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Ac,CAAd,MAAqB,SAA1B;AAAA,aAAxB,KAAgE,IAAhF;AAEA,gBAAI,CAAC,QAAQ,IAAT,IAAiB,CAAC,QAAQ,QAA9B,EAAwC;AACtC,4BAAY,8GAAZ,EAA4H,IAA5H;AACA,uBAAO,IAAP;AACD;AAED,mBAAO,KAAK,cAAL,CAAoB,IAApB,EAA0B;AAC/B,uBAAO,EAAE,MAAM,IAAR,EADwB;AAE/B,oBAAI;AACF,yBADE,iBACK,CADL,EACM;AACN,0BAAE,eAAF;AACA,gCAAQ,QAAR,CAAiB,CAAjB;AACD;AAJC;AAF2B,aAA1B,EAQJ,CAAC,QAAQ,IAAT,CARI,CAAP;AASD;AAjDM;AAlCyB,CAArB,CAAf","sourcesContent":["// Styles\nimport '../../stylus/components/_overflow-buttons.styl'\n\n// Extensions\nimport VSelect from '../VSelect/VSelect'\nimport VAutocomplete from '../VAutocomplete'\nimport VTextField from '../VTextField/VTextField'\n\nimport VBtn from '../VBtn'\n\nimport { consoleWarn } from '../../util/console'\n\n/* @vue/component */\nexport default VAutocomplete.extend({\n name: 'v-overflow-btn',\n\n props: {\n segmented: Boolean,\n editable: Boolean,\n transition: VSelect.options.props.transition\n },\n\n computed: {\n classes () {\n return Object.assign(VAutocomplete.options.computed.classes.call(this), {\n 'v-overflow-btn': true,\n 'v-overflow-btn--segmented': this.segmented,\n 'v-overflow-btn--editable': this.editable\n })\n },\n isAnyValueAllowed () {\n return this.editable ||\n VAutocomplete.options.computed.isAnyValueAllowed.call(this)\n },\n isSingle () {\n return true\n },\n computedItems () {\n return this.segmented ? this.allItems : this.filteredItems\n },\n $_menuProps () {\n const props = VAutocomplete.options.computed.$_menuProps.call(this)\n props.transition = props.transition || 'v-menu-transition'\n return props\n }\n },\n\n methods: {\n genSelections () {\n return this.editable\n ? VAutocomplete.options.methods.genSelections.call(this)\n : VSelect.options.methods.genSelections.call(this) // Override v-autocomplete's override\n },\n genCommaSelection (item, index, last) {\n return this.segmented\n ? this.genSegmentedBtn(item)\n : VSelect.options.methods.genCommaSelection.call(this, item, index, last)\n },\n genInput () {\n const input = VTextField.options.methods.genInput.call(this)\n\n input.data.domProps.value = this.editable ? this.internalSearch : ''\n input.data.attrs.readonly = !this.isAnyValueAllowed\n\n return input\n },\n genLabel () {\n if (this.editable && this.isFocused) return null\n\n const label = VTextField.options.methods.genLabel.call(this)\n\n if (!label) return label\n\n // Reset previously set styles from parent\n label.data.style = {}\n\n return label\n },\n genSegmentedBtn (item) {\n const itemValue = this.getValue(item)\n const itemObj = this.computedItems.find(i => this.getValue(i) === itemValue) || item\n\n if (!itemObj.text || !itemObj.callback) {\n consoleWarn('When using \\'segmented\\' prop without a selection slot, items must contain both a text and callback property', this)\n return null\n }\n\n return this.$createElement(VBtn, {\n props: { flat: true },\n on: {\n click (e) {\n e.stopPropagation()\n itemObj.callback(e)\n }\n }\n }, [itemObj.text])\n }\n }\n})\n"],"sourceRoot":""}
|