UNPKG

bootstrap-vue-next

Version:

BootstrapVueNext is an early and lovely component library for Vue 3 & Nuxt 3 based on Bootstrap 5 and Typescript.

1 lines 9.05 kB
{"version":3,"file":"keys-CFfh7DXf.mjs","sources":["../src/utils/withBvnPrefix.ts","../src/utils/keys.ts"],"sourcesContent":["export const withBvnPrefix = (value: string, suffix: string = '') => {\n const suffixWithTrail = `${suffix}___`\n return `___BVN__ID__${value}__${suffix ? suffixWithTrail : ''}`\n}\n","import type {ComponentInternalInstance, ComputedRef, InjectionKey, Ref} from 'vue'\nimport type {TabType} from '../types/Tab'\nimport type {ClassValue} from '../types/AnyValuedAttributes'\nimport type {Numberish} from '../types/CommonTypes'\nimport type {LiteralUnion} from '../types/LiteralUnion'\nimport type {Size} from '../types/Size'\nimport type {RadiusElement} from '../types/RadiusElement'\nimport type {\n BgColorVariant,\n ButtonVariant,\n ColorVariant,\n TextColorVariant,\n} from '../types/ColorTypes'\nimport type {CheckboxValue} from '../types/CheckboxTypes'\nimport type {RadioValue} from '../types/RadioTypes'\nimport type {BreadcrumbItemRaw} from '../types/BreadcrumbTypes'\nimport type {\n ControllerKey,\n ModalOrchestratorMapValue,\n ModalOrchestratorShowParam,\n PopoverOrchestratorMapValue,\n PopoverOrchestratorShowParam,\n PrivateOrchestratedPopover,\n PrivateOrchestratedTooltip,\n ToastOrchestratorArrayValue,\n ToastOrchestratorShowParam,\n TooltipOrchestratorMapValue,\n TooltipOrchestratorShowParam,\n} from '../types/ComponentOrchestratorTypes'\nimport type {BvnComponentProps} from '../types/BootstrapVueOptions'\nimport {withBvnPrefix} from './withBvnPrefix'\n\nconst createBvnInjectionKey = (name: string) => withBvnPrefix(name) as unknown as symbol // Type cast to symbol, these should be static\n\n// BCarousel\nexport const carouselInjectionKey: InjectionKey<{\n background: Readonly<Ref<string | undefined>>\n width: Readonly<Ref<string | undefined>>\n height: Readonly<Ref<string | undefined>>\n}> = createBvnInjectionKey('carousel')\n\n// BTabs\nexport const tabsInjectionKey: InjectionKey<{\n lazy: Readonly<Ref<boolean>>\n card: Readonly<Ref<boolean>>\n noFade: Readonly<Ref<boolean>>\n registerTab: (tab: Readonly<Ref<TabType>>) => void\n unregisterTab: (id: string) => void\n activateTab: (id: string | undefined) => void\n activeTabClass: Readonly<Ref<ClassValue>>\n inactiveTabClass: Readonly<Ref<ClassValue>>\n tabClass: Readonly<Ref<ClassValue>>\n activeId: Readonly<Ref<string | undefined>>\n}> = createBvnInjectionKey('tabs')\n\n// BProgress\nexport const progressInjectionKey: InjectionKey<{\n animated: Readonly<Ref<boolean | undefined>>\n max: Readonly<Ref<Numberish>>\n showProgress: Readonly<Ref<boolean | undefined>>\n showValue: Readonly<Ref<boolean | undefined>>\n striped: Readonly<Ref<boolean | undefined>>\n}> = createBvnInjectionKey('progress')\n\n// BListGroup\nexport const listGroupInjectionKey: InjectionKey<{\n numbered: Readonly<Ref<boolean>>\n}> = createBvnInjectionKey('listGroup')\n\n// BAvatarGroup\nexport const avatarGroupInjectionKey: InjectionKey<{\n overlapScale: Readonly<Ref<number>>\n size: Readonly<Ref<LiteralUnion<Size, Numberish> | undefined>>\n square: Readonly<Ref<boolean>>\n rounded: Readonly<Ref<RadiusElement | boolean>>\n roundedTop: Readonly<Ref<RadiusElement | boolean | undefined>>\n roundedBottom: Readonly<Ref<RadiusElement | boolean | undefined>>\n roundedStart: Readonly<Ref<RadiusElement | boolean | undefined>>\n roundedEnd: Readonly<Ref<RadiusElement | boolean | undefined>>\n variant: Readonly<Ref<ColorVariant | null>>\n bgVariant: Readonly<Ref<BgColorVariant | null>>\n textVariant: Readonly<Ref<TextColorVariant | null>>\n}> = createBvnInjectionKey('avatarGroup')\n\n// BAccordion\nexport const accordionInjectionKey: InjectionKey<{\n openItem: Readonly<Ref<string | undefined>>\n free: Readonly<Ref<boolean>>\n setOpenItem: (id: string) => void\n}> = createBvnInjectionKey('accordion')\n\n// BFormCheckboxGroup\nexport const checkboxGroupKey: InjectionKey<{\n modelValue: Ref<readonly CheckboxValue[]>\n switch: Readonly<Ref<boolean>>\n buttonVariant: Readonly<Ref<ButtonVariant | null>>\n form: Readonly<Ref<string | undefined>>\n name: Readonly<Ref<string>>\n state: Readonly<Ref<boolean | undefined | null>>\n plain: Readonly<Ref<boolean>>\n size: Readonly<Ref<Size>>\n inline: Readonly<Ref<boolean>>\n reverse: Readonly<Ref<boolean>>\n required: Readonly<Ref<boolean>>\n buttons: Readonly<Ref<boolean>>\n disabled: Readonly<Ref<boolean>>\n}> = createBvnInjectionKey('checkboxGroup')\n\nexport const radioGroupKey: InjectionKey<{\n modelValue: Ref<RadioValue>\n buttonVariant: Readonly<Ref<ButtonVariant | null>>\n form: Readonly<Ref<string | undefined>>\n name: Readonly<Ref<string>>\n buttons: Readonly<Ref<boolean>>\n state: Readonly<Ref<boolean | undefined | null>>\n plain: Readonly<Ref<boolean>>\n size: Readonly<Ref<Size>>\n inline: Readonly<Ref<boolean>>\n reverse: Readonly<Ref<boolean>>\n required: Readonly<Ref<boolean>>\n disabled: Readonly<Ref<boolean>>\n}> = createBvnInjectionKey('radioGroup')\n\n// Collapse\nexport const collapseInjectionKey: InjectionKey<{\n id?: Readonly<Ref<string>>\n readonly hide?: () => void\n readonly show?: () => void\n readonly toggle?: () => void\n visible?: Readonly<Ref<boolean>>\n isNav?: Readonly<Ref<boolean>>\n}> = createBvnInjectionKey('collapse')\n\nexport const dropdownInjectionKey: InjectionKey<{\n id?: Readonly<Ref<string>>\n readonly hide?: () => void\n readonly show?: () => void\n readonly toggle?: () => void\n visible?: Readonly<Ref<boolean>>\n isNav?: Readonly<Ref<boolean>>\n}> = createBvnInjectionKey('dropdown')\n\nexport const navbarInjectionKey: InjectionKey<{\n tag?: Readonly<Ref<string>>\n autoClose?: Readonly<Ref<boolean>>\n}> = createBvnInjectionKey('navbar')\n\nexport const rtlPluginKey: InjectionKey<{\n isRtl: Ref<boolean>\n locale: Ref<string | undefined>\n}> = createBvnInjectionKey('rtlPlugin')\n\nexport const breadcrumbPluginKey: InjectionKey<{\n items: Ref<BreadcrumbItemRaw[]>\n reset: () => void\n}> = createBvnInjectionKey('breadcrumbPlugin')\n\nexport const modalManagerPluginKey: InjectionKey<{\n stack: ComputedRef<ComponentInternalInstance[]>\n countStack: ComputedRef<number>\n lastStack: ComputedRef<ComponentInternalInstance | undefined>\n pushStack: (modal: Readonly<ComponentInternalInstance>) => void\n removeStack: (modal: Readonly<ComponentInternalInstance>) => void\n registry: Readonly<Ref<Map<number, ComponentInternalInstance>>>\n pushRegistry: (modal: Readonly<ComponentInternalInstance>) => void\n removeRegistry: (modal: Readonly<ComponentInternalInstance>) => void\n}> = createBvnInjectionKey('modalManagerPlugin')\n\nexport const defaultsKey: InjectionKey<Ref<Partial<BvnComponentProps>>> =\n createBvnInjectionKey('defaults')\n\nexport const inputGroupKey: InjectionKey<boolean> = createBvnInjectionKey('inputGroup')\nexport const buttonGroupKey: InjectionKey<boolean> = createBvnInjectionKey('buttonGroup')\n\nexport const toastPluginKey: InjectionKey<{\n toasts: Ref<ToastOrchestratorArrayValue[]>\n _setIsAppend: (value: boolean) => void\n show: (obj: ToastOrchestratorShowParam) => ControllerKey\n remove: (self: ControllerKey) => void\n leave: (self: ControllerKey) => void\n}> = createBvnInjectionKey('toastPlugin')\n\nexport const modalControllerPluginKey: InjectionKey<{\n modals: Ref<Map<ControllerKey, ModalOrchestratorMapValue>>\n show: (obj: ModalOrchestratorShowParam) => Promise<boolean | null>\n confirm: (obj: ModalOrchestratorShowParam) => Promise<boolean | null>\n remove: (self: ControllerKey) => void\n leave: (self: ControllerKey) => void\n}> = createBvnInjectionKey('modalControllerPlugin')\n\nexport const popoverPluginKey: InjectionKey<{\n popovers: Ref<Map<ControllerKey, PopoverOrchestratorMapValue>>\n popover: (obj: PopoverOrchestratorShowParam) => ControllerKey\n setPopover: (self: ControllerKey, val: Partial<PrivateOrchestratedPopover>) => void\n removePopover: (self: ControllerKey) => void\n tooltips: Ref<Map<ControllerKey, TooltipOrchestratorMapValue>>\n tooltip: (obj: TooltipOrchestratorShowParam) => ControllerKey\n setTooltip: (self: ControllerKey, val: Partial<PrivateOrchestratedTooltip>) => void\n removeTooltip: (self: ControllerKey) => void\n}> = createBvnInjectionKey('popoverPlugin')\n"],"names":[],"mappings":"AAAO,MAAM,gBAAgB,CAAC,OAAe,SAAiB,OAAO;AAC7D,QAAA,kBAAkB,GAAG,MAAM;AACjC,SAAO,eAAe,KAAK,KAAK,SAAS,kBAAkB,EAAE;AAC/D;AC6BA,MAAM,wBAAwB,CAAC,SAAiB,cAAc,IAAI;AAGrD,MAAA,uBAIR,sBAAsB,UAAU;AAGxB,MAAA,mBAWR,sBAAsB,MAAM;AAGpB,MAAA,uBAMR,sBAAsB,UAAU;AAGxB,MAAA,wBAER,sBAAsB,WAAW;AAGzB,MAAA,0BAYR,sBAAsB,aAAa;AAG3B,MAAA,wBAIR,sBAAsB,WAAW;AAGzB,MAAA,mBAcR,sBAAsB,eAAe;AAE7B,MAAA,gBAaR,sBAAsB,YAAY;AAG1B,MAAA,uBAOR,sBAAsB,UAAU;AAExB,MAAA,uBAOR,sBAAsB,UAAU;AAExB,MAAA,qBAGR,sBAAsB,QAAQ;AAEtB,MAAA,eAGR,sBAAsB,WAAW;AAEzB,MAAA,sBAGR,sBAAsB,kBAAkB;AAEhC,MAAA,wBASR,sBAAsB,oBAAoB;AAElC,MAAA,cACX,sBAAsB,UAAU;AAErB,MAAA,gBAAuC,sBAAsB,YAAY;AACzE,MAAA,iBAAwC,sBAAsB,aAAa;AAE3E,MAAA,iBAMR,sBAAsB,aAAa;AAE3B,MAAA,2BAMR,sBAAsB,uBAAuB;AAErC,MAAA,mBASR,sBAAsB,eAAe;"}