vuetify eingebunden + erster Versuch Combobox
This commit is contained in:
+57
@@ -0,0 +1,57 @@
|
||||
// Mixins
|
||||
import Delayable from '../../mixins/delayable';
|
||||
import Toggleable from '../../mixins/toggleable';
|
||||
// Utilities
|
||||
import mixins from '../../util/mixins';
|
||||
import { consoleWarn } from '../../util/console';
|
||||
export default mixins(Delayable, Toggleable
|
||||
/* @vue/component */
|
||||
).extend({
|
||||
name: 'v-hover',
|
||||
props: {
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
value: {
|
||||
type: Boolean,
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onMouseEnter: function onMouseEnter() {
|
||||
this.runDelay('open');
|
||||
},
|
||||
onMouseLeave: function onMouseLeave() {
|
||||
this.runDelay('close');
|
||||
}
|
||||
},
|
||||
render: function render() {
|
||||
if (!this.$scopedSlots.default && this.value === undefined) {
|
||||
consoleWarn('v-hover is missing a default scopedSlot or bound value', this);
|
||||
return null;
|
||||
}
|
||||
var element = void 0;
|
||||
if (this.$scopedSlots.default) {
|
||||
element = this.$scopedSlots.default({ hover: this.isActive });
|
||||
} else if (this.$slots.default && this.$slots.default.length === 1) {
|
||||
element = this.$slots.default[0];
|
||||
}
|
||||
if (Array.isArray(element) && element.length === 1) {
|
||||
element = element[0];
|
||||
}
|
||||
if (!element || Array.isArray(element) || !element.tag) {
|
||||
consoleWarn('v-hover should only contain a single element', this);
|
||||
return element;
|
||||
}
|
||||
if (!this.disabled) {
|
||||
element.data = element.data || {};
|
||||
this._g(element.data, {
|
||||
mouseenter: this.onMouseEnter,
|
||||
mouseleave: this.onMouseLeave
|
||||
});
|
||||
}
|
||||
return element;
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=VHover.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/components/VHover/VHover.ts"],"names":[],"mappings":";AACA,OAAO,SAAP,MAAsB,wBAAtB;AACA,OAAO,UAAP,MAAuB,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R,GAAe,QAAQ,IAAR,IAAgB,EAA/B;AACA,iBAAK,EAAL,CAAQ,QAAQ,IAAhB,EAAsB;AACpB,4BAAY,KAAK,YADG;AAEpB,4BAAY,KAAK;AAFG,aAAtB;AAID;AAED,eAAO,OAAP;AACD;AAzDM,CAJM,CAAf","sourcesContent":["// Mixins\nimport Delayable from '../../mixins/delayable'\nimport Toggleable from '../../mixins/toggleable'\n\n// Utilities\nimport mixins from '../../util/mixins'\nimport { consoleWarn } from '../../util/console'\n\n// Types\nimport { VNode, ScopedSlotChildren } from 'vue/types/vnode'\n\nexport default mixins(\n Delayable,\n Toggleable\n /* @vue/component */\n).extend({\n name: 'v-hover',\n\n props: {\n disabled: {\n type: Boolean,\n default: false\n },\n value: {\n type: Boolean,\n default: undefined\n }\n },\n\n methods: {\n onMouseEnter () {\n this.runDelay('open')\n },\n onMouseLeave () {\n this.runDelay('close')\n }\n },\n\n render (): VNode {\n if (!this.$scopedSlots.default && this.value === undefined) {\n consoleWarn('v-hover is missing a default scopedSlot or bound value', this)\n\n return null as any\n }\n\n let element: VNode | ScopedSlotChildren\n\n if (this.$scopedSlots.default) {\n element = this.$scopedSlots.default({ hover: this.isActive })\n } else if (this.$slots.default && this.$slots.default.length === 1) {\n element = this.$slots.default[0]\n }\n\n if (Array.isArray(element) && element.length === 1) {\n element = element[0]\n }\n\n if (!element || Array.isArray(element) || !element.tag) {\n consoleWarn('v-hover should only contain a single element', this)\n\n return element as any\n }\n\n if (!this.disabled) {\n element.data = element.data || {}\n this._g(element.data, {\n mouseenter: this.onMouseEnter,\n mouseleave: this.onMouseLeave\n })\n }\n\n return element\n }\n})\n"],"sourceRoot":""}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
import VHover from './VHover';
|
||||
export { VHover };
|
||||
export default VHover;
|
||||
//# sourceMappingURL=index.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/components/VHover/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAP,MAAmB,UAAnB;AAEA,SAAS,MAAT;AACA,eAAe,MAAf","sourcesContent":["import VHover from './VHover'\n\nexport { VHover }\nexport default VHover\n"],"sourceRoot":""}
|
||||
Reference in New Issue
Block a user