king-design-analyzer 1.0.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 (92) hide show
  1. package/README.md +151 -0
  2. package/components/affix.json +178 -0
  3. package/components/az.json +86 -0
  4. package/components/badge.json +162 -0
  5. package/components/billtypes.json +90 -0
  6. package/components/breadcrumb.json +220 -0
  7. package/components/button.json +511 -0
  8. package/components/card.json +334 -0
  9. package/components/cardcontent.json +144 -0
  10. package/components/carousel.json +207 -0
  11. package/components/cascader.json +373 -0
  12. package/components/checkbox.json +298 -0
  13. package/components/code.json +318 -0
  14. package/components/collapse.json +358 -0
  15. package/components/copy.json +220 -0
  16. package/components/datepicker.json +529 -0
  17. package/components/descriptions.json +309 -0
  18. package/components/dialog.json +460 -0
  19. package/components/divider.json +287 -0
  20. package/components/drawer.json +563 -0
  21. package/components/dropdown.json +407 -0
  22. package/components/editable.json +331 -0
  23. package/components/ellipsis.json +218 -0
  24. package/components/form.json +638 -0
  25. package/components/grid.json +377 -0
  26. package/components/icon.json +442 -0
  27. package/components/input.json +821 -0
  28. package/components/layoutcontent.json +210 -0
  29. package/components/menu.json +482 -0
  30. package/components/message.json +345 -0
  31. package/components/pagination.json +444 -0
  32. package/components/paginationplus.json +74 -0
  33. package/components/popover.json +456 -0
  34. package/components/progress.json +354 -0
  35. package/components/protable.json +132 -0
  36. package/components/radio.json +246 -0
  37. package/components/region.json +115 -0
  38. package/components/select.json +676 -0
  39. package/components/slider.json +422 -0
  40. package/components/spin.json +232 -0
  41. package/components/spinner.json +441 -0
  42. package/components/status.json +75 -0
  43. package/components/steps.json +292 -0
  44. package/components/switch.json +357 -0
  45. package/components/table.json +1057 -0
  46. package/components/tablecolumnid.json +217 -0
  47. package/components/tabs.json +363 -0
  48. package/components/tag.json +504 -0
  49. package/components/timepicker.json +447 -0
  50. package/components/tip.json +322 -0
  51. package/components/tooltip.json +416 -0
  52. package/components/tour.json +395 -0
  53. package/components/transfer.json +414 -0
  54. package/components/tree.json +480 -0
  55. package/components/treeselect.json +478 -0
  56. package/components/upload.json +499 -0
  57. package/components/virtuallist.json +178 -0
  58. package/dist/ast/index.d.mts +71 -0
  59. package/dist/ast/index.d.ts +71 -0
  60. package/dist/ast/index.js +15 -0
  61. package/dist/ast/index.mjs +2 -0
  62. package/dist/chunk-4BUGNH4F.mjs +62 -0
  63. package/dist/chunk-5H7N2A5X.mjs +1 -0
  64. package/dist/chunk-5IF32MBB.js +603 -0
  65. package/dist/chunk-ARWRNWDW.js +219 -0
  66. package/dist/chunk-C3L4IXJC.mjs +577 -0
  67. package/dist/chunk-GNVCC37B.js +102 -0
  68. package/dist/chunk-N4UIA6DN.js +68 -0
  69. package/dist/chunk-RAMIBZAU.mjs +216 -0
  70. package/dist/chunk-RNQHI7YG.js +64 -0
  71. package/dist/chunk-TB6BF5TJ.mjs +99 -0
  72. package/dist/chunk-UX7KGX45.mjs +66 -0
  73. package/dist/chunk-YTEYDSDW.js +2 -0
  74. package/dist/full/index.d.mts +29 -0
  75. package/dist/full/index.d.ts +29 -0
  76. package/dist/full/index.js +16 -0
  77. package/dist/full/index.mjs +3 -0
  78. package/dist/index.d.mts +5 -0
  79. package/dist/index.d.ts +5 -0
  80. package/dist/index.js +43 -0
  81. package/dist/index.mjs +6 -0
  82. package/dist/runtime/index.d.mts +14 -0
  83. package/dist/runtime/index.d.ts +14 -0
  84. package/dist/runtime/index.js +15 -0
  85. package/dist/runtime/index.mjs +2 -0
  86. package/dist/sfcCompiler-m51JOfWs.d.mts +22 -0
  87. package/dist/sfcCompiler-m51JOfWs.d.ts +22 -0
  88. package/dist/static/index.d.mts +14 -0
  89. package/dist/static/index.d.ts +14 -0
  90. package/dist/static/index.js +19 -0
  91. package/dist/static/index.mjs +2 -0
  92. package/package.json +88 -0
@@ -0,0 +1,345 @@
1
+ {
2
+ "id": "message",
3
+ "name": "Message",
4
+ "displayName": "全局提示",
5
+ "category": "feedback",
6
+ "description": "全局消息提示组件,用于向用户显示操作反馈信息。支持 info、success、warning、error 四种类型,通过静态方法调用,自动在页面顶部显示并自动消失。",
7
+ "importStatement": "import { Message } from '@king-design/vue';",
8
+ "props": [
9
+ {
10
+ "name": "content",
11
+ "description": "提示内容",
12
+ "type": {
13
+ "raw": "string | VNode",
14
+ "kind": "union"
15
+ },
16
+ "required": false,
17
+ "default": "undefined",
18
+ "usageExample": "Message.info({ content: '提示内容' })"
19
+ },
20
+ {
21
+ "name": "duration",
22
+ "description": "提示展示多长时间后自动关闭,传入 0 时不自动关闭,单位 ms",
23
+ "type": {
24
+ "raw": "number",
25
+ "kind": "number"
26
+ },
27
+ "required": false,
28
+ "default": "5000",
29
+ "usageExample": "Message.info('提示', 10000)"
30
+ },
31
+ {
32
+ "name": "type",
33
+ "description": "提示类型",
34
+ "type": {
35
+ "raw": "\"info\" | \"error\" | \"success\" | \"warning\"",
36
+ "kind": "union",
37
+ "unionTypes": [
38
+ "info",
39
+ "error",
40
+ "success",
41
+ "warning"
42
+ ]
43
+ },
44
+ "required": false,
45
+ "default": "\"info\"",
46
+ "allowedValues": [
47
+ {
48
+ "value": "info",
49
+ "label": "普通提示(蓝色)",
50
+ "isDefault": true
51
+ },
52
+ {
53
+ "value": "success",
54
+ "label": "成功提示(绿色)"
55
+ },
56
+ {
57
+ "value": "warning",
58
+ "label": "警告提示(橙色)"
59
+ },
60
+ {
61
+ "value": "error",
62
+ "label": "错误提示(红色)"
63
+ }
64
+ ],
65
+ "usageExample": "Message.success('成功')"
66
+ },
67
+ {
68
+ "name": "closable",
69
+ "description": "是否展示关闭按钮",
70
+ "type": {
71
+ "raw": "boolean",
72
+ "kind": "boolean"
73
+ },
74
+ "required": false,
75
+ "default": "false",
76
+ "usageExample": "Message.info({ content: '可关闭', closable: true })"
77
+ },
78
+ {
79
+ "name": "hideIcon",
80
+ "description": "是否隐藏文字前面的图标",
81
+ "type": {
82
+ "raw": "boolean",
83
+ "kind": "boolean"
84
+ },
85
+ "required": false,
86
+ "default": "false",
87
+ "usageExample": "Message.info({ content: '无图标', hideIcon: true })"
88
+ }
89
+ ],
90
+ "events": [],
91
+ "methods": [
92
+ {
93
+ "name": "info",
94
+ "description": "显示普通提示消息",
95
+ "params": [
96
+ {
97
+ "name": "content",
98
+ "type": "string | VNode | Partial<MessageProps>",
99
+ "description": "提示内容或配置对象"
100
+ },
101
+ {
102
+ "name": "duration",
103
+ "type": "number",
104
+ "description": "可选,显示时长(ms)"
105
+ }
106
+ ],
107
+ "returnType": "void",
108
+ "usageExample": "Message.info('这是一条普通消息');"
109
+ },
110
+ {
111
+ "name": "success",
112
+ "description": "显示成功提示消息",
113
+ "params": [
114
+ {
115
+ "name": "content",
116
+ "type": "string | VNode | Partial<MessageProps>",
117
+ "description": "提示内容或配置对象"
118
+ },
119
+ {
120
+ "name": "duration",
121
+ "type": "number",
122
+ "description": "可选,显示时长(ms)"
123
+ }
124
+ ],
125
+ "returnType": "void",
126
+ "usageExample": "Message.success('操作成功');"
127
+ },
128
+ {
129
+ "name": "warning",
130
+ "description": "显示警告提示消息",
131
+ "params": [
132
+ {
133
+ "name": "content",
134
+ "type": "string | VNode | Partial<MessageProps>",
135
+ "description": "提示内容或配置对象"
136
+ },
137
+ {
138
+ "name": "duration",
139
+ "type": "number",
140
+ "description": "可选,显示时长(ms)"
141
+ }
142
+ ],
143
+ "returnType": "void",
144
+ "usageExample": "Message.warning('请注意');"
145
+ },
146
+ {
147
+ "name": "error",
148
+ "description": "显示错误提示消息",
149
+ "params": [
150
+ {
151
+ "name": "content",
152
+ "type": "string | VNode | Partial<MessageProps>",
153
+ "description": "提示内容或配置对象"
154
+ },
155
+ {
156
+ "name": "duration",
157
+ "type": "number",
158
+ "description": "可选,显示时长(ms)"
159
+ }
160
+ ],
161
+ "returnType": "void",
162
+ "usageExample": "Message.error('操作失败');"
163
+ }
164
+ ],
165
+ "typeDefinitions": [
166
+ {
167
+ "name": "MessageProps",
168
+ "definition": "interface MessageProps {\n content?: string | VNode\n duration?: number\n type?: 'info' | 'error' | 'success' | 'warning'\n closable?: boolean\n hideIcon?: boolean\n}",
169
+ "description": "Message 配置对象类型"
170
+ }
171
+ ],
172
+ "examples": [
173
+ {
174
+ "id": "message_basic",
175
+ "title": "基础用法",
176
+ "description": "基本的消息提示",
177
+ "difficulty": "easy",
178
+ "code": "<script setup lang=\"ts\">\nimport { Button, Message } from '@king-design/vue';\n\nconst showMessage = () => {\n Message.info('这是一条普通消息');\n};\n</script>\n<template>\n <Button @click=\"showMessage\">显示消息</Button>\n</template>",
179
+ "tags": [
180
+ "basic",
181
+ "info"
182
+ ],
183
+ "usedProps": [],
184
+ "usedEvents": [],
185
+ "usedMethods": [
186
+ "info"
187
+ ],
188
+ "scenario": "显示一条普通的提示消息"
189
+ },
190
+ {
191
+ "id": "message_types",
192
+ "title": "不同类型",
193
+ "description": "四种类型的消息提示",
194
+ "difficulty": "easy",
195
+ "code": "<script setup lang=\"ts\">\nimport { Button, Message } from '@king-design/vue';\n\nconst showSuccess = () => Message.success('操作成功');\nconst showWarning = () => Message.warning('请注意');\nconst showError = () => Message.error('操作失败');\nconst showInfo = () => Message.info('提示信息');\n</script>\n<template>\n <Button type=\"primary\" @click=\"showSuccess\">成功</Button>\n <Button type=\"warning\" @click=\"showWarning\">警告</Button>\n <Button type=\"danger\" @click=\"showError\">错误</Button>\n <Button @click=\"showInfo\">信息</Button>\n</template>",
196
+ "tags": [
197
+ "success",
198
+ "warning",
199
+ "error",
200
+ "info"
201
+ ],
202
+ "usedProps": [],
203
+ "usedEvents": [],
204
+ "usedMethods": [
205
+ "success",
206
+ "warning",
207
+ "error",
208
+ "info"
209
+ ],
210
+ "scenario": "展示不同类型的消息提示"
211
+ },
212
+ {
213
+ "id": "message_duration",
214
+ "title": "自定义时长",
215
+ "description": "设置消息显示时长",
216
+ "difficulty": "easy",
217
+ "code": "<script setup lang=\"ts\">\nimport { Button, Message } from '@king-design/vue';\n\nconst showMessage = () => {\n // 显示 10 秒后关闭\n Message.info('这条消息会显示 10 秒', 10000);\n};\n\nconst showPermanent = () => {\n // 传入 0 表示不自动关闭\n Message.warning('这条消息不会自动关闭', 0);\n};\n</script>\n<template>\n <Button @click=\"showMessage\">显示 10 秒</Button>\n <Button @click=\"showPermanent\">不自动关闭</Button>\n</template>",
218
+ "tags": [
219
+ "duration",
220
+ "permanent"
221
+ ],
222
+ "usedProps": [
223
+ "duration"
224
+ ],
225
+ "usedEvents": [],
226
+ "usedMethods": [
227
+ "info",
228
+ "warning"
229
+ ],
230
+ "scenario": "自定义消息显示时长"
231
+ },
232
+ {
233
+ "id": "message_closable",
234
+ "title": "可关闭消息",
235
+ "description": "带关闭按钮的消息",
236
+ "difficulty": "easy",
237
+ "code": "<script setup lang=\"ts\">\nimport { Button, Message } from '@king-design/vue';\n\nconst showMessage = () => {\n Message.info({\n content: '点击关闭按钮关闭',\n closable: true,\n duration: 0\n });\n};\n</script>\n<template>\n <Button @click=\"showMessage\">显示可关闭消息</Button>\n</template>",
238
+ "tags": [
239
+ "closable",
240
+ "close"
241
+ ],
242
+ "usedProps": [
243
+ "content",
244
+ "closable",
245
+ "duration"
246
+ ],
247
+ "usedEvents": [],
248
+ "usedMethods": [
249
+ "info"
250
+ ],
251
+ "scenario": "显示带关闭按钮的消息"
252
+ },
253
+ {
254
+ "id": "message_no_icon",
255
+ "title": "隐藏图标",
256
+ "description": "不显示图标的消息",
257
+ "difficulty": "easy",
258
+ "code": "<script setup lang=\"ts\">\nimport { Button, Message } from '@king-design/vue';\n\nconst showMessage = () => {\n Message.success({\n content: '没有图标的消息',\n hideIcon: true\n });\n};\n</script>\n<template>\n <Button @click=\"showMessage\">无图标消息</Button>\n</template>",
259
+ "tags": [
260
+ "hideIcon",
261
+ "no-icon"
262
+ ],
263
+ "usedProps": [
264
+ "content",
265
+ "hideIcon"
266
+ ],
267
+ "usedEvents": [],
268
+ "usedMethods": [
269
+ "success"
270
+ ],
271
+ "scenario": "显示不带图标的简洁消息"
272
+ },
273
+ {
274
+ "id": "message_api_response",
275
+ "title": "接口响应提示",
276
+ "description": "常见的 API 请求结果提示",
277
+ "difficulty": "medium",
278
+ "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Button, Message } from '@king-design/vue';\n\nconst loading = ref(false);\n\nconst submitForm = async () => {\n loading.value = true;\n try {\n // 模拟 API 请求\n await new Promise(r => setTimeout(r, 1000));\n Message.success('提交成功!');\n } catch (error) {\n Message.error('提交失败,请重试');\n } finally {\n loading.value = false;\n }\n};\n</script>\n<template>\n <Button type=\"primary\" :loading=\"loading\" @click=\"submitForm\">\n 提交表单\n </Button>\n</template>",
279
+ "tags": [
280
+ "api",
281
+ "response",
282
+ "async"
283
+ ],
284
+ "usedProps": [],
285
+ "usedEvents": [],
286
+ "usedMethods": [
287
+ "success",
288
+ "error"
289
+ ],
290
+ "scenario": "API 请求成功或失败后的提示"
291
+ }
292
+ ],
293
+ "commonMistakes": [
294
+ {
295
+ "id": "message_wrong_import",
296
+ "description": "未导入 Message 组件",
297
+ "wrongCode": "Message.success('成功'); // ReferenceError: Message is not defined",
298
+ "correctCode": "import { Message } from '@king-design/vue';\n\nMessage.success('成功');",
299
+ "explanation": "使用 Message 前需要先从 @king-design/vue 导入",
300
+ "relatedProps": []
301
+ },
302
+ {
303
+ "id": "message_duration_string",
304
+ "description": "duration 使用字符串而非数字",
305
+ "wrongCode": "Message.info('提示', '5000');",
306
+ "correctCode": "Message.info('提示', 5000);",
307
+ "explanation": "duration 必须是数字类型,单位是毫秒",
308
+ "relatedProps": [
309
+ "duration"
310
+ ]
311
+ },
312
+ {
313
+ "id": "message_config_without_content",
314
+ "description": "传入配置对象时忘记设置 content",
315
+ "wrongCode": "Message.info({ duration: 10000 });",
316
+ "correctCode": "Message.info({ content: '提示内容', duration: 10000 });",
317
+ "explanation": "使用配置对象时必须包含 content 属性",
318
+ "relatedProps": [
319
+ "content"
320
+ ]
321
+ }
322
+ ],
323
+ "searchKeywords": [
324
+ "消息",
325
+ "message",
326
+ "提示",
327
+ "toast",
328
+ "通知",
329
+ "notification",
330
+ "成功",
331
+ "错误",
332
+ "警告"
333
+ ],
334
+ "useCases": [
335
+ "操作成功提示",
336
+ "操作失败提示",
337
+ "表单提交反馈",
338
+ "API 请求结果提示",
339
+ "系统通知",
340
+ "警告提醒"
341
+ ],
342
+ "relatedComponents": [
343
+ "Notice"
344
+ ]
345
+ }