1 line
2.1 KiB
Text
1 line
2.1 KiB
Text
|
{"version":3,"sources":["../../../src/mixins/delayable/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAgB,KAAhB;AAEA;;;;;;;;AAOA,eAAe,GAAG,CAAC,MAAJ,GAA2C,MAA3C,CAAkD;AAC/D,EAAA,IAAI,EAAE,WADyD;AAG/D,EAAA,KAAK,EAAE;AACL,IAAA,SAAS,EAAE;AACT,MAAA,IAAI,EAAE,CAAC,MAAD,EAAS,MAAT,CADG;AAET,MAAA,OAAO,EAAE;AAFA,KADN;AAKL,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,CAAC,MAAD,EAAS,MAAT,CADI;AAEV,MAAA,OAAO,EAAE;AAFC;AALP,GAHwD;AAc/D,EAAA,IAAI,EAAE,OAAO;AACX,IAAA,WAAW,EAAE,SADF;AAEX,IAAA,YAAY,EAAE;AAFH,GAAP,CAdyD;AAmB/D,EAAA,OAAO,EAAE;AACP;;;AAGA,IAAA,UAAU,GAAA;AACR,MAAA,YAAY,CAAC,KAAK,WAAN,CAAZ;AACA,MAAA,YAAY,CAAC,KAAK,YAAN,CAAZ;AACD,KAPM;;AAQP;;;AAGA,IAAA,QAAQ,CAAE,IAAF,EAA0B,EAA1B,EAAyC;AAC/C,WAAK,UAAL;AAEA,YAAM,KAAK,GAAG,QAAQ,CAAE,KAAa,GAAG,IAAI,OAApB,CAAF,EAAgC,EAAhC,CAAtB;AAEE,WAAa,GAAG,IAAI,SAApB,IAAiC,UAAU,CAAC,EAAE,KAAK,MAAK;AACxD,aAAK,QAAL,GAAgB;AAAE,UAAA,IAAI,EAAE,IAAR;AAAc,UAAA,KAAK,EAAE;AAArB,UAA6B,IAA7B,CAAhB;AACD,OAF+C,CAAH,EAEzC,KAFyC,CAA3C;AAGH;;AAnBM;AAnBsD,CAAlD,CAAf","sourcesContent":["import Vue from 'vue'\n\n/**\n * Delayable\n *\n * @mixin\n *\n * Changes the open or close delay time for elements\n */\nexport default Vue.extend<Vue & { isActive?: boolean }>().extend({\n name: 'delayable',\n\n props: {\n openDelay: {\n type: [Number, String],\n default: 0,\n },\n closeDelay: {\n type: [Number, String],\n default: 0,\n },\n },\n\n data: () => ({\n openTimeout: undefined as number | undefined,\n closeTimeout: undefined as number | undefined,\n }),\n\n methods: {\n /**\n * Clear any pending delay timers from executing\n */\n clearDelay (): void {\n clearTimeout(this.openTimeout)\n clearTimeout(this.closeTimeout)\n },\n /**\n * Runs callback after a specified delay\n */\n runDelay (type: 'open' | 'close', cb?: () => void): void {\n this.clearDelay()\n\n const delay = parseInt((this as any)[`${type}Delay`], 10)\n\n ;(this as any)[`${type}Timeout`] = setTimeout(cb || (() => {\n this.isActive = { open: true, close: false }[type]\n }), delay)\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"}
|