@bootstrap-vue-next/nuxt 0.0.1 → 0.0.2
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/module.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import {
|
|
2
|
+
import { Composables } from 'bootstrap-vue-next';
|
|
3
3
|
|
|
4
4
|
interface ModuleOptions {
|
|
5
|
-
directives: (Partial<Record<keyof typeof Directives, boolean>> & {
|
|
6
|
-
all: boolean;
|
|
7
|
-
}) | boolean;
|
|
8
5
|
composables: (Partial<Record<keyof typeof Composables, boolean>> & {
|
|
9
6
|
all: boolean;
|
|
10
7
|
}) | boolean;
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addComponent, defineNuxtModule, createResolver, addPlugin } from '@nuxt/kit';
|
|
1
|
+
import { addComponent, defineNuxtModule, createResolver, addPlugin, addImports } from '@nuxt/kit';
|
|
2
2
|
import { Components } from 'bootstrap-vue-next';
|
|
3
3
|
|
|
4
4
|
const useComponents = () => {
|
|
@@ -11,6 +11,14 @@ const useComponents = () => {
|
|
|
11
11
|
});
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
+
const parseActiveImports = (options, values) => {
|
|
15
|
+
const { all, ...others } = options;
|
|
16
|
+
const valuesCopy = { ...values };
|
|
17
|
+
Object.keys(valuesCopy).forEach((el) => valuesCopy[el] = all);
|
|
18
|
+
const merge = { ...valuesCopy, ...others };
|
|
19
|
+
return Object.entries(merge).filter(([, value]) => value === true).map(([name]) => name);
|
|
20
|
+
};
|
|
21
|
+
|
|
14
22
|
const module = defineNuxtModule({
|
|
15
23
|
meta: {
|
|
16
24
|
name: "bootstrap-vue-next",
|
|
@@ -21,18 +29,35 @@ const module = defineNuxtModule({
|
|
|
21
29
|
}
|
|
22
30
|
},
|
|
23
31
|
defaults: {
|
|
24
|
-
directives: true,
|
|
32
|
+
// directives: true,
|
|
25
33
|
composables: true
|
|
26
34
|
},
|
|
27
35
|
setup(options, nuxt) {
|
|
28
36
|
const resolver = createResolver(import.meta.url);
|
|
29
|
-
const
|
|
37
|
+
const normalizedComposables = typeof options.composables === "boolean" ? { all: options.composables } : options.composables;
|
|
30
38
|
nuxt.options.build.transpile.push(resolver.resolve("./runtime"));
|
|
31
39
|
nuxt.options.css.push("bootstrap-vue-next/dist/bootstrap-vue-next.css");
|
|
32
40
|
useComponents();
|
|
33
|
-
if (
|
|
41
|
+
if (normalizedComposables.all === true && normalizedComposables.createBreadcrumb !== false || normalizedComposables.createBreadcrumb === true) {
|
|
34
42
|
addPlugin(resolver.resolve("./runtime/breadcrumb"));
|
|
35
43
|
}
|
|
44
|
+
const arr = [];
|
|
45
|
+
if (Object.values(normalizedComposables).some((el) => el === true)) {
|
|
46
|
+
const imports = parseActiveImports(normalizedComposables, {
|
|
47
|
+
createBreadcrumb: false,
|
|
48
|
+
useBreadcrumb: false,
|
|
49
|
+
useColorMode: false
|
|
50
|
+
}).map(
|
|
51
|
+
(el) => ({
|
|
52
|
+
from: resolver.resolve("./runtime/composables"),
|
|
53
|
+
name: el
|
|
54
|
+
})
|
|
55
|
+
);
|
|
56
|
+
arr.push(...imports);
|
|
57
|
+
}
|
|
58
|
+
if (arr.length) {
|
|
59
|
+
addImports(arr);
|
|
60
|
+
}
|
|
36
61
|
}
|
|
37
62
|
});
|
|
38
63
|
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
items: import("bootstrap-vue-next/dist/src/types/BreadcrumbItem").default[];
|
|
3
|
-
readonly reset: () => void;
|
|
4
|
-
};
|
|
5
|
-
export { createBreadcrumb, useBreadcrumb };
|
|
1
|
+
export { useBreadcrumb, createBreadcrumb, useColorMode } from 'bootstrap-vue-next';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { vBColorMode, vBPopover, vBToggle, vBTooltip };
|
|
1
|
+
export { vBColorMode, vBPopover, vBToggle, vBTooltip } from 'bootstrap-vue-next';
|