king-design-analyzer 2.1.9 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (327) hide show
  1. package/components/actions.json +109 -0
  2. package/components/advancedset.json +128 -0
  3. package/components/affix.json +8 -0
  4. package/components/aksk.json +172 -0
  5. package/components/anchor.json +220 -0
  6. package/components/anchorlink.json +111 -0
  7. package/components/az.json +15 -2
  8. package/components/badge.json +8 -0
  9. package/components/billtypes.json +14 -2
  10. package/components/breadcrumb.json +9 -1
  11. package/components/button.json +192 -0
  12. package/components/buttonlink.json +74 -0
  13. package/components/card.json +14 -4
  14. package/components/cardcol.json +142 -0
  15. package/components/cardcols.json +121 -0
  16. package/components/cardcontent.json +20 -3
  17. package/components/cardtabs.json +172 -0
  18. package/components/carousel.json +7 -0
  19. package/components/cascader.json +576 -368
  20. package/components/checkbox.json +51 -4
  21. package/components/cidrinput.json +140 -0
  22. package/components/code.json +8 -1
  23. package/components/collapse.json +335 -341
  24. package/components/colorpicker.json +217 -0
  25. package/components/configprovider.json +96 -0
  26. package/components/copy.json +7 -0
  27. package/components/copyhover.json +111 -0
  28. package/components/copyrow.json +125 -0
  29. package/components/datepicker.json +656 -524
  30. package/components/description.json +98 -0
  31. package/components/descriptions.json +10 -3
  32. package/components/diagram.json +295 -0
  33. package/components/dialog.json +526 -455
  34. package/components/divider.json +9 -1
  35. package/components/drawer.json +603 -558
  36. package/components/dropdown.json +464 -384
  37. package/components/duration.json +125 -0
  38. package/components/editable.json +66 -0
  39. package/components/ellipsis.json +34 -1
  40. package/components/filtertablefieldsdialog.json +128 -0
  41. package/components/flex.json +152 -0
  42. package/components/form.json +143 -3
  43. package/components/formiteminput.json +214 -0
  44. package/components/formitemspinner.json +213 -0
  45. package/components/formitemswitch.json +185 -0
  46. package/components/formitemtableconfigs.json +210 -0
  47. package/components/grid.json +7 -0
  48. package/components/header.json +165 -0
  49. package/components/icon.json +13 -1
  50. package/components/icontooltip.json +19 -1
  51. package/components/input.json +196 -8
  52. package/components/instancelist.json +194 -0
  53. package/components/instancenum.json +196 -0
  54. package/components/ipinput.json +117 -0
  55. package/components/kspstatus.json +205 -0
  56. package/components/kvcode.json +120 -0
  57. package/components/layoutcontent.json +24 -3
  58. package/components/layoutlistcontent.json +157 -0
  59. package/components/layoutpermissioncontent.json +156 -0
  60. package/components/layoutstandardlist.json +276 -0
  61. package/components/layouttabs.json +168 -0
  62. package/components/lazymount.json +87 -0
  63. package/components/lazyteleport.json +119 -0
  64. package/components/menu.json +11 -3
  65. package/components/notification.json +351 -0
  66. package/components/pagination.json +12 -0
  67. package/components/paginationplus.json +30 -3
  68. package/components/password.json +121 -0
  69. package/components/popover.json +457 -437
  70. package/components/projects.json +129 -0
  71. package/components/protable.json +99 -8
  72. package/components/queuevisualrange.json +110 -0
  73. package/components/radio.json +82 -2
  74. package/components/rate.json +200 -0
  75. package/components/region.json +14 -2
  76. package/components/scrollselect.json +140 -0
  77. package/components/search.json +221 -0
  78. package/components/searchinput.json +132 -0
  79. package/components/searchitems.json +215 -0
  80. package/components/searchselect.json +195 -0
  81. package/components/select.json +749 -666
  82. package/components/sidebar.json +198 -0
  83. package/components/skeleton.json +234 -0
  84. package/components/slider.json +12 -2
  85. package/components/spin.json +10 -2
  86. package/components/spinner.json +419 -429
  87. package/components/split.json +263 -0
  88. package/components/sshkeys.json +138 -0
  89. package/components/status.json +60 -3
  90. package/components/steps.json +7 -0
  91. package/components/switch.json +12 -3
  92. package/components/table.json +24 -2
  93. package/components/tablecolumnid.json +14 -2
  94. package/components/tabs.json +14 -2
  95. package/components/tag.json +8 -5
  96. package/components/timeline.json +215 -0
  97. package/components/timepicker.json +147 -3
  98. package/components/timerange.json +262 -0
  99. package/components/tip.json +27 -0
  100. package/components/tooltip.json +492 -395
  101. package/components/tour.json +418 -372
  102. package/components/transfer.json +79 -8
  103. package/components/tree.json +28 -5
  104. package/components/treeselect.json +612 -475
  105. package/components/upload.json +474 -473
  106. package/components/vdialog.json +309 -0
  107. package/components/vdrawer.json +335 -0
  108. package/components/virtuallist.json +7 -0
  109. package/dist/ast/index.d.mts +65 -2
  110. package/dist/ast/index.d.ts +65 -2
  111. package/dist/ast/index.js +4 -3
  112. package/dist/ast/index.mjs +2 -1
  113. package/dist/chunk-4OTQAQ6J.mjs +341 -0
  114. package/dist/{chunk-F26GUCGG.js → chunk-4WXOYU2N.js} +32 -9
  115. package/dist/chunk-6HOIRUQB.mjs +409 -0
  116. package/dist/chunk-DHLWNT53.js +364 -0
  117. package/dist/{chunk-H2ET6MMM.mjs → chunk-IPJJMPOO.mjs} +155 -66
  118. package/dist/{chunk-WYSRJVX4.js → chunk-JJ6AB4ZH.js} +2 -2
  119. package/dist/{chunk-2W6OCG2S.js → chunk-JNRGUR3O.js} +155 -67
  120. package/dist/chunk-KF5YBEM5.js +143 -0
  121. package/dist/{chunk-OJOHB64C.mjs → chunk-LRTDTFFQ.mjs} +28 -5
  122. package/dist/{chunk-DSWKLUIX.mjs → chunk-NZL6T22V.mjs} +1 -1
  123. package/dist/chunk-QC6VTSA3.mjs +117 -0
  124. package/dist/chunk-V5N65MRP.js +411 -0
  125. package/dist/full/index.d.mts +2 -0
  126. package/dist/full/index.d.ts +2 -0
  127. package/dist/full/index.js +7 -6
  128. package/dist/full/index.mjs +5 -4
  129. package/dist/index.d.mts +1 -0
  130. package/dist/index.d.ts +1 -0
  131. package/dist/index.js +14 -13
  132. package/dist/index.mjs +6 -5
  133. package/dist/metadata/index.d.mts +38 -3
  134. package/dist/metadata/index.d.ts +38 -3
  135. package/dist/metadata/index.js +26 -16
  136. package/dist/metadata/index.mjs +26 -15
  137. package/dist/resolve-BsLBxlBi.d.mts +24 -0
  138. package/dist/resolve-BsLBxlBi.d.ts +24 -0
  139. package/dist/runtime/index.d.mts +2 -0
  140. package/dist/runtime/index.d.ts +2 -0
  141. package/dist/runtime/index.js +4 -4
  142. package/dist/runtime/index.mjs +2 -2
  143. package/dist/shared/index.d.mts +10 -0
  144. package/dist/shared/index.d.ts +10 -0
  145. package/dist/shared/index.js +23 -0
  146. package/dist/shared/index.mjs +2 -0
  147. package/dist/static/index.js +5 -5
  148. package/dist/static/index.mjs +2 -2
  149. package/docs_for_llm/actions.doc.md +87 -0
  150. package/docs_for_llm/advancedset.doc.md +98 -0
  151. package/docs_for_llm/affix.doc.md +20 -7
  152. package/docs_for_llm/aksk.doc.md +111 -0
  153. package/docs_for_llm/anchor.doc.md +155 -0
  154. package/docs_for_llm/anchorlink.doc.md +75 -0
  155. package/docs_for_llm/az.doc.md +17 -11
  156. package/docs_for_llm/badge.doc.md +11 -5
  157. package/docs_for_llm/billtypes.doc.md +17 -11
  158. package/docs_for_llm/breadcrumb.doc.md +80 -4
  159. package/docs_for_llm/button.doc.md +91 -18
  160. package/docs_for_llm/buttonlink.doc.md +64 -0
  161. package/docs_for_llm/card.doc.md +58 -8
  162. package/docs_for_llm/cardcol.doc.md +78 -0
  163. package/docs_for_llm/cardcols.doc.md +84 -0
  164. package/docs_for_llm/cardcontent.doc.md +31 -10
  165. package/docs_for_llm/cardtabs.doc.md +106 -0
  166. package/docs_for_llm/carousel.doc.md +79 -7
  167. package/docs_for_llm/cascader.doc.md +106 -23
  168. package/docs_for_llm/checkbox.doc.md +25 -13
  169. package/docs_for_llm/cidrinput.doc.md +83 -0
  170. package/docs_for_llm/code.doc.md +22 -11
  171. package/docs_for_llm/collapse.doc.md +147 -14
  172. package/docs_for_llm/colorpicker.doc.md +104 -0
  173. package/docs_for_llm/configprovider.doc.md +77 -0
  174. package/docs_for_llm/copy.doc.md +15 -13
  175. package/docs_for_llm/copyhover.doc.md +59 -0
  176. package/docs_for_llm/copyrow.doc.md +80 -0
  177. package/docs_for_llm/datepicker.doc.md +66 -35
  178. package/docs_for_llm/description.doc.md +75 -0
  179. package/docs_for_llm/descriptions.doc.md +122 -10
  180. package/docs_for_llm/diagram.doc.md +343 -0
  181. package/docs_for_llm/dialog.doc.md +97 -77
  182. package/docs_for_llm/divider.doc.md +14 -7
  183. package/docs_for_llm/drawer.doc.md +114 -69
  184. package/docs_for_llm/dropdown.doc.md +290 -22
  185. package/docs_for_llm/duration.doc.md +76 -0
  186. package/docs_for_llm/editable.doc.md +36 -14
  187. package/docs_for_llm/ellipsis.doc.md +10 -5
  188. package/docs_for_llm/filtertablefieldsdialog.doc.md +99 -0
  189. package/docs_for_llm/flex.doc.md +83 -0
  190. package/docs_for_llm/form.doc.md +196 -18
  191. package/docs_for_llm/formiteminput.doc.md +128 -0
  192. package/docs_for_llm/formitemspinner.doc.md +105 -0
  193. package/docs_for_llm/formitemswitch.doc.md +113 -0
  194. package/docs_for_llm/formitemtableconfigs.doc.md +95 -0
  195. package/docs_for_llm/grid.doc.md +78 -5
  196. package/docs_for_llm/header.doc.md +114 -0
  197. package/docs_for_llm/icon.doc.md +12 -8
  198. package/docs_for_llm/icontooltip.doc.md +121 -0
  199. package/docs_for_llm/input.doc.md +199 -41
  200. package/docs_for_llm/instancelist.doc.md +113 -0
  201. package/docs_for_llm/instancenum.doc.md +95 -0
  202. package/docs_for_llm/ipinput.doc.md +77 -0
  203. package/docs_for_llm/kspstatus.doc.md +82 -0
  204. package/docs_for_llm/kvcode.doc.md +76 -0
  205. package/docs_for_llm/layoutcontent.doc.md +54 -17
  206. package/docs_for_llm/layoutlistcontent.doc.md +168 -0
  207. package/docs_for_llm/layoutpermissioncontent.doc.md +93 -0
  208. package/docs_for_llm/layoutstandardlist.doc.md +129 -0
  209. package/docs_for_llm/layouttabs.doc.md +101 -0
  210. package/docs_for_llm/lazymount.doc.md +82 -0
  211. package/docs_for_llm/lazyteleport.doc.md +85 -0
  212. package/docs_for_llm/menu.doc.md +139 -14
  213. package/docs_for_llm/message.doc.md +93 -10
  214. package/docs_for_llm/notification.doc.md +214 -0
  215. package/docs_for_llm/pagination.doc.md +30 -17
  216. package/docs_for_llm/paginationplus.doc.md +31 -10
  217. package/docs_for_llm/password.doc.md +86 -0
  218. package/docs_for_llm/popover.doc.md +24 -55
  219. package/docs_for_llm/progress.doc.md +13 -10
  220. package/docs_for_llm/projects.doc.md +91 -0
  221. package/docs_for_llm/protable.doc.md +98 -15
  222. package/docs_for_llm/queuevisualrange.doc.md +78 -0
  223. package/docs_for_llm/radio.doc.md +23 -8
  224. package/docs_for_llm/rate.doc.md +127 -0
  225. package/docs_for_llm/region.doc.md +25 -13
  226. package/docs_for_llm/scrollselect.doc.md +90 -0
  227. package/docs_for_llm/search.doc.md +120 -0
  228. package/docs_for_llm/searchinput.doc.md +111 -0
  229. package/docs_for_llm/searchitems.doc.md +116 -0
  230. package/docs_for_llm/searchselect.doc.md +126 -0
  231. package/docs_for_llm/select.doc.md +208 -49
  232. package/docs_for_llm/sidebar.doc.md +133 -0
  233. package/docs_for_llm/skeleton.doc.md +152 -0
  234. package/docs_for_llm/slider.doc.md +42 -22
  235. package/docs_for_llm/spin.doc.md +18 -6
  236. package/docs_for_llm/spinner.doc.md +28 -18
  237. package/docs_for_llm/split.doc.md +170 -0
  238. package/docs_for_llm/sshkeys.doc.md +88 -0
  239. package/docs_for_llm/status.doc.md +14 -9
  240. package/docs_for_llm/steps.doc.md +81 -7
  241. package/docs_for_llm/switch.doc.md +32 -16
  242. package/docs_for_llm/table.doc.md +317 -55
  243. package/docs_for_llm/tablecolumnid.doc.md +36 -16
  244. package/docs_for_llm/tabs.doc.md +117 -12
  245. package/docs_for_llm/tag.doc.md +167 -15
  246. package/docs_for_llm/timeline.doc.md +187 -0
  247. package/docs_for_llm/timepicker.doc.md +74 -36
  248. package/docs_for_llm/timerange.doc.md +157 -0
  249. package/docs_for_llm/tip.doc.md +50 -11
  250. package/docs_for_llm/tooltip.doc.md +99 -27
  251. package/docs_for_llm/tour.doc.md +125 -28
  252. package/docs_for_llm/transfer.doc.md +99 -33
  253. package/docs_for_llm/tree.doc.md +129 -24
  254. package/docs_for_llm/treeselect.doc.md +101 -44
  255. package/docs_for_llm/upload.doc.md +63 -32
  256. package/docs_for_llm/useCRUD.doc.md +49 -0
  257. package/docs_for_llm/useCountdown.doc.md +43 -0
  258. package/docs_for_llm/useDetail.doc.md +48 -0
  259. package/docs_for_llm/useDialog.doc.md +46 -0
  260. package/docs_for_llm/useEntity.doc.md +45 -0
  261. package/docs_for_llm/useEventListener.doc.md +44 -0
  262. package/docs_for_llm/useFalseUntilTruthy.doc.md +41 -0
  263. package/docs_for_llm/useGetCopyAuthText.doc.md +35 -0
  264. package/docs_for_llm/useGetUserPermission.doc.md +43 -0
  265. package/docs_for_llm/useGroup.doc.md +48 -0
  266. package/docs_for_llm/useIdEntities.doc.md +48 -0
  267. package/docs_for_llm/useIdEntity.doc.md +103 -0
  268. package/docs_for_llm/useInterval.doc.md +43 -0
  269. package/docs_for_llm/useLayoutStandardList.doc.md +38 -0
  270. package/docs_for_llm/useMessage.doc.md +46 -0
  271. package/docs_for_llm/useModifyCache.doc.md +37 -0
  272. package/docs_for_llm/useOpenDialog.doc.md +41 -0
  273. package/docs_for_llm/usePagination.doc.md +60 -0
  274. package/docs_for_llm/usePersist.doc.md +54 -0
  275. package/docs_for_llm/usePoll.doc.md +41 -0
  276. package/docs_for_llm/useRoutePlus.doc.md +34 -0
  277. package/docs_for_llm/useRouterPlus.doc.md +34 -0
  278. package/docs_for_llm/useSearch.doc.md +68 -0
  279. package/docs_for_llm/useShell.doc.md +43 -0
  280. package/docs_for_llm/useSkip.doc.md +41 -0
  281. package/docs_for_llm/useStorageIdEntity.doc.md +46 -0
  282. package/docs_for_llm/useStore.doc.md +34 -0
  283. package/docs_for_llm/useTable.doc.md +57 -0
  284. package/docs_for_llm/useTableGroup.doc.md +47 -0
  285. package/docs_for_llm/useTableSort.doc.md +40 -0
  286. package/docs_for_llm/useToState.doc.md +112 -0
  287. package/docs_for_llm/useUser.doc.md +38 -0
  288. package/docs_for_llm/useValidForm.doc.md +41 -0
  289. package/docs_for_llm/vdialog.doc.md +154 -0
  290. package/docs_for_llm/vdrawer.doc.md +148 -0
  291. package/docs_for_llm/virtuallist.doc.md +157 -3
  292. package/hooks/useCRUD.json +61 -0
  293. package/hooks/useCountdown.json +49 -0
  294. package/hooks/useDetail.json +67 -0
  295. package/hooks/useDialog.json +49 -0
  296. package/hooks/useEntity.json +61 -0
  297. package/hooks/useEventListener.json +61 -0
  298. package/hooks/useFalseUntilTruthy.json +43 -0
  299. package/hooks/useGetCopyAuthText.json +36 -0
  300. package/hooks/useGetUserPermission.json +55 -0
  301. package/hooks/useGroup.json +49 -0
  302. package/hooks/useIdEntities.json +61 -0
  303. package/hooks/useInterval.json +55 -0
  304. package/hooks/useLayoutStandardList.json +36 -0
  305. package/hooks/useMessage.json +73 -0
  306. package/hooks/useModifyCache.json +36 -0
  307. package/hooks/useOpenDialog.json +43 -0
  308. package/hooks/usePagination.json +49 -0
  309. package/hooks/usePersist.json +61 -0
  310. package/hooks/usePoll.json +43 -0
  311. package/hooks/useRoutePlus.json +36 -0
  312. package/hooks/useRouterPlus.json +36 -0
  313. package/hooks/useSearch.json +56 -0
  314. package/hooks/useShell.json +49 -0
  315. package/hooks/useSkip.json +43 -0
  316. package/hooks/useStorageIdEntity.json +67 -0
  317. package/hooks/useStore.json +36 -0
  318. package/hooks/useTable.json +49 -0
  319. package/hooks/useTableGroup.json +43 -0
  320. package/hooks/useTableSort.json +43 -0
  321. package/hooks/useUser.json +36 -0
  322. package/hooks/useValidForm.json +43 -0
  323. package/package.json +14 -8
  324. package/dist/chunk-D3Y6FGWA.js +0 -153
  325. package/dist/chunk-HPAUCD5I.js +0 -156
  326. package/dist/chunk-L4DS3EXI.mjs +0 -133
  327. package/dist/chunk-NZ6TLWMD.mjs +0 -151
@@ -1,7 +1,10 @@
1
+ import { C as ComponentInheritance } from '../resolve-BsLBxlBi.js';
2
+
1
3
  /**
2
4
  * Components 元数据模块入口
3
5
  * 提供对 components 目录中 JSON 元数据的访问
4
6
  */
7
+
5
8
  /**
6
9
  * 组件元数据类型定义
7
10
  */
@@ -15,11 +18,13 @@ interface ComponentProp {
15
18
  required?: boolean;
16
19
  default?: string;
17
20
  usageExample?: string;
21
+ tags?: string[];
18
22
  }
19
23
  interface ComponentEvent {
20
24
  name: string;
21
25
  vueEventName?: string;
22
26
  description: string;
27
+ params?: ComponentActionParam[];
23
28
  payload?: {
24
29
  name: string;
25
30
  type: string;
@@ -27,11 +32,40 @@ interface ComponentEvent {
27
32
  }[];
28
33
  usageExample?: string;
29
34
  }
35
+ interface ComponentActionParam {
36
+ name: string;
37
+ type: string;
38
+ description: string;
39
+ optional?: boolean;
40
+ default?: string;
41
+ }
42
+ interface ComponentMethod {
43
+ name: string;
44
+ description: string;
45
+ params?: ComponentActionParam[];
46
+ returnType?: string;
47
+ usageExample?: string;
48
+ }
30
49
  interface ComponentSlot {
31
50
  name: string;
32
51
  description: string;
33
52
  vueTemplate?: string;
34
53
  usageExample?: string;
54
+ bindingType?: 'array' | 'object' | 'single' | 'none';
55
+ slotProps?: {
56
+ name: string;
57
+ type?: string;
58
+ description?: string;
59
+ destructuringExample?: string;
60
+ }[];
61
+ }
62
+ interface ComponentSubComponent {
63
+ name: string;
64
+ description: string;
65
+ props?: ComponentProp[];
66
+ events?: ComponentEvent[];
67
+ slots?: ComponentSlot[];
68
+ methods?: ComponentMethod[];
35
69
  }
36
70
  interface ComponentMetadata {
37
71
  id: string;
@@ -43,13 +77,14 @@ interface ComponentMetadata {
43
77
  props: ComponentProp[];
44
78
  events: ComponentEvent[];
45
79
  slots: ComponentSlot[];
46
- methods?: any[];
80
+ methods?: ComponentMethod[];
47
81
  examples?: any[];
48
- subComponents?: any[];
82
+ subComponents?: ComponentSubComponent[];
49
83
  commonMistakes?: any[];
50
84
  searchKeywords?: string[];
51
85
  useCases?: string[];
52
86
  relatedComponents?: string[];
87
+ inherits?: ComponentInheritance[];
53
88
  }
54
89
  /**
55
90
  * 获取所有可用的组件名称列表
@@ -74,4 +109,4 @@ declare function getComponentsDir(): string;
74
109
  */
75
110
  declare function getComponentPath(componentName: string): string;
76
111
 
77
- export { type ComponentEvent, type ComponentMetadata, type ComponentProp, type ComponentSlot, getAllComponentsMetadata, getComponentMetadata, getComponentPath, getComponentsDir, getComponentsList };
112
+ export { type ComponentActionParam, type ComponentEvent, type ComponentMetadata, type ComponentMethod, type ComponentProp, type ComponentSlot, type ComponentSubComponent, getAllComponentsMetadata, getComponentMetadata, getComponentPath, getComponentsDir, getComponentsList };
@@ -1,11 +1,10 @@
1
1
  'use strict';
2
2
 
3
+ var chunkKF5YBEM5_js = require('../chunk-KF5YBEM5.js');
3
4
  require('../chunk-JSBRDJBE.js');
4
5
  var fs = require('fs');
5
6
  var path = require('path');
6
- var url = require('url');
7
7
 
8
- var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
9
8
  function _interopNamespace(e) {
10
9
  if (e && e.__esModule) return e;
11
10
  var n = Object.create(null);
@@ -27,9 +26,21 @@ function _interopNamespace(e) {
27
26
  var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
28
27
  var path__namespace = /*#__PURE__*/_interopNamespace(path);
29
28
 
30
- var __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.js', document.baseURI).href)));
31
- var __dirname$1 = path__namespace.dirname(__filename$1);
32
- var COMPONENTS_DIR = path__namespace.resolve(__dirname$1, "../components");
29
+ var COMPONENTS_DIR = chunkKF5YBEM5_js.resolvePackageResourceDir("components");
30
+ function loadAllRawComponents() {
31
+ const metadata = {};
32
+ try {
33
+ const files = fs__namespace.readdirSync(COMPONENTS_DIR).filter((f) => f.endsWith(".json"));
34
+ for (const file of files) {
35
+ const content = fs__namespace.readFileSync(path__namespace.join(COMPONENTS_DIR, file), "utf-8");
36
+ const data = JSON.parse(content);
37
+ metadata[data.name] = data;
38
+ }
39
+ } catch {
40
+ return {};
41
+ }
42
+ return metadata;
43
+ }
33
44
  function getComponentsList() {
34
45
  try {
35
46
  return fs__namespace.readdirSync(COMPONENTS_DIR).filter((f) => f.endsWith(".json")).map((f) => f.replace(".json", ""));
@@ -39,23 +50,22 @@ function getComponentsList() {
39
50
  }
40
51
  function getComponentMetadata(componentName) {
41
52
  try {
42
- const filePath = path__namespace.join(COMPONENTS_DIR, `${componentName}.json`);
43
- const content = fs__namespace.readFileSync(filePath, "utf-8");
44
- return JSON.parse(content);
53
+ const rawMetadata = loadAllRawComponents();
54
+ const target = Object.values(rawMetadata).find(
55
+ (component) => component.name === componentName || component.id === componentName
56
+ );
57
+ return target ? chunkKF5YBEM5_js.resolveMetadataInheritance(target, rawMetadata) : null;
45
58
  } catch {
46
59
  return null;
47
60
  }
48
61
  }
49
62
  function getAllComponentsMetadata() {
50
- const metadata = {};
51
- const list = getComponentsList();
52
- for (const name of list) {
53
- const data = getComponentMetadata(name);
54
- if (data) {
55
- metadata[name] = data;
56
- }
63
+ const rawMetadata = loadAllRawComponents();
64
+ const resolvedMetadata = {};
65
+ for (const component of Object.values(rawMetadata)) {
66
+ resolvedMetadata[component.name] = chunkKF5YBEM5_js.resolveMetadataInheritance(component, rawMetadata);
57
67
  }
58
- return metadata;
68
+ return resolvedMetadata;
59
69
  }
60
70
  function getComponentsDir() {
61
71
  return COMPONENTS_DIR;
@@ -1,11 +1,23 @@
1
+ import { resolvePackageResourceDir, resolveMetadataInheritance } from '../chunk-QC6VTSA3.mjs';
1
2
  import '../chunk-UJCSKKID.mjs';
2
3
  import * as fs from 'fs';
3
4
  import * as path from 'path';
4
- import { fileURLToPath } from 'url';
5
5
 
6
- var __filename$1 = fileURLToPath(import.meta.url);
7
- var __dirname$1 = path.dirname(__filename$1);
8
- var COMPONENTS_DIR = path.resolve(__dirname$1, "../components");
6
+ var COMPONENTS_DIR = resolvePackageResourceDir("components");
7
+ function loadAllRawComponents() {
8
+ const metadata = {};
9
+ try {
10
+ const files = fs.readdirSync(COMPONENTS_DIR).filter((f) => f.endsWith(".json"));
11
+ for (const file of files) {
12
+ const content = fs.readFileSync(path.join(COMPONENTS_DIR, file), "utf-8");
13
+ const data = JSON.parse(content);
14
+ metadata[data.name] = data;
15
+ }
16
+ } catch {
17
+ return {};
18
+ }
19
+ return metadata;
20
+ }
9
21
  function getComponentsList() {
10
22
  try {
11
23
  return fs.readdirSync(COMPONENTS_DIR).filter((f) => f.endsWith(".json")).map((f) => f.replace(".json", ""));
@@ -15,23 +27,22 @@ function getComponentsList() {
15
27
  }
16
28
  function getComponentMetadata(componentName) {
17
29
  try {
18
- const filePath = path.join(COMPONENTS_DIR, `${componentName}.json`);
19
- const content = fs.readFileSync(filePath, "utf-8");
20
- return JSON.parse(content);
30
+ const rawMetadata = loadAllRawComponents();
31
+ const target = Object.values(rawMetadata).find(
32
+ (component) => component.name === componentName || component.id === componentName
33
+ );
34
+ return target ? resolveMetadataInheritance(target, rawMetadata) : null;
21
35
  } catch {
22
36
  return null;
23
37
  }
24
38
  }
25
39
  function getAllComponentsMetadata() {
26
- const metadata = {};
27
- const list = getComponentsList();
28
- for (const name of list) {
29
- const data = getComponentMetadata(name);
30
- if (data) {
31
- metadata[name] = data;
32
- }
40
+ const rawMetadata = loadAllRawComponents();
41
+ const resolvedMetadata = {};
42
+ for (const component of Object.values(rawMetadata)) {
43
+ resolvedMetadata[component.name] = resolveMetadataInheritance(component, rawMetadata);
33
44
  }
34
- return metadata;
45
+ return resolvedMetadata;
35
46
  }
36
47
  function getComponentsDir() {
37
48
  return COMPONENTS_DIR;
@@ -0,0 +1,24 @@
1
+ interface ComponentInheritance {
2
+ component: string;
3
+ include?: Array<'props' | 'events' | 'slots' | 'methods'>;
4
+ exclude?: string[];
5
+ }
6
+ type NamedItem = {
7
+ name: string;
8
+ tags?: string[];
9
+ [key: string]: any;
10
+ };
11
+ interface ResolvableComponentMetadata {
12
+ id?: string;
13
+ name: string;
14
+ props?: NamedItem[];
15
+ events?: NamedItem[];
16
+ slots?: NamedItem[];
17
+ methods?: NamedItem[];
18
+ inherits?: ComponentInheritance[];
19
+ [key: string]: any;
20
+ }
21
+ declare function normalizeMetadataName(value: string): string;
22
+ declare function resolveMetadataInheritance<T extends ResolvableComponentMetadata>(metadata: T, lookup: Record<string, T>, visited?: Set<string>): T;
23
+
24
+ export { type ComponentInheritance as C, type ResolvableComponentMetadata as R, normalizeMetadataName as n, resolveMetadataInheritance as r };
@@ -0,0 +1,24 @@
1
+ interface ComponentInheritance {
2
+ component: string;
3
+ include?: Array<'props' | 'events' | 'slots' | 'methods'>;
4
+ exclude?: string[];
5
+ }
6
+ type NamedItem = {
7
+ name: string;
8
+ tags?: string[];
9
+ [key: string]: any;
10
+ };
11
+ interface ResolvableComponentMetadata {
12
+ id?: string;
13
+ name: string;
14
+ props?: NamedItem[];
15
+ events?: NamedItem[];
16
+ slots?: NamedItem[];
17
+ methods?: NamedItem[];
18
+ inherits?: ComponentInheritance[];
19
+ [key: string]: any;
20
+ }
21
+ declare function normalizeMetadataName(value: string): string;
22
+ declare function resolveMetadataInheritance<T extends ResolvableComponentMetadata>(metadata: T, lookup: Record<string, T>, visited?: Set<string>): T;
23
+
24
+ export { type ComponentInheritance as C, type ResolvableComponentMetadata as R, normalizeMetadataName as n, resolveMetadataInheritance as r };
@@ -4,6 +4,8 @@ interface ValidationLayer {
4
4
  name: string;
5
5
  passed: boolean;
6
6
  errors: string[];
7
+ warnings?: string[];
8
+ status?: 'passed' | 'failed' | 'env_dependent' | 'runtime_skipped';
7
9
  }
8
10
  /**
9
11
  * 运行时预检查 (模拟执行)
@@ -4,6 +4,8 @@ interface ValidationLayer {
4
4
  name: string;
5
5
  passed: boolean;
6
6
  errors: string[];
7
+ warnings?: string[];
8
+ status?: 'passed' | 'failed' | 'env_dependent' | 'runtime_skipped';
7
9
  }
8
10
  /**
9
11
  * 运行时预检查 (模拟执行)
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var chunkD3Y6FGWA_js = require('../chunk-D3Y6FGWA.js');
4
- var chunkHPAUCD5I_js = require('../chunk-HPAUCD5I.js');
3
+ var chunkV5N65MRP_js = require('../chunk-V5N65MRP.js');
4
+ var chunkDHLWNT53_js = require('../chunk-DHLWNT53.js');
5
5
  require('../chunk-JSBRDJBE.js');
6
6
 
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "validateRuntimePrecheck", {
10
10
  enumerable: true,
11
- get: function () { return chunkD3Y6FGWA_js.validateRuntimePrecheck; }
11
+ get: function () { return chunkV5N65MRP_js.validateRuntimePrecheck; }
12
12
  });
13
13
  Object.defineProperty(exports, "compileSFC", {
14
14
  enumerable: true,
15
- get: function () { return chunkHPAUCD5I_js.compileSFC; }
15
+ get: function () { return chunkDHLWNT53_js.compileSFC; }
16
16
  });
@@ -1,3 +1,3 @@
1
- export { validateRuntimePrecheck } from '../chunk-NZ6TLWMD.mjs';
2
- export { compileSFC } from '../chunk-L4DS3EXI.mjs';
1
+ export { validateRuntimePrecheck } from '../chunk-6HOIRUQB.mjs';
2
+ export { compileSFC } from '../chunk-4OTQAQ6J.mjs';
3
3
  import '../chunk-UJCSKKID.mjs';
@@ -0,0 +1,10 @@
1
+ export { C as ComponentInheritance, R as ResolvableComponentMetadata, n as normalizeMetadataName, r as resolveMetadataInheritance } from '../resolve-BsLBxlBi.mjs';
2
+
3
+ interface ResolvePackagePathOptions {
4
+ cwd?: string;
5
+ packageName?: string;
6
+ }
7
+ declare function resolvePackageRoot(options?: ResolvePackagePathOptions): string | null;
8
+ declare function resolvePackageResourceDir(resourceDirName: string, options?: ResolvePackagePathOptions): string;
9
+
10
+ export { type ResolvePackagePathOptions, resolvePackageResourceDir, resolvePackageRoot };
@@ -0,0 +1,10 @@
1
+ export { C as ComponentInheritance, R as ResolvableComponentMetadata, n as normalizeMetadataName, r as resolveMetadataInheritance } from '../resolve-BsLBxlBi.js';
2
+
3
+ interface ResolvePackagePathOptions {
4
+ cwd?: string;
5
+ packageName?: string;
6
+ }
7
+ declare function resolvePackageRoot(options?: ResolvePackagePathOptions): string | null;
8
+ declare function resolvePackageResourceDir(resourceDirName: string, options?: ResolvePackagePathOptions): string;
9
+
10
+ export { type ResolvePackagePathOptions, resolvePackageResourceDir, resolvePackageRoot };
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ var chunkKF5YBEM5_js = require('../chunk-KF5YBEM5.js');
4
+ require('../chunk-JSBRDJBE.js');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "normalizeMetadataName", {
9
+ enumerable: true,
10
+ get: function () { return chunkKF5YBEM5_js.normalizeMetadataName; }
11
+ });
12
+ Object.defineProperty(exports, "resolveMetadataInheritance", {
13
+ enumerable: true,
14
+ get: function () { return chunkKF5YBEM5_js.resolveMetadataInheritance; }
15
+ });
16
+ Object.defineProperty(exports, "resolvePackageResourceDir", {
17
+ enumerable: true,
18
+ get: function () { return chunkKF5YBEM5_js.resolvePackageResourceDir; }
19
+ });
20
+ Object.defineProperty(exports, "resolvePackageRoot", {
21
+ enumerable: true,
22
+ get: function () { return chunkKF5YBEM5_js.resolvePackageRoot; }
23
+ });
@@ -0,0 +1,2 @@
1
+ export { normalizeMetadataName, resolveMetadataInheritance, resolvePackageResourceDir, resolvePackageRoot } from '../chunk-QC6VTSA3.mjs';
2
+ import '../chunk-UJCSKKID.mjs';
@@ -1,20 +1,20 @@
1
1
  'use strict';
2
2
 
3
- var chunkWYSRJVX4_js = require('../chunk-WYSRJVX4.js');
4
- var chunkHPAUCD5I_js = require('../chunk-HPAUCD5I.js');
3
+ var chunkJJ6AB4ZH_js = require('../chunk-JJ6AB4ZH.js');
4
+ var chunkDHLWNT53_js = require('../chunk-DHLWNT53.js');
5
5
  require('../chunk-JSBRDJBE.js');
6
6
 
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "validateCompilation", {
10
10
  enumerable: true,
11
- get: function () { return chunkWYSRJVX4_js.validateCompilation; }
11
+ get: function () { return chunkJJ6AB4ZH_js.validateCompilation; }
12
12
  });
13
13
  Object.defineProperty(exports, "compileSFC", {
14
14
  enumerable: true,
15
- get: function () { return chunkHPAUCD5I_js.compileSFC; }
15
+ get: function () { return chunkDHLWNT53_js.compileSFC; }
16
16
  });
17
17
  Object.defineProperty(exports, "scopeStyles", {
18
18
  enumerable: true,
19
- get: function () { return chunkHPAUCD5I_js.scopeStyles; }
19
+ get: function () { return chunkDHLWNT53_js.scopeStyles; }
20
20
  });
@@ -1,3 +1,3 @@
1
- export { validateCompilation } from '../chunk-DSWKLUIX.mjs';
2
- export { compileSFC, scopeStyles } from '../chunk-L4DS3EXI.mjs';
1
+ export { validateCompilation } from '../chunk-NZL6T22V.mjs';
2
+ export { compileSFC, scopeStyles } from '../chunk-4OTQAQ6J.mjs';
3
3
  import '../chunk-UJCSKKID.mjs';
@@ -0,0 +1,87 @@
1
+ # 操作按钮集 (Actions)
2
+
3
+ 用于组织主操作和次操作的按钮集合组件,常放在表格操作列、详情页头部和工具栏右侧,避免页面出现过多平铺按钮。
4
+
5
+ **关键词**: actions, action buttons, 操作按钮集, 更多操作, 主次操作, 操作列按钮
6
+
7
+ **使用场景**: 表格操作列、页面头部操作区、主次操作分层展示
8
+
9
+ ## 导入语句
10
+ ```typescript
11
+ import { Actions } from '@ksyun-internal/versatile';
12
+ ```
13
+
14
+ ## 属性 (Props)
15
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
16
+ | --- | --- | --- | --- | --- | --- | --- |
17
+ | primaries | `ActionConfig[]` | `[]` | 否 | 一级操作按钮列表 | - | - |
18
+ | secondaries | `ActionConfig[]` | `[]` | 否 | 二级操作按钮列表,通常展示在“更多”菜单中 | - | - |
19
+
20
+ ## 插槽 (Slots)
21
+ | 插槽名 | 说明 | 模板写法 | 示例 |
22
+ | --- | --- | --- | --- |
23
+ | btnText | 自定义按钮文案渲染 | `<template #btnText="{ action }">...</template>` | `<Actions>
24
+ <template <template #btnText="{ action }">...</template>>
25
+ {{ action }}
26
+ </template>
27
+ </Actions>` |
28
+
29
+ ### 插槽参数说明
30
+ **btnText**
31
+
32
+ - 参数结构: <template #btnText="{ action }">...</template>
33
+ - 参数列表: `action: ActionConfig`
34
+
35
+ ## 使用示例
36
+ ### 表格操作列中的主次操作
37
+ **场景**: 在列表行内同时承载高频与低频操作,减少操作列拥挤。
38
+
39
+ 将高频操作直接展示,低频操作折叠到更多菜单中。
40
+
41
+ **使用的 API**: 属性: primaries, secondaries
42
+
43
+ ```vue
44
+ <script setup lang="ts">
45
+ import { Actions } from '@ksyun-internal/versatile';
46
+
47
+ const primaries = [
48
+ { text: '重启', type: 'primary', onClick: () => console.log('restart') },
49
+ ];
50
+ const secondaries = [
51
+ { text: '续费', onClick: () => console.log('renew') },
52
+ { text: '释放', danger: true, onClick: () => console.log('delete') },
53
+ ];
54
+ </script>
55
+
56
+ <template>
57
+ <Actions :primaries="primaries" :secondaries="secondaries" />
58
+ </template>
59
+ ```
60
+
61
+ ### 自定义操作按钮文案
62
+ **场景**: 在操作区给危险动作补充更明确的文案提示。
63
+
64
+ 使用 btnText 插槽为危险操作补充风险提示。
65
+
66
+ **使用的 API**: 属性: primaries, secondaries
67
+
68
+ ```vue
69
+ <script setup lang="ts">
70
+ import { Actions } from '@ksyun-internal/versatile';
71
+
72
+ const primaries = [{ text: '启动', onClick: () => console.log('start') }];
73
+ const secondaries = [{ text: '释放', danger: true, onClick: () => console.log('release') }];
74
+ </script>
75
+
76
+ <template>
77
+ <Actions :primaries="primaries" :secondaries="secondaries">
78
+ <template #btnText="{ action }">
79
+ {{ action.danger ? action.text + '(高风险)' : action.text }}
80
+ </template>
81
+ </Actions>
82
+ </template>
83
+ ```
84
+
85
+ ## 相关组件
86
+ ButtonLink, IconTooltip
87
+
@@ -0,0 +1,98 @@
1
+ # 高级设置开关 (AdvancedSet)
2
+
3
+ 用于折叠和展开高级配置区域的业务组件,适合购买页、创建页中把非高频参数收进“高级设置”。
4
+
5
+ **关键词**: advanced set, advanced options, 高级设置, 折叠配置区, 高级参数
6
+
7
+ **使用场景**: 高级参数开关、可折叠配置区、编辑页默认展开高级设置
8
+
9
+ ## 导入语句
10
+ ```typescript
11
+ import { AdvancedSet } from '@ksyun-internal/versatile';
12
+ ```
13
+
14
+ ## 属性 (Props)
15
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
16
+ | --- | --- | --- | --- | --- | --- | --- |
17
+ | modelValue | `boolean` | `undefined` | 否 | 是否展开高级设置 | - | - |
18
+ | label | `string` | `undefined` | 否 | 标题文案 | - | - |
19
+ | appendTip | `string` | `undefined` | 否 | 追加提示文案 | - | - |
20
+
21
+ ## 事件 (Events)
22
+ | 事件名 | Vue事件名 | 说明 | 回调参数 | 示例 |
23
+ | --- | --- | --- | --- | --- |
24
+ | update:modelValue | `@update:modelValue` | 用户展开或收起高级设置区域时触发,可用于同步表单状态或埋点。 | `value?: boolean` | - |
25
+
26
+ ### 事件参数说明
27
+ **update:modelValue**
28
+
29
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
30
+ | --- | --- | --- | --- | --- |
31
+ | value | `boolean` | 否 | - | 当前高级设置区域的展开状态。 |
32
+
33
+ ## 插槽 (Slots)
34
+ | 插槽名 | 说明 | 模板写法 | 示例 |
35
+ | --- | --- | --- | --- |
36
+ | default | 高级设置内容区域 | `<AdvancedSet>...</AdvancedSet>` | `<AdvancedSet>
37
+ <template <AdvancedSet>...</AdvancedSet>>
38
+ 自定义default内容
39
+ </template>
40
+ </AdvancedSet>` |
41
+
42
+ ### 插槽参数说明
43
+ **default**
44
+
45
+ - 参数结构: 无参数
46
+
47
+ ## 使用示例
48
+ ### 购买页中的高级设置折叠区
49
+ **场景**: 创建实例时把网络、命名等低频参数收纳到高级设置区。
50
+
51
+ 默认收起高级参数,只在用户主动展开后展示额外配置。
52
+
53
+ **使用的 API**: 属性: modelValue, label, appendTip | 事件: update:modelValue
54
+
55
+ ```vue
56
+ <script setup lang="ts">
57
+ import { ref } from 'vue';
58
+ import { AdvancedSet, FormItemInput, FormItemSpinner } from '@ksyun-internal/versatile';
59
+
60
+ const advanced = ref(false);
61
+ const hostname = ref('web-01');
62
+ const bandwidth = ref(20);
63
+ </script>
64
+
65
+ <template>
66
+ <AdvancedSet v-model="advanced" label="高级设置" append-tip="修改后将影响实例网络配置">
67
+ <FormItemInput v-model="hostname" label="主机名" />
68
+ <FormItemSpinner v-model="bandwidth" label="带宽峰值" unit="Mbps" />
69
+ </AdvancedSet>
70
+ </template>
71
+ ```
72
+
73
+ ### 默认展开高级设置
74
+ **场景**: 在编辑页面中默认展开高级参数,方便用户快速核对设置。
75
+
76
+ 在编辑已有配置时直接展开高级区域,减少额外点击。
77
+
78
+ **使用的 API**: 属性: modelValue, label, appendTip | 事件: update:modelValue
79
+
80
+ ```vue
81
+ <script setup lang="ts">
82
+ import { ref } from 'vue';
83
+ import { AdvancedSet, FormItemSwitch } from '@ksyun-internal/versatile';
84
+
85
+ const advanced = ref(true);
86
+ const enableMonitor = ref(false);
87
+ </script>
88
+
89
+ <template>
90
+ <AdvancedSet v-model="advanced" label="高级设置" append-tip="修改后即时生效">
91
+ <FormItemSwitch v-model="enableMonitor" label="开启监控增强" />
92
+ </AdvancedSet>
93
+ </template>
94
+ ```
95
+
96
+ ## 相关组件
97
+ FormItemInput, FormItemSpinner
98
+
@@ -12,25 +12,38 @@ import { Affix } from '@king-design/vue';
12
12
  ```
13
13
 
14
14
  ## 属性 (Props)
15
- | 属性名 | 类型 | 默认值 | 必填 | 说明 | 示例 |
16
- | --- | --- | --- | --- | --- | --- |
17
- | top | `number` | `undefined` | 否 | 距离窗口顶部的偏移量,设置为 undefined 则不生效 | `<Affix :top="100"></Affix>` |
18
- | bottom | `number` | `undefined` | 否 | 距离窗口底部的偏移量,设置为 undefined 则不生效 | `<Affix :bottom="50"></Affix>` |
19
- | shouldFix | `Function` | `undefined` | 否 | 自定义是否需要固定的函数,返回 boolean | `<Affix :shouldFix="checkFix"></Affix>` |
20
- | exclude | `Function` | `undefined` | 否 | 自定义排除固定的函数,返回 boolean 表示不固定 | `<Affix :exclude="checkExclude"></Affix>` |
21
- | disabled | `boolean` | `false` | 否 | 是否禁用固定功能 | `<Affix disabled></Affix>` |
15
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
16
+ | --- | --- | --- | --- | --- | --- | --- |
17
+ | top | `number` | `undefined` | 否 | 距离窗口顶部的偏移量,设置为 undefined 则不生效 | - | `<Affix :top="100"></Affix>` |
18
+ | bottom | `number` | `undefined` | 否 | 距离窗口底部的偏移量,设置为 undefined 则不生效 | - | `<Affix :bottom="50"></Affix>` |
19
+ | shouldFix | `Function` | `undefined` | 否 | 自定义是否需要固定的函数,返回 boolean | - | `<Affix :shouldFix="checkFix"></Affix>` |
20
+ | exclude | `Function` | `undefined` | 否 | 自定义排除固定的函数,返回 boolean 表示不固定 | - | `<Affix :exclude="checkExclude"></Affix>` |
21
+ | disabled | `boolean` | `false` | 否 | 是否禁用固定功能 | - | `<Affix disabled></Affix>` |
22
22
 
23
23
  ## 事件 (Events)
24
24
  | 事件名 | Vue事件名 | 说明 | 回调参数 | 示例 |
25
25
  | --- | --- | --- | --- | --- |
26
26
  | change | `@change` | 固定状态改变时触发 | `isFixed: boolean` | `<Affix @change="handleChange"></Affix>` |
27
27
 
28
+ ### 事件参数说明
29
+ **change**
30
+
31
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
32
+ | --- | --- | --- | --- | --- |
33
+ | isFixed | `boolean` | 是 | - | 当前是否处于固定状态 |
34
+
28
35
  ## 插槽 (Slots)
29
36
  | 插槽名 | 说明 | 模板写法 | 示例 |
30
37
  | --- | --- | --- | --- |
31
38
  | default | 需要被固定的元素 | `#default` | `<Affix><Button>Fixed Button</Button></Affix>` |
32
39
 
40
+ ### 插槽参数说明
41
+ **default**
42
+
43
+ - 参数结构: 无参数
44
+
33
45
  ## 常见错误与正确用法 (Anti-Hallucination)
46
+ ### 父容器滚动问题
34
47
  > **错误用法**: `<div style="overflow: auto; height: 200px;">
35
48
  <Affix :top="10">...</Affix>
36
49
  </div>`