unplugin-vue-components 29.2.0 → 31.0.0

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.
Files changed (70) hide show
  1. package/README.md +4 -36
  2. package/dist/esbuild.d.mts +7 -0
  3. package/dist/esbuild.mjs +9 -0
  4. package/dist/{index.d.cts → index.d.mts} +4 -2
  5. package/dist/index.mjs +4 -0
  6. package/dist/nuxt.d.mts +7 -0
  7. package/dist/{nuxt.js → nuxt.mjs} +4 -4
  8. package/dist/{resolvers.d.ts → resolvers.d.mts} +189 -218
  9. package/dist/{resolvers.js → resolvers.mjs} +28 -83
  10. package/dist/rolldown.d.mts +7 -0
  11. package/dist/rolldown.mjs +9 -0
  12. package/dist/rollup.d.mts +7 -0
  13. package/dist/rollup.mjs +9 -0
  14. package/dist/rspack.d.mts +6 -0
  15. package/dist/rspack.mjs +9 -0
  16. package/dist/{src-bfjkatac.js → src-pYuu2TZ_.mjs} +53 -141
  17. package/dist/types-CWfK8m_y.d.mts +217 -0
  18. package/dist/types.d.mts +2 -0
  19. package/dist/types.mjs +1 -0
  20. package/dist/utils-DuuqqWXg.mjs +234 -0
  21. package/dist/vite.d.mts +9 -0
  22. package/dist/vite.mjs +9 -0
  23. package/dist/webpack.d.mts +7 -0
  24. package/dist/webpack.mjs +9 -0
  25. package/package.json +40 -78
  26. package/dist/esbuild.cjs +0 -9
  27. package/dist/esbuild.d.cts +0 -6
  28. package/dist/esbuild.d.ts +0 -7
  29. package/dist/esbuild.js +0 -9
  30. package/dist/index.cjs +0 -9
  31. package/dist/index.d.ts +0 -13
  32. package/dist/index.js +0 -5
  33. package/dist/nuxt.cjs +0 -14
  34. package/dist/nuxt.d.cts +0 -6
  35. package/dist/nuxt.d.ts +0 -7
  36. package/dist/resolvers.cjs +0 -2074
  37. package/dist/resolvers.d.cts +0 -574
  38. package/dist/rolldown.cjs +0 -9
  39. package/dist/rolldown.d.cts +0 -6
  40. package/dist/rolldown.d.ts +0 -7
  41. package/dist/rolldown.js +0 -9
  42. package/dist/rollup.cjs +0 -9
  43. package/dist/rollup.d.cts +0 -6
  44. package/dist/rollup.d.ts +0 -7
  45. package/dist/rollup.js +0 -9
  46. package/dist/rspack.cjs +0 -9
  47. package/dist/rspack.d.cts +0 -5
  48. package/dist/rspack.d.ts +0 -6
  49. package/dist/rspack.js +0 -9
  50. package/dist/src-BTwFq3T3.cjs +0 -188
  51. package/dist/src-D2-JfLYq.js +0 -187
  52. package/dist/src-DAvVDVLg.cjs +0 -769
  53. package/dist/types-CBTc19th.cjs +0 -0
  54. package/dist/types-DSJ5r-ta.d.cts +0 -225
  55. package/dist/types-rC3290ja.d.ts +0 -225
  56. package/dist/types.cjs +0 -1
  57. package/dist/types.d.cts +0 -2
  58. package/dist/types.d.ts +0 -2
  59. package/dist/types.js +0 -3
  60. package/dist/utils-8UQ22cuO.cjs +0 -1689
  61. package/dist/utils-BoXu-4gQ.js +0 -1523
  62. package/dist/vite.cjs +0 -9
  63. package/dist/vite.d.cts +0 -8
  64. package/dist/vite.d.ts +0 -9
  65. package/dist/vite.js +0 -9
  66. package/dist/webpack.cjs +0 -9
  67. package/dist/webpack.d.cts +0 -6
  68. package/dist/webpack.d.ts +0 -7
  69. package/dist/webpack.js +0 -9
  70. /package/dist/{types-DQoXDiso.js → types--fVOUYBq.mjs} +0 -0
@@ -1,2074 +0,0 @@
1
- const require_utils = require('./utils-8UQ22cuO.cjs');
2
- let node_fs = require("node:fs");
3
- node_fs = require_utils.__toESM(node_fs);
4
- let node_process = require("node:process");
5
- node_process = require_utils.__toESM(node_process);
6
- let node_path = require("node:path");
7
- node_path = require_utils.__toESM(node_path);
8
- let debug = require("debug");
9
- debug = require_utils.__toESM(debug);
10
- let local_pkg = require("local-pkg");
11
- local_pkg = require_utils.__toESM(local_pkg);
12
- let mlly = require("mlly");
13
- mlly = require_utils.__toESM(mlly);
14
-
15
- //#region src/core/resolvers/antdv.ts
16
- const matchComponents$3 = [
17
- {
18
- pattern: /^Affix/,
19
- styleDir: "affix"
20
- },
21
- {
22
- pattern: /^Avatar/,
23
- styleDir: "avatar"
24
- },
25
- {
26
- pattern: /^AutoComplete/,
27
- styleDir: "auto-complete"
28
- },
29
- {
30
- pattern: /^Alert/,
31
- styleDir: "alert"
32
- },
33
- {
34
- pattern: /^Anchor/,
35
- styleDir: "anchor"
36
- },
37
- {
38
- pattern: /^App/,
39
- styleDir: "app"
40
- },
41
- {
42
- pattern: /^Badge/,
43
- styleDir: "badge"
44
- },
45
- {
46
- pattern: /^Breadcrumb/,
47
- styleDir: "breadcrumb"
48
- },
49
- {
50
- pattern: /^Button/,
51
- styleDir: "button"
52
- },
53
- {
54
- pattern: /^Checkbox/,
55
- styleDir: "checkbox"
56
- },
57
- {
58
- pattern: /^Calendar/,
59
- styleDir: "calendar"
60
- },
61
- {
62
- pattern: /^Card/,
63
- styleDir: "card"
64
- },
65
- {
66
- pattern: /^Carousel/,
67
- styleDir: "carousel"
68
- },
69
- {
70
- pattern: /^Collapse/,
71
- styleDir: "collapse"
72
- },
73
- {
74
- pattern: /^Comment/,
75
- styleDir: "comment"
76
- },
77
- {
78
- pattern: /^Descriptions/,
79
- styleDir: "descriptions"
80
- },
81
- {
82
- pattern: /^RangePicker|^WeekPicker|^MonthPicker/,
83
- styleDir: "date-picker"
84
- },
85
- {
86
- pattern: /^Divider/,
87
- styleDir: "divider"
88
- },
89
- {
90
- pattern: /^Drawer/,
91
- styleDir: "drawer"
92
- },
93
- {
94
- pattern: /^Dropdown/,
95
- styleDir: "dropdown"
96
- },
97
- {
98
- pattern: /^Empty/,
99
- styleDir: "empty"
100
- },
101
- {
102
- pattern: /^Flex/,
103
- styleDir: "flex"
104
- },
105
- {
106
- pattern: /^FloatButton/,
107
- styleDir: "float-button"
108
- },
109
- {
110
- pattern: /^Form/,
111
- styleDir: "form"
112
- },
113
- {
114
- pattern: /^Grid/,
115
- styleDir: "grid"
116
- },
117
- {
118
- pattern: /^InputNumber/,
119
- styleDir: "input-number"
120
- },
121
- {
122
- pattern: /^Input|^Textarea/,
123
- styleDir: "input"
124
- },
125
- {
126
- pattern: /^Statistic/,
127
- styleDir: "statistic"
128
- },
129
- {
130
- pattern: /^CheckableTag/,
131
- styleDir: "tag"
132
- },
133
- {
134
- pattern: /^TimeRangePicker/,
135
- styleDir: "time-picker"
136
- },
137
- {
138
- pattern: /^Layout/,
139
- styleDir: "layout"
140
- },
141
- {
142
- pattern: /^Menu|^SubMenu/,
143
- styleDir: "menu"
144
- },
145
- {
146
- pattern: /^Table/,
147
- styleDir: "table"
148
- },
149
- {
150
- pattern: /^TimePicker|^TimeRangePicker/,
151
- styleDir: "time-picker"
152
- },
153
- {
154
- pattern: /^Radio/,
155
- styleDir: "radio"
156
- },
157
- {
158
- pattern: /^Image/,
159
- styleDir: "image"
160
- },
161
- {
162
- pattern: /^List/,
163
- styleDir: "list"
164
- },
165
- {
166
- pattern: /^Tab/,
167
- styleDir: "tabs"
168
- },
169
- {
170
- pattern: /^Mentions/,
171
- styleDir: "mentions"
172
- },
173
- {
174
- pattern: /^Step/,
175
- styleDir: "steps"
176
- },
177
- {
178
- pattern: /^Skeleton/,
179
- styleDir: "skeleton"
180
- },
181
- {
182
- pattern: /^Select/,
183
- styleDir: "select"
184
- },
185
- {
186
- pattern: /^TreeSelect/,
187
- styleDir: "tree-select"
188
- },
189
- {
190
- pattern: /^Tree|^DirectoryTree/,
191
- styleDir: "tree"
192
- },
193
- {
194
- pattern: /^Typography/,
195
- styleDir: "typography"
196
- },
197
- {
198
- pattern: /^Timeline/,
199
- styleDir: "timeline"
200
- },
201
- {
202
- pattern: /^Upload/,
203
- styleDir: "upload"
204
- },
205
- {
206
- pattern: /^Qrcode/,
207
- styleDir: "qrcode"
208
- },
209
- {
210
- pattern: /^Space/,
211
- styleDir: "space"
212
- }
213
- ];
214
- function getStyleDir(compName) {
215
- let styleDir;
216
- const total = matchComponents$3.length;
217
- for (let i = 0; i < total; i++) {
218
- const matcher = matchComponents$3[i];
219
- if (compName.match(matcher.pattern)) {
220
- styleDir = matcher.styleDir;
221
- break;
222
- }
223
- }
224
- if (!styleDir) styleDir = require_utils.kebabCase(compName);
225
- return styleDir;
226
- }
227
- function getSideEffects$8(compName, options) {
228
- const { importStyle = true, importLess = false } = options;
229
- if (!importStyle) return;
230
- const lib = options.cjs ? "lib" : "es";
231
- const packageName = (options === null || options === void 0 ? void 0 : options.packageName) || "ant-design-vue";
232
- if (importStyle === "less" || importStyle === "css-in-js" || importLess) return `${packageName}/${lib}/${getStyleDir(compName)}/style`;
233
- else return `${packageName}/${lib}/${getStyleDir(compName)}/style/css`;
234
- }
235
- const primitiveNames = [
236
- "Affix",
237
- "Anchor",
238
- "AnchorLink",
239
- "AutoComplete",
240
- "AutoCompleteOptGroup",
241
- "AutoCompleteOption",
242
- "Alert",
243
- "Avatar",
244
- "AvatarGroup",
245
- "BackTop",
246
- "Badge",
247
- "BadgeRibbon",
248
- "Breadcrumb",
249
- "BreadcrumbItem",
250
- "BreadcrumbSeparator",
251
- "Button",
252
- "ButtonGroup",
253
- "Calendar",
254
- "Card",
255
- "CardGrid",
256
- "CardMeta",
257
- "Collapse",
258
- "CollapsePanel",
259
- "Carousel",
260
- "Cascader",
261
- "Checkbox",
262
- "CheckboxGroup",
263
- "Col",
264
- "Comment",
265
- "ConfigProvider",
266
- "DatePicker",
267
- "MonthPicker",
268
- "WeekPicker",
269
- "RangePicker",
270
- "QuarterPicker",
271
- "Descriptions",
272
- "DescriptionsItem",
273
- "Divider",
274
- "Dropdown",
275
- "DropdownButton",
276
- "Drawer",
277
- "Empty",
278
- "Form",
279
- "FormItem",
280
- "FormItemRest",
281
- "Grid",
282
- "Input",
283
- "InputGroup",
284
- "InputPassword",
285
- "InputSearch",
286
- "Textarea",
287
- "Image",
288
- "ImagePreviewGroup",
289
- "InputNumber",
290
- "Layout",
291
- "LayoutHeader",
292
- "LayoutSider",
293
- "LayoutFooter",
294
- "LayoutContent",
295
- "List",
296
- "ListItem",
297
- "ListItemMeta",
298
- "Menu",
299
- "MenuDivider",
300
- "MenuItem",
301
- "MenuItemGroup",
302
- "SubMenu",
303
- "Mentions",
304
- "MentionsOption",
305
- "Modal",
306
- "Statistic",
307
- "StatisticCountdown",
308
- "PageHeader",
309
- "Pagination",
310
- "Popconfirm",
311
- "Popover",
312
- "Progress",
313
- "Radio",
314
- "RadioButton",
315
- "RadioGroup",
316
- "Rate",
317
- "Result",
318
- "Row",
319
- "Select",
320
- "SelectOptGroup",
321
- "SelectOption",
322
- "Skeleton",
323
- "SkeletonButton",
324
- "SkeletonAvatar",
325
- "SkeletonInput",
326
- "SkeletonImage",
327
- "Slider",
328
- "Space",
329
- "Spin",
330
- "Steps",
331
- "Step",
332
- "Switch",
333
- "Table",
334
- "TableColumn",
335
- "TableColumnGroup",
336
- "TableSummary",
337
- "TableSummaryRow",
338
- "TableSummaryCell",
339
- "Transfer",
340
- "Tree",
341
- "TreeNode",
342
- "DirectoryTree",
343
- "TreeSelect",
344
- "TreeSelectNode",
345
- "Tabs",
346
- "TabPane",
347
- "Tag",
348
- "CheckableTag",
349
- "TimePicker",
350
- "TimeRangePicker",
351
- "Timeline",
352
- "TimelineItem",
353
- "Tooltip",
354
- "Typography",
355
- "TypographyLink",
356
- "TypographyParagraph",
357
- "TypographyText",
358
- "TypographyTitle",
359
- "Upload",
360
- "UploadDragger",
361
- "LocaleProvider",
362
- "FloatButton",
363
- "FloatButtonGroup",
364
- "Qrcode",
365
- "Watermark",
366
- "Segmented",
367
- "Tour",
368
- "SpaceCompact",
369
- "StyleProvider",
370
- "Flex",
371
- "App"
372
- ];
373
- let antdvNames;
374
- function genAntdNames(primitiveNames$1) {
375
- antdvNames = new Set(primitiveNames$1);
376
- }
377
- genAntdNames(primitiveNames);
378
- function isAntdv(compName) {
379
- return antdvNames.has(compName);
380
- }
381
- function getImportName(compName) {
382
- if (compName === "Qrcode") return "QRCode";
383
- else if (compName === "SpaceCompact") return "Compact";
384
- return compName;
385
- }
386
- /**
387
- * Resolver for Ant Design Vue
388
- *
389
- * Requires ant-design-vue@v2.2.0-beta.6 or later
390
- *
391
- * See https://github.com/antfu/unplugin-vue-components/issues/26#issuecomment-789767941 for more details
392
- *
393
- * @author @yangss3
394
- * @link https://antdv.com/
395
- */
396
- function AntDesignVueResolver(options = {}) {
397
- const originPrefix = options.prefix ?? "A";
398
- return {
399
- type: "component",
400
- resolve: (name) => {
401
- var _options$exclude;
402
- if (options.resolveIcons && name.match(/(Outlined|Filled|TwoTone)$/)) return {
403
- name,
404
- from: "@ant-design/icons-vue"
405
- };
406
- const [compName, prefix] = [name.slice(originPrefix.length), name.slice(0, originPrefix.length)];
407
- if (prefix === originPrefix && isAntdv(compName) && !(options === null || options === void 0 || (_options$exclude = options.exclude) === null || _options$exclude === void 0 ? void 0 : _options$exclude.includes(compName))) {
408
- const { cjs = false, packageName = "ant-design-vue" } = options;
409
- const path = `${packageName}/${cjs ? "lib" : "es"}`;
410
- return {
411
- name: getImportName(compName),
412
- from: path,
413
- sideEffects: getSideEffects$8(compName, options)
414
- };
415
- }
416
- }
417
- };
418
- }
419
-
420
- //#endregion
421
- //#region src/core/resolvers/arco.ts
422
- const debug$1 = (0, debug.default)("unplugin-vue-components:resolvers:arco");
423
- const matchComponents$2 = [
424
- {
425
- pattern: /^AnchorLink$/,
426
- componentDir: "anchor"
427
- },
428
- {
429
- pattern: /^AvatarGroup$/,
430
- componentDir: "avatar"
431
- },
432
- {
433
- pattern: /^BreadcrumbItem$/,
434
- componentDir: "breadcrumb"
435
- },
436
- {
437
- pattern: /^ButtonGroup$/,
438
- componentDir: "button"
439
- },
440
- {
441
- pattern: /^(CardMeta|CardGrid)$/,
442
- componentDir: "card"
443
- },
444
- {
445
- pattern: /^CarouselItem$/,
446
- componentDir: "carousel"
447
- },
448
- {
449
- pattern: /^CascaderPanel$/,
450
- componentDir: "cascader"
451
- },
452
- {
453
- pattern: /^CheckboxGroup$/,
454
- componentDir: "checkbox"
455
- },
456
- {
457
- pattern: /^CollapseItem$/,
458
- componentDir: "collapse"
459
- },
460
- {
461
- pattern: /^(WeekPicker|MonthPicker|YearPicker|QuarterPicker|RangePicker)$/,
462
- componentDir: "date-picker"
463
- },
464
- {
465
- pattern: /^DescriptionsItem$/,
466
- componentDir: "descriptions"
467
- },
468
- {
469
- pattern: /^(Doption|Dgroup|Dsubmenu|DropdownButton)$/,
470
- componentDir: "dropdown"
471
- },
472
- {
473
- pattern: /^FormItem$/,
474
- componentDir: "form"
475
- },
476
- {
477
- pattern: /^(Col|Row|GridItem)$/,
478
- componentDir: "grid"
479
- },
480
- {
481
- pattern: /^(ImagePreview|ImagePreviewGroup)$/,
482
- componentDir: "image"
483
- },
484
- {
485
- pattern: /^(InputGroup|InputSearch|InputPassword)$/,
486
- componentDir: "input"
487
- },
488
- {
489
- pattern: /^(LayoutHeader|LayoutContent|LayoutFooter|LayoutSider)$/,
490
- componentDir: "layout"
491
- },
492
- {
493
- pattern: /^(ListItem|ListItemMeta)$/,
494
- componentDir: "list"
495
- },
496
- {
497
- pattern: /^(MenuItem|MenuItemGroup|SubMenu)$/,
498
- componentDir: "menu"
499
- },
500
- {
501
- pattern: /^RadioGroup$/,
502
- componentDir: "radio"
503
- },
504
- {
505
- pattern: /^(Option|Optgroup)$/,
506
- componentDir: "select"
507
- },
508
- {
509
- pattern: /^(SkeletonLine|SkeletonShape)$/,
510
- componentDir: "skeleton"
511
- },
512
- {
513
- pattern: /^Countdown$/,
514
- componentDir: "statistic"
515
- },
516
- {
517
- pattern: /^Step$/,
518
- componentDir: "steps"
519
- },
520
- {
521
- pattern: /^(Thead|Td|Th|Tr|Tbody|TableColumn)$/,
522
- componentDir: "table"
523
- },
524
- {
525
- pattern: /^TagGroup$/,
526
- componentDir: "tag"
527
- },
528
- {
529
- pattern: /^TabPane$/,
530
- componentDir: "tabs"
531
- },
532
- {
533
- pattern: /^TimelineItem$/,
534
- componentDir: "timeline"
535
- },
536
- {
537
- pattern: /^(TypographyParagraph|TypographyTitle|TypographyText)$/,
538
- componentDir: "typography"
539
- }
540
- ];
541
- function getComponentStyleDir(importName, importStyle) {
542
- if (["ConfigProvider", "Icon"].includes(importName)) return void 0;
543
- let componentDir = require_utils.kebabCase(importName);
544
- for (const item of matchComponents$2) if (item.pattern.test(importName)) {
545
- componentDir = item.componentDir;
546
- break;
547
- }
548
- if (importStyle === "less") return `@arco-design/web-vue/es/${componentDir}/style/index.js`;
549
- if (importStyle === "css" || importStyle) return `@arco-design/web-vue/es/${componentDir}/style/css.js`;
550
- }
551
- function canResolveIcons(options) {
552
- if (options === void 0) return false;
553
- if (typeof options === "boolean") return options;
554
- else return options.enable;
555
- }
556
- function getResolveIconPrefix(options) {
557
- if (canResolveIcons(options)) if (typeof options === "boolean" && options) return "";
558
- else if (options.enable) return options.iconPrefix ?? "";
559
- else return "";
560
- return "";
561
- }
562
- /**
563
- * Resolver for Arco Design Vue
564
- *
565
- * Requires arco-design/web-vue@2.11.0 or later
566
- *
567
- * @author @flsion
568
- * @link https://arco.design/ for arco-design
569
- *
570
- */
571
- function ArcoResolver(options = {}) {
572
- return {
573
- type: "component",
574
- resolve: (name) => {
575
- if (canResolveIcons(options.resolveIcons)) {
576
- const iconPrefix = require_utils.pascalCase(getResolveIconPrefix(options.resolveIcons));
577
- if ((/* @__PURE__ */ new RegExp(`^${iconPrefix}Icon`)).test(name)) {
578
- debug$1("found icon component name %s", name);
579
- const rawComponentName = name.slice(iconPrefix.length);
580
- debug$1("found icon component raw name %s", rawComponentName);
581
- return {
582
- name: rawComponentName,
583
- as: name,
584
- from: "@arco-design/web-vue/es/icon"
585
- };
586
- }
587
- }
588
- if (name.match(/^A[A-Z]/) && !require_utils.isExclude(name, options.exclude)) {
589
- const importStyle = options.importStyle ?? "css";
590
- const importName = name.slice(1);
591
- const config = {
592
- name: importName,
593
- from: "@arco-design/web-vue"
594
- };
595
- if (options.sideEffect !== false) config.sideEffects = getComponentStyleDir(importName, importStyle);
596
- return config;
597
- }
598
- }
599
- };
600
- }
601
-
602
- //#endregion
603
- //#region src/core/resolvers/bootstrap-vue.ts
604
- const COMPONENT_ALIASES = {
605
- BBtn: "BButton",
606
- BBtnClose: "BButtonClose",
607
- BBtnGroup: "BButtonGroup",
608
- BBtnToolbar: "BButtonToolbar",
609
- BCheck: "BFormCheckbox",
610
- BCheckbox: "BFormCheckbox",
611
- BCheckboxGroup: "BFormCheckboxGroup",
612
- BCheckGroup: "BFormCheckboxGroup",
613
- BDatalist: "BFormDatalist",
614
- BDatepicker: "BFormDatepicker",
615
- BDd: "BDropdown",
616
- BDdDivider: "BDropdownDivider",
617
- BDdForm: "BDropdownForm",
618
- BDdGroup: "BDropdownGroup",
619
- BDdHeader: "BDropdownHeader",
620
- BDdItem: "BDropdownItem",
621
- BDdItemBtn: "BDropdownItemButton",
622
- BDdItemButton: "BDropdownItemButton",
623
- BDdText: "BDropdownText",
624
- BDropdownItemBtn: "BDropdownItemButton",
625
- BFile: "BFormFile",
626
- BInput: "BFormInput",
627
- BNavDd: "BNavItemDropdown",
628
- BNavDropdown: "BNavItemDropdown",
629
- BNavItemDd: "BNavItemDropdown",
630
- BNavToggle: "BNavbarToggle",
631
- BRadio: "BFormRadio",
632
- BRadioGroup: "BFormRadioGroup",
633
- BRating: "BFormRating",
634
- BSelect: "BFormSelect",
635
- BSelectOption: "BFormSelectOption",
636
- BSelectOptionGroup: "BFormSelectOptionGroup",
637
- BSpinbutton: "BFormSpinbutton",
638
- BTag: "BFormTag",
639
- BTags: "BFormTags",
640
- BTextarea: "BFormTextarea",
641
- BTimepicker: "BFormTimepicker"
642
- };
643
- /**
644
- * Resolver for BootstrapVue
645
- *
646
- * @link https://github.com/bootstrap-vue/bootstrap-vue
647
- */
648
- function BootstrapVueResolver(_options = {}) {
649
- const options = {
650
- directives: true,
651
- ..._options
652
- };
653
- const resolvers = [{
654
- type: "component",
655
- resolve: (name) => {
656
- if (name.match(/^B[A-Z]/)) return {
657
- name: COMPONENT_ALIASES[name] || name,
658
- from: "bootstrap-vue"
659
- };
660
- }
661
- }];
662
- if (options.directives) resolvers.push({
663
- type: "directive",
664
- resolve: (name) => {
665
- if (name.match(/^B[A-Z]/)) return {
666
- name: `V${name}`,
667
- from: "bootstrap-vue"
668
- };
669
- }
670
- });
671
- return resolvers;
672
- }
673
- /**
674
- * Resolver for BootstrapVueNext
675
- *
676
- * @link https://github.com/bootstrap-vue/bootstrap-vue-next
677
- *
678
- * @deprecated use `import { BootstrapVueNextResolver } from 'bootstrap-vue-next'` instead
679
- */
680
- function BootstrapVueNextResolver(_options = {}) {
681
- const options = {
682
- directives: true,
683
- ..._options
684
- };
685
- const resolvers = [{
686
- type: "component",
687
- resolve: (name) => {
688
- if (name.match(/^B[A-Z]/)) return {
689
- name,
690
- from: "bootstrap-vue-next"
691
- };
692
- }
693
- }];
694
- if (options.directives) resolvers.push({
695
- type: "directive",
696
- resolve: (name) => {
697
- if (name.match(/^B[A-Z]/)) return {
698
- name: `v${name}`,
699
- from: "bootstrap-vue-next"
700
- };
701
- }
702
- });
703
- return resolvers;
704
- }
705
- /**
706
- * Resolver for legacy BootstrapVue3 apps
707
- *
708
- * @deprecated use BootstrapVueNextResolver with https://github.com/bootstrap-vue/bootstrap-vue-next
709
- * @link https://www.npmjs.com/package/bootstrap-vue-3
710
- */
711
- function BootstrapVue3Resolver(_options = {}) {
712
- const options = {
713
- directives: true,
714
- ..._options
715
- };
716
- const resolvers = [{
717
- type: "component",
718
- resolve: (name) => {
719
- if (name.match(/^B[A-Z]/)) return {
720
- name,
721
- from: "bootstrap-vue-3"
722
- };
723
- }
724
- }];
725
- if (options.directives) resolvers.push({
726
- type: "directive",
727
- resolve: (name) => {
728
- if (name.match(/^B[A-Z]/)) return {
729
- name: `V${name}`,
730
- from: "bootstrap-vue-3"
731
- };
732
- }
733
- });
734
- return resolvers;
735
- }
736
-
737
- //#endregion
738
- //#region src/core/resolvers/devui.ts
739
- const LIB_NAME = "vue-devui";
740
- const HARMLESS = ["ripple"];
741
- function resolveDirectory(name, filename) {
742
- return `${LIB_NAME}/${name}/${filename}`;
743
- }
744
- function getSideEffects$7(name, filename) {
745
- if (HARMLESS.includes(name)) return;
746
- if (["row", "col"].includes(name)) return resolveDirectory("grid", filename);
747
- if ([
748
- "aside",
749
- "content",
750
- "footer",
751
- "header",
752
- "layout"
753
- ].includes(name)) return resolveDirectory("layout", filename);
754
- if ([
755
- "overlay",
756
- "fixed-overlay",
757
- "flexible-overlay"
758
- ].includes(name)) return resolveDirectory("overlay", filename);
759
- if ([
760
- "panel",
761
- "panel-header",
762
- "panel-body"
763
- ].includes(name)) return resolveDirectory("panel", filename);
764
- if ([
765
- "menu",
766
- "menu-item",
767
- "sub-menu"
768
- ].includes(name)) return resolveDirectory("menu", filename);
769
- if (["tabs", "tab"].includes(name)) return resolveDirectory("tabs", filename);
770
- if (["form", "form-item"].includes(name)) return resolveDirectory("form", filename);
771
- if (["collapse", "collapse-item"].includes(name)) return resolveDirectory("collapse", filename);
772
- if (["steps", "step"].includes(name)) return resolveDirectory("steps", filename);
773
- if ([
774
- "radio",
775
- "radio-group",
776
- "radio-button"
777
- ].includes(name)) return resolveDirectory("radio", filename);
778
- if (["column"].includes(name)) return resolveDirectory("table", filename);
779
- if (["timeline-item"].includes(name)) return resolveDirectory("timeline", filename);
780
- if (["splitter-pane"].includes(name)) return resolveDirectory("splitter", filename);
781
- return resolveDirectory(name, filename);
782
- }
783
- function componentsResolver(name, { ssr }) {
784
- if (!name.match(/^D[A-Z]/)) return;
785
- const resolveId = require_utils.kebabCase(name = name.slice(1));
786
- return {
787
- name,
788
- sideEffects: getSideEffects$7(resolveId, "style.css"),
789
- from: getSideEffects$7(resolveId, `index.${ssr ? "umd" : "es"}.js`)
790
- };
791
- }
792
- function directivesResolver(name, { ssr }) {
793
- const resolveId = require_utils.kebabCase(name);
794
- return {
795
- name: `${name}Directive`,
796
- sideEffects: getSideEffects$7(resolveId, "style.css"),
797
- from: resolveDirectory(resolveId, `index.${ssr ? "umd" : "es"}.js`)
798
- };
799
- }
800
- function DevUiResolver(options = {}) {
801
- const config = {
802
- directives: true,
803
- importStyle: true,
804
- ssr: false,
805
- ...options
806
- };
807
- const resolvers = [{
808
- type: "component",
809
- resolve: (name) => componentsResolver(name, config)
810
- }];
811
- if (config.directives) resolvers.push({
812
- type: "directive",
813
- resolve: (name) => directivesResolver(name, config)
814
- });
815
- return resolvers;
816
- }
817
-
818
- //#endregion
819
- //#region node_modules/.pnpm/compare-versions@6.1.1/node_modules/compare-versions/lib/umd/index.js
820
- var require_umd = /* @__PURE__ */ require_utils.__commonJS({ "node_modules/.pnpm/compare-versions@6.1.1/node_modules/compare-versions/lib/umd/index.js": ((exports, module) => {
821
- (function(global, factory) {
822
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.compareVersions = {}));
823
- })(exports, (function(exports$1) {
824
- const semver = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
825
- const validateAndParse = (version) => {
826
- if (typeof version !== "string") throw new TypeError("Invalid argument expected string");
827
- const match = version.match(semver);
828
- if (!match) throw new Error(`Invalid argument not valid semver ('${version}' received)`);
829
- match.shift();
830
- return match;
831
- };
832
- const isWildcard = (s) => s === "*" || s === "x" || s === "X";
833
- const tryParse = (v) => {
834
- const n = parseInt(v, 10);
835
- return isNaN(n) ? v : n;
836
- };
837
- const forceType = (a, b) => typeof a !== typeof b ? [String(a), String(b)] : [a, b];
838
- const compareStrings = (a, b) => {
839
- if (isWildcard(a) || isWildcard(b)) return 0;
840
- const [ap, bp] = forceType(tryParse(a), tryParse(b));
841
- if (ap > bp) return 1;
842
- if (ap < bp) return -1;
843
- return 0;
844
- };
845
- const compareSegments = (a, b) => {
846
- for (let i = 0; i < Math.max(a.length, b.length); i++) {
847
- const r = compareStrings(a[i] || "0", b[i] || "0");
848
- if (r !== 0) return r;
849
- }
850
- return 0;
851
- };
852
- /**
853
- * Compare [semver](https://semver.org/) version strings to find greater, equal or lesser.
854
- * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`.
855
- * @param v1 - First version to compare
856
- * @param v2 - Second version to compare
857
- * @returns Numeric value compatible with the [Array.sort(fn) interface](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Parameters).
858
- */
859
- const compareVersions = (v1, v2) => {
860
- const n1 = validateAndParse(v1);
861
- const n2 = validateAndParse(v2);
862
- const p1 = n1.pop();
863
- const p2 = n2.pop();
864
- const r = compareSegments(n1, n2);
865
- if (r !== 0) return r;
866
- if (p1 && p2) return compareSegments(p1.split("."), p2.split("."));
867
- else if (p1 || p2) return p1 ? -1 : 1;
868
- return 0;
869
- };
870
- /**
871
- * Compare [semver](https://semver.org/) version strings using the specified operator.
872
- *
873
- * @param v1 First version to compare
874
- * @param v2 Second version to compare
875
- * @param operator Allowed arithmetic operator to use
876
- * @returns `true` if the comparison between the firstVersion and the secondVersion satisfies the operator, `false` otherwise.
877
- *
878
- * @example
879
- * ```
880
- * compare('10.1.8', '10.0.4', '>'); // return true
881
- * compare('10.0.1', '10.0.1', '='); // return true
882
- * compare('10.1.1', '10.2.2', '<'); // return true
883
- * compare('10.1.1', '10.2.2', '<='); // return true
884
- * compare('10.1.1', '10.2.2', '>='); // return false
885
- * ```
886
- */
887
- const compare$2 = (v1, v2, operator) => {
888
- assertValidOperator(operator);
889
- const res = compareVersions(v1, v2);
890
- return operatorResMap[operator].includes(res);
891
- };
892
- const operatorResMap = {
893
- ">": [1],
894
- ">=": [0, 1],
895
- "=": [0],
896
- "<=": [-1, 0],
897
- "<": [-1],
898
- "!=": [-1, 1]
899
- };
900
- const allowedOperators = Object.keys(operatorResMap);
901
- const assertValidOperator = (op) => {
902
- if (typeof op !== "string") throw new TypeError(`Invalid operator type, expected string but got ${typeof op}`);
903
- if (allowedOperators.indexOf(op) === -1) throw new Error(`Invalid operator, expected one of ${allowedOperators.join("|")}`);
904
- };
905
- /**
906
- * Match [npm semver](https://docs.npmjs.com/cli/v6/using-npm/semver) version range.
907
- *
908
- * @param version Version number to match
909
- * @param range Range pattern for version
910
- * @returns `true` if the version number is within the range, `false` otherwise.
911
- *
912
- * @example
913
- * ```
914
- * satisfies('1.1.0', '^1.0.0'); // return true
915
- * satisfies('1.1.0', '~1.0.0'); // return false
916
- * ```
917
- */
918
- const satisfies = (version, range) => {
919
- range = range.replace(/([><=]+)\s+/g, "$1");
920
- if (range.includes("||")) return range.split("||").some((r$1) => satisfies(version, r$1));
921
- else if (range.includes(" - ")) {
922
- const [a, b] = range.split(" - ", 2);
923
- return satisfies(version, `>=${a} <=${b}`);
924
- } else if (range.includes(" ")) return range.trim().replace(/\s{2,}/g, " ").split(" ").every((r$1) => satisfies(version, r$1));
925
- const m = range.match(/^([<>=~^]+)/);
926
- const op = m ? m[1] : "=";
927
- if (op !== "^" && op !== "~") return compare$2(version, range, op);
928
- const [v1, v2, v3, , vp] = validateAndParse(version);
929
- const [r1, r2, r3, , rp] = validateAndParse(range);
930
- const v = [
931
- v1,
932
- v2,
933
- v3
934
- ];
935
- const r = [
936
- r1,
937
- r2 !== null && r2 !== void 0 ? r2 : "x",
938
- r3 !== null && r3 !== void 0 ? r3 : "x"
939
- ];
940
- if (rp) {
941
- if (!vp) return false;
942
- if (compareSegments(v, r) !== 0) return false;
943
- if (compareSegments(vp.split("."), rp.split(".")) === -1) return false;
944
- }
945
- const nonZero = r.findIndex((v$1) => v$1 !== "0") + 1;
946
- const i = op === "~" ? 2 : nonZero > 1 ? nonZero : 1;
947
- if (compareSegments(v.slice(0, i), r.slice(0, i)) !== 0) return false;
948
- if (compareSegments(v.slice(i), r.slice(i)) === -1) return false;
949
- return true;
950
- };
951
- /**
952
- * Validate [semver](https://semver.org/) version strings.
953
- *
954
- * @param version Version number to validate
955
- * @returns `true` if the version number is a valid semver version number, `false` otherwise.
956
- *
957
- * @example
958
- * ```
959
- * validate('1.0.0-rc.1'); // return true
960
- * validate('1.0-rc.1'); // return false
961
- * validate('foo'); // return false
962
- * ```
963
- */
964
- const validate = (version) => typeof version === "string" && /^[v\d]/.test(version) && semver.test(version);
965
- /**
966
- * Validate [semver](https://semver.org/) version strings strictly. Will not accept wildcards and version ranges.
967
- *
968
- * @param version Version number to validate
969
- * @returns `true` if the version number is a valid semver version number `false` otherwise
970
- *
971
- * @example
972
- * ```
973
- * validate('1.0.0-rc.1'); // return true
974
- * validate('1.0-rc.1'); // return false
975
- * validate('foo'); // return false
976
- * ```
977
- */
978
- const validateStrict = (version) => typeof version === "string" && /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/.test(version);
979
- exports$1.compare = compare$2;
980
- exports$1.compareVersions = compareVersions;
981
- exports$1.satisfies = satisfies;
982
- exports$1.validate = validate;
983
- exports$1.validateStrict = validateStrict;
984
- }));
985
- }) });
986
-
987
- //#endregion
988
- //#region src/core/resolvers/element-plus.ts
989
- var import_umd$1 = /* @__PURE__ */ require_utils.__toESM(require_umd(), 1);
990
- /**
991
- * @deprecated
992
- * @param partialName
993
- * @param options
994
- */
995
- function getSideEffectsLegacy(partialName, options) {
996
- const { importStyle } = options;
997
- if (!importStyle) return;
998
- if (importStyle === "sass") return ["element-plus/packages/theme-chalk/src/base.scss", `element-plus/packages/theme-chalk/src/${partialName}.scss`];
999
- else if (importStyle === true || importStyle === "css") return ["element-plus/lib/theme-chalk/base.css", `element-plus/lib/theme-chalk/el-${partialName}.css`];
1000
- }
1001
- function getSideEffects$6(dirName, options) {
1002
- const { importStyle, ssr, nightly } = options;
1003
- const themeFolder = nightly ? "@element-plus/nightly/theme-chalk" : "element-plus/theme-chalk";
1004
- const esComponentsFolder = nightly ? "@element-plus/nightly/es/components" : "element-plus/es/components";
1005
- if (importStyle === "sass") return ssr ? [`${themeFolder}/src/base.scss`, `${themeFolder}/src/${dirName}.scss`] : [`${esComponentsFolder}/base/style/index`, `${esComponentsFolder}/${dirName}/style/index`];
1006
- else if (importStyle === true || importStyle === "css") return ssr ? [`${themeFolder}/base.css`, `${themeFolder}/el-${dirName}.css`] : [`${esComponentsFolder}/base/style/css`, `${esComponentsFolder}/${dirName}/style/css`];
1007
- }
1008
- function resolveComponent$1(name, options) {
1009
- if (options.exclude && name.match(options.exclude)) return;
1010
- if (!name.match(/^El[A-Z]/)) return;
1011
- if (name.match(/^ElIcon.+/)) return {
1012
- name: name.replace(/^ElIcon/, ""),
1013
- from: "@element-plus/icons-vue"
1014
- };
1015
- const partialName = require_utils.kebabCase(name.slice(2));
1016
- const { version, ssr, nightly } = options;
1017
- if ((0, import_umd$1.compare)(version, "1.1.0-beta.1", ">=") || nightly) return {
1018
- name,
1019
- from: `${nightly ? "@element-plus/nightly" : "element-plus"}/${ssr ? "lib" : "es"}`,
1020
- sideEffects: getSideEffects$6(partialName, options)
1021
- };
1022
- else if ((0, import_umd$1.compare)(version, "1.0.2-beta.28", ">=")) return {
1023
- from: `element-plus/es/el-${partialName}`,
1024
- sideEffects: getSideEffectsLegacy(partialName, options)
1025
- };
1026
- else return {
1027
- from: `element-plus/lib/el-${partialName}`,
1028
- sideEffects: getSideEffectsLegacy(partialName, options)
1029
- };
1030
- }
1031
- function resolveDirective(name, options) {
1032
- if (!options.directives) return;
1033
- const directive = {
1034
- Loading: {
1035
- importName: "ElLoadingDirective",
1036
- styleName: "loading"
1037
- },
1038
- Popover: {
1039
- importName: "ElPopoverDirective",
1040
- styleName: "popover"
1041
- },
1042
- InfiniteScroll: {
1043
- importName: "ElInfiniteScroll",
1044
- styleName: "infinite-scroll"
1045
- }
1046
- }[name];
1047
- if (!directive) return;
1048
- const { version, ssr, nightly } = options;
1049
- if ((0, import_umd$1.compare)(version, "1.1.0-beta.1", ">=") || nightly) return {
1050
- name: directive.importName,
1051
- from: `${nightly ? "@element-plus/nightly" : "element-plus"}/${ssr ? "lib" : "es"}`,
1052
- sideEffects: getSideEffects$6(directive.styleName, options)
1053
- };
1054
- }
1055
- const noStylesComponents = ["ElAutoResizer"];
1056
- /**
1057
- * Resolver for Element Plus
1058
- *
1059
- * See https://github.com/antfu/vite-plugin-components/pull/28 for more details
1060
- * See https://github.com/antfu/vite-plugin-components/issues/117 for more details
1061
- *
1062
- * @author @develar @nabaonan @sxzz
1063
- * @link https://element-plus.org/ for element-plus
1064
- *
1065
- */
1066
- function ElementPlusResolver(options = {}) {
1067
- let optionsResolved;
1068
- async function resolveOptions() {
1069
- if (optionsResolved) return optionsResolved;
1070
- optionsResolved = {
1071
- ssr: false,
1072
- version: await require_utils.getPkgVersion("element-plus", "2.2.2"),
1073
- importStyle: "css",
1074
- directives: true,
1075
- exclude: void 0,
1076
- noStylesComponents: options.noStylesComponents || [],
1077
- nightly: false,
1078
- ...options
1079
- };
1080
- return optionsResolved;
1081
- }
1082
- return [{
1083
- type: "component",
1084
- resolve: async (name) => {
1085
- const options$1 = await resolveOptions();
1086
- if ([...options$1.noStylesComponents, ...noStylesComponents].includes(name)) return resolveComponent$1(name, {
1087
- ...options$1,
1088
- importStyle: false
1089
- });
1090
- else return resolveComponent$1(name, options$1);
1091
- }
1092
- }, {
1093
- type: "directive",
1094
- resolve: async (name) => {
1095
- return resolveDirective(name, await resolveOptions());
1096
- }
1097
- }];
1098
- }
1099
-
1100
- //#endregion
1101
- //#region src/core/resolvers/element-ui.ts
1102
- function getSideEffects$5(partialName, options) {
1103
- const { importStyle = "css" } = options;
1104
- if (!importStyle) return;
1105
- if (importStyle === "sass") return ["element-ui/packages/theme-chalk/src/base.scss", `element-ui/packages/theme-chalk/src/${partialName}.scss`];
1106
- else return ["element-ui/lib/theme-chalk/base.css", `element-ui/lib/theme-chalk/${partialName}.css`];
1107
- }
1108
- /**
1109
- * Resolver for Element-UI
1110
- * @link https://element.eleme.cn/#/zh-CN
1111
- * @version @element-ui ^2.15.3, @vue ^2.6.14
1112
- * @author @nabaonan
1113
- */
1114
- function ElementUiResolver(options = {}) {
1115
- return {
1116
- type: "component",
1117
- resolve: (name) => {
1118
- if (options.exclude && name.match(options.exclude)) return;
1119
- if (/^El[A-Z]/.test(name)) {
1120
- const partialName = require_utils.kebabCase(name.slice(2));
1121
- if (partialName === "collapse-transition") return { from: `element-ui/lib/transitions/${partialName}` };
1122
- return {
1123
- from: `element-ui/lib/${partialName}`,
1124
- sideEffects: getSideEffects$5(partialName, options)
1125
- };
1126
- }
1127
- }
1128
- };
1129
- }
1130
-
1131
- //#endregion
1132
- //#region src/core/resolvers/headless-ui.ts
1133
- const components$3 = [
1134
- "Combobox",
1135
- "ComboboxButton",
1136
- "ComboboxInput",
1137
- "ComboboxLabel",
1138
- "ComboboxOption",
1139
- "ComboboxOptions",
1140
- "Dialog",
1141
- "DialogDescription",
1142
- "DialogOverlay",
1143
- "DialogPanel",
1144
- "DialogTitle",
1145
- "Disclosure",
1146
- "DisclosureButton",
1147
- "DisclosurePanel",
1148
- "FocusTrap",
1149
- "Listbox",
1150
- "ListboxButton",
1151
- "ListboxLabel",
1152
- "ListboxOption",
1153
- "ListboxOptions",
1154
- "Menu",
1155
- "MenuButton",
1156
- "MenuItem",
1157
- "MenuItems",
1158
- "Popover",
1159
- "PopoverButton",
1160
- "PopoverGroup",
1161
- "PopoverOverlay",
1162
- "PopoverPanel",
1163
- "Portal",
1164
- "PortalGroup",
1165
- "RadioGroup",
1166
- "RadioGroupDescription",
1167
- "RadioGroupLabel",
1168
- "RadioGroupOption",
1169
- "Switch",
1170
- "SwitchDescription",
1171
- "SwitchGroup",
1172
- "SwitchLabel",
1173
- "Tab",
1174
- "TabGroup",
1175
- "TabList",
1176
- "TabPanel",
1177
- "TabPanels",
1178
- "TransitionChild",
1179
- "TransitionRoot"
1180
- ];
1181
- /**
1182
- * Resolver for headlessui
1183
- *
1184
- * @link https://github.com/tailwindlabs/headlessui
1185
- */
1186
- function HeadlessUiResolver(options = {}) {
1187
- const { prefix = "" } = options;
1188
- return {
1189
- type: "component",
1190
- resolve: (name) => {
1191
- if (name.startsWith(prefix)) {
1192
- const componentName = name.substring(prefix.length);
1193
- if (components$3.includes(componentName)) return {
1194
- name: componentName,
1195
- from: "@headlessui/vue"
1196
- };
1197
- }
1198
- }
1199
- };
1200
- }
1201
-
1202
- //#endregion
1203
- //#region src/core/resolvers/idux.ts
1204
- var import_umd = /* @__PURE__ */ require_utils.__toESM(require_umd(), 1);
1205
- const specialComponents = {
1206
- CdkClickOutside: "click-outside",
1207
- CdkDraggable: "drag-drop",
1208
- CdkResizable: "resize",
1209
- CdkResizableHandle: "resize",
1210
- CdkResizeObserver: "resize",
1211
- CdkVirtualScroll: "scroll",
1212
- IxAutoComplete: "auto-complete",
1213
- IxBackTop: "back-top",
1214
- IxCol: "grid",
1215
- IxDatePicker: "date-picker",
1216
- IxDateRangePicker: "date-picker",
1217
- IxInputNumber: "input-number",
1218
- IxLoadingBar: "loading-bar",
1219
- IxLoadingBarProvider: "loading-bar",
1220
- IxRow: "grid",
1221
- IxTab: "tabs",
1222
- IxTimePicker: "time-picker",
1223
- IxTimeRangePicker: "time-picker",
1224
- IxTreeSelect: "tree-select"
1225
- };
1226
- /**
1227
- * Resolver for `@idux/cdk`, `@idux/components` and ``@idux/pro``
1228
- *
1229
- * @link https://idux.site
1230
- */
1231
- function IduxResolver(options = {}) {
1232
- return {
1233
- type: "component",
1234
- resolve: async (name) => {
1235
- const { importStyle, importStyleTheme, exclude = [], scope = "@idux" } = options;
1236
- if (exclude.includes(name)) return;
1237
- const packageName = getPackageName(name);
1238
- if (!packageName) return;
1239
- const resolvedVersion = await require_utils.getPkgVersion(`${scope}/${packageName}`, "2.0.0");
1240
- let dirname = specialComponents[name];
1241
- if (!dirname) {
1242
- const nameIndex = packageName === "pro" ? 2 : 1;
1243
- dirname = require_utils.kebabCase(name).split("-")[nameIndex];
1244
- }
1245
- const path = `${scope}/${packageName}/${dirname}`;
1246
- return {
1247
- name,
1248
- from: path,
1249
- sideEffects: packageName === "cdk" ? void 0 : getSideEffects$4(resolvedVersion, path, importStyle, importStyleTheme)
1250
- };
1251
- }
1252
- };
1253
- }
1254
- function getPackageName(name) {
1255
- let packageName;
1256
- if (name.match(/^Cdk[A-Z]/)) packageName = "cdk";
1257
- else if (name.match(/^IxPro[A-Z]/)) packageName = "pro";
1258
- else if (name.match(/^Ix[A-Z]/)) packageName = "components";
1259
- return packageName;
1260
- }
1261
- function getSideEffects$4(version, path, importStyle, importStyleTheme) {
1262
- if (!importStyle) return;
1263
- if ((0, import_umd.compare)(version, "2.0.0-beta.0", "<")) return getLegacySideEffects(path, importStyle, importStyleTheme);
1264
- const styleRoot = `${path}/style`;
1265
- const themeRoot = `${path}/theme`;
1266
- const styleImport = `${styleRoot}/${importStyle === "css" ? "index_css" : "index"}`;
1267
- if (!(0, local_pkg.resolveModule)(styleImport)) return;
1268
- const themeImport = `${themeRoot}/${importStyleTheme}.css`;
1269
- if (!importStyleTheme || !(0, local_pkg.resolveModule)(themeImport)) return styleImport;
1270
- return [styleImport, `${themeRoot}/${importStyleTheme}`];
1271
- }
1272
- function getLegacySideEffects(path, importStyle, importStyleTheme = "default") {
1273
- const styleImport = `${path}/style/themes/${importStyle === "css" ? `${importStyleTheme}_css` : importStyleTheme}`;
1274
- if (!(0, local_pkg.resolveModule)(styleImport)) return;
1275
- return styleImport;
1276
- }
1277
-
1278
- //#endregion
1279
- //#region src/core/resolvers/inkline.ts
1280
- /**
1281
- * Resolver for Inkline
1282
- *
1283
- * @author @alexgrozav
1284
- * @link https://github.com/inkline/inkline
1285
- */
1286
- function InklineResolver() {
1287
- return {
1288
- type: "component",
1289
- resolve: (name) => {
1290
- if (name.match(/^I[A-Z]/)) return {
1291
- name,
1292
- from: "@inkline/inkline"
1293
- };
1294
- }
1295
- };
1296
- }
1297
-
1298
- //#endregion
1299
- //#region src/core/resolvers/ionic.ts
1300
- /**
1301
- * source: https://github.com/nuxt-modules/ionic/blob/main/src/imports.ts
1302
- * @author @danielroe
1303
- */
1304
- const IonicBuiltInComponents = [
1305
- "IonAccordion",
1306
- "IonAccordionGroup",
1307
- "IonActionSheet",
1308
- "IonAlert",
1309
- "IonApp",
1310
- "IonAvatar",
1311
- "IonBackButton",
1312
- "IonBackdrop",
1313
- "IonBadge",
1314
- "IonBreadcrumb",
1315
- "IonBreadcrumbs",
1316
- "IonButton",
1317
- "IonButtons",
1318
- "IonCard",
1319
- "IonCardContent",
1320
- "IonCardHeader",
1321
- "IonCardSubtitle",
1322
- "IonCardTitle",
1323
- "IonCheckbox",
1324
- "IonChip",
1325
- "IonCol",
1326
- "IonContent",
1327
- "IonDatetime",
1328
- "IonDatetimeButton",
1329
- "IonFab",
1330
- "IonFabButton",
1331
- "IonFabList",
1332
- "IonFooter",
1333
- "IonGrid",
1334
- "IonHeader",
1335
- "IonIcon",
1336
- "IonImg",
1337
- "IonInfiniteScroll",
1338
- "IonInfiniteScrollContent",
1339
- "IonInput",
1340
- "IonInputOtp",
1341
- "IonInputPasswordToggle",
1342
- "IonItem",
1343
- "IonItemDivider",
1344
- "IonItemGroup",
1345
- "IonItemOption",
1346
- "IonItemOptions",
1347
- "IonItemSliding",
1348
- "IonLabel",
1349
- "IonList",
1350
- "IonListHeader",
1351
- "IonLoading",
1352
- "IonMenu",
1353
- "IonMenuButton",
1354
- "IonMenuToggle",
1355
- "IonModal",
1356
- "IonNav",
1357
- "IonNavLink",
1358
- "IonNote",
1359
- "IonPage",
1360
- "IonPicker",
1361
- "IonPickerColumn",
1362
- "IonPickerColumnOption",
1363
- "IonPickerLegacy",
1364
- "IonPopover",
1365
- "IonProgressBar",
1366
- "IonRadio",
1367
- "IonRadioGroup",
1368
- "IonRange",
1369
- "IonRefresher",
1370
- "IonRefresherContent",
1371
- "IonReorder",
1372
- "IonReorderGroup",
1373
- "IonRippleEffect",
1374
- "IonRouterOutlet",
1375
- "IonRow",
1376
- "IonSearchbar",
1377
- "IonSegment",
1378
- "IonSegmentButton",
1379
- "IonSegmentContent",
1380
- "IonSegmentView",
1381
- "IonSelect",
1382
- "IonSelectModal",
1383
- "IonSelectOption",
1384
- "IonSkeletonText",
1385
- "IonSpinner",
1386
- "IonSplitPane",
1387
- "IonTab",
1388
- "IonTabBar",
1389
- "IonTabButton",
1390
- "IonTabs",
1391
- "IonText",
1392
- "IonTextarea",
1393
- "IonThumbnail",
1394
- "IonTitle",
1395
- "IonToast",
1396
- "IonToggle",
1397
- "IonToolbar"
1398
- ];
1399
- /**
1400
- * Resolver for ionic framework
1401
- *
1402
- * @author @mathsgod @reslear
1403
- * @link https://ionicframework.com/
1404
- */
1405
- function IonicResolver() {
1406
- return {
1407
- type: "component",
1408
- resolve: (name) => {
1409
- if (IonicBuiltInComponents.includes(name)) return {
1410
- name,
1411
- from: "@ionic/vue"
1412
- };
1413
- }
1414
- };
1415
- }
1416
-
1417
- //#endregion
1418
- //#region src/core/resolvers/layui-vue.ts
1419
- const matchComponents$1 = [
1420
- {
1421
- pattern: /^LayAvatarList$/,
1422
- styleDir: "avatar"
1423
- },
1424
- {
1425
- pattern: /^LayBreadcrumbItem$/,
1426
- styleDir: "breadcrumb"
1427
- },
1428
- {
1429
- pattern: /^(LayCarouselItem)$/,
1430
- styleDir: "carousel"
1431
- },
1432
- {
1433
- pattern: /^(LayCheckboxGroup)$/,
1434
- styleDir: "checkbox"
1435
- },
1436
- {
1437
- pattern: /^LayCol$/,
1438
- styleDir: "row"
1439
- },
1440
- {
1441
- pattern: /^(LayCollapseItem)$/,
1442
- styleDir: "collapse"
1443
- },
1444
- {
1445
- pattern: /^LayConfigProvider$/,
1446
- styleDir: void 0
1447
- },
1448
- {
1449
- pattern: /^LayCountUp$/,
1450
- styleDir: void 0
1451
- },
1452
- {
1453
- pattern: /^(LayDropdownMenu|LayDropdownMenuItem|LayDropdownSubMenu)$/,
1454
- styleDir: "dropdown"
1455
- },
1456
- {
1457
- pattern: /^(LayFormItem)$/,
1458
- styleDir: "form"
1459
- },
1460
- {
1461
- pattern: /^(LayMenuItem|LaySubMenu)$/,
1462
- styleDir: "menu"
1463
- },
1464
- {
1465
- pattern: /^(LayRadioGroup)$/,
1466
- styleDir: "radio"
1467
- },
1468
- {
1469
- pattern: /^LaySelectOption$/,
1470
- styleDir: "select"
1471
- },
1472
- {
1473
- pattern: /^LaySkeletonItem$/,
1474
- styleDir: "skeleton"
1475
- },
1476
- {
1477
- pattern: /^LaySplitPanelItem$/,
1478
- styleDir: "splitPanel"
1479
- },
1480
- {
1481
- pattern: /^LayStepItem$/,
1482
- styleDir: "step"
1483
- },
1484
- {
1485
- pattern: /^(LayTabItem)$/,
1486
- styleDir: "tab"
1487
- },
1488
- {
1489
- pattern: /^LayTimelineItem$/,
1490
- styleDir: "timeline"
1491
- }
1492
- ];
1493
- const layuiRE = /^Lay[A-Z]/;
1494
- const layerRE = /^(layer|LayLayer)$/;
1495
- const iconsRE = /^[A-Z]\w+Icon$/;
1496
- let libName = "@layui/layui-vue";
1497
- function lowerCamelCase(str) {
1498
- return str.charAt(0).toLowerCase() + str.slice(1);
1499
- }
1500
- function getSideEffects$3(importName, options) {
1501
- const { importStyle = "css" } = options;
1502
- if (!importStyle) return void 0;
1503
- if (libName !== "@layui/layui-vue") return `${libName}/lib/index.css`;
1504
- let styleDir = lowerCamelCase(importName.slice(3));
1505
- for (const item of matchComponents$1) if (item.pattern.test(importName)) {
1506
- styleDir = item.styleDir;
1507
- break;
1508
- }
1509
- if (importStyle === "css" || importStyle) return styleDir ? [`@layui/layui-vue/es/${styleDir}/index.css`, "@layui/layui-vue/es/index/index.css"] : void 0;
1510
- }
1511
- function resolveComponent(importName, options) {
1512
- let name;
1513
- if (require_utils.isExclude(importName, options.exclude)) return void 0;
1514
- if (options.resolveIcons && importName.match(iconsRE)) {
1515
- name = importName;
1516
- libName = "@layui/icons-vue";
1517
- } else if (importName.match(layerRE)) {
1518
- name = importName;
1519
- libName = "@layui/layer-vue";
1520
- } else if (importName.match(layuiRE) && !importName.match(iconsRE)) {
1521
- name = importName;
1522
- libName = "@layui/layui-vue";
1523
- }
1524
- return name ? {
1525
- name,
1526
- from: libName,
1527
- sideEffects: getSideEffects$3(name, options)
1528
- } : void 0;
1529
- }
1530
- /**
1531
- * Resolver for layui-vue
1532
- *
1533
- * @link http://www.layui-vue.com/ for layui-vue
1534
- *
1535
- */
1536
- function LayuiVueResolver(options = {}) {
1537
- return {
1538
- type: "component",
1539
- resolve: (name) => {
1540
- return resolveComponent(name, options);
1541
- }
1542
- };
1543
- }
1544
-
1545
- //#endregion
1546
- //#region src/core/resolvers/naive-ui.ts
1547
- /**
1548
- * Resolver for Naive UI
1549
- *
1550
- * @author @antfu
1551
- * @link https://www.naiveui.com/
1552
- */
1553
- function NaiveUiResolver() {
1554
- return {
1555
- type: "component",
1556
- resolve: (name) => {
1557
- if (name.match(/^(N[A-Z]|n-[a-z])/)) return {
1558
- name,
1559
- from: "naive-ui"
1560
- };
1561
- }
1562
- };
1563
- }
1564
-
1565
- //#endregion
1566
- //#region src/core/resolvers/prime-vue.ts
1567
- const components$2 = [
1568
- "Accordion",
1569
- "AccordionTab",
1570
- "AutoComplete",
1571
- "Avatar",
1572
- "AvatarGroup",
1573
- "Badge",
1574
- "BlockUI",
1575
- "Breadcrumb",
1576
- "Button",
1577
- "Calendar",
1578
- "Card",
1579
- "Carousel",
1580
- "CascadeSelect",
1581
- "Chart",
1582
- "Checkbox",
1583
- "Chip",
1584
- "Chips",
1585
- "ColorPicker",
1586
- "Column",
1587
- "ColumnGroup",
1588
- "ContextMenu",
1589
- "DataTable",
1590
- "DataView",
1591
- "DataViewLayoutOptions",
1592
- "DeferredContent",
1593
- "Dialog",
1594
- "Divider",
1595
- "Dock",
1596
- "Dropdown",
1597
- "Editor",
1598
- "Fieldset",
1599
- "FileUpload",
1600
- "FloatLabel",
1601
- "FullCalendar",
1602
- "Galleria",
1603
- "IconField",
1604
- "IconField",
1605
- "Image",
1606
- "InlineMessage",
1607
- "Inplace",
1608
- "InputGroup",
1609
- "InputGroupAddon",
1610
- "InputIcon",
1611
- "InputMask",
1612
- "InputNumber",
1613
- "InputOtp",
1614
- "InputSwitch",
1615
- "InputText",
1616
- "Knob",
1617
- "Listbox",
1618
- "MegaMenu",
1619
- "Menu",
1620
- "Menubar",
1621
- "Message",
1622
- "MeterGroup",
1623
- "MultiSelect",
1624
- "OrderList",
1625
- "OrganizationChart",
1626
- "OverlayPanel",
1627
- "Paginator",
1628
- "Panel",
1629
- "PanelMenu",
1630
- "Password",
1631
- "PickList",
1632
- "ProgressBar",
1633
- "ProgressSpinner",
1634
- "RadioButton",
1635
- "Rating",
1636
- "Row",
1637
- "ScrollPanel",
1638
- "ScrollTop",
1639
- "SelectButton",
1640
- "Sidebar",
1641
- "Skeleton",
1642
- "Slider",
1643
- "SpeedDial",
1644
- "SplitButton",
1645
- "Splitter",
1646
- "SplitterPanel",
1647
- "Stepper",
1648
- "StepperPanel",
1649
- "Steps",
1650
- "TabMenu",
1651
- "TabPanel",
1652
- "TabView",
1653
- "Tag",
1654
- "Terminal",
1655
- "TerminalService",
1656
- "Textarea",
1657
- "TieredMenu",
1658
- "Timeline",
1659
- "Timelist",
1660
- "ToggleButton",
1661
- "Toolbar",
1662
- "Tree",
1663
- "TreeSelect",
1664
- "TreeTable",
1665
- "TriStateCheckbox",
1666
- "VirtualScroller"
1667
- ];
1668
- /**
1669
- * Resolver for PrimeVue - If you're using a component with the same tag as an native HTML element (e.g. button) the component must be in uppercase
1670
- *
1671
- * @link https://github.com/primefaces/primevue
1672
- */
1673
- function PrimeVueResolver(options = {}) {
1674
- return {
1675
- type: "component",
1676
- resolve: (name) => {
1677
- const sideEffects = [];
1678
- if (options.importStyle) sideEffects.push("primevue/resources/primevue.min.css");
1679
- if (options.importIcons) sideEffects.push("primeicons/primeicons.css");
1680
- if (options.importTheme) sideEffects.push(`primevue/resources/themes/${options.importTheme}/theme.css`);
1681
- if (options.prefix) {
1682
- if (!name.startsWith(options.prefix)) return;
1683
- name = name.substring(options.prefix.length);
1684
- }
1685
- if (components$2.includes(name)) return {
1686
- from: `primevue/${name.toLowerCase()}`,
1687
- sideEffects
1688
- };
1689
- }
1690
- };
1691
- }
1692
-
1693
- //#endregion
1694
- //#region src/core/resolvers/quasar.ts
1695
- /**
1696
- * Resolver for Quasar
1697
- *
1698
- * @link https://github.com/quasarframework/quasar
1699
- */
1700
- function QuasarResolver() {
1701
- let components$4 = [];
1702
- return {
1703
- type: "component",
1704
- resolve: async (name) => {
1705
- if (!components$4.length) {
1706
- const quasarApiListPath = (0, local_pkg.resolveModule)("quasar/dist/transforms/api-list.json");
1707
- if (quasarApiListPath) components$4 = JSON.parse(await node_fs.promises.readFile(quasarApiListPath, "utf-8"));
1708
- }
1709
- if (components$4.includes(name)) return {
1710
- name,
1711
- from: "quasar"
1712
- };
1713
- }
1714
- };
1715
- }
1716
-
1717
- //#endregion
1718
- //#region src/core/resolvers/tdesign.ts
1719
- function TDesignResolver(options = {}) {
1720
- const pluginList = [
1721
- "DialogPlugin",
1722
- "LoadingPlugin",
1723
- "MessagePlugin",
1724
- "NotifyPlugin"
1725
- ];
1726
- return {
1727
- type: "component",
1728
- resolve: (name) => {
1729
- const { library = "vue", exclude } = options;
1730
- const importFrom = options.esm ? "/esm" : "";
1731
- if (require_utils.isExclude(name, exclude)) return;
1732
- if (options.resolveIcons && name.match(/[a-z]Icon$/)) return {
1733
- name,
1734
- from: `tdesign-icons-${library}${importFrom}`
1735
- };
1736
- if (name.startsWith("TTypography") || name.startsWith("Typography")) return {
1737
- name: name.slice(name.startsWith("TTypography") ? 11 : 10),
1738
- from: `tdesign-${library}${importFrom}`
1739
- };
1740
- if (name.startsWith("TQrcode")) return {
1741
- name: "QRCode",
1742
- from: `tdesign-${library}${importFrom}`
1743
- };
1744
- if (name.match(/^T[A-Z]/) || pluginList.includes(name)) return {
1745
- name: name.match(/^T[A-Z]/) ? name.slice(1) : name,
1746
- from: `tdesign-${library}${importFrom}`
1747
- };
1748
- }
1749
- };
1750
- }
1751
-
1752
- //#endregion
1753
- //#region src/core/resolvers/vant.ts
1754
- const moduleType = require_utils.isSSR ? "lib" : "es";
1755
- function getSideEffects$2(dirName, options) {
1756
- const { importStyle = true } = options;
1757
- if (!importStyle || require_utils.isSSR) return;
1758
- if (importStyle === "less") return `vant/${moduleType}/${dirName}/style/less`;
1759
- if (importStyle === "css") return `vant/${moduleType}/${dirName}/style/index`;
1760
- return `vant/${moduleType}/${dirName}/style/index`;
1761
- }
1762
- /**
1763
- * Resolver for Vant
1764
- *
1765
- * @link https://github.com/youzan/vant
1766
- */
1767
- function VantResolver(options = {}) {
1768
- return {
1769
- type: "component",
1770
- resolve: (name) => {
1771
- if (name.startsWith("Van")) {
1772
- const partialName = name.slice(3);
1773
- return {
1774
- name: partialName,
1775
- from: `vant/${moduleType}`,
1776
- sideEffects: getSideEffects$2(require_utils.kebabCase(partialName), options)
1777
- };
1778
- }
1779
- }
1780
- };
1781
- }
1782
-
1783
- //#endregion
1784
- //#region src/core/resolvers/varlet-ui.ts
1785
- const varFunctions = [
1786
- "ImagePreview",
1787
- "Snackbar",
1788
- "Picker",
1789
- "ActionSheet",
1790
- "Dialog",
1791
- "Locale",
1792
- "StyleProvider",
1793
- "LoadingBar"
1794
- ];
1795
- const varDirectives = [
1796
- "Ripple",
1797
- "Lazy",
1798
- "Hover"
1799
- ];
1800
- function getResolved(name, options) {
1801
- const { importStyle = "css", importCss = true, importLess, styleExtname = ".mjs", autoImport = false, version = "vue3" } = options;
1802
- const path = version === "vue2" ? "@varlet-vue2/ui" : "@varlet/ui";
1803
- const sideEffects = [];
1804
- if (importStyle || importCss) if (importStyle === "less" || importLess) sideEffects.push(`${path}/es/${require_utils.kebabCase(name)}/style/less`);
1805
- else sideEffects.push(`${path}/es/${require_utils.kebabCase(name)}/style/index${styleExtname}`);
1806
- return {
1807
- from: path,
1808
- name: autoImport ? name : `_${name}Component`,
1809
- sideEffects
1810
- };
1811
- }
1812
- /**
1813
- * Resolver for VarletUI
1814
- *
1815
- * @link https://github.com/varletjs/varlet
1816
- * @link https://github.com/varletjs/varlet-vue2
1817
- */
1818
- function VarletUIResolver(options = {}) {
1819
- return [{
1820
- type: "component",
1821
- resolve: (name) => {
1822
- const { autoImport = false } = options;
1823
- if (autoImport && varFunctions.includes(name)) return getResolved(name, options);
1824
- if (name.startsWith("Var")) return getResolved(name.slice(3), options);
1825
- }
1826
- }, {
1827
- type: "directive",
1828
- resolve: (name) => {
1829
- const { directives: directives$1 = true } = options;
1830
- if (!directives$1) return;
1831
- if (!varDirectives.includes(name)) return;
1832
- return getResolved(name, options);
1833
- }
1834
- }];
1835
- }
1836
-
1837
- //#endregion
1838
- //#region src/core/resolvers/veui.ts
1839
- const VEUI_PACKAGE_NAME = "veui";
1840
- let components$1;
1841
- /**
1842
- * Resolver for VEUI
1843
- *
1844
- * @link https://github.com/ecomfe/veui
1845
- */
1846
- function VeuiResolver(options = {}) {
1847
- const { alias = VEUI_PACKAGE_NAME } = options;
1848
- if (!components$1) try {
1849
- const componentsData = require(`${alias}/components.json`);
1850
- components$1 = new Set(componentsData.map(({ name }) => name));
1851
- } catch {
1852
- throw new Error("[unplugin-vue-components:veui] VEUI is not installed");
1853
- }
1854
- return {
1855
- type: "component",
1856
- resolve: (name) => {
1857
- if (name.match(/^Veui[A-Z]/)) {
1858
- const componentName = name.slice(4);
1859
- if (!components$1.has(componentName)) return;
1860
- return {
1861
- name: componentName,
1862
- from: alias,
1863
- sideEffects: getSideEffects$1(componentName, options)
1864
- };
1865
- }
1866
- }
1867
- };
1868
- }
1869
- const formatters = {
1870
- "kebab-case": require_utils.kebabCase,
1871
- "camelCase": require_utils.camelCase,
1872
- "PascalCase": require_utils.pascalCase
1873
- };
1874
- const peerPaths = /* @__PURE__ */ new Map();
1875
- function assertPeerPath(peerPath) {
1876
- if (!peerPaths.has(peerPath)) try {
1877
- (0, mlly.resolvePathSync)(peerPath);
1878
- peerPaths.set(peerPath, true);
1879
- } catch {
1880
- peerPaths.set(peerPath, false);
1881
- }
1882
- return peerPaths.get(peerPath);
1883
- }
1884
- function getSideEffects$1(name, { alias = VEUI_PACKAGE_NAME, modules = [], locale = "zh-Hans", global = [] }) {
1885
- const localeModules = (locale ? Array.isArray(locale) ? locale : [locale] : []).map((locale$1) => `${alias}/locale/${locale$1}/${name}.js`);
1886
- const peerModules = modules.map(({ package: pack, path = "components", fileName = "{module}.css", transform = "kebab-case" }) => {
1887
- const peer = transform ? formatters[transform](name) : name;
1888
- return (0, node_path.normalize)((0, node_path.join)(pack, path, fileName.replace(/\$?\{module\}/g, peer)));
1889
- });
1890
- return [
1891
- ...localeModules,
1892
- ...global,
1893
- ...peerModules
1894
- ].filter(assertPeerPath);
1895
- }
1896
-
1897
- //#endregion
1898
- //#region src/core/resolvers/view-ui.ts
1899
- function getSideEffects(componentName) {
1900
- const sideEffects = ["view-design/dist/styles/iview.css", "popper.js/dist/umd/popper.js"];
1901
- if (/^Table|^Slider|^Tab/.test(componentName)) sideEffects.push("element-resize-detector");
1902
- if (componentName.startsWith("Date")) sideEffects.push("js-calendar");
1903
- return sideEffects;
1904
- }
1905
- const matchComponents = [{
1906
- pattern: /^List/,
1907
- compDir: "list"
1908
- }];
1909
- function getCompDir(compName) {
1910
- let compPath;
1911
- const total = matchComponents.length;
1912
- for (let i = 0; i < total; i++) {
1913
- const matcher = matchComponents[i];
1914
- if (compName.match(matcher.pattern)) {
1915
- compPath = `${matcher.compDir}/${require_utils.kebabCase(compName)}.vue`;
1916
- break;
1917
- }
1918
- }
1919
- if (!compPath) compPath = require_utils.kebabCase(compName);
1920
- return compPath;
1921
- }
1922
- /**
1923
- * Resolver for View UI
1924
- * @requires @originjs/vite-plugin-commonjs
1925
- * @author @nabaonan
1926
- * @link https://www.iviewui.com/
1927
- * @description has known problems list below
1928
- * - select component render error PR: https://github.com/view-design/ViewUI/pull/944, choose can't display value,because click option trigger twice,at second time,select value turn into undefined.
1929
- * - scroll component has a template syntax called lang='html',it is require html-loader,but vite plugin not support yet,remove it can run. relate pr: https://github.com/view-design/ViewUI/pull/985
1930
- */
1931
- function ViewUiResolver() {
1932
- return {
1933
- type: "component",
1934
- resolve: (name) => {
1935
- if (name.match(/^I[A-Z]/)) {
1936
- const compName = name.slice(1);
1937
- return {
1938
- from: `view-design/src/components/${getCompDir(compName)}`,
1939
- sideEffects: getSideEffects(compName)
1940
- };
1941
- }
1942
- }
1943
- };
1944
- }
1945
-
1946
- //#endregion
1947
- //#region src/core/resolvers/vuetify.ts
1948
- /**
1949
- * Resolver for Vuetify
1950
- *
1951
- * @link https://github.com/vuetifyjs/vuetify
1952
- */
1953
- function VuetifyResolver() {
1954
- return {
1955
- type: "component",
1956
- resolve: (name) => {
1957
- if (name.match(/^V[A-Z]/)) return {
1958
- name,
1959
- from: "vuetify/lib"
1960
- };
1961
- }
1962
- };
1963
- }
1964
- /**
1965
- * Resolver for Vuetify 3 Beta
1966
- *
1967
- * @link https://github.com/vuetifyjs/vuetify
1968
- */
1969
- function Vuetify3Resolver() {
1970
- return {
1971
- type: "component",
1972
- resolve: (name) => {
1973
- if (name.match(/^V[A-Z]/)) return {
1974
- name,
1975
- from: "vuetify/components"
1976
- };
1977
- }
1978
- };
1979
- }
1980
-
1981
- //#endregion
1982
- //#region src/core/resolvers/vueuse.ts
1983
- let components;
1984
- /**
1985
- * Resolver for VueUse
1986
- *
1987
- * @link https://github.com/vueuse/vueuse
1988
- */
1989
- function VueUseComponentsResolver() {
1990
- return {
1991
- type: "component",
1992
- resolve: (name) => {
1993
- if (!components) {
1994
- let indexesJson;
1995
- try {
1996
- const corePath = (0, local_pkg.resolveModule)("@vueuse/core") || node_process.default.cwd();
1997
- const path = (0, local_pkg.resolveModule)("@vueuse/core/indexes.json") || (0, local_pkg.resolveModule)("@vueuse/metadata/index.json") || (0, local_pkg.resolveModule)("@vueuse/metadata/index.json", { paths: [corePath] });
1998
- indexesJson = JSON.parse((0, node_fs.readFileSync)(path, "utf-8"));
1999
- components = indexesJson.functions.filter((i) => i.component && i.name).map(({ name: name$1 }) => name$1[0].toUpperCase() + name$1.slice(1));
2000
- } catch (error) {
2001
- console.error(error);
2002
- throw new Error("[vue-components] failed to load @vueuse/core, have you installed it?");
2003
- }
2004
- }
2005
- if (components && components.includes(name)) return {
2006
- name,
2007
- as: name,
2008
- from: "@vueuse/components"
2009
- };
2010
- }
2011
- };
2012
- }
2013
-
2014
- //#endregion
2015
- //#region src/core/resolvers/vueuse-directive.ts
2016
- let directives;
2017
- /**
2018
- * Resolver for VueUse
2019
- *
2020
- * @link https://github.com/vueuse/vueuse
2021
- */
2022
- function VueUseDirectiveResolver() {
2023
- return {
2024
- type: "directive",
2025
- resolve: (name) => {
2026
- if (!directives) {
2027
- let indexesJson;
2028
- try {
2029
- const corePath = (0, local_pkg.resolveModule)("@vueuse/core") || node_process.default.cwd();
2030
- const path = (0, local_pkg.resolveModule)("@vueuse/core/indexes.json") || (0, local_pkg.resolveModule)("@vueuse/metadata/index.json") || (0, local_pkg.resolveModule)("@vueuse/metadata/index.json", { paths: [corePath] });
2031
- indexesJson = JSON.parse((0, node_fs.readFileSync)(path, "utf-8"));
2032
- directives = indexesJson.functions.filter((i) => i.directive && i.name).map(({ name: name$1 }) => name$1[0].toUpperCase() + name$1.slice(1)).map((name$1) => name$1.startsWith("Use") ? name$1.slice(3) : name$1);
2033
- } catch (error) {
2034
- console.error(error);
2035
- throw new Error("[vue-components] failed to load @vueuse/core, have you installed it?");
2036
- }
2037
- }
2038
- if (directives && directives.includes(name)) return {
2039
- name: `v${name}`,
2040
- as: `v${name}`,
2041
- from: "@vueuse/components"
2042
- };
2043
- }
2044
- };
2045
- }
2046
-
2047
- //#endregion
2048
- exports.AntDesignVueResolver = AntDesignVueResolver;
2049
- exports.ArcoResolver = ArcoResolver;
2050
- exports.BootstrapVue3Resolver = BootstrapVue3Resolver;
2051
- exports.BootstrapVueNextResolver = BootstrapVueNextResolver;
2052
- exports.BootstrapVueResolver = BootstrapVueResolver;
2053
- exports.DevUiResolver = DevUiResolver;
2054
- exports.ElementPlusResolver = ElementPlusResolver;
2055
- exports.ElementUiResolver = ElementUiResolver;
2056
- exports.HeadlessUiResolver = HeadlessUiResolver;
2057
- exports.IduxResolver = IduxResolver;
2058
- exports.InklineResolver = InklineResolver;
2059
- exports.IonicBuiltInComponents = IonicBuiltInComponents;
2060
- exports.IonicResolver = IonicResolver;
2061
- exports.LayuiVueResolver = LayuiVueResolver;
2062
- exports.NaiveUiResolver = NaiveUiResolver;
2063
- exports.PrimeVueResolver = PrimeVueResolver;
2064
- exports.QuasarResolver = QuasarResolver;
2065
- exports.TDesignResolver = TDesignResolver;
2066
- exports.VantResolver = VantResolver;
2067
- exports.VarletUIResolver = VarletUIResolver;
2068
- exports.VeuiResolver = VeuiResolver;
2069
- exports.ViewUiResolver = ViewUiResolver;
2070
- exports.VueUseComponentsResolver = VueUseComponentsResolver;
2071
- exports.VueUseDirectiveResolver = VueUseDirectiveResolver;
2072
- exports.Vuetify3Resolver = Vuetify3Resolver;
2073
- exports.VuetifyResolver = VuetifyResolver;
2074
- exports.getResolved = getResolved;