1 line
No EOL
1.8 KiB
Text
1 line
No EOL
1.8 KiB
Text
{"version":3,"sources":["../../../src/mixins/bootable/index.ts"],"names":[],"mappings":"AAAA;AACA,SAAS,OAAT,QAAwB,oBAAxB,C,CAEA;;AACA,OAAO,GAAP,MAA2B,KAA3B;AAKA;;;;;;;;;AAQA;;AACA,eAAe,GAAG,CAAC,MAAJ,GAA+B,MAA/B,CAAsC;AACnD,EAAA,IAAI,EAAE,UAD6C;AAGnD,EAAA,KAAK,EAAE;AACL,IAAA,KAAK,EAAE;AADF,GAH4C;AAOnD,EAAA,IAAI,EAAE,OAAO;AACX,IAAA,QAAQ,EAAE;AADC,GAAP,CAP6C;AAWnD,EAAA,QAAQ,EAAE;AACR,IAAA,UAAU,GAAA;AACR,aAAO,KAAK,QAAL,IAAiB,KAAK,KAAtB,IAA+B,KAAK,QAA3C;AACD;;AAHO,GAXyC;AAiBnD,EAAA,KAAK,EAAE;AACL,IAAA,QAAQ,GAAA;AACN,WAAK,QAAL,GAAgB,IAAhB;AACD;;AAHI,GAjB4C;;AAuBnD,EAAA,OAAO,GAAA;AACL;AACA,QAAI,UAAU,KAAK,MAAnB,EAA2B;AACzB,MAAA,OAAO,CAAC,MAAD,EAAS,IAAT,CAAP;AACD;AACF,GA5BkD;;AA8BnD,EAAA,OAAO,EAAE;AACP,IAAA,eAAe,CAAE,OAAF,EAAmB;AAChC,aAAO,KAAK,UAAL,GAAkB,OAAlB,GAA4B,SAAnC;AACD;;AAHM;AA9B0C,CAAtC,CAAf","sourcesContent":["// Utilities\nimport { removed } from '../../util/console'\n\n// Types\nimport Vue, { VNode } from 'vue'\ninterface Toggleable extends Vue {\n isActive?: boolean\n}\n\n/**\n * Bootable\n * @mixin\n *\n * Used to add lazy content functionality to components\n * Looks for change in \"isActive\" to automatically boot\n * Otherwise can be set manually\n */\n/* @vue/component */\nexport default Vue.extend<Vue & Toggleable>().extend({\n name: 'bootable',\n\n props: {\n eager: Boolean,\n },\n\n data: () => ({\n isBooted: false,\n }),\n\n computed: {\n hasContent (): boolean | undefined {\n return this.isBooted || this.eager || this.isActive\n },\n },\n\n watch: {\n isActive () {\n this.isBooted = true\n },\n },\n\n created () {\n /* istanbul ignore next */\n if ('lazy' in this.$attrs) {\n removed('lazy', this)\n }\n },\n\n methods: {\n showLazyContent (content?: VNode[]): VNode[] | undefined {\n return this.hasContent ? content : undefined\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"} |