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.
- package/components/actions.json +101 -0
- package/components/advancedset.json +127 -0
- package/components/affix.json +7 -0
- package/components/aksk.json +172 -0
- package/components/az.json +15 -2
- package/components/badge.json +7 -0
- package/components/billtypes.json +14 -2
- package/components/breadcrumb.json +7 -0
- package/components/button.json +191 -0
- package/components/buttonlink.json +73 -0
- package/components/card.json +8 -1
- package/components/cardcol.json +142 -0
- package/components/cardcols.json +121 -0
- package/components/cardcontent.json +15 -3
- package/components/cardtabs.json +172 -0
- package/components/carousel.json +7 -0
- package/components/cascader.json +520 -368
- package/components/checkbox.json +51 -4
- package/components/cidrinput.json +140 -0
- package/components/code.json +8 -1
- package/components/collapse.json +7 -0
- package/components/colorpicker.json +217 -0
- package/components/copy.json +7 -0
- package/components/copyhover.json +111 -0
- package/components/copyrow.json +124 -0
- package/components/datepicker.json +656 -524
- package/components/description.json +98 -0
- package/components/dialog.json +522 -455
- package/components/divider.json +8 -1
- package/components/drawer.json +571 -558
- package/components/dropdown.json +464 -384
- package/components/duration.json +125 -0
- package/components/editable.json +66 -0
- package/components/ellipsis.json +34 -1
- package/components/filtertablefieldsdialog.json +128 -0
- package/components/flex.json +151 -0
- package/components/form.json +131 -0
- package/components/formiteminput.json +214 -0
- package/components/formitemspinner.json +213 -0
- package/components/formitemswitch.json +185 -0
- package/components/formitemtableconfigs.json +210 -0
- package/components/grid.json +7 -0
- package/components/header.json +161 -0
- package/components/icon.json +13 -1
- package/components/icontooltip.json +19 -1
- package/components/input.json +188 -4
- package/components/instancelist.json +194 -0
- package/components/instancenum.json +196 -0
- package/components/ipinput.json +117 -0
- package/components/kspstatus.json +205 -0
- package/components/kvcode.json +120 -0
- package/components/layoutcontent.json +15 -3
- package/components/layoutlistcontent.json +148 -0
- package/components/layoutpermissioncontent.json +155 -0
- package/components/layoutstandardlist.json +275 -0
- package/components/layouttabs.json +168 -0
- package/components/lazymount.json +86 -0
- package/components/lazyteleport.json +118 -0
- package/components/menu.json +7 -0
- package/components/pagination.json +12 -0
- package/components/paginationplus.json +30 -3
- package/components/password.json +121 -0
- package/components/popover.json +457 -437
- package/components/projects.json +129 -0
- package/components/protable.json +97 -8
- package/components/queuevisualrange.json +110 -0
- package/components/radio.json +82 -2
- package/components/rate.json +199 -0
- package/components/region.json +14 -2
- package/components/search.json +221 -0
- package/components/searchinput.json +132 -0
- package/components/searchitems.json +215 -0
- package/components/searchselect.json +195 -0
- package/components/select.json +686 -666
- package/components/sidebar.json +198 -0
- package/components/skeleton.json +233 -0
- package/components/spin.json +8 -1
- package/components/split.json +260 -0
- package/components/sshkeys.json +138 -0
- package/components/status.json +60 -3
- package/components/steps.json +7 -0
- package/components/switch.json +8 -1
- package/components/table.json +18 -1
- package/components/tablecolumnid.json +14 -2
- package/components/tabs.json +12 -0
- package/components/timeline.json +213 -0
- package/components/timepicker.json +147 -3
- package/components/timerange.json +262 -0
- package/components/tip.json +7 -0
- package/components/tooltip.json +484 -395
- package/components/tour.json +418 -372
- package/components/transfer.json +27 -3
- package/components/tree.json +6 -4
- package/components/treeselect.json +556 -475
- package/components/upload.json +474 -473
- package/components/vdialog.json +308 -0
- package/components/vdrawer.json +331 -0
- package/components/virtuallist.json +7 -0
- package/dist/ast/index.d.mts +35 -1
- package/dist/ast/index.d.ts +35 -1
- package/dist/ast/index.js +5 -3
- package/dist/ast/index.mjs +3 -1
- package/dist/{chunk-DSWKLUIX.mjs → chunk-3LYQ5XFM.mjs} +1 -1
- package/dist/chunk-BI5TIQID.mjs +330 -0
- package/dist/{chunk-6QS5IGS6.js → chunk-CJGGFVQJ.js} +8 -8
- package/dist/chunk-CR3GC4H3.js +353 -0
- package/dist/{chunk-NZ6TLWMD.mjs → chunk-D2SXGGTX.mjs} +28 -17
- package/dist/{chunk-D3Y6FGWA.js → chunk-EYKZY2F3.js} +29 -18
- package/dist/chunk-JSBRDJBE.js +30 -0
- package/dist/chunk-KF5YBEM5.js +143 -0
- package/dist/chunk-KMIDURUR.mjs +33324 -0
- package/dist/chunk-QC6VTSA3.mjs +117 -0
- package/dist/chunk-SZYVGYKK.js +33350 -0
- package/dist/{chunk-WYSRJVX4.js → chunk-TA3SV4SP.js} +2 -2
- package/dist/chunk-UJCSKKID.mjs +27 -0
- package/dist/{chunk-FVSQ6BU6.mjs → chunk-XGPHQHLR.mjs} +4 -4
- package/dist/docs/index.js +1 -1
- package/dist/docs/index.mjs +1 -1
- package/dist/full/index.js +8 -6
- package/dist/full/index.mjs +6 -4
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +15 -13
- package/dist/index.mjs +7 -5
- package/dist/metadata/index.d.mts +22 -2
- package/dist/metadata/index.d.ts +22 -2
- package/dist/metadata/index.js +27 -17
- package/dist/metadata/index.mjs +27 -16
- package/dist/resolve-BsLBxlBi.d.mts +24 -0
- package/dist/resolve-BsLBxlBi.d.ts +24 -0
- package/dist/runtime/index.js +5 -4
- package/dist/runtime/index.mjs +3 -2
- package/dist/shared/index.d.mts +10 -0
- package/dist/shared/index.d.ts +10 -0
- package/dist/shared/index.js +23 -0
- package/dist/shared/index.mjs +2 -0
- package/dist/static/index.js +6 -5
- package/dist/static/index.mjs +3 -2
- package/docs_for_llm/actions.doc.md +77 -0
- package/docs_for_llm/advancedset.doc.md +89 -0
- package/docs_for_llm/affix.doc.md +15 -7
- package/docs_for_llm/aksk.doc.md +111 -0
- package/docs_for_llm/az.doc.md +17 -11
- package/docs_for_llm/badge.doc.md +6 -5
- package/docs_for_llm/billtypes.doc.md +17 -11
- package/docs_for_llm/breadcrumb.doc.md +6 -3
- package/docs_for_llm/button.doc.md +34 -18
- package/docs_for_llm/buttonlink.doc.md +55 -0
- package/docs_for_llm/card.doc.md +8 -5
- package/docs_for_llm/cardcol.doc.md +78 -0
- package/docs_for_llm/cardcols.doc.md +84 -0
- package/docs_for_llm/cardcontent.doc.md +10 -10
- package/docs_for_llm/cardtabs.doc.md +106 -0
- package/docs_for_llm/carousel.doc.md +8 -7
- package/docs_for_llm/cascader.doc.md +46 -25
- package/docs_for_llm/checkbox.doc.md +25 -13
- package/docs_for_llm/cidrinput.doc.md +83 -0
- package/docs_for_llm/code.doc.md +22 -11
- package/docs_for_llm/collapse.doc.md +9 -6
- package/docs_for_llm/colorpicker.doc.md +104 -0
- package/docs_for_llm/copy.doc.md +15 -13
- package/docs_for_llm/copyhover.doc.md +59 -0
- package/docs_for_llm/copyrow.doc.md +71 -0
- package/docs_for_llm/datepicker.doc.md +51 -39
- package/docs_for_llm/description.doc.md +75 -0
- package/docs_for_llm/descriptions.doc.md +9 -6
- package/docs_for_llm/dialog.doc.md +48 -77
- package/docs_for_llm/divider.doc.md +9 -7
- package/docs_for_llm/drawer.doc.md +43 -84
- package/docs_for_llm/dropdown.doc.md +52 -21
- package/docs_for_llm/duration.doc.md +76 -0
- package/docs_for_llm/editable.doc.md +36 -14
- package/docs_for_llm/ellipsis.doc.md +10 -5
- package/docs_for_llm/filtertablefieldsdialog.doc.md +99 -0
- package/docs_for_llm/flex.doc.md +74 -0
- package/docs_for_llm/form.doc.md +33 -14
- package/docs_for_llm/formiteminput.doc.md +128 -0
- package/docs_for_llm/formitemspinner.doc.md +105 -0
- package/docs_for_llm/formitemswitch.doc.md +113 -0
- package/docs_for_llm/formitemtableconfigs.doc.md +95 -0
- package/docs_for_llm/grid.doc.md +7 -5
- package/docs_for_llm/header.doc.md +85 -0
- package/docs_for_llm/icon.doc.md +12 -8
- package/docs_for_llm/icontooltip.doc.md +121 -0
- package/docs_for_llm/input.doc.md +90 -39
- package/docs_for_llm/instancelist.doc.md +113 -0
- package/docs_for_llm/instancenum.doc.md +95 -0
- package/docs_for_llm/ipinput.doc.md +77 -0
- package/docs_for_llm/kspstatus.doc.md +82 -0
- package/docs_for_llm/kvcode.doc.md +76 -0
- package/docs_for_llm/layoutcontent.doc.md +17 -17
- package/docs_for_llm/layoutlistcontent.doc.md +95 -0
- package/docs_for_llm/layoutpermissioncontent.doc.md +84 -0
- package/docs_for_llm/layoutstandardlist.doc.md +120 -0
- package/docs_for_llm/layouttabs.doc.md +101 -0
- package/docs_for_llm/lazymount.doc.md +73 -0
- package/docs_for_llm/lazyteleport.doc.md +76 -0
- package/docs_for_llm/menu.doc.md +14 -11
- package/docs_for_llm/message.doc.md +48 -10
- package/docs_for_llm/pagination.doc.md +30 -17
- package/docs_for_llm/paginationplus.doc.md +31 -10
- package/docs_for_llm/password.doc.md +86 -0
- package/docs_for_llm/popover.doc.md +24 -55
- package/docs_for_llm/progress.doc.md +13 -10
- package/docs_for_llm/projects.doc.md +91 -0
- package/docs_for_llm/protable.doc.md +89 -15
- package/docs_for_llm/queuevisualrange.doc.md +78 -0
- package/docs_for_llm/radio.doc.md +23 -8
- package/docs_for_llm/rate.doc.md +122 -0
- package/docs_for_llm/region.doc.md +25 -13
- package/docs_for_llm/search.doc.md +120 -0
- package/docs_for_llm/searchinput.doc.md +111 -0
- package/docs_for_llm/searchitems.doc.md +116 -0
- package/docs_for_llm/searchselect.doc.md +126 -0
- package/docs_for_llm/select.doc.md +40 -55
- package/docs_for_llm/sidebar.doc.md +133 -0
- package/docs_for_llm/skeleton.doc.md +117 -0
- package/docs_for_llm/slider.doc.md +31 -21
- package/docs_for_llm/spin.doc.md +8 -5
- package/docs_for_llm/spinner.doc.md +28 -18
- package/docs_for_llm/split.doc.md +157 -0
- package/docs_for_llm/sshkeys.doc.md +88 -0
- package/docs_for_llm/status.doc.md +14 -9
- package/docs_for_llm/steps.doc.md +10 -7
- package/docs_for_llm/switch.doc.md +17 -14
- package/docs_for_llm/table.doc.md +118 -51
- package/docs_for_llm/tablecolumnid.doc.md +36 -16
- package/docs_for_llm/tabs.doc.md +19 -10
- package/docs_for_llm/tag.doc.md +19 -10
- package/docs_for_llm/timeline.doc.md +109 -0
- package/docs_for_llm/timepicker.doc.md +57 -38
- package/docs_for_llm/timerange.doc.md +157 -0
- package/docs_for_llm/tip.doc.md +20 -11
- package/docs_for_llm/tooltip.doc.md +55 -29
- package/docs_for_llm/tour.doc.md +48 -29
- package/docs_for_llm/transfer.doc.md +40 -29
- package/docs_for_llm/tree.doc.md +65 -23
- package/docs_for_llm/treeselect.doc.md +37 -48
- package/docs_for_llm/upload.doc.md +56 -32
- package/docs_for_llm/useCRUD.doc.md +49 -0
- package/docs_for_llm/useCountdown.doc.md +43 -0
- package/docs_for_llm/useDetail.doc.md +48 -0
- package/docs_for_llm/useDialog.doc.md +46 -0
- package/docs_for_llm/useEntity.doc.md +45 -0
- package/docs_for_llm/useEventListener.doc.md +44 -0
- package/docs_for_llm/useFalseUntilTruthy.doc.md +41 -0
- package/docs_for_llm/useGetCopyAuthText.doc.md +35 -0
- package/docs_for_llm/useGetUserPermission.doc.md +43 -0
- package/docs_for_llm/useGroup.doc.md +48 -0
- package/docs_for_llm/useIdEntities.doc.md +48 -0
- package/docs_for_llm/useIdEntity.doc.md +103 -0
- package/docs_for_llm/useInterval.doc.md +43 -0
- package/docs_for_llm/useLayoutStandardList.doc.md +38 -0
- package/docs_for_llm/useMessage.doc.md +46 -0
- package/docs_for_llm/useModifyCache.doc.md +37 -0
- package/docs_for_llm/useOpenDialog.doc.md +41 -0
- package/docs_for_llm/usePagination.doc.md +60 -0
- package/docs_for_llm/usePersist.doc.md +54 -0
- package/docs_for_llm/usePoll.doc.md +41 -0
- package/docs_for_llm/useRoutePlus.doc.md +34 -0
- package/docs_for_llm/useRouterPlus.doc.md +34 -0
- package/docs_for_llm/useSearch.doc.md +68 -0
- package/docs_for_llm/useShell.doc.md +43 -0
- package/docs_for_llm/useSkip.doc.md +41 -0
- package/docs_for_llm/useStorageIdEntity.doc.md +46 -0
- package/docs_for_llm/useStore.doc.md +34 -0
- package/docs_for_llm/useTable.doc.md +57 -0
- package/docs_for_llm/useTableGroup.doc.md +47 -0
- package/docs_for_llm/useTableSort.doc.md +40 -0
- package/docs_for_llm/useToState.doc.md +112 -0
- package/docs_for_llm/useUser.doc.md +38 -0
- package/docs_for_llm/useValidForm.doc.md +41 -0
- package/docs_for_llm/vdialog.doc.md +129 -0
- package/docs_for_llm/vdrawer.doc.md +119 -0
- package/docs_for_llm/virtuallist.doc.md +6 -3
- package/hooks/useCRUD.json +61 -0
- package/hooks/useCountdown.json +49 -0
- package/hooks/useDetail.json +67 -0
- package/hooks/useDialog.json +49 -0
- package/hooks/useEntity.json +61 -0
- package/hooks/useEventListener.json +61 -0
- package/hooks/useFalseUntilTruthy.json +43 -0
- package/hooks/useGetCopyAuthText.json +36 -0
- package/hooks/useGetUserPermission.json +55 -0
- package/hooks/useGroup.json +49 -0
- package/hooks/useIdEntities.json +61 -0
- package/hooks/useInterval.json +55 -0
- package/hooks/useLayoutStandardList.json +36 -0
- package/hooks/useMessage.json +73 -0
- package/hooks/useModifyCache.json +36 -0
- package/hooks/useOpenDialog.json +43 -0
- package/hooks/usePagination.json +49 -0
- package/hooks/usePersist.json +61 -0
- package/hooks/usePoll.json +43 -0
- package/hooks/useRoutePlus.json +36 -0
- package/hooks/useRouterPlus.json +36 -0
- package/hooks/useSearch.json +56 -0
- package/hooks/useShell.json +49 -0
- package/hooks/useSkip.json +43 -0
- package/hooks/useStorageIdEntity.json +67 -0
- package/hooks/useStore.json +36 -0
- package/hooks/useTable.json +49 -0
- package/hooks/useTableGroup.json +43 -0
- package/hooks/useTableSort.json +43 -0
- package/hooks/useUser.json +36 -0
- package/hooks/useValidForm.json +43 -0
- package/package.json +12 -6
- package/dist/chunk-HDV7ETXE.mjs +0 -1055
- package/dist/chunk-HPAUCD5I.js +0 -156
- package/dist/chunk-L4DS3EXI.mjs +0 -133
- package/dist/chunk-YWY3D4J7.js +0 -1082
package/components/region.json
CHANGED
|
@@ -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
|
+
}
|