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

1 line
5.5 KiB
Plaintext
Raw Normal View History

{"version":3,"file":"VIcon.mjs","names":["useTextColor","makeComponentProps","IconValue","useIcon","makeSizeProps","useSize","makeTagProps","makeThemeProps","provideTheme","computed","ref","Text","toRef","convertToUnit","flattenFragments","genericComponent","propsFactory","useRender","makeVIconProps","color","String","start","Boolean","end","icon","tag","VIcon","name","props","setup","_ref","attrs","slots","slotIcon","themeClasses","iconData","value","sizeClasses","textColorClasses","textColorStyles","slotValue","default","filter","node","type","children","_createVNode","component","onClick","class","fontSize","size","height","width","undefined","style"],"sources":["../../../src/components/VIcon/VIcon.tsx"],"sourcesContent":["// Styles\nimport './VIcon.sass'\n\n// Composables\nimport { useTextColor } from '@/composables/color'\nimport { makeComponentProps } from '@/composables/component'\nimport { IconValue, useIcon } from '@/composables/icons'\nimport { makeSizeProps, useSize } from '@/composables/size'\nimport { makeTagProps } from '@/composables/tag'\nimport { makeThemeProps, provideTheme } from '@/composables/theme'\n\n// Utilities\nimport { computed, ref, Text, toRef } from 'vue'\nimport { convertToUnit, flattenFragments, genericComponent, propsFactory, useRender } from '@/util'\n\nexport const makeVIconProps = propsFactory({\n color: String,\n start: Boolean,\n end: Boolean,\n icon: IconValue,\n\n ...makeComponentProps(),\n ...makeSizeProps(),\n ...makeTagProps({ tag: 'i' }),\n ...makeThemeProps(),\n}, 'VIcon')\n\nexport const VIcon = genericComponent()({\n name: 'VIcon',\n\n props: makeVIconProps(),\n\n setup (props, { attrs, slots }) {\n const slotIcon = ref<string>()\n\n const { themeClasses } = provideTheme(props)\n const { iconData } = useIcon(computed(() => slotIcon.value || props.icon))\n const { sizeClasses } = useSize(props)\n const { textColorClasses, textColorStyles } = useTextColor(toRef(props, 'color'))\n\n useRender(() => {\n const slotValue = slots.default?.()\n if (slotValue) {\n slotIcon.value = flattenFragments(slotValue).filter(node =>\n node.type === Text && node.children && typeof node.children === 'string'\n )[0]?.children as string\n }\n\n return (\n <iconData.value.component\n tag={ props.tag }\n icon={ iconData.value.icon }\n class={[\n 'v-icon',\n 'notranslate',\n themeClasses.value,\n sizeClasses.value,\n textColorClasses.value,\n {\n 'v-icon--clickable': !!attrs.onClick,\n 'v-icon--start': props.start,\n 'v-icon--end': props.end,\n },\n props.class,\n ]}\n style={[\n !sizeClasses.value ? ({\n fontSize: convertToUnit(props.size),\n height: convertToUnit(props.size),\n width: convertToUnit(props.size),\n }) : undefined,\n textColorStyles.value,\n props.style,\n ]}\n role={ attrs.onClick ? 'button' : undefined }\n aria-hidden={ !attrs.onClick }\n >\n { slotValue }\n </iconData.value.component>\n )\n })\n\n return {}\n },\n})\n\nexport type VIcon = InstanceType<typeof VIcon>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,YAAY;AAAA,SACZC,kBAAkB;AAAA,SAClBC,SAAS,EAAEC,OAAO;AAAA,SAClBC,aAAa,EAAEC,OAAO;AAAA,SACtBC,YAAY;AAAA,SACZC,cAAc,EAAEC,YAAY,uCAErC;AACA,SAASC,QAAQ,EAAEC,GAAG,EAAEC,IAAI,EAAEC,KAAK,QAAQ,KAAK;AAAA,SACvCC,aAAa,EAAEC,gBAAgB,EAAEC,gBAAgB,EAAEC,YAAY,EAAEC,SAAS;AAEnF,OAAO,MAAMC,cAAc,GAAGF,YAAY,CAAC;EACzCG,KAAK,EAAEC,MAAM;EACbC,KAAK,EAAEC,OAAO;EACdC,GAAG,EAAED,OAAO;EACZE,IAAI,EAAEtB,SAAS;EAEf,GAAGD,kBAAkB,CAAC,CAAC;EACvB,GAAGG,aAAa,CAAC,CAAC;EAClB,GAAGE,YAAY,CAAC;IAAEmB,GAAG,EAAE;EAAI,CAAC,CAAC;EAC7B,GAAGlB,cAAc,CAAC;AACpB,CAAC,EAAE,OAAO,CAAC;AAEX,OAAO,MAAMmB,KAAK,GAAGX,gBAAgB,CAAC,CAAC,CAAC;EACtCY,IAAI,EAAE,OAAO;EAEbC,KAAK,EAAEV,cAAc,CAAC,CAAC;EAEvBW,KAAKA,CAAED,KAAK,EAAAE,IAAA,EAAoB;IAAA,IAAlB;M