1 |
- {"version":3,"file":"VBottomNavigation.mjs","names":["VBtnToggleSymbol","makeBorderProps","useBorder","useBackgroundColor","makeComponentProps","provideDefaults","makeDensityProps","useDensity","makeElevationProps","useElevation","makeGroupProps","useGroup","makeLayoutItemProps","useLayoutItem","makeRoundedProps","useRounded","useSsrBoot","makeTagProps","makeThemeProps","useTheme","computed","toRef","convertToUnit","genericComponent","propsFactory","useRender","makeVBottomNavigationProps","bgColor","String","color","grow","Boolean","mode","type","validator","v","includes","height","Number","default","active","name","tag","modelValue","selectedClass","VBottomNavigation","props","emits","value","setup","_ref","slots","themeClasses","borderClasses","backgroundColorClasses","backgroundColorStyles","densityClasses","elevationClasses","roundedClasses","ssrBootStyles","density","isActive","layoutItemStyles","id","order","parseInt","position","layoutSize","elementSize","absolute","VBtn","stacked","variant","scoped","_createVNode","class","transform","style"],"sources":["../../../src/components/VBottomNavigation/VBottomNavigation.tsx"],"sourcesContent":["// Styles\nimport './VBottomNavigation.sass'\n\n// Components\nimport { VBtnToggleSymbol } from '@/components/VBtnToggle/VBtnToggle'\n\n// Composables\nimport { makeBorderProps, useBorder } from '@/composables/border'\nimport { useBackgroundColor } from '@/composables/color'\nimport { makeComponentProps } from '@/composables/component'\nimport { provideDefaults } from '@/composables/defaults'\nimport { makeDensityProps, useDensity } from '@/composables/density'\nimport { makeElevationProps, useElevation } from '@/composables/elevation'\nimport { makeGroupProps, useGroup } from '@/composables/group'\nimport { makeLayoutItemProps, useLayoutItem } from '@/composables/layout'\nimport { makeRoundedProps, useRounded } from '@/composables/rounded'\nimport { useSsrBoot } from '@/composables/ssrBoot'\nimport { makeTagProps } from '@/composables/tag'\nimport { makeThemeProps, useTheme } from '@/composables/theme'\n\n// Utilities\nimport { computed, toRef } from 'vue'\nimport { convertToUnit, genericComponent, propsFactory, useRender } from '@/util'\n\nexport const makeVBottomNavigationProps = propsFactory({\n bgColor: String,\n color: String,\n grow: Boolean,\n mode: {\n type: String,\n validator: (v: any) => !v || ['horizontal', 'shift'].includes(v),\n },\n height: {\n type: [Number, String],\n default: 56,\n },\n active: {\n type: Boolean,\n default: true,\n },\n\n ...makeBorderProps(),\n ...makeComponentProps(),\n ...makeDensityProps(),\n ...makeElevationProps(),\n ...makeRoundedProps(),\n ...makeLayoutItemProps({ name: 'bottom-navigation' }),\n ...makeTagProps({ tag: 'header' }),\n ...makeGroupProps({\n modelValue: true,\n selectedClass: 'v-btn--selected',\n }),\n ...makeThemeProps(),\n}, 'VBottomNavigation')\n\nexport const VBottomNavigation = genericComponent()({\n name: 'VBottomNavigation',\n\n props: makeVBottomNavigationProps(),\n\n emits: {\n 'update:modelValue': (value: any) => true,\n },\n\n setup (props, { slots }) {\n const { themeClasses } = useTheme()\n const { borderClasses } = useBorder(props)\n const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(toRef(props, 'bgColor'))\n const { densityClasses } = useDensity(props)\n const { elevationClasses } = useElevation(props)\n const { roundedClasses } = useRounded(props)\n const { ssrBootStyles } = useSsrBoot()\n const height = computed(() => (\n Number(props.height) -\n (props.density === 'comfortable' ? 8 : 0) -\n (props.density === 'compact' ? 16 : 0)\n ))\n const isActive = toRef(props, 'active')\n const { layoutItemStyles } = useLayoutItem({\n id: props.name,\n order: computed(() => parseInt(props.order, 10)),\n position: computed(() => 'bottom'),\n layoutSize: computed(() => isActive.value ? height.value : 0),\n elementSize: height,\n active: isActive,\n absolute: toRef(props, 'absolute'),\n })\n\n useGroup(props, VBtnToggleSymbol)\n\n provideDefaults({\n VBtn: {\n color: toRef(props, 'color'),\n density: toRef(props, 'density'),\n stacked: computed(() => props.mode !== 'horizontal'),\n variant: 'text',\n },\n }, { scoped: true })\n\n useRender(() => {\n return (\n <props.tag\n class={[\n 'v-bottom-navigation',\n {\n 'v-bottom-navigation--active': isActive.value,\n 'v-bottom-navigation--grow': props.grow,\n 'v-bottom-navigation--shift': props.mode === 'shift',\n },\n themeClasses.value,\n backgroundColorClasses.value,\n borderClasses.value,\n densityClasses.value,\n elevationClasses.value,\n roundedClasses.value,\n props.class,\n ]}\n style={[\n backgroundColorStyles.value,\n layoutItemStyles.value,\n {\n height: convertToUnit(height.value),\n transform: `translateY(${convertToUnit(!isActive.value ? 100 : 0, '%')})`,\n },\n ssrBootStyles.value,\n props.style,\n ]}\n >\n { slots.default && (\n <div class=\"v-bottom-navigation__content\">\n { slots.default() }\n </div>\n )}\n </props.tag>\n )\n })\n\n return {}\n },\n})\n\nexport type VBottomNavigation = InstanceType<typeof VBottomNavigation>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,gBAAgB,wCAEzB;AAAA,SACSC,eAAe,EAAEC,SAAS;AAAA,SAC1BC,kBAAkB;AAAA,SAClBC,kBAAkB;AAAA,SAClBC,eAAe;AAAA,SACfC,gBAAgB,EAAEC,UAAU;AAAA,SAC5BC,kBAAkB,EAAEC,YAAY;AAAA,SAChCC,cAAc,EAAEC,QAAQ;AAAA,SACxBC,mBAAmB,EAAEC,aAAa;AAAA,SAClCC,gBAAgB,EAAEC,UAAU;AAAA,SAC5BC,UAAU;AAAA,SACVC,YAAY;AAAA,SACZC,cAAc,EAAEC,QAAQ,uCAEjC;AACA,SAASC,QAAQ,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAC5BC,aAAa,EAAEC,gBAAgB,EAAEC,YAAY,EAAEC,SAAS;AAEjE,OAAO,MAAMC,0BAA0B,GAAGF,YAAY,CAAC;EACrDG,OAAO,EAAEC,MAAM;EACfC,KAAK,EAAED,MAAM;EACbE,IAAI,EAAEC,OAAO;EACbC,IAAI,EAAE;IACJC,IAAI,EAAEL,MAAM;IACZM,SAAS,EAAGC,CAAM,IAAK,CAACA,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAACC,QAAQ,CAACD,CAAC;EACjE,CAAC;EACDE,MAAM,EAAE;IACNJ,IAAI,EAAE,CAACK,MAAM,EAAEV,MAAM,CAAC;IACtBW,OAAO,EAAE;EACX,CAAC;EACDC,MAAM,EAAE;IACNP,IAAI,EAAE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