VBanner.mjs.map 9.2 KB

1
  1. {"version":3,"file":"VBanner.mjs","names":["VBannerActions","VBannerText","VAvatar","VDefaultsProvider","makeBorderProps","useBorder","makeComponentProps","provideDefaults","makeDensityProps","useDensity","makeDimensionProps","useDimension","useDisplay","makeElevationProps","useElevation","IconValue","makeLocationProps","useLocation","makePositionProps","usePosition","makeRoundedProps","useRounded","makeTagProps","makeThemeProps","provideTheme","toRef","genericComponent","propsFactory","useRender","makeVBannerProps","avatar","String","color","icon","lines","stacked","Boolean","sticky","text","VBanner","name","props","setup","_ref","slots","borderClasses","densityClasses","mobile","dimensionStyles","elevationClasses","locationStyles","positionClasses","roundedClasses","themeClasses","density","hasText","hasPrependMedia","hasPrepend","prepend","_createVNode","tag","value","class","style","default","image","actions"],"sources":["../../../src/components/VBanner/VBanner.tsx"],"sourcesContent":["// Styles\nimport './VBanner.sass'\n\n// Components\nimport { VBannerActions } from './VBannerActions'\nimport { VBannerText } from './VBannerText'\nimport { VAvatar } from '@/components/VAvatar'\nimport { VDefaultsProvider } from '@/components/VDefaultsProvider'\n\n// Composables\nimport { makeBorderProps, useBorder } from '@/composables/border'\nimport { makeComponentProps } from '@/composables/component'\nimport { provideDefaults } from '@/composables/defaults'\nimport { makeDensityProps, useDensity } from '@/composables/density'\nimport { makeDimensionProps, useDimension } from '@/composables/dimensions'\nimport { useDisplay } from '@/composables/display'\nimport { makeElevationProps, useElevation } from '@/composables/elevation'\nimport { IconValue } from '@/composables/icons'\nimport { makeLocationProps, useLocation } from '@/composables/location'\nimport { makePositionProps, usePosition } from '@/composables/position'\nimport { makeRoundedProps, useRounded } from '@/composables/rounded'\nimport { makeTagProps } from '@/composables/tag'\nimport { makeThemeProps, provideTheme } from '@/composables/theme'\n\n// Utilities\nimport { toRef } from 'vue'\nimport { genericComponent, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\n\nexport type VBannerSlots = {\n default: never\n prepend: never\n text: never\n actions: never\n}\n\nexport const makeVBannerProps = propsFactory({\n avatar: String,\n color: String,\n icon: IconValue,\n lines: String as PropType<'one' | 'two' | 'three'>,\n stacked: Boolean,\n sticky: Boolean,\n text: String,\n\n ...makeBorderProps(),\n ...makeComponentProps(),\n ...makeDensityProps(),\n ...makeDimensionProps(),\n ...makeElevationProps(),\n ...makeLocationProps(),\n ...makePositionProps(),\n ...makeRoundedProps(),\n ...makeTagProps(),\n ...makeThemeProps(),\n}, 'VBanner')\n\nexport const VBanner = genericComponent<VBannerSlots>()({\n name: 'VBanner',\n\n props: makeVBannerProps(),\n\n setup (props, { slots }) {\n const { borderClasses } = useBorder(props)\n const { densityClasses } = useDensity(props)\n const { mobile } = useDisplay()\n const { dimensionStyles } = useDimension(props)\n const { elevationClasses } = useElevation(props)\n const { locationStyles } = useLocation(props)\n const { positionClasses } = usePosition(props)\n const { roundedClasses } = useRounded(props)\n\n const { themeClasses } = provideTheme(props)\n\n const color = toRef(props, 'color')\n const density = toRef(props, 'density')\n\n provideDefaults({ VBannerActions: { color, density } })\n\n useRender(() => {\n const hasText = !!(props.text || slots.text)\n const hasPrependMedia = !!(props.avatar || props.icon)\n const hasPrepend = !!(hasPrependMedia || slots.prepend)\n\n return (\n <props.tag\n class={[\n 'v-banner',\n {\n 'v-banner--stacked': props.stacked || mobile.value,\n 'v-banner--sticky': props.sticky,\n [`v-banner--${props.lines}-line`]: !!props.lines,\n },\n borderClasses.value,\n densityClasses.value,\n elevationClasses.value,\n positionClasses.value,\n roundedClasses.value,\n themeClasses.value,\n props.class,\n ]}\n style={[\n dimensionStyles.value,\n locationStyles.value,\n props.style,\n ]}\n role=\"banner\"\n >\n { hasPrepend && (\n <div key=\"prepend\" class=\"v-banner__prepend\">\n { !slots.prepend ? (\n <VAvatar\n key=\"prepend-avatar\"\n color={ color.value }\n density={ density.value }\n icon={ props.icon }\n image={ props.avatar }\n />\n ) : (\n <VDefaultsProvider\n key=\"prepend-defaults\"\n disabled={ !hasPrependMedia }\n defaults={{\n VAvatar: {\n color: color.value,\n density: density.value,\n icon: props.icon,\n image: props.avatar,\n },\n }}\n v-slots:default={ slots.prepend }\n />\n )}\n </div>\n )}\n\n <div class=\"v-banner__content\">\n { hasText && (\n <VBannerText key=\"text\">\n { slots.text?.() ?? props.text }\n </VBannerText>\n )}\n\n { slots.default?.() }\n </div>\n\n { slots.actions && (\n <VBannerActions key=\"actions\" v-slots:default={ slots.actions } />\n )}\n </props.tag>\n )\n })\n },\n})\n\nexport type VBanner = InstanceType<typeof VBanner>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,cAAc;AAAA,SACdC,WAAW;AAAA,SACXC,OAAO;AAAA,SACPC,iBAAiB,0CAE1B;AAAA,SACSC,eAAe,EAAEC,SAAS;AAAA,SAC1BC,kBAAkB;AAAA,SAClBC,eAAe;AAAA,SACfC,gBAAgB,EAAEC,UAAU;AAAA,SAC5BC,kBAAkB,EAAEC,YAAY;AAAA,SAChCC,UAAU;AAAA,SACVC,kBAAkB,EAAEC,YAAY;AAAA,SAChCC,SAAS;AAAA,SACTC,iBAAiB,EAAEC,WAAW;AAAA,SAC9BC,iBAAiB,EAAEC,WAAW;AAAA,SAC9BC,gBAAgB,EAAEC,UAAU;AAAA,SAC5BC,YAAY;AAAA,SACZC,cAAc,EAAEC,YAAY,uCAErC;AACA,SAASC,KAAK,QAAQ,KAAK;AAAA,SAClBC,gBAAgB,EAAEC,YAAY,EAAEC,SAAS,gCAElD;AAUA,OAAO,MAAMC,gBAAgB,GAAGF,YAAY,CAAC;EAC3CG,MAAM,EAAEC,MAAM;EACdC,KAAK,EAAED,MAAM;EACbE,IAAI,EAAElB,SAAS;EACfmB,KAAK,EAAEH,MAA2C;EAClDI,OAAO,EAAEC,OAAO;EAChBC,MAAM,EAAED,OAAO;EACfE,IAAI,EAAEP,MAAM;EAEZ,GAAG3B,eAAe,EAAE;EACpB,GAAGE,kBAAkB,EAAE;EACvB,GAAGE,gBAAgB,EAAE;EACrB,GAAGE,kBAAkB,EAAE;EACvB,GAAGG,k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