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
@@ -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
+ }
@@ -0,0 +1,195 @@
1
+ {
2
+ "id": "searchselect",
3
+ "name": "SearchSelect",
4
+ "displayName": "搜索下拉框",
5
+ "category": "form",
6
+ "description": "面向搜索维度或搜索值选择的业务下拉组件,适合在搜索框左侧选择字段,也适合承载小规模筛选选项。",
7
+ "importStatement": "import { SearchSelect } from '@ksyun-internal/versatile';",
8
+ "inherits": [
9
+ {
10
+ "component": "Select",
11
+ "include": [
12
+ "props"
13
+ ],
14
+ "exclude": [
15
+ "value"
16
+ ]
17
+ }
18
+ ],
19
+ "props": [
20
+ {
21
+ "name": "label",
22
+ "description": "下拉框前置标题或说明文案",
23
+ "type": {
24
+ "raw": "string",
25
+ "kind": "string"
26
+ },
27
+ "required": false,
28
+ "default": "undefined"
29
+ },
30
+ {
31
+ "name": "helper",
32
+ "description": "辅助提示文案",
33
+ "type": {
34
+ "raw": "string",
35
+ "kind": "string"
36
+ },
37
+ "required": false,
38
+ "default": "undefined"
39
+ },
40
+ {
41
+ "name": "modelValue",
42
+ "description": "当前选中的值",
43
+ "type": {
44
+ "raw": "string",
45
+ "kind": "string"
46
+ },
47
+ "required": false,
48
+ "default": "\"\""
49
+ },
50
+ {
51
+ "name": "searches",
52
+ "description": "搜索选项列表",
53
+ "type": {
54
+ "raw": "SearchType[] | Record<string, SearchType>",
55
+ "kind": "union"
56
+ },
57
+ "required": false,
58
+ "default": "[]"
59
+ },
60
+ {
61
+ "name": "searchKeyName",
62
+ "description": "搜索项中 value 字段名",
63
+ "type": {
64
+ "raw": "string",
65
+ "kind": "string"
66
+ },
67
+ "required": false,
68
+ "default": "\"key\""
69
+ },
70
+ {
71
+ "name": "searchLabelName",
72
+ "description": "搜索项中 label 字段名",
73
+ "type": {
74
+ "raw": "string",
75
+ "kind": "string"
76
+ },
77
+ "required": false,
78
+ "default": "\"label\""
79
+ },
80
+ {
81
+ "name": "searchGroups",
82
+ "description": "搜索项分组配置",
83
+ "type": {
84
+ "raw": "SearchGroupItem[]",
85
+ "kind": "array"
86
+ },
87
+ "required": false,
88
+ "default": "undefined"
89
+ },
90
+ {
91
+ "name": "showValue",
92
+ "description": "选项展示时是否同时显示 value",
93
+ "type": {
94
+ "raw": "boolean",
95
+ "kind": "boolean"
96
+ },
97
+ "required": false,
98
+ "default": "false"
99
+ }
100
+ ],
101
+ "events": [
102
+ {
103
+ "name": "change:value",
104
+ "vueEventName": "@change:value",
105
+ "description": "下拉选中值变化时触发,通常用于联动输入框占位或直接发起查询。",
106
+ "params": [
107
+ {
108
+ "name": "value",
109
+ "type": "string",
110
+ "description": "当前选中的搜索项 key。",
111
+ "optional": true
112
+ }
113
+ ]
114
+ }
115
+ ],
116
+ "slots": [],
117
+ "methods": [],
118
+ "examples": [
119
+ {
120
+ "id": "searchselect_type",
121
+ "title": "选择搜索维度",
122
+ "description": "在组合搜索中用下拉框切换当前搜索字段。",
123
+ "difficulty": "easy",
124
+ "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { SearchSelect } from '@ksyun-internal/versatile';\n\nconst searchKey = ref('name');\nconst searches = [\n { key: 'name', label: '实例名称' },\n { key: 'id', label: '实例 ID' },\n { key: 'ip', label: '内网 IP' },\n];\n</script>\n\n<template>\n <SearchSelect\n v-model=\"searchKey\"\n label=\"搜索字段\"\n :searches=\"searches\"\n />\n</template>",
125
+ "tags": [
126
+ "search",
127
+ "select"
128
+ ],
129
+ "usedProps": [
130
+ "modelValue",
131
+ "label",
132
+ "searches"
133
+ ],
134
+ "usedEvents": [
135
+ "change:value"
136
+ ],
137
+ "usedMethods": [],
138
+ "scenario": "在列表搜索区切换当前按哪个字段检索。"
139
+ },
140
+ {
141
+ "id": "searchselect_show_value",
142
+ "title": "同时展示标签和值",
143
+ "description": "在选项较多时同时展示 value,方便用户准确识别字段。",
144
+ "difficulty": "medium",
145
+ "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { SearchSelect } from '@ksyun-internal/versatile';\n\nconst searchKey = ref('instanceId');\nconst searches = [\n { key: 'instanceId', label: '实例 ID' },\n { key: 'privateIp', label: '内网 IP' },\n { key: 'projectId', label: '项目 ID' },\n];\n</script>\n\n<template>\n <SearchSelect\n v-model=\"searchKey\"\n :searches=\"searches\"\n helper=\"请选择检索字段\"\n :show-value=\"true\"\n />\n</template>",
146
+ "tags": [
147
+ "search",
148
+ "value"
149
+ ],
150
+ "usedProps": [
151
+ "modelValue",
152
+ "searches",
153
+ "helper",
154
+ "showValue"
155
+ ],
156
+ "usedEvents": [
157
+ "change:value"
158
+ ],
159
+ "usedMethods": [],
160
+ "scenario": "在字段名称可能重复或歧义较大时同时展示 key 和 label。"
161
+ }
162
+ ],
163
+ "searchKeywords": [
164
+ "search select",
165
+ "search field select",
166
+ "filter select",
167
+ "下拉搜索",
168
+ "搜索下拉框",
169
+ "检索字段选择",
170
+ "筛选字段",
171
+ "条件下拉"
172
+ ],
173
+ "useCases": [
174
+ "搜索类型选择",
175
+ "业务下拉筛选",
176
+ "组合搜索左侧字段切换",
177
+ "小规模筛选项选择"
178
+ ],
179
+ "relatedComponents": [
180
+ "Search",
181
+ "Select"
182
+ ],
183
+ "typeDefinitions": [
184
+ {
185
+ "name": "SearchType",
186
+ "definition": "type SearchType = {\n key: string\n label: string\n helper?: string\n disabled?: boolean\n}",
187
+ "description": "下拉中可选的搜索字段配置,至少包含 key 和 label。"
188
+ },
189
+ {
190
+ "name": "SearchGroupItem",
191
+ "definition": "type SearchGroupItem = {\n label: string\n keys: string[]\n}",
192
+ "description": "搜索字段分组配置,用于按资源域或功能域展示下拉选项。"
193
+ }
194
+ ]
195
+ }