{"version":3,"sources":["webpack:///./src/eventbus/event-bus.js","webpack:///./src/components/ExternalMappings/LocationMapExternal.vue","webpack:///src/components/ExternalMappings/LocationMapExternal.vue","webpack:///./src/components/ExternalMappings/LocationMapExternal.vue?adfd","webpack:///./src/components/ExternalMappings/LocationMapExternal.vue?0389"],"names":["EventBus","Vue","render","_vm","this","_c","_self","isSaving","_e","staticClass","attrs","_v","_s","$t","directives","name","rawName","value","newLocationMapping","Code","expression","domProps","on","$event","type","indexOf","keyCode","saveExternalMappings","apply","arguments","target","composing","$set","staticRenderFns","components","props","externalSource","String","default","data","locationId","Number","$route","params","computed","created","Id","ItemId","ItemName","Key","LocationId","Source","SourceName","Type","TypeName","methods","_objectSpread","mapActions","mapMutations","_this","_asyncToGenerator","_regenerator","m","_callee","mappings","w","_context","p","n","a","push","externalMappingProvider","saveLocationMappedItems","mExternalSource","refreshLocationState","$emit","message","v","f","component"],"mappings":"oJAAA,kDACaA,EAAW,IAAIC,aAEbD,U,yCCHf,IAAIE,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAASF,EAAII,SAAitCJ,EAAIK,KAA3sCH,EAAG,MAAM,CAACA,EAAG,MAAM,CAACI,YAAY,WAAW,CAACJ,EAAG,MAAM,CAACI,YAAY,kBAAkB,CAACJ,EAAG,MAAM,CAACI,YAAY,SAAS,CAACJ,EAAG,QAAQ,CAACI,YAAY,QAAQC,MAAM,CAAC,IAAM,sBAAsB,CAACP,EAAIQ,GAAGR,EAAIS,GAAGT,EAAIU,GAAG,2FAA2FR,EAAG,MAAM,CAACI,YAAY,WAAW,CAACJ,EAAG,QAAQ,CAACS,WAAW,CAAC,CAACC,KAAK,QAAQC,QAAQ,UAAUC,MAAOd,EAAIe,mBAAmBC,KAAMC,WAAW,4BAA4BX,YAAY,QAAQC,MAAM,CAAC,GAAK,oBAAoB,UAAYP,EAAII,SAAS,YAAcJ,EAAIU,GAAG,8FAA8FQ,SAAS,CAAC,MAASl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,EAAApD,UAAA,EAAA2D,EAAAC,EAAA,EAAAD,EAAAE,EAAA,EAEAG,OAAAhB,QAAAiB,wBAAAb,EAAAnB,WAAAwB,GAAA,OACAL,EAAAK,SAAA,GACAL,EAAAc,gBAAA,OAEAd,EAAAe,uBAEAf,EAAAgB,MAAA,iBAEA3E,OAAA2E,MAAA,aACAnD,KAAA,OACAoD,QAAAjB,EAAA9C,GAAA,yEACAqD,EAAAE,EAAA,eAAAF,EAAAC,EAAA,EAAAD,EAAAW,EAAA,OAGA,OAHAX,EAAAC,EAAA,EAGAR,EAAApD,UAAA,EAAA2D,EAAAY,EAAA,iBAAAZ,EAAAG,EAAA,MAAAN,EAAA,qBAtBAH,OC/E2W,I,YCOvWmB,EAAY,eACd,EACA7E,EACA+B,GACA,EACA,KACA,KACA,MAIa,aAAA8C,E","file":"js/chunk-4703a9b7.js?id=72b3ef22559fbf8ed3f5","sourcesContent":["import Vue from 'vue'\nexport const EventBus = new Vue()\n\nexport default EventBus\n","var render = function render(){var _vm=this,_c=_vm._self._c;return (!_vm.isSaving)?_c('div',[_c('div',{staticClass:\"columns\"},[_c('div',{staticClass:\"column is-half\"},[_c('div',{staticClass:\"field\"},[_c('label',{staticClass:\"label\",attrs:{\"for\":\"externalCodeInput\"}},[_vm._v(_vm._s(_vm.$t('Components.Settings.ExternalMappings.LocationMapExternal.Label_LocationExternalCode')))]),_c('div',{staticClass:\"control\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.newLocationMapping.Code),expression:\"newLocationMapping.Code\"}],staticClass:\"input\",attrs:{\"id\":\"externalCodeInput\",\"disableld\":_vm.isSaving,\"placeholder\":_vm.$t('Components.Settings.ExternalMappings.LocationMapExternal.PlaceHolder_LocationExternalCode')},domProps:{\"value\":(_vm.newLocationMapping.Code)},on:{\"keyup\":function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==13)return null;return _vm.saveExternalMappings.apply(null, arguments)},\"input\":function($event){if($event.target.composing)return;_vm.$set(_vm.newLocationMapping, \"Code\", $event.target.value)}}})])]),_c('div',{staticClass:\"is-pulled-right\"},[_c('a',{staticClass:\"button is-primary\",attrs:{\"disableld\":_vm.isSaving},on:{\"click\":_vm.saveExternalMappings}},[_vm._v(_vm._s(_vm.$t('Form.Control.Save')))])])]),_c('div',{staticClass:\"column\"})])]):_vm._e()\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n  <div v-if=\"!isSaving\">\n    <div class=\"columns\">\n      <div class=\"column is-half\">\n        <div class=\"field\">\n          <label\n            for=\"externalCodeInput\"\n            class=\"label\"\n          >{{ $t('Components.Settings.ExternalMappings.LocationMapExternal.Label_LocationExternalCode') }}</label>\n          <div class=\"control\">\n            <input\n              id=\"externalCodeInput\"\n              v-model=\"newLocationMapping.Code\"\n              v-on:keyup.13=\"saveExternalMappings\"\n              :disableld=\"isSaving\"\n              :placeholder=\"$t('Components.Settings.ExternalMappings.LocationMapExternal.PlaceHolder_LocationExternalCode')\"\n              class=\"input\"\n            />\n          </div>\n        </div>\n\n        <div class=\"is-pulled-right\">\n          <a\n            @click=\"saveExternalMappings\"\n            class=\"button is-primary\"\n            :disableld=\"isSaving\"\n          >{{ $t('Form.Control.Save') }}</a>\n        </div>\n      </div>\n      <div class=\"column\"></div>\n    </div>\n\n  </div>\n</template>\n\n<script>\nimport { mapActions, mapMutations } from 'vuex'\nimport externalMappingProvider from '@/providers/externalmapping';\nimport EventBus from '@/eventbus/event-bus';\n\nexport default {\n  components: {},\n\n  props: {\n    externalSource: {\n      type: String,\n      default: ''\n    },\n  },\n\n  data() {\n    return {\n      isSaving: false,\n      locationId: Number(this.$route.params.locationId),\n      newLocationMapping: null\n    }\n  },\n\n  computed: {},\n\n  created() {\n    this.newLocationMapping = {\n      Code: '',\n      Id: 0,\n      ItemId: this.locationId,\n      ItemName: '',\n      Key: '',\n      LocationId: this.locationId,\n      Source: this.externalSource,\n      SourceName: this.externalSource,\n      Type: \"Location\",\n      TypeName: \"Location\",\n    }\n  },\n\n  methods: {\n    ...mapActions('locationStore', ['refreshLocationState']),\n    ...mapMutations('locationStore', ['setLocationState']),\n\n    async saveExternalMappings() {\n      if (this.isSaving || !this.newLocationMapping.Code) { return }\n\n      let mappings = [];\n      mappings.push(this.newLocationMapping)\n\n      this.isSaving = true\n      try {\n        await externalMappingProvider.methods.saveLocationMappedItems(this.locationId, mappings)\n        this.mappings = []\n        this.mExternalSource = 'None'\n\n        this.refreshLocationState();\n\n        this.$emit('mappingsSaved')\n\n        EventBus.$emit('showToast', {\n          type: 'info',\n          message: this.$t('Views.Settings.ExternalMappings.SpaceMapExternal.Message_SetupSaved'),\n        })\n      } catch { }\n      finally {\n        this.isSaving = false\n      }\n\n    },\n  }\n}\n</script>\n\n<style></style>","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./LocationMapExternal.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./LocationMapExternal.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./LocationMapExternal.vue?vue&type=template&id=40eaf560\"\nimport script from \"./LocationMapExternal.vue?vue&type=script&lang=js\"\nexport * from \"./LocationMapExternal.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\nexport default component.exports"],"sourceRoot":""}