{"version":3,"sources":["webpack:///./src/eventbus/event-bus.js","webpack:///./src/components/ToDos/ModalDeleteToDo.vue","webpack:///src/components/ToDos/ModalDeleteToDo.vue","webpack:///./src/components/ToDos/ModalDeleteToDo.vue?ab5d","webpack:///./src/components/ToDos/ModalDeleteToDo.vue?9875"],"names":["EventBus","Vue","render","_vm","this","_c","_self","attrs","$t","isDeleting","isDeletingSuccess","isDeletingError","onClickCancel","deleteToDo","showModal","isDeleteConfirmed","on","scopedSlots","_u","key","fn","_v","_s","staticClass","model","value","callback","$$v","expression","proxy","slot","staticRenderFns","BaseCheckbox","components","props","type","Boolean","default","Function","required","todo","Object","data","mToDo","methods","_this","self","todoProvider","Id","then","response","status","$emit","message","catch","error","finally","component"],"mappings":"oJAAA,kDACaA,EAAW,IAAIC,aAEbD,U,2CCHf,IAAIE,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,qBAAqB,CAACE,MAAM,CAAC,WAAaJ,EAAIK,GAAG,+CAA+C,sBAAwB,YAAY,SAAWL,EAAIM,WAAW,gBAAkBN,EAAIO,kBAAkB,cAAgBP,EAAIQ,gBAAgB,cAAgBR,EAAIS,cAAc,YAAcT,EAAIU,WAAW,UAAYV,EAAIW,UAAU,mBAAqBX,EAAIY,mBAAqBZ,EAAIM,WAAW,kBAAoBN,EAAIQ,iBAAmBR,EAAIO,kBAAkB,mBAAqBP,EAAIK,GAAG,uBAAuB,qBAAuBL,EAAIK,GAAG,0DAA0D,mBAAqBL,EAAIK,GAAG,yDAAyDQ,GAAG,CAAC,WAAab,EAAIS,eAAeK,YAAYd,EAAIe,GAAG,CAAC,CAACC,IAAI,UAAUC,GAAG,WAAW,MAAO,CAACf,EAAG,MAAM,CAACF,EAAIkB,GAAGlB,EAAImB,GAAGnB,EAAIK,GAAG,oDAAoDH,EAAG,MAAM,CAACkB,YAAY,qBAAqB,CAAClB,EAAG,eAAe,CAACkB,YAAY,gBAAgBhB,MAAM,CAAC,MAAQJ,EAAIK,GAAG,kDAAkDgB,MAAM,CAACC,MAAOtB,EAAIY,kBAAmBW,SAAS,SAAUC,GAAMxB,EAAIY,kBAAkBY,GAAKC,WAAW,wBAAwB,KAAKC,OAAM,MAAS,CAACxB,EAAG,WAAW,CAACyB,KAAK,gBAAgB,IAE3uCC,EAAkB,G,wDCqCtBC,EAAA,kBACA,8GAIe,GACfC,WAAA,CACAD,gBAGAE,MAAA,CACApB,UAAA,CACAqB,KAAAC,QACAC,SAAA,GAEAzB,cAAA,CACAuB,KAAAG,SACAC,UAAA,GAEAC,KAAA,CACAL,KAAAM,OACAJ,QAAA,OAIAK,KAAA,WACA,OACA3B,mBAAA,EACAJ,iBAAA,EACAD,mBAAA,EACAD,YAAA,EACAkC,MAAA,KAAAH,OAIAI,QAAA,CACA/B,WAAA,eAAAgC,EAAA,KACAC,EAAA,KACAA,EAAArC,YAAA,EAEAsC,OAAAH,QACA/B,WAAAiC,EAAAH,MAAAK,IACAC,MAAA,SAAAC,GACA,MAAAA,EAAAC,SACAL,EAAAM,MAAA,cAAAN,EAAAH,OAGA3C,OAAAoD,MAAA,aACAjB,KAAA,OACAkB,QAAAR,EAAArC,GAAA,4DAGAqC,EAAAjC,oBAGA0C,OAAA,SAAAC,GACAT,EAAAnC,iBAAA,KAEA6C,SAAA,WACAV,EAAArC,YAAA,QClGuW,I,YCOnWgD,EAAY,eACd,EACAvD,EACA6B,GACA,EACA,KACA,KACA,MAIa,aAAA0B,E","file":"js/chunk-3d7d7d97.js?id=aec0a8e2256ee5131ace","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 _c('ui-component-modal',{attrs:{\"modalTitle\":_vm.$t('Components.ToDos.ModalDeleteToDo.Main_Title'),\"confirmButtonCssClass\":\"is-danger\",\"isSaving\":_vm.isDeleting,\"isSavingSuccess\":_vm.isDeletingSuccess,\"isSavingError\":_vm.isDeletingError,\"onClickCancel\":_vm.onClickCancel,\"onClickSave\":_vm.deleteToDo,\"showModal\":_vm.showModal,\"disableSaveButton\":!_vm.isDeleteConfirmed || _vm.isDeleting,\"hideFooterButtons\":_vm.isDeletingError || _vm.isDeletingSuccess,\"buttonLabelConfirm\":_vm.$t('Form.Control.Delete'),\"savingSuccessMessage\":_vm.$t('Components.ToDos.ModalDeleteToDo.Message_SavingSuccess'),\"savingErrorMessage\":_vm.$t('Components.ToDos.ModalDeleteToDo.Message_SavingError')},on:{\"closeModal\":_vm.onClickCancel},scopedSlots:_vm._u([{key:\"content\",fn:function(){return [_c('div',[_vm._v(_vm._s(_vm.$t('Components.ToDos.ModalDeleteToDo.Text_Delete')))]),_c('div',{staticClass:\"has-text-centered\"},[_c('BaseCheckbox',{staticClass:\"has-text-left\",attrs:{\"label\":_vm.$t('Components.ToDos.ModalDeleteToDo.Text_YesSure')},model:{value:(_vm.isDeleteConfirmed),callback:function ($$v) {_vm.isDeleteConfirmed=$$v},expression:\"isDeleteConfirmed\"}})],1)]},proxy:true}])},[_c('template',{slot:\"modalTitle\"})],2)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n  <ui-component-modal\n    :modalTitle=\"$t('Components.ToDos.ModalDeleteToDo.Main_Title')\"\n    confirmButtonCssClass=\"is-danger\"\n    :isSaving=\"isDeleting\"\n    :isSavingSuccess=\"isDeletingSuccess\"\n    :isSavingError=\"isDeletingError\"\n    :onClickCancel=\"onClickCancel\"\n    :onClickSave=\"deleteToDo\"\n    :showModal=\"showModal\"\n    :disableSaveButton=\"!isDeleteConfirmed || isDeleting\"\n    :hideFooterButtons=\"isDeletingError || isDeletingSuccess\"\n    :buttonLabelConfirm=\"$t('Form.Control.Delete')\"\n    :savingSuccessMessage=\"\n      $t('Components.ToDos.ModalDeleteToDo.Message_SavingSuccess')\n    \"\n    :savingErrorMessage=\"\n      $t('Components.ToDos.ModalDeleteToDo.Message_SavingError')\n    \"\n    @closeModal=\"onClickCancel\"\n  >\n    <template slot=\"modalTitle\"></template>\n    <template v-slot:content>\n      <div>{{ $t('Components.ToDos.ModalDeleteToDo.Text_Delete') }}</div>\n      <div class=\"has-text-centered\">\n        <BaseCheckbox\n          v-model=\"isDeleteConfirmed\"\n          class=\"has-text-left\"\n          :label=\"$t('Components.ToDos.ModalDeleteToDo.Text_YesSure')\"\n        />\n      </div>\n    </template>\n  </ui-component-modal>\n</template>\n\n<script>\nimport todoProvider from '@/providers/todo'\nimport EventBus from '@/eventbus/event-bus'\n\nconst BaseCheckbox = () =>\n  import(\n    /* webpackChunkName: \"settings-options\" */ '@/components/UI/Form/BaseCheckbox'\n  )\n\nexport default {\n  components: {\n    BaseCheckbox,\n  },\n\n  props: {\n    showModal: {\n      type: Boolean,\n      default: false,\n    },\n    onClickCancel: {\n      type: Function,\n      required: true,\n    },\n    todo: {\n      type: Object,\n      default: null,\n    },\n  },\n\n  data() {\n    return {\n      isDeleteConfirmed: false,\n      isDeletingError: false,\n      isDeletingSuccess: false,\n      isDeleting: false,\n      mToDo: this.todo,\n    }\n  },\n\n  methods: {\n    deleteToDo() {\n      let self = this\n      self.isDeleting = true\n\n      todoProvider.methods\n        .deleteToDo(self.mToDo.Id)\n        .then((response) => {\n          if (response.status === 204) {\n            self.$emit('todoDeleted', self.mToDo)\n\n            // Send message to be shown as toast on page\n            EventBus.$emit('showToast', {\n              type: 'info',\n              message: this.$t('Components.ToDos.ModalDeleteToDo.Message_SavingSuccess'),\n            })\n\n            this.onClickCancel();\n          }\n        })\n        .catch((error) => {\n          self.isDeletingError = true\n        })\n        .finally(() => {\n          self.isDeleting = false\n        })\n    },\n  },\n}\n</script>\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!./ModalDeleteToDo.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!./ModalDeleteToDo.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./ModalDeleteToDo.vue?vue&type=template&id=5e99cfbe\"\nimport script from \"./ModalDeleteToDo.vue?vue&type=script&lang=js\"\nexport * from \"./ModalDeleteToDo.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":""}