resolvers.cjs 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773
  1. "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  2. var _chunkUX65OJTHcjs = require('./chunk-UX65OJTH.cjs');
  3. var _chunkWJIU4Q36cjs = require('./chunk-WJIU4Q36.cjs');
  4. // src/core/resolvers/antdv.ts
  5. var matchComponents = [
  6. {
  7. pattern: /^Affix/,
  8. styleDir: "affix"
  9. },
  10. {
  11. pattern: /^Avatar/,
  12. styleDir: "avatar"
  13. },
  14. {
  15. pattern: /^AutoComplete/,
  16. styleDir: "auto-complete"
  17. },
  18. {
  19. pattern: /^Alert/,
  20. styleDir: "alert"
  21. },
  22. {
  23. pattern: /^Anchor/,
  24. styleDir: "anchor"
  25. },
  26. {
  27. pattern: /^App/,
  28. styleDir: "app"
  29. },
  30. {
  31. pattern: /^Badge/,
  32. styleDir: "badge"
  33. },
  34. {
  35. pattern: /^Breadcrumb/,
  36. styleDir: "breadcrumb"
  37. },
  38. {
  39. pattern: /^Button/,
  40. styleDir: "button"
  41. },
  42. {
  43. pattern: /^Checkbox/,
  44. styleDir: "checkbox"
  45. },
  46. {
  47. pattern: /^Calendar/,
  48. styleDir: "calendar"
  49. },
  50. {
  51. pattern: /^Card/,
  52. styleDir: "card"
  53. },
  54. {
  55. pattern: /^Carousel/,
  56. styleDir: "carousel"
  57. },
  58. {
  59. pattern: /^Collapse/,
  60. styleDir: "collapse"
  61. },
  62. {
  63. pattern: /^Comment/,
  64. styleDir: "comment"
  65. },
  66. {
  67. pattern: /^Descriptions/,
  68. styleDir: "descriptions"
  69. },
  70. {
  71. pattern: /^RangePicker|^WeekPicker|^MonthPicker/,
  72. styleDir: "date-picker"
  73. },
  74. {
  75. pattern: /^Divider/,
  76. styleDir: "divider"
  77. },
  78. {
  79. pattern: /^Drawer/,
  80. styleDir: "drawer"
  81. },
  82. {
  83. pattern: /^Dropdown/,
  84. styleDir: "dropdown"
  85. },
  86. {
  87. pattern: /^Empty/,
  88. styleDir: "empty"
  89. },
  90. {
  91. pattern: /^Flex/,
  92. styleDir: "flex"
  93. },
  94. {
  95. pattern: /^FloatButton/,
  96. styleDir: "float-button"
  97. },
  98. {
  99. pattern: /^Form/,
  100. styleDir: "form"
  101. },
  102. {
  103. pattern: /^Grid/,
  104. styleDir: "grid"
  105. },
  106. {
  107. pattern: /^InputNumber/,
  108. styleDir: "input-number"
  109. },
  110. {
  111. pattern: /^Input|^Textarea/,
  112. styleDir: "input"
  113. },
  114. {
  115. pattern: /^Statistic/,
  116. styleDir: "statistic"
  117. },
  118. {
  119. pattern: /^CheckableTag/,
  120. styleDir: "tag"
  121. },
  122. {
  123. pattern: /^TimeRangePicker/,
  124. styleDir: "time-picker"
  125. },
  126. {
  127. pattern: /^Layout/,
  128. styleDir: "layout"
  129. },
  130. {
  131. pattern: /^Menu|^SubMenu/,
  132. styleDir: "menu"
  133. },
  134. {
  135. pattern: /^Table/,
  136. styleDir: "table"
  137. },
  138. {
  139. pattern: /^TimePicker|^TimeRangePicker/,
  140. styleDir: "time-picker"
  141. },
  142. {
  143. pattern: /^Radio/,
  144. styleDir: "radio"
  145. },
  146. {
  147. pattern: /^Image/,
  148. styleDir: "image"
  149. },
  150. {
  151. pattern: /^List/,
  152. styleDir: "list"
  153. },
  154. {
  155. pattern: /^Tab/,
  156. styleDir: "tabs"
  157. },
  158. {
  159. pattern: /^Mentions/,
  160. styleDir: "mentions"
  161. },
  162. {
  163. pattern: /^Step/,
  164. styleDir: "steps"
  165. },
  166. {
  167. pattern: /^Skeleton/,
  168. styleDir: "skeleton"
  169. },
  170. {
  171. pattern: /^Select/,
  172. styleDir: "select"
  173. },
  174. {
  175. pattern: /^TreeSelect/,
  176. styleDir: "tree-select"
  177. },
  178. {
  179. pattern: /^Tree|^DirectoryTree/,
  180. styleDir: "tree"
  181. },
  182. {
  183. pattern: /^Typography/,
  184. styleDir: "typography"
  185. },
  186. {
  187. pattern: /^Timeline/,
  188. styleDir: "timeline"
  189. },
  190. {
  191. pattern: /^Upload/,
  192. styleDir: "upload"
  193. },
  194. {
  195. pattern: /^Qrcode/,
  196. styleDir: "qrcode"
  197. },
  198. {
  199. pattern: /^Space/,
  200. styleDir: "space"
  201. }
  202. ];
  203. function getStyleDir(compName) {
  204. let styleDir;
  205. const total = matchComponents.length;
  206. for (let i = 0; i < total; i++) {
  207. const matcher = matchComponents[i];
  208. if (compName.match(matcher.pattern)) {
  209. styleDir = matcher.styleDir;
  210. break;
  211. }
  212. }
  213. if (!styleDir)
  214. styleDir = _chunkUX65OJTHcjs.kebabCase.call(void 0, compName);
  215. return styleDir;
  216. }
  217. function getSideEffects(compName, options) {
  218. const {
  219. importStyle = true,
  220. importLess = false
  221. } = options;
  222. if (!importStyle)
  223. return;
  224. const lib = options.cjs ? "lib" : "es";
  225. const packageName = (options == null ? void 0 : options.packageName) || "ant-design-vue";
  226. if (importStyle === "less" || importLess) {
  227. const styleDir = getStyleDir(compName);
  228. return `${packageName}/${lib}/${styleDir}/style`;
  229. } else {
  230. const styleDir = getStyleDir(compName);
  231. return `${packageName}/${lib}/${styleDir}/style/css`;
  232. }
  233. }
  234. var primitiveNames = ["Affix", "Anchor", "AnchorLink", "AutoComplete", "AutoCompleteOptGroup", "AutoCompleteOption", "Alert", "Avatar", "AvatarGroup", "BackTop", "Badge", "BadgeRibbon", "Breadcrumb", "BreadcrumbItem", "BreadcrumbSeparator", "Button", "ButtonGroup", "Calendar", "Card", "CardGrid", "CardMeta", "Collapse", "CollapsePanel", "Carousel", "Cascader", "Checkbox", "CheckboxGroup", "Col", "Comment", "ConfigProvider", "DatePicker", "MonthPicker", "WeekPicker", "RangePicker", "QuarterPicker", "Descriptions", "DescriptionsItem", "Divider", "Dropdown", "DropdownButton", "Drawer", "Empty", "Form", "FormItem", "FormItemRest", "Grid", "Input", "InputGroup", "InputPassword", "InputSearch", "Textarea", "Image", "ImagePreviewGroup", "InputNumber", "Layout", "LayoutHeader", "LayoutSider", "LayoutFooter", "LayoutContent", "List", "ListItem", "ListItemMeta", "Menu", "MenuDivider", "MenuItem", "MenuItemGroup", "SubMenu", "Mentions", "MentionsOption", "Modal", "Statistic", "StatisticCountdown", "PageHeader", "Pagination", "Popconfirm", "Popover", "Progress", "Radio", "RadioButton", "RadioGroup", "Rate", "Result", "Row", "Select", "SelectOptGroup", "SelectOption", "Skeleton", "SkeletonButton", "SkeletonAvatar", "SkeletonInput", "SkeletonImage", "Slider", "Space", "Spin", "Steps", "Step", "Switch", "Table", "TableColumn", "TableColumnGroup", "TableSummary", "TableSummaryRow", "TableSummaryCell", "Transfer", "Tree", "TreeNode", "DirectoryTree", "TreeSelect", "TreeSelectNode", "Tabs", "TabPane", "Tag", "CheckableTag", "TimePicker", "TimeRangePicker", "Timeline", "TimelineItem", "Tooltip", "Typography", "TypographyLink", "TypographyParagraph", "TypographyText", "TypographyTitle", "Upload", "UploadDragger", "LocaleProvider", "FloatButton", "FloatButtonGroup", "Qrcode", "Watermark", "Segmented", "Tour", "SpaceCompact", "StyleProvider", "Flex", "App"];
  235. var antdvNames;
  236. function genAntdNames(primitiveNames2) {
  237. antdvNames = new Set(primitiveNames2);
  238. }
  239. genAntdNames(primitiveNames);
  240. function isAntdv(compName) {
  241. return antdvNames.has(compName);
  242. }
  243. function getImportName(compName) {
  244. if (compName === "Qrcode")
  245. return "QRCode";
  246. else if (compName === "SpaceCompact")
  247. return "Compact";
  248. return compName;
  249. }
  250. function AntDesignVueResolver(options = {}) {
  251. var _a;
  252. const originPrefix = (_a = options.prefix) != null ? _a : "A";
  253. return {
  254. type: "component",
  255. resolve: (name) => {
  256. var _a2;
  257. if (options.resolveIcons && name.match(/(Outlined|Filled|TwoTone)$/)) {
  258. return {
  259. name,
  260. from: "@ant-design/icons-vue"
  261. };
  262. }
  263. const [compName, prefix] = [name.slice(originPrefix.length), name.slice(0, originPrefix.length)];
  264. if (prefix === originPrefix && isAntdv(compName) && !((_a2 = options == null ? void 0 : options.exclude) == null ? void 0 : _a2.includes(compName))) {
  265. const { cjs = false, packageName = "ant-design-vue" } = options;
  266. const path = `${packageName}/${cjs ? "lib" : "es"}`;
  267. return {
  268. name: getImportName(compName),
  269. from: path,
  270. sideEffects: getSideEffects(compName, options)
  271. };
  272. }
  273. }
  274. };
  275. }
  276. // node_modules/.pnpm/compare-versions@6.1.0/node_modules/compare-versions/lib/esm/utils.js
  277. var semver = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
  278. var validateAndParse = (version) => {
  279. if (typeof version !== "string") {
  280. throw new TypeError("Invalid argument expected string");
  281. }
  282. const match = version.match(semver);
  283. if (!match) {
  284. throw new Error(`Invalid argument not valid semver ('${version}' received)`);
  285. }
  286. match.shift();
  287. return match;
  288. };
  289. var isWildcard = (s) => s === "*" || s === "x" || s === "X";
  290. var tryParse = (v) => {
  291. const n = parseInt(v, 10);
  292. return isNaN(n) ? v : n;
  293. };
  294. var forceType = (a, b) => typeof a !== typeof b ? [String(a), String(b)] : [a, b];
  295. var compareStrings = (a, b) => {
  296. if (isWildcard(a) || isWildcard(b))
  297. return 0;
  298. const [ap, bp] = forceType(tryParse(a), tryParse(b));
  299. if (ap > bp)
  300. return 1;
  301. if (ap < bp)
  302. return -1;
  303. return 0;
  304. };
  305. var compareSegments = (a, b) => {
  306. for (let i = 0; i < Math.max(a.length, b.length); i++) {
  307. const r = compareStrings(a[i] || "0", b[i] || "0");
  308. if (r !== 0)
  309. return r;
  310. }
  311. return 0;
  312. };
  313. // node_modules/.pnpm/compare-versions@6.1.0/node_modules/compare-versions/lib/esm/compareVersions.js
  314. var compareVersions = (v1, v2) => {
  315. const n1 = validateAndParse(v1);
  316. const n2 = validateAndParse(v2);
  317. const p1 = n1.pop();
  318. const p2 = n2.pop();
  319. const r = compareSegments(n1, n2);
  320. if (r !== 0)
  321. return r;
  322. if (p1 && p2) {
  323. return compareSegments(p1.split("."), p2.split("."));
  324. } else if (p1 || p2) {
  325. return p1 ? -1 : 1;
  326. }
  327. return 0;
  328. };
  329. // node_modules/.pnpm/compare-versions@6.1.0/node_modules/compare-versions/lib/esm/compare.js
  330. var compare = (v1, v2, operator) => {
  331. assertValidOperator(operator);
  332. const res = compareVersions(v1, v2);
  333. return operatorResMap[operator].includes(res);
  334. };
  335. var operatorResMap = {
  336. ">": [1],
  337. ">=": [0, 1],
  338. "=": [0],
  339. "<=": [-1, 0],
  340. "<": [-1],
  341. "!=": [-1, 1]
  342. };
  343. var allowedOperators = Object.keys(operatorResMap);
  344. var assertValidOperator = (op) => {
  345. if (typeof op !== "string") {
  346. throw new TypeError(`Invalid operator type, expected string but got ${typeof op}`);
  347. }
  348. if (allowedOperators.indexOf(op) === -1) {
  349. throw new Error(`Invalid operator, expected one of ${allowedOperators.join("|")}`);
  350. }
  351. };
  352. // src/core/resolvers/element-plus.ts
  353. function getSideEffectsLegacy(partialName, options) {
  354. const { importStyle } = options;
  355. if (!importStyle)
  356. return;
  357. if (importStyle === "sass") {
  358. return [
  359. "element-plus/packages/theme-chalk/src/base.scss",
  360. `element-plus/packages/theme-chalk/src/${partialName}.scss`
  361. ];
  362. } else if (importStyle === true || importStyle === "css") {
  363. return [
  364. "element-plus/lib/theme-chalk/base.css",
  365. `element-plus/lib/theme-chalk/el-${partialName}.css`
  366. ];
  367. }
  368. }
  369. function getSideEffects2(dirName, options) {
  370. const { importStyle, ssr, nightly } = options;
  371. const themeFolder = nightly ? "@element-plus/nightly/theme-chalk" : "element-plus/theme-chalk";
  372. const esComponentsFolder = nightly ? "@element-plus/nightly/es/components" : "element-plus/es/components";
  373. if (importStyle === "sass") {
  374. return ssr ? [`${themeFolder}/src/base.scss`, `${themeFolder}/src/${dirName}.scss`] : [`${esComponentsFolder}/base/style/index`, `${esComponentsFolder}/${dirName}/style/index`];
  375. } else if (importStyle === true || importStyle === "css") {
  376. return ssr ? [`${themeFolder}/base.css`, `${themeFolder}/el-${dirName}.css`] : [`${esComponentsFolder}/base/style/css`, `${esComponentsFolder}/${dirName}/style/css`];
  377. }
  378. }
  379. function resolveComponent(name, options) {
  380. if (options.exclude && name.match(options.exclude))
  381. return;
  382. if (!name.match(/^El[A-Z]/))
  383. return;
  384. if (name.match(/^ElIcon.+/)) {
  385. return {
  386. name: name.replace(/^ElIcon/, ""),
  387. from: "@element-plus/icons-vue"
  388. };
  389. }
  390. const partialName = _chunkUX65OJTHcjs.kebabCase.call(void 0, name.slice(2));
  391. const { version, ssr, nightly } = options;
  392. if (compare(version, "1.1.0-beta.1", ">=") || nightly) {
  393. return {
  394. name,
  395. from: `${nightly ? "@element-plus/nightly" : "element-plus"}/${ssr ? "lib" : "es"}`,
  396. sideEffects: getSideEffects2(partialName, options)
  397. };
  398. } else if (compare(version, "1.0.2-beta.28", ">=")) {
  399. return {
  400. from: `element-plus/es/el-${partialName}`,
  401. sideEffects: getSideEffectsLegacy(partialName, options)
  402. };
  403. } else {
  404. return {
  405. from: `element-plus/lib/el-${partialName}`,
  406. sideEffects: getSideEffectsLegacy(partialName, options)
  407. };
  408. }
  409. }
  410. function resolveDirective(name, options) {
  411. if (!options.directives)
  412. return;
  413. const directives2 = {
  414. Loading: { importName: "ElLoadingDirective", styleName: "loading" },
  415. Popover: { importName: "ElPopoverDirective", styleName: "popover" },
  416. InfiniteScroll: { importName: "ElInfiniteScroll", styleName: "infinite-scroll" }
  417. };
  418. const directive = directives2[name];
  419. if (!directive)
  420. return;
  421. const { version, ssr, nightly } = options;
  422. if (compare(version, "1.1.0-beta.1", ">=") || nightly) {
  423. return {
  424. name: directive.importName,
  425. from: `${nightly ? "@element-plus/nightly" : "element-plus"}/${ssr ? "lib" : "es"}`,
  426. sideEffects: getSideEffects2(directive.styleName, options)
  427. };
  428. }
  429. }
  430. var noStylesComponents = ["ElAutoResizer"];
  431. function ElementPlusResolver(options = {}) {
  432. let optionsResolved;
  433. async function resolveOptions() {
  434. if (optionsResolved)
  435. return optionsResolved;
  436. optionsResolved = _chunkWJIU4Q36cjs.__spreadValues.call(void 0, {
  437. ssr: false,
  438. version: await _chunkUX65OJTHcjs.getPkgVersion.call(void 0, "element-plus", "2.2.2"),
  439. importStyle: "css",
  440. directives: true,
  441. exclude: void 0,
  442. noStylesComponents: options.noStylesComponents || [],
  443. nightly: false
  444. }, options);
  445. return optionsResolved;
  446. }
  447. return [
  448. {
  449. type: "component",
  450. resolve: async (name) => {
  451. const options2 = await resolveOptions();
  452. if ([...options2.noStylesComponents, ...noStylesComponents].includes(name))
  453. return resolveComponent(name, _chunkWJIU4Q36cjs.__spreadProps.call(void 0, _chunkWJIU4Q36cjs.__spreadValues.call(void 0, {}, options2), { importStyle: false }));
  454. else
  455. return resolveComponent(name, options2);
  456. }
  457. },
  458. {
  459. type: "directive",
  460. resolve: async (name) => {
  461. return resolveDirective(name, await resolveOptions());
  462. }
  463. }
  464. ];
  465. }
  466. // src/core/resolvers/element-ui.ts
  467. function getSideEffects3(partialName, options) {
  468. const { importStyle = "css" } = options;
  469. if (!importStyle)
  470. return;
  471. if (importStyle === "sass") {
  472. return [
  473. "element-ui/packages/theme-chalk/src/base.scss",
  474. `element-ui/packages/theme-chalk/src/${partialName}.scss`
  475. ];
  476. } else {
  477. return [
  478. "element-ui/lib/theme-chalk/base.css",
  479. `element-ui/lib/theme-chalk/${partialName}.css`
  480. ];
  481. }
  482. }
  483. function ElementUiResolver(options = {}) {
  484. return {
  485. type: "component",
  486. resolve: (name) => {
  487. if (options.exclude && name.match(options.exclude))
  488. return;
  489. if (/^El[A-Z]/.test(name)) {
  490. const compName = name.slice(2);
  491. const partialName = _chunkUX65OJTHcjs.kebabCase.call(void 0, compName);
  492. if (partialName === "collapse-transition") {
  493. return {
  494. from: `element-ui/lib/transitions/${partialName}`
  495. };
  496. }
  497. return {
  498. from: `element-ui/lib/${partialName}`,
  499. sideEffects: getSideEffects3(partialName, options)
  500. };
  501. }
  502. }
  503. };
  504. }
  505. // src/core/resolvers/headless-ui.ts
  506. var components = [
  507. "Combobox",
  508. "ComboboxButton",
  509. "ComboboxInput",
  510. "ComboboxLabel",
  511. "ComboboxOption",
  512. "ComboboxOptions",
  513. "Dialog",
  514. "DialogDescription",
  515. "DialogOverlay",
  516. "DialogTitle",
  517. "DialogPanel",
  518. "Disclosure",
  519. "DisclosureButton",
  520. "DisclosurePanel",
  521. "FocusTrap",
  522. "Listbox",
  523. "ListboxButton",
  524. "ListboxLabel",
  525. "ListboxOption",
  526. "ListboxOptions",
  527. "Menu",
  528. "MenuButton",
  529. "MenuItem",
  530. "MenuItems",
  531. "Popover",
  532. "PopoverButton",
  533. "PopoverGroup",
  534. "PopoverOverlay",
  535. "PopoverPanel",
  536. "Portal",
  537. "PortalGroup",
  538. "RadioGroup",
  539. "RadioGroupDescription",
  540. "RadioGroupLabel",
  541. "RadioGroupOption",
  542. "Switch",
  543. "SwitchDescription",
  544. "SwitchGroup",
  545. "SwitchLabel",
  546. "TransitionChild",
  547. "TransitionRoot",
  548. "TabGroup",
  549. "TabList",
  550. "Tab",
  551. "TabPanels",
  552. "TabPanel"
  553. ];
  554. function HeadlessUiResolver(options = {}) {
  555. const { prefix = "" } = options;
  556. return {
  557. type: "component",
  558. resolve: (name) => {
  559. if (name.startsWith(prefix)) {
  560. const componentName = name.substring(prefix.length);
  561. if (components.includes(componentName)) {
  562. return {
  563. name: componentName,
  564. from: "@headlessui/vue"
  565. };
  566. }
  567. }
  568. }
  569. };
  570. }
  571. // src/core/resolvers/idux.ts
  572. var specialComponents = {
  573. CdkVirtualScroll: "scroll",
  574. CdkClickOutside: "click-outside",
  575. CdkDraggable: "drag-drop",
  576. CdkResizable: "resize",
  577. CdkResizableHandle: "resize",
  578. CdkResizeObserver: "resize",
  579. IxAutoComplete: "auto-complete",
  580. IxBackTop: "back-top",
  581. IxDatePicker: "date-picker",
  582. IxDateRangePicker: "date-picker",
  583. IxCol: "grid",
  584. IxRow: "grid",
  585. IxInputNumber: "input-number",
  586. IxTab: "tabs",
  587. IxTreeSelect: "tree-select",
  588. IxTimePicker: "time-picker",
  589. IxTimeRangePicker: "time-picker",
  590. IxLoadingBar: "loading-bar",
  591. IxLoadingBarProvider: "loading-bar"
  592. };
  593. function IduxResolver(options = {}) {
  594. return {
  595. type: "component",
  596. resolve: (name) => {
  597. const { importStyle, importStyleTheme = "default", exclude = [], scope = "@idux" } = options;
  598. if (exclude.includes(name))
  599. return;
  600. const packageName = getPackageName(name);
  601. if (!packageName)
  602. return;
  603. let dirname = specialComponents[name];
  604. if (!dirname) {
  605. const nameIndex = packageName === "pro" ? 2 : 1;
  606. dirname = _chunkUX65OJTHcjs.kebabCase.call(void 0, name).split("-")[nameIndex];
  607. }
  608. const path = `${scope}/${packageName}/${dirname}`;
  609. let sideEffects;
  610. if (packageName !== "cdk" && importStyle)
  611. sideEffects = `${path}/style/themes/${importStyle === "css" ? `${importStyleTheme}_css` : importStyleTheme}`;
  612. return { name, from: path, sideEffects };
  613. }
  614. };
  615. }
  616. function getPackageName(name) {
  617. let packageName;
  618. if (name.match(/^Cdk[A-Z]/))
  619. packageName = "cdk";
  620. else if (name.match(/^IxPro[A-Z]/))
  621. packageName = "pro";
  622. else if (name.match(/^Ix[A-Z]/))
  623. packageName = "components";
  624. return packageName;
  625. }
  626. // src/core/resolvers/inkline.ts
  627. function InklineResolver() {
  628. return {
  629. type: "component",
  630. resolve: (name) => {
  631. if (name.match(/^I[A-Z]/)) {
  632. return {
  633. name,
  634. from: "@inkline/inkline"
  635. };
  636. }
  637. }
  638. };
  639. }
  640. // src/core/resolvers/naive-ui.ts
  641. function NaiveUiResolver() {
  642. return {
  643. type: "component",
  644. resolve: (name) => {
  645. if (name.match(/^(N[A-Z]|n-[a-z])/))
  646. return { name, from: "naive-ui" };
  647. }
  648. };
  649. }
  650. // src/core/resolvers/prime-vue.ts
  651. var components2 = [
  652. "Accordion",
  653. "AccordionTab",
  654. "AutoComplete",
  655. "Avatar",
  656. "AvatarGroup",
  657. "Badge",
  658. "BlockUI",
  659. "Breadcrumb",
  660. "Button",
  661. "Calendar",
  662. "Card",
  663. "Carousel",
  664. "CascadeSelect",
  665. "Chart",
  666. "Checkbox",
  667. "Chip",
  668. "Chips",
  669. "ColorPicker",
  670. "Column",
  671. "ColumnGroup",
  672. // 'ConfirmDialog',
  673. // 'ConfirmPopup',
  674. // These must be registered globally in order for the confirm service to work properly
  675. "ContextMenu",
  676. "DataTable",
  677. "DataView",
  678. "DataViewLayoutOptions",
  679. "DeferredContent",
  680. "Dialog",
  681. "Divider",
  682. "Dock",
  683. "Dropdown",
  684. "Editor",
  685. "Fieldset",
  686. "FileUpload",
  687. "FullCalendar",
  688. "Galleria",
  689. "Image",
  690. "InlineMessage",
  691. "Inplace",
  692. "InputMask",
  693. "InputNumber",
  694. "InputSwitch",
  695. "InputText",
  696. "Knob",
  697. "Listbox",
  698. "MegaMenu",
  699. "Menu",
  700. "Menubar",
  701. "Message",
  702. "MultiSelect",
  703. "OrderList",
  704. "OrganizationChart",
  705. "OverlayPanel",
  706. "Paginator",
  707. "Panel",
  708. "PanelMenu",
  709. "Password",
  710. "PickList",
  711. "ProgressBar",
  712. "ProgressSpinner",
  713. "RadioButton",
  714. "Rating",
  715. "Row",
  716. "ScrollPanel",
  717. "ScrollTop",
  718. "SelectButton",
  719. "Sidebar",
  720. "Skeleton",
  721. "Slider",
  722. "SpeedDial",
  723. "SplitButton",
  724. "Splitter",
  725. "SplitterPanel",
  726. "Steps",
  727. "TabMenu",
  728. "TabPanel",
  729. "TabView",
  730. "Tag",
  731. "Terminal",
  732. "TerminalService",
  733. "Textarea",
  734. "TieredMenu",
  735. "Timeline",
  736. "Timelist",
  737. // 'Toast',
  738. // Toast must be registered globally in order for the toast service to work properly
  739. "ToggleButton",
  740. "Toolbar",
  741. // 'Tooltip',
  742. // Tooltip must be registered globally in order for the tooltip service to work properly
  743. "Tree",
  744. "TreeSelect",
  745. "TreeTable",
  746. "TriStateCheckbox",
  747. "VirtualScroller"
  748. ];
  749. function PrimeVueResolver(options = {}) {
  750. return {
  751. type: "component",
  752. resolve: (name) => {
  753. const sideEffects = [];
  754. if (options.importStyle)
  755. sideEffects.push("primevue/resources/primevue.min.css");
  756. if (options.importIcons)
  757. sideEffects.push("primeicons/primeicons.css");
  758. if (options.importTheme) {
  759. sideEffects.push(
  760. `primevue/resources/themes/${options.importTheme}/theme.css`
  761. );
  762. }
  763. if (options.prefix) {
  764. if (!name.startsWith(options.prefix))
  765. return;
  766. name = name.substring(options.prefix.length);
  767. }
  768. if (components2.includes(name)) {
  769. return {
  770. from: `primevue/${name.toLowerCase()}`,
  771. sideEffects
  772. };
  773. }
  774. }
  775. };
  776. }
  777. // src/core/resolvers/vant.ts
  778. var moduleType = _chunkUX65OJTHcjs.isSSR ? "lib" : "es";
  779. function getSideEffects4(dirName, options) {
  780. const { importStyle = true } = options;
  781. if (!importStyle || _chunkUX65OJTHcjs.isSSR)
  782. return;
  783. if (importStyle === "less")
  784. return `vant/${moduleType}/${dirName}/style/less`;
  785. if (importStyle === "css")
  786. return `vant/${moduleType}/${dirName}/style/index`;
  787. return `vant/${moduleType}/${dirName}/style/index`;
  788. }
  789. function VantResolver(options = {}) {
  790. return {
  791. type: "component",
  792. resolve: (name) => {
  793. if (name.startsWith("Van")) {
  794. const partialName = name.slice(3);
  795. return {
  796. name: partialName,
  797. from: `vant/${moduleType}`,
  798. sideEffects: getSideEffects4(_chunkUX65OJTHcjs.kebabCase.call(void 0, partialName), options)
  799. };
  800. }
  801. }
  802. };
  803. }
  804. // src/core/resolvers/varlet-ui.ts
  805. var varFunctions = ["ImagePreview", "Snackbar", "Picker", "ActionSheet", "Dialog", "Locale", "StyleProvider", "LoadingBar"];
  806. var varDirectives = ["Ripple", "Lazy", "Hover"];
  807. function getResolved(name, options) {
  808. const {
  809. importStyle = "css",
  810. importCss = true,
  811. importLess,
  812. autoImport = false,
  813. version = "vue3"
  814. } = options;
  815. const path = version === "vue2" ? "@varlet-vue2/ui" : "@varlet/ui";
  816. const sideEffects = [];
  817. if (importStyle || importCss) {
  818. if (importStyle === "less" || importLess)
  819. sideEffects.push(`${path}/es/${_chunkUX65OJTHcjs.kebabCase.call(void 0, name)}/style/less`);
  820. else
  821. sideEffects.push(`${path}/es/${_chunkUX65OJTHcjs.kebabCase.call(void 0, name)}/style/index`);
  822. }
  823. return {
  824. from: path,
  825. name: autoImport ? name : `_${name}Component`,
  826. sideEffects
  827. };
  828. }
  829. function VarletUIResolver(options = {}) {
  830. return [
  831. {
  832. type: "component",
  833. resolve: (name) => {
  834. const { autoImport = false } = options;
  835. if (autoImport && varFunctions.includes(name))
  836. return getResolved(name, options);
  837. if (name.startsWith("Var"))
  838. return getResolved(name.slice(3), options);
  839. }
  840. },
  841. {
  842. type: "directive",
  843. resolve: (name) => {
  844. const { directives: directives2 = true } = options;
  845. if (!directives2)
  846. return;
  847. if (!varDirectives.includes(name))
  848. return;
  849. return getResolved(name, options);
  850. }
  851. }
  852. ];
  853. }
  854. // src/core/resolvers/veui.ts
  855. var _path = require('path');
  856. var VEUI_PACKAGE_NAME = "veui";
  857. var components3;
  858. function VeuiResolver(options = {}) {
  859. const { alias = VEUI_PACKAGE_NAME } = options;
  860. if (!components3) {
  861. try {
  862. const componentsData = _chunkWJIU4Q36cjs.__require.call(void 0, `${alias}/components.json`);
  863. components3 = new Set(componentsData.map(({ name }) => name));
  864. } catch (e) {
  865. throw new Error("[unplugin-vue-components:veui] VEUI is not installed");
  866. }
  867. }
  868. return {
  869. type: "component",
  870. resolve: (name) => {
  871. if (name.match(/^Veui[A-Z]/)) {
  872. const componentName = name.slice(4);
  873. if (!components3.has(componentName))
  874. return;
  875. const sideEffects = getSideEffects5(componentName, options);
  876. return { name: componentName, from: alias, sideEffects };
  877. }
  878. }
  879. };
  880. }
  881. var formatters = {
  882. "kebab-case": _chunkUX65OJTHcjs.kebabCase,
  883. "camelCase": _chunkUX65OJTHcjs.camelCase,
  884. "PascalCase": _chunkUX65OJTHcjs.pascalCase
  885. };
  886. var peerPaths = /* @__PURE__ */ new Map();
  887. function assertPeerPath(peerPath) {
  888. if (!peerPaths.has(peerPath)) {
  889. try {
  890. _chunkUX65OJTHcjs.resolveImportPath.call(void 0, peerPath);
  891. peerPaths.set(peerPath, true);
  892. } catch (e) {
  893. peerPaths.set(peerPath, false);
  894. }
  895. }
  896. return peerPaths.get(peerPath);
  897. }
  898. function getSideEffects5(name, {
  899. alias = VEUI_PACKAGE_NAME,
  900. modules = [],
  901. locale = "zh-Hans",
  902. global = []
  903. }) {
  904. const localeModules = (locale ? Array.isArray(locale) ? locale : [locale] : []).map((locale2) => `${alias}/locale/${locale2}/${name}.js`);
  905. const peerModules = modules.map(
  906. ({
  907. package: pack,
  908. path = "components",
  909. fileName = "{module}.css",
  910. transform = "kebab-case"
  911. }) => {
  912. const peer = transform ? formatters[transform](name) : name;
  913. const file = fileName.replace(/\$?\{module\}/g, peer);
  914. return _path.normalize.call(void 0, _path.join.call(void 0, pack, path, file));
  915. }
  916. );
  917. return [...localeModules, ...global, ...peerModules].filter(assertPeerPath);
  918. }
  919. // src/core/resolvers/view-ui.ts
  920. function getSideEffects6(componentName) {
  921. const sideEffects = [
  922. "view-design/dist/styles/iview.css",
  923. "popper.js/dist/umd/popper.js"
  924. ];
  925. if (/^Table|^Slider|^Tab/.test(componentName))
  926. sideEffects.push("element-resize-detector");
  927. if (componentName.startsWith("Date"))
  928. sideEffects.push("js-calendar");
  929. return sideEffects;
  930. }
  931. var matchComponents2 = [
  932. {
  933. pattern: /^List/,
  934. compDir: "list"
  935. }
  936. ];
  937. function getCompDir(compName) {
  938. let compPath;
  939. const total = matchComponents2.length;
  940. for (let i = 0; i < total; i++) {
  941. const matcher = matchComponents2[i];
  942. if (compName.match(matcher.pattern)) {
  943. compPath = `${matcher.compDir}/${_chunkUX65OJTHcjs.kebabCase.call(void 0, compName)}.vue`;
  944. break;
  945. }
  946. }
  947. if (!compPath)
  948. compPath = _chunkUX65OJTHcjs.kebabCase.call(void 0, compName);
  949. return compPath;
  950. }
  951. function ViewUiResolver() {
  952. return {
  953. type: "component",
  954. resolve: (name) => {
  955. if (name.match(/^I[A-Z]/)) {
  956. const compName = name.slice(1);
  957. return {
  958. from: `view-design/src/components/${getCompDir(compName)}`,
  959. sideEffects: getSideEffects6(compName)
  960. };
  961. }
  962. }
  963. };
  964. }
  965. // src/core/resolvers/vuetify.ts
  966. function VuetifyResolver() {
  967. return {
  968. type: "component",
  969. resolve: (name) => {
  970. if (name.match(/^V[A-Z]/))
  971. return { name, from: "vuetify/lib" };
  972. }
  973. };
  974. }
  975. function Vuetify3Resolver() {
  976. return {
  977. type: "component",
  978. resolve: (name) => {
  979. if (name.match(/^V[A-Z]/))
  980. return { name, from: "vuetify/components" };
  981. }
  982. };
  983. }
  984. // src/core/resolvers/vueuse.ts
  985. var _fs = require('fs');
  986. var _process = require('process'); var _process2 = _interopRequireDefault(_process);
  987. var _localpkg = require('local-pkg');
  988. var components4;
  989. function VueUseComponentsResolver() {
  990. return {
  991. type: "component",
  992. resolve: (name) => {
  993. if (!components4) {
  994. let indexesJson;
  995. try {
  996. const corePath = _localpkg.resolveModule.call(void 0, "@vueuse/core") || _process2.default.cwd();
  997. const path = _localpkg.resolveModule.call(void 0, "@vueuse/core/indexes.json") || _localpkg.resolveModule.call(void 0, "@vueuse/metadata/index.json") || _localpkg.resolveModule.call(void 0, "@vueuse/metadata/index.json", { paths: [corePath] });
  998. indexesJson = JSON.parse(_fs.readFileSync.call(void 0, path, "utf-8"));
  999. components4 = indexesJson.functions.filter((i) => i.component && i.name).map(({ name: name2 }) => name2[0].toUpperCase() + name2.slice(1));
  1000. } catch (error) {
  1001. console.error(error);
  1002. throw new Error("[vue-components] failed to load @vueuse/core, have you installed it?");
  1003. }
  1004. }
  1005. if (components4 && components4.includes(name))
  1006. return { name, as: name, from: "@vueuse/components" };
  1007. }
  1008. };
  1009. }
  1010. // src/core/resolvers/vueuse-directive.ts
  1011. var directives;
  1012. function VueUseDirectiveResolver() {
  1013. return {
  1014. type: "directive",
  1015. resolve: (name) => {
  1016. if (!directives) {
  1017. let indexesJson;
  1018. try {
  1019. const corePath = _localpkg.resolveModule.call(void 0, "@vueuse/core") || _process2.default.cwd();
  1020. const path = _localpkg.resolveModule.call(void 0, "@vueuse/core/indexes.json") || _localpkg.resolveModule.call(void 0, "@vueuse/metadata/index.json") || _localpkg.resolveModule.call(void 0, "@vueuse/metadata/index.json", { paths: [corePath] });
  1021. indexesJson = JSON.parse(_fs.readFileSync.call(void 0, path, "utf-8"));
  1022. directives = indexesJson.functions.filter((i) => i.directive && i.name).map(({ name: name2 }) => name2[0].toUpperCase() + name2.slice(1)).map((name2) => name2.startsWith("Use") ? name2.slice(3) : name2);
  1023. } catch (error) {
  1024. console.error(error);
  1025. throw new Error("[vue-components] failed to load @vueuse/core, have you installed it?");
  1026. }
  1027. }
  1028. if (directives && directives.includes(name))
  1029. return { name: `v${name}`, as: name, from: "@vueuse/components" };
  1030. }
  1031. };
  1032. }
  1033. // src/core/resolvers/quasar.ts
  1034. function QuasarResolver() {
  1035. let components5 = [];
  1036. return {
  1037. type: "component",
  1038. resolve: async (name) => {
  1039. if (!components5.length) {
  1040. const quasarApiListPath = _localpkg.resolveModule.call(void 0, "quasar/dist/transforms/api-list.json");
  1041. if (quasarApiListPath)
  1042. components5 = JSON.parse(await _fs.promises.readFile(quasarApiListPath, "utf-8"));
  1043. }
  1044. if (components5.includes(name))
  1045. return { name, from: "quasar" };
  1046. }
  1047. };
  1048. }
  1049. // src/core/resolvers/devui.ts
  1050. var LIB_NAME = "vue-devui";
  1051. var HARMLESS = ["ripple"];
  1052. function resolveDirectory(name, filename) {
  1053. return `${LIB_NAME}/${name}/${filename}`;
  1054. }
  1055. function getSideEffects7(name, filename) {
  1056. if (HARMLESS.includes(name))
  1057. return;
  1058. if (["row", "col"].includes(name))
  1059. return resolveDirectory("grid", filename);
  1060. if (["aside", "content", "footer", "header", "layout"].includes(name))
  1061. return resolveDirectory("layout", filename);
  1062. if (["overlay", "fixed-overlay", "flexible-overlay"].includes(name))
  1063. return resolveDirectory("overlay", filename);
  1064. if (["panel", "panel-header", "panel-body"].includes(name))
  1065. return resolveDirectory("panel", filename);
  1066. if (["menu", "menu-item", "sub-menu"].includes(name))
  1067. return resolveDirectory("menu", filename);
  1068. if (["tabs", "tab"].includes(name))
  1069. return resolveDirectory("tabs", filename);
  1070. if (["form", "form-item"].includes(name))
  1071. return resolveDirectory("form", filename);
  1072. if (["collapse", "collapse-item"].includes(name))
  1073. return resolveDirectory("collapse", filename);
  1074. if (["steps", "step"].includes(name))
  1075. return resolveDirectory("steps", filename);
  1076. if (["radio", "radio-group", "radio-button"].includes(name))
  1077. return resolveDirectory("radio", filename);
  1078. if (["column"].includes(name))
  1079. return resolveDirectory("table", filename);
  1080. if (["timeline-item"].includes(name))
  1081. return resolveDirectory("timeline", filename);
  1082. if (["splitter-pane"].includes(name))
  1083. return resolveDirectory("splitter", filename);
  1084. return resolveDirectory(name, filename);
  1085. }
  1086. function componentsResolver(name, { ssr }) {
  1087. if (!name.match(/^D[A-Z]/))
  1088. return;
  1089. const resolveId = _chunkUX65OJTHcjs.kebabCase.call(void 0, name = name.slice(1));
  1090. return {
  1091. name,
  1092. sideEffects: getSideEffects7(resolveId, "style.css"),
  1093. from: getSideEffects7(resolveId, `index.${ssr ? "umd" : "es"}.js`)
  1094. };
  1095. }
  1096. function directivesResolver(name, { ssr }) {
  1097. const resolveId = _chunkUX65OJTHcjs.kebabCase.call(void 0, name);
  1098. return {
  1099. name: `${name}Directive`,
  1100. sideEffects: getSideEffects7(resolveId, "style.css"),
  1101. from: resolveDirectory(resolveId, `index.${ssr ? "umd" : "es"}.js`)
  1102. };
  1103. }
  1104. function DevUiResolver(options = {}) {
  1105. const config = _chunkWJIU4Q36cjs.__spreadValues.call(void 0, { directives: true, importStyle: true, ssr: false }, options);
  1106. const resolvers = [
  1107. {
  1108. type: "component",
  1109. resolve: (name) => componentsResolver(name, config)
  1110. }
  1111. ];
  1112. if (config.directives) {
  1113. resolvers.push({
  1114. type: "directive",
  1115. resolve: (name) => directivesResolver(name, config)
  1116. });
  1117. }
  1118. return resolvers;
  1119. }
  1120. // src/core/resolvers/arco.ts
  1121. var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
  1122. // src/core/resolvers/_utils.ts
  1123. function isExclude(name, exclude) {
  1124. if (!exclude)
  1125. return false;
  1126. if (typeof exclude === "string")
  1127. return name === exclude;
  1128. if (exclude instanceof RegExp)
  1129. return !!name.match(exclude);
  1130. if (Array.isArray(exclude)) {
  1131. for (const item of exclude) {
  1132. if (name === item || name.match(item))
  1133. return true;
  1134. }
  1135. }
  1136. return false;
  1137. }
  1138. // src/core/resolvers/arco.ts
  1139. var debug = _debug2.default.call(void 0, "unplugin-vue-components:resolvers:arco");
  1140. var matchComponents3 = [
  1141. {
  1142. pattern: /^AnchorLink$/,
  1143. componentDir: "anchor"
  1144. },
  1145. {
  1146. pattern: /^AvatarGroup$/,
  1147. componentDir: "avatar"
  1148. },
  1149. {
  1150. pattern: /^BreadcrumbItem$/,
  1151. componentDir: "breadcrumb"
  1152. },
  1153. {
  1154. pattern: /^ButtonGroup$/,
  1155. componentDir: "button"
  1156. },
  1157. {
  1158. pattern: /^(CardMeta|CardGrid)$/,
  1159. componentDir: "card"
  1160. },
  1161. {
  1162. pattern: /^CarouselItem$/,
  1163. componentDir: "carousel"
  1164. },
  1165. {
  1166. pattern: /^CascaderPanel$/,
  1167. componentDir: "cascader"
  1168. },
  1169. {
  1170. pattern: /^CheckboxGroup$/,
  1171. componentDir: "checkbox"
  1172. },
  1173. {
  1174. pattern: /^CollapseItem$/,
  1175. componentDir: "collapse"
  1176. },
  1177. {
  1178. pattern: /^(WeekPicker|MonthPicker|YearPicker|QuarterPicker|RangePicker)$/,
  1179. componentDir: "date-picker"
  1180. },
  1181. {
  1182. pattern: /^DescriptionsItem$/,
  1183. componentDir: "descriptions"
  1184. },
  1185. {
  1186. pattern: /^(Doption|Dgroup|Dsubmenu|DropdownButton)$/,
  1187. componentDir: "dropdown"
  1188. },
  1189. {
  1190. pattern: /^FormItem$/,
  1191. componentDir: "form"
  1192. },
  1193. {
  1194. pattern: /^(Col|Row|GridItem)$/,
  1195. componentDir: "grid"
  1196. },
  1197. {
  1198. pattern: /^(ImagePreview|ImagePreviewGroup)$/,
  1199. componentDir: "image"
  1200. },
  1201. {
  1202. pattern: /^(InputGroup|InputSearch|InputPassword)$/,
  1203. componentDir: "input"
  1204. },
  1205. {
  1206. pattern: /^(LayoutHeader|LayoutContent|LayoutFooter|LayoutSider)$/,
  1207. componentDir: "layout"
  1208. },
  1209. {
  1210. pattern: /^(ListItem|ListItemMeta)$/,
  1211. componentDir: "list"
  1212. },
  1213. {
  1214. pattern: /^(MenuItem|MenuItemGroup|SubMenu)$/,
  1215. componentDir: "menu"
  1216. },
  1217. {
  1218. pattern: /^RadioGroup$/,
  1219. componentDir: "radio"
  1220. },
  1221. {
  1222. pattern: /^(Option|Optgroup)$/,
  1223. componentDir: "select"
  1224. },
  1225. {
  1226. pattern: /^(SkeletonLine|SkeletonShape)$/,
  1227. componentDir: "skeleton"
  1228. },
  1229. {
  1230. pattern: /^Countdown$/,
  1231. componentDir: "statistic"
  1232. },
  1233. {
  1234. pattern: /^Step$/,
  1235. componentDir: "steps"
  1236. },
  1237. {
  1238. pattern: /^(Thead|Td|Th|Tr|Tbody|TableColumn)$/,
  1239. componentDir: "table"
  1240. },
  1241. {
  1242. pattern: /^TagGroup$/,
  1243. componentDir: "tag"
  1244. },
  1245. {
  1246. pattern: /^TabPane$/,
  1247. componentDir: "tabs"
  1248. },
  1249. {
  1250. pattern: /^TimelineItem$/,
  1251. componentDir: "timeline"
  1252. },
  1253. {
  1254. pattern: /^(TypographyParagraph|TypographyTitle|TypographyText)$/,
  1255. componentDir: "typography"
  1256. }
  1257. ];
  1258. function getComponentStyleDir(importName, importStyle) {
  1259. if (["ConfigProvider", "Icon"].includes(importName))
  1260. return void 0;
  1261. let componentDir = _chunkUX65OJTHcjs.kebabCase.call(void 0, importName);
  1262. for (const item of matchComponents3) {
  1263. if (item.pattern.test(importName)) {
  1264. componentDir = item.componentDir;
  1265. break;
  1266. }
  1267. }
  1268. if (importStyle === "less")
  1269. return `@arco-design/web-vue/es/${componentDir}/style/index.js`;
  1270. if (importStyle === "css" || importStyle)
  1271. return `@arco-design/web-vue/es/${componentDir}/style/css.js`;
  1272. }
  1273. function canResolveIcons(options) {
  1274. if (options === void 0)
  1275. return false;
  1276. if (typeof options === "boolean")
  1277. return options;
  1278. else
  1279. return options.enable;
  1280. }
  1281. function getResolveIconPrefix(options) {
  1282. var _a;
  1283. if (canResolveIcons(options)) {
  1284. if (typeof options === "boolean" && options)
  1285. return "";
  1286. else if (options.enable)
  1287. return (_a = options.iconPrefix) != null ? _a : "";
  1288. else
  1289. return "";
  1290. }
  1291. return "";
  1292. }
  1293. function ArcoResolver(options = {}) {
  1294. return {
  1295. type: "component",
  1296. resolve: (name) => {
  1297. var _a;
  1298. if (canResolveIcons(options.resolveIcons)) {
  1299. const iconPrefix = _chunkUX65OJTHcjs.pascalCase.call(void 0, getResolveIconPrefix(options.resolveIcons));
  1300. const newNameRegexp = new RegExp(`^${iconPrefix}Icon`);
  1301. if (newNameRegexp.test(name)) {
  1302. debug("found icon component name %s", name);
  1303. const rawComponentName = name.slice(iconPrefix.length);
  1304. debug("found icon component raw name %s", rawComponentName);
  1305. return {
  1306. name: rawComponentName,
  1307. as: name,
  1308. from: "@arco-design/web-vue/es/icon"
  1309. };
  1310. }
  1311. }
  1312. if (name.match(/^A[A-Z]/) && !isExclude(name, options.exclude)) {
  1313. const importStyle = (_a = options.importStyle) != null ? _a : "css";
  1314. const importName = name.slice(1);
  1315. const config = {
  1316. name: importName,
  1317. from: "@arco-design/web-vue"
  1318. };
  1319. if (options.sideEffect !== false)
  1320. config.sideEffects = getComponentStyleDir(importName, importStyle);
  1321. return config;
  1322. }
  1323. }
  1324. };
  1325. }
  1326. // src/core/resolvers/tdesign.ts
  1327. function TDesignResolver(options = {}) {
  1328. const pluginList = ["DialogPlugin", "LoadingPlugin", "MessagePlugin", "NotifyPlugin"];
  1329. return {
  1330. type: "component",
  1331. resolve: (name) => {
  1332. const { library = "vue", exclude } = options;
  1333. const importFrom = options.esm ? "/esm" : "";
  1334. if (options.exclude && isExclude2(name, exclude))
  1335. return;
  1336. if (options.resolveIcons && name.match(/[a-z]Icon$/)) {
  1337. return {
  1338. name,
  1339. from: `tdesign-icons-${library}${importFrom}`
  1340. };
  1341. }
  1342. if (name.match(/^T[A-Z]/) || pluginList.includes(name)) {
  1343. const importName = name.match(/^T[A-Z]/) ? name.slice(1) : name;
  1344. return {
  1345. name: importName,
  1346. from: `tdesign-${library}${importFrom}`
  1347. };
  1348. }
  1349. }
  1350. };
  1351. }
  1352. function isExclude2(name, exclude) {
  1353. if (typeof exclude === "string")
  1354. return name === exclude;
  1355. if (exclude instanceof RegExp)
  1356. return !!name.match(exclude);
  1357. if (Array.isArray(exclude)) {
  1358. for (const item of exclude) {
  1359. if (name === item || name.match(item))
  1360. return true;
  1361. }
  1362. }
  1363. return false;
  1364. }
  1365. // src/core/resolvers/layui-vue.ts
  1366. var matchComponents4 = [
  1367. {
  1368. pattern: /^LayAvatarList$/,
  1369. styleDir: "avatar"
  1370. },
  1371. {
  1372. pattern: /^LayBreadcrumbItem$/,
  1373. styleDir: "breadcrumb"
  1374. },
  1375. {
  1376. pattern: /^(LayCarouselItem)$/,
  1377. styleDir: "carousel"
  1378. },
  1379. {
  1380. pattern: /^(LayCheckboxGroup)$/,
  1381. styleDir: "checkbox"
  1382. },
  1383. {
  1384. pattern: /^LayCol$/,
  1385. styleDir: "row"
  1386. },
  1387. {
  1388. pattern: /^(LayCollapseItem)$/,
  1389. styleDir: "collapse"
  1390. },
  1391. {
  1392. pattern: /^LayConfigProvider$/,
  1393. styleDir: void 0
  1394. },
  1395. {
  1396. pattern: /^LayCountUp$/,
  1397. styleDir: void 0
  1398. },
  1399. {
  1400. pattern: /^(LayDropdownMenu|LayDropdownMenuItem|LayDropdownSubMenu)$/,
  1401. styleDir: "dropdown"
  1402. },
  1403. {
  1404. pattern: /^(LayFormItem)$/,
  1405. styleDir: "form"
  1406. },
  1407. {
  1408. pattern: /^(LayMenuItem|LaySubMenu)$/,
  1409. styleDir: "menu"
  1410. },
  1411. {
  1412. pattern: /^(LayRadioGroup)$/,
  1413. styleDir: "radio"
  1414. },
  1415. {
  1416. pattern: /^LaySelectOption$/,
  1417. styleDir: "select"
  1418. },
  1419. {
  1420. pattern: /^LaySkeletonItem$/,
  1421. styleDir: "skeleton"
  1422. },
  1423. {
  1424. pattern: /^LaySplitPanelItem$/,
  1425. styleDir: "splitPanel"
  1426. },
  1427. {
  1428. pattern: /^LayStepItem$/,
  1429. styleDir: "step"
  1430. },
  1431. {
  1432. pattern: /^(LayTabItem)$/,
  1433. styleDir: "tab"
  1434. },
  1435. {
  1436. pattern: /^LayTimelineItem$/,
  1437. styleDir: "timeline"
  1438. }
  1439. ];
  1440. var layuiRE = /^Lay[A-Z]/;
  1441. var layerRE = /^(layer|LayLayer)$/;
  1442. var iconsRE = /^([A-Z][\w]+Icon|LayIcon)$/;
  1443. var libName = "@layui/layui-vue";
  1444. function lowerCamelCase(str) {
  1445. return str.charAt(0).toLowerCase() + str.slice(1);
  1446. }
  1447. function getSideEffects8(importName, options) {
  1448. const { importStyle = "css" } = options;
  1449. if (!importStyle)
  1450. return void 0;
  1451. if (libName !== "@layui/layui-vue")
  1452. return `${libName}/lib/index.css`;
  1453. let styleDir = lowerCamelCase(importName.slice(3));
  1454. for (const item of matchComponents4) {
  1455. if (item.pattern.test(importName)) {
  1456. styleDir = item.styleDir;
  1457. break;
  1458. }
  1459. }
  1460. if (importStyle === "css" || importStyle) {
  1461. return styleDir ? [`@layui/layui-vue/es/${styleDir}/index.css`, "@layui/layui-vue/es/index/index.css"] : void 0;
  1462. }
  1463. }
  1464. function resolveComponent2(importName, options) {
  1465. let name;
  1466. if (options.exclude && isExclude3(importName, options.exclude))
  1467. return void 0;
  1468. if (options.resolveIcons && importName.match(iconsRE)) {
  1469. name = importName;
  1470. libName = "@layui/icons-vue";
  1471. } else if (importName.match(layerRE)) {
  1472. name = importName;
  1473. libName = "@layui/layer-vue";
  1474. } else if (importName.match(layuiRE) && !importName.match(iconsRE)) {
  1475. name = importName;
  1476. libName = "@layui/layui-vue";
  1477. }
  1478. return name ? { name, from: libName, sideEffects: getSideEffects8(name, options) } : void 0;
  1479. }
  1480. function isExclude3(name, exclude) {
  1481. for (const item of exclude) {
  1482. if (name === item || name.match(item))
  1483. return true;
  1484. }
  1485. return false;
  1486. }
  1487. function LayuiVueResolver(options = {}) {
  1488. return {
  1489. type: "component",
  1490. resolve: (name) => {
  1491. return resolveComponent2(name, options);
  1492. }
  1493. };
  1494. }
  1495. // src/core/resolvers/bootstrap-vue.ts
  1496. var COMPONENT_ALIASES = {
  1497. BBtn: "BButton",
  1498. BBtnClose: "BButtonClose",
  1499. BBtnGroup: "BButtonGroup",
  1500. BBtnToolbar: "BButtonToolbar",
  1501. BCheck: "BFormCheckbox",
  1502. BCheckbox: "BFormCheckbox",
  1503. BCheckboxGroup: "BFormCheckboxGroup",
  1504. BCheckGroup: "BFormCheckboxGroup",
  1505. BDatalist: "BFormDatalist",
  1506. BDd: "BDropdown",
  1507. BDdDivider: "BDropdownDivider",
  1508. BDdForm: "BDropdownForm",
  1509. BDdGroup: "BDropdownGroup",
  1510. BDdHeader: "BDropdownHeader",
  1511. BDdItem: "BDropdownItem",
  1512. BDdItemButton: "BDropdownItemButton",
  1513. BDdItemBtn: "BDropdownItemButton",
  1514. BDdText: "BDropdownText",
  1515. BDropdownItemBtn: "BDropdownItemButton",
  1516. BFile: "BFormFile",
  1517. BDatepicker: "BFormDatepicker",
  1518. BInput: "BFormInput",
  1519. BNavDd: "BNavItemDropdown",
  1520. BNavDropdown: "BNavItemDropdown",
  1521. BNavItemDd: "BNavItemDropdown",
  1522. BNavToggle: "BNavbarToggle",
  1523. BRadio: "BFormRadio",
  1524. BRadioGroup: "BFormRadioGroup",
  1525. BRating: "BFormRating",
  1526. BSelect: "BFormSelect",
  1527. BSelectOption: "BFormSelectOption",
  1528. BSelectOptionGroup: "BFormSelectOptionGroup",
  1529. BSpinbutton: "BFormSpinbutton",
  1530. BTag: "BFormTag",
  1531. BTags: "BFormTags",
  1532. BTextarea: "BFormTextarea",
  1533. BTimepicker: "BFormTimepicker"
  1534. };
  1535. function BootstrapVueResolver(_options = {}) {
  1536. const options = _chunkWJIU4Q36cjs.__spreadValues.call(void 0, { directives: true }, _options);
  1537. const resolvers = [{
  1538. type: "component",
  1539. resolve: (name) => {
  1540. if (name.match(/^B[A-Z]/)) {
  1541. return {
  1542. name: COMPONENT_ALIASES[name] || name,
  1543. from: "bootstrap-vue"
  1544. };
  1545. }
  1546. }
  1547. }];
  1548. if (options.directives) {
  1549. resolvers.push({
  1550. type: "directive",
  1551. resolve: (name) => {
  1552. if (name.match(/^B[A-Z]/)) {
  1553. return {
  1554. name: `V${name}`,
  1555. from: "bootstrap-vue"
  1556. };
  1557. }
  1558. }
  1559. });
  1560. }
  1561. return resolvers;
  1562. }
  1563. function BootstrapVueNextResolver(_options = {}) {
  1564. const options = _chunkWJIU4Q36cjs.__spreadValues.call(void 0, { directives: true }, _options);
  1565. const resolvers = [{
  1566. type: "component",
  1567. resolve: (name) => {
  1568. if (name.match(/^B[A-Z]/))
  1569. return { name, from: "bootstrap-vue-next" };
  1570. }
  1571. }];
  1572. if (options.directives) {
  1573. resolvers.push({
  1574. type: "directive",
  1575. resolve: (name) => {
  1576. if (name.match(/^B[A-Z]/))
  1577. return { name: `v${name}`, from: "bootstrap-vue-next" };
  1578. }
  1579. });
  1580. }
  1581. return resolvers;
  1582. }
  1583. function BootstrapVue3Resolver(_options = {}) {
  1584. const options = _chunkWJIU4Q36cjs.__spreadValues.call(void 0, { directives: true }, _options);
  1585. const resolvers = [{
  1586. type: "component",
  1587. resolve: (name) => {
  1588. if (name.match(/^B[A-Z]/))
  1589. return { name, from: "bootstrap-vue-3" };
  1590. }
  1591. }];
  1592. if (options.directives) {
  1593. resolvers.push({
  1594. type: "directive",
  1595. resolve: (name) => {
  1596. if (name.match(/^B[A-Z]/))
  1597. return { name: `V${name}`, from: "bootstrap-vue-3" };
  1598. }
  1599. });
  1600. }
  1601. return resolvers;
  1602. }
  1603. // src/core/resolvers/ionic.ts
  1604. var IonicBuiltInComponents = [
  1605. "IonAccordion",
  1606. "IonAccordionGroup",
  1607. "IonActionSheet",
  1608. "IonAlert",
  1609. "IonApp",
  1610. "IonAvatar",
  1611. "IonBackButton",
  1612. "IonBackdrop",
  1613. "IonBadge",
  1614. "IonBreadcrumb",
  1615. "IonBreadcrumbs",
  1616. "IonButton",
  1617. "IonButtons",
  1618. "IonCard",
  1619. "IonCardContent",
  1620. "IonCardHeader",
  1621. "IonCardSubtitle",
  1622. "IonCardTitle",
  1623. "IonCheckbox",
  1624. "IonChip",
  1625. "IonCol",
  1626. "IonContent",
  1627. "IonDatetime",
  1628. "IonDatetimeButton",
  1629. "IonFab",
  1630. "IonFabButton",
  1631. "IonFabList",
  1632. "IonFooter",
  1633. "IonGrid",
  1634. "IonHeader",
  1635. "IonIcon",
  1636. "IonImg",
  1637. "IonInfiniteScroll",
  1638. "IonInfiniteScrollContent",
  1639. "IonInput",
  1640. "IonItem",
  1641. "IonItemDivider",
  1642. "IonItemGroup",
  1643. "IonItemOption",
  1644. "IonItemOptions",
  1645. "IonItemSliding",
  1646. "IonLabel",
  1647. "IonList",
  1648. "IonListHeader",
  1649. "IonLoading",
  1650. "IonMenu",
  1651. "IonMenuButton",
  1652. "IonMenuToggle",
  1653. "IonModal",
  1654. "IonNav",
  1655. "IonNavLink",
  1656. "IonNote",
  1657. "IonPage",
  1658. "IonPicker",
  1659. "IonPopover",
  1660. "IonProgressBar",
  1661. "IonRadio",
  1662. "IonRadioGroup",
  1663. "IonRange",
  1664. "IonRefresher",
  1665. "IonRefresherContent",
  1666. "IonReorder",
  1667. "IonReorderGroup",
  1668. "IonRippleEffect",
  1669. "IonRouterOutlet",
  1670. "IonRow",
  1671. "IonSearchbar",
  1672. "IonSegment",
  1673. "IonSegmentButton",
  1674. "IonSelect",
  1675. "IonSelectOption",
  1676. "IonSkeletonText",
  1677. "IonSpinner",
  1678. "IonSplitPane",
  1679. "IonTabBar",
  1680. "IonTabButton",
  1681. "IonTabs",
  1682. "IonText",
  1683. "IonTextarea",
  1684. "IonThumbnail",
  1685. "IonTitle",
  1686. "IonToast",
  1687. "IonToggle",
  1688. "IonToolbar"
  1689. ];
  1690. function IonicResolver() {
  1691. return {
  1692. type: "component",
  1693. resolve: (name) => {
  1694. if (IonicBuiltInComponents.includes(name)) {
  1695. return {
  1696. name,
  1697. from: "@ionic/vue"
  1698. };
  1699. }
  1700. }
  1701. };
  1702. }
  1703. exports.AntDesignVueResolver = AntDesignVueResolver; exports.ArcoResolver = ArcoResolver; exports.BootstrapVue3Resolver = BootstrapVue3Resolver; exports.BootstrapVueNextResolver = BootstrapVueNextResolver; exports.BootstrapVueResolver = BootstrapVueResolver; exports.DevUiResolver = DevUiResolver; exports.ElementPlusResolver = ElementPlusResolver; exports.ElementUiResolver = ElementUiResolver; exports.HeadlessUiResolver = HeadlessUiResolver; exports.IduxResolver = IduxResolver; exports.InklineResolver = InklineResolver; exports.IonicBuiltInComponents = IonicBuiltInComponents; exports.IonicResolver = IonicResolver; exports.LayuiVueResolver = LayuiVueResolver; exports.NaiveUiResolver = NaiveUiResolver; exports.PrimeVueResolver = PrimeVueResolver; exports.QuasarResolver = QuasarResolver; exports.TDesignResolver = TDesignResolver; exports.VantResolver = VantResolver; exports.VarletUIResolver = VarletUIResolver; exports.VeuiResolver = VeuiResolver; exports.ViewUiResolver = ViewUiResolver; exports.VueUseComponentsResolver = VueUseComponentsResolver; exports.VueUseDirectiveResolver = VueUseDirectiveResolver; exports.Vuetify3Resolver = Vuetify3Resolver; exports.VuetifyResolver = VuetifyResolver; exports.getResolved = getResolved;