{"version":3,"sources":["webpack:///./src/views/admin/components/CreateProduct.vue?a14f","webpack:///./src/views/admin/components/CreateProduct.vue","webpack:///./src/views/admin/components/CreateProduct.vue?83b2","webpack:///./src/views/admin/components/CreateProduct.vue?ce4a","webpack:///../../../src/mixins/rippleable/index.ts","webpack:///../../../src/components/VTextarea/VTextarea.ts","webpack:///../../../src/components/VSwitch/VSwitch.ts","webpack:///../../../src/mixins/selectable/index.ts"],"names":["render","_vm","this","_h","$createElement","_c","_self","VDialog","attrs","scopedSlots","_u","key","fn","ref","on","VBtn","_g","VIcon","_v","model","value","callback","$$v","dialog","expression","VCard","_s","$t","VSpacer","staticClass","$event","VTextField","nameErrors","name","VTextarea","descErrors","description","priceErrors","unitAmount","_n","countErrors","employees","VSwitch","active","loading","create","staticRenderFns","CreateProduct","err","$v","$dirty","required","push","min","$touch","$invalid","metadata","data","Math","round","createProduct","Vue","__decorate","Getter","Action","Function","Component","mixins","validationMixin","validations","minLength","minValue","component","extend","directives","ripple","props","type","Boolean","Object","default","methods","genRipple","center","baseMixins","autoGrow","noResize","rowHeight","Number","String","validator","v","isNaN","parseFloat","rows","parseInt","computed","classes","noResizeHandle","options","call","watch","val","$nextTick","calculateInputHeight","$refs","input","_a","style","removeProperty","lazyValue","mounted","setTimeout","height","scrollHeight","minHeight","max","genInput","tag","onInput","e","onKeyDown","isFocused","keyCode","stopPropagation","$emit","Selectable","Touch","inset","flat","VInput","isActive","isDisabled","role","validationState","hasError","shouldValidate","hasSuccess","hasColor","computedColor","switchData","setTextColor","undefined","class","themeClasses","genDefaultSlot","genSwitch","genLabel","attrs$","switchAttrs","title","left","onSwipeLeft","right","onSwipeRight","genProgress","VFabTransition","$slots","progress","VProgressCircular","color","size","width","indeterminate","onChange","onKeydown","keyCodes","prevent","preventDefault","Rippleable","Comparable","prop","event","id","inputValue","falseValue","trueValue","multiple","label","isDark","appIsDark","isMultiple","Array","isArray","internalValue","some","item","valueComparator","isDirty","rippleState","click","assign","toString","disabled","computedId","dom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AAKC,gBAAgBD,EAAMtK,MAE5DsF,EAAMmG,SAAWA,GACnBnG,EAAMtD,KAAKhC,QAGbsF,OAD4BoC,IAAnB5I,KAAK8K,gBAA+ClC,IAApB5I,KAAK6K,WACtC7K,KAAKyL,gBAAgBjF,EAAOxG,KAAK8K,WAAa9K,KAAK6K,WAAa7K,KAAK8K,UACpE5J,EACDlB,KAAKyL,gBAAgBjF,EAAOtF,GAAS,KAAOA,GAE3CsF,EAGXxG,KAAK6M,UAAS,EAAMrG,GACpBxG,KAAKsL,cAAgB9E,EACrBxG,KAAKwI,SAAWhC,IAElB+F,QAAO,SAAEjF,GACPtH,KAAKwH,WAAY,EACjBxH,KAAK2H,MAAM,QAASL,IAEtB8E,OAAM,SAAE9E,GACNtH,KAAKwH,WAAY,EACjBxH,KAAK2H,MAAM,OAAQL,IAGrB6C,UAAS,SAAE7C","file":"assets/js/chunk-186104d2.d02f3fa6.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 { VIcon } from 'vuetify/lib/components/VIcon';\nimport { VSpacer } from 'vuetify/lib/components/VGrid';\nimport { VSwitch } from 'vuetify/lib/components/VSwitch';\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(VDialog,{attrs:{\"max-width\":\"600px\"},scopedSlots:_vm._u([{key:\"activator\",fn:function(ref){\nvar on = ref.on;\nreturn [_c(VBtn,_vm._g({attrs:{\"icon\":\"\",\"elevation\":\"0\",\"color\":\"primary\"}},on),[_c(VIcon,[_vm._v(\"mdi-plus\")])],1)]}}]),model:{value:(_vm.dialog),callback:function ($$v) {_vm.dialog=$$v},expression:\"dialog\"}},[_c(VCard,[_c(VCardTitle,[_c('span',[_vm._v(_vm._s(_vm.$t(\"admin.createNewProduct\")))]),_c(VSpacer),_c(VBtn,{staticClass:\"ml-4\",attrs:{\"icon\":\"\"},on:{\"click\":function($event){_vm.dialog = false}}},[_c(VIcon,[_vm._v(\"mdi-close\")])],1)],1),_c(VCardText,[_c(VTextField,{attrs:{\"label\":_vm.$t('admin.productName'),\"error-messages\":_vm.nameErrors},model:{value:(_vm.name),callback:function ($$v) {_vm.name=$$v},expression:\"name\"}}),_c(VTextarea,{attrs:{\"placeholder\":_vm.$t('admin.productDescription'),\"error-messages\":_vm.descErrors,\"auto-grow\":\"\",\"rows\":\"2\",\"counter\":\"\"},model:{value:(_vm.description),callback:function ($$v) {_vm.description=$$v},expression:\"description\"}}),_c(VTextField,{attrs:{\"label\":_vm.$t('admin.productPrice'),\"error-messages\":_vm.priceErrors,\"type\":\"number\",\"step\":\"0.01\"},model:{value:(_vm.unitAmount),callback:function ($$v) {_vm.unitAmount=_vm._n($$v)},expression:\"unitAmount\"}}),_c(VTextField,{attrs:{\"label\":_vm.$t('admin.maximumAllowedEmployees'),\"error-messages\":_vm.countErrors,\"placeholder\":\"0\"},model:{value:(_vm.employees),callback:function ($$v) {_vm.employees=$$v},expression:\"employees\"}}),_c('div',{staticClass:\"d-flex align-center\"},[_c('span',[_vm._v(_vm._s(_vm.$t(\"admin.activeProduct\")))]),_c(VSpacer),_c(VSwitch,{staticClass:\"ma-0\",attrs:{\"hide-details\":\"\"},model:{value:(_vm.active),callback:function ($$v) {_vm.active=$$v},expression:\"active\"}})],1)],1),_c(VCardActions,[_c(VSpacer),_c(VBtn,{attrs:{\"elevation\":\"0\",\"color\":\"primary\",\"loading\":_vm.loading,\"disabled\":_vm.loading},on:{\"click\":_vm.create}},[_c('span',[_vm._v(_vm._s(_vm.$t(\"admin.createProduct\")))])])],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\r\nimport Vue from \"vue\";\r\nimport { Component } from \"vue-property-decorator\";\r\nimport { Action, Getter } from \"vuex-class\";\r\nimport { validationMixin } from \"vuelidate\";\r\nimport { required, minLength, minValue } from \"vuelidate/lib/validators\";\r\n\r\n@Component({\r\n mixins: [validationMixin],\r\n validations: {\r\n name: { required, min: minLength(3) },\r\n description: { required, min: minLength(5) },\r\n unitAmount: { required, min: minValue(1) },\r\n employees: { required, min: minValue(2) },\r\n },\r\n})\r\nexport default class CreateProduct extends Vue {\r\n @Getter(\"products/loading\") loading!: boolean;\r\n @Action(\"products/create\") createProduct!: Function;\r\n @Action(\"displaySnackbar\") displaySnackbar!: Function;\r\n\r\n dialog = false;\r\n name = \"\";\r\n description = \"\";\r\n active = false;\r\n unitAmount = 10;\r\n employees = 2;\r\n\r\n // Errors\r\n get nameErrors() {\r\n const err: string[] = [];\r\n if (!this.$v.name!.$dirty) return err;\r\n //todo: translate\r\n if (!this.$v.name!.required) err.push(\"Required field\");\r\n if (!this.$v.name!.min) err.push(\"Name is too short\");\r\n return err;\r\n }\r\n get descErrors() {\r\n const err: string[] = [];\r\n if (!this.$v.description!.$dirty) return err;\r\n //todo: translate\r\n if (!this.$v.description!.required) err.push(\"Required field\");\r\n if (!this.$v.description!.min) err.push(\"Description is too short\");\r\n return err;\r\n }\r\n get priceErrors() {\r\n const err: string[] = [];\r\n if (!this.$v.unitAmount!.$dirty) return err;\r\n //todo: translate\r\n if (!this.$v.unitAmount!.required) err.push(\"Required field\");\r\n if (!this.$v.unitAmount!.min) err.push(\"Cannot create a free product\");\r\n return err;\r\n }\r\n get countErrors() {\r\n const err: string[] = [];\r\n if (!this.$v.employees!.$dirty) return err;\r\n //todo: translate\r\n if (!this.$v.employees!.required) err.push(\"Required field\");\r\n if (!this.$v.employees!.min)\r\n err.push(\"Cannot add less than 2 employees (incl. yourself)\");\r\n return err;\r\n }\r\n\r\n async create() {\r\n this.$v.$touch();\r\n if (this.$v.$invalid || this.loading) return;\r\n\r\n const metadata = { employees: this.employees };\r\n const data = {\r\n name: this.name,\r\n description: this.description,\r\n active: this.active,\r\n metadata: metadata,\r\n unitAmount: Math.round(this.unitAmount * 100),\r\n };\r\n this.createProduct(data);\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!./CreateProduct.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!./CreateProduct.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./CreateProduct.vue?vue&type=template&id=a87b9890&\"\nimport script from \"./CreateProduct.vue?vue&type=script&lang=ts&\"\nexport * from \"./CreateProduct.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","// Directives\nimport ripple from '../../directives/ripple'\n\n// Types\nimport Vue, { VNode, VNodeData, VNodeDirective } from 'vue'\n\nexport default Vue.extend({\n name: 'rippleable',\n\n directives: { ripple },\n\n props: {\n ripple: {\n type: [Boolean, Object],\n default: true,\n },\n },\n\n methods: {\n genRipple (data: VNodeData = {}): VNode | null {\n if (!this.ripple) return null\n\n data.staticClass = 'v-input--selection-controls__ripple'\n\n data.directives = data.directives || []\n data.directives.push({\n name: 'ripple',\n value: { center: true },\n } as VNodeDirective)\n\n return this.$createElement('div', data)\n },\n },\n})\n","// 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<options &\n InstanceType<typeof VTextField>\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","// Styles\nimport '../../styles/components/_selection-controls.sass'\nimport './VSwitch.sass'\n\n// Mixins\nimport Selectable from '../../mixins/selectable'\nimport VInput from '../VInput'\n\n// Directives\nimport Touch from '../../directives/touch'\n\n// Components\nimport { VFabTransition } from '../transitions'\nimport VProgressCircular from '../VProgressCircular/VProgressCircular'\n\n// Helpers\nimport { keyCodes } from '../../util/helpers'\n\n// Types\nimport { VNode, VNodeData } from 'vue'\n\n/* @vue/component */\nexport default Selectable.extend({\n name: 'v-switch',\n\n directives: { Touch },\n\n props: {\n inset: Boolean,\n loading: {\n type: [Boolean, String],\n default: false,\n },\n flat: {\n type: Boolean,\n default: false,\n },\n },\n\n computed: {\n classes (): object {\n return {\n ...VInput.options.computed.classes.call(this),\n 'v-input--selection-controls v-input--switch': true,\n 'v-input--switch--flat': this.flat,\n 'v-input--switch--inset': this.inset,\n }\n },\n attrs (): object {\n return {\n 'aria-checked': String(this.isActive),\n 'aria-disabled': String(this.isDisabled),\n role: 'switch',\n }\n },\n // Do not return undefined if disabled,\n // according to spec, should still show\n // a color when disabled and active\n validationState (): string | undefined {\n if (this.hasError && this.shouldValidate) return 'error'\n if (this.hasSuccess) return 'success'\n if (this.hasColor !== null) return this.computedColor\n return undefined\n },\n switchData (): VNodeData {\n return this.setTextColor(this.loading ? undefined : this.validationState, {\n class: this.themeClasses,\n })\n },\n },\n\n methods: {\n genDefaultSlot (): (VNode | null)[] {\n return [\n this.genSwitch(),\n this.genLabel(),\n ]\n },\n genSwitch (): VNode {\n const { title, ...switchAttrs } = this.attrs$\n\n return this.$createElement('div', {\n staticClass: 'v-input--selection-controls__input',\n }, [\n this.genInput('checkbox', {\n ...this.attrs,\n ...switchAttrs,\n }),\n this.genRipple(this.setTextColor(this.validationState, {\n directives: [{\n name: 'touch',\n value: {\n left: this.onSwipeLeft,\n right: this.onSwipeRight,\n },\n }],\n })),\n this.$createElement('div', {\n staticClass: 'v-input--switch__track',\n ...this.switchData,\n }),\n this.$createElement('div', {\n staticClass: 'v-input--switch__thumb',\n ...this.switchData,\n }, [this.genProgress()]),\n ])\n },\n genProgress (): VNode {\n return this.$createElement(VFabTransition, {}, [\n this.loading === false\n ? null\n : this.$slots.progress || this.$createElement(VProgressCircular, {\n props: {\n color: (this.loading === true || this.loading === '')\n ? (this.color || 'primary')\n : this.loading,\n size: 16,\n width: 2,\n indeterminate: true,\n },\n }),\n ])\n },\n onSwipeLeft () {\n if (this.isActive) this.onChange()\n },\n onSwipeRight () {\n if (!this.isActive) this.onChange()\n },\n onKeydown (e: KeyboardEvent) {\n if (\n (e.keyCode === keyCodes.left && this.isActive) ||\n (e.keyCode === keyCodes.right && !this.isActive)\n ) this.onChange()\n },\n },\n})\n","// Components\nimport VInput from '../../components/VInput'\n\n// Mixins\nimport Rippleable from '../rippleable'\nimport Comparable from '../comparable'\n\n// Utilities\nimport mixins from '../../util/mixins'\n\nexport function prevent (e: Event) {\n e.preventDefault()\n}\n\n/* @vue/component */\nexport default mixins(\n VInput,\n Rippleable,\n Comparable\n).extend({\n name: 'selectable',\n\n model: {\n prop: 'inputValue',\n event: 'change',\n },\n\n props: {\n id: String,\n inputValue: null as any,\n falseValue: null as any,\n trueValue: null as any,\n multiple: {\n type: Boolean,\n default: null,\n },\n label: String,\n },\n\n data () {\n return {\n hasColor: this.inputValue,\n lazyValue: this.inputValue,\n }\n },\n\n computed: {\n computedColor (): string | undefined {\n if (!this.isActive) return undefined\n if (this.color) return this.color\n if (this.isDark && !this.appIsDark) return 'white'\n return 'primary'\n },\n isMultiple (): boolean {\n return this.multiple === true || (this.multiple === null && Array.isArray(this.internalValue))\n },\n isActive (): boolean {\n const value = this.value\n const input = this.internalValue\n\n if (this.isMultiple) {\n if (!Array.isArray(input)) return false\n\n return input.some(item => this.valueComparator(item, value))\n }\n\n if (this.trueValue === undefined || this.falseValue === undefined) {\n return value\n ? this.valueComparator(value, input)\n : Boolean(input)\n }\n\n return this.valueComparator(input, this.trueValue)\n },\n isDirty (): boolean {\n return this.isActive\n },\n rippleState (): string | undefined {\n return !this.isDisabled && !this.validationState\n ? undefined\n : this.validationState\n },\n },\n\n watch: {\n inputValue (val) {\n this.lazyValue = val\n this.hasColor = val\n },\n },\n\n methods: {\n genLabel () {\n const label = VInput.options.methods.genLabel.call(this)\n\n if (!label) return label\n\n label!.data!.on = {\n // Label shouldn't cause the input to focus\n click: prevent,\n }\n\n return label\n },\n genInput (type: string, attrs: object) {\n return this.$createElement('input', {\n attrs: Object.assign({\n 'aria-checked': this.isActive.toString(),\n disabled: this.isDisabled,\n id: this.computedId,\n role: type,\n type,\n }, attrs),\n domProps: {\n value: this.value,\n checked: this.isActive,\n },\n on: {\n blur: this.onBlur,\n change: this.onChange,\n focus: this.onFocus,\n keydown: this.onKeydown,\n click: prevent,\n },\n ref: 'input',\n })\n },\n onClick (e: Event) {\n this.onChange()\n this.$emit('click', e)\n },\n onChange () {\n if (!this.isInteractive) return\n\n const value = this.value\n let input = this.internalValue\n\n if (this.isMultiple) {\n if (!Array.isArray(input)) {\n input = []\n }\n\n const length = input.length\n\n input = input.filter((item: any) => !this.valueComparator(item, value))\n\n if (input.length === length) {\n input.push(value)\n }\n } else if (this.trueValue !== undefined && this.falseValue !== undefined) {\n input = this.valueComparator(input, this.trueValue) ? this.falseValue : this.trueValue\n } else if (value) {\n input = this.valueComparator(input, value) ? null : value\n } else {\n input = !input\n }\n\n this.validate(true, input)\n this.internalValue = input\n this.hasColor = input\n },\n onFocus (e: FocusEvent) {\n this.isFocused = true\n this.$emit('focus', e)\n },\n onBlur (e: FocusEvent) {\n this.isFocused = false\n this.$emit('blur', e)\n },\n /** @abstract */\n onKeydown (e: Event) {},\n },\n})\n"],"sourceRoot":""}