{"version":3,"sources":["webpack:///../../../src/components/VGrid/VSpacer.ts","webpack:///../../../src/mixins/rippleable/index.ts","webpack:///../../../src/components/VSwitch/VSwitch.ts","webpack:///../../../src/mixins/selectable/index.ts"],"names":["name","directives","ripple","props","type","Boolean","default","methods","genRipple","data","this","value","center","$createElement","Touch","inset","loading","flat","computed","classes","attrs","String","role","validationState","hasError","hasColor","switchData","setTextColor","undefined","class","themeClasses","genDefaultSlot","genSwitch","staticClass","genInput","attrs$","left","right","onSwipeRight","genProgress","$slots","progress","color","size","width","indeterminate","onSwipeLeft","onChange","onKeydown","e","model","prop","event","id","inputValue","falseValue","trueValue","multiple","label","lazyValue","computedColor","isDark","isMultiple","Array","isActive","input","item","valueComparator","isDirty","rippleState","watch","genLabel","click","prevent","Object","disabled","domProps","checked","on","blur","change","focus","keydown","ref","onBlur","onClick","length","onFocus"],"mappings":"2IAAA,0BAGe,sBAAuB,SAAU,MAAhD,a,kCCHA,4BAMe,qBAAW,CACxBA,KADwB,aAGxBC,WAAY,CAAEC,OAAA,QAEdC,MAAO,CACLD,OAAQ,CACNE,KAAM,CAACC,QADD,QAENC,SAAS,IAIbC,QAAS,CACPC,UADO,WACwB,IAApBC,EAAoB,uDAAtB,GACP,OAAKC,KAAL,QAEAD,EAAA,kDAEAA,EAAA,WAAkBA,EAAA,YAAlB,GACAA,EAAA,gBAAqB,CACnBT,KADmB,SAEnBW,MAAO,CAAEC,QAAQ,KAGZF,KAAKG,eAAe,MAA3B,IAVyB,U,6LCEhB,qBAAkB,CAC/Bb,KAD+B,WAG/BC,WAAY,CAAEa,MAAA,QAEdX,MAAO,CACLY,MADK,QAELC,QAAS,CACPZ,KAAM,CAACC,QADA,QAEPC,SAAS,GAEXW,KAAM,CACJb,KADI,QAEJE,SAAS,IAIbY,SAAU,CACRC,QADQ,WAEN,wCACK,qCADE,OAAP,IAEE,+CAFK,EAGL,wBAAyBT,KAHpB,KAIL,yBAA0BA,KAAKK,SAGnCK,MATQ,WAUN,MAAO,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BxB,SAbO,SAaC,KACN,OAAOxB,KAAKG,eAAe,QAAS,CAClCO,MAAOsD,OAAA,OAAc,CACnB,eAAgBhE,KAAKsD,SADF,WAEnBW,SAAUjE,KAFS,WAGnB2C,GAAI3C,KAHe,WAInBY,KAJmB,EAKnBlB,QANgC,GAQlCwE,SAAU,CACRjE,MAAOD,KADC,MAERmE,QAASnE,KAAKsD,UAEhBc,GAAI,CACFC,KAAMrE,KADJ,OAEFsE,OAAQtE,KAFN,SAGFuE,MAAOvE,KAHL,QAIFwE,QAASxE,KAJP,UAKF8D,MAAOC,GAETU,IAAK,WAGTC,OApCO,WAqCL1E,KAAA,cAEF2E,QAvCO,SAuCA,GACL3E,KAAA,WACAA,KAAA,kBAEFqC,SA3CO,WA2CC,WACN,GAAKrC,KAAL,eAEA,IAAMC,EAAQD,KAAd,MACIuD,EAAQvD,KAAZ,cAEA,GAAIA,KAAJ,WAAqB,CACdqD,MAAA,QAAL,KACEE,EAAA,IAGF,IAAMqB,EAASrB,EAAf,OAEAA,EAAQA,EAAA,QAAc,SAAAC,GAAD,OAAgB,oBAArC,MAEID,EAAA,SAAJ,GACEA,EAAA,aAGFA,OAD4BrC,IAAnBlB,KAAK8C,gBAAT,IAAoC9C,KAAK6C,WACtC7C,KAAKyD,gBAAgBF,EAAOvD,KAA5B,WAA8CA,KAA9C,WAAgEA,KAAxE,UACSC,EACDD,KAAKyD,gBAAgBF,EAAOtD,GAAS,KAA7C,GAEAsD,EAGFvD,KAAA,eACAA,KAAA,gBACAA,KAAA,aAEF6E,QAzEO,WA0EL7E,KAAA,cAGFsC,UA7EO,SA6EE","file":"js/chunk-0d7192cb.ace57d5e.js","sourcesContent":["import './_grid.sass'\nimport { createSimpleFunctional } from '../../util/helpers'\n\nexport default createSimpleFunctional('spacer', 'div', 'v-spacer')\n","// 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 '../../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 return this.$createElement('div', {\n staticClass: 'v-input--selection-controls__input',\n }, [\n this.genInput('checkbox', {\n ...this.attrs,\n ...this.attrs$,\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 onBlur () {\n this.isFocused = false\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 () {\n this.isFocused = true\n },\n /** @abstract */\n onKeydown (e: Event) {},\n },\n})\n"],"sourceRoot":""}