unplugin-vue-components 0.21.1 → 0.21.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/README.md +4 -3
- package/dist/{chunk-SX77T22J.mjs → chunk-3LRP7IED.mjs} +43 -21
- package/dist/chunk-AKU6F3WT.mjs +11 -0
- package/dist/chunk-EZUCZHGV.js +11 -0
- package/dist/{chunk-N4XEWXLG.js → chunk-MR7ESCTS.js} +43 -21
- package/dist/esbuild.js +3 -3
- package/dist/esbuild.mjs +2 -2
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/dist/nuxt.js +4 -4
- package/dist/nuxt.mjs +2 -2
- package/dist/resolvers.d.ts +14 -2
- package/dist/resolvers.js +103 -27
- package/dist/resolvers.mjs +103 -27
- package/dist/rollup.js +3 -3
- package/dist/rollup.mjs +2 -2
- package/dist/{src-4OAWGTJE.js → src-KKLCUN63.js} +1 -1
- package/dist/{src-WRIQ2NEL.mjs → src-Z5BCFXFD.mjs} +1 -1
- package/dist/vite.js +3 -3
- package/dist/vite.mjs +2 -2
- package/dist/webpack.js +3 -3
- package/dist/webpack.mjs +2 -2
- package/package.json +13 -13
- package/dist/chunk-BTQOTIPQ.js +0 -32
- package/dist/chunk-ZKNUHGJ4.mjs +0 -32
package/README.md
CHANGED
|
@@ -186,6 +186,7 @@ Supported Resolvers:
|
|
|
186
186
|
|
|
187
187
|
- [Ant Design Vue](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/antdv.ts)
|
|
188
188
|
- [Arco Design Vue](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/arco.ts)
|
|
189
|
+
- [BootstrapVue](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/bootstrap-vue.ts)
|
|
189
190
|
- [Element Plus](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/element-plus.ts)
|
|
190
191
|
- [Element UI](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/element-ui.ts)
|
|
191
192
|
- [Headless UI](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/headless-ui.ts)
|
|
@@ -193,14 +194,14 @@ Supported Resolvers:
|
|
|
193
194
|
- [Inkline](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/inkline.ts)
|
|
194
195
|
- [Naive UI](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/naive-ui.ts)
|
|
195
196
|
- [Prime Vue](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/prime-vue.ts)
|
|
197
|
+
- [Quasar](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/quasar.ts)
|
|
198
|
+
- [TDesign](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/tdesign.ts)
|
|
196
199
|
- [Vant](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/vant.ts)
|
|
197
|
-
- [VEUI](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/veui.ts)
|
|
198
200
|
- [Varlet UI](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/varlet-ui.ts)
|
|
201
|
+
- [VEUI](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/veui.ts)
|
|
199
202
|
- [View UI](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/view-ui.ts)
|
|
200
203
|
- [Vuetify](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/vuetify.ts)
|
|
201
204
|
- [VueUse Components](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/vueuse.ts)
|
|
202
|
-
- [Quasar](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/quasar.ts)
|
|
203
|
-
- [TDesign](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/tdesign.ts)
|
|
204
205
|
|
|
205
206
|
```ts
|
|
206
207
|
// vite.config.js
|
|
@@ -12,10 +12,8 @@ import {
|
|
|
12
12
|
stringifyComponentImport
|
|
13
13
|
} from "./chunk-667B3WUW.mjs";
|
|
14
14
|
import {
|
|
15
|
-
__require
|
|
16
|
-
|
|
17
|
-
__spreadValues
|
|
18
|
-
} from "./chunk-ZKNUHGJ4.mjs";
|
|
15
|
+
__require
|
|
16
|
+
} from "./chunk-AKU6F3WT.mjs";
|
|
19
17
|
|
|
20
18
|
// src/core/unplugin.ts
|
|
21
19
|
import { existsSync as existsSync2 } from "fs";
|
|
@@ -90,11 +88,16 @@ function resolveOptions(options, root) {
|
|
|
90
88
|
const extsGlob = resolved.extensions.length === 1 ? resolved.extensions : `{${resolved.extensions.join(",")}}`;
|
|
91
89
|
resolved.dirs = toArray(resolved.dirs);
|
|
92
90
|
resolved.resolvedDirs = resolved.dirs.map((i) => slash(resolve(root, i)));
|
|
93
|
-
resolved.globs = resolved.resolvedDirs.map(
|
|
91
|
+
resolved.globs = resolved.resolvedDirs.map(
|
|
92
|
+
(i) => resolved.deep ? slash(join(i, `**/*.${extsGlob}`)) : slash(join(i, `*.${extsGlob}`))
|
|
93
|
+
);
|
|
94
94
|
if (!resolved.extensions.length)
|
|
95
95
|
throw new Error("[unplugin-vue-components] `extensions` option is required to search for components");
|
|
96
96
|
}
|
|
97
|
-
resolved.dts = !resolved.dts ? false : resolve(
|
|
97
|
+
resolved.dts = !resolved.dts ? false : resolve(
|
|
98
|
+
root,
|
|
99
|
+
typeof resolved.dts === "string" ? resolved.dts : "components.d.ts"
|
|
100
|
+
);
|
|
98
101
|
if (!resolved.types && resolved.dts)
|
|
99
102
|
resolved.types = detectTypeImports();
|
|
100
103
|
resolved.types = resolved.types || [];
|
|
@@ -170,14 +173,23 @@ function stringifyComponentInfo(filepath, { from: path, as: name, name: importNa
|
|
|
170
173
|
return [name, entry];
|
|
171
174
|
}
|
|
172
175
|
function stringifyComponentsInfo(filepath, components, importPathTransform) {
|
|
173
|
-
return Object.fromEntries(
|
|
176
|
+
return Object.fromEntries(
|
|
177
|
+
components.map((info) => stringifyComponentInfo(filepath, info, importPathTransform)).filter(notNullish2)
|
|
178
|
+
);
|
|
174
179
|
}
|
|
175
180
|
function getDeclarationImports(ctx, filepath) {
|
|
176
181
|
const component = stringifyComponentsInfo(filepath, [
|
|
177
|
-
...Object.values(
|
|
182
|
+
...Object.values({
|
|
183
|
+
...ctx.componentNameMap,
|
|
184
|
+
...ctx.componentCustomMap
|
|
185
|
+
}),
|
|
178
186
|
...resolveTypeImports(ctx.options.types)
|
|
179
187
|
], ctx.options.importPathTransform);
|
|
180
|
-
const directive = stringifyComponentsInfo(
|
|
188
|
+
const directive = stringifyComponentsInfo(
|
|
189
|
+
filepath,
|
|
190
|
+
Object.values(ctx.directiveCustomMap),
|
|
191
|
+
ctx.options.importPathTransform
|
|
192
|
+
);
|
|
181
193
|
if (Object.keys(component).length + Object.keys(directive).length === 0)
|
|
182
194
|
return;
|
|
183
195
|
return { component, directive };
|
|
@@ -194,8 +206,8 @@ function getDeclaration(ctx, filepath, originalImports) {
|
|
|
194
206
|
if (!imports)
|
|
195
207
|
return;
|
|
196
208
|
const declarations = {
|
|
197
|
-
component: stringifyDeclarationImports(
|
|
198
|
-
directive: stringifyDeclarationImports(
|
|
209
|
+
component: stringifyDeclarationImports({ ...originalImports == null ? void 0 : originalImports.component, ...imports.component }),
|
|
210
|
+
directive: stringifyDeclarationImports({ ...originalImports == null ? void 0 : originalImports.directive, ...imports.directive })
|
|
199
211
|
};
|
|
200
212
|
let code = `// generated by unplugin-vue-components
|
|
201
213
|
// We suggest you to commit this file into source control
|
|
@@ -277,7 +289,7 @@ async function transformComponent(code, transformer2, s, ctx, sfcPath) {
|
|
|
277
289
|
const component = await ctx.findComponent(name, "component", [sfcPath]);
|
|
278
290
|
if (component) {
|
|
279
291
|
const varName = `__unplugin_components_${no}`;
|
|
280
|
-
s.prepend(`${stringifyComponentImport(
|
|
292
|
+
s.prepend(`${stringifyComponentImport({ ...component, as: varName }, ctx)};
|
|
281
293
|
`);
|
|
282
294
|
no += 1;
|
|
283
295
|
replace(varName);
|
|
@@ -293,7 +305,9 @@ import Debug3 from "debug";
|
|
|
293
305
|
import { importModule, isPackageExists as isPackageExists3 } from "local-pkg";
|
|
294
306
|
var getRenderFnStart = (ast) => {
|
|
295
307
|
var _a, _b;
|
|
296
|
-
const renderFn = ast.program.body.find(
|
|
308
|
+
const renderFn = ast.program.body.find(
|
|
309
|
+
(node) => node.type === "VariableDeclaration" && node.declarations[0].id.type === "Identifier" && node.declarations[0].id.name === "render"
|
|
310
|
+
);
|
|
297
311
|
const start = (_b = (_a = renderFn == null ? void 0 : renderFn.declarations[0].init) == null ? void 0 : _a.body) == null ? void 0 : _b.start;
|
|
298
312
|
if (start === null || start === void 0)
|
|
299
313
|
throw new Error("[unplugin-vue-components:directive] Cannot find render function position.");
|
|
@@ -308,7 +322,7 @@ async function resolveVue22(code, s) {
|
|
|
308
322
|
sourceType: "module"
|
|
309
323
|
});
|
|
310
324
|
const nodes = [];
|
|
311
|
-
const { walk } = await import("./src-
|
|
325
|
+
const { walk } = await import("./src-Z5BCFXFD.mjs");
|
|
312
326
|
walk(ast.program, {
|
|
313
327
|
enter(node) {
|
|
314
328
|
if (node.type === "CallExpression")
|
|
@@ -320,14 +334,18 @@ async function resolveVue22(code, s) {
|
|
|
320
334
|
const { callee, arguments: args } = node;
|
|
321
335
|
if (callee.type !== "Identifier" || callee.name !== "_c" || ((_a = args[1]) == null ? void 0 : _a.type) !== "ObjectExpression")
|
|
322
336
|
continue;
|
|
323
|
-
const directives = (_b = args[1].properties.find(
|
|
337
|
+
const directives = (_b = args[1].properties.find(
|
|
338
|
+
(property) => property.type === "ObjectProperty" && property.key.type === "Identifier" && property.key.name === "directives"
|
|
339
|
+
)) == null ? void 0 : _b.value;
|
|
324
340
|
if (!directives || directives.type !== "ArrayExpression")
|
|
325
341
|
continue;
|
|
326
342
|
const renderStart = getRenderFnStart(ast);
|
|
327
343
|
for (const directive of directives.elements) {
|
|
328
344
|
if ((directive == null ? void 0 : directive.type) !== "ObjectExpression")
|
|
329
345
|
continue;
|
|
330
|
-
const nameNode = (_c = directive.properties.find(
|
|
346
|
+
const nameNode = (_c = directive.properties.find(
|
|
347
|
+
(p) => p.type === "ObjectProperty" && p.key.type === "Identifier" && p.key.name === "name"
|
|
348
|
+
)) == null ? void 0 : _c.value;
|
|
331
349
|
if ((nameNode == null ? void 0 : nameNode.type) !== "StringLiteral")
|
|
332
350
|
continue;
|
|
333
351
|
const name = nameNode.value;
|
|
@@ -375,7 +393,7 @@ async function transformDirective(code, transformer2, s, ctx, sfcPath) {
|
|
|
375
393
|
if (!directive)
|
|
376
394
|
continue;
|
|
377
395
|
const varName = `__unplugin_directives_${no}`;
|
|
378
|
-
s.prepend(`${stringifyComponentImport(
|
|
396
|
+
s.prepend(`${stringifyComponentImport({ ...directive, as: varName }, ctx)};
|
|
379
397
|
`);
|
|
380
398
|
no += 1;
|
|
381
399
|
replace(varName);
|
|
@@ -571,9 +589,10 @@ var Context = class {
|
|
|
571
589
|
from: result
|
|
572
590
|
};
|
|
573
591
|
} else {
|
|
574
|
-
info =
|
|
575
|
-
as: name
|
|
576
|
-
|
|
592
|
+
info = {
|
|
593
|
+
as: name,
|
|
594
|
+
...normalizeComponetInfo(result)
|
|
595
|
+
};
|
|
577
596
|
}
|
|
578
597
|
if (type === "component")
|
|
579
598
|
this.addCustomComponents(info);
|
|
@@ -619,7 +638,10 @@ var Context = class {
|
|
|
619
638
|
// src/core/unplugin.ts
|
|
620
639
|
var PLUGIN_NAME = "unplugin:webpack";
|
|
621
640
|
var unplugin_default = createUnplugin((options = {}) => {
|
|
622
|
-
const filter = createFilter(
|
|
641
|
+
const filter = createFilter(
|
|
642
|
+
options.include || [/\.vue$/, /\.vue\?vue/],
|
|
643
|
+
options.exclude || [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/]
|
|
644
|
+
);
|
|
623
645
|
const ctx = new Context(options);
|
|
624
646
|
const api = {
|
|
625
647
|
async findComponent(name, filename) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined")
|
|
5
|
+
return require.apply(this, arguments);
|
|
6
|
+
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
__require
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined")
|
|
5
|
+
return require.apply(this, arguments);
|
|
6
|
+
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.__require = __require;
|
|
@@ -13,9 +13,7 @@
|
|
|
13
13
|
var _chunk2GXY7E6Xjs = require('./chunk-2GXY7E6X.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var _chunkBTQOTIPQjs = require('./chunk-BTQOTIPQ.js');
|
|
16
|
+
var _chunkEZUCZHGVjs = require('./chunk-EZUCZHGV.js');
|
|
19
17
|
|
|
20
18
|
// src/core/unplugin.ts
|
|
21
19
|
var _fs = require('fs');
|
|
@@ -90,11 +88,16 @@ function resolveOptions(options, root) {
|
|
|
90
88
|
const extsGlob = resolved.extensions.length === 1 ? resolved.extensions : `{${resolved.extensions.join(",")}}`;
|
|
91
89
|
resolved.dirs = _utils.toArray.call(void 0, resolved.dirs);
|
|
92
90
|
resolved.resolvedDirs = resolved.dirs.map((i) => _utils.slash.call(void 0, _path.resolve.call(void 0, root, i)));
|
|
93
|
-
resolved.globs = resolved.resolvedDirs.map(
|
|
91
|
+
resolved.globs = resolved.resolvedDirs.map(
|
|
92
|
+
(i) => resolved.deep ? _utils.slash.call(void 0, _path.join.call(void 0, i, `**/*.${extsGlob}`)) : _utils.slash.call(void 0, _path.join.call(void 0, i, `*.${extsGlob}`))
|
|
93
|
+
);
|
|
94
94
|
if (!resolved.extensions.length)
|
|
95
95
|
throw new Error("[unplugin-vue-components] `extensions` option is required to search for components");
|
|
96
96
|
}
|
|
97
|
-
resolved.dts = !resolved.dts ? false : _path.resolve.call(void 0,
|
|
97
|
+
resolved.dts = !resolved.dts ? false : _path.resolve.call(void 0,
|
|
98
|
+
root,
|
|
99
|
+
typeof resolved.dts === "string" ? resolved.dts : "components.d.ts"
|
|
100
|
+
);
|
|
98
101
|
if (!resolved.types && resolved.dts)
|
|
99
102
|
resolved.types = detectTypeImports();
|
|
100
103
|
resolved.types = resolved.types || [];
|
|
@@ -106,7 +109,7 @@ function resolveOptions(options, root) {
|
|
|
106
109
|
function getVueVersion() {
|
|
107
110
|
var _a;
|
|
108
111
|
try {
|
|
109
|
-
const vue =
|
|
112
|
+
const vue = _chunkEZUCZHGVjs.__require.call(void 0, "vue");
|
|
110
113
|
const version = ((_a = vue == null ? void 0 : vue.default) == null ? void 0 : _a.version) || (vue == null ? void 0 : vue.version) || "3";
|
|
111
114
|
return version.startsWith("2.") ? "vue2" : "vue3";
|
|
112
115
|
} catch (e2) {
|
|
@@ -170,14 +173,23 @@ function stringifyComponentInfo(filepath, { from: path, as: name, name: importNa
|
|
|
170
173
|
return [name, entry];
|
|
171
174
|
}
|
|
172
175
|
function stringifyComponentsInfo(filepath, components, importPathTransform) {
|
|
173
|
-
return Object.fromEntries(
|
|
176
|
+
return Object.fromEntries(
|
|
177
|
+
components.map((info) => stringifyComponentInfo(filepath, info, importPathTransform)).filter(_utils.notNullish)
|
|
178
|
+
);
|
|
174
179
|
}
|
|
175
180
|
function getDeclarationImports(ctx, filepath) {
|
|
176
181
|
const component = stringifyComponentsInfo(filepath, [
|
|
177
|
-
...Object.values(
|
|
182
|
+
...Object.values({
|
|
183
|
+
...ctx.componentNameMap,
|
|
184
|
+
...ctx.componentCustomMap
|
|
185
|
+
}),
|
|
178
186
|
...resolveTypeImports(ctx.options.types)
|
|
179
187
|
], ctx.options.importPathTransform);
|
|
180
|
-
const directive = stringifyComponentsInfo(
|
|
188
|
+
const directive = stringifyComponentsInfo(
|
|
189
|
+
filepath,
|
|
190
|
+
Object.values(ctx.directiveCustomMap),
|
|
191
|
+
ctx.options.importPathTransform
|
|
192
|
+
);
|
|
181
193
|
if (Object.keys(component).length + Object.keys(directive).length === 0)
|
|
182
194
|
return;
|
|
183
195
|
return { component, directive };
|
|
@@ -194,8 +206,8 @@ function getDeclaration(ctx, filepath, originalImports) {
|
|
|
194
206
|
if (!imports)
|
|
195
207
|
return;
|
|
196
208
|
const declarations = {
|
|
197
|
-
component: stringifyDeclarationImports(
|
|
198
|
-
directive: stringifyDeclarationImports(
|
|
209
|
+
component: stringifyDeclarationImports({ ...originalImports == null ? void 0 : originalImports.component, ...imports.component }),
|
|
210
|
+
directive: stringifyDeclarationImports({ ...originalImports == null ? void 0 : originalImports.directive, ...imports.directive })
|
|
199
211
|
};
|
|
200
212
|
let code = `// generated by unplugin-vue-components
|
|
201
213
|
// We suggest you to commit this file into source control
|
|
@@ -277,7 +289,7 @@ async function transformComponent(code, transformer2, s, ctx, sfcPath) {
|
|
|
277
289
|
const component = await ctx.findComponent(name, "component", [sfcPath]);
|
|
278
290
|
if (component) {
|
|
279
291
|
const varName = `__unplugin_components_${no}`;
|
|
280
|
-
s.prepend(`${_chunk2GXY7E6Xjs.stringifyComponentImport.call(void 0,
|
|
292
|
+
s.prepend(`${_chunk2GXY7E6Xjs.stringifyComponentImport.call(void 0, { ...component, as: varName }, ctx)};
|
|
281
293
|
`);
|
|
282
294
|
no += 1;
|
|
283
295
|
replace(varName);
|
|
@@ -293,7 +305,9 @@ async function transformComponent(code, transformer2, s, ctx, sfcPath) {
|
|
|
293
305
|
|
|
294
306
|
var getRenderFnStart = (ast) => {
|
|
295
307
|
var _a, _b;
|
|
296
|
-
const renderFn = ast.program.body.find(
|
|
308
|
+
const renderFn = ast.program.body.find(
|
|
309
|
+
(node) => node.type === "VariableDeclaration" && node.declarations[0].id.type === "Identifier" && node.declarations[0].id.name === "render"
|
|
310
|
+
);
|
|
297
311
|
const start = (_b = (_a = renderFn == null ? void 0 : renderFn.declarations[0].init) == null ? void 0 : _a.body) == null ? void 0 : _b.start;
|
|
298
312
|
if (start === null || start === void 0)
|
|
299
313
|
throw new Error("[unplugin-vue-components:directive] Cannot find render function position.");
|
|
@@ -308,7 +322,7 @@ async function resolveVue22(code, s) {
|
|
|
308
322
|
sourceType: "module"
|
|
309
323
|
});
|
|
310
324
|
const nodes = [];
|
|
311
|
-
const { walk } = await Promise.resolve().then(() => require("./src-
|
|
325
|
+
const { walk } = await Promise.resolve().then(() => require("./src-KKLCUN63.js"));
|
|
312
326
|
walk(ast.program, {
|
|
313
327
|
enter(node) {
|
|
314
328
|
if (node.type === "CallExpression")
|
|
@@ -320,14 +334,18 @@ async function resolveVue22(code, s) {
|
|
|
320
334
|
const { callee, arguments: args } = node;
|
|
321
335
|
if (callee.type !== "Identifier" || callee.name !== "_c" || ((_a = args[1]) == null ? void 0 : _a.type) !== "ObjectExpression")
|
|
322
336
|
continue;
|
|
323
|
-
const directives = (_b = args[1].properties.find(
|
|
337
|
+
const directives = (_b = args[1].properties.find(
|
|
338
|
+
(property) => property.type === "ObjectProperty" && property.key.type === "Identifier" && property.key.name === "directives"
|
|
339
|
+
)) == null ? void 0 : _b.value;
|
|
324
340
|
if (!directives || directives.type !== "ArrayExpression")
|
|
325
341
|
continue;
|
|
326
342
|
const renderStart = getRenderFnStart(ast);
|
|
327
343
|
for (const directive of directives.elements) {
|
|
328
344
|
if ((directive == null ? void 0 : directive.type) !== "ObjectExpression")
|
|
329
345
|
continue;
|
|
330
|
-
const nameNode = (_c = directive.properties.find(
|
|
346
|
+
const nameNode = (_c = directive.properties.find(
|
|
347
|
+
(p) => p.type === "ObjectProperty" && p.key.type === "Identifier" && p.key.name === "name"
|
|
348
|
+
)) == null ? void 0 : _c.value;
|
|
331
349
|
if ((nameNode == null ? void 0 : nameNode.type) !== "StringLiteral")
|
|
332
350
|
continue;
|
|
333
351
|
const name = nameNode.value;
|
|
@@ -375,7 +393,7 @@ async function transformDirective(code, transformer2, s, ctx, sfcPath) {
|
|
|
375
393
|
if (!directive)
|
|
376
394
|
continue;
|
|
377
395
|
const varName = `__unplugin_directives_${no}`;
|
|
378
|
-
s.prepend(`${_chunk2GXY7E6Xjs.stringifyComponentImport.call(void 0,
|
|
396
|
+
s.prepend(`${_chunk2GXY7E6Xjs.stringifyComponentImport.call(void 0, { ...directive, as: varName }, ctx)};
|
|
379
397
|
`);
|
|
380
398
|
no += 1;
|
|
381
399
|
replace(varName);
|
|
@@ -571,9 +589,10 @@ var Context = class {
|
|
|
571
589
|
from: result
|
|
572
590
|
};
|
|
573
591
|
} else {
|
|
574
|
-
info =
|
|
575
|
-
as: name
|
|
576
|
-
|
|
592
|
+
info = {
|
|
593
|
+
as: name,
|
|
594
|
+
..._chunk2GXY7E6Xjs.normalizeComponetInfo.call(void 0, result)
|
|
595
|
+
};
|
|
577
596
|
}
|
|
578
597
|
if (type === "component")
|
|
579
598
|
this.addCustomComponents(info);
|
|
@@ -619,7 +638,10 @@ var Context = class {
|
|
|
619
638
|
// src/core/unplugin.ts
|
|
620
639
|
var PLUGIN_NAME = "unplugin:webpack";
|
|
621
640
|
var unplugin_default = _unplugin.createUnplugin.call(void 0, (options = {}) => {
|
|
622
|
-
const filter = _pluginutils.createFilter.call(void 0,
|
|
641
|
+
const filter = _pluginutils.createFilter.call(void 0,
|
|
642
|
+
options.include || [/\.vue$/, /\.vue\?vue/],
|
|
643
|
+
options.exclude || [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/]
|
|
644
|
+
);
|
|
623
645
|
const ctx = new Context(options);
|
|
624
646
|
const api = {
|
|
625
647
|
async findComponent(name, filename) {
|
package/dist/esbuild.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkMR7ESCTSjs = require('./chunk-MR7ESCTS.js');
|
|
4
4
|
require('./chunk-2GXY7E6X.js');
|
|
5
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-EZUCZHGV.js');
|
|
6
6
|
require('./chunk-6F4PWJZI.js');
|
|
7
7
|
|
|
8
8
|
// src/esbuild.ts
|
|
9
|
-
var esbuild_default =
|
|
9
|
+
var esbuild_default = _chunkMR7ESCTSjs.unplugin_default.esbuild;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
module.exports = esbuild_default;
|
package/dist/esbuild.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkMR7ESCTSjs = require('./chunk-MR7ESCTS.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _chunk2GXY7E6Xjs = require('./chunk-2GXY7E6X.js');
|
|
9
|
-
require('./chunk-
|
|
9
|
+
require('./chunk-EZUCZHGV.js');
|
|
10
10
|
require('./chunk-6F4PWJZI.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
exports.camelCase = _chunk2GXY7E6Xjs.camelCase; exports.default =
|
|
16
|
+
exports.camelCase = _chunk2GXY7E6Xjs.camelCase; exports.default = _chunkMR7ESCTSjs.unplugin_default; exports.kebabCase = _chunk2GXY7E6Xjs.kebabCase; exports.pascalCase = _chunk2GXY7E6Xjs.pascalCase;
|
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
unplugin_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3LRP7IED.mjs";
|
|
4
4
|
import {
|
|
5
5
|
camelCase,
|
|
6
6
|
kebabCase,
|
|
7
7
|
pascalCase
|
|
8
8
|
} from "./chunk-667B3WUW.mjs";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-AKU6F3WT.mjs";
|
|
10
10
|
import "./chunk-WBQAMGXK.mjs";
|
|
11
11
|
export {
|
|
12
12
|
camelCase,
|
package/dist/nuxt.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkMR7ESCTSjs = require('./chunk-MR7ESCTS.js');
|
|
4
4
|
require('./chunk-2GXY7E6X.js');
|
|
5
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-EZUCZHGV.js');
|
|
6
6
|
require('./chunk-6F4PWJZI.js');
|
|
7
7
|
|
|
8
8
|
// src/nuxt.ts
|
|
9
9
|
function nuxt_default(options) {
|
|
10
10
|
this.extendBuild((config) => {
|
|
11
11
|
config.plugins = config.plugins || [];
|
|
12
|
-
config.plugins.unshift(
|
|
12
|
+
config.plugins.unshift(_chunkMR7ESCTSjs.unplugin_default.webpack(options));
|
|
13
13
|
});
|
|
14
14
|
this.nuxt.hook("vite:extend", async (vite) => {
|
|
15
15
|
vite.config.plugins = vite.config.plugins || [];
|
|
16
|
-
vite.config.plugins.push(
|
|
16
|
+
vite.config.plugins.push(_chunkMR7ESCTSjs.unplugin_default.vite(options));
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
|
package/dist/nuxt.mjs
CHANGED
package/dist/resolvers.d.ts
CHANGED
|
@@ -76,6 +76,10 @@ interface ElementPlusResolverOptions {
|
|
|
76
76
|
* exclude component name, if match do not resolve the name
|
|
77
77
|
*/
|
|
78
78
|
exclude?: RegExp;
|
|
79
|
+
/**
|
|
80
|
+
* a list of component names that have no styles, so resolving their styles file should be prevented
|
|
81
|
+
*/
|
|
82
|
+
noStylesComponents?: string[];
|
|
79
83
|
}
|
|
80
84
|
/**
|
|
81
85
|
* Resolver for Element Plus
|
|
@@ -431,11 +435,19 @@ interface LayuiVueResolverOptions {
|
|
|
431
435
|
*/
|
|
432
436
|
declare function LayuiVueResolver(options?: LayuiVueResolverOptions): ComponentResolver;
|
|
433
437
|
|
|
438
|
+
interface BootstrapVueResolverOptions {
|
|
439
|
+
/**
|
|
440
|
+
* Auto import for directives.
|
|
441
|
+
*
|
|
442
|
+
* @default true
|
|
443
|
+
*/
|
|
444
|
+
directives?: boolean;
|
|
445
|
+
}
|
|
434
446
|
/**
|
|
435
447
|
* Resolver for BootstrapVue
|
|
436
448
|
*
|
|
437
449
|
* @link https://github.com/bootstrap-vue/bootstrap-vue
|
|
438
450
|
*/
|
|
439
|
-
declare function BootstrapVueResolver(): ComponentResolver;
|
|
451
|
+
declare function BootstrapVueResolver(_options?: BootstrapVueResolverOptions): ComponentResolver[];
|
|
440
452
|
|
|
441
|
-
export { AntDesignVueResolver, AntDesignVueResolverOptions, ArcoResolver, ArcoResolverOptions, BootstrapVueResolver, DevResolverOptions, DevUiResolver, ElementPlusResolver, ElementPlusResolverOptions, ElementUiResolver, ElementUiResolverOptions, HeadlessUiResolver, HeadlessUiResolverOptions, IduxResolver, IduxResolverOptions, InklineResolver, LayuiVueResolver, LayuiVueResolverOptions, NaiveUiResolver, PrimeVueResolver, PrimeVueResolverOptions, QuasarResolver, TDesignResolver, TDesignResolverOptions, VantResolver, VantResolverOptions, VarletUIResolver, VarletUIResolverOptions, VeuiResolver, VeuiResolverOptions, ViewUiResolver, VueUseComponentsResolver, Vuetify3Resolver, VuetifyResolver, getResolved };
|
|
453
|
+
export { AntDesignVueResolver, AntDesignVueResolverOptions, ArcoResolver, ArcoResolverOptions, BootstrapVueResolver, BootstrapVueResolverOptions, DevResolverOptions, DevUiResolver, ElementPlusResolver, ElementPlusResolverOptions, ElementUiResolver, ElementUiResolverOptions, HeadlessUiResolver, HeadlessUiResolverOptions, IduxResolver, IduxResolverOptions, InklineResolver, LayuiVueResolver, LayuiVueResolverOptions, NaiveUiResolver, PrimeVueResolver, PrimeVueResolverOptions, QuasarResolver, TDesignResolver, TDesignResolverOptions, VantResolver, VantResolverOptions, VarletUIResolver, VarletUIResolverOptions, VeuiResolver, VeuiResolverOptions, ViewUiResolver, VueUseComponentsResolver, Vuetify3Resolver, VuetifyResolver, getResolved };
|
package/dist/resolvers.js
CHANGED
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
var _chunk2GXY7E6Xjs = require('./chunk-2GXY7E6X.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
var _chunkBTQOTIPQjs = require('./chunk-BTQOTIPQ.js');
|
|
11
|
+
var _chunkEZUCZHGVjs = require('./chunk-EZUCZHGV.js');
|
|
13
12
|
|
|
14
13
|
// src/core/resolvers/antdv.ts
|
|
15
14
|
var matchComponents = [
|
|
@@ -306,10 +305,14 @@ var operatorResMap = {
|
|
|
306
305
|
var allowedOperators = Object.keys(operatorResMap);
|
|
307
306
|
var assertValidOperator = (op) => {
|
|
308
307
|
if (typeof op !== "string") {
|
|
309
|
-
throw new TypeError(
|
|
308
|
+
throw new TypeError(
|
|
309
|
+
`Invalid operator type, expected string but got ${typeof op}`
|
|
310
|
+
);
|
|
310
311
|
}
|
|
311
312
|
if (allowedOperators.indexOf(op) === -1) {
|
|
312
|
-
throw new Error(
|
|
313
|
+
throw new Error(
|
|
314
|
+
`Invalid operator, expected one of ${allowedOperators.join("|")}`
|
|
315
|
+
);
|
|
313
316
|
}
|
|
314
317
|
};
|
|
315
318
|
|
|
@@ -390,25 +393,32 @@ function resolveDirective(name, options) {
|
|
|
390
393
|
};
|
|
391
394
|
}
|
|
392
395
|
}
|
|
396
|
+
var noStylesComponents = ["ElAutoResizer"];
|
|
393
397
|
function ElementPlusResolver(options = {}) {
|
|
394
398
|
let optionsResolved;
|
|
395
399
|
async function resolveOptions() {
|
|
396
400
|
if (optionsResolved)
|
|
397
401
|
return optionsResolved;
|
|
398
|
-
optionsResolved =
|
|
402
|
+
optionsResolved = {
|
|
399
403
|
ssr: false,
|
|
400
404
|
version: await _chunk2GXY7E6Xjs.getPkgVersion.call(void 0, "element-plus", "2.2.2"),
|
|
401
405
|
importStyle: "css",
|
|
402
406
|
directives: true,
|
|
403
|
-
exclude: void 0
|
|
404
|
-
|
|
407
|
+
exclude: void 0,
|
|
408
|
+
noStylesComponents: options.noStylesComponents || [],
|
|
409
|
+
...options
|
|
410
|
+
};
|
|
405
411
|
return optionsResolved;
|
|
406
412
|
}
|
|
407
413
|
return [
|
|
408
414
|
{
|
|
409
415
|
type: "component",
|
|
410
416
|
resolve: async (name) => {
|
|
411
|
-
|
|
417
|
+
const options2 = await resolveOptions();
|
|
418
|
+
if ([...options2.noStylesComponents, ...noStylesComponents].includes(name))
|
|
419
|
+
return resolveComponent(name, { ...options2, importStyle: false });
|
|
420
|
+
else
|
|
421
|
+
return resolveComponent(name, options2);
|
|
412
422
|
}
|
|
413
423
|
},
|
|
414
424
|
{
|
|
@@ -701,7 +711,9 @@ function PrimeVueResolver(options = {}) {
|
|
|
701
711
|
if (options.importIcons)
|
|
702
712
|
sideEffects.push("primeicons/primeicons.css");
|
|
703
713
|
if (options.importTheme) {
|
|
704
|
-
sideEffects.push(
|
|
714
|
+
sideEffects.push(
|
|
715
|
+
`primevue/resources/themes/${options.importTheme}/theme.css`
|
|
716
|
+
);
|
|
705
717
|
}
|
|
706
718
|
if (options.prefix) {
|
|
707
719
|
if (!name.startsWith(options.prefix))
|
|
@@ -800,7 +812,7 @@ function VeuiResolver(options = {}) {
|
|
|
800
812
|
const { alias = VEUI_PACKAGE_NAME } = options;
|
|
801
813
|
if (!components3) {
|
|
802
814
|
try {
|
|
803
|
-
const componentsData =
|
|
815
|
+
const componentsData = _chunkEZUCZHGVjs.__require.call(void 0, `${alias}/components.json`);
|
|
804
816
|
components3 = new Set(componentsData.map(({ name }) => name));
|
|
805
817
|
} catch (e) {
|
|
806
818
|
throw new Error("[unplugin-vue-components:veui] VEUI is not installed");
|
|
@@ -843,16 +855,18 @@ function getSideEffects5(name, {
|
|
|
843
855
|
global = []
|
|
844
856
|
}) {
|
|
845
857
|
const localeModules = (locale ? Array.isArray(locale) ? locale : [locale] : []).map((locale2) => `${alias}/locale/${locale2}/${name}.js`);
|
|
846
|
-
const peerModules = modules.map(
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
858
|
+
const peerModules = modules.map(
|
|
859
|
+
({
|
|
860
|
+
package: pack,
|
|
861
|
+
path = "components",
|
|
862
|
+
fileName = "{module}.css",
|
|
863
|
+
transform = "kebab-case"
|
|
864
|
+
}) => {
|
|
865
|
+
const peer = transform ? formatters[transform](name) : name;
|
|
866
|
+
const file = fileName.replace(/\$?\{module\}/g, peer);
|
|
867
|
+
return _path.normalize.call(void 0, _path.join.call(void 0, pack, path, file));
|
|
868
|
+
}
|
|
869
|
+
);
|
|
856
870
|
return [...localeModules, ...global, ...peerModules].filter(assertPeerPath);
|
|
857
871
|
}
|
|
858
872
|
|
|
@@ -1011,7 +1025,7 @@ function directivesResolver(name) {
|
|
|
1011
1025
|
};
|
|
1012
1026
|
}
|
|
1013
1027
|
function DevUiResolver(options = {}) {
|
|
1014
|
-
const config =
|
|
1028
|
+
const config = { directives: true, importStyle: true, ...options };
|
|
1015
1029
|
const resolvers = [
|
|
1016
1030
|
{ type: "component", resolve: componentsResolver }
|
|
1017
1031
|
];
|
|
@@ -1275,7 +1289,7 @@ var matchComponents4 = [
|
|
|
1275
1289
|
styleDir: void 0
|
|
1276
1290
|
},
|
|
1277
1291
|
{
|
|
1278
|
-
pattern: /^(LayDropdownMenu|LayDropdownMenuItem)$/,
|
|
1292
|
+
pattern: /^(LayDropdownMenu|LayDropdownMenuItem|LayDropdownSubMenu)$/,
|
|
1279
1293
|
styleDir: "dropdown"
|
|
1280
1294
|
},
|
|
1281
1295
|
{
|
|
@@ -1286,6 +1300,10 @@ var matchComponents4 = [
|
|
|
1286
1300
|
pattern: /^(LayMenuItem|LaySubMenu)$/,
|
|
1287
1301
|
styleDir: "menu"
|
|
1288
1302
|
},
|
|
1303
|
+
{
|
|
1304
|
+
pattern: /^(LayRadioGroup)$/,
|
|
1305
|
+
styleDir: "radio"
|
|
1306
|
+
},
|
|
1289
1307
|
{
|
|
1290
1308
|
pattern: /^LaySelectOption$/,
|
|
1291
1309
|
styleDir: "select"
|
|
@@ -1368,14 +1386,72 @@ function LayuiVueResolver(options = {}) {
|
|
|
1368
1386
|
}
|
|
1369
1387
|
|
|
1370
1388
|
// src/core/resolvers/bootstrap-vue.ts
|
|
1371
|
-
|
|
1372
|
-
|
|
1389
|
+
var COMPONENT_ALIASES = {
|
|
1390
|
+
BBtn: "BButton",
|
|
1391
|
+
BBtnClose: "BButtonClose",
|
|
1392
|
+
BBtnGroup: "BButtonGroup",
|
|
1393
|
+
BBtnToolbar: "BButtonToolbar",
|
|
1394
|
+
BCheck: "BFormCheckbox",
|
|
1395
|
+
BCheckbox: "BFormCheckbox",
|
|
1396
|
+
BCheckboxGroup: "BFormCheckboxGroup",
|
|
1397
|
+
BCheckGroup: "BFormCheckboxGroup",
|
|
1398
|
+
BDatalist: "BFormDatalist",
|
|
1399
|
+
BDd: "BDropdown",
|
|
1400
|
+
BDdDivider: "BDropdownDivider",
|
|
1401
|
+
BDdForm: "BDropdownForm",
|
|
1402
|
+
BDdGroup: "BDropdownGroup",
|
|
1403
|
+
BDdHeader: "BDropdownHeader",
|
|
1404
|
+
BDdItem: "BDropdownItem",
|
|
1405
|
+
BDdItemButton: "BDropdownItemButton",
|
|
1406
|
+
BDdItemBtn: "BDropdownItemButton",
|
|
1407
|
+
BDdText: "BDropdownText",
|
|
1408
|
+
BDropdownItemBtn: "BDropdownItemButton",
|
|
1409
|
+
BFile: "BFormFile",
|
|
1410
|
+
BFormDatepicker: "BDatepicker",
|
|
1411
|
+
BInput: "BFormInput",
|
|
1412
|
+
BNavDd: "BNavItemDropdown",
|
|
1413
|
+
BNavDropdown: "BNavItemDropdown",
|
|
1414
|
+
BNavItemDd: "BNavItemDropdown",
|
|
1415
|
+
BNavToggle: "BNavbarToggle",
|
|
1416
|
+
BRadio: "BFormRadio",
|
|
1417
|
+
BRadioGroup: "BFormRadioGroup",
|
|
1418
|
+
BRating: "BFormRating",
|
|
1419
|
+
BSelect: "BFormSelect",
|
|
1420
|
+
BSelectOption: "BFormSelectOption",
|
|
1421
|
+
BSelectOptionGroup: "BFormSelectOptionGroup",
|
|
1422
|
+
BSpinbutton: "BFormSpinbutton",
|
|
1423
|
+
BTag: "BFormTag",
|
|
1424
|
+
BTags: "BFormTags",
|
|
1425
|
+
BTextarea: "BFormTextarea",
|
|
1426
|
+
BTimepicker: "BFormTimepicker"
|
|
1427
|
+
};
|
|
1428
|
+
function BootstrapVueResolver(_options = {}) {
|
|
1429
|
+
const options = { directives: true, ..._options };
|
|
1430
|
+
const resolvers = [{
|
|
1373
1431
|
type: "component",
|
|
1374
1432
|
resolve: (name) => {
|
|
1375
|
-
if (name.match(/^B[A-Z]/))
|
|
1376
|
-
return {
|
|
1433
|
+
if (name.match(/^B[A-Z]/)) {
|
|
1434
|
+
return {
|
|
1435
|
+
name: COMPONENT_ALIASES[name] || name,
|
|
1436
|
+
from: "bootstrap-vue"
|
|
1437
|
+
};
|
|
1438
|
+
}
|
|
1377
1439
|
}
|
|
1378
|
-
};
|
|
1440
|
+
}];
|
|
1441
|
+
if (options.directives) {
|
|
1442
|
+
resolvers.push({
|
|
1443
|
+
type: "directive",
|
|
1444
|
+
resolve: (name) => {
|
|
1445
|
+
if (name.match(/^B[A-Z]/)) {
|
|
1446
|
+
return {
|
|
1447
|
+
name: `V${name}`,
|
|
1448
|
+
from: "bootstrap-vue"
|
|
1449
|
+
};
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
});
|
|
1453
|
+
}
|
|
1454
|
+
return resolvers;
|
|
1379
1455
|
}
|
|
1380
1456
|
|
|
1381
1457
|
|
package/dist/resolvers.mjs
CHANGED
|
@@ -7,9 +7,8 @@ import {
|
|
|
7
7
|
resolveImportPath
|
|
8
8
|
} from "./chunk-667B3WUW.mjs";
|
|
9
9
|
import {
|
|
10
|
-
__require
|
|
11
|
-
|
|
12
|
-
} from "./chunk-ZKNUHGJ4.mjs";
|
|
10
|
+
__require
|
|
11
|
+
} from "./chunk-AKU6F3WT.mjs";
|
|
13
12
|
|
|
14
13
|
// src/core/resolvers/antdv.ts
|
|
15
14
|
var matchComponents = [
|
|
@@ -306,10 +305,14 @@ var operatorResMap = {
|
|
|
306
305
|
var allowedOperators = Object.keys(operatorResMap);
|
|
307
306
|
var assertValidOperator = (op) => {
|
|
308
307
|
if (typeof op !== "string") {
|
|
309
|
-
throw new TypeError(
|
|
308
|
+
throw new TypeError(
|
|
309
|
+
`Invalid operator type, expected string but got ${typeof op}`
|
|
310
|
+
);
|
|
310
311
|
}
|
|
311
312
|
if (allowedOperators.indexOf(op) === -1) {
|
|
312
|
-
throw new Error(
|
|
313
|
+
throw new Error(
|
|
314
|
+
`Invalid operator, expected one of ${allowedOperators.join("|")}`
|
|
315
|
+
);
|
|
313
316
|
}
|
|
314
317
|
};
|
|
315
318
|
|
|
@@ -390,25 +393,32 @@ function resolveDirective(name, options) {
|
|
|
390
393
|
};
|
|
391
394
|
}
|
|
392
395
|
}
|
|
396
|
+
var noStylesComponents = ["ElAutoResizer"];
|
|
393
397
|
function ElementPlusResolver(options = {}) {
|
|
394
398
|
let optionsResolved;
|
|
395
399
|
async function resolveOptions() {
|
|
396
400
|
if (optionsResolved)
|
|
397
401
|
return optionsResolved;
|
|
398
|
-
optionsResolved =
|
|
402
|
+
optionsResolved = {
|
|
399
403
|
ssr: false,
|
|
400
404
|
version: await getPkgVersion("element-plus", "2.2.2"),
|
|
401
405
|
importStyle: "css",
|
|
402
406
|
directives: true,
|
|
403
|
-
exclude: void 0
|
|
404
|
-
|
|
407
|
+
exclude: void 0,
|
|
408
|
+
noStylesComponents: options.noStylesComponents || [],
|
|
409
|
+
...options
|
|
410
|
+
};
|
|
405
411
|
return optionsResolved;
|
|
406
412
|
}
|
|
407
413
|
return [
|
|
408
414
|
{
|
|
409
415
|
type: "component",
|
|
410
416
|
resolve: async (name) => {
|
|
411
|
-
|
|
417
|
+
const options2 = await resolveOptions();
|
|
418
|
+
if ([...options2.noStylesComponents, ...noStylesComponents].includes(name))
|
|
419
|
+
return resolveComponent(name, { ...options2, importStyle: false });
|
|
420
|
+
else
|
|
421
|
+
return resolveComponent(name, options2);
|
|
412
422
|
}
|
|
413
423
|
},
|
|
414
424
|
{
|
|
@@ -701,7 +711,9 @@ function PrimeVueResolver(options = {}) {
|
|
|
701
711
|
if (options.importIcons)
|
|
702
712
|
sideEffects.push("primeicons/primeicons.css");
|
|
703
713
|
if (options.importTheme) {
|
|
704
|
-
sideEffects.push(
|
|
714
|
+
sideEffects.push(
|
|
715
|
+
`primevue/resources/themes/${options.importTheme}/theme.css`
|
|
716
|
+
);
|
|
705
717
|
}
|
|
706
718
|
if (options.prefix) {
|
|
707
719
|
if (!name.startsWith(options.prefix))
|
|
@@ -843,16 +855,18 @@ function getSideEffects5(name, {
|
|
|
843
855
|
global = []
|
|
844
856
|
}) {
|
|
845
857
|
const localeModules = (locale ? Array.isArray(locale) ? locale : [locale] : []).map((locale2) => `${alias}/locale/${locale2}/${name}.js`);
|
|
846
|
-
const peerModules = modules.map(
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
858
|
+
const peerModules = modules.map(
|
|
859
|
+
({
|
|
860
|
+
package: pack,
|
|
861
|
+
path = "components",
|
|
862
|
+
fileName = "{module}.css",
|
|
863
|
+
transform = "kebab-case"
|
|
864
|
+
}) => {
|
|
865
|
+
const peer = transform ? formatters[transform](name) : name;
|
|
866
|
+
const file = fileName.replace(/\$?\{module\}/g, peer);
|
|
867
|
+
return normalize(join(pack, path, file));
|
|
868
|
+
}
|
|
869
|
+
);
|
|
856
870
|
return [...localeModules, ...global, ...peerModules].filter(assertPeerPath);
|
|
857
871
|
}
|
|
858
872
|
|
|
@@ -1011,7 +1025,7 @@ function directivesResolver(name) {
|
|
|
1011
1025
|
};
|
|
1012
1026
|
}
|
|
1013
1027
|
function DevUiResolver(options = {}) {
|
|
1014
|
-
const config =
|
|
1028
|
+
const config = { directives: true, importStyle: true, ...options };
|
|
1015
1029
|
const resolvers = [
|
|
1016
1030
|
{ type: "component", resolve: componentsResolver }
|
|
1017
1031
|
];
|
|
@@ -1275,7 +1289,7 @@ var matchComponents4 = [
|
|
|
1275
1289
|
styleDir: void 0
|
|
1276
1290
|
},
|
|
1277
1291
|
{
|
|
1278
|
-
pattern: /^(LayDropdownMenu|LayDropdownMenuItem)$/,
|
|
1292
|
+
pattern: /^(LayDropdownMenu|LayDropdownMenuItem|LayDropdownSubMenu)$/,
|
|
1279
1293
|
styleDir: "dropdown"
|
|
1280
1294
|
},
|
|
1281
1295
|
{
|
|
@@ -1286,6 +1300,10 @@ var matchComponents4 = [
|
|
|
1286
1300
|
pattern: /^(LayMenuItem|LaySubMenu)$/,
|
|
1287
1301
|
styleDir: "menu"
|
|
1288
1302
|
},
|
|
1303
|
+
{
|
|
1304
|
+
pattern: /^(LayRadioGroup)$/,
|
|
1305
|
+
styleDir: "radio"
|
|
1306
|
+
},
|
|
1289
1307
|
{
|
|
1290
1308
|
pattern: /^LaySelectOption$/,
|
|
1291
1309
|
styleDir: "select"
|
|
@@ -1368,14 +1386,72 @@ function LayuiVueResolver(options = {}) {
|
|
|
1368
1386
|
}
|
|
1369
1387
|
|
|
1370
1388
|
// src/core/resolvers/bootstrap-vue.ts
|
|
1371
|
-
|
|
1372
|
-
|
|
1389
|
+
var COMPONENT_ALIASES = {
|
|
1390
|
+
BBtn: "BButton",
|
|
1391
|
+
BBtnClose: "BButtonClose",
|
|
1392
|
+
BBtnGroup: "BButtonGroup",
|
|
1393
|
+
BBtnToolbar: "BButtonToolbar",
|
|
1394
|
+
BCheck: "BFormCheckbox",
|
|
1395
|
+
BCheckbox: "BFormCheckbox",
|
|
1396
|
+
BCheckboxGroup: "BFormCheckboxGroup",
|
|
1397
|
+
BCheckGroup: "BFormCheckboxGroup",
|
|
1398
|
+
BDatalist: "BFormDatalist",
|
|
1399
|
+
BDd: "BDropdown",
|
|
1400
|
+
BDdDivider: "BDropdownDivider",
|
|
1401
|
+
BDdForm: "BDropdownForm",
|
|
1402
|
+
BDdGroup: "BDropdownGroup",
|
|
1403
|
+
BDdHeader: "BDropdownHeader",
|
|
1404
|
+
BDdItem: "BDropdownItem",
|
|
1405
|
+
BDdItemButton: "BDropdownItemButton",
|
|
1406
|
+
BDdItemBtn: "BDropdownItemButton",
|
|
1407
|
+
BDdText: "BDropdownText",
|
|
1408
|
+
BDropdownItemBtn: "BDropdownItemButton",
|
|
1409
|
+
BFile: "BFormFile",
|
|
1410
|
+
BFormDatepicker: "BDatepicker",
|
|
1411
|
+
BInput: "BFormInput",
|
|
1412
|
+
BNavDd: "BNavItemDropdown",
|
|
1413
|
+
BNavDropdown: "BNavItemDropdown",
|
|
1414
|
+
BNavItemDd: "BNavItemDropdown",
|
|
1415
|
+
BNavToggle: "BNavbarToggle",
|
|
1416
|
+
BRadio: "BFormRadio",
|
|
1417
|
+
BRadioGroup: "BFormRadioGroup",
|
|
1418
|
+
BRating: "BFormRating",
|
|
1419
|
+
BSelect: "BFormSelect",
|
|
1420
|
+
BSelectOption: "BFormSelectOption",
|
|
1421
|
+
BSelectOptionGroup: "BFormSelectOptionGroup",
|
|
1422
|
+
BSpinbutton: "BFormSpinbutton",
|
|
1423
|
+
BTag: "BFormTag",
|
|
1424
|
+
BTags: "BFormTags",
|
|
1425
|
+
BTextarea: "BFormTextarea",
|
|
1426
|
+
BTimepicker: "BFormTimepicker"
|
|
1427
|
+
};
|
|
1428
|
+
function BootstrapVueResolver(_options = {}) {
|
|
1429
|
+
const options = { directives: true, ..._options };
|
|
1430
|
+
const resolvers = [{
|
|
1373
1431
|
type: "component",
|
|
1374
1432
|
resolve: (name) => {
|
|
1375
|
-
if (name.match(/^B[A-Z]/))
|
|
1376
|
-
return {
|
|
1433
|
+
if (name.match(/^B[A-Z]/)) {
|
|
1434
|
+
return {
|
|
1435
|
+
name: COMPONENT_ALIASES[name] || name,
|
|
1436
|
+
from: "bootstrap-vue"
|
|
1437
|
+
};
|
|
1438
|
+
}
|
|
1377
1439
|
}
|
|
1378
|
-
};
|
|
1440
|
+
}];
|
|
1441
|
+
if (options.directives) {
|
|
1442
|
+
resolvers.push({
|
|
1443
|
+
type: "directive",
|
|
1444
|
+
resolve: (name) => {
|
|
1445
|
+
if (name.match(/^B[A-Z]/)) {
|
|
1446
|
+
return {
|
|
1447
|
+
name: `V${name}`,
|
|
1448
|
+
from: "bootstrap-vue"
|
|
1449
|
+
};
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
});
|
|
1453
|
+
}
|
|
1454
|
+
return resolvers;
|
|
1379
1455
|
}
|
|
1380
1456
|
export {
|
|
1381
1457
|
AntDesignVueResolver,
|
package/dist/rollup.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkMR7ESCTSjs = require('./chunk-MR7ESCTS.js');
|
|
4
4
|
require('./chunk-2GXY7E6X.js');
|
|
5
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-EZUCZHGV.js');
|
|
6
6
|
require('./chunk-6F4PWJZI.js');
|
|
7
7
|
|
|
8
8
|
// src/rollup.ts
|
|
9
|
-
var rollup_default =
|
|
9
|
+
var rollup_default = _chunkMR7ESCTSjs.unplugin_default.rollup;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
module.exports = rollup_default;
|
package/dist/rollup.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-EZUCZHGV.js');
|
|
2
2
|
|
|
3
3
|
// node_modules/.pnpm/estree-walker@3.0.1/node_modules/estree-walker/src/walker.js
|
|
4
4
|
var WalkerBase = class {
|
package/dist/vite.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkMR7ESCTSjs = require('./chunk-MR7ESCTS.js');
|
|
4
4
|
require('./chunk-2GXY7E6X.js');
|
|
5
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-EZUCZHGV.js');
|
|
6
6
|
require('./chunk-6F4PWJZI.js');
|
|
7
7
|
|
|
8
8
|
// src/vite.ts
|
|
9
|
-
var vite_default =
|
|
9
|
+
var vite_default = _chunkMR7ESCTSjs.unplugin_default.vite;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
module.exports = vite_default;
|
package/dist/vite.mjs
CHANGED
package/dist/webpack.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkMR7ESCTSjs = require('./chunk-MR7ESCTS.js');
|
|
4
4
|
require('./chunk-2GXY7E6X.js');
|
|
5
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-EZUCZHGV.js');
|
|
6
6
|
require('./chunk-6F4PWJZI.js');
|
|
7
7
|
|
|
8
8
|
// src/webpack.ts
|
|
9
|
-
var webpack_default =
|
|
9
|
+
var webpack_default = _chunkMR7ESCTSjs.unplugin_default.webpack;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
module.exports = webpack_default;
|
package/dist/webpack.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-vue-components",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.2",
|
|
4
4
|
"packageManager": "pnpm@7.1.5",
|
|
5
5
|
"description": "Components auto importing for Vue",
|
|
6
6
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
@@ -89,33 +89,33 @@
|
|
|
89
89
|
"chokidar": "^3.5.3",
|
|
90
90
|
"debug": "^4.3.4",
|
|
91
91
|
"fast-glob": "^3.2.11",
|
|
92
|
-
"local-pkg": "^0.4.
|
|
92
|
+
"local-pkg": "^0.4.2",
|
|
93
93
|
"magic-string": "^0.26.2",
|
|
94
94
|
"minimatch": "^5.1.0",
|
|
95
95
|
"resolve": "^1.22.1",
|
|
96
|
-
"unplugin": "^0.7.
|
|
96
|
+
"unplugin": "^0.7.2"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
99
|
"@antfu/eslint-config": "^0.25.2",
|
|
100
|
-
"@babel/parser": "^7.18.
|
|
101
|
-
"@babel/types": "^7.18.
|
|
100
|
+
"@babel/parser": "^7.18.9",
|
|
101
|
+
"@babel/types": "^7.18.9",
|
|
102
102
|
"@types/debug": "^4.1.7",
|
|
103
103
|
"@types/minimatch": "^3.0.5",
|
|
104
|
-
"@types/node": "^18.
|
|
104
|
+
"@types/node": "^18.6.1",
|
|
105
105
|
"@types/resolve": "^1.20.2",
|
|
106
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
106
|
+
"@typescript-eslint/eslint-plugin": "^5.31.0",
|
|
107
107
|
"bumpp": "^8.2.1",
|
|
108
108
|
"compare-versions": "^4.1.3",
|
|
109
|
-
"element-plus": "^2.2.
|
|
110
|
-
"eslint": "^8.
|
|
109
|
+
"element-plus": "^2.2.10",
|
|
110
|
+
"eslint": "^8.20.0",
|
|
111
111
|
"esno": "^0.16.3",
|
|
112
112
|
"estree-walker": "^3.0.1",
|
|
113
113
|
"pathe": "^0.3.2",
|
|
114
|
-
"rollup": "^2.
|
|
115
|
-
"tsup": "^6.
|
|
114
|
+
"rollup": "^2.77.0",
|
|
115
|
+
"tsup": "^6.2.0",
|
|
116
116
|
"typescript": "^4.7.4",
|
|
117
|
-
"vite": "^
|
|
118
|
-
"vitest": "^0.
|
|
117
|
+
"vite": "^3.0.3",
|
|
118
|
+
"vitest": "^0.19.1",
|
|
119
119
|
"vue": "3.2.37"
|
|
120
120
|
}
|
|
121
121
|
}
|
package/dist/chunk-BTQOTIPQ.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
21
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
22
|
-
}) : x)(function(x) {
|
|
23
|
-
if (typeof require !== "undefined")
|
|
24
|
-
return require.apply(this, arguments);
|
|
25
|
-
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__require = __require;
|
package/dist/chunk-ZKNUHGJ4.mjs
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
21
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
22
|
-
}) : x)(function(x) {
|
|
23
|
-
if (typeof require !== "undefined")
|
|
24
|
-
return require.apply(this, arguments);
|
|
25
|
-
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
export {
|
|
29
|
-
__spreadValues,
|
|
30
|
-
__spreadProps,
|
|
31
|
-
__require
|
|
32
|
-
};
|