{"version":3,"file":"VSkeletonLoader-Ca7okvpr.js","sources":["../../../node_modules/.pnpm/vuetify@2.7.2_vue@2.7.16/node_modules/vuetify/lib/components/VSkeletonLoader/VSkeletonLoader.js"],"sourcesContent":["// Styles\nimport \"../../../src/components/VSkeletonLoader/VSkeletonLoader.sass\"; // Mixins\n\nimport Elevatable from '../../mixins/elevatable';\nimport Measurable from '../../mixins/measurable';\nimport Themeable from '../../mixins/themeable'; // Utilities\n\nimport mixins from '../../util/mixins';\nimport { getSlot } from '../../util/helpers';\n/* @vue/component */\n\nexport default mixins(Elevatable, Measurable, Themeable).extend({\n name: 'VSkeletonLoader',\n props: {\n boilerplate: Boolean,\n loading: Boolean,\n loadingText: {\n type: String,\n default: '$vuetify.loading'\n },\n tile: Boolean,\n transition: String,\n type: String,\n types: {\n type: Object,\n default: () => ({})\n }\n },\n computed: {\n attrs() {\n if (!this.isLoading) return this.$attrs;\n return {\n 'aria-busy': !this.boilerplate ? true : undefined,\n 'aria-live': !this.boilerplate ? 'polite' : undefined,\n 'aria-label': !this.boilerplate ? this.$vuetify.lang.t(this.loadingText) : undefined,\n role: !this.boilerplate ? 'alert' : undefined,\n ...this.$attrs\n };\n },\n\n classes() {\n return {\n 'v-skeleton-loader--boilerplate': this.boilerplate,\n 'v-skeleton-loader--is-loading': this.isLoading,\n 'v-skeleton-loader--tile': this.tile,\n ...this.themeClasses,\n ...this.elevationClasses\n };\n },\n\n isLoading() {\n return !('default' in this.$scopedSlots) || this.loading;\n },\n\n rootTypes() {\n return {\n actions: 'button@2',\n article: 'heading, paragraph',\n avatar: 'avatar',\n button: 'button',\n card: 'image, card-heading',\n 'card-avatar': 'image, list-item-avatar',\n 'card-heading': 'heading',\n chip: 'chip',\n 'date-picker': 'list-item, card-heading, divider, date-picker-options, date-picker-days, actions',\n 'date-picker-options': 'text, avatar@2',\n 'date-picker-days': 'avatar@28',\n heading: 'heading',\n image: 'image',\n 'list-item': 'text',\n 'list-item-avatar': 'avatar, text',\n 'list-item-two-line': 'sentences',\n 'list-item-avatar-two-line': 'avatar, sentences',\n 'list-item-three-line': 'paragraph',\n 'list-item-avatar-three-line': 'avatar, paragraph',\n paragraph: 'text@3',\n sentences: 'text@2',\n table: 'table-heading, table-thead, table-tbody, table-tfoot',\n 'table-heading': 'heading, text',\n 'table-thead': 'heading@6',\n 'table-tbody': 'table-row-divider@6',\n 'table-row-divider': 'table-row, divider',\n 'table-row': 'table-cell@6',\n 'table-cell': 'text',\n 'table-tfoot': 'text@2, avatar@2',\n text: 'text',\n ...this.types\n };\n }\n\n },\n methods: {\n genBone(text, children) {\n return this.$createElement('div', {\n staticClass: `v-skeleton-loader__${text} v-skeleton-loader__bone`\n }, children);\n },\n\n genBones(bone) {\n // e.g. 'text@3'\n const [type, length] = bone.split('@');\n\n const generator = () => this.genStructure(type); // Generate a length array based upon\n // value after @ in the bone string\n\n\n return Array.from({\n length\n }).map(generator);\n },\n\n // Fix type when this is merged\n // https://github.com/microsoft/TypeScript/pull/33050\n genStructure(type) {\n let children = [];\n type = type || this.type || '';\n const bone = this.rootTypes[type] || ''; // End of recursion, do nothing\n\n /* eslint-disable-next-line no-empty, brace-style */\n\n if (type === bone) {} // Array of values - e.g. 'heading, paragraph, text@2'\n else if (type.indexOf(',') > -1) return this.mapBones(type); // Array of values - e.g. 'paragraph@4'\n else if (type.indexOf('@') > -1) return this.genBones(type); // Array of values - e.g. 'card@2'\n else if (bone.indexOf(',') > -1) children = this.mapBones(bone); // Array of values - e.g. 'list-item@2'\n else if (bone.indexOf('@') > -1) children = this.genBones(bone); // Single value - e.g. 'card-heading'\n else if (bone) children.push(this.genStructure(bone));\n\n return [this.genBone(type, children)];\n },\n\n genSkeleton() {\n const children = [];\n if (!this.isLoading) children.push(getSlot(this));else children.push(this.genStructure());\n /* istanbul ignore else */\n\n if (!this.transition) return children;\n /* istanbul ignore next */\n\n return this.$createElement('transition', {\n props: {\n name: this.transition\n },\n // Only show transition when\n // content has been loaded\n on: {\n afterEnter: this.resetStyles,\n beforeEnter: this.onBeforeEnter,\n beforeLeave: this.onBeforeLeave,\n leaveCancelled: this.resetStyles\n }\n }, children);\n },\n\n mapBones(bones) {\n // Remove spaces and return array of structures\n return bones.replace(/\\s/g, '').split(',').map(this.genStructure);\n },\n\n onBeforeEnter(el) {\n this.resetStyles(el);\n if (!this.isLoading) return;\n el._initialStyle = {\n display: el.style.display,\n transition: el.style.transition\n };\n el.style.setProperty('transition', 'none', 'important');\n },\n\n onBeforeLeave(el) {\n el.style.setProperty('display', 'none', 'important');\n },\n\n resetStyles(el) {\n if (!el._initialStyle) return;\n el.style.display = el._initialStyle.display || '';\n el.style.transition = el._initialStyle.transition;\n delete el._initialStyle;\n }\n\n },\n\n render(h) {\n return h('div', {\n staticClass: 'v-skeleton-loader',\n attrs: this.attrs,\n on: this.$listeners,\n class: this.classes,\n style: this.isLoading ? this.measurableStyles : undefined\n }, [this.genSkeleton()]);\n }\n\n});\n//# sourceMappingURL=VSkeletonLoader.js.map"],"names":["__unplugin_components_1","mixins","Elevatable","Measurable","Themeable","__spreadValues","text","children","bone","type","length","generator","getSlot","bones","el","h"],"mappings":"+xBAWA,MAAeA,EAAAC,EAAOC,EAAYC,EAAYC,CAAS,EAAE,OAAO,CAC9D,KAAM,kBACN,MAAO,CACL,YAAa,QACb,QAAS,QACT,YAAa,CACX,KAAM,OACN,QAAS,kBACV,EACD,KAAM,QACN,WAAY,OACZ,KAAM,OACN,MAAO,CACL,KAAM,OACN,QAAS,KAAO,CAAE,EACxB,CACG,EACD,SAAU,CACR,OAAQ,CACN,OAAK,KAAK,UACHC,EAAA,CACL,YAAc,KAAK,YAAqB,OAAP,GACjC,YAAc,KAAK,YAAyB,OAAX,SACjC,aAAe,KAAK,YAAuD,OAAzC,KAAK,SAAS,KAAK,EAAE,KAAK,WAAW,EACvE,KAAO,KAAK,YAAwB,OAAV,SACvB,KAAK,QANkB,KAAK,MAQlC,EAED,SAAU,CACR,OAAOA,IAAA,CACL,iCAAkC,KAAK,YACv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