Vulture/VApp/node_modules/vuetify/lib/components/VSkeletonLoader/VSkeletonLoader.mjs.map

1 line
10 KiB
Plaintext
Raw Permalink Normal View History

{"version":3,"file":"VSkeletonLoader.mjs","names":["useBackgroundColor","makeDimensionProps","useDimension","makeElevationProps","useElevation","useLocale","makeThemeProps","provideTheme","computed","toRef","genericComponent","propsFactory","useRender","wrapInArray","rootTypes","actions","article","avatar","button","card","chip","divider","heading","image","ossein","paragraph","sentences","subtitle","table","text","genBone","type","children","arguments","length","undefined","_createVNode","genBones","bone","split","Array","from","map","genStructure","includes","mapBones","push","bones","replace","makeVSkeletonLoaderProps","boilerplate","Boolean","color","String","loading","loadingText","default","VSkeletonLoader","name","props","setup","_ref","slots","backgroundColorClasses","backgroundColorStyles","dimensionStyles","elevationClasses","themeClasses","t","items","join","isLoading","value"],"sources":["../../../src/components/VSkeletonLoader/VSkeletonLoader.tsx"],"sourcesContent":["// Styles\nimport './VSkeletonLoader.sass'\n\n// Composables\nimport { useBackgroundColor } from '@/composables/color'\nimport { makeDimensionProps, useDimension } from '@/composables/dimensions'\nimport { makeElevationProps, useElevation } from '@/composables/elevation'\nimport { useLocale } from '@/composables/locale'\nimport { makeThemeProps, provideTheme } from '@/composables/theme'\n\n// Utilities\nimport { computed, toRef } from 'vue'\nimport { genericComponent, propsFactory, useRender, wrapInArray } from '@/util'\n\n// Types\nimport type { PropType, VNode } from 'vue'\n\ntype VSkeletonBone<T> = T | VSkeletonBone<T>[]\n\nexport type VSkeletonBones = VSkeletonBone<VNode>\nexport type VSkeletonLoaderType = keyof typeof rootTypes\n\nexport const rootTypes = {\n actions: 'button@2',\n article: 'heading, paragraph',\n avatar: 'avatar',\n button: 'button',\n card: 'image, heading',\n 'card-avatar': 'image, list-item-avatar',\n chip: 'chip',\n 'date-picker': 'list-item, heading, divider, date-picker-options, date-picker-days, actions',\n 'date-picker-options': 'text, avatar@2',\n 'date-picker-days': 'avatar@28',\n divider: 'divider',\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 ossein: 'ossein',\n paragraph: 'text@3',\n sentences: 'text@2',\n subtitle: 'text',\n table: 'table-heading, table-thead, table-tbody, table-tfoot',\n 'table-heading': 'chip, text',\n 'table-thead': 'heading@6',\n 'table-tbody': 'table-row-divider@6',\n 'table-row-divider': 'table-row, divider',\n 'table-row': 'text@6',\n 'table-tfoot': 'text@2, avatar@2',\n text: 'text',\n} as const\n\nfunction genBone (type: string, children: VSkeletonBones = []) {\n return (\n <div\n class={[\n 'v-skeleton-loader__bone',\n `v-skeleton-loader__${type}`,\n ]}\n >\n { children }\n </div>\n )\n}\n\nfunction genBones (bone: string) {\n // e.g. 'text@3'\n const [type, length] = bone.split('@') as [VSkeletonLoaderType, number]\n\n // Generate a length array based upon\n // value after @ in the bone string\n return Array.from({ length }).map(() => genStructure(type))\n}\n\nfunction genStructure (type?: string): VSkeletonBones {\n let children: VSkeletonBones = []\n\n if (!type) return children\n\n // TODO: figure out a better way to type this\n const bone = (rootTypes as Record<string, string>)[type]\n\n // End of recursion, do nothing\n /* eslint-disable-next-line no-empty, brace-style */\n if (type === bone) {}\n // Array of values - e.g. 'heading, paragraph, text@2'\n else if (type.includes(',')) return mapBones(type)\n // Array of values - e.g. 'paragraph@4'\n else if (type.includes('@')) return genBones(type)\n // Array of values - e.g. 'card@2'\n else if (bone.includes(',')) children = mapBones(bone)\n // Array of values - e.g. 'list-item@2'\n else if (bone.inclu