Vulture/VApp/node_modules/vuetify/lib/components/VGrid/VRow.mjs.map

1 line
8.9 KiB
Plaintext
Raw Normal View History

{"version":3,"file":"VRow.mjs","names":["makeComponentProps","breakpoints","makeTagProps","capitalize","computed","h","genericComponent","propsFactory","ALIGNMENT","SPACE","makeRowProps","prefix","def","reduce","props","val","prefixKey","ALIGN_VALUES","alignValidator","str","includes","alignProps","type","String","default","validator","JUSTIFY_VALUES","justifyValidator","justifyProps","ALIGN_CONTENT_VALUES","alignContentValidator","alignContentProps","propMap","align","Object","keys","justify","alignContent","classMap","breakpointClass","prop","className","undefined","breakpoint","replace","toLowerCase","makeVRowProps","dense","Boolean","noGutters","VRow","name","setup","_ref","slots","classes","classList","forEach","value","push","tag","class","style"],"sources":["../../../src/components/VGrid/VRow.ts"],"sourcesContent":["// Styles\nimport './VGrid.sass'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { breakpoints } from '@/composables/display'\nimport { makeTagProps } from '@/composables/tag'\n\n// Utilities\nimport { capitalize, computed, h } from 'vue'\nimport { genericComponent, propsFactory } from '@/util'\n\n// Types\nimport type { Prop, PropType } from 'vue'\nimport type { Breakpoint } from '@/composables/display'\n\nconst ALIGNMENT = ['start', 'end', 'center'] as const\n\ntype BreakpointAlign = `align${Capitalize<Breakpoint>}`\ntype BreakpointJustify = `justify${Capitalize<Breakpoint>}`\ntype BreakpointAlignContent = `alignContent${Capitalize<Breakpoint>}`\n\nconst SPACE = ['space-between', 'space-around', 'space-evenly'] as const\n\nfunction makeRowProps <\n Name extends BreakpointAlign | BreakpointJustify | BreakpointAlignContent,\n Type,\n> (prefix: string, def: () => Prop<Type, null>) {\n return breakpoints.reduce((props, val) => {\n const prefixKey = prefix + capitalize(val) as Name\n props[prefixKey] = def()\n return props\n }, {} as Record<Name, Prop<Type, null>>)\n}\n\nconst ALIGN_VALUES = [...ALIGNMENT, 'baseline', 'stretch'] as const\ntype AlignValue = typeof ALIGN_VALUES[number]\nconst alignValidator = (str: any) => ALIGN_VALUES.includes(str)\nconst alignProps = makeRowProps<BreakpointAlign, AlignValue>('align', () => ({\n type: String as PropType<AlignValue>,\n default: null,\n validator: alignValidator,\n}))\n\nconst JUSTIFY_VALUES = [...ALIGNMENT, ...SPACE] as const\ntype JustifyValue = typeof JUSTIFY_VALUES[number]\nconst justifyValidator = (str: any) => JUSTIFY_VALUES.includes(str)\nconst justifyProps = makeRowProps<BreakpointJustify, JustifyValue>('justify', () => ({\n type: String as PropType<JustifyValue>,\n default: null,\n validator: justifyValidator,\n}))\n\nconst ALIGN_CONTENT_VALUES = [...ALIGNMENT, ...SPACE, 'stretch'] as const\ntype AlignContentValue = typeof ALIGN_CONTENT_VALUES[number]\nconst alignContentValidator = (str: any) => ALIGN_CONTENT_VALUES.includes(str)\nconst alignContentProps = makeRowProps<BreakpointAlignContent, AlignContentValue>('alignContent', () => ({\n type: String as PropType<AlignContentValue>,\n default: null,\n validator: alignContentValidator,\n}))\n\nconst propMap = {\n align: Object.keys(alignProps),\n justify: Object.keys(justifyProps),\n alignContent: Object.keys(alignContentProps),\n}\n\nconst classMap = {\n align: 'align',\n justify: 'justify',\n alignContent: 'align-content',\n}\n\nfunction breakpointClass (type: keyof typeof propMap, prop: string, val: string) {\n let className = classMap[type]\n if (val == null) {\n return undefined\n }\n if (prop) {\n // alignSm -> Sm\n const breakpoint = prop.replace(type, '')\n className += `-${breakpoint}`\n }\n // .align-items-sm-center\n className += `-${val}`\n return className.toLowerCase()\n}\n\nexport const makeVRowProps = propsFactory({\n dense: Boolean,\n noGutters: Boolean,\n align: {\n type: String as PropType<typeof ALIGN_VALUES[number]>,\n default: null,\n validator: alignValidator,\n },\n ...alignProps,\n justify: {\n type: String as PropType<typeof ALIGN_CONTENT_VALUES[number]>,\n default: n