bootstrap-vue-next
Version:
Seamless integration of Vue 3, Bootstrap 5, and TypeScript for modern, type-safe UI development
1 lines • 10.2 kB
Source Map (JSON)
{"version":3,"file":"BListGroup-DHdBjAI1.mjs","names":[],"sources":["../src/components/BListGroup/BListGroup.vue","../src/components/BListGroup/BListGroup.vue","../src/components/BListGroup/BListGroupItem.vue","../src/components/BListGroup/BListGroupItem.vue"],"sourcesContent":["<template>\n <component :is=\"computedTag\" class=\"list-group\" :class=\"computedClasses\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, provide, toRef} from 'vue'\nimport {listGroupInjectionKey} from '../../utils/keys'\nimport type {BListGroupProps} from '../../types/ComponentProps'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BListGroupSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<BListGroupProps>(), {\n flush: false,\n horizontal: false,\n numbered: false,\n tag: 'div',\n})\nconst props = useDefaults(_props, 'BListGroup')\ndefineSlots<BListGroupSlots>()\n\nconst computedClasses = computed(() => {\n const horizontal = props.flush ? false : props.horizontal\n return {\n 'list-group-flush': props.flush,\n 'list-group-horizontal': horizontal === true,\n [`list-group-horizontal-${horizontal}`]: typeof horizontal === 'string',\n 'list-group-numbered': props.numbered,\n }\n})\nconst computedTag = computed(() => (props.numbered === true ? 'ol' : props.tag))\n\nprovide(listGroupInjectionKey, {\n numbered: toRef(() => props.numbered),\n})\n</script>\n","<template>\n <component :is=\"computedTag\" class=\"list-group\" :class=\"computedClasses\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, provide, toRef} from 'vue'\nimport {listGroupInjectionKey} from '../../utils/keys'\nimport type {BListGroupProps} from '../../types/ComponentProps'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BListGroupSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<BListGroupProps>(), {\n flush: false,\n horizontal: false,\n numbered: false,\n tag: 'div',\n})\nconst props = useDefaults(_props, 'BListGroup')\ndefineSlots<BListGroupSlots>()\n\nconst computedClasses = computed(() => {\n const horizontal = props.flush ? false : props.horizontal\n return {\n 'list-group-flush': props.flush,\n 'list-group-horizontal': horizontal === true,\n [`list-group-horizontal-${horizontal}`]: typeof horizontal === 'string',\n 'list-group-numbered': props.numbered,\n }\n})\nconst computedTag = computed(() => (props.numbered === true ? 'ol' : props.tag))\n\nprovide(listGroupInjectionKey, {\n numbered: toRef(() => props.numbered),\n})\n</script>\n","<template>\n <component\n :is=\"tagComputed\"\n class=\"list-group-item\"\n :class=\"computedClasses\"\n :aria-current=\"props.active ? true : undefined\"\n :aria-disabled=\"props.disabled ? true : undefined\"\n :target=\"isLink ? props.target : undefined\"\n :href=\"!props.button ? props.href : undefined\"\n :to=\"!props.button ? props.to : undefined\"\n v-bind=\"{...(isLink ? computedLinkProps : {}), ...computedAttrs}\"\n >\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, inject, useAttrs} from 'vue'\nimport type {BListGroupItemProps} from '../../types/ComponentProps'\nimport {useDefaults} from '../../composables/useDefaults'\nimport BLink from '../BLink/BLink.vue'\nimport {listGroupInjectionKey} from '../../utils/keys'\nimport {useBLinkHelper} from '../../composables/useBLinkHelper'\nimport type {BListGroupItemSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<BListGroupItemProps>(), {\n action: false,\n button: false,\n tag: 'div',\n // Link props\n active: false, // Why is this active: false?\n // All others use defaults\n activeClass: undefined,\n disabled: undefined,\n exactActiveClass: undefined,\n href: undefined,\n icon: undefined,\n opacity: undefined,\n opacityHover: undefined,\n stretched: false,\n rel: undefined,\n replace: undefined,\n routerComponentName: undefined,\n target: undefined,\n to: undefined,\n underlineOffset: undefined,\n underlineOffsetHover: undefined,\n underlineOpacity: undefined,\n underlineOpacityHover: undefined,\n underlineVariant: undefined,\n variant: undefined,\n // End link props\n})\nconst props = useDefaults(_props, 'BListGroupItem')\ndefineSlots<BListGroupItemSlots>()\nconst attrs = useAttrs()\n\nconst parentData = inject(listGroupInjectionKey, null)\n\nconst {computedLink, computedLinkProps} = useBLinkHelper(props)\n\nconst isLink = computed(() => !props.button && computedLink.value)\nconst tagComputed = computed(() =>\n parentData?.numbered.value ? 'li' : props.button ? 'button' : !isLink.value ? props.tag : BLink\n)\n\nconst isAction = computed(\n () =>\n props.action ||\n isLink.value ||\n props.button ||\n ['a', 'router-link', 'button', 'b-link'].includes(props.tag)\n)\n\nconst computedClasses = computed(() => ({\n [`list-group-item-${props.variant}`]: props.variant !== null && props.variant !== undefined,\n 'list-group-item-action': isAction.value,\n 'active': props.active,\n 'disabled': props.disabled,\n}))\n\nconst computedAttrs = computed(() => {\n const localAttrs = {} as {type?: string; disabled?: boolean}\n if (props.button) {\n if (!attrs || !attrs.type) {\n // Add a type for button is one not provided in passed attributes\n localAttrs.type = 'button'\n }\n if (props.disabled) {\n // Set disabled attribute if button and disabled\n localAttrs.disabled = true\n }\n }\n return localAttrs\n})\n</script>\n","<template>\n <component\n :is=\"tagComputed\"\n class=\"list-group-item\"\n :class=\"computedClasses\"\n :aria-current=\"props.active ? true : undefined\"\n :aria-disabled=\"props.disabled ? true : undefined\"\n :target=\"isLink ? props.target : undefined\"\n :href=\"!props.button ? props.href : undefined\"\n :to=\"!props.button ? props.to : undefined\"\n v-bind=\"{...(isLink ? computedLinkProps : {}), ...computedAttrs}\"\n >\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, inject, useAttrs} from 'vue'\nimport type {BListGroupItemProps} from '../../types/ComponentProps'\nimport {useDefaults} from '../../composables/useDefaults'\nimport BLink from '../BLink/BLink.vue'\nimport {listGroupInjectionKey} from '../../utils/keys'\nimport {useBLinkHelper} from '../../composables/useBLinkHelper'\nimport type {BListGroupItemSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<BListGroupItemProps>(), {\n action: false,\n button: false,\n tag: 'div',\n // Link props\n active: false, // Why is this active: false?\n // All others use defaults\n activeClass: undefined,\n disabled: undefined,\n exactActiveClass: undefined,\n href: undefined,\n icon: undefined,\n opacity: undefined,\n opacityHover: undefined,\n stretched: false,\n rel: undefined,\n replace: undefined,\n routerComponentName: undefined,\n target: undefined,\n to: undefined,\n underlineOffset: undefined,\n underlineOffsetHover: undefined,\n underlineOpacity: undefined,\n underlineOpacityHover: undefined,\n underlineVariant: undefined,\n variant: undefined,\n // End link props\n})\nconst props = useDefaults(_props, 'BListGroupItem')\ndefineSlots<BListGroupItemSlots>()\nconst attrs = useAttrs()\n\nconst parentData = inject(listGroupInjectionKey, null)\n\nconst {computedLink, computedLinkProps} = useBLinkHelper(props)\n\nconst isLink = computed(() => !props.button && computedLink.value)\nconst tagComputed = computed(() =>\n parentData?.numbered.value ? 'li' : props.button ? 'button' : !isLink.value ? props.tag : BLink\n)\n\nconst isAction = computed(\n () =>\n props.action ||\n isLink.value ||\n props.button ||\n ['a', 'router-link', 'button', 'b-link'].includes(props.tag)\n)\n\nconst computedClasses = computed(() => ({\n [`list-group-item-${props.variant}`]: props.variant !== null && props.variant !== undefined,\n 'list-group-item-action': isAction.value,\n 'active': props.active,\n 'disabled': props.disabled,\n}))\n\nconst computedAttrs = computed(() => {\n const localAttrs = {} as {type?: string; disabled?: boolean}\n if (props.button) {\n if (!attrs || !attrs.type) {\n // Add a type for button is one not provided in passed attributes\n localAttrs.type = 'button'\n }\n if (props.disabled) {\n // Set disabled attribute if button and disabled\n localAttrs.disabled = true\n }\n }\n return localAttrs\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAmBA,MAAM,QAAQ,YANC,SAMmB,aAAY;EAG9C,MAAM,kBAAkB,eAAe;GACrC,MAAM,aAAa,MAAM,QAAQ,QAAQ,MAAM;AAC/C,UAAO;IACL,oBAAoB,MAAM;IAC1B,yBAAyB,eAAe;KACvC,yBAAyB,eAAe,OAAO,eAAe;IAC/D,uBAAuB,MAAM;IAC/B;IACD;EACD,MAAM,cAAc,eAAgB,MAAM,aAAa,OAAO,OAAO,MAAM,IAAI;AAE/E,UAAQ,uBAAuB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