diff --git a/docs/components/importdoc.vue b/docs/components/importdoc.vue index 5da68756c8e..a5829cf0454 100644 --- a/docs/components/importdoc.vue +++ b/docs/components/importdoc.vue @@ -125,14 +125,13 @@ @@ -144,6 +143,8 @@ import kebabCase from 'lodash/kebabCase' import startCase from 'lodash/startCase' import AnchoredHeading from './anchored-heading' +const importPath = 'bootstrap-vue' + export default { name: 'BDVImportdoc', components: { AnchoredHeading }, @@ -212,9 +213,8 @@ export default { }, directiveImportCode() { const firstDirective = this.directives[0] - const firstDirectiveImport = this.directiveImports[0] return [ - `import { ${firstDirective} } from '${firstDirectiveImport.importPath}'`, + `import { ${firstDirective} } from '${importPath}'`, "// Note: Vue automatically prefixes the directive name with 'v-'", `Vue.directive('${this.directiveName(firstDirective)}', ${firstDirective})` ].join('\n') diff --git a/scripts/build.sh b/scripts/build.sh index 24be71fafb6..7154494e268 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -13,28 +13,20 @@ echo 'Done.' echo '' # Cleanup -rm -rf dist es esm +rm -rf dist esm echo 'Compile JS...' rollup -c scripts/rollup.config.js echo 'Done.' echo '' -echo 'Build ESM modules...' +echo 'Compiling ESM modular build...' NODE_ENV=esm babel src --out-dir esm --ignore 'src/**/*.spec.js' -rm -f esm/legacy-es.js esm/browser.js +rm -f esm/browser.js echo "${BV_BANNER}" | cat - esm/index.js > esm/tmp.js && mv -f esm/tmp.js esm/index.js echo 'Done.' echo '' -echo 'Build ES modules (deprecated)...' -NODE_ENV=es babel src --out-dir es --ignore 'src/**/*.spec.js' -rm -f es/index.js es/browser.js -echo "${BV_BANNER}" | cat - es/legacy-es.js > es/index.js -rm -f es/legacy-es.js -echo 'Done.' -echo '' - echo 'Minify JS...' terser dist/bootstrap-vue.js \ --compress typeofs=false \ @@ -78,29 +70,16 @@ echo 'Done.' echo '' echo 'Copying types from src/ to esm/ ...' -# There must be a better way to do this +# This may no longer be needed, as all exports are at top level now. # -# The following does not preserve the paths -# shopt -s globstar -# cp src/**/*.d.ts es -# -# So we resort to a find with exec -cd src -find . -type f -name '*.d.ts' -exec cp {} ../esm/{} ';' -cd .. -echo 'Done.' -echo '' - -echo 'Copying types from src/ to es/ ...' # There must be a better way to do this -# # The following does not preserve the paths # shopt -s globstar # cp src/**/*.d.ts es # # So we resort to a find with exec cd src -find . -type f -name '*.d.ts' -exec cp {} ../es/{} ';' +find . -type f -name '*.d.ts' -exec cp {} ../esm/{} ';' cd .. echo 'Done.' echo '' diff --git a/src/bv-config.d.ts b/src/bv-config.d.ts index 2a64453caff..e9bed57f4b8 100644 --- a/src/bv-config.d.ts +++ b/src/bv-config.d.ts @@ -2,4 +2,3 @@ import Vue, { PluginFunction, PluginObject } from 'vue' import { BvPlugin } from './' export declare const BVConfigPlugin: BvPlugin -export default BVConfigPlugin diff --git a/src/bv-config.js b/src/bv-config.js index ac06e540577..79d27dfb870 100644 --- a/src/bv-config.js +++ b/src/bv-config.js @@ -3,6 +3,4 @@ // import { pluginFactory } from './utils/plugins' -const BVConfigPlugin = /*#__PURE__*/ pluginFactory() - -export default BVConfigPlugin +export const BVConfigPlugin = /*#__PURE__*/ pluginFactory() diff --git a/src/components/alert/index.d.ts b/src/components/alert/index.d.ts index b630135ad0f..9c0c0e0ac69 100644 --- a/src/components/alert/index.d.ts +++ b/src/components/alert/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const AlertPlugin: BvPlugin -export default AlertPlugin // Component: b-alert export declare class BAlert extends BvComponent { diff --git a/src/components/alert/index.js b/src/components/alert/index.js index bbabb3ea3e6..4d1298a253c 100644 --- a/src/components/alert/index.js +++ b/src/components/alert/index.js @@ -6,5 +6,3 @@ const AlertPlugin = /*#__PURE__*/ pluginFactory({ }) export { AlertPlugin, BAlert } - -export default AlertPlugin diff --git a/src/components/badge/index.d.ts b/src/components/badge/index.d.ts index d15a97bdcf2..a27dd02a656 100644 --- a/src/components/badge/index.d.ts +++ b/src/components/badge/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const BadgePlugin: BvPlugin -export default BadgePlugin // Component: b-badge export declare class BBadge extends BvComponent {} diff --git a/src/components/badge/index.js b/src/components/badge/index.js index a3f40f07b1a..439ebe161b3 100644 --- a/src/components/badge/index.js +++ b/src/components/badge/index.js @@ -6,5 +6,3 @@ const BadgePlugin = /*#__PURE__*/ pluginFactory({ }) export { BadgePlugin, BBadge } - -export default BadgePlugin diff --git a/src/components/breadcrumb/index.d.ts b/src/components/breadcrumb/index.d.ts index 92b47948529..7030b86026c 100644 --- a/src/components/breadcrumb/index.d.ts +++ b/src/components/breadcrumb/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const BreadcrumbPlugin: BvPlugin -export default BreadcrumbPlugin // Component: b-breadcrumb export declare class BBreadcrumb extends BvComponent {} diff --git a/src/components/breadcrumb/index.js b/src/components/breadcrumb/index.js index 183e9cadffd..8fe2b8ad04c 100644 --- a/src/components/breadcrumb/index.js +++ b/src/components/breadcrumb/index.js @@ -8,5 +8,3 @@ const BreadcrumbPlugin = /*#__PURE__*/ pluginFactory({ }) export { BreadcrumbPlugin, BBreadcrumb, BBreadcrumbItem, BBreadcrumbLink } - -export default BreadcrumbPlugin diff --git a/src/components/button-group/index.d.ts b/src/components/button-group/index.d.ts index 91bc502cb42..ccc8de191f3 100644 --- a/src/components/button-group/index.d.ts +++ b/src/components/button-group/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const ButtonGroupPlugin: BvPlugin -export default ButtonGroupPlugin // Component: b-button-group export declare class BButtonGroup extends BvComponent {} diff --git a/src/components/button-group/index.js b/src/components/button-group/index.js index f562ca35ea2..594345af08d 100644 --- a/src/components/button-group/index.js +++ b/src/components/button-group/index.js @@ -9,5 +9,3 @@ const ButtonGroupPlugin = /*#__PURE__*/ pluginFactory({ }) export { ButtonGroupPlugin, BButtonGroup } - -export default ButtonGroupPlugin diff --git a/src/components/button-toolbar/index.d.ts b/src/components/button-toolbar/index.d.ts index a0ae840c5f2..c04eeb7edc4 100644 --- a/src/components/button-toolbar/index.d.ts +++ b/src/components/button-toolbar/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const ButtonToolbarPlugin: BvPlugin -export default ButtonToolbarPlugin // Component: b-button-toolbar export declare class BButtonToolbar extends BvComponent {} diff --git a/src/components/button-toolbar/index.js b/src/components/button-toolbar/index.js index aa2ae4693d0..741fd1d064f 100644 --- a/src/components/button-toolbar/index.js +++ b/src/components/button-toolbar/index.js @@ -9,5 +9,3 @@ const ButtonToolbarPlugin = /*#__PURE__*/ pluginFactory({ }) export { ButtonToolbarPlugin, BButtonToolbar } - -export default ButtonToolbarPlugin diff --git a/src/components/button/index.d.ts b/src/components/button/index.d.ts index 034f88bff17..d201f88089f 100644 --- a/src/components/button/index.d.ts +++ b/src/components/button/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const ButtonPlugin: BvPlugin -export default ButtonPlugin // Component: b-button export declare class BButton extends BvComponent {} diff --git a/src/components/button/index.js b/src/components/button/index.js index d0948574ac9..5c064a421af 100644 --- a/src/components/button/index.js +++ b/src/components/button/index.js @@ -12,5 +12,3 @@ const ButtonPlugin = /*#__PURE__*/ pluginFactory({ }) export { ButtonPlugin, BButton, BButtonClose } - -export default ButtonPlugin diff --git a/src/components/card/index.d.ts b/src/components/card/index.d.ts index d6eb85b1856..ba4bd6a0882 100644 --- a/src/components/card/index.d.ts +++ b/src/components/card/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const CardPlugin: BvPlugin -export default CardPlugin // Component: b-card export declare class BCard extends BvComponent {} diff --git a/src/components/card/index.js b/src/components/card/index.js index 039585922a3..fabbed4bdd0 100644 --- a/src/components/card/index.js +++ b/src/components/card/index.js @@ -38,5 +38,3 @@ export { BCardText, BCardGroup } - -export default CardPlugin diff --git a/src/components/carousel/index.d.ts b/src/components/carousel/index.d.ts index f10098b2d54..8a4f257771c 100644 --- a/src/components/carousel/index.d.ts +++ b/src/components/carousel/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const CarouselPlugin: BvPlugin -export default CarouselPlugin // Component: b-carousel export declare class BCarousel extends BvComponent { diff --git a/src/components/carousel/index.js b/src/components/carousel/index.js index a1047d3c219..edfb0157e5e 100644 --- a/src/components/carousel/index.js +++ b/src/components/carousel/index.js @@ -10,5 +10,3 @@ const CarouselPlugin = /*#__PURE*/ pluginFactory({ }) export { CarouselPlugin, BCarousel, BCarouselSlide } - -export default CarouselPlugin diff --git a/src/components/collapse/index.d.ts b/src/components/collapse/index.d.ts index 947bd7de473..c66e5c4d5af 100644 --- a/src/components/collapse/index.d.ts +++ b/src/components/collapse/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const CollapsePlugin: BvPlugin -export default CollapsePlugin // Component: b-collapse export declare class BCollapse extends BvComponent { diff --git a/src/components/collapse/index.js b/src/components/collapse/index.js index 4e8ea9ec23a..026531ac4cf 100644 --- a/src/components/collapse/index.js +++ b/src/components/collapse/index.js @@ -8,5 +8,3 @@ const CollapsePlugin = /*#__PURE__*/ pluginFactory({ }) export { CollapsePlugin, BCollapse } - -export default CollapsePlugin diff --git a/src/components/dropdown/index.d.ts b/src/components/dropdown/index.d.ts index 65fecc692ee..ec4d3f81ee9 100644 --- a/src/components/dropdown/index.d.ts +++ b/src/components/dropdown/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const DropdownPlugin: BvPlugin -export default DropdownPlugin // Component: b-dropdown export declare class BDropdown extends BvComponent { diff --git a/src/components/dropdown/index.js b/src/components/dropdown/index.js index b0cadbf0ade..9bc0ea20933 100644 --- a/src/components/dropdown/index.js +++ b/src/components/dropdown/index.js @@ -42,5 +42,3 @@ export { BDropdownText, BDropdownGroup } - -export default DropdownPlugin diff --git a/src/components/embed/index.d.ts b/src/components/embed/index.d.ts index 9191b5e264b..ab692e431f4 100644 --- a/src/components/embed/index.d.ts +++ b/src/components/embed/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const EmbedPlugin: BvPlugin -export default EmbedPlugin // Component: b-embed export declare class BEmbed extends BvComponent {} diff --git a/src/components/embed/index.js b/src/components/embed/index.js index 8ed552813a8..accbeab811e 100644 --- a/src/components/embed/index.js +++ b/src/components/embed/index.js @@ -6,5 +6,3 @@ const EmbedPlugin = /*#__PURE__*/ pluginFactory({ }) export { EmbedPlugin, BEmbed } - -export default EmbedPlugin diff --git a/src/components/form-checkbox/index.d.ts b/src/components/form-checkbox/index.d.ts index 43e6c7d094d..5ae3da7f934 100644 --- a/src/components/form-checkbox/index.d.ts +++ b/src/components/form-checkbox/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const FormCheckboxPlugin: BvPlugin -export default FormCheckboxPlugin // Component: b-form-checkbox export declare class BFormCheckbox extends BvComponent {} diff --git a/src/components/form-checkbox/index.js b/src/components/form-checkbox/index.js index 334887c344e..fecc9d78c58 100644 --- a/src/components/form-checkbox/index.js +++ b/src/components/form-checkbox/index.js @@ -14,5 +14,3 @@ const FormCheckboxPlugin = /*#__PURE__*/ pluginFactory({ }) export { FormCheckboxPlugin, BFormCheckbox, BFormCheckboxGroup } - -export default FormCheckboxPlugin diff --git a/src/components/form-file/index.d.ts b/src/components/form-file/index.d.ts index 3e9dd1a8a99..3a10c989ab7 100644 --- a/src/components/form-file/index.d.ts +++ b/src/components/form-file/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const FormFilePlugin: BvPlugin -export default FormFilePlugin // Component: b-form-file export declare class BFormFile extends BvComponent { diff --git a/src/components/form-file/index.js b/src/components/form-file/index.js index 33c48afb81f..3a00d89b7d7 100644 --- a/src/components/form-file/index.js +++ b/src/components/form-file/index.js @@ -9,5 +9,3 @@ const FormFilePlugin = /*#__PURE__*/ pluginFactory({ }) export { FormFilePlugin, BFormFile } - -export default FormFilePlugin diff --git a/src/components/form-group/index.d.ts b/src/components/form-group/index.d.ts index 8208ebb86c9..9744338d1e0 100644 --- a/src/components/form-group/index.d.ts +++ b/src/components/form-group/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const FormGroupPlugin: BvPlugin -export default FormGroupPlugin // Component: b-form-group export declare class BFormGroup extends BvComponent {} diff --git a/src/components/form-group/index.js b/src/components/form-group/index.js index 6c312ead34f..a40d3c91df7 100644 --- a/src/components/form-group/index.js +++ b/src/components/form-group/index.js @@ -9,5 +9,3 @@ const FormGroupPlugin = /*#__PURE__*/ pluginFactory({ }) export { FormGroupPlugin, BFormGroup } - -export default FormGroupPlugin diff --git a/src/components/form-input/index.d.ts b/src/components/form-input/index.d.ts index 14f70d678af..738afbccf15 100644 --- a/src/components/form-input/index.d.ts +++ b/src/components/form-input/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const FormInputPlugin: BvPlugin -export default FormInputPlugin // Component: b-form-input export declare class BFormInput extends BvComponent { diff --git a/src/components/form-input/index.js b/src/components/form-input/index.js index 86a8ee0f539..5e0e337a71f 100644 --- a/src/components/form-input/index.js +++ b/src/components/form-input/index.js @@ -9,5 +9,3 @@ const FormInputPlugin = /*#__PURE__*/ pluginFactory({ }) export { FormInputPlugin, BFormInput } - -export default FormInputPlugin diff --git a/src/components/form-radio/index.d.ts b/src/components/form-radio/index.d.ts index 61139380425..e5f95e31660 100644 --- a/src/components/form-radio/index.d.ts +++ b/src/components/form-radio/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const FormRadioPlugin: BvPlugin -export default FormRadioPlugin // Component: b-form-radio export declare class BFormRadio extends BvComponent {} diff --git a/src/components/form-radio/index.js b/src/components/form-radio/index.js index 3fe88c3e815..816f2c577e4 100644 --- a/src/components/form-radio/index.js +++ b/src/components/form-radio/index.js @@ -12,5 +12,3 @@ const FormRadioPlugin = /*#__PURE__*/ pluginFactory({ }) export { FormRadioPlugin, BFormRadio, BFormRadioGroup } - -export default FormRadioPlugin diff --git a/src/components/form-select/index.d.ts b/src/components/form-select/index.d.ts index 4f8e9e9e33a..9ac3911fd52 100644 --- a/src/components/form-select/index.d.ts +++ b/src/components/form-select/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const FormSelectPlugin: BvPlugin -export default FormSelectPlugin // Component: b-form-select export declare class BFormSelect extends BvComponent {} diff --git a/src/components/form-select/index.js b/src/components/form-select/index.js index 5a0a92ebc82..8ed949d59bd 100644 --- a/src/components/form-select/index.js +++ b/src/components/form-select/index.js @@ -9,5 +9,3 @@ const FormSelectPlugin = /*#__PURE__*/ pluginFactory({ }) export { FormSelectPlugin, BFormSelect } - -export default FormSelectPlugin diff --git a/src/components/form-textarea/index.d.ts b/src/components/form-textarea/index.d.ts index 18e65f86d8e..bbe51233769 100644 --- a/src/components/form-textarea/index.d.ts +++ b/src/components/form-textarea/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const FormTextareaPlugin: BvPlugin -export default FormTextareaPlugin // Component: b-form-textarea export declare class BFormTextarea extends BvComponent { diff --git a/src/components/form-textarea/index.js b/src/components/form-textarea/index.js index 175e92994b0..3ec886ded02 100644 --- a/src/components/form-textarea/index.js +++ b/src/components/form-textarea/index.js @@ -9,5 +9,3 @@ const FormTextareaPlugin = /*#__PURE__*/ pluginFactory({ }) export { FormTextareaPlugin, BFormTextarea } - -export default FormTextareaPlugin diff --git a/src/components/form/index.d.ts b/src/components/form/index.d.ts index f6c8318f46d..a7ee3ffe216 100644 --- a/src/components/form/index.d.ts +++ b/src/components/form/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const FormPlugin: BvPlugin -export default FormPlugin // Component: b-form export declare class BForm extends BvComponent {} diff --git a/src/components/form/index.js b/src/components/form/index.js index f47e424ceee..592cf0bcd6b 100644 --- a/src/components/form/index.js +++ b/src/components/form/index.js @@ -22,5 +22,3 @@ const FormPlugin = /*#__PURE__*/ pluginFactory({ // BFormRow is not exported here as a named export, as it is exported by Layout export { FormPlugin, BForm, BFormDatalist, BFormText, BFormInvalidFeedback, BFormValidFeedback } - -export default FormPlugin diff --git a/src/components/image/index.d.ts b/src/components/image/index.d.ts index 4ecb2b2c2ff..60c481bb0ba 100644 --- a/src/components/image/index.d.ts +++ b/src/components/image/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const ImagePlugin: BvPlugin -export default ImagePlugin // Component: b-img export declare class BImg extends BvComponent {} diff --git a/src/components/image/index.js b/src/components/image/index.js index db3a3984eb2..3fefe3980e1 100644 --- a/src/components/image/index.js +++ b/src/components/image/index.js @@ -10,5 +10,3 @@ const ImagePlugin = /*#__PURE__*/ pluginFactory({ }) export { ImagePlugin, BImg, BImgLazy } - -export default ImagePlugin diff --git a/src/components/index.d.ts b/src/components/index.d.ts index cfcd4d4771c..eae58c71bfd 100644 --- a/src/components/index.d.ts +++ b/src/components/index.d.ts @@ -1,8 +1,7 @@ import { BvPlugin } from '../' -// Default export is a plugin that installs all plugins -declare const BVComponentsPlugin: BvPlugin -export default BVComponentsPlugin +// Plugin that installs all plugins +export declare const componentsPlugin: BvPlugin // Export all components as named exports export * from './alert' diff --git a/src/components/index.esm.js b/src/components/index.esm.js deleted file mode 100644 index 65db27d6cb9..00000000000 --- a/src/components/index.esm.js +++ /dev/null @@ -1,311 +0,0 @@ -// Index file used for the main builds, which does not include legacy plugin names -// Once es/ buld is removed, then this file will be renamed to index.js -import { pluginFactory } from '../utils/plugins' - -// Component group plugins -import { AlertPlugin } from './alert' -import { BadgePlugin } from './badge' -import { BreadcrumbPlugin } from './breadcrumb' -import { ButtonPlugin } from './button' -import { ButtonGroupPlugin } from './button-group' -import { ButtonToolbarPlugin } from './button-toolbar' -import { CardPlugin } from './card' -import { CarouselPlugin } from './carousel' -import { CollapsePlugin } from './collapse' -import { DropdownPlugin } from './dropdown' -import { EmbedPlugin } from './embed' -import { FormPlugin } from './form' -import { FormGroupPlugin } from './form-group' -import { FormCheckboxPlugin } from './form-checkbox' -import { FormRadioPlugin } from './form-radio' -import { FormInputPlugin } from './form-input' -import { FormTextareaPlugin } from './form-textarea' -import { FormFilePlugin } from './form-file' -import { FormSelectPlugin } from './form-select' -import { ImagePlugin } from './image' -import { InputGroupPlugin } from './input-group' -import { JumbotronPlugin } from './jumbotron' -import { LayoutPlugin } from './layout' -import { LinkPlugin } from './link' -import { ListGroupPlugin } from './list-group' -import { MediaPlugin } from './media' -import { ModalPlugin } from './modal' -import { NavPlugin } from './nav' -import { NavbarPlugin } from './navbar' -import { PaginationPlugin } from './pagination' -import { PaginationNavPlugin } from './pagination-nav' -import { PopoverPlugin } from './popover' -import { ProgressPlugin } from './progress' -import { SpinnerPlugin } from './spinner' -import { TablePlugin } from './table' -import { TabsPlugin } from './tabs' -import { ToastPlugin } from './toast' -import { TooltipPlugin } from './tooltip' - -// Main plugin to install all component group plugins -export const componentsPlugin = /*#__PURE__*/ pluginFactory({ - plugins: { - AlertPlugin, - BadgePlugin, - BreadcrumbPlugin, - ButtonPlugin, - ButtonGroupPlugin, - ButtonToolbarPlugin, - CardPlugin, - CarouselPlugin, - CollapsePlugin, - DropdownPlugin, - EmbedPlugin, - FormPlugin, - FormGroupPlugin, - FormCheckboxPlugin, - FormRadioPlugin, - FormInputPlugin, - FormTextareaPlugin, - FormFilePlugin, - FormSelectPlugin, - ImagePlugin, - InputGroupPlugin, - JumbotronPlugin, - LayoutPlugin, - LinkPlugin, - ListGroupPlugin, - MediaPlugin, - ModalPlugin, - NavPlugin, - NavbarPlugin, - PaginationPlugin, - PaginationNavPlugin, - PopoverPlugin, - ProgressPlugin, - SpinnerPlugin, - TablePlugin, - TabsPlugin, - ToastPlugin, - TooltipPlugin - } -}) - -// Export named injection plugins -// These two plugins are not directly included in the above installer, as they are -// installed via the ModalPlugin and ToastPlugin respectively. -export { BVModalPlugin } from './modal/helpers/bv-modal' -export { BVToastPlugin } from './toast/helpers/bv-toast' - -// Export all individual components and component group plugins as named exports. -// This is mainly for users who import individual components, directives or plugins. -// -// Webpack 4 has optimization difficulties with re-eport of re-exports, so -// we import the components individulaly here for better tree shaking, -// -// Webpack v5 fixes the optimizations with re-export of re-exports so this -// can be reverted back to `export * from './table'` when Webpack v5 is released. -// https://github.com/webpack/webpack/pull/9203 (available in Webpack v5.0.0-alpha.15) - -// export * from './alert' -export { AlertPlugin } from './alert' -export { BAlert } from './alert/alert' - -// export * from './badge' -export { BadgePlugin } from './badge' -export { BBadge } from './badge/badge' - -// export * from './breadcrumb' -export { BreadcrumbPlugin } from './breadcrumb' -export { BBreadcrumb } from './breadcrumb/breadcrumb' -export { BBreadcrumbItem } from './breadcrumb/breadcrumb-item' - -// export * from './button' -export { ButtonPlugin } from './button' -export { BButton } from './button/button' -export { BButtonClose } from './button/button-close' - -// export * from './button-group' -export { ButtonGroupPlugin } from './button-group' -export { BButtonGroup } from './button-group/button-group' - -// export * from './button-toolbar' -export { ButtonToolbarPlugin } from './button-toolbar' -export { BButtonToolbar } from './button-toolbar/button-toolbar' - -// export * from './card' -export { CardPlugin } from './card' -export { BCard } from './card/card' -export { BCardBody } from './card/card-body' -export { BCardFooter } from './card/card-footer' -export { BCardGroup } from './card/card-group' -export { BCardHeader } from './card/card-header' -export { BCardImg } from './card/card-img' -export { BCardImgLazy } from './card/card-img-lazy' -export { BCardSubTitle } from './card/card-sub-title' -export { BCardText } from './card/card-text' -export { BCardTitle } from './card/card-title' - -// export * from './carousel' -export { CarouselPlugin } from './carousel' -export { BCarousel } from './carousel/carousel' -export { BCarouselSlide } from './carousel/carousel-slide' - -// export * from './collapse' -export { CollapsePlugin } from './collapse' -export { BCollapse } from './collapse/collapse' - -// export * from './dropdown' -export { DropdownPlugin } from './dropdown' -export { BDropdown } from './dropdown/dropdown' -export { BDropdownItem } from './dropdown/dropdown-item' -export { BDropdownItemButton } from './dropdown/dropdown-item-button' -export { BDropdownDivider } from './dropdown/dropdown-divider' -export { BDropdownForm } from './dropdown/dropdown-form' -export { BDropdownGroup } from './dropdown/dropdown-group' -export { BDropdownHeader } from './dropdown/dropdown-header' -export { BDropdownText } from './dropdown/dropdown-text' - -// export * from './embed' -export { EmbedPlugin } from './embed' -export { BEmbed } from './embed/embed' - -// export * from './form' -export { FormPlugin } from './form' -export { BForm } from './form/form' -export { BFormDatalist } from './form/form-datalist' -export { BFormText } from './form/form-text' -export { BFormInvalidFeedback } from './form/form-invalid-feedback' -export { BFormValidFeedback } from './form/form-valid-feedback' - -// export * from './form-checkbox' -export { FormCheckboxPlugin } from './form-checkbox' -export { BFormCheckbox } from './form-checkbox/form-checkbox' -export { BFormCheckboxGroup } from './form-checkbox/form-checkbox-group' - -// export * from './form-file' -export { FormFilePlugin } from './form-file' -export { BFormFile } from './form-file/form-file' - -// export * from './form-group' -export { FormGroupPlugin } from './form-group' -export { BFormGroup } from './form-group/form-group' - -// export * from './form-input' -export { FormInputPlugin } from './form-input' -export { BFormInput } from './form-input/form-input' - -// export * from './form-radio' -export { FormRadioPlugin } from './form-radio' -export { BFormRadio } from './form-radio/form-radio' -export { BFormRadioGroup } from './form-radio/form-radio-group' - -// export * from './form-select' -export { FormSelectPlugin } from './form-select' -export { BFormSelect } from './form-select/form-select' - -// export * from './form-textarea' -export { FormTextareaPlugin } from './form-textarea' -export { BFormTextarea } from './form-textarea/form-textarea' - -// export * from './image' -export { ImagePlugin } from './image' -export { BImg } from './image/img' -export { BImgLazy } from './image/img-lazy' - -// export * from './input-group' -export { InputGroupPlugin } from './input-group' -export { BInputGroup } from './input-group/input-group' -export { BInputGroupAddon } from './input-group/input-group-addon' -export { BInputGroupAppend } from './input-group/input-group-append' -export { BInputGroupPrepend } from './input-group/input-group-prepend' -export { BInputGroupText } from './input-group/input-group-text' - -// export * from './jumbotron' -export { JumbotronPlugin } from './jumbotron' -export { BJumbotron } from './jumbotron/jumbotron' - -// export * from './layout' -export { LayoutPlugin } from './layout' -export { BContainer } from './layout/container' -export { BRow } from './layout/row' -export { BCol } from './layout/col' -export { BFormRow } from './layout/form-row' - -// export * from './link' -export { LinkPlugin } from './link' -export { BLink } from './link/link' - -// export * from './list-group' -export { ListGroupPlugin } from './list-group' -export { BListGroup } from './list-group/list-group' -export { BListGroupItem } from './list-group/list-group-item' - -// export * from './media' -export { MediaPlugin } from './media' -export { BMedia } from './media/media' -export { BMediaAside } from './media/media-aside' -export { BMediaBody } from './media/media-body' - -// export * from './modal' -export { ModalPlugin } from './modal' -export { BModal } from './modal/modal' - -// export * from './nav' -export { NavPlugin } from './nav' -export { BNav } from './nav/nav' -export { BNavForm } from './nav/nav-form' -export { BNavItem } from './nav/nav-item' -export { BNavItemDropdown } from './nav/nav-item-dropdown' -export { BNavText } from './nav/nav-text' - -// export * from './navbar' -export { NavbarPlugin } from './navbar' -export { BNavbar } from './navbar/navbar' -export { BNavbarBrand } from './navbar/navbar-brand' -export { BNavbarNav } from './navbar/navbar-nav' -export { BNavbarToggle } from './navbar/navbar-toggle' - -// export * from './pagination' -export { PaginationPlugin } from './pagination' -export { BPagination } from './pagination/pagination' - -// export * from './pagination-nav' -export { PaginationNavPlugin } from './pagination-nav' -export { BPaginationNav } from './pagination-nav/pagination-nav' - -// export * from './popover' -export { PopoverPlugin } from './popover' -export { BPopover } from './popover/popover' - -// export * from './progress' -export { ProgressPlugin } from './progress' -export { BProgress } from './progress/progress' -export { BProgressBar } from './progress/progress-bar' - -// export * from './spinner' -export { SpinnerPlugin } from './spinner' -export { BSpinner } from './spinner/spinner' - -// export * from './table' -export { TablePlugin } from './table' -export { TableLitePlugin } from './table' -export { TableSimplePlugin } from './table' -export { BTable } from './table/table' -export { BTableLite } from './table/table-lite' -export { BTableSimple } from './table/table-simple' -export { BTbody } from './table/tbody' -export { BThead } from './table/thead' -export { BTfoot } from './table/tfoot' -export { BTr } from './table/tr' -export { BTh } from './table/th' -export { BTd } from './table/td' - -// export * from './tabs' -export { TabsPlugin } from './tabs' -export { BTabs } from './tabs/tabs' -export { BTab } from './tabs/tab' - -// export * from './toast' -export { ToastPlugin } from './toast' -export { BToast } from './toast/toast' -export { BToaster } from './toast/toaster' - -// export * from './tooltip' -export { TooltipPlugin } from './tooltip' -export { BTooltip } from './tooltip/tooltip' diff --git a/src/components/index.js b/src/components/index.js index d8e60c4061a..1891f16b40d 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -1,58 +1,86 @@ -// Legacy index file supporting legacy plugin names and default export. -// This file is only here from transpilation purposes for `es/` build. -// src/index imports /src/components/index.esm so that we don't -// have top-level duplicate plugin names. -// -// TODO: -// Once `es/` build is removed, we will rename index.esm.js to index.js -// and update /src/index.js to import the new index.js +import { pluginFactory } from '../utils/plugins' -// Import the main components plugin -import { componentsPlugin } from './index.esm' +// Component group plugins +import { AlertPlugin } from './alert' +import { BadgePlugin } from './badge' +import { BreadcrumbPlugin } from './breadcrumb' +import { ButtonPlugin } from './button' +import { ButtonGroupPlugin } from './button-group' +import { ButtonToolbarPlugin } from './button-toolbar' +import { CardPlugin } from './card' +import { CarouselPlugin } from './carousel' +import { CollapsePlugin } from './collapse' +import { DropdownPlugin } from './dropdown' +import { EmbedPlugin } from './embed' +import { FormPlugin } from './form' +import { FormGroupPlugin } from './form-group' +import { FormCheckboxPlugin } from './form-checkbox' +import { FormRadioPlugin } from './form-radio' +import { FormInputPlugin } from './form-input' +import { FormTextareaPlugin } from './form-textarea' +import { FormFilePlugin } from './form-file' +import { FormSelectPlugin } from './form-select' +import { ImagePlugin } from './image' +import { InputGroupPlugin } from './input-group' +import { JumbotronPlugin } from './jumbotron' +import { LayoutPlugin } from './layout' +import { LinkPlugin } from './link' +import { ListGroupPlugin } from './list-group' +import { MediaPlugin } from './media' +import { ModalPlugin } from './modal' +import { NavPlugin } from './nav' +import { NavbarPlugin } from './navbar' +import { PaginationPlugin } from './pagination' +import { PaginationNavPlugin } from './pagination-nav' +import { PopoverPlugin } from './popover' +import { ProgressPlugin } from './progress' +import { SpinnerPlugin } from './spinner' +// Table plugin includes TableLitePlugin and TableSimplePlugin +import { TablePlugin } from './table' +import { TabsPlugin } from './tabs' +import { ToastPlugin } from './toast' +import { TooltipPlugin } from './tooltip' -// Export all component group plugins and components as named exports -export * from './index.esm' - -// Export all legacy named component group plugins as named exports -// To be removed in stable release -export { AlertPlugin as Alert } from './alert' -export { BadgePlugin as Badge } from './badge' -export { BreadcrumbPlugin as Breadcrumb } from './breadcrumb' -export { ButtonPlugin as Button } from './button' -export { ButtonGroupPlugin as ButtonGroup } from './button-group' -export { ButtonToolbarPlugin as ButtonToolbar } from './button-toolbar' -export { CardPlugin as Card } from './card' -export { CarouselPlugin as Carousel } from './carousel' -export { CollapsePlugin as Collapse } from './collapse' -export { DropdownPlugin as Dropdown } from './dropdown' -export { EmbedPlugin as Embed } from './embed' -export { FormPlugin as Form } from './form' -export { FormGroupPlugin as FormGroup } from './form-group' -export { FormCheckboxPlugin as FormCheckbox } from './form-checkbox' -export { FormRadioPlugin as FormRadio } from './form-radio' -export { FormInputPlugin as FormInput } from './form-input' -export { FormTextareaPlugin as FormTextarea } from './form-textarea' -export { FormFilePlugin as FormFile } from './form-file' -export { FormSelectPlugin as FormSelect } from './form-select' -export { ImagePlugin as Image } from './image' -export { InputGroupPlugin as InputGroup } from './input-group' -export { JumbotronPlugin as Jumbotron } from './jumbotron' -export { LayoutPlugin as Layout } from './layout' -export { LinkPlugin as Link } from './link' -export { ListGroupPlugin as ListGroup } from './list-group' -export { MediaPlugin as Media } from './media' -export { ModalPlugin as Modal } from './modal' -export { NavPlugin as Nav } from './nav' -export { NavbarPlugin as Navbar } from './navbar' -export { PaginationPlugin as Pagination } from './pagination' -export { PaginationNavPlugin as PaginationNav } from './pagination-nav' -export { PopoverPlugin as Popover } from './popover' -export { ProgressPlugin as Progress } from './progress' -export { SpinnerPlugin as Spinner } from './spinner' -export { TablePlugin as Table } from './table' -export { TabsPlugin as Tabs } from './tabs' -export { ToastPlugin as Toast } from './toast' -export { TooltipPlugin as Tooltip } from './tooltip' - -// Export default as a plugin that installs all the component group plugins -export default componentsPlugin +// Main plugin to install all component group plugins +export const componentsPlugin = /*#__PURE__*/ pluginFactory({ + plugins: { + AlertPlugin, + BadgePlugin, + BreadcrumbPlugin, + ButtonPlugin, + ButtonGroupPlugin, + ButtonToolbarPlugin, + CardPlugin, + CarouselPlugin, + CollapsePlugin, + DropdownPlugin, + EmbedPlugin, + FormPlugin, + FormGroupPlugin, + FormCheckboxPlugin, + FormRadioPlugin, + FormInputPlugin, + FormTextareaPlugin, + FormFilePlugin, + FormSelectPlugin, + ImagePlugin, + InputGroupPlugin, + JumbotronPlugin, + LayoutPlugin, + LinkPlugin, + ListGroupPlugin, + MediaPlugin, + ModalPlugin, + NavPlugin, + NavbarPlugin, + PaginationPlugin, + PaginationNavPlugin, + PopoverPlugin, + ProgressPlugin, + SpinnerPlugin, + TablePlugin, + TabsPlugin, + ToastPlugin, + TooltipPlugin + } +}) diff --git a/src/components/input-group/index.d.ts b/src/components/input-group/index.d.ts index 38882074c6b..102fde525ce 100644 --- a/src/components/input-group/index.d.ts +++ b/src/components/input-group/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const InputGroupPlugin: BvPlugin -export default InputGroupPlugin // Component: b-input-group export declare class BInputGroup extends BvComponent {} diff --git a/src/components/input-group/index.js b/src/components/input-group/index.js index 0ac78c86161..59d487897c4 100644 --- a/src/components/input-group/index.js +++ b/src/components/input-group/index.js @@ -23,5 +23,3 @@ export { BInputGroupAppend, BInputGroupText } - -export default InputGroupPlugin diff --git a/src/components/jumbotron/index.d.ts b/src/components/jumbotron/index.d.ts index 576fa81c2e0..dba81fe6555 100644 --- a/src/components/jumbotron/index.d.ts +++ b/src/components/jumbotron/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const JumbotronPlugin: BvPlugin -export default JumbotronPlugin // Component: b-jumbotron export declare class BJumbotron extends BvComponent {} diff --git a/src/components/jumbotron/index.js b/src/components/jumbotron/index.js index 7b409656753..e4484e8f4e8 100644 --- a/src/components/jumbotron/index.js +++ b/src/components/jumbotron/index.js @@ -6,5 +6,3 @@ const JumbotronPlugin = /*#__PURE__*/ pluginFactory({ }) export { JumbotronPlugin, BJumbotron } - -export default JumbotronPlugin diff --git a/src/components/layout/index.d.ts b/src/components/layout/index.d.ts index dc0722229b8..4bb7aa1e7ce 100644 --- a/src/components/layout/index.d.ts +++ b/src/components/layout/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const LayoutPlugin: BvPlugin -export default LayoutPlugin // Component: b-container export declare class BContainer extends BvComponent {} diff --git a/src/components/layout/index.js b/src/components/layout/index.js index e158b9730fb..444138f7f3e 100644 --- a/src/components/layout/index.js +++ b/src/components/layout/index.js @@ -14,5 +14,3 @@ const LayoutPlugin = /*#__PURE__*/ pluginFactory({ }) export { LayoutPlugin, BContainer, BRow, BCol, BFormRow } - -export default LayoutPlugin diff --git a/src/components/link/index.d.ts b/src/components/link/index.d.ts index ecfedbe38f7..fcd52317a78 100644 --- a/src/components/link/index.d.ts +++ b/src/components/link/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const LinkPlugin: BvPlugin -export default LinkPlugin // Component: b-link export declare class BLink extends BvComponent { diff --git a/src/components/link/index.js b/src/components/link/index.js index b4243ad9ad5..62a7ec4042f 100644 --- a/src/components/link/index.js +++ b/src/components/link/index.js @@ -6,5 +6,3 @@ const LinkPlugin = /*#__PURE__*/ pluginFactory({ }) export { LinkPlugin, BLink } - -export default LinkPlugin diff --git a/src/components/list-group/index.d.ts b/src/components/list-group/index.d.ts index 05f4eeddf9d..ee31d94e56a 100644 --- a/src/components/list-group/index.d.ts +++ b/src/components/list-group/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const ListGroupPlugin: BvPlugin -export default ListGroupPlugin // Component: b-list-group export declare class BListGroup extends BvComponent {} diff --git a/src/components/list-group/index.js b/src/components/list-group/index.js index 68c97ecc3a7..e73535bcb3f 100644 --- a/src/components/list-group/index.js +++ b/src/components/list-group/index.js @@ -10,5 +10,3 @@ const ListGroupPlugin = /*#__PURE__*/ pluginFactory({ }) export { ListGroupPlugin, BListGroup, BListGroupItem } - -export default ListGroupPlugin diff --git a/src/components/media/index.d.ts b/src/components/media/index.d.ts index 9c314b6f499..ee244d32d06 100644 --- a/src/components/media/index.d.ts +++ b/src/components/media/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const MediaPlugin: BvPlugin -export default MediaPlugin // Component: b-media export declare class BMedia extends BvComponent {} diff --git a/src/components/media/index.js b/src/components/media/index.js index a04f048597d..2fdca60ccfd 100644 --- a/src/components/media/index.js +++ b/src/components/media/index.js @@ -12,5 +12,3 @@ const MediaPlugin = /*#__PURE__*/ pluginFactory({ }) export { MediaPlugin, BMedia, BMediaAside, BMediaBody } - -export default MediaPlugin diff --git a/src/components/modal/helpers/bv-modal.js b/src/components/modal/helpers/bv-modal.js index 0a543c3fd4d..b63e1cb8ee3 100644 --- a/src/components/modal/helpers/bv-modal.js +++ b/src/components/modal/helpers/bv-modal.js @@ -266,5 +266,3 @@ const plugin = Vue => { export const BVModalPlugin = /*#__PURE__*/ pluginFactory({ plugins: { plugin } }) - -export default BVModalPlugin diff --git a/src/components/modal/helpers/bv-modal.spec.js b/src/components/modal/helpers/bv-modal.spec.js index db5fa97041d..44079eb931f 100644 --- a/src/components/modal/helpers/bv-modal.spec.js +++ b/src/components/modal/helpers/bv-modal.spec.js @@ -1,12 +1,12 @@ import { mount, createWrapper, createLocalVue as CreateLocalVue } from '@vue/test-utils' import { waitNT, waitRAF } from '../../../../tests/utils' -import modalPlugin from '../index' +import { ModalPlugin } from '../index' describe('$bvModal', () => { const localVue = new CreateLocalVue() beforeAll(() => { - localVue.use(modalPlugin) + localVue.use(ModalPlugin) }) it('$bvModal.show() and $bvModal.hide() works', async () => { diff --git a/src/components/modal/index.d.ts b/src/components/modal/index.d.ts index 3959750c6f9..ad457ff3eee 100644 --- a/src/components/modal/index.d.ts +++ b/src/components/modal/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent, BvEvent } from '../../' // Modal Plugin export declare const ModalPlugin: BvPlugin -export default ModalPlugin // Component: b-modal export declare class BModal extends BvComponent { diff --git a/src/components/modal/index.js b/src/components/modal/index.js index 5607b06e42a..4737a7d38b3 100644 --- a/src/components/modal/index.js +++ b/src/components/modal/index.js @@ -11,5 +11,3 @@ const ModalPlugin = /*#__PURE__*/ pluginFactory({ }) export { ModalPlugin, BModal } - -export default ModalPlugin diff --git a/src/components/nav/index.d.ts b/src/components/nav/index.d.ts index 6c806d684b8..adf11310664 100644 --- a/src/components/nav/index.d.ts +++ b/src/components/nav/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const NavPlugin: BvPlugin -export default NavPlugin // Component: b-nav export declare class BNav extends BvComponent {} diff --git a/src/components/nav/index.js b/src/components/nav/index.js index f2503e8aaf3..01cb707c2d3 100644 --- a/src/components/nav/index.js +++ b/src/components/nav/index.js @@ -23,5 +23,3 @@ const NavPlugin = /*#__PURE__*/ pluginFactory({ }) export { NavPlugin, BNav, BNavItem, BNavText, BNavForm, BNavItemDropdown } - -export default NavPlugin diff --git a/src/components/navbar/index.d.ts b/src/components/navbar/index.d.ts index 32093ab2073..545cbb19bcc 100644 --- a/src/components/navbar/index.d.ts +++ b/src/components/navbar/index.d.ts @@ -6,8 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const NavbarPlugin: BvPlugin -export default NavbarPlugin - // Component: b-navbar export declare class BNavbar extends BvComponent {} diff --git a/src/components/navbar/index.js b/src/components/navbar/index.js index 9575519ece1..44ac7bb23e6 100644 --- a/src/components/navbar/index.js +++ b/src/components/navbar/index.js @@ -23,5 +23,3 @@ const NavbarPlugin = /*#__PURE__*/ pluginFactory({ }) export { NavbarPlugin, BNavbar, BNavbarNav, BNavbarBrand, BNavbarToggle } - -export default NavbarPlugin diff --git a/src/components/pagination-nav/index.d.ts b/src/components/pagination-nav/index.d.ts index f680fc4ecad..0005902c7ad 100644 --- a/src/components/pagination-nav/index.d.ts +++ b/src/components/pagination-nav/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const PaginationNavPlugin: BvPlugin -export default PaginationNavPlugin // Component: b-pagination-nav export declare class BPaginationNav extends BvComponent {} diff --git a/src/components/pagination-nav/index.js b/src/components/pagination-nav/index.js index e19909730dd..a37a4bf107d 100644 --- a/src/components/pagination-nav/index.js +++ b/src/components/pagination-nav/index.js @@ -6,5 +6,3 @@ const PaginationNavPlugin = /*#__PURE__*/ pluginFactory({ }) export { PaginationNavPlugin, BPaginationNav } - -export default PaginationNavPlugin diff --git a/src/components/pagination/index.d.ts b/src/components/pagination/index.d.ts index 804637739d6..03fde46b12a 100644 --- a/src/components/pagination/index.d.ts +++ b/src/components/pagination/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const PaginationPlugin: BvPlugin -export default PaginationPlugin // Component: b-pagination export declare class BPagination extends BvComponent {} diff --git a/src/components/pagination/index.js b/src/components/pagination/index.js index bbdf31820ad..401db6b702b 100644 --- a/src/components/pagination/index.js +++ b/src/components/pagination/index.js @@ -6,5 +6,3 @@ const PaginationPlugin = /*#__PURE__*/ pluginFactory({ }) export { PaginationPlugin, BPagination } - -export default PaginationPlugin diff --git a/src/components/popover/index.d.ts b/src/components/popover/index.d.ts index 261abc6d96a..538d9684a9c 100644 --- a/src/components/popover/index.d.ts +++ b/src/components/popover/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const PopoverPlugin: BvPlugin -export default PopoverPlugin // Component: b-popover export declare class BPopover extends BvComponent {} diff --git a/src/components/popover/index.js b/src/components/popover/index.js index e491e777cc6..521fa6134bb 100644 --- a/src/components/popover/index.js +++ b/src/components/popover/index.js @@ -8,5 +8,3 @@ const PopoverPlugin = /*#__PURE__*/ pluginFactory({ }) export { PopoverPlugin, BPopover } - -export default PopoverPlugin diff --git a/src/components/progress/index.d.ts b/src/components/progress/index.d.ts index 69ac4b45b99..e9ec1558a87 100644 --- a/src/components/progress/index.d.ts +++ b/src/components/progress/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const ProgressPlugin: BvPlugin -export default ProgressPlugin // Component: b-progress export declare class BProgress extends BvComponent {} diff --git a/src/components/progress/index.js b/src/components/progress/index.js index 25418242ad7..6c302a71639 100644 --- a/src/components/progress/index.js +++ b/src/components/progress/index.js @@ -10,5 +10,3 @@ const ProgressPlugin = /*#__PURE__*/ pluginFactory({ }) export { ProgressPlugin, BProgress, BProgressBar } - -export default ProgressPlugin diff --git a/src/components/spinner/index.d.ts b/src/components/spinner/index.d.ts index 15d7997c529..dd2db336772 100644 --- a/src/components/spinner/index.d.ts +++ b/src/components/spinner/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const SpinnerPlugin: BvPlugin -export default SpinnerPlugin // Component: b-alert export declare class BSpinner extends BvComponent {} diff --git a/src/components/spinner/index.js b/src/components/spinner/index.js index a65cdfe2729..b16fe71c184 100644 --- a/src/components/spinner/index.js +++ b/src/components/spinner/index.js @@ -6,5 +6,3 @@ const SpinnerPlugin = /*#__PURE__*/ pluginFactory({ }) export { SpinnerPlugin, BSpinner } - -export default SpinnerPlugin diff --git a/src/components/table/index.d.ts b/src/components/table/index.d.ts index 353d7412608..5483ce42cdd 100644 --- a/src/components/table/index.d.ts +++ b/src/components/table/index.d.ts @@ -8,7 +8,6 @@ import { BvPlugin, BvComponent } from '../../' export declare const TablePlugin: BvPlugin export declare const TableLitePlugin: BvPlugin export declare const TableSimplePlugin: BvPlugin -export default TablePlugin // Component: b-table export declare class BTable extends BvComponent { diff --git a/src/components/table/index.js b/src/components/table/index.js index 231d609a0a8..415cc9399cc 100644 --- a/src/components/table/index.js +++ b/src/components/table/index.js @@ -54,5 +54,3 @@ export { BTd, BTh } - -export default TablePlugin diff --git a/src/components/table/table.js b/src/components/table/table.js index eeead709de5..d058adbf760 100644 --- a/src/components/table/table.js +++ b/src/components/table/table.js @@ -42,6 +42,7 @@ export const BTable = /*#__PURE__*/ Vue.extend({ tfootMixin, tbodyMixin, // Features Mixins + stackedMixin, filteringMixin, sortingMixin, paginationMixin, diff --git a/src/components/tabs/index.d.ts b/src/components/tabs/index.d.ts index 7ac9d13cf53..3ed2b5222e4 100644 --- a/src/components/tabs/index.d.ts +++ b/src/components/tabs/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const TabsPlugin: BvPlugin -export default TabsPlugin // Component: b-tabs export declare class BTabs extends BvComponent {} diff --git a/src/components/tabs/index.js b/src/components/tabs/index.js index 6be35ce99db..3a0e9564b5f 100644 --- a/src/components/tabs/index.js +++ b/src/components/tabs/index.js @@ -10,5 +10,3 @@ const TabsPlugin = /*#__PURE__*/ pluginFactory({ }) export { TabsPlugin, BTabs, BTab } - -export default TabsPlugin diff --git a/src/components/toast/helpers/bv-toast.js b/src/components/toast/helpers/bv-toast.js index e583f914c85..29284cca9bf 100644 --- a/src/components/toast/helpers/bv-toast.js +++ b/src/components/toast/helpers/bv-toast.js @@ -194,6 +194,3 @@ const plugin = Vue => { export const BVToastPlugin = /*#__PURE__*/ pluginFactory({ plugins: { plugin } }) - -// Default export is the Plugin -export default BVToastPlugin diff --git a/src/components/toast/helpers/bv-toast.spec.js b/src/components/toast/helpers/bv-toast.spec.js index 9d8bb1d56c0..f1e721b51a1 100644 --- a/src/components/toast/helpers/bv-toast.spec.js +++ b/src/components/toast/helpers/bv-toast.spec.js @@ -1,12 +1,12 @@ import { mount, createWrapper, createLocalVue as CreateLocalVue } from '@vue/test-utils' import { waitNT, waitRAF } from '../../../../tests/utils' -import toastPlugin from '../index' +import { ToastPlugin } from '../index' describe('$bvToast', () => { const localVue = new CreateLocalVue() beforeAll(() => { - localVue.use(toastPlugin) + localVue.use(ToastPlugin) }) it('$bvToast.show() and $bvToast.hide() works', async () => { diff --git a/src/components/toast/index.d.ts b/src/components/toast/index.d.ts index 1196fe10ca1..e7324029588 100644 --- a/src/components/toast/index.d.ts +++ b/src/components/toast/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Toast Plugin export declare const ToastPlugin: BvPlugin -export default ToastPlugin // Component: b-toast export declare class BToast extends BvComponent { diff --git a/src/components/toast/index.js b/src/components/toast/index.js index 95187f1b784..6f6dd260325 100644 --- a/src/components/toast/index.js +++ b/src/components/toast/index.js @@ -10,5 +10,3 @@ const ToastPlugin = /*#__PURE__*/ pluginFactory({ }) export { ToastPlugin, BToast, BToaster } - -export default ToastPlugin diff --git a/src/components/tooltip/index.d.ts b/src/components/tooltip/index.d.ts index 4ee217d9b3c..bf580656b7a 100644 --- a/src/components/tooltip/index.d.ts +++ b/src/components/tooltip/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../' // Plugin export declare const TooltipPlugin: BvPlugin -export default TooltipPlugin // Component: b-tooltip export declare class BTooltip extends BvComponent {} diff --git a/src/components/tooltip/index.js b/src/components/tooltip/index.js index bbc01c20491..9c7380e0d66 100644 --- a/src/components/tooltip/index.js +++ b/src/components/tooltip/index.js @@ -8,5 +8,3 @@ const TooltipPlugin = /*#__PURE__*/ pluginFactory({ }) export { TooltipPlugin, BTooltip } - -export default TooltipPlugin diff --git a/src/directives/index.d.ts b/src/directives/index.d.ts index 418a35054a7..7ff01bd1c33 100644 --- a/src/directives/index.d.ts +++ b/src/directives/index.d.ts @@ -1,8 +1,7 @@ import { BvPlugin } from '../' -// Default export is a plugin that installs all plugins -declare const BVDirectivesPlugin: BvPlugin -export default BVDirectivesPlugin +// Plugin that installs all plugins +export declare const directivesPlugin: BvPlugin // Named exports of all directives export * from './toggle' diff --git a/src/directives/index.esm.js b/src/directives/index.esm.js deleted file mode 100644 index a3546ccd9d0..00000000000 --- a/src/directives/index.esm.js +++ /dev/null @@ -1,43 +0,0 @@ -// Index file used for the main builds, which does not include legacy plugin names -// Once es/ buld is removed, then this file will be renamed to index.js -import { pluginFactory } from '../utils/plugins' - -import { VBModalPlugin } from './modal' -import { VBPopoverPlugin } from './popover' -import { VBScrollspyPlugin } from './scrollspy' -import { VBTogglePlugin } from './toggle' -import { VBTooltipPlugin } from './tooltip' - -// Main plugin for installing all directive plugins -export const directivesPlugin = /*#__PURE__*/ pluginFactory({ - plugins: { - VBModalPlugin, - VBPopoverPlugin, - VBScrollspyPlugin, - VBTogglePlugin, - VBTooltipPlugin - } -}) - -// Named exports of all directives (VB) and Plugins (VBPlugin) -// See src/compinents/index.esm.js for notes/comment - -// export * from './modal' -export { VBModalPlugin } from './modal' -export { VBModal } from './modal/modal' - -// export * from './popover' -export { VBPopoverPlugin } from './popover' -export { VBPopover } from './popover/popover' - -// export * from './scrollspy' -export { VBScrollspyPlugin } from './scrollspy' -export { VBScrollspy } from './scrollspy/scrollspy' - -// export * from './toggle' -export { VBTogglePlugin } from './toggle' -export { VBToggle } from './toggle/toggle' - -// export * from './tooltip' -export { VBTooltipPlugin } from './tooltip' -export { VBTooltip } from './tooltip/tooltip' diff --git a/src/directives/index.js b/src/directives/index.js index 9316b610a9b..50cdbaad94f 100644 --- a/src/directives/index.js +++ b/src/directives/index.js @@ -1,21 +1,18 @@ -// Legacy index file supporting legacy plugin names. -// This file is only here from transpilation purposes for `es/` build. -// src/index imports /src/directives/index.esm so that we don't -// have top-level duplicate plugin names. +import { pluginFactory } from '../utils/plugins' -// Import the main directives plugin -import { directivesPlugin } from './index.esm' +import { VBModalPlugin } from './modal' +import { VBPopoverPlugin } from './popover' +import { VBScrollspyPlugin } from './scrollspy' +import { VBTogglePlugin } from './toggle' +import { VBTooltipPlugin } from './tooltip' -// Export all directive group plugins and directives as named exports -export * from './index.esm' - -// Export all legacy named directive group plugins as named exports -// To be removed in stable release -export { VBModalPlugin as Modal } from './modal' -export { VBPopoverPlugin as Popover } from './popover' -export { VBScrollspyPlugin as Scrollspy } from './scrollspy' -export { VBTogglePlugin as Toggle } from './toggle' -export { VBTooltipPlugin as Tooltip } from './tooltip' - -// Default export is a plugin that installs all plugins -export default directivesPlugin +// Main plugin for installing all directive plugins +export const directivesPlugin = /*#__PURE__*/ pluginFactory({ + plugins: { + VBModalPlugin, + VBPopoverPlugin, + VBScrollspyPlugin, + VBTogglePlugin, + VBTooltipPlugin + } +}) diff --git a/src/directives/modal/index.d.ts b/src/directives/modal/index.d.ts index a30cd155f42..cc9484be63f 100644 --- a/src/directives/modal/index.d.ts +++ b/src/directives/modal/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin } from '../../' // Plugin export declare const VBModalPlugin: BvPlugin -export default VBModalPlugin // directive: v-b-modal export declare const VBModal: DirectiveOptions diff --git a/src/directives/modal/index.js b/src/directives/modal/index.js index b45810d8237..6d701dbc6dc 100644 --- a/src/directives/modal/index.js +++ b/src/directives/modal/index.js @@ -6,5 +6,3 @@ const VBModalPlugin = /*#__PURE__*/ pluginFactory({ }) export { VBModalPlugin, VBModal } - -export default VBModalPlugin diff --git a/src/directives/popover/index.d.ts b/src/directives/popover/index.d.ts index 0452caa83e3..1bb469baa69 100644 --- a/src/directives/popover/index.d.ts +++ b/src/directives/popover/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin } from '../../' // Plugin export declare const VBPopoverPlugin: BvPlugin -export default VBPopoverPlugin // directive: v-b-popover export declare const VBPopover: DirectiveOptions diff --git a/src/directives/popover/index.js b/src/directives/popover/index.js index 5e89909be61..21a28cbfcae 100644 --- a/src/directives/popover/index.js +++ b/src/directives/popover/index.js @@ -6,5 +6,3 @@ const VBPopoverPlugin = /*#__PURE__*/ pluginFactory({ }) export { VBPopoverPlugin, VBPopover } - -export default VBPopoverPlugin diff --git a/src/directives/scrollspy/index.d.ts b/src/directives/scrollspy/index.d.ts index 0ea0906ec54..c128d79df9f 100644 --- a/src/directives/scrollspy/index.d.ts +++ b/src/directives/scrollspy/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin } from '../../' // Plugin export declare const VBScrollspyPlugin: BvPlugin -export default VBScrollspyPlugin // directive: v-b-scrollspy export declare const VBScrollspy: DirectiveOptions diff --git a/src/directives/scrollspy/index.js b/src/directives/scrollspy/index.js index 9519dc272c0..3e411e7b0e7 100644 --- a/src/directives/scrollspy/index.js +++ b/src/directives/scrollspy/index.js @@ -6,5 +6,3 @@ const VBScrollspyPlugin = /*#__PURE__*/ pluginFactory({ }) export { VBScrollspyPlugin, VBScrollspy } - -export default VBScrollspyPlugin diff --git a/src/directives/toggle/index.d.ts b/src/directives/toggle/index.d.ts index c1409ef7b33..931132c0448 100644 --- a/src/directives/toggle/index.d.ts +++ b/src/directives/toggle/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin } from '../../' // Plugin export declare const VBTogglePlugin: BvPlugin -export default VBTogglePlugin // directive: v-b-toggle export declare const VBToggle: DirectiveOptions diff --git a/src/directives/toggle/index.js b/src/directives/toggle/index.js index 638388404de..e762aaf766b 100644 --- a/src/directives/toggle/index.js +++ b/src/directives/toggle/index.js @@ -6,5 +6,3 @@ const VBTogglePlugin = /*#__PURE__*/ pluginFactory({ }) export { VBTogglePlugin, VBToggle } - -export default VBTogglePlugin diff --git a/src/directives/tooltip/index.d.ts b/src/directives/tooltip/index.d.ts index 51af79ffc7d..a188590ca7e 100644 --- a/src/directives/tooltip/index.d.ts +++ b/src/directives/tooltip/index.d.ts @@ -6,7 +6,6 @@ import { BvPlugin } from '../../' // Plugin export declare const VBTooltipPlugin: BvPlugin -export default VBTooltipPlugin // directive: v-b-tooltip export declare const VBTooltip: DirectiveOptions diff --git a/src/directives/tooltip/index.js b/src/directives/tooltip/index.js index ea32ed99eb0..7c5efbf3a28 100644 --- a/src/directives/tooltip/index.js +++ b/src/directives/tooltip/index.js @@ -6,5 +6,3 @@ const VBTooltipPlugin = /*#__PURE__*/ pluginFactory({ }) export { VBTooltipPlugin, VBTooltip } - -export default VBTooltipPlugin diff --git a/src/index.js b/src/index.js index a0e82367800..55476dfdc14 100644 --- a/src/index.js +++ b/src/index.js @@ -1,26 +1,31 @@ import { installFactory } from './utils/plugins' -import { componentsPlugin } from './components/index.esm' -import { directivesPlugin } from './directives/index.esm' -import BVConfigPlugin from './bv-config' +import { componentsPlugin } from './components' +import { directivesPlugin } from './directives' +import { BVConfigPlugin } from './bv-config' const NAME = 'BootstrapVue' -// Named exports of all components and component group plugins -export * from './components/index.esm' - -// Named exports of all directives and directive group plugins -export * from './directives/index.esm' - +// // BootstrapVue installer -const install = /*#__PURE__*/ installFactory({ plugins: { componentsPlugin, directivesPlugin } }) +// +const install = /*#__PURE__*/ installFactory({ + plugins: { + componentsPlugin, + directivesPlugin + } +}) +// // BootstrapVue plugin +// const BootstrapVue = /*#__PURE__*/ { install, NAME } -// Named exports for BvConfigPlugin and BootstrapVue +// +// Named exports for BvConfigPlugin +// export { // Installer exported in case the consumer does not import `default` // as the plugin in CommonJS build (or does not have interop enabled @@ -39,5 +44,261 @@ export { BootstrapVue } +// +// Export named injection plugins +// +// TODO: we should probably move injections into their +// own parent directory (i.e. /src/injections) +export { BVModalPlugin } from './components/modal/helpers/bv-modal' +export { BVToastPlugin } from './components/toast/helpers/bv-toast' + +// +// Export all individual components and component group plugins as named exports. +// + +// Webpack 4 has optimization difficulties with re-eport of re-exports, so +// we import the components individulaly here for better tree shaking, +// +// Webpack v5 fixes the optimizations with re-export of re-exports so this +// can be reverted back to `export * from './table'` when Webpack v5 is released. +// https://github.com/webpack/webpack/pull/9203 (available in Webpack v5.0.0-alpha.15) + +// export * from './components/alert' +export { AlertPlugin } from './components/alert' +export { BAlert } from './components/alert/alert' + +// export * from './components/badge' +export { BadgePlugin } from './components/badge' +export { BBadge } from './components/badge/badge' + +// export * from './components/breadcrumb' +export { BreadcrumbPlugin } from './components/breadcrumb' +export { BBreadcrumb } from './components/breadcrumb/breadcrumb' +export { BBreadcrumbItem } from './components/breadcrumb/breadcrumb-item' + +// export * from './components/button' +export { ButtonPlugin } from './components/button' +export { BButton } from './components/button/button' +export { BButtonClose } from './components/button/button-close' + +// export * from './components/button-group' +export { ButtonGroupPlugin } from './components/button-group' +export { BButtonGroup } from './components/button-group/button-group' + +// export * from './components/button-toolbar' +export { ButtonToolbarPlugin } from './components/button-toolbar' +export { BButtonToolbar } from './components/button-toolbar/button-toolbar' + +// export * from './components/card' +export { CardPlugin } from './components/card' +export { BCard } from './components/card/card' +export { BCardBody } from './components/card/card-body' +export { BCardFooter } from './components/card/card-footer' +export { BCardGroup } from './components/card/card-group' +export { BCardHeader } from './components/card/card-header' +export { BCardImg } from './components/card/card-img' +export { BCardImgLazy } from './components/card/card-img-lazy' +export { BCardSubTitle } from './components/card/card-sub-title' +export { BCardText } from './components/card/card-text' +export { BCardTitle } from './components/card/card-title' + +// export * from './components/carousel' +export { CarouselPlugin } from './components/carousel' +export { BCarousel } from './components/carousel/carousel' +export { BCarouselSlide } from './components/carousel/carousel-slide' + +// export * from './components/collapse' +export { CollapsePlugin } from './components/collapse' +export { BCollapse } from './components/collapse/collapse' + +// export * from './components/dropdown' +export { DropdownPlugin } from './components/dropdown' +export { BDropdown } from './components/dropdown/dropdown' +export { BDropdownItem } from './components/dropdown/dropdown-item' +export { BDropdownItemButton } from './components/dropdown/dropdown-item-button' +export { BDropdownDivider } from './components/dropdown/dropdown-divider' +export { BDropdownForm } from './components/dropdown/dropdown-form' +export { BDropdownGroup } from './components/dropdown/dropdown-group' +export { BDropdownHeader } from './components/dropdown/dropdown-header' +export { BDropdownText } from './components/dropdown/dropdown-text' + +// export * from './components/embed' +export { EmbedPlugin } from './components/embed' +export { BEmbed } from './components/embed/embed' + +// export * from './components/form' +export { FormPlugin } from './components/form' +export { BForm } from './components/form/form' +export { BFormDatalist } from './components/form/form-datalist' +export { BFormText } from './components/form/form-text' +export { BFormInvalidFeedback } from './components/form/form-invalid-feedback' +export { BFormValidFeedback } from './components/form/form-valid-feedback' + +// export * from './components/form-checkbox' +export { FormCheckboxPlugin } from './components/form-checkbox' +export { BFormCheckbox } from './components/form-checkbox/form-checkbox' +export { BFormCheckboxGroup } from './components/form-checkbox/form-checkbox-group' + +// export * from './components/form-file' +export { FormFilePlugin } from './components/form-file' +export { BFormFile } from './components/form-file/form-file' + +// export * from './components/form-group' +export { FormGroupPlugin } from './components/form-group' +export { BFormGroup } from './components/form-group/form-group' + +// export * from './components/form-input' +export { FormInputPlugin } from './components/form-input' +export { BFormInput } from './components/form-input/form-input' + +// export * from './components/form-radio' +export { FormRadioPlugin } from './components/form-radio' +export { BFormRadio } from './components/form-radio/form-radio' +export { BFormRadioGroup } from './components/form-radio/form-radio-group' + +// export * from './components/form-select' +export { FormSelectPlugin } from './components/form-select' +export { BFormSelect } from './components/form-select/form-select' + +// export * from './components/form-textarea' +export { FormTextareaPlugin } from './components/form-textarea' +export { BFormTextarea } from './components/form-textarea/form-textarea' + +// export * from './components/image' +export { ImagePlugin } from './components/image' +export { BImg } from './components/image/img' +export { BImgLazy } from './components/image/img-lazy' + +// export * from './components/input-group' +export { InputGroupPlugin } from './components/input-group' +export { BInputGroup } from './components/input-group/input-group' +export { BInputGroupAddon } from './components/input-group/input-group-addon' +export { BInputGroupAppend } from './components/input-group/input-group-append' +export { BInputGroupPrepend } from './components/input-group/input-group-prepend' +export { BInputGroupText } from './components/input-group/input-group-text' + +// export * from './components/jumbotron' +export { JumbotronPlugin } from './components/jumbotron' +export { BJumbotron } from './components/jumbotron/jumbotron' + +// export * from './components/layout' +export { LayoutPlugin } from './components/layout' +export { BContainer } from './components/layout/container' +export { BRow } from './components/layout/row' +export { BCol } from './components/layout/col' +export { BFormRow } from './components/layout/form-row' + +// export * from './components/link' +export { LinkPlugin } from './components/link' +export { BLink } from './components/link/link' + +// export * from './components/list-group' +export { ListGroupPlugin } from './components/list-group' +export { BListGroup } from './components/list-group/list-group' +export { BListGroupItem } from './components/list-group/list-group-item' + +// export * from './components/media' +export { MediaPlugin } from './components/media' +export { BMedia } from './components/media/media' +export { BMediaAside } from './components/media/media-aside' +export { BMediaBody } from './components/media/media-body' + +// export * from './components/modal' +export { ModalPlugin } from './components/modal' +export { BModal } from './components/modal/modal' + +// export * from './components/nav' +export { NavPlugin } from './components/nav' +export { BNav } from './components/nav/nav' +export { BNavForm } from './components/nav/nav-form' +export { BNavItem } from './components/nav/nav-item' +export { BNavItemDropdown } from './components/nav/nav-item-dropdown' +export { BNavText } from './components/nav/nav-text' + +// export * from './components/navbar' +export { NavbarPlugin } from './components/navbar' +export { BNavbar } from './components/navbar/navbar' +export { BNavbarBrand } from './components/navbar/navbar-brand' +export { BNavbarNav } from './components/navbar/navbar-nav' +export { BNavbarToggle } from './components/navbar/navbar-toggle' + +// export * from './components/pagination' +export { PaginationPlugin } from './components/pagination' +export { BPagination } from './components/pagination/pagination' + +// export * from './components/pagination-nav' +export { PaginationNavPlugin } from './components/pagination-nav' +export { BPaginationNav } from './components/pagination-nav/pagination-nav' + +// export * from './components/popover' +export { PopoverPlugin } from './components/popover' +export { BPopover } from './components/popover/popover' + +// export * from './components/progress' +export { ProgressPlugin } from './components/progress' +export { BProgress } from './components/progress/progress' +export { BProgressBar } from './components/progress/progress-bar' + +// export * from './components/spinner' +export { SpinnerPlugin } from './components/spinner' +export { BSpinner } from './components/spinner/spinner' + +// export * from './components/table' +export { TablePlugin, TableLitePlugin, TableSimplePlugin } from './components/table' +export { BTable } from './components/table/table' +export { BTableLite } from './components/table/table-lite' +export { BTableSimple } from './components/table/table-simple' +export { BTbody } from './components/table/tbody' +export { BThead } from './components/table/thead' +export { BTfoot } from './components/table/tfoot' +export { BTr } from './components/table/tr' +export { BTh } from './components/table/th' +export { BTd } from './components/table/td' + +// export * from './components/tabs' +export { TabsPlugin } from './components/tabs' +export { BTabs } from './components/tabs/tabs' +export { BTab } from './components/tabs/tab' + +// export * from './components/toast' +export { ToastPlugin } from './components/toast' +export { BToast } from './components/toast/toast' +export { BToaster } from './components/toast/toaster' + +// export * from './components/tooltip' +export { TooltipPlugin } from './components/tooltip' +export { BTooltip } from './components/tooltip/tooltip' + +// +// Named exports of all directives (VB) and Plugins (VBPlugin) +// + +// Webpack 4 has optimization difficulties with re-eport of re-exports, so +// we import the directives individulaly here for better tree shaking, +// +// Webpack v5 fixes the optimizations with re-export of re-exports so this +// can be reverted back to `export * from './scrollspy'` when Webpack v5 is released. +// https://github.com/webpack/webpack/pull/9203 (available in Webpack v5.0.0-alpha.15) + +// export * from './directives/modal' +export { VBModalPlugin } from './directives/modal' +export { VBModal } from './directives/modal/modal' + +// export * from './directives/popover' +export { VBPopoverPlugin } from './directives/popover' +export { VBPopover } from './directives/popover/popover' + +// export * from './directives/scrollspy' +export { VBScrollspyPlugin } from './directives/scrollspy' +export { VBScrollspy } from './directives/scrollspy/scrollspy' + +// export * from './directives/toggle' +export { VBTogglePlugin } from './directives/toggle' +export { VBToggle } from './directives/toggle/toggle' + +// export * from './directives/tooltip' +export { VBTooltipPlugin } from './directives/tooltip' +export { VBTooltip } from './directives/tooltip/tooltip' + // Default export is the BootstrapVue plugin export default BootstrapVue diff --git a/src/legacy-es.js b/src/legacy-es.js deleted file mode 100644 index 54e95cc08dd..00000000000 --- a/src/legacy-es.js +++ /dev/null @@ -1,16 +0,0 @@ -// This index file is used to create the legacy es/index.js -// and will be removed once the `es/` build has been removed. -// It has no top-level named exports - -import { installFactory } from './utils/plugins' -import { setConfig } from './utils/config' -import { componentsPlugin } from './components' -import { directivesPlugin } from './directives' - -const BootstrapVue = { - install: installFactory({ plugins: { componentsPlugin, directivesPlugin } }), - setConfig: setConfig -} - -// Default export is the BootstrapVue plugin -export default BootstrapVue diff --git a/src/utils/config.spec.js b/src/utils/config.spec.js index 30d427331ef..30031b77d6a 100644 --- a/src/utils/config.spec.js +++ b/src/utils/config.spec.js @@ -10,8 +10,8 @@ import { setConfig, resetConfig } from './config-set' import DEFAULTS from './config-defaults' import { createLocalVue } from '@vue/test-utils' import BootstrapVue from '../../src' -import AlertPlugin from '../../src/components/alert' -import BVConfigPlugin from '../../src/bv-config' +import { AlertPlugin } from '../../src/components/alert' +import { BVConfigPlugin } from '../../src/bv-config' describe('utils/config', () => { afterEach(() => {