{"version":3,"sources":["webpack:///./src/views/admin/components/CreateProduct.vue?5a1f","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","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","domProps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,OAD4BoC,IAAnB3I,KAAK6K,gBAA+ClC,IAApB3I,KAAK4K,WACtC5K,KAAKwL,gBAAgBjF,EAAOvG,KAAK6K,WAAa7K,KAAK4K,WAAa5K,KAAK6K,UACpE3J,EACDlB,KAAKwL,gBAAgBjF,EAAOrF,GAAS,KAAOA,GAE3CqF,EAGXvG,KAAK4M,UAAS,EAAMrG,GACpBvG,KAAKqL,cAAgB9E,EACrBvG,KAAKuI,SAAWhC,IAElB+F,QAAO,SAAEjF,GACPrH,KAAKuH,WAAY,EACjBvH,KAAK0H,MAAM,QAASL,IAEtB8E,OAAM,SAAE9E,GACNrH,KAAKuH,WAAY,EACjBvH,KAAK0H,MAAM,OAAQL,IAGrB6C,UAAS,SAAE7C","file":"assets/js/chunk-186104d2.7e0b885a.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\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":""}