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tD,qBAAS,KAAK;AAHwC,SAAxC,CAAT,EAIH,KAAK,UAAL,EAJG,CAAP;AAKD;AA5QM,CAbM,C","sourcesContent":["// Styles\nimport '../../stylus/components/_inputs.styl'\n\n// Components\nimport VIcon from '../VIcon'\nimport VLabel from '../VLabel'\nimport VMessages from '../VMessages'\n\n// Mixins\nimport Colorable from '../../mixins/colorable'\nimport Themeable from '../../mixins/themeable'\nimport Validatable from '../../mixins/validatable'\n\n// Utilities\nimport {\n convertToUnit,\n kebabCase\n} from '../../util/helpers'\nimport { deprecate } from '../../util/console'\nimport mixins, { ExtractVue } from '../../util/mixins'\n\n// Types\nimport Vue, { VNode, VNodeData } from 'vue'\ninterface options extends Vue {\n /* eslint-disable-next-line camelcase */\n $_modelEvent: string\n}\n\nexport default mixins<options &\n/* eslint-disable indent */\n ExtractVue<[\n typeof Colorable,\n typeof Themeable,\n typeof Validatable\n ]>\n/* eslint-enable indent */\n>(\n Colorable,\n Themeable,\n Validatable\n /* @vue/component */\n).extend({\n name: 'v-input',\n\n props: {\n appendIcon: String,\n /** @deprecated */\n appendIconCb: Function,\n backgroundColor: {\n type: String,\n default: ''\n },\n height: [Number, String],\n hideDetails: Boolean,\n hint: String,\n label: String,\n loading: Boolean,\n persistentHint: Boolean,\n prependIcon: String,\n /** @deprecated */\n prependIconCb: Function,\n value: { required: false }\n },\n\n data () {\n return {\n attrsInput: {},\n lazyValue: this.value as any,\n hasMouseDown: false\n }\n },\n\n computed: {\n classes: () => ({}),\n classesInput (): object {\n return {\n ...this.classes,\n 'v-input--has-state': this.hasState,\n 'v-input--hide-details': this.hideDetails,\n 'v-input--is-label-active': this.isLabelActive,\n 'v-input--is-dirty': this.isDirty,\n 'v-input--is-disabled': this.disabled,\n 'v-input--is-focused': this.isFocused,\n 'v-input--is-loading': this.loading !== false && this.loading !== undefined,\n 'v-input--is-readonly': this.readonly,\n ...this.themeClasses\n }\n },\n directivesInput () {\n return []\n },\n hasHint () {\n return !this.hasMessages &&\n this.hint &&\n (this.persistentHint || this.isFocused)\n },\n hasLabel () {\n return Boolean(this.$slots.label || this.label)\n },\n // Proxy for `lazyValue`\n // This allows an input\n // to function without\n // a provided model\n internalValue: {\n get () {\n return this.lazyValue\n },\n set (val: any) {\n this.lazyValue = val\n this.$emit(this.$_modelEvent, val)\n }\n },\n isDirty () {\n return !!this.lazyValue\n },\n isDisabled () {\n return Boolean(this.disabled || this.readonly)\n },\n isLabelActive () {\n return this.isDirty\n }\n },\n\n watch: {\n value (val) {\n this.lazyValue = val\n }\n },\n\n beforeCreate () {\n // v-radio-group needs to emit a different event\n // https://github.com/vuetifyjs/vuetify/issues/4752\n this.$_modelEvent = (this.$options.model && this.$options.model.event) || 'input'\n },\n\n methods: {\n genContent () {\n return [\n this.genPrependSlot(),\n this.genControl(),\n this.genAppendSlot()\n ]\n },\n genControl () {\n return this.$createElement('div', {\n staticClass: 'v-input__control'\n }, [\n this.genInputSlot(),\n this.genMessages()\n ])\n },\n genDefaultSlot () {\n return [\n this.genLabel(),\n this.$slots.default\n ]\n },\n // TODO: remove shouldDeprecate (2.0), used for clearIcon\n genIcon (\n type: string,\n cb?: (e: Event) => void,\n shouldDeprecate = true\n ) {\n const icon = (this as any)[`${type}Icon`]\n const eventName = `click:${kebabCase(type)}`\n cb = cb || (this as any)[`${type}IconCb`]\n\n if (shouldDeprecate && type && cb) {\n deprecate(`:${type}-icon-cb`, `@${eventName}`, this)\n }\n\n const data: VNodeData = {\n props: {\n color: this.validationState,\n dark: this.dark,\n disabled: this.disabled,\n light: this.light\n },\n on: !(this.$listeners[eventName] || cb)\n ? undefined\n : {\n click: (e: Event) => {\n e.preventDefault()\n e.stopPropagation()\n\n this.$emit(eventName, e)\n cb && cb(e)\n },\n // Container has mouseup event that will\n // trigger menu open if enclosed\n mouseup: (e: Event) => {\n e.preventDefault()\n e.stopPropagation()\n }\n }\n }\n\n return this.$createElement('div', {\n staticClass: `v-input__icon v-input__icon--${kebabCase(type)}`,\n key: `${type}${icon}`\n }, [\n this.$createElement(\n VIcon,\n data,\n icon\n )\n ])\n },\n genInputSlot () {\n return this.$createElement('div', this.setBackgroundColor(this.backgroundColor, {\n staticClass: 'v-input__slot',\n style: { height: convertToUnit(this.height) },\n directives: this.directivesInput,\n on: {\n click: this.onClick,\n mousedown: this.onMouseDown,\n mouseup: this.onMouseUp\n },\n ref: 'input-slot'\n }), [this.genDefaultSlot()])\n },\n genLabel () {\n if (!this.hasLabel) return null\n\n return this.$createElement(VLabel, {\n props: {\n color: this.validationState,\n dark: this.dark,\n focused: this.hasState,\n for: this.$attrs.id,\n light: this.light\n }\n }, this.$slots.label || this.label)\n },\n genMessages () {\n if (this.hideDetails) return null\n\n const messages = this.hasHint\n ? [this.hint]\n : this.validations\n\n return this.$createElement(VMessages, {\n props: {\n color: this.hasHint ? '' : this.validationState,\n dark: this.dark,\n light: this.light,\n value: (this.hasMessages || this.hasHint) ? messages : []\n }\n })\n },\n genSlot (\n type: string,\n location: string,\n slot: (VNode | VNode[])[]\n ) {\n if (!slot.length) return null\n\n const ref = `${type}-${location}`\n\n return this.$createElement('div', {\n staticClass: `v-input__${ref}`,\n ref\n }, slot)\n },\n genPrependSlot () {\n const slot = []\n\n if (this.$slots.prepend) {\n slot.push(this.$slots.prepend)\n } else if (this.prependIcon) {\n slot.push(this.genIcon('prepend'))\n }\n\n return this.genSlot('prepend', 'outer', slot)\n },\n genAppendSlot () {\n const slot = []\n\n // Append icon for text field was really\n // an appended inner icon, v-text-field\n // will overwrite this method in order to obtain\n // backwards compat\n if (this.$slots.append) {\n slot.push(this.$slots.append)\n } else if (this.appendIcon) {\n slot.push(this.genIcon('append'))\n }\n\n return this.genSlot('append', 'outer', slot)\n },\n onClick (e: Event) {\n this.$emit('click', e)\n },\n onMouseDown (e: Event) {\n this.hasMouseDown = true\n this.$emit('mousedown', e)\n },\n onMouseUp (e: Event) {\n this.hasMouseDown = false\n this.$emit('mouseup', e)\n }\n },\n\n render (h): VNode {\n return h('div', this.setTextColor(this.validationState, {\n staticClass: 'v-input',\n attrs: this.attrsInput,\n 'class': this.classesInput\n }), this.genContent())\n }\n})\n"],"sourceRoot":""}
|