king-design-analyzer 2.1.7 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (311) hide show
  1. package/components/actions.json +101 -0
  2. package/components/advancedset.json +127 -0
  3. package/components/affix.json +7 -0
  4. package/components/aksk.json +172 -0
  5. package/components/az.json +15 -2
  6. package/components/badge.json +7 -0
  7. package/components/billtypes.json +14 -2
  8. package/components/breadcrumb.json +7 -0
  9. package/components/button.json +191 -0
  10. package/components/buttonlink.json +73 -0
  11. package/components/card.json +8 -1
  12. package/components/cardcol.json +142 -0
  13. package/components/cardcols.json +121 -0
  14. package/components/cardcontent.json +15 -3
  15. package/components/cardtabs.json +172 -0
  16. package/components/carousel.json +7 -0
  17. package/components/cascader.json +520 -368
  18. package/components/checkbox.json +51 -4
  19. package/components/cidrinput.json +140 -0
  20. package/components/code.json +8 -1
  21. package/components/collapse.json +7 -0
  22. package/components/colorpicker.json +217 -0
  23. package/components/copy.json +7 -0
  24. package/components/copyhover.json +111 -0
  25. package/components/copyrow.json +124 -0
  26. package/components/datepicker.json +656 -524
  27. package/components/description.json +98 -0
  28. package/components/dialog.json +522 -455
  29. package/components/divider.json +8 -1
  30. package/components/drawer.json +571 -558
  31. package/components/dropdown.json +464 -384
  32. package/components/duration.json +125 -0
  33. package/components/editable.json +66 -0
  34. package/components/ellipsis.json +34 -1
  35. package/components/filtertablefieldsdialog.json +128 -0
  36. package/components/flex.json +151 -0
  37. package/components/form.json +131 -0
  38. package/components/formiteminput.json +214 -0
  39. package/components/formitemspinner.json +213 -0
  40. package/components/formitemswitch.json +185 -0
  41. package/components/formitemtableconfigs.json +210 -0
  42. package/components/grid.json +7 -0
  43. package/components/header.json +161 -0
  44. package/components/icon.json +13 -1
  45. package/components/icontooltip.json +19 -1
  46. package/components/input.json +188 -4
  47. package/components/instancelist.json +194 -0
  48. package/components/instancenum.json +196 -0
  49. package/components/ipinput.json +117 -0
  50. package/components/kspstatus.json +205 -0
  51. package/components/kvcode.json +120 -0
  52. package/components/layoutcontent.json +15 -3
  53. package/components/layoutlistcontent.json +148 -0
  54. package/components/layoutpermissioncontent.json +155 -0
  55. package/components/layoutstandardlist.json +275 -0
  56. package/components/layouttabs.json +168 -0
  57. package/components/lazymount.json +86 -0
  58. package/components/lazyteleport.json +118 -0
  59. package/components/menu.json +7 -0
  60. package/components/pagination.json +12 -0
  61. package/components/paginationplus.json +30 -3
  62. package/components/password.json +121 -0
  63. package/components/popover.json +457 -437
  64. package/components/projects.json +129 -0
  65. package/components/protable.json +97 -8
  66. package/components/queuevisualrange.json +110 -0
  67. package/components/radio.json +82 -2
  68. package/components/rate.json +199 -0
  69. package/components/region.json +14 -2
  70. package/components/search.json +221 -0
  71. package/components/searchinput.json +132 -0
  72. package/components/searchitems.json +215 -0
  73. package/components/searchselect.json +195 -0
  74. package/components/select.json +686 -666
  75. package/components/sidebar.json +198 -0
  76. package/components/skeleton.json +233 -0
  77. package/components/spin.json +8 -1
  78. package/components/split.json +260 -0
  79. package/components/sshkeys.json +138 -0
  80. package/components/status.json +60 -3
  81. package/components/steps.json +7 -0
  82. package/components/switch.json +8 -1
  83. package/components/table.json +18 -1
  84. package/components/tablecolumnid.json +14 -2
  85. package/components/tabs.json +12 -0
  86. package/components/timeline.json +213 -0
  87. package/components/timepicker.json +147 -3
  88. package/components/timerange.json +262 -0
  89. package/components/tip.json +7 -0
  90. package/components/tooltip.json +484 -395
  91. package/components/tour.json +418 -372
  92. package/components/transfer.json +27 -3
  93. package/components/tree.json +6 -4
  94. package/components/treeselect.json +556 -475
  95. package/components/upload.json +474 -473
  96. package/components/vdialog.json +308 -0
  97. package/components/vdrawer.json +331 -0
  98. package/components/virtuallist.json +7 -0
  99. package/dist/ast/index.d.mts +35 -1
  100. package/dist/ast/index.d.ts +35 -1
  101. package/dist/ast/index.js +5 -3
  102. package/dist/ast/index.mjs +3 -1
  103. package/dist/{chunk-DSWKLUIX.mjs → chunk-3LYQ5XFM.mjs} +1 -1
  104. package/dist/chunk-BI5TIQID.mjs +330 -0
  105. package/dist/{chunk-6QS5IGS6.js → chunk-CJGGFVQJ.js} +8 -8
  106. package/dist/chunk-CR3GC4H3.js +353 -0
  107. package/dist/{chunk-NZ6TLWMD.mjs → chunk-D2SXGGTX.mjs} +28 -17
  108. package/dist/{chunk-D3Y6FGWA.js → chunk-EYKZY2F3.js} +29 -18
  109. package/dist/chunk-JSBRDJBE.js +30 -0
  110. package/dist/chunk-KF5YBEM5.js +143 -0
  111. package/dist/chunk-KMIDURUR.mjs +33324 -0
  112. package/dist/chunk-QC6VTSA3.mjs +117 -0
  113. package/dist/chunk-SZYVGYKK.js +33350 -0
  114. package/dist/{chunk-WYSRJVX4.js → chunk-TA3SV4SP.js} +2 -2
  115. package/dist/chunk-UJCSKKID.mjs +27 -0
  116. package/dist/{chunk-FVSQ6BU6.mjs → chunk-XGPHQHLR.mjs} +4 -4
  117. package/dist/docs/index.js +1 -1
  118. package/dist/docs/index.mjs +1 -1
  119. package/dist/full/index.js +8 -6
  120. package/dist/full/index.mjs +6 -4
  121. package/dist/index.d.mts +1 -0
  122. package/dist/index.d.ts +1 -0
  123. package/dist/index.js +15 -13
  124. package/dist/index.mjs +7 -5
  125. package/dist/metadata/index.d.mts +22 -2
  126. package/dist/metadata/index.d.ts +22 -2
  127. package/dist/metadata/index.js +27 -17
  128. package/dist/metadata/index.mjs +27 -16
  129. package/dist/resolve-BsLBxlBi.d.mts +24 -0
  130. package/dist/resolve-BsLBxlBi.d.ts +24 -0
  131. package/dist/runtime/index.js +5 -4
  132. package/dist/runtime/index.mjs +3 -2
  133. package/dist/shared/index.d.mts +10 -0
  134. package/dist/shared/index.d.ts +10 -0
  135. package/dist/shared/index.js +23 -0
  136. package/dist/shared/index.mjs +2 -0
  137. package/dist/static/index.js +6 -5
  138. package/dist/static/index.mjs +3 -2
  139. package/docs_for_llm/actions.doc.md +77 -0
  140. package/docs_for_llm/advancedset.doc.md +89 -0
  141. package/docs_for_llm/affix.doc.md +15 -7
  142. package/docs_for_llm/aksk.doc.md +111 -0
  143. package/docs_for_llm/az.doc.md +17 -11
  144. package/docs_for_llm/badge.doc.md +6 -5
  145. package/docs_for_llm/billtypes.doc.md +17 -11
  146. package/docs_for_llm/breadcrumb.doc.md +6 -3
  147. package/docs_for_llm/button.doc.md +34 -18
  148. package/docs_for_llm/buttonlink.doc.md +55 -0
  149. package/docs_for_llm/card.doc.md +8 -5
  150. package/docs_for_llm/cardcol.doc.md +78 -0
  151. package/docs_for_llm/cardcols.doc.md +84 -0
  152. package/docs_for_llm/cardcontent.doc.md +10 -10
  153. package/docs_for_llm/cardtabs.doc.md +106 -0
  154. package/docs_for_llm/carousel.doc.md +8 -7
  155. package/docs_for_llm/cascader.doc.md +46 -25
  156. package/docs_for_llm/checkbox.doc.md +25 -13
  157. package/docs_for_llm/cidrinput.doc.md +83 -0
  158. package/docs_for_llm/code.doc.md +22 -11
  159. package/docs_for_llm/collapse.doc.md +9 -6
  160. package/docs_for_llm/colorpicker.doc.md +104 -0
  161. package/docs_for_llm/copy.doc.md +15 -13
  162. package/docs_for_llm/copyhover.doc.md +59 -0
  163. package/docs_for_llm/copyrow.doc.md +71 -0
  164. package/docs_for_llm/datepicker.doc.md +51 -39
  165. package/docs_for_llm/description.doc.md +75 -0
  166. package/docs_for_llm/descriptions.doc.md +9 -6
  167. package/docs_for_llm/dialog.doc.md +48 -77
  168. package/docs_for_llm/divider.doc.md +9 -7
  169. package/docs_for_llm/drawer.doc.md +43 -84
  170. package/docs_for_llm/dropdown.doc.md +52 -21
  171. package/docs_for_llm/duration.doc.md +76 -0
  172. package/docs_for_llm/editable.doc.md +36 -14
  173. package/docs_for_llm/ellipsis.doc.md +10 -5
  174. package/docs_for_llm/filtertablefieldsdialog.doc.md +99 -0
  175. package/docs_for_llm/flex.doc.md +74 -0
  176. package/docs_for_llm/form.doc.md +33 -14
  177. package/docs_for_llm/formiteminput.doc.md +128 -0
  178. package/docs_for_llm/formitemspinner.doc.md +105 -0
  179. package/docs_for_llm/formitemswitch.doc.md +113 -0
  180. package/docs_for_llm/formitemtableconfigs.doc.md +95 -0
  181. package/docs_for_llm/grid.doc.md +7 -5
  182. package/docs_for_llm/header.doc.md +85 -0
  183. package/docs_for_llm/icon.doc.md +12 -8
  184. package/docs_for_llm/icontooltip.doc.md +121 -0
  185. package/docs_for_llm/input.doc.md +90 -39
  186. package/docs_for_llm/instancelist.doc.md +113 -0
  187. package/docs_for_llm/instancenum.doc.md +95 -0
  188. package/docs_for_llm/ipinput.doc.md +77 -0
  189. package/docs_for_llm/kspstatus.doc.md +82 -0
  190. package/docs_for_llm/kvcode.doc.md +76 -0
  191. package/docs_for_llm/layoutcontent.doc.md +17 -17
  192. package/docs_for_llm/layoutlistcontent.doc.md +95 -0
  193. package/docs_for_llm/layoutpermissioncontent.doc.md +84 -0
  194. package/docs_for_llm/layoutstandardlist.doc.md +120 -0
  195. package/docs_for_llm/layouttabs.doc.md +101 -0
  196. package/docs_for_llm/lazymount.doc.md +73 -0
  197. package/docs_for_llm/lazyteleport.doc.md +76 -0
  198. package/docs_for_llm/menu.doc.md +14 -11
  199. package/docs_for_llm/message.doc.md +48 -10
  200. package/docs_for_llm/pagination.doc.md +30 -17
  201. package/docs_for_llm/paginationplus.doc.md +31 -10
  202. package/docs_for_llm/password.doc.md +86 -0
  203. package/docs_for_llm/popover.doc.md +24 -55
  204. package/docs_for_llm/progress.doc.md +13 -10
  205. package/docs_for_llm/projects.doc.md +91 -0
  206. package/docs_for_llm/protable.doc.md +89 -15
  207. package/docs_for_llm/queuevisualrange.doc.md +78 -0
  208. package/docs_for_llm/radio.doc.md +23 -8
  209. package/docs_for_llm/rate.doc.md +122 -0
  210. package/docs_for_llm/region.doc.md +25 -13
  211. package/docs_for_llm/search.doc.md +120 -0
  212. package/docs_for_llm/searchinput.doc.md +111 -0
  213. package/docs_for_llm/searchitems.doc.md +116 -0
  214. package/docs_for_llm/searchselect.doc.md +126 -0
  215. package/docs_for_llm/select.doc.md +40 -55
  216. package/docs_for_llm/sidebar.doc.md +133 -0
  217. package/docs_for_llm/skeleton.doc.md +117 -0
  218. package/docs_for_llm/slider.doc.md +31 -21
  219. package/docs_for_llm/spin.doc.md +8 -5
  220. package/docs_for_llm/spinner.doc.md +28 -18
  221. package/docs_for_llm/split.doc.md +157 -0
  222. package/docs_for_llm/sshkeys.doc.md +88 -0
  223. package/docs_for_llm/status.doc.md +14 -9
  224. package/docs_for_llm/steps.doc.md +10 -7
  225. package/docs_for_llm/switch.doc.md +17 -14
  226. package/docs_for_llm/table.doc.md +118 -51
  227. package/docs_for_llm/tablecolumnid.doc.md +36 -16
  228. package/docs_for_llm/tabs.doc.md +19 -10
  229. package/docs_for_llm/tag.doc.md +19 -10
  230. package/docs_for_llm/timeline.doc.md +109 -0
  231. package/docs_for_llm/timepicker.doc.md +57 -38
  232. package/docs_for_llm/timerange.doc.md +157 -0
  233. package/docs_for_llm/tip.doc.md +20 -11
  234. package/docs_for_llm/tooltip.doc.md +55 -29
  235. package/docs_for_llm/tour.doc.md +48 -29
  236. package/docs_for_llm/transfer.doc.md +40 -29
  237. package/docs_for_llm/tree.doc.md +65 -23
  238. package/docs_for_llm/treeselect.doc.md +37 -48
  239. package/docs_for_llm/upload.doc.md +56 -32
  240. package/docs_for_llm/useCRUD.doc.md +49 -0
  241. package/docs_for_llm/useCountdown.doc.md +43 -0
  242. package/docs_for_llm/useDetail.doc.md +48 -0
  243. package/docs_for_llm/useDialog.doc.md +46 -0
  244. package/docs_for_llm/useEntity.doc.md +45 -0
  245. package/docs_for_llm/useEventListener.doc.md +44 -0
  246. package/docs_for_llm/useFalseUntilTruthy.doc.md +41 -0
  247. package/docs_for_llm/useGetCopyAuthText.doc.md +35 -0
  248. package/docs_for_llm/useGetUserPermission.doc.md +43 -0
  249. package/docs_for_llm/useGroup.doc.md +48 -0
  250. package/docs_for_llm/useIdEntities.doc.md +48 -0
  251. package/docs_for_llm/useIdEntity.doc.md +103 -0
  252. package/docs_for_llm/useInterval.doc.md +43 -0
  253. package/docs_for_llm/useLayoutStandardList.doc.md +38 -0
  254. package/docs_for_llm/useMessage.doc.md +46 -0
  255. package/docs_for_llm/useModifyCache.doc.md +37 -0
  256. package/docs_for_llm/useOpenDialog.doc.md +41 -0
  257. package/docs_for_llm/usePagination.doc.md +60 -0
  258. package/docs_for_llm/usePersist.doc.md +54 -0
  259. package/docs_for_llm/usePoll.doc.md +41 -0
  260. package/docs_for_llm/useRoutePlus.doc.md +34 -0
  261. package/docs_for_llm/useRouterPlus.doc.md +34 -0
  262. package/docs_for_llm/useSearch.doc.md +68 -0
  263. package/docs_for_llm/useShell.doc.md +43 -0
  264. package/docs_for_llm/useSkip.doc.md +41 -0
  265. package/docs_for_llm/useStorageIdEntity.doc.md +46 -0
  266. package/docs_for_llm/useStore.doc.md +34 -0
  267. package/docs_for_llm/useTable.doc.md +57 -0
  268. package/docs_for_llm/useTableGroup.doc.md +47 -0
  269. package/docs_for_llm/useTableSort.doc.md +40 -0
  270. package/docs_for_llm/useToState.doc.md +112 -0
  271. package/docs_for_llm/useUser.doc.md +38 -0
  272. package/docs_for_llm/useValidForm.doc.md +41 -0
  273. package/docs_for_llm/vdialog.doc.md +129 -0
  274. package/docs_for_llm/vdrawer.doc.md +119 -0
  275. package/docs_for_llm/virtuallist.doc.md +6 -3
  276. package/hooks/useCRUD.json +61 -0
  277. package/hooks/useCountdown.json +49 -0
  278. package/hooks/useDetail.json +67 -0
  279. package/hooks/useDialog.json +49 -0
  280. package/hooks/useEntity.json +61 -0
  281. package/hooks/useEventListener.json +61 -0
  282. package/hooks/useFalseUntilTruthy.json +43 -0
  283. package/hooks/useGetCopyAuthText.json +36 -0
  284. package/hooks/useGetUserPermission.json +55 -0
  285. package/hooks/useGroup.json +49 -0
  286. package/hooks/useIdEntities.json +61 -0
  287. package/hooks/useInterval.json +55 -0
  288. package/hooks/useLayoutStandardList.json +36 -0
  289. package/hooks/useMessage.json +73 -0
  290. package/hooks/useModifyCache.json +36 -0
  291. package/hooks/useOpenDialog.json +43 -0
  292. package/hooks/usePagination.json +49 -0
  293. package/hooks/usePersist.json +61 -0
  294. package/hooks/usePoll.json +43 -0
  295. package/hooks/useRoutePlus.json +36 -0
  296. package/hooks/useRouterPlus.json +36 -0
  297. package/hooks/useSearch.json +56 -0
  298. package/hooks/useShell.json +49 -0
  299. package/hooks/useSkip.json +43 -0
  300. package/hooks/useStorageIdEntity.json +67 -0
  301. package/hooks/useStore.json +36 -0
  302. package/hooks/useTable.json +49 -0
  303. package/hooks/useTableGroup.json +43 -0
  304. package/hooks/useTableSort.json +43 -0
  305. package/hooks/useUser.json +36 -0
  306. package/hooks/useValidForm.json +43 -0
  307. package/package.json +12 -6
  308. package/dist/chunk-HDV7ETXE.mjs +0 -1055
  309. package/dist/chunk-HPAUCD5I.js +0 -156
  310. package/dist/chunk-L4DS3EXI.mjs +0 -133
  311. package/dist/chunk-YWY3D4J7.js +0 -1082
@@ -106,10 +106,22 @@
106
106
  "area",
107
107
  "location",
108
108
  "地域",
109
- "区域"
109
+ "区域",
110
+ "大区",
111
+ "region select",
112
+ "地域选择"
110
113
  ],
111
114
  "useCases": [
112
115
  "购买页选择地域",
113
- "列表页筛选地域"
116
+ "列表页筛选地域",
117
+ "资源创建时切换可售卖地域",
118
+ "和 AZ 联动选择地域与可用区"
119
+ ],
120
+ "typeDefinitions": [
121
+ {
122
+ "name": "RegionItem",
123
+ "definition": "type RegionItem = {\\n code: string\\n name: string\\n areaCode?: string\\n}",
124
+ "description": "地域配置项结构,包含地域编码、展示名称和所属大区。"
125
+ }
114
126
  ]
115
127
  }
@@ -0,0 +1,221 @@
1
+ {
2
+ "id": "search",
3
+ "name": "Search",
4
+ "displayName": "组合搜索框",
5
+ "category": "form",
6
+ "description": "由搜索类型选择器和输入区域组合而成的业务搜索组件,适合列表页按名称、ID、状态等不同维度快速检索。",
7
+ "importStatement": "import { Search } from '@ksyun-internal/versatile';",
8
+ "props": [
9
+ {
10
+ "name": "searchKey",
11
+ "description": "当前选中的搜索类型 key",
12
+ "type": {
13
+ "raw": "string",
14
+ "kind": "string"
15
+ },
16
+ "required": false,
17
+ "default": "\"\""
18
+ },
19
+ {
20
+ "name": "searchValue",
21
+ "description": "当前输入或选择的搜索值",
22
+ "type": {
23
+ "raw": "string",
24
+ "kind": "string"
25
+ },
26
+ "required": false,
27
+ "default": "\"\""
28
+ },
29
+ {
30
+ "name": "searches",
31
+ "description": "搜索配置集合,支持数组或 key-value 对象",
32
+ "type": {
33
+ "raw": "SearchType[] | Record<string, SearchType>",
34
+ "kind": "union"
35
+ },
36
+ "required": true
37
+ },
38
+ {
39
+ "name": "searchGroups",
40
+ "description": "搜索类型分组配置",
41
+ "type": {
42
+ "raw": "SearchGroupItem[]",
43
+ "kind": "array"
44
+ },
45
+ "required": false,
46
+ "default": "undefined"
47
+ },
48
+ {
49
+ "name": "clearable",
50
+ "description": "是否允许清空搜索值",
51
+ "type": {
52
+ "raw": "boolean",
53
+ "kind": "boolean"
54
+ },
55
+ "required": false,
56
+ "default": "false"
57
+ },
58
+ {
59
+ "name": "leftWidth",
60
+ "description": "左侧搜索类型选择区域宽度",
61
+ "type": {
62
+ "raw": "string | number",
63
+ "kind": "union"
64
+ },
65
+ "required": false,
66
+ "default": "120"
67
+ },
68
+ {
69
+ "name": "rightWidth",
70
+ "description": "右侧搜索输入区域宽度",
71
+ "type": {
72
+ "raw": "string | number",
73
+ "kind": "union"
74
+ },
75
+ "required": false,
76
+ "default": "240"
77
+ }
78
+ ],
79
+ "events": [
80
+ {
81
+ "name": "clear",
82
+ "vueEventName": "@clear",
83
+ "description": "用户点击清空按钮后触发,通常用于重置搜索值并刷新列表。"
84
+ },
85
+ {
86
+ "name": "change:searchKey",
87
+ "vueEventName": "@change:searchKey",
88
+ "description": "搜索维度切换时触发,可据此切换占位提示或请求参数。",
89
+ "params": [
90
+ {
91
+ "name": "value",
92
+ "type": "string",
93
+ "description": "当前选中的搜索字段 key,例如 `name`、`project`、`privateIp`。"
94
+ },
95
+ {
96
+ "name": "current",
97
+ "type": "SearchType",
98
+ "description": "当前激活的搜索项配置对象,包含 label、type、placeholder 等信息。",
99
+ "optional": true
100
+ }
101
+ ]
102
+ },
103
+ {
104
+ "name": "change:searchValue",
105
+ "vueEventName": "@change:searchValue",
106
+ "description": "搜索值变化时触发,适合实时记录当前检索条件。",
107
+ "params": [
108
+ {
109
+ "name": "value",
110
+ "type": "string",
111
+ "description": "当前输入框或选择器中的搜索值。"
112
+ },
113
+ {
114
+ "name": "label",
115
+ "type": "string",
116
+ "description": "当前搜索值对应的展示文案,选择型搜索时常用于回显标签。",
117
+ "optional": true
118
+ },
119
+ {
120
+ "name": "current",
121
+ "type": "SearchType",
122
+ "description": "当前正在使用的搜索项配置对象。",
123
+ "optional": true
124
+ },
125
+ {
126
+ "name": "obj",
127
+ "type": "Record<string, any> | null",
128
+ "description": "选择型搜索命中的原始选项对象;输入型搜索通常为 `null`。",
129
+ "optional": true
130
+ }
131
+ ]
132
+ }
133
+ ],
134
+ "slots": [],
135
+ "methods": [],
136
+ "examples": [
137
+ {
138
+ "id": "search_instance_filters",
139
+ "title": "实例列表组合搜索",
140
+ "description": "在一个搜索框内切换按名称、实例 ID 或 IP 搜索。",
141
+ "difficulty": "easy",
142
+ "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Search } from '@ksyun-internal/versatile';\n\nconst searchKey = ref('name');\nconst searchValue = ref('web-prod');\nconst searches = [\n { key: 'name', label: '实例名称', type: 'input', placeholder: '请输入实例名称' },\n { key: 'id', label: '实例 ID', type: 'input', placeholder: '请输入实例 ID' },\n { key: 'ip', label: '内网 IP', type: 'input', placeholder: '请输入内网 IP' },\n];\n</script>\n\n<template>\n <Search\n v-model:search-key=\"searchKey\"\n v-model:search-value=\"searchValue\"\n :searches=\"searches\"\n :clearable=\"true\"\n />\n</template>",
143
+ "tags": [
144
+ "search",
145
+ "filter"
146
+ ],
147
+ "usedProps": [
148
+ "searchKey",
149
+ "searchValue",
150
+ "searches",
151
+ "clearable"
152
+ ],
153
+ "usedEvents": [
154
+ "change:searchKey",
155
+ "change:searchValue",
156
+ "clear"
157
+ ],
158
+ "usedMethods": [],
159
+ "scenario": "在列表页顶部提供按不同字段切换的统一搜索入口。"
160
+ },
161
+ {
162
+ "id": "search_grouped_filters",
163
+ "title": "按分组组织搜索条件",
164
+ "description": "通过 searchGroups 将资源类和网络类搜索条件分组展示。",
165
+ "difficulty": "medium",
166
+ "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Search } from '@ksyun-internal/versatile';\n\nconst searchKey = ref('project');\nconst searchValue = ref('core');\nconst searches = {\n name: { key: 'name', label: '实例名称', type: 'input', placeholder: '请输入实例名称' },\n project: { key: 'project', label: '项目名称', type: 'input', placeholder: '请输入项目名称' },\n privateIp: { key: 'privateIp', label: '内网 IP', type: 'input', placeholder: '请输入内网 IP' },\n};\nconst searchGroups = [\n { label: '资源信息', keys: ['name', 'project'] },\n { label: '网络信息', keys: ['privateIp'] },\n];\n</script>\n\n<template>\n <Search\n v-model:search-key=\"searchKey\"\n v-model:search-value=\"searchValue\"\n :searches=\"searches\"\n :search-groups=\"searchGroups\"\n :left-width=\"140\"\n :right-width=\"280\"\n />\n</template>",
167
+ "tags": [
168
+ "search",
169
+ "groups"
170
+ ],
171
+ "usedProps": [
172
+ "searchKey",
173
+ "searchValue",
174
+ "searches",
175
+ "searchGroups",
176
+ "leftWidth",
177
+ "rightWidth"
178
+ ],
179
+ "usedEvents": [
180
+ "change:searchKey",
181
+ "change:searchValue"
182
+ ],
183
+ "usedMethods": [],
184
+ "scenario": "在复杂列表页中把搜索条件按业务域分组,降低用户选择成本。"
185
+ }
186
+ ],
187
+ "searchKeywords": [
188
+ "search",
189
+ "filter",
190
+ "search bar",
191
+ "search by field",
192
+ "组合搜索",
193
+ "搜索框",
194
+ "多条件搜索",
195
+ "字段筛选"
196
+ ],
197
+ "useCases": [
198
+ "列表页关键字搜索",
199
+ "按类型切换搜索条件",
200
+ "和 SearchItems 联动的高级检索",
201
+ "控制台资源列表顶部搜索区"
202
+ ],
203
+ "relatedComponents": [
204
+ "SearchInput",
205
+ "SearchSelect",
206
+ "SearchItems",
207
+ "ProTable"
208
+ ],
209
+ "typeDefinitions": [
210
+ {
211
+ "name": "SearchType",
212
+ "definition": "type SearchType = {\n key: string\n label: string\n type?: 'input' | 'select' | 'custom'\n placeholder?: string\n list?: Array<{ key: string | number; label: string }>\n}",
213
+ "description": "单个搜索项配置,描述搜索字段、展示文案、输入类型和候选值。"
214
+ },
215
+ {
216
+ "name": "SearchGroupItem",
217
+ "definition": "type SearchGroupItem = {\n label: string\n keys: string[]\n}",
218
+ "description": "搜索项分组配置,用于把多个搜索字段按业务域归类展示。"
219
+ }
220
+ ]
221
+ }
@@ -0,0 +1,132 @@
1
+ {
2
+ "id": "searchinput",
3
+ "name": "SearchInput",
4
+ "displayName": "搜索输入框",
5
+ "category": "form",
6
+ "description": "轻量搜索输入框组件,适合工具栏关键词过滤、输入即搜或与列表查询按钮配套使用。",
7
+ "importStatement": "import { SearchInput } from '@ksyun-internal/versatile';",
8
+ "inherits": [
9
+ {
10
+ "component": "Input",
11
+ "include": [
12
+ "props"
13
+ ],
14
+ "exclude": [
15
+ "value",
16
+ "defaultValue"
17
+ ]
18
+ }
19
+ ],
20
+ "props": [
21
+ {
22
+ "name": "modelValue",
23
+ "description": "输入框当前值",
24
+ "type": {
25
+ "raw": "string",
26
+ "kind": "string"
27
+ },
28
+ "required": false,
29
+ "default": "\"\""
30
+ },
31
+ {
32
+ "name": "clearable",
33
+ "description": "是否显示清空按钮",
34
+ "type": {
35
+ "raw": "boolean",
36
+ "kind": "boolean"
37
+ },
38
+ "required": false,
39
+ "default": "false"
40
+ }
41
+ ],
42
+ "events": [
43
+ {
44
+ "name": "clear",
45
+ "vueEventName": "@clear",
46
+ "description": "用户清空关键词时触发,通常用于恢复默认列表数据。"
47
+ },
48
+ {
49
+ "name": "change:value",
50
+ "vueEventName": "@change:value",
51
+ "description": "搜索关键词完成一次确认输入时触发,适合发起查询请求。",
52
+ "params": [
53
+ {
54
+ "name": "value",
55
+ "type": "string",
56
+ "description": "本次确认提交的关键词。",
57
+ "optional": true
58
+ }
59
+ ]
60
+ }
61
+ ],
62
+ "slots": [],
63
+ "methods": [],
64
+ "examples": [
65
+ {
66
+ "id": "searchinput_toolbar",
67
+ "title": "工具栏关键字过滤",
68
+ "description": "在列表工具栏放置一个轻量搜索框,按名称快速过滤资源。",
69
+ "difficulty": "easy",
70
+ "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { SearchInput } from '@ksyun-internal/versatile';\n\nconst keyword = ref('');\n</script>\n\n<template>\n <SearchInput v-model=\"keyword\" :clearable=\"true\" placeholder=\"搜索实例名称\" />\n</template>",
71
+ "tags": [
72
+ "search",
73
+ "input"
74
+ ],
75
+ "usedProps": [
76
+ "modelValue",
77
+ "clearable",
78
+ "placeholder"
79
+ ],
80
+ "usedEvents": [
81
+ "change:value",
82
+ "clear"
83
+ ],
84
+ "usedMethods": [],
85
+ "scenario": "在工具栏中提供单关键字快速搜索。"
86
+ },
87
+ {
88
+ "id": "searchinput_confirm_query",
89
+ "title": "监听确认输入发起搜索",
90
+ "description": "通过 change:value 在用户确认输入后发起查询。",
91
+ "difficulty": "medium",
92
+ "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { SearchInput } from '@ksyun-internal/versatile';\n\nconst keyword = ref('');\nconst handleChange = (value: string) => {\n console.log('query keyword:', value);\n};\n</script>\n\n<template>\n <SearchInput\n v-model=\"keyword\"\n placeholder=\"请输入镜像名称\"\n @change:value=\"handleChange\"\n />\n</template>",
93
+ "tags": [
94
+ "search",
95
+ "event"
96
+ ],
97
+ "usedProps": [
98
+ "modelValue",
99
+ "placeholder"
100
+ ],
101
+ "usedEvents": [
102
+ "change:value"
103
+ ],
104
+ "usedMethods": [],
105
+ "scenario": "在用户回车或确认输入时再发起一次正式查询。"
106
+ }
107
+ ],
108
+ "searchKeywords": [
109
+ "search input",
110
+ "keyword search",
111
+ "输入搜索",
112
+ "搜索输入框",
113
+ "关键字过滤",
114
+ "单字段搜索"
115
+ ],
116
+ "useCases": [
117
+ "列表页关键字输入",
118
+ "工具栏快捷搜索",
119
+ "确认输入后发起查询"
120
+ ],
121
+ "typeDefinitions": [
122
+ {
123
+ "name": "SearchInputValue",
124
+ "definition": "type SearchInputValue = string",
125
+ "description": "搜索输入框绑定值类型。"
126
+ }
127
+ ],
128
+ "relatedComponents": [
129
+ "Search",
130
+ "Input"
131
+ ]
132
+ }
@@ -0,0 +1,215 @@
1
+ {
2
+ "id": "searchitems",
3
+ "name": "SearchItems",
4
+ "displayName": "检索项",
5
+ "category": "form",
6
+ "description": "用于展示和管理当前检索条件标签的组件,适合复杂筛选场景中回显用户已选条件,并支持快速删除和清空。",
7
+ "importStatement": "import { SearchItems } from '@ksyun-internal/versatile';",
8
+ "props": [
9
+ {
10
+ "name": "modelValue",
11
+ "description": "检索项数据对象",
12
+ "type": {
13
+ "raw": "Record<string, string | number>",
14
+ "kind": "object"
15
+ },
16
+ "required": false,
17
+ "default": "{}"
18
+ },
19
+ {
20
+ "name": "searchKey",
21
+ "description": "持久化存储时使用的 key",
22
+ "type": {
23
+ "raw": "string",
24
+ "kind": "string"
25
+ },
26
+ "required": false,
27
+ "default": "\"\""
28
+ },
29
+ {
30
+ "name": "title",
31
+ "description": "检索项区域标题",
32
+ "type": {
33
+ "raw": "string",
34
+ "kind": "string"
35
+ },
36
+ "required": false,
37
+ "default": "\"检索项\""
38
+ },
39
+ {
40
+ "name": "separator",
41
+ "description": "多值拼接分隔符",
42
+ "type": {
43
+ "raw": "string",
44
+ "kind": "string"
45
+ },
46
+ "required": false,
47
+ "default": "\"|\""
48
+ },
49
+ {
50
+ "name": "placeholderSeparator",
51
+ "description": "占位分隔符匹配规则",
52
+ "type": {
53
+ "raw": "string | RegExp",
54
+ "kind": "union"
55
+ },
56
+ "required": false,
57
+ "default": "/,+|\\|+/g"
58
+ }
59
+ ],
60
+ "events": [
61
+ {
62
+ "name": "delete:item",
63
+ "vueEventName": "@delete:item",
64
+ "description": "删除单个检索条件时触发,可用于同步列表查询参数。",
65
+ "params": [
66
+ {
67
+ "name": "key",
68
+ "type": "string",
69
+ "description": "被删除检索项所属的分组 key,通常对应当前列表或筛选区的唯一标识。",
70
+ "optional": true
71
+ },
72
+ {
73
+ "name": "value",
74
+ "type": "SearchItem",
75
+ "description": "被删除的检索项对象,包含 label、key、text、value 等字段。",
76
+ "optional": true
77
+ }
78
+ ]
79
+ },
80
+ {
81
+ "name": "delete:all",
82
+ "vueEventName": "@delete:all",
83
+ "description": "清空全部检索条件时触发,通常配合重置分页和重新拉取数据。"
84
+ }
85
+ ],
86
+ "slots": [],
87
+ "methods": [
88
+ {
89
+ "name": "get",
90
+ "description": "获取当前组件维护的全部检索项,用于外部读取当前筛选状态。",
91
+ "returnType": "SearchItem[]"
92
+ },
93
+ {
94
+ "name": "add",
95
+ "description": "追加一个新的检索条件,并立即同步到当前检索项列表中。",
96
+ "params": [
97
+ {
98
+ "name": "searchItem",
99
+ "type": "SearchItem",
100
+ "description": "待追加的检索项对象,通常包含 key、label 和 value。"
101
+ }
102
+ ],
103
+ "returnType": "void"
104
+ },
105
+ {
106
+ "name": "del",
107
+ "description": "按照给定条件删除一个已存在的检索项。",
108
+ "params": [
109
+ {
110
+ "name": "item",
111
+ "type": "Partial<SearchItem>",
112
+ "description": "用于匹配删除目标的条件对象,可传 key、label 或 value。"
113
+ },
114
+ {
115
+ "name": "unique",
116
+ "type": "boolean",
117
+ "description": "是否按唯一条件精确删除匹配项,适合区分同 key 下的多个候选值。",
118
+ "optional": true,
119
+ "default": "false"
120
+ },
121
+ {
122
+ "name": "isTriggerEmit",
123
+ "type": "boolean",
124
+ "description": "删除后是否继续触发组件事件,批量同步内部状态时可按需关闭。",
125
+ "optional": true,
126
+ "default": "true"
127
+ }
128
+ ],
129
+ "returnType": "void"
130
+ },
131
+ {
132
+ "name": "clear",
133
+ "description": "清空当前 searchKey 下保存的检索项,常用于重置单个列表视图的筛选状态。",
134
+ "returnType": "void"
135
+ },
136
+ {
137
+ "name": "clearAll",
138
+ "description": "清空组件维护的全部检索项,通常用于一键重置筛选条件。",
139
+ "returnType": "void"
140
+ }
141
+ ],
142
+ "examples": [
143
+ {
144
+ "id": "searchitems_filters",
145
+ "title": "复杂筛选条件回显",
146
+ "description": "把当前列表的多个过滤条件展示为可删除的检索项。",
147
+ "difficulty": "easy",
148
+ "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { SearchItems } from '@ksyun-internal/versatile';\n\nconst filters = ref({\n name: 'web-prod',\n status: 'running',\n project: '核心项目',\n});\n</script>\n\n<template>\n <SearchItems v-model=\"filters\" search-key=\"instance-list\" title=\"当前筛选\" />\n</template>",
149
+ "tags": [
150
+ "search",
151
+ "filters"
152
+ ],
153
+ "usedProps": [
154
+ "modelValue",
155
+ "searchKey",
156
+ "title"
157
+ ],
158
+ "usedEvents": [
159
+ "delete:item",
160
+ "delete:all"
161
+ ],
162
+ "usedMethods": [],
163
+ "scenario": "在复杂列表页中回显并管理用户已选择的过滤条件。"
164
+ },
165
+ {
166
+ "id": "searchitems_ref_methods",
167
+ "title": "通过组件方法清空检索项",
168
+ "description": "使用 ref 调用 clearAll,在切换列表视图时统一重置筛选条件。",
169
+ "difficulty": "medium",
170
+ "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { SearchItems } from '@ksyun-internal/versatile';\n\nconst searchItemsRef = ref<InstanceType<typeof SearchItems>>();\nconst filters = ref({\n name: 'web-prod',\n project: '核心项目',\n});\nconst resetFilters = () => {\n searchItemsRef.value?.clearAll();\n};\n</script>\n\n<template>\n <button @click=\"resetFilters\">重置全部筛选</button>\n <SearchItems ref=\"searchItemsRef\" v-model=\"filters\" search-key=\"instance-list\" />\n</template>",
171
+ "tags": [
172
+ "search",
173
+ "methods"
174
+ ],
175
+ "usedProps": [
176
+ "modelValue",
177
+ "searchKey"
178
+ ],
179
+ "usedEvents": [
180
+ "delete:all"
181
+ ],
182
+ "usedMethods": [
183
+ "clearAll"
184
+ ],
185
+ "scenario": "在切换页签或重置查询条件时,从外部统一清空当前检索项。"
186
+ }
187
+ ],
188
+ "searchKeywords": [
189
+ "search items",
190
+ "filters",
191
+ "filter tags",
192
+ "检索项",
193
+ "筛选条件",
194
+ "条件回显",
195
+ "搜索标签",
196
+ "已选条件"
197
+ ],
198
+ "useCases": [
199
+ "复杂检索条件回显",
200
+ "列表页多条件筛选",
201
+ "已选条件快速删除",
202
+ "列表页筛选状态持久化"
203
+ ],
204
+ "relatedComponents": [
205
+ "Search",
206
+ "ProTable"
207
+ ],
208
+ "typeDefinitions": [
209
+ {
210
+ "name": "SearchItem",
211
+ "definition": "type SearchItem = {\n key: string\n label?: string\n value: string | number\n}",
212
+ "description": "单个检索项的数据结构,描述筛选条件的键、展示文案和值。"
213
+ }
214
+ ]
215
+ }