This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/vuetify/lib/mixins/activatable/index.js.map
2019-08-11 20:48:02 +02:00

1 line
No EOL
6.4 KiB
Text

{"version":3,"sources":["../../../src/mixins/activatable/index.ts"],"names":[],"mappings":"AAAA;AACA,OAAO,SAAP,MAAsB,cAAtB;AACA,OAAO,UAAP,MAAuB,eAAvB,C,CAEA;;AACA,OAAO,MAAP,MAAmB,mBAAnB;AACA,SAAS,OAAT,EAAkB,WAAlB,QAAqC,oBAArC;AACA,SAAS,YAAT,QAA6B,oBAA7B;AAMA,MAAM,UAAU,GAAG,MAAM,CACvB,SADuB,EAEvB,UAFuB,CAAzB;AAKA;;AACA,eAAe,UAAU,CAAC,MAAX,CAAkB;AAC/B,EAAA,IAAI,EAAE,aADyB;AAG/B,EAAA,KAAK,EAAE;AACL,IAAA,SAAS,EAAE;AACT,MAAA,OAAO,EAAE,IADA;AAET,MAAA,SAAS,EAAG,GAAD,IAAyB;AAClC,eAAO,CAAC,QAAD,EAAW,QAAX,EAAqB,QAArB,CAA8B,OAAO,GAArC,CAAP;AACD;AAJQ,KADN;AAOL,IAAA,QAAQ,EAAE,OAPL;AAQL,IAAA,iBAAiB,EAAE,OARd;AASL,IAAA,WAAW,EAAE;AATR,GAHwB;AAe/B,EAAA,IAAI,EAAE,OAAO;AACX,IAAA,gBAAgB,EAAE,IADP;AAEX,IAAA,aAAa,EAAE;AAFJ,GAAP,CAfyB;AAoB/B,EAAA,KAAK,EAAE;AACL,IAAA,SAAS,GAAA;AACP,WAAK,gBAAL,GAAwB,IAAxB;AACA,WAAK,YAAL;AACD;;AAJI,GApBwB;;AA2B/B,EAAA,OAAO,GAAA;AACL,UAAM,QAAQ,GAAG,WAAW,CAAC,IAAD,EAAO,WAAP,EAAoB,IAApB,CAA5B;;AAEA,QAAI,QAAQ,IAAI,CAAC,QAAD,EAAW,QAAX,EAAqB,QAArB,CAA8B,QAA9B,CAAhB,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,UAAV,GAAwB,CAAD,IAAkB;AACvC,eAAK,YAAL,CAAkB,CAAlB;AACA,eAAK,QAAL,CAAc,OAAd;AACD,SAHD;AAID,OATD,MASO;AACL,QAAA,SAAS,CAAC,KAAV,GAAmB,CAAD,IAAkB;AAClC,gBAAM,SAAS,GAAG,KAAK,YAAL,CAAkB,CAAlB,CAAlB;AAEA,cAAI,SAAJ,EAAe,SAAS,CAAC,KAAV;AAEf,eAAK,QAAL,GAAgB,CAAC,KAAK,QAAtB;AACD,SAND;AAOD;;AAED,aAAO,SAAP;AACD,KAzDM;;AA0DP,IAAA,YAAY,CAAE,CAAF,EAAW;AACrB;AACA,UAAI,KAAK,gBAAT,EAA2B,OAAO,KAAK,gBAAZ;AAE3B,UAAI,SAAS,GAAG,IAAhB;;AAEA,UAAI,KAAK,SAAT,EAAoB;AAClB,cAAM,MAAM,GAAG,KAAK,iBAAL,GAAyB,KAAK,GAA9B,GAAoC,QAAnD;AAEA,QAAA,SAAS,GAAG,OAAO,KAAK,SAAZ,KAA0B,QAA1B,GACR,MAAM,CAAC,aAAP,CAAqB,KAAK,SAA1B,CADQ,GAER,KAAK,SAFT;AAGD,OAND,MAMO,IAAI,CAAJ,EAAO;AACZ,QAAA,SAAS,GAAG,CAAC,CAAC,aAAF,IAAmB,CAAC,CAAC,MAAjC;AACD,OAFM,MAEA,IAAI,KAAK,aAAL,CAAmB,MAAvB,EAA+B;AACpC,QAAA,SAAS,GAAG,KAAK,aAAL,CAAmB,CAAnB,EAAsB,GAAlC;AACD;;AAED,WAAK,gBAAL,GAAwB,SAAxB;AAEA,aAAO,KAAK,gBAAZ;AACD;;AA/EM;AAnCsB,CAAlB,CAAf","sourcesContent":["// Mixins\nimport Delayable from '../delayable'\nimport Toggleable from '../toggleable'\n\n// Utilities\nimport mixins from '../../util/mixins'\nimport { getSlot, getSlotType } from '../../util/helpers'\nimport { consoleError } from '../../util/console'\n\n// Types\nimport { PropValidator } from 'vue/types/options'\nimport { VNode } from 'vue'\n\nconst baseMixins = mixins(\n Delayable,\n Toggleable\n)\n\n/* @vue/component */\nexport default baseMixins.extend({\n name: 'activatable',\n\n props: {\n activator: {\n default: null,\n validator: (val: string | object) => {\n return ['string', 'object'].includes(typeof val)\n },\n } as PropValidator<string | HTMLElement>,\n disabled: Boolean,\n internalActivator: Boolean,\n openOnHover: Boolean,\n },\n\n data: () => ({\n activatorElement: null as null | HTMLElement,\n activatorNode: [] as VNode[],\n }),\n\n watch: {\n activator () {\n this.activatorElement = null\n this.getActivator()\n },\n },\n\n mounted () {\n const slotType = getSlotType(this, 'activator', true)\n\n if (slotType && ['v-slot', 'normal'].includes(slotType)) {\n consoleError(`The activator slot must be bound, try '<template v-slot:activator=\"{ on }\"><v-btn v-on=\"on\">'`, this)\n }\n },\n\n methods: {\n getValueProxy (): object {\n const self = this\n return {\n get value () {\n return self.isActive\n },\n set value (isActive: boolean) {\n self.isActive = isActive\n },\n }\n },\n genActivator () {\n const node = getSlot(this, 'activator', Object.assign(this.getValueProxy(), {\n on: this.genActivatorListeners(),\n attrs: this.genActivatorAttributes(),\n })) || []\n\n this.activatorNode = node\n\n return node\n },\n getContentSlot () {\n return getSlot(this, 'default', this.getValueProxy(), true)\n },\n genActivatorAttributes () {\n return {\n role: 'button',\n 'aria-haspopup': true,\n 'aria-expanded': String(this.isActive),\n }\n },\n genActivatorListeners () {\n if (this.disabled) return {}\n\n const listeners: Record<string, (e: MouseEvent & KeyboardEvent) => void> = {}\n\n if (this.openOnHover) {\n listeners.mouseenter = (e: MouseEvent) => {\n this.getActivator(e)\n this.runDelay('open')\n }\n listeners.mouseleave = (e: MouseEvent) => {\n this.getActivator(e)\n this.runDelay('close')\n }\n } else {\n listeners.click = (e: MouseEvent) => {\n const activator = this.getActivator(e)\n\n if (activator) activator.focus()\n\n this.isActive = !this.isActive\n }\n }\n\n return listeners\n },\n getActivator (e?: Event): HTMLElement | null {\n // If we've already fetched the activator, re-use\n if (this.activatorElement) return this.activatorElement\n\n let activator = null\n\n if (this.activator) {\n const target = this.internalActivator ? this.$el : document\n\n activator = typeof this.activator === 'string'\n ? target.querySelector(this.activator)\n : this.activator\n } else if (e) {\n activator = e.currentTarget || e.target\n } else if (this.activatorNode.length) {\n activator = this.activatorNode[0].elm\n }\n\n this.activatorElement = activator as HTMLElement\n\n return this.activatorElement\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"}