bootstrap-vue-next 0.9.19 → 0.9.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bootstrap-vue-next.css +1 -1
- package/dist/bootstrap-vue-next.mjs +2755 -2727
- package/dist/bootstrap-vue-next.mjs.map +1 -1
- package/dist/bootstrap-vue-next.umd.js +1 -1
- package/dist/bootstrap-vue-next.umd.js.map +1 -1
- package/dist/src/components/BAvatar/BAvatar.vue.d.ts +9 -9
- package/dist/src/components/BBreadcrumb/BBreadcrumbItem.vue.d.ts +9 -9
- package/dist/src/components/BButton/BButton.vue.d.ts +9 -9
- package/dist/src/components/BCard/BCard.vue.d.ts +108 -108
- package/dist/src/components/BCard/BCardBody.vue.d.ts +23 -23
- package/dist/src/components/BCard/BCardFooter.vue.d.ts +5 -5
- package/dist/src/components/BCard/BCardHeadFoot.vue.d.ts +5 -5
- package/dist/src/components/BCard/BCardHeader.vue.d.ts +5 -5
- package/dist/src/components/BCard/BCardImg.vue.d.ts +9 -9
- package/dist/src/components/BCarousel/BCarouselSlide.vue.d.ts +5 -5
- package/dist/src/components/BDropdown/BDropdownGroup.vue.d.ts +9 -9
- package/dist/src/components/BForm/BFormFloatingLabel.vue.d.ts +5 -5
- package/dist/src/components/BImg.vue.d.ts +18 -18
- package/dist/src/components/BListGroup/BListGroupItem.vue.d.ts +9 -9
- package/dist/src/components/BModal.vue.d.ts +80 -80
- package/dist/src/components/BOffcanvas/BOffcanvas.vue.d.ts +14 -14
- package/dist/src/components/BPlaceholder/BPlaceholderTable.vue.d.ts +9 -9
- package/dist/src/components/BPopover.vue.d.ts +5 -1
- package/dist/src/components/BTable/BTable.vue.d.ts +9 -9
- package/dist/src/components/BTabs/BTabs.vue.d.ts +9 -9
- package/dist/src/components/BToast/BToast.vue.d.ts +4 -4
- package/dist/src/components/BTooltip.vue.d.ts +5 -1
- package/dist/src/types/BootstrapVueOptions.d.ts +10 -16
- package/dist/src/types/index.d.ts +1 -1
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/parseActiveImports.d.ts +3 -0
- package/package.json +3 -3
- package/src/BootstrapVue.ts +24 -10
- package/src/components/BPopover.vue +6 -0
- package/src/components/BToast/plugin.ts +5 -3
- package/src/components/BTooltip.vue +10 -1
- package/src/types/BootstrapVueOptions.ts +9 -17
- package/src/types/index.ts +1 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/parseActiveImports.ts +21 -0
|
@@ -16,10 +16,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
16
16
|
type: import("vue").PropType<string | number>;
|
|
17
17
|
default: number;
|
|
18
18
|
};
|
|
19
|
-
hideHeader: {
|
|
20
|
-
type: import("vue").PropType<Booleanish>;
|
|
21
|
-
default: boolean;
|
|
22
|
-
};
|
|
23
19
|
headerVariant: {
|
|
24
20
|
type: import("vue").PropType<keyof import("../../types").BaseColorVariant | null>;
|
|
25
21
|
default: undefined;
|
|
@@ -28,6 +24,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
28
24
|
type: import("vue").PropType<string | number>;
|
|
29
25
|
default: number;
|
|
30
26
|
};
|
|
27
|
+
hideHeader: {
|
|
28
|
+
type: import("vue").PropType<Booleanish>;
|
|
29
|
+
default: boolean;
|
|
30
|
+
};
|
|
31
31
|
headerAnimation: {
|
|
32
32
|
type: import("vue").PropType<PlaceholderAnimation>;
|
|
33
33
|
default: undefined;
|
|
@@ -89,10 +89,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
89
89
|
type: import("vue").PropType<string | number>;
|
|
90
90
|
default: number;
|
|
91
91
|
};
|
|
92
|
-
hideHeader: {
|
|
93
|
-
type: import("vue").PropType<Booleanish>;
|
|
94
|
-
default: boolean;
|
|
95
|
-
};
|
|
96
92
|
headerVariant: {
|
|
97
93
|
type: import("vue").PropType<keyof import("../../types").BaseColorVariant | null>;
|
|
98
94
|
default: undefined;
|
|
@@ -101,6 +97,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
101
97
|
type: import("vue").PropType<string | number>;
|
|
102
98
|
default: number;
|
|
103
99
|
};
|
|
100
|
+
hideHeader: {
|
|
101
|
+
type: import("vue").PropType<Booleanish>;
|
|
102
|
+
default: boolean;
|
|
103
|
+
};
|
|
104
104
|
headerAnimation: {
|
|
105
105
|
type: import("vue").PropType<PlaceholderAnimation>;
|
|
106
106
|
default: undefined;
|
|
@@ -150,9 +150,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
150
150
|
variant: keyof import("../../types").BaseColorVariant | null;
|
|
151
151
|
animation: PlaceholderAnimation;
|
|
152
152
|
columns: string | number;
|
|
153
|
-
hideHeader: Booleanish;
|
|
154
153
|
headerVariant: keyof import("../../types").BaseColorVariant | null;
|
|
155
154
|
rows: string | number;
|
|
155
|
+
hideHeader: Booleanish;
|
|
156
156
|
headerAnimation: PlaceholderAnimation;
|
|
157
157
|
headerSize: PlaceholderSize;
|
|
158
158
|
footerVariant: keyof import("../../types").BaseColorVariant | null;
|
|
@@ -127,7 +127,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
127
127
|
type: import("vue").PropType<Booleanish>;
|
|
128
128
|
default: boolean;
|
|
129
129
|
};
|
|
130
|
-
}, {
|
|
130
|
+
}, {
|
|
131
|
+
hideFn: (e: Event) => void;
|
|
132
|
+
show: () => void;
|
|
133
|
+
toggle: (e: Event) => void;
|
|
134
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
131
135
|
show: (value: BvTriggerableEvent) => void;
|
|
132
136
|
shown: (value: BvTriggerableEvent) => void;
|
|
133
137
|
hide: (value: BvTriggerableEvent) => void;
|
|
@@ -25,10 +25,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
25
25
|
type: import("vue").PropType<keyof import("../../types").BaseColorVariant | null>;
|
|
26
26
|
default: undefined;
|
|
27
27
|
};
|
|
28
|
-
busy: {
|
|
29
|
-
type: import("vue").PropType<Booleanish>;
|
|
30
|
-
default: boolean;
|
|
31
|
-
};
|
|
32
28
|
items: {
|
|
33
29
|
type: import("vue").PropType<TableItem[]>;
|
|
34
30
|
default: () => never[];
|
|
@@ -41,6 +37,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
41
37
|
type: import("vue").PropType<boolean | Breakpoint>;
|
|
42
38
|
default: boolean;
|
|
43
39
|
};
|
|
40
|
+
busy: {
|
|
41
|
+
type: import("vue").PropType<Booleanish>;
|
|
42
|
+
default: boolean;
|
|
43
|
+
};
|
|
44
44
|
perPage: {
|
|
45
45
|
type: import("vue").PropType<number>;
|
|
46
46
|
default: undefined;
|
|
@@ -206,10 +206,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
206
206
|
type: import("vue").PropType<keyof import("../../types").BaseColorVariant | null>;
|
|
207
207
|
default: undefined;
|
|
208
208
|
};
|
|
209
|
-
busy: {
|
|
210
|
-
type: import("vue").PropType<Booleanish>;
|
|
211
|
-
default: boolean;
|
|
212
|
-
};
|
|
213
209
|
items: {
|
|
214
210
|
type: import("vue").PropType<TableItem[]>;
|
|
215
211
|
default: () => never[];
|
|
@@ -222,6 +218,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
222
218
|
type: import("vue").PropType<boolean | Breakpoint>;
|
|
223
219
|
default: boolean;
|
|
224
220
|
};
|
|
221
|
+
busy: {
|
|
222
|
+
type: import("vue").PropType<Booleanish>;
|
|
223
|
+
default: boolean;
|
|
224
|
+
};
|
|
225
225
|
perPage: {
|
|
226
226
|
type: import("vue").PropType<number>;
|
|
227
227
|
default: undefined;
|
|
@@ -363,10 +363,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
363
363
|
caption: string;
|
|
364
364
|
align: VerticalAlign;
|
|
365
365
|
variant: keyof import("../../types").BaseColorVariant | null;
|
|
366
|
-
busy: Booleanish;
|
|
367
366
|
items: TableItem[];
|
|
368
367
|
borderVariant: keyof import("../../types").BaseColorVariant | null;
|
|
369
368
|
stacked: boolean | Breakpoint;
|
|
369
|
+
busy: Booleanish;
|
|
370
370
|
perPage: number;
|
|
371
371
|
bordered: Booleanish;
|
|
372
372
|
borderless: Booleanish;
|
|
@@ -41,14 +41,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
41
41
|
type: import("vue").PropType<Booleanish>;
|
|
42
42
|
default: boolean;
|
|
43
43
|
};
|
|
44
|
-
contentClass: {
|
|
45
|
-
type: import("vue").PropType<any>;
|
|
46
|
-
default: undefined;
|
|
47
|
-
};
|
|
48
44
|
card: {
|
|
49
45
|
type: import("vue").PropType<Booleanish>;
|
|
50
46
|
default: boolean;
|
|
51
47
|
};
|
|
48
|
+
contentClass: {
|
|
49
|
+
type: import("vue").PropType<any>;
|
|
50
|
+
default: undefined;
|
|
51
|
+
};
|
|
52
52
|
justified: {
|
|
53
53
|
type: import("vue").PropType<Booleanish>;
|
|
54
54
|
default: boolean;
|
|
@@ -122,14 +122,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
122
122
|
type: import("vue").PropType<Booleanish>;
|
|
123
123
|
default: boolean;
|
|
124
124
|
};
|
|
125
|
-
contentClass: {
|
|
126
|
-
type: import("vue").PropType<any>;
|
|
127
|
-
default: undefined;
|
|
128
|
-
};
|
|
129
125
|
card: {
|
|
130
126
|
type: import("vue").PropType<Booleanish>;
|
|
131
127
|
default: boolean;
|
|
132
128
|
};
|
|
129
|
+
contentClass: {
|
|
130
|
+
type: import("vue").PropType<any>;
|
|
131
|
+
default: undefined;
|
|
132
|
+
};
|
|
133
133
|
justified: {
|
|
134
134
|
type: import("vue").PropType<Booleanish>;
|
|
135
135
|
default: boolean;
|
|
@@ -173,8 +173,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
173
173
|
modelValue: number;
|
|
174
174
|
noFade: Booleanish;
|
|
175
175
|
vertical: Booleanish;
|
|
176
|
-
contentClass: any;
|
|
177
176
|
card: Booleanish;
|
|
177
|
+
contentClass: any;
|
|
178
178
|
justified: Booleanish;
|
|
179
179
|
pills: Booleanish;
|
|
180
180
|
activeNavItemClass: any;
|
|
@@ -269,18 +269,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
269
269
|
static: Booleanish;
|
|
270
270
|
animation: Booleanish;
|
|
271
271
|
solid: Booleanish;
|
|
272
|
-
|
|
273
|
-
noCloseButton: Booleanish;
|
|
272
|
+
headerTag: string;
|
|
274
273
|
activeClass: string;
|
|
275
274
|
append: Booleanish;
|
|
276
275
|
event: string | unknown[];
|
|
277
276
|
routerComponentName: string;
|
|
278
277
|
routerTag: string;
|
|
278
|
+
noHoverPause: Booleanish;
|
|
279
279
|
bodyClass: string;
|
|
280
280
|
headerClass: string;
|
|
281
|
-
|
|
281
|
+
autoHide: Booleanish;
|
|
282
|
+
noCloseButton: Booleanish;
|
|
282
283
|
isStatus: Booleanish;
|
|
283
|
-
noHoverPause: Booleanish;
|
|
284
284
|
toastClass: string[];
|
|
285
285
|
}, {}>;
|
|
286
286
|
export default _default;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {
|
|
2
|
+
hide: ((e: Event) => void) | undefined;
|
|
3
|
+
show: (() => void) | undefined;
|
|
4
|
+
toggle: ((e: Event) => void) | undefined;
|
|
5
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>, Partial<Record<NonNullable<string | number>, (_: any) => any>>>;
|
|
2
6
|
export default _default;
|
|
3
7
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
4
8
|
new (): {
|
|
@@ -1,22 +1,16 @@
|
|
|
1
|
+
import * as Components from '../components';
|
|
2
|
+
import * as Directives from '../directives';
|
|
1
3
|
interface BToastPluginOptions {
|
|
2
4
|
injectkey: symbol;
|
|
3
5
|
}
|
|
6
|
+
export type ComponentType = keyof typeof Components;
|
|
7
|
+
export type DirectiveType = keyof typeof Directives;
|
|
8
|
+
export type ConfigurationOption<T extends string> = Partial<Record<T, boolean>> & {
|
|
9
|
+
all: boolean;
|
|
10
|
+
};
|
|
4
11
|
export interface BootstrapVueOptions {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
BButton?: Record<string, any>;
|
|
9
|
-
BButtonGroup?: Record<string, any>;
|
|
10
|
-
BButtonToolbar?: Record<string, any>;
|
|
11
|
-
BCard?: Record<string, any>;
|
|
12
|
-
BCollapse?: Record<string, any>;
|
|
13
|
-
BDropdown?: Record<string, any>;
|
|
14
|
-
BListGroup?: Record<string, any>;
|
|
15
|
-
BModal?: Record<string, any>;
|
|
16
|
-
BOffcanvas?: Record<string, any>;
|
|
17
|
-
BProgress?: Record<string, any>;
|
|
18
|
-
BSpinner?: Record<string, any>;
|
|
19
|
-
BTab?: Record<string, any>;
|
|
20
|
-
BToast?: BToastPluginOptions;
|
|
12
|
+
components?: boolean | ConfigurationOption<ComponentType>;
|
|
13
|
+
directives?: boolean | ConfigurationOption<DirectiveType>;
|
|
14
|
+
BToast?: boolean | BToastPluginOptions;
|
|
21
15
|
}
|
|
22
16
|
export {};
|
|
@@ -12,7 +12,7 @@ export type { BTableProvider } from './BTableProvider';
|
|
|
12
12
|
export type { BTableProviderContext } from './BTableProviderContext';
|
|
13
13
|
export type { BTableSortCompare } from './BTableSortCompare';
|
|
14
14
|
export type { Booleanish } from './Booleanish';
|
|
15
|
-
export type { BootstrapVueOptions } from './BootstrapVueOptions';
|
|
15
|
+
export type { BootstrapVueOptions, ConfigurationOption } from './BootstrapVueOptions';
|
|
16
16
|
export type { BreadcrumbItem } from './BreadcrumbItem';
|
|
17
17
|
export type { BreadcrumbItemObject } from './BreadcrumbItemObject';
|
|
18
18
|
export type { Breakpoint } from './Breakpoint';
|
package/package.json
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
"name": "bootstrap-vue-next",
|
|
3
3
|
"displayName": "BootstrapVueNext",
|
|
4
4
|
"description": "Early (but lovely) implementation of Vue 3, Bootstrap 5 and Typescript",
|
|
5
|
-
"version": "0.9.
|
|
5
|
+
"version": "0.9.21",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "./dist/bootstrap-vue-next.umd.js",
|
|
8
8
|
"module": "./dist/bootstrap-vue-next.mjs",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
+
"types": "./dist/src/BootstrapVue.d.ts",
|
|
11
12
|
"import": "./dist/bootstrap-vue-next.mjs",
|
|
12
|
-
"require": "./dist/bootstrap-vue-next.umd.js"
|
|
13
|
-
"types": "./dist/src/BootstrapVue.d.ts"
|
|
13
|
+
"require": "./dist/bootstrap-vue-next.umd.js"
|
|
14
14
|
},
|
|
15
15
|
"./dist/bootstrap-vue-next.css": "./dist/bootstrap-vue-next.css",
|
|
16
16
|
"./src/styles/styles.scss": "./src/styles/styles.scss"
|
package/src/BootstrapVue.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type {App, Plugin} from 'vue'
|
|
2
|
+
import {BToastPlugin} from './components'
|
|
2
3
|
import type {BootstrapVueOptions} from './types'
|
|
3
4
|
|
|
4
5
|
import './styles/styles.scss'
|
|
5
6
|
|
|
6
7
|
import * as Components from './components'
|
|
7
8
|
import * as Directives from './directives'
|
|
9
|
+
import type {ComponentType, DirectiveType} from './types/BootstrapVueOptions'
|
|
10
|
+
import parseActiveImports from './utils/parseActiveImports'
|
|
8
11
|
|
|
9
12
|
declare module '@vue/runtime-core' {
|
|
10
13
|
export interface GlobalComponents {
|
|
@@ -115,20 +118,31 @@ declare module '@vue/runtime-core' {
|
|
|
115
118
|
|
|
116
119
|
// Main app plugin
|
|
117
120
|
const plugin: Plugin = {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
121
|
+
install(app: App, options: BootstrapVueOptions = {components: true, directives: true}) {
|
|
122
|
+
const selectedComponents =
|
|
123
|
+
typeof options.components === 'boolean' || typeof options.components === 'undefined'
|
|
124
|
+
? {all: true}
|
|
125
|
+
: options.components
|
|
126
|
+
|
|
127
|
+
const componentKeys = Object.keys(Components) as unknown as ComponentType[]
|
|
128
|
+
parseActiveImports(selectedComponents, componentKeys).forEach((name) => {
|
|
129
|
+
const component = Components[name]
|
|
122
130
|
app.component(name, component)
|
|
123
131
|
})
|
|
124
132
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
133
|
+
const selectedDirectives =
|
|
134
|
+
typeof options?.directives === 'boolean' || typeof options.directives === 'undefined'
|
|
135
|
+
? {all: true}
|
|
136
|
+
: options?.directives
|
|
137
|
+
|
|
138
|
+
const directiveKeys = Object.keys(Directives) as unknown as DirectiveType[]
|
|
139
|
+
parseActiveImports(selectedDirectives, directiveKeys).forEach((name) => {
|
|
140
|
+
const parsedName = name.toLowerCase().startsWith('v') ? name.slice(1) : name
|
|
141
|
+
const directive = Directives[name]
|
|
142
|
+
app.directive(parsedName, directive)
|
|
131
143
|
})
|
|
144
|
+
|
|
145
|
+
if (options?.BToast) app.use(BToastPlugin, options)
|
|
132
146
|
},
|
|
133
147
|
}
|
|
134
148
|
|
|
@@ -432,6 +432,12 @@ const hideFn = (e: Event) => {
|
|
|
432
432
|
}, delay)
|
|
433
433
|
}
|
|
434
434
|
|
|
435
|
+
defineExpose({
|
|
436
|
+
hideFn,
|
|
437
|
+
show,
|
|
438
|
+
toggle,
|
|
439
|
+
})
|
|
440
|
+
|
|
435
441
|
const bind = () => {
|
|
436
442
|
// TODO: is this the best way to bind the events?
|
|
437
443
|
// we place a span and get the next element sibling fo rthe listeners
|
|
@@ -223,9 +223,11 @@ export function useToast(vm?: any, key: symbol = injectkey): ToastInstance | und
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
const BToastPlugin: Plugin = {
|
|
226
|
-
install: (app: App, options
|
|
227
|
-
|
|
228
|
-
|
|
226
|
+
install: (app: App, options?: BootstrapVueOptions) => {
|
|
227
|
+
const key =
|
|
228
|
+
typeof options?.BToast === 'object' ? options?.BToast?.injectkey ?? injectkey : injectkey
|
|
229
|
+
app.provide(fetchKey, key)
|
|
230
|
+
app.provide(key, new ToastController())
|
|
229
231
|
},
|
|
230
232
|
}
|
|
231
233
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<BPopover tooltip>
|
|
2
|
+
<BPopover ref="popover" tooltip>
|
|
3
3
|
<template v-for="(_, name) in $slots" #[name]="slotData">
|
|
4
4
|
<slot :name="name" v-bind="slotData" />
|
|
5
5
|
</template>
|
|
@@ -7,5 +7,14 @@
|
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<script setup lang="ts">
|
|
10
|
+
import {ref} from 'vue'
|
|
10
11
|
import BPopover from './BPopover.vue'
|
|
12
|
+
|
|
13
|
+
const popover = ref<null | InstanceType<typeof BPopover>>(null)
|
|
14
|
+
|
|
15
|
+
defineExpose({
|
|
16
|
+
hide: popover.value?.hideFn,
|
|
17
|
+
show: popover.value?.show,
|
|
18
|
+
toggle: popover.value?.toggle,
|
|
19
|
+
})
|
|
11
20
|
</script>
|
|
@@ -1,24 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import * as Components from '../components'
|
|
2
|
+
import * as Directives from '../directives'
|
|
2
3
|
|
|
3
4
|
interface BToastPluginOptions {
|
|
4
5
|
injectkey: symbol
|
|
5
6
|
}
|
|
6
7
|
|
|
8
|
+
export type ComponentType = keyof typeof Components
|
|
9
|
+
export type DirectiveType = keyof typeof Directives
|
|
10
|
+
export type ConfigurationOption<T extends string> = Partial<Record<T, boolean>> & {all: boolean}
|
|
11
|
+
|
|
7
12
|
export interface BootstrapVueOptions {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
BButton?: Record<string, any>
|
|
12
|
-
BButtonGroup?: Record<string, any>
|
|
13
|
-
BButtonToolbar?: Record<string, any>
|
|
14
|
-
BCard?: Record<string, any>
|
|
15
|
-
BCollapse?: Record<string, any>
|
|
16
|
-
BDropdown?: Record<string, any>
|
|
17
|
-
BListGroup?: Record<string, any>
|
|
18
|
-
BModal?: Record<string, any>
|
|
19
|
-
BOffcanvas?: Record<string, any>
|
|
20
|
-
BProgress?: Record<string, any>
|
|
21
|
-
BSpinner?: Record<string, any>
|
|
22
|
-
BTab?: Record<string, any>
|
|
23
|
-
BToast?: BToastPluginOptions
|
|
13
|
+
components?: boolean | ConfigurationOption<ComponentType>
|
|
14
|
+
directives?: boolean | ConfigurationOption<DirectiveType>
|
|
15
|
+
BToast?: boolean | BToastPluginOptions
|
|
24
16
|
}
|
package/src/types/index.ts
CHANGED
|
@@ -12,7 +12,7 @@ export type {BTableProvider} from './BTableProvider'
|
|
|
12
12
|
export type {BTableProviderContext} from './BTableProviderContext'
|
|
13
13
|
export type {BTableSortCompare} from './BTableSortCompare'
|
|
14
14
|
export type {Booleanish} from './Booleanish'
|
|
15
|
-
export type {BootstrapVueOptions} from './BootstrapVueOptions'
|
|
15
|
+
export type {BootstrapVueOptions, ConfigurationOption} from './BootstrapVueOptions'
|
|
16
16
|
export type {BreadcrumbItem} from './BreadcrumbItem'
|
|
17
17
|
export type {BreadcrumbItemObject} from './BreadcrumbItemObject'
|
|
18
18
|
export type {Breakpoint} from './Breakpoint'
|
package/src/utils/index.ts
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type {ConfigurationOption} from '../types'
|
|
2
|
+
|
|
3
|
+
export default <Type extends string, Base extends ConfigurationOption<Type>>(
|
|
4
|
+
options: Base,
|
|
5
|
+
values: Type[]
|
|
6
|
+
): Type[] => {
|
|
7
|
+
const {all, ...others} = options
|
|
8
|
+
const valuesCopy: Partial<Record<keyof Base, boolean>> = {}
|
|
9
|
+
if (all) {
|
|
10
|
+
values.forEach((el) => {
|
|
11
|
+
valuesCopy[el] = all
|
|
12
|
+
})
|
|
13
|
+
}
|
|
14
|
+
const merge: Record<string, boolean> = {...valuesCopy, ...others}
|
|
15
|
+
return (
|
|
16
|
+
Object.entries(merge)
|
|
17
|
+
// filtering possible invalid keys
|
|
18
|
+
.filter(([name, value]) => !!value && values.includes(name as Type))
|
|
19
|
+
.map(([name]) => name as Type)
|
|
20
|
+
)
|
|
21
|
+
}
|