UNPKG

bootstrap-vue-next

Version:

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

228 lines (227 loc) 7.84 kB
const componentsWithExternalPath = { BAccordion: "/components/BAccordion", BAccordionItem: "/components/BAccordion", BAlert: "/components/BAlert", BAvatar: "/components/BAvatar", BAvatarGroup: "/components/BAvatar", BBadge: "/components/BBadge", BBreadcrumb: "/components/BBreadcrumb", BBreadcrumbItem: "/components/BBreadcrumb", BButton: "/components/BButton", BButtonGroup: "/components/BButton", BButtonToolbar: "/components/BButton", BCloseButton: "/components/BButton", BCard: "/components/BCard", BCardBody: "/components/BCard", BCardFooter: "/components/BCard", BCardGroup: "/components/BCard", BCardHeader: "/components/BCard", BCardImg: "/components/BCard", BCardSubtitle: "/components/BCard", BCardText: "/components/BCard", BCardTitle: "/components/BCard", BCarousel: "/components/BCarousel", BCarouselSlide: "/components/BCarousel", BCol: "/components/BContainer", BCollapse: "/components/BCollapse", BContainer: "/components/BContainer", BDropdown: "/components/BDropdown", BDropdownDivider: "/components/BDropdown", BDropdownForm: "/components/BDropdown", BDropdownGroup: "/components/BDropdown", BDropdownHeader: "/components/BDropdown", BDropdownItem: "/components/BDropdown", BDropdownItemButton: "/components/BDropdown", BDropdownText: "/components/BDropdown", BForm: "/components/BForm", BFormCheckbox: "/components/BFormCheckbox", BFormCheckboxGroup: "/components/BFormCheckbox", BFormDatalist: "/components/BForm", BFormFile: "/components/BFormFile", BFormFloatingLabel: "/components/BForm", BFormGroup: "/components/BFormGroup", BFormInput: "/components/BFormInput", BFormInvalidFeedback: "/components/BForm", BFormRadio: "/components/BFormRadio", BFormRadioGroup: "/components/BFormRadio", BFormRow: "/components/BForm", BFormSelect: "/components/BFormSelect", BFormSelectOption: "/components/BFormSelect", BFormSelectOptionGroup: "/components/BFormSelect", BFormSpinbutton: "/components/BFormSpinbutton", BFormTag: "/components/BFormTags", BFormTags: "/components/BFormTags", BFormText: "/components/BForm", BFormTextarea: "/components/BFormTextarea", BFormValidFeedback: "/components/BForm", BImg: "/components/BImg", BInput: "/components/BFormInput", BInputGroup: "/components/BInputGroup", BInputGroupText: "/components/BInputGroup", BListGroup: "/components/BListGroup", BListGroupItem: "/components/BListGroup", BModal: "/components/BModal", BModalOrchestrator: "/components/BModal", BNav: "/components/BNav", BNavForm: "/components/BNav", BNavItem: "/components/BNav", BNavItemDropdown: "/components/BNav", BNavText: "/components/BNav", BNavbar: "/components/BNavbar", BNavbarBrand: "/components/BNavbar", BNavbarNav: "/components/BNavbar", BNavbarToggle: "/components/BNavbar", BOffcanvas: "/components/BOffcanvas", BOverlay: "/components/BOverlay", BPagination: "/components/BPagination", BPlaceholder: "/components/BPlaceholder", BPlaceholderButton: "/components/BPlaceholder", BPlaceholderCard: "/components/BPlaceholder", BPlaceholderTable: "/components/BPlaceholder", BPlaceholderWrapper: "/components/BPlaceholder", BPopover: "/components/BPopover", BProgress: "/components/BProgress", BRow: "/components/BContainer", BSpinner: "/components/BSpinner", BTab: "/components/BTabs", BTabs: "/components/BTabs", BToast: "/components/BToast", BToastOrchestrator: "/components/BToast", BTooltip: "/components/BTooltip", BLink: "/components/BLink", BProgressBar: "/components/BProgress", BTableSimple: "/components/BTable", BTableLite: "/components/BTable", BTable: "/components/BTable", BTbody: "/components/BTable", BTd: "/components/BTable", BTh: "/components/BTable", BThead: "/components/BTable", BTfoot: "/components/BTable", BTr: "/components/BTable", BPopoverOrchestrator: "/components/BPopover" }; const componentNames = Object.freeze( Object.keys(componentsWithExternalPath) ); const directivesWithExternalPath = { vBColorMode: "/directives/BColorMode", vBModal: "/directives/BModal", vBPopover: "/directives/BPopover", vBScrollspy: "/directives/BScrollspy", vBToggle: "/directives/BToggle", vBTooltip: "/directives/BTooltip" }; const directiveNames = Object.freeze( Object.keys(directivesWithExternalPath) ); const composablesWithExternalPath = { useBreadcrumb: "/composables/useBreadcrumb", useColorMode: "/composables/useColorMode", useModal: "/composables/useModal", useModalController: "/composables/useModalController", useScrollspy: "/composables/useScrollspy", useToastController: "/composables/useToastController", useToggle: "/composables/useToggle", usePopoverController: "/composables/usePopoverController" }; const composableNames = Object.freeze( Object.keys(composablesWithExternalPath) ); const bvKey = "bootstrap-vue-next"; const parseActiveImports = (options, values) => { const { all, ...others } = options; const valuesCopy = {}; if (all) { values.forEach((el) => { valuesCopy[el] = all; }); } const merge = { ...valuesCopy, ...others }; return Object.entries(merge).filter(([name, value]) => !!value && values.includes(name)).map(([name]) => name); }; const usedComponents = /* @__PURE__ */ new Set(); const usedDirectives = /* @__PURE__ */ new Set(); const BootstrapVueNextResolver = Object.assign( ({ aliases = {}, directives = true, components = true } = {}) => { const selectedComponents = typeof components === "boolean" ? { all: components } : components; const compImports = parseActiveImports(selectedComponents, componentNames).reduce( (map, name) => { map.set(name, `${bvKey}${componentsWithExternalPath[name]}`); return map; }, /* @__PURE__ */ new Map() ); const selectedDirectives = typeof directives === "boolean" ? { all: directives } : directives; const dirImports = parseActiveImports(selectedDirectives, directiveNames).reduce( (map, directive) => { const key = directive.toLowerCase().startsWith("v") ? directive : `v${directive}`; map.set(key, `${bvKey}${directivesWithExternalPath[key]}`); return map; }, /* @__PURE__ */ new Map() ); const resolvers = [ { type: "component", resolve(name) { const destination = compImports.get(name); const aliasDestination = compImports.get(aliases[name]); if (aliasDestination) { const val = aliases[name]; usedComponents.add(val); return { name: val, from: aliasDestination }; } if (destination) { usedComponents.add(name); return { name, from: destination }; } } }, { type: "directive", resolve(name) { const prefixedName = `v${name}`; const destination = dirImports.get(prefixedName); if (destination) { usedDirectives.add(prefixedName); return { name: prefixedName, from: destination }; } } } ]; return resolvers; }, { __usedComponents: usedComponents, __usedDirectives: usedDirectives } ); const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, BootstrapVueNextResolver }, Symbol.toStringTag, { value: "Module" })); export { BootstrapVueNextResolver as B, componentsWithExternalPath as a, composableNames as b, componentNames as c, composablesWithExternalPath as d, directiveNames as e, directivesWithExternalPath as f, index as i }; //# sourceMappingURL=index-DkI9t_-4.mjs.map