|
1 | 1 | import {App, Plugin} from 'vue'
|
2 | 2 | import Components from './components'
|
3 | 3 | import Directives from './directives'
|
4 |
| - |
5 | 4 | import {BootstrapVueOptions} from './types'
|
6 |
| -import {createBreadcrumb} from './composables' |
| 5 | +import {createBreadcrumb, useBreadcrumb} from './composables' |
7 | 6 | import './styles/styles.scss'
|
8 |
| - |
9 | 7 | // All available components
|
10 | 8 | // Keep this list in sync with /components/index.ts please
|
11 |
| -const { |
| 9 | +import BAccordion from './components/BAccordion/BAccordion.vue' |
| 10 | +import BAccordionItem from './components/BAccordion/BAccordionItem.vue' |
| 11 | +import BAlert from './components/BAlert.vue' |
| 12 | +import BAvatar from './components/BAvatar/BAvatar.vue' |
| 13 | +import BAvatarGroup from './components/BAvatar/BAvatarGroup.vue' |
| 14 | +import BBadge from './components/BBadge/BBadge.vue' |
| 15 | +import BBreadcrumb from './components/BBreadcrumb/BBreadcrumb.vue' |
| 16 | +import BBreadcrumbItem from './components/BBreadcrumb/BBreadcrumbItem.vue' |
| 17 | +import BButton from './components/BButton/BButton.vue' |
| 18 | +import BButtonGroup from './components/BButton/BButtonGroup.vue' |
| 19 | +import BButtonToolbar from './components/BButton/BButtonToolbar.vue' |
| 20 | +import BCard from './components/BCard/BCard.vue' |
| 21 | +import BCardBody from './components/BCard/BCardBody.vue' |
| 22 | +import BCardFooter from './components/BCard/BCardFooter.vue' |
| 23 | +import BCardGroup from './components/BCard/BCardGroup.vue' |
| 24 | +import BCardHeader from './components/BCard/BCardHeader.vue' |
| 25 | +import BCardImg from './components/BCard/BCardImg.vue' |
| 26 | +import BCardSubTitle from './components/BCard/BCardSubTitle.vue' |
| 27 | +import BCardText from './components/BCard/BCardText.vue' |
| 28 | +import BCardTitle from './components/BCard/BCardTitle.vue' |
| 29 | +import BCarousel from './components/BCarousel/BCarousel.vue' |
| 30 | +import BCarouselSlide from './components/BCarousel/BCarouselSlide.vue' |
| 31 | +import BCloseButton from './components/BButton/BCloseButton.vue' |
| 32 | +import BCol from './components/BCol.vue' |
| 33 | +import BCollapse from './components/BCollapse.vue' |
| 34 | +import BContainer from './components/BContainer.vue' |
| 35 | +import BDropdown from './components/BDropdown/BDropdown.vue' |
| 36 | +import BDropdownDivider from './components/BDropdown/BDropdownDivider.vue' |
| 37 | +import BDropdownForm from './components/BDropdown/BDropdownForm.vue' |
| 38 | +import BDropdownGroup from './components/BDropdown/BDropdownGroup.vue' |
| 39 | +import BDropdownHeader from './components/BDropdown/BDropdownHeader.vue' |
| 40 | +import BDropdownItem from './components/BDropdown/BDropdownItem.vue' |
| 41 | +import BDropdownItemButton from './components/BDropdown/BDropdownItemButton.vue' |
| 42 | +import BDropdownText from './components/BDropdown/BDropdownText.vue' |
| 43 | +import BForm from './components/BForm/BForm.vue' |
| 44 | +import BFormFloatingLabel from './components/BForm/BFormFloatingLabel.vue' |
| 45 | +import BFormInvalidFeedback from './components/BForm/BFormInvalidFeedback.vue' |
| 46 | +import BFormRow from './components/BForm/BFormRow.vue' |
| 47 | +import BFormText from './components/BForm/BFormText.vue' |
| 48 | +import BFormValidFeedback from './components/BForm/BFormValidFeedback.vue' |
| 49 | +import BFormCheckbox from './components/BFormCheckbox/BFormCheckbox.vue' |
| 50 | +import BFormCheckboxGroup from './components/BFormCheckbox/BFormCheckboxGroup.vue' |
| 51 | +import BFormGroup from './components/BFormGroup/BFormGroup.vue' |
| 52 | +import BFormInput from './components/BFormInput/BFormInput.vue' |
| 53 | +import BFormRadio from './components/BFormRadio' |
| 54 | +import BFormRadioGroup from './components/BFormRadio/BFormRadioGroup.vue' |
| 55 | +import BFormSelect from './components/BFormSelect/BFormSelect.vue' |
| 56 | +import BFormSelectOption from './components/BFormSelect/BFormSelectOption.vue' |
| 57 | +import BFormSelectOptionGroup from './components/BFormSelect/BFormSelectOptionGroup.vue' |
| 58 | +import BFormTag from './components/BFormTags/BFormTag.vue' |
| 59 | +import BFormTags from './components/BFormTags/BFormTags.vue' |
| 60 | +import BFormTextarea from './components/BFormTextarea/BFormTextarea.vue' |
| 61 | +import BImg from './components/BImg.vue' |
| 62 | +import BInputGroup from './components/BInputGroup/BInputGroup.vue' |
| 63 | +import BInputGroupAddon from './components/BInputGroup/BInputGroupAddon.vue' |
| 64 | +import BInputGroupAppend from './components/BInputGroup/BInputGroupAppend.vue' |
| 65 | +import BInputGroupPrepend from './components/BInputGroup/BInputGroupPrepend.vue' |
| 66 | +import BInputGroupText from './components/BInputGroup/BInputGroupText.vue' |
| 67 | +import BLink from './components/BLink/BLink.vue' |
| 68 | +import BListGroup from './components/BListGroup/BListGroup.vue' |
| 69 | +import BListGroupItem from './components/BListGroup/BListGroupItem.vue' |
| 70 | +import BModal from './components/BModal.vue' |
| 71 | +import BNav from './components/BNav.vue' |
| 72 | +import BNavItem from './components/BNavItem.vue' |
| 73 | +import BNavItemDropdown from './components/BNavItemDropdown.vue' |
| 74 | +import BOffcanvas from './components/BOffcanvas.vue' |
| 75 | +import BOverlay from './components/BOverlay/BOverlay.vue' |
| 76 | +import BPagination from './components/BPagination/BPagination.vue' |
| 77 | +import BPopover from './components/BPopover.vue' |
| 78 | +import BProgress from './components/BProgress.vue' |
| 79 | +import BProgressBar from './components/BProgressBar.vue' |
| 80 | +import BRow from './components/BRow.vue' |
| 81 | +import BSkeleton from './components/BSkeleton/BSkeleton.vue' |
| 82 | +import BSkeletonIcon from './components/BSkeleton/BSkeletonIcon.vue' |
| 83 | +import BSkeletonTable from './components/BSkeleton/BSkeletonTable.vue' |
| 84 | +import BSkeletonWrapper from './components/BSkeleton/BSkeletonWrapper.vue' |
| 85 | +import BSpinner from './components/BSpinner.vue' |
| 86 | +import BTab from './components/BTabs/BTab.vue' |
| 87 | +import BTable from './components/BTable/BTable.vue' |
| 88 | +import BTableSimple from './components/BTable/BTableSimple.vue' |
| 89 | +import BTbody from './components/BTable/BTbody.vue' |
| 90 | +import BTd from './components/BTable/BTd.vue' |
| 91 | +import BTfoot from './components/BTable/BTfoot.vue' |
| 92 | +import BTh from './components/BTable/BTh.vue' |
| 93 | +import BThead from './components/BTable/BThead.vue' |
| 94 | +import BTr from './components/BTable/BTr.vue' |
| 95 | +import BTabs from './components/BTabs/BTabs.vue' |
| 96 | +import {BToast, BToaster, BToastPlugin, useToast} from './components/BToast/' |
| 97 | +import BToastContainer from './components/BToast/BToaster.vue' |
| 98 | +import BTransition from './components/BTransition/BTransition.vue' |
| 99 | + |
| 100 | +// Export available composables |
| 101 | +export {useToast} |
| 102 | + |
| 103 | +// Export available plugins |
| 104 | +// Not to be confused with the above main app plugin |
| 105 | +export {BToastPlugin} |
| 106 | + |
| 107 | +// Export available composables |
| 108 | +export {useBreadcrumb} |
| 109 | + |
| 110 | +// Export available directives |
| 111 | +export { |
| 112 | + BPopover as VBPopover, |
| 113 | + BToggle as VBToggle, |
| 114 | + BTooltip as VBTooltip, |
| 115 | + BVisible as VBVisible, |
| 116 | +} from './directives' |
| 117 | + |
| 118 | +// Export available utils |
| 119 | +export {BvEvent} from './utils' |
| 120 | + |
| 121 | +// Export components |
| 122 | +export { |
12 | 123 | BAccordion,
|
13 | 124 | BAccordionItem,
|
14 | 125 | BAlert,
|
@@ -96,51 +207,38 @@ const {
|
96 | 207 | BThead,
|
97 | 208 | BTr,
|
98 | 209 | BTabs,
|
99 |
| - BToastContainer, |
100 |
| - BTransition, |
101 | 210 | BToast,
|
102 | 211 | BToaster,
|
103 |
| - BToastPlugin, |
104 |
| -} = Components |
105 |
| - |
106 |
| -// Export available composables |
107 |
| -export {useToast} from './components/BToast/' |
108 |
| - |
109 |
| -// Export available plugins |
110 |
| -// Not to be confused with the above main app plugin |
111 |
| -export {BToastPlugin} |
112 |
| - |
113 |
| -// Export utils |
114 |
| -export {BvEvent} from './utils' |
115 |
| - |
116 |
| -// Export available directives |
117 |
| -const { |
118 |
| - BPopover: VBPopover, |
119 |
| - BToggle: VBToggle, |
120 |
| - BTooltip: VBTooltip, |
121 |
| - BVisible: VBVisible, |
122 |
| -} = Directives |
123 |
| -export {VBPopover, VBToggle, VBTooltip, VBVisible} |
124 |
| - |
125 |
| -// Main app plugin |
126 |
| -const plugin: Plugin = { |
127 |
| - // TODO: use options in the future |
128 |
| - // eslint-disable-next-line @typescript-eslint/no-unused-vars |
129 |
| - install(app: App, options: BootstrapVueOptions = {}) { |
130 |
| - Object.entries(Components).forEach(([name, component]) => { |
131 |
| - app.component(name, component) |
132 |
| - }) |
133 |
| - |
134 |
| - Object.entries(Directives).forEach(([name, component]) => { |
135 |
| - app.directive(name, component) |
136 |
| - }) |
137 |
| - |
138 |
| - createBreadcrumb(app) |
139 |
| - }, |
| 212 | + BToastContainer, |
| 213 | + BTransition, |
140 | 214 | }
|
141 | 215 |
|
142 |
| -export {plugin as BootstrapVue3} |
143 |
| -export default plugin |
| 216 | +// Export types |
| 217 | +export type { |
| 218 | + InputSize, |
| 219 | + ColorVariant, |
| 220 | + Booleanish, |
| 221 | + BreadcrumbItem, |
| 222 | + LinkTarget, |
| 223 | + ButtonVariant, |
| 224 | + Alignment, |
| 225 | + TextColorVariant, |
| 226 | + Size, |
| 227 | + ButtonType, |
| 228 | + InputType, |
| 229 | + Breakpoint, |
| 230 | + SkeletonAnimation, |
| 231 | + SkeletonType, |
| 232 | + VerticalAlign, |
| 233 | + TableField, |
| 234 | + TableItem, |
| 235 | + ContainerPosition, |
| 236 | + TransitionMode, |
| 237 | + Position, |
| 238 | + SpinnerType, |
| 239 | +} from './types' |
| 240 | +export type {BodyProp} from './components/BToast/plugin' |
| 241 | +export type {BPopoverDelayObject} from './types/components' |
144 | 242 |
|
145 | 243 | // Inject all components into the global @vue/runtime-core
|
146 | 244 | // This allows intellisense in templates w/out direct importing
|
@@ -241,136 +339,22 @@ declare module '@vue/runtime-core' {
|
241 | 339 | }
|
242 | 340 | }
|
243 | 341 |
|
244 |
| -// Export types |
245 |
| -export type { |
246 |
| - Alignment, |
247 |
| - Animation, |
248 |
| - BootstrapVueOptions, |
249 |
| - BreadcrumbItem, |
250 |
| - BreadcrumbItemObject, |
251 |
| - Breakpoint, |
252 |
| - ColBreakpointProps, |
253 |
| - RowColsBreakpointProps, |
254 |
| - OffsetBreakpointProps, |
255 |
| - OrderBreakpointProps, |
256 |
| - ButtonType, |
257 |
| - ButtonVariant, |
258 |
| - ColorVariant, |
259 |
| - ContainerVerticalAlign, |
260 |
| - ContainerHorizontalAlign, |
261 |
| - ContainerPosition, |
262 |
| - InputSize, |
263 |
| - InputType, |
264 |
| - LinkTarget, |
265 |
| - LiteralUnion, |
266 |
| - Pagination, |
267 |
| - PaginationPage, |
268 |
| - Position, |
269 |
| - RadioOption, |
270 |
| - SelectOption, |
271 |
| - Size, |
272 |
| - SkeletonAnimation, |
273 |
| - SkeletonType, |
274 |
| - SpinnerType, |
275 |
| - TableFieldObject, |
276 |
| - TableField, |
277 |
| - TableItem, |
278 |
| - TextColorVariant, |
279 |
| - TransitionMode, |
280 |
| - VerticalAlign, |
281 |
| -} from './types' |
| 342 | +// Main app plugin |
| 343 | +const plugin: Plugin = { |
| 344 | + // TODO: use options in the future |
| 345 | + // eslint-disable-next-line @typescript-eslint/no-unused-vars |
| 346 | + install(app: App, options: BootstrapVueOptions = {}) { |
| 347 | + Object.entries(Components).forEach(([name, component]) => { |
| 348 | + app.component(name, component) |
| 349 | + }) |
282 | 350 |
|
283 |
| -// Finally export components |
284 |
| -export { |
285 |
| - BAccordion, |
286 |
| - BAccordionItem, |
287 |
| - BAlert, |
288 |
| - BAvatar, |
289 |
| - BAvatarGroup, |
290 |
| - BBadge, |
291 |
| - BBreadcrumb, |
292 |
| - BBreadcrumbItem, |
293 |
| - BButton, |
294 |
| - BButtonGroup, |
295 |
| - BButtonToolbar, |
296 |
| - BCard, |
297 |
| - BCardBody, |
298 |
| - BCardFooter, |
299 |
| - BCardGroup, |
300 |
| - BCardHeader, |
301 |
| - BCardImg, |
302 |
| - BCardSubTitle, |
303 |
| - BCardText, |
304 |
| - BCardTitle, |
305 |
| - BCarousel, |
306 |
| - BCarouselSlide, |
307 |
| - BCloseButton, |
308 |
| - BCol, |
309 |
| - BCollapse, |
310 |
| - BContainer, |
311 |
| - BDropdown, |
312 |
| - BDropdownDivider, |
313 |
| - BDropdownForm, |
314 |
| - BDropdownGroup, |
315 |
| - BDropdownHeader, |
316 |
| - BDropdownItem, |
317 |
| - BDropdownItemButton, |
318 |
| - BDropdownText, |
319 |
| - BForm, |
320 |
| - BFormFloatingLabel, |
321 |
| - BFormInvalidFeedback, |
322 |
| - BFormRow, |
323 |
| - BFormText, |
324 |
| - BFormValidFeedback, |
325 |
| - BFormCheckbox, |
326 |
| - BFormCheckboxGroup, |
327 |
| - BFormGroup, |
328 |
| - BFormInput, |
329 |
| - BFormRadio, |
330 |
| - BFormRadioGroup, |
331 |
| - BFormSelect, |
332 |
| - BFormSelectOption, |
333 |
| - BFormSelectOptionGroup, |
334 |
| - BFormTag, |
335 |
| - BFormTags, |
336 |
| - BFormTextarea, |
337 |
| - BImg, |
338 |
| - BInputGroup, |
339 |
| - BInputGroupAddon, |
340 |
| - BInputGroupAppend, |
341 |
| - BInputGroupPrepend, |
342 |
| - BInputGroupText, |
343 |
| - BLink, |
344 |
| - BListGroup, |
345 |
| - BListGroupItem, |
346 |
| - BModal, |
347 |
| - BNav, |
348 |
| - BNavItem, |
349 |
| - BNavItemDropdown, |
350 |
| - BOffcanvas, |
351 |
| - BOverlay, |
352 |
| - BPagination, |
353 |
| - BPopover, |
354 |
| - BProgress, |
355 |
| - BProgressBar, |
356 |
| - BRow, |
357 |
| - BSkeleton, |
358 |
| - BSkeletonIcon, |
359 |
| - BSkeletonTable, |
360 |
| - BSkeletonWrapper, |
361 |
| - BSpinner, |
362 |
| - BTab, |
363 |
| - BTable, |
364 |
| - BTableSimple, |
365 |
| - BTbody, |
366 |
| - BTd, |
367 |
| - BTfoot, |
368 |
| - BTh, |
369 |
| - BThead, |
370 |
| - BTr, |
371 |
| - BTabs, |
372 |
| - BToast, |
373 |
| - BToaster, |
374 |
| - BToastContainer, |
375 |
| - BTransition, |
| 351 | + Object.entries(Directives).forEach(([name, component]) => { |
| 352 | + app.directive(name, component) |
| 353 | + }) |
| 354 | + |
| 355 | + createBreadcrumb(app) |
| 356 | + }, |
376 | 357 | }
|
| 358 | + |
| 359 | +export {plugin as BootstrapVue3} |
| 360 | +export default plugin |
0 commit comments