{"version":3,"sources":["webpack:///./src/views/news/components/ArticleActions.vue?76d1","webpack:///./src/views/news/components/ArticleActions.vue","webpack:///./src/views/news/components/ArticleActions.vue?890f","webpack:///./src/views/news/components/ArticleActions.vue?c9d6","webpack:///../../../src/components/VTextarea/VTextarea.ts"],"names":["render","_vm","this","_h","$createElement","_c","_self","VMenu","attrs","scopedSlots","_u","key","fn","ref","on","VBtn","_g","VIcon","_v","VList","VListItem","editArticleLoading","$event","editDialog","staticClass","_s","$t","deleteArticleLoading","deleteDialog","VDialog","model","value","callback","$$v","expression","VCard","currentlyBeingEdited","staticStyle","VForm","preventDefault","editArticle","VTextField","textRules","newTitle","VTextarea","newBody","_e","currentlyBeingDeleted","VSpacer","deleteArticle","staticRenderFns","ArticleActions","v","trim","length","editedArticleID","article","ID","data","articleId","editArticleAction","Title","Body","deletedArticleID","deleteArticleAction","$router","replace","push","Vue","__decorate","Prop","default","Article","Getter","Action","Function","Watch","Component","component","baseMixins","mixins","extend","name","props","autoGrow","Boolean","noResize","rowHeight","type","Number","String","validator","isNaN","parseFloat","rows","parseInt","computed","classes","noResizeHandle","options","call","watch","val","$nextTick","calculateInputHeight","$refs","input","_a","style","removeProperty","lazyValue","mounted","setTimeout","methods","height","scrollHeight","minHeight","Math","max","genInput","tag","onInput","e","onKeyDown","isFocused","keyCode","stopPropagation","$emit"],"mappings":"oTAgBIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACA,EAAGE,EAAA,KAAM,CAACC,MAAM,CAAC,WAAW,GAAG,KAAO,IAAIC,YAAYR,EAAIS,GAAG,CAAC,CAACC,IAAI,YAAYC,GAAG,SAASC,GACrM,IAAIC,EAAKD,EAAIC,GACb,MAAO,CAACT,EAAGU,EAAA,KAAKd,EAAIe,GAAG,CAACR,MAAM,CAAC,KAAO,KAAKM,GAAI,CAACT,EAAGY,EAAA,KAAM,CA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AKlG,QAGhDgG,eAAc,WACZ,OAAOhG,KAAKoF,UAAYpF,KAAKkF,WAIjCiB,MAAO,CACLjB,SAAQ,SAAEkB,GAAY,WACpBpG,KAAKqG,WAAU,W,MACbD,EACI,EAAKE,uBACW,QAAhB,IAAKC,MAAMC,aAAKC,SAAEC,MAAMC,eAAe,cAG/CC,UAAS,WACP5G,KAAKkF,UAAYlF,KAAKqG,UAAUrG,KAAKsG,uBAEvCjB,UAAS,WACPrF,KAAKkF,UAAYlF,KAAKqG,UAAUrG,KAAKsG,wBAIzCO,QAAO,sBACLC,YAAW,WACT,EAAK5B,UAAY,EAAKoB,yBACrB,IAGLS,QAAS,CACPT,qBAAoB,WAClB,IAAME,EAAQxG,KAAKuG,MAAMC,MACzB,GAAKA,EAAL,CAEAA,EAAME,MAAMM,OAAS,IACrB,IAAMA,EAASR,EAAMS,aACfC,EAAYrB,SAAS7F,KAAK4F,KAAM,IAAMD,WAAW3F,KAAKqF,WAG5DmB,EAAME,MAAMM,OAASG,KAAKC,IAAIF,EAAWF,GAAU,OAErDK,SAAQ,WACN,IAAMb,EAAQjE,OAAW0D,QAAQc,QAAQM,SAASnB,KAAKlG,MAMvD,OAJAwG,EAAMc,IAAM,kBACLd,EAAMhD,KAAMlD,MAAOgF,KAC1BkB,EAAMhD,KAAMlD,MAAOsF,KAAO5F,KAAK4F,KAExBY,GAETe,QAAO,SAAEC,GACPjF,OAAW0D,QAAQc,QAAQQ,QAAQrB,KAAKlG,KAAMwH,GAC9CxH,KAAKkF,UAAYlF,KAAKsG,wBAExBmB,UAAS,SAAED,GAILxH,KAAK0H,WAA2B,KAAdF,EAAEG,SACtBH,EAAEI,kBAGJ5H,KAAK6H,MAAM,UAAWL","file":"assets/js/chunk-8b3d3f4a.3f27abb7.js","sourcesContent":["import { VBtn } from 'vuetify/lib/components/VBtn';\nimport { VCard } from 'vuetify/lib/components/VCard';\nimport { VCardActions } from 'vuetify/lib/components/VCard';\nimport { VCardText } from 'vuetify/lib/components/VCard';\nimport { VCardTitle } from 'vuetify/lib/components/VCard';\nimport { VDialog } from 'vuetify/lib/components/VDialog';\nimport { VForm } from 'vuetify/lib/components/VForm';\nimport { VIcon } from 'vuetify/lib/components/VIcon';\nimport { VList } from 'vuetify/lib/components/VList';\nimport { VListItem } from 'vuetify/lib/components/VList';\nimport { VListItemSubtitle } from 'vuetify/lib/components/VList';\nimport { VMenu } from 'vuetify/lib/components/VMenu';\nimport { VSpacer } from 'vuetify/lib/components/VGrid';\nimport { VTextField } from 'vuetify/lib/components/VTextField';\nimport { VTextarea } from 'vuetify/lib/components/VTextarea';\n\nvar render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c(VMenu,{attrs:{\"offset-y\":\"\",\"left\":\"\"},scopedSlots:_vm._u([{key:\"activator\",fn:function(ref){\nvar on = ref.on;\nreturn [_c(VBtn,_vm._g({attrs:{\"icon\":\"\"}},on),[_c(VIcon,[_vm._v(\"mdi-dots-vertical\")])],1)]}}])},[_c(VList,{attrs:{\"dense\":\"\"}},[_c(VListItem,{attrs:{\"disabled\":_vm.editArticleLoading},on:{\"click\":function($event){_vm.editDialog = true}}},[_c(VListItemSubtitle,[_c(VIcon,{staticClass:\"mr-2\",attrs:{\"left\":\"\",\"small\":\"\"}},[_vm._v(\"mdi-pencil\")]),_c('span',[_vm._v(_vm._s(_vm.$t(\"latestNewsSections.articleActions.edit\")))])],1)],1),_c(VListItem,{attrs:{\"disabled\":_vm.deleteArticleLoading},on:{\"click\":function($event){_vm.deleteDialog = true}}},[_c(VListItemSubtitle,[_c(VIcon,{staticClass:\"mr-2\",attrs:{\"left\":\"\",\"small\":\"\"}},[_vm._v(\"mdi-delete\")]),_c('span',[_vm._v(_vm._s(_vm.$t(\"latestNewsSections.articleActions.deleteArticle\")))])],1)],1)],1)],1),_c(VDialog,{attrs:{\"max-width\":\"800px\"},model:{value:(_vm.editDialog),callback:function ($$v) {_vm.editDialog=$$v},expression:\"editDialog\"}},[_c(VCard,{attrs:{\"elevation\":\"0\",\"loading\":_vm.currentlyBeingEdited,\"disabled\":_vm.currentlyBeingEdited}},[_c(VCardTitle,{staticStyle:{\"justify-content\":\"space-between\"}},[_c('div',{staticClass:\"d-flex flex-1 text-truncate font-weight-bold text-h6\"},[_c('span',[_vm._v(_vm._s(_vm.$t(\"latestNewsSections.articleActions.editArticle\")))])]),_c('div',{staticClass:\"mx-2 flex-none\"}),_c(VBtn,{attrs:{\"icon\":\"\"},on:{\"click\":function($event){_vm.editDialog = false}}},[_c(VIcon,[_vm._v(\"mdi-close\")])],1)],1),_c(VCardText,{staticClass:\"pa-6\"},[(_vm.editDialog)?_c(VForm,{on:{\"submit\":function($event){$event.preventDefault();return _vm.editArticle($event)}}},[_c(VTextField,{attrs:{\"outlined\":\"\",\"label\":_vm.$t('latestNewsSections.articleActions.newArticleTitle'),\"rules\":_vm.textRules},model:{value:(_vm.newTitle),callback:function ($$v) {_vm.newTitle=$$v},expression:\"newTitle\"}}),_c(VTextarea,{attrs:{\"outlined\":\"\",\"label\":_vm.$t('latestNewsSections.articleActions.newArticleBody'),\"rules\":_vm.textRules,\"auto-grow\":\"\",\"rows\":\"2\",\"clearable\":\"\"},model:{value:(_vm.newBody),callback:function ($$v) {_vm.newBody=$$v},expression:\"newBody\"}}),_c(VBtn,{attrs:{\"type\":\"submit\",\"elevation\":\"0\",\"block\":\"\",\"color\":\"primary\"}},[_vm._v(_vm._s(_vm.$t(\"latestNewsSections.articleActions.done\")))])],1):_vm._e()],1)],1)],1),_c(VDialog,{attrs:{\"max-width\":\"300px\"},model:{value:(_vm.deleteDialog),callback:function ($$v) {_vm.deleteDialog=$$v},expression:\"deleteDialog\"}},[_c(VCard,{attrs:{\"loading\":_vm.currentlyBeingDeleted,\"disabled\":_vm.currentlyBeingDeleted}},[_c(VCardTitle,[_vm._v(_vm._s(_vm.$t(\"latestNewsSections.articleActions.deleteArticle\")))]),_c(VCardText,[_vm._v(_vm._s(_vm.$t(\"latestNewsSections.articleActions.areYouSure\")))]),_c(VCardActions,[_c(VSpacer),_c(VBtn,{attrs:{\"text\":\"\",\"color\":\"error\"},on:{\"click\":_vm.deleteArticle}},[_vm._v(_vm._s(_vm.$t(\"latestNewsSections.articleActions.confirm\")))]),_c(VBtn,{attrs:{\"text\":\"\"},on:{\"click\":function($event){_vm.deleteDialog = false}}},[_vm._v(_vm._s(_vm.$t(\"latestNewsSections.articleActions.cancel\")))])],1)],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport Vue from \"vue\";\r\nimport { Article } from \"@/core/models\";\r\nimport { Action, Getter } from \"vuex-class\";\r\nimport { Component, Watch, Prop } from \"vue-property-decorator\";\r\n\r\n@Component\r\nexport default class ArticleActions extends Vue {\r\n @Prop({ default: () => {} }) article!: Article;\r\n\r\n // Edit/Delete\r\n @Getter(\"news/editArticleLoading\") editArticleLoading!: boolean;\r\n @Getter(\"news/editedArticleID\") editedArticleID!: number;\r\n @Getter(\"news/deleteArticleLoading\") deleteArticleLoading!: boolean;\r\n @Getter(\"news/deletedArticleID\") deletedArticleID!: number;\r\n @Action(\"news/editArticle\") editArticleAction!: Function;\r\n @Action(\"news/deleteArticle\")\r\n deleteArticleAction!: (i: number) => Promise;\r\n\r\n editDialog = false;\r\n newTitle = \"\";\r\n newBody = \"\";\r\n textRules = [\r\n (v: string) => {\r\n if (!v) return \"Field cannot be empty.\";\r\n else if (v.trim().length == 0) return \"Field cannot be empty.\";\r\n else return true;\r\n },\r\n ];\r\n get currentlyBeingEdited() {\r\n return this.editArticleLoading && this.editedArticleID == this.article.ID;\r\n }\r\n editArticle() {\r\n let data = {\r\n articleId: this.article.ID,\r\n newTitle: this.newTitle,\r\n newBody: this.newBody,\r\n };\r\n this.editArticleAction(data);\r\n }\r\n @Watch(\"currentlyBeingEdited\")\r\n handleEdit(value: boolean) {\r\n if (!value) this.editDialog = false;\r\n }\r\n @Watch(\"editDialog\")\r\n toggleEdit() {\r\n if (this.editDialog) {\r\n this.newTitle = this.article.Title;\r\n this.newBody = this.article.Body;\r\n } else {\r\n this.newTitle = \"\";\r\n this.newBody = \"\";\r\n }\r\n }\r\n\r\n deleteDialog = false;\r\n get currentlyBeingDeleted() {\r\n return (\r\n this.deleteArticleLoading && this.deletedArticleID == this.article.ID\r\n );\r\n }\r\n async deleteArticle() {\r\n await this.deleteArticleAction(this.article.ID);\r\n this.$router.replace(\"/news\");\r\n }\r\n\r\n beforeDestroy() {\r\n if (this.currentlyBeingDeleted) this.$router.push(\"/news\");\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--15-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ArticleActions.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--15-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ArticleActions.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./ArticleActions.vue?vue&type=template&id=55f365dd&\"\nimport script from \"./ArticleActions.vue?vue&type=script&lang=ts&\"\nexport * from \"./ArticleActions.vue?vue&type=script&lang=ts&\"\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","// Styles\nimport './VTextarea.sass'\n\n// Extensions\nimport VTextField from '../VTextField/VTextField'\n\n// Utilities\nimport mixins from '../../util/mixins'\n\n// Types\nimport Vue from 'vue'\n\ninterface options extends Vue {\n $refs: {\n input: HTMLTextAreaElement\n }\n}\n\nconst baseMixins = mixins\n>(\n VTextField\n)\n\n/* @vue/component */\nexport default baseMixins.extend({\n name: 'v-textarea',\n\n props: {\n autoGrow: Boolean,\n noResize: Boolean,\n rowHeight: {\n type: [Number, String],\n default: 24,\n validator: (v: any) => !isNaN(parseFloat(v)),\n },\n rows: {\n type: [Number, String],\n default: 5,\n validator: (v: any) => !isNaN(parseInt(v, 10)),\n },\n },\n\n computed: {\n classes (): object {\n return {\n 'v-textarea': true,\n 'v-textarea--auto-grow': this.autoGrow,\n 'v-textarea--no-resize': this.noResizeHandle,\n ...VTextField.options.computed.classes.call(this),\n }\n },\n noResizeHandle (): boolean {\n return this.noResize || this.autoGrow\n },\n },\n\n watch: {\n autoGrow (val: boolean) {\n this.$nextTick(() => {\n val\n ? this.calculateInputHeight()\n : this.$refs.input?.style.removeProperty('height')\n })\n },\n lazyValue () {\n this.autoGrow && this.$nextTick(this.calculateInputHeight)\n },\n rowHeight () {\n this.autoGrow && this.$nextTick(this.calculateInputHeight)\n },\n },\n\n mounted () {\n setTimeout(() => {\n this.autoGrow && this.calculateInputHeight()\n }, 0)\n },\n\n methods: {\n calculateInputHeight () {\n const input = this.$refs.input\n if (!input) return\n\n input.style.height = '0'\n const height = input.scrollHeight\n const minHeight = parseInt(this.rows, 10) * parseFloat(this.rowHeight)\n // This has to be done ASAP, waiting for Vue\n // to update the DOM causes ugly layout jumping\n input.style.height = Math.max(minHeight, height) + 'px'\n },\n genInput () {\n const input = VTextField.options.methods.genInput.call(this)\n\n input.tag = 'textarea'\n delete input.data!.attrs!.type\n input.data!.attrs!.rows = this.rows\n\n return input\n },\n onInput (e: Event) {\n VTextField.options.methods.onInput.call(this, e)\n this.autoGrow && this.calculateInputHeight()\n },\n onKeyDown (e: KeyboardEvent) {\n // Prevents closing of a\n // dialog when pressing\n // enter\n if (this.isFocused && e.keyCode === 13) {\n e.stopPropagation()\n }\n\n this.$emit('keydown', e)\n },\n },\n})\n"],"sourceRoot":""}