resolvers.js 46 KB

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