|
1 |
- {"version":3,"sources":["../../src/mixins/delayable.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAgB,KAAhB;AAEA;;;;;;;AAOA,eAAe,IAAI,MAAJ,GAA2C,MAA3C,CAAkD;AAC/D,UAAM,WADyD;AAG/D,WAAO;AACL,mBAAW;AACT,kBAAM,CAAC,MAAD,EAAS,MAAT,CADG;AAET,qBAAS;AAFA,SADN;AAKL,oBAAY;AACV,kBAAM,CAAC,MAAD,EAAS,MAAT,CADI;AAEV,qBAAS;AAFC;AALP,KAHwD;AAc/D,UAAM;AAAA,eAAO;AACX,yBAAa,SADF;AAEX,0BAAc;AAFH,SAAP;AAAA,KAdyD;AAmB/D,aAAS;AACP;;;AAGA,kBAJO,wBAIG;AACR,yBAAa,KAAK,WAAlB;AACA,yBAAa,KAAK,YAAlB;AACD,SAPM;;AAQP;;;AAGA,gBAXO,oBAWG,IAXH,EAW2B,EAX3B,EAW0C;AAAA;;AAC/C,iBAAK,UAAL;AAEA,gBAAM,QAAQ,SAAU,KAAgB,IAAhB,WAAV,EAAwC,EAAxC,CAAd;AAEE,iBAAgB,IAAhB,gBAAiC,WAAW,MAAO,YAAK;AACxD,sBAAK,QAAL,GAAgB,EAAE,MAAM,IAAR,EAAc,OAAO,KAArB,GAA6B,IAA7B,CAAhB;AACD,aAFkC,EAE/B,KAF+B,CAAjC;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":""}
|