{"version":3,"sources":["webpack:///./src/components/Calendar/ModalEditCalendarItem.vue","webpack:///src/components/Calendar/ModalEditCalendarItem.vue","webpack:///./src/components/Calendar/ModalEditCalendarItem.vue?35e9","webpack:///./src/components/Calendar/ModalEditCalendarItem.vue?d685","webpack:///./src/components/Calendar/ModalEditCalendarItem.vue?deb8"],"names":["render","_vm","this","_c","_self","attrs","$t","isSaving","isSavingSuccess","isSavingError","preventSave","mCalendarItem","Name","onClickCancel","save","showModal","on","scopedSlots","_u","key","fn","staticClass","nameValidation","$event","$v","$touch","model","value","callback","$$v","$set","expression","default","sm","formatDates","dateRange","IsWholeDay","_e","domProps","_s","directives","name","rawName","StartMinutes","$$selectedVal","Array","prototype","filter","call","target","options","o","selected","map","val","_value","multiple","_l","timeslots","slot","_v","_f","EndMinutes","proxy","Description","errorMessage","staticRenderFns","components","Message","BaseCheckbox","BaseFieldTemplate","props","type","Boolean","Function","required","calendarItem","Object","data","start","StartDate","Date","end","EndDate","openinghours","MinMinutes","MaxMinutes","computed","slots","min","max","minutes","i","push","result","length","errors","$dirty","fieldLabel","descriptionValidation","validations","created","JSON","parse","stringify","methods","formattedDates","$options","filters","dateFormat","$i18n","locale","getLocationOpeninghours","_this","_asyncToGenerator","_regenerator","m","_callee","w","_context","n","openinghoursProvider","getOpeningHours","LocationId","then","response","status","a","_this2","self","startDate","endDate","parseIsoDateStringToDate","format","calendarProvider","updateCalendarItem","setTimeout","EventBus","$emit","catch","error","finally","component"],"mappings":"sMAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,qBAAqB,CAACE,MAAM,CAAC,WAAaJ,EAAIK,GAAG,wDAAwD,SAAWL,EAAIM,SAAS,gBAAkBN,EAAIO,gBAAgB,cAAgBP,EAAIQ,cAAc,kBAAoBR,EAAIS,aAA2C,KAA5BR,KAAKS,cAAcC,KAAY,kBAAoBX,EAAIQ,eAAiBR,EAAIO,gBAAgB,cAAgBP,EA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AAA,SAAAC,GACA,MAAAA,EAAAC,SACAG,EAAAzH,iBAAA,EAEAgI,YAAA,WACAR,EAAAnH,kBACA,MAEA4H,OAAAC,MAAA,sBAAAb,EAAA/C,UAGA6D,OAAA,SAAAC,GACAX,EAAAxH,eAAA,KAEAoI,SAAA,WACAZ,EAAA1H,UAAA,SCvV6W,I,wBCQzWuI,EAAY,eACd,EACA9I,EACAkE,GACA,EACA,KACA,KACA,MAIa,aAAA4E,E,2CCnBf","file":"js/chunk-41ea621e.js?id=fd0afb9314a15ba3cc1f","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return _c('ui-component-modal',{attrs:{\"modalTitle\":_vm.$t(`Components.Calendar.ModalEditCalendarItem.Main_Title`),\"isSaving\":_vm.isSaving,\"isSavingSuccess\":_vm.isSavingSuccess,\"isSavingError\":_vm.isSavingError,\"disableSaveButton\":_vm.preventSave || this.mCalendarItem.Name === '',\"hideFooterButtons\":_vm.isSavingError || _vm.isSavingSuccess,\"onClickCancel\":_vm.onClickCancel,\"onClickSave\":_vm.save,\"showModal\":_vm.showModal},on:{\"closeModal\":_vm.onClickCancel},scopedSlots:_vm._u([{key:\"content\",fn:function(){return [_c('table',{staticClass:\"table is-fullwidth is-striped\"},[_c('tbody',[_c('tr',[_c('td',[_c('ui-base-input-field',{attrs:{\"label\":_vm.$t('Components.Calendar.ModalEditCalendarItem.Label_Name'),\"fieldType\":\"text\",\"required\":true,\"error\":_vm.nameValidation},on:{\"input\":function($event){return _vm.$v.mCalendarItem.Name.$touch()},\"blur\":function($event){return _vm.$v.mCalendarItem.Name.$touch()}},model:{value:(_vm.mCalendarItem.Name),callback:function ($$v) {_vm.$set(_vm.mCalendarItem, \"Name\", $$v)},expression:\"mCalendarItem.Name\"}})],1)]),_c('tr',[_c('td',[_c('BaseFieldTemplate',{attrs:{\"label\":_vm.$t('Components.Calendar.ModalCreateCalendarItem.Label_Period')},scopedSlots:_vm._u([{key:\"fields\",fn:function(){return [_c('div',[_c('ui-base-date-field',{attrs:{\"labelForInput\":true,\"openCalendarInModal\":true,\"isRange\":true,\"screens\":{ default: 1, sm: 2 }},on:{\"updateDates\":_vm.formatDates},model:{value:(_vm.dateRange),callback:function ($$v) {_vm.dateRange=$$v},expression:\"dateRange\"}})],1),_c('div',[_c('div',{staticClass:\"columns-period\"},[_c('div',{staticClass:\"column\"},[_c('BaseCheckbox',{staticClass:\"checkbox-wholeDay has-text-left\",attrs:{\"cssClassLabel\":'has-text-weight-bold',\"label\":_vm.$t('Components.Calendar.ModalCreateCalendarItem.Label_WholeDay')},model:{value:(_vm.mCalendarItem.IsWholeDay),callback:function ($$v) {_vm.$set(_vm.mCalendarItem, \"IsWholeDay\", $$v)},expression:\"mCalendarItem.IsWholeDay\"}})],1),(!_vm.mCalendarItem.IsWholeDay)?_c('div',{staticClass:\"column\"},[_c('span',{staticClass:\"has-text-weight-bold\",domProps:{\"textContent\":_vm._s(_vm.$t('Components.Calendar.ModalCreateCalendarItem.Label_Start'))}}),_c('div',{staticClass:\"select\"},[_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.mCalendarItem.StartMinutes),expression:\"mCalendarItem.StartMinutes\"}],on:{\"change\":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.$set(_vm.mCalendarItem, \"StartMinutes\", $event.target.multiple ? $$selectedVal : $$selectedVal[0])}}},_vm._l((_vm.timeslots),function(slot){return _c('option',{key:slot,attrs:{\"slected\":_vm.mCalendarItem.StartMinutes === slot},domProps:{\"value\":slot}},[_vm._v(_vm._s(_vm._f(\"minutesToTime\")(slot))+\" \")])}),0)])]):_vm._e(),(!_vm.mCalendarItem.IsWholeDay)?_c('div',{staticClass:\"column\"},[_c('span',{staticClass:\"has-text-weight-bold\",domProps:{\"textContent\":_vm._s(_vm.$t('Components.Calendar.ModalCreateCalendarItem.Label_End'))}}),_c('div',{staticClass:\"select\"},[_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.mCalendarItem.EndMinutes),expression:\"mCalendarItem.EndMinutes\"}],on:{\"change\":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.$set(_vm.mCalendarItem, \"EndMinutes\", $event.target.multiple ? $$selectedVal : $$selectedVal[0])}}},_vm._l((_vm.timeslots),function(slot){return _c('option',{key:slot,attrs:{\"slected\":_vm.mCalendarItem.EndMinutes === slot},domProps:{\"value\":slot}},[_vm._v(_vm._s(_vm._f(\"minutesToTime\")(slot))+\" \")])}),0)])]):_vm._e()])])]},proxy:true}])})],1)]),_c('tr',[_c('td',[_c('ui-textarea',{attrs:{\"label\":_vm.$t(\n                  'Components.Calendar.ModalEditCalendarItem.Label_Description'\n                ),\"maxLength\":2000},on:{\"input\":function($event){return _vm.$v.mCalendarItem.Description.$touch()},\"blur\":function($event){return _vm.$v.mCalendarItem.Description.$touch()}},model:{value:(_vm.mCalendarItem.Description),callback:function ($$v) {_vm.$set(_vm.mCalendarItem, \"Description\", $$v)},expression:\"mCalendarItem.Description\"}})],1)]),_c('tr',[(_vm.errorMessage)?_c('message',{staticClass:\"is-warning is-fullwidth\",attrs:{\"message\":_vm.errorMessage}}):_vm._e()],1)])])]},proxy:true}])},[_c('template',{slot:\"modalTitle\"})],2)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n  <ui-component-modal\n    :modalTitle=\"$t(`Components.Calendar.ModalEditCalendarItem.Main_Title`)\"\n    :isSaving=\"isSaving\"\n    :isSavingSuccess=\"isSavingSuccess\"\n    :isSavingError=\"isSavingError\"\n    :disableSaveButton=\"preventSave || this.mCalendarItem.Name === ''\"\n    :hideFooterButtons=\"isSavingError || isSavingSuccess\"\n    :onClickCancel=\"onClickCancel\"\n    :onClickSave=\"save\"\n    :showModal=\"showModal\"\n    @closeModal=\"onClickCancel\"\n  >\n    <template slot=\"modalTitle\"></template>\n    <template v-slot:content>\n      <table class=\"table is-fullwidth is-striped\">\n        <tbody>\n          <tr>\n            <td>\n              <ui-base-input-field\n                :label=\"\n                  $t('Components.Calendar.ModalEditCalendarItem.Label_Name')\n                \"\n                v-model=\"mCalendarItem.Name\"\n                fieldType=\"text\"\n                :required=\"true\"\n                :error=\"nameValidation\"\n                @input=\"$v.mCalendarItem.Name.$touch()\"\n                @blur=\"$v.mCalendarItem.Name.$touch()\"\n              />\n            </td>\n          </tr>\n\n          <tr>\n            <td>\n              <BaseFieldTemplate :label=\"\n                  $t('Components.Calendar.ModalCreateCalendarItem.Label_Period')\n                \">\n                <template v-slot:fields>\n                  <div>\n                    <ui-base-date-field\n                      v-model=\"dateRange\"\n                      :labelForInput=\"true\"\n                      :openCalendarInModal=\"true\"\n                      :isRange=\"true\"\n                      @updateDates=\"formatDates\"\n                      :screens=\"{ default: 1, sm: 2 }\"\n                    />\n                  </div>\n                  <div>\n                    <div class=\"columns-period\">\n                      <div class=\"column\">\n                        <BaseCheckbox\n                          v-model=\"mCalendarItem.IsWholeDay\"\n                          :cssClassLabel=\"'has-text-weight-bold'\"\n                          class=\"checkbox-wholeDay has-text-left\"\n                          :label=\"$t('Components.Calendar.ModalCreateCalendarItem.Label_WholeDay')\"\n                        />\n                      </div>\n                      <div\n                        v-if=\"!mCalendarItem.IsWholeDay\"\n                        class=\"column\"\n                      >\n                        <span\n                          class=\"has-text-weight-bold\"\n                          v-text=\"$t('Components.Calendar.ModalCreateCalendarItem.Label_Start')\"\n                        ></span>\n                        <div class=\"select\">\n                          <select v-model=\"mCalendarItem.StartMinutes\">\n                            <option\n                              v-for=\"slot in timeslots\"\n                              :key=\"slot\"\n                              :value=\"slot\"\n                              :slected=\"mCalendarItem.StartMinutes === slot\"\n                            >{{ slot | minutesToTime }}\n                            </option>\n                          </select>\n                        </div>\n                      </div>\n                      <div\n                        v-if=\"!mCalendarItem.IsWholeDay\"\n                        class=\"column\"\n                      >\n                        <span\n                          class=\"has-text-weight-bold\"\n                          v-text=\"$t('Components.Calendar.ModalCreateCalendarItem.Label_End')\"\n                        ></span>\n                        <div class=\"select\">\n                          <select v-model=\"mCalendarItem.EndMinutes\">\n                            <option\n                              v-for=\"slot in timeslots\"\n                              :key=\"slot\"\n                              :value=\"slot\"\n                              :slected=\"mCalendarItem.EndMinutes === slot\"\n                            >{{ slot | minutesToTime }}\n                            </option>\n                          </select>\n                        </div>\n                      </div>\n                    </div>\n                  </div>\n                </template>\n              </BaseFieldTemplate>\n            </td>\n          </tr>\n\n          <tr>\n            <td>\n              <ui-textarea\n                :label=\"\n                  $t(\n                    'Components.Calendar.ModalEditCalendarItem.Label_Description'\n                  )\n                \"\n                v-model=\"mCalendarItem.Description\"\n                :maxLength=\"2000\"\n                @input=\"$v.mCalendarItem.Description.$touch()\"\n                @blur=\"$v.mCalendarItem.Description.$touch()\"\n              />\n            </td>\n          </tr>\n          <tr>\n            <message\n              v-if=\"errorMessage\"\n              :message=\"errorMessage\"\n              class=\"is-warning is-fullwidth\"\n            />\n          </tr>\n        </tbody>\n      </table>\n    </template>\n  </ui-component-modal>\n</template>\n\n<script>\nimport { EventBus } from '@/eventbus/event-bus'\nimport calendarProvider from '@/providers/calendar'\nimport openinghoursProvider from '@/providers/openinghours'\nimport { required } from 'vuelidate/lib/validators'\nimport { format } from 'date-fns'\n\nexport default {\n  components: {\n    Message: () => import(/* webpackChunkName: \"modal-edit-calandar-item\" */ '@/components/UI/Message'),\n    BaseCheckbox: () => import(/* webpackChunkName: \"modal-edit-calandar-item\" */ '@/components/UI/Form/BaseCheckbox'),\n    BaseFieldTemplate: () => import(/* webpackChunkName: \"modal-edit-calandar-item\" */ '@/components/UI/Form/BaseFieldTemplate')\n  },\n\n  props: {\n    showModal: {\n      type: Boolean,\n      default: false,\n    },\n\n    onClickCancel: {\n      type: Function,\n      required: true,\n    },\n\n    calendarItem: {\n      type: Object,\n      default: null,\n    },\n  },\n\n  data() {\n    return {\n      isSaving: false,\n      isSavingSuccess: false,\n      isSavingError: false,\n      mCalendarItem: null,\n      dateRange: {\n        start: this.calendarItem.StartDate\n          ? this.calendarItem.StartDate\n          : new Date(),\n        end: this.calendarItem.EndDate ? this.calendarItem.EndDate : new Date(),\n      },\n      openinghours: {\n        MinMinutes: 460,\n        MaxMinutes: 1120,\n      },\n    }\n  },\n\n  computed: {\n    timeslots() {\n      let slots = []\n\n      let min = 0\n      let max = 1440\n      let minutes = 15\n\n      let i = min\n      while (i <= max) {\n        slots.push(i)\n        i = i + minutes\n      }\n      return slots\n    },\n\n    preventSave() {\n      let result = true\n\n      if (this.errorMessage === '' && !this.nameValidation.length) {\n        result = false\n      }\n      return result\n    },\n\n    errorMessage() {\n\n      return ''\n    },\n\n    nameValidation() {\n      let errors = []\n\n      if (!this.$v.mCalendarItem.Name.$dirty) {\n        return errors\n      } else if (!this.$v.mCalendarItem.Name.required) {\n        errors.push(\n          this.$t('Form.InputErrors.RequiredField', {\n            fieldLabel: this.$t(\n              'Components.Calendar.ModalEditCalendarItem.Label_Name'\n            ),\n          })\n        )\n      }\n      return errors\n    },\n\n    descriptionValidation() {\n      let errors = []\n\n      if (this.$v.mCalendarItem.Description) {\n        if (!this.$v.mCalendarItem.Description.$dirty) {\n          return errors\n        } else if (!this.$v.mCalendarItem.Description.required) {\n          errors.push(\n            this.$t('Form.InputErrors.RequiredField', {\n              fieldLabel: this.$t(\n                'Components.Calendar.ModalEditCalendarItem.Label_Description'\n              ),\n            })\n          )\n        }\n      }\n      return errors\n    },\n  },\n\n  /**\n   * Form validation rules\n   */\n  validations: {\n    mCalendarItem: {\n      Name: {\n        required,\n      },\n      Description: {\n        required,\n      },\n    },\n  },\n\n  created() {\n    if (this.calendarItem) {\n      this.mCalendarItem = JSON.parse(JSON.stringify(this.calendarItem))\n    }\n  },\n\n  methods: {\n    /**\n     * Format date to text\n     */\n    formatDates(value) {\n      let formattedDates = ''\n      formattedDates = this.$options.filters.dateFormat(\n        value.start,\n        this.$i18n.locale,\n        'shortDateFormat'\n      )\n      formattedDates +=\n        '  -  ' +\n        this.$options.filters.dateFormat(\n          value.end,\n          this.$i18n.locale,\n          'shortDateFormat'\n        )\n      return formattedDates\n    },\n\n    async getLocationOpeninghours() {\n      await openinghoursProvider.methods\n        .getOpeningHours(\n          this.calendarItem.StartDate,\n          0,\n          this.calendarItem.LocationId,\n          0\n        )\n        .then((response) => {\n          if (response.status === 200) {\n            this.openinghours = response.data\n          }\n        })\n    },\n\n    save() {\n      let self = this\n\n      if (self.isSaving) { return }\n        self.isSaving = true\n\n      let startDate = self.dateRange.start\n      let endDate = self.dateRange.end\n      // If dates include time component, preserve it\n      if (typeof this.dateRange.start === 'string') {\n        startDate = this.$options.filters.parseIsoDateStringToDate(this.dateRange.start);\n      }\n      if (typeof this.dateRange.end === 'string') {\n        endDate = this.$options.filters.parseIsoDateStringToDate(this.dateRange.end);\n      }\n\n        self.mCalendarItem.StartDate = format(startDate, 'yyyy-MM-dd');\n        self.mCalendarItem.EndDate = format(endDate, 'yyyy-MM-dd');\n\n        calendarProvider.methods\n          .updateCalendarItem(self.mCalendarItem)\n          .then((response) => {\n            if (response.status === 200) {\n              self.isSavingSuccess = true\n\n              setTimeout(() => {\n                this.onClickCancel()\n              }, 1500)\n\n              EventBus.$emit('CalenderItemUpdated', response.data)\n            }\n          })\n          .catch((error) => {\n            self.isSavingError = true\n          })\n          .finally(() => {\n            self.isSaving = false\n          })\n    },\n  },\n}\n</script>\n\n<style lang=\"scss\">\n.columns-period {\n  display: flex;\n  align-items: center;\n  .column {\n    display: inline-flex;\n    padding: 10px 10px 5px 10px;\n    align-items: center;\n    min-height: 47px;\n\n    span {\n      margin-right: 5px;\n    }\n  }\n}\n</style>\n","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!./ModalEditCalendarItem.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!./ModalEditCalendarItem.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./ModalEditCalendarItem.vue?vue&type=template&id=69d44005\"\nimport script from \"./ModalEditCalendarItem.vue?vue&type=script&lang=js\"\nexport * from \"./ModalEditCalendarItem.vue?vue&type=script&lang=js\"\nimport style0 from \"./ModalEditCalendarItem.vue?vue&type=style&index=0&id=69d44005&prod&lang=scss\"\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","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModalEditCalendarItem.vue?vue&type=style&index=0&id=69d44005&prod&lang=scss\""],"sourceRoot":""}