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,444 @@
1
+ {
2
+ "id": "pagination",
3
+ "name": "Pagination",
4
+ "displayName": "分页",
5
+ "category": "navigation",
6
+ "description": "分页导航组件,用于数据量较大时进行分页展示。支持页码跳转、每页条数切换、总数显示等功能。",
7
+ "importStatement": "import { Pagination } from '@king-design/vue';",
8
+ "props": [
9
+ {
10
+ "name": "value",
11
+ "description": "当前页码,可用 v-model 双向绑定",
12
+ "type": {
13
+ "raw": "number",
14
+ "kind": "number"
15
+ },
16
+ "required": false,
17
+ "default": "1",
18
+ "usageExample": "<Pagination v-model=\"currentPage\" :total=\"100\" />"
19
+ },
20
+ {
21
+ "name": "total",
22
+ "description": "数据总条数",
23
+ "type": {
24
+ "raw": "number",
25
+ "kind": "number"
26
+ },
27
+ "required": false,
28
+ "default": "0",
29
+ "usageExample": "<Pagination :total=\"1000\" />"
30
+ },
31
+ {
32
+ "name": "limit",
33
+ "description": "每页条数,可用 v-model:limit 双向绑定",
34
+ "type": {
35
+ "raw": "number",
36
+ "kind": "number"
37
+ },
38
+ "required": false,
39
+ "default": "10",
40
+ "usageExample": "<Pagination v-model:limit=\"pageSize\" :total=\"100\" />"
41
+ },
42
+ {
43
+ "name": "limits",
44
+ "description": "可选的每页条数列表",
45
+ "type": {
46
+ "raw": "Array<number>",
47
+ "kind": "array"
48
+ },
49
+ "required": false,
50
+ "default": "[10, 20, 50]",
51
+ "usageExample": "<Pagination :limits=\"[20, 50, 100, 200]\" :total=\"1000\" />"
52
+ },
53
+ {
54
+ "name": "size",
55
+ "description": "尺寸",
56
+ "type": {
57
+ "raw": "\"large\" | \"default\" | \"small\" | \"mini\"",
58
+ "kind": "union",
59
+ "unionTypes": [
60
+ "large",
61
+ "default",
62
+ "small",
63
+ "mini"
64
+ ]
65
+ },
66
+ "required": false,
67
+ "default": "\"default\"",
68
+ "allowedValues": [
69
+ {
70
+ "value": "large",
71
+ "label": "大尺寸"
72
+ },
73
+ {
74
+ "value": "default",
75
+ "label": "默认尺寸",
76
+ "isDefault": true
77
+ },
78
+ {
79
+ "value": "small",
80
+ "label": "小尺寸"
81
+ },
82
+ {
83
+ "value": "mini",
84
+ "label": "迷你尺寸"
85
+ }
86
+ ],
87
+ "usageExample": "<Pagination size=\"small\" :total=\"100\" />"
88
+ },
89
+ {
90
+ "name": "counts",
91
+ "description": "展示的页码按钮个数",
92
+ "type": {
93
+ "raw": "number",
94
+ "kind": "number"
95
+ },
96
+ "required": false,
97
+ "default": "7",
98
+ "usageExample": "<Pagination :counts=\"5\" :total=\"100\" />"
99
+ },
100
+ {
101
+ "name": "flat",
102
+ "description": "是否展示无边框样式",
103
+ "type": {
104
+ "raw": "boolean",
105
+ "kind": "boolean"
106
+ },
107
+ "required": false,
108
+ "default": "false",
109
+ "usageExample": "<Pagination flat :total=\"100\" />"
110
+ },
111
+ {
112
+ "name": "simple",
113
+ "description": "是否展示简洁样式",
114
+ "type": {
115
+ "raw": "boolean",
116
+ "kind": "boolean"
117
+ },
118
+ "required": false,
119
+ "default": "false",
120
+ "usageExample": "<Pagination simple :total=\"100\" />"
121
+ },
122
+ {
123
+ "name": "showTotal",
124
+ "description": "是否显示总条数",
125
+ "type": {
126
+ "raw": "boolean",
127
+ "kind": "boolean"
128
+ },
129
+ "required": false,
130
+ "default": "true",
131
+ "usageExample": "<Pagination :showTotal=\"false\" :total=\"100\" />"
132
+ },
133
+ {
134
+ "name": "showGoto",
135
+ "description": "是否显示快速跳转框",
136
+ "type": {
137
+ "raw": "boolean",
138
+ "kind": "boolean"
139
+ },
140
+ "required": false,
141
+ "default": "false",
142
+ "usageExample": "<Pagination showGoto :total=\"100\" />"
143
+ },
144
+ {
145
+ "name": "showLimits",
146
+ "description": "是否显示每页条数选择框",
147
+ "type": {
148
+ "raw": "boolean",
149
+ "kind": "boolean"
150
+ },
151
+ "required": false,
152
+ "default": "true",
153
+ "usageExample": "<Pagination :showLimits=\"false\" :total=\"100\" />"
154
+ },
155
+ {
156
+ "name": "disableBtn",
157
+ "description": "禁用页码按钮的函数,\"上一页\"\"下一页\"按钮依然可点",
158
+ "type": {
159
+ "raw": "(page: number, limit: number) => boolean",
160
+ "kind": "function",
161
+ "functionSignature": "(page: number, limit: number) => boolean"
162
+ },
163
+ "required": false,
164
+ "default": "undefined",
165
+ "usageExample": "<Pagination :disableBtn=\"(page) => page > 10\" :total=\"200\" />"
166
+ },
167
+ {
168
+ "name": "disablePage",
169
+ "description": "同时禁用页码按钮和\"上一页\"\"下一页\"按钮的函数",
170
+ "type": {
171
+ "raw": "(page: number, limit: number) => boolean",
172
+ "kind": "function",
173
+ "functionSignature": "(page: number, limit: number) => boolean"
174
+ },
175
+ "required": false,
176
+ "default": "undefined",
177
+ "usageExample": "<Pagination :disablePage=\"(page) => page > 10\" :total=\"200\" />"
178
+ }
179
+ ],
180
+ "events": [
181
+ {
182
+ "name": "change",
183
+ "vueEventName": "@change",
184
+ "description": "value 和 limit 变化时触发,同时变化不会重复触发",
185
+ "payload": [
186
+ {
187
+ "name": "value",
188
+ "type": "number",
189
+ "description": "当前页码"
190
+ },
191
+ {
192
+ "name": "limit",
193
+ "type": "number",
194
+ "description": "每页条数"
195
+ }
196
+ ],
197
+ "usageExample": "<Pagination @change=\"handleChange\" :total=\"100\" />",
198
+ "handlerExample": "const handleChange = ({value, limit}: {value: number; limit: number}) => {\n console.log(`当前页: ${value}, 每页: ${limit}`);\n fetchData(value, limit);\n};"
199
+ }
200
+ ],
201
+ "methods": [],
202
+ "examples": [
203
+ {
204
+ "id": "pagination_basic",
205
+ "title": "基础用法",
206
+ "description": "基本的分页组件",
207
+ "difficulty": "easy",
208
+ "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Pagination } from '@king-design/vue';\n\nconst currentPage = ref(1);\n</script>\n<template>\n <Pagination v-model=\"currentPage\" :total=\"100\" />\n</template>",
209
+ "tags": [
210
+ "basic"
211
+ ],
212
+ "usedProps": [
213
+ "value",
214
+ "total"
215
+ ],
216
+ "usedEvents": [],
217
+ "usedMethods": [],
218
+ "scenario": "创建一个基本的分页组件"
219
+ },
220
+ {
221
+ "id": "pagination_change_event",
222
+ "title": "监听变化",
223
+ "description": "监听分页和每页条数变化",
224
+ "difficulty": "medium",
225
+ "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Pagination, Message } from '@king-design/vue';\n\nconst currentPage = ref(1);\nconst limit = ref(10);\n\nconst handleChange = ({value, limit}: {value: number; limit: number}) => {\n Message.info(`当前页: ${value}, 每页: ${limit}`);\n};\n</script>\n<template>\n <Pagination \n v-model=\"currentPage\" \n v-model:limit=\"limit\" \n :total=\"100\" \n @change=\"handleChange\" \n />\n</template>",
226
+ "tags": [
227
+ "change",
228
+ "event",
229
+ "v-model:limit"
230
+ ],
231
+ "usedProps": [
232
+ "value",
233
+ "limit",
234
+ "total"
235
+ ],
236
+ "usedEvents": [
237
+ "change"
238
+ ],
239
+ "usedMethods": [],
240
+ "scenario": "监听分页变化并加载对应数据"
241
+ },
242
+ {
243
+ "id": "pagination_simple",
244
+ "title": "简洁样式",
245
+ "description": "简洁模式的分页",
246
+ "difficulty": "easy",
247
+ "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Pagination } from '@king-design/vue';\n\nconst currentPage = ref(1);\n</script>\n<template>\n <Pagination v-model=\"currentPage\" :total=\"100\" simple />\n</template>",
248
+ "tags": [
249
+ "simple",
250
+ "minimal"
251
+ ],
252
+ "usedProps": [
253
+ "value",
254
+ "total",
255
+ "simple"
256
+ ],
257
+ "usedEvents": [],
258
+ "usedMethods": [],
259
+ "scenario": "创建简洁样式的分页,适合空间有限的场景"
260
+ },
261
+ {
262
+ "id": "pagination_goto",
263
+ "title": "快速跳转",
264
+ "description": "显示快速跳转输入框",
265
+ "difficulty": "easy",
266
+ "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Pagination } from '@king-design/vue';\n\nconst currentPage = ref(1);\n</script>\n<template>\n <Pagination v-model=\"currentPage\" :total=\"1000\" showGoto />\n</template>",
267
+ "tags": [
268
+ "showGoto",
269
+ "jump"
270
+ ],
271
+ "usedProps": [
272
+ "value",
273
+ "total",
274
+ "showGoto"
275
+ ],
276
+ "usedEvents": [],
277
+ "usedMethods": [],
278
+ "scenario": "支持用户直接输入页码跳转"
279
+ },
280
+ {
281
+ "id": "pagination_custom_limits",
282
+ "title": "自定义每页条数",
283
+ "description": "自定义可选的每页条数列表",
284
+ "difficulty": "easy",
285
+ "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Pagination } from '@king-design/vue';\n\nconst currentPage = ref(1);\n</script>\n<template>\n <Pagination \n v-model=\"currentPage\" \n :total=\"1000\" \n :limits=\"[20, 50, 100, 200]\" \n :limit=\"20\" \n />\n</template>",
286
+ "tags": [
287
+ "limits",
288
+ "pageSize"
289
+ ],
290
+ "usedProps": [
291
+ "value",
292
+ "total",
293
+ "limits",
294
+ "limit"
295
+ ],
296
+ "usedEvents": [],
297
+ "usedMethods": [],
298
+ "scenario": "自定义每页条数的可选项"
299
+ },
300
+ {
301
+ "id": "pagination_hide_controls",
302
+ "title": "隐藏控件",
303
+ "description": "隐藏总数和每页条数选择器",
304
+ "difficulty": "easy",
305
+ "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Pagination } from '@king-design/vue';\n\nconst currentPage = ref(1);\n</script>\n<template>\n <Pagination \n v-model=\"currentPage\" \n :total=\"100\" \n :showTotal=\"false\" \n :showLimits=\"false\" \n />\n</template>",
306
+ "tags": [
307
+ "showTotal",
308
+ "showLimits",
309
+ "minimal"
310
+ ],
311
+ "usedProps": [
312
+ "value",
313
+ "total",
314
+ "showTotal",
315
+ "showLimits"
316
+ ],
317
+ "usedEvents": [],
318
+ "usedMethods": [],
319
+ "scenario": "创建只显示页码的精简分页"
320
+ },
321
+ {
322
+ "id": "pagination_sizes",
323
+ "title": "不同尺寸",
324
+ "description": "展示不同尺寸的分页",
325
+ "difficulty": "easy",
326
+ "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Pagination } from '@king-design/vue';\n\nconst currentPage = ref(1);\n</script>\n<template>\n <Pagination v-model=\"currentPage\" :total=\"100\" size=\"large\" />\n <Pagination v-model=\"currentPage\" :total=\"100\" size=\"default\" />\n <Pagination v-model=\"currentPage\" :total=\"100\" size=\"small\" />\n <Pagination v-model=\"currentPage\" :total=\"100\" size=\"mini\" />\n</template>",
327
+ "tags": [
328
+ "size",
329
+ "large",
330
+ "small",
331
+ "mini"
332
+ ],
333
+ "usedProps": [
334
+ "value",
335
+ "total",
336
+ "size"
337
+ ],
338
+ "usedEvents": [],
339
+ "usedMethods": [],
340
+ "scenario": "展示不同尺寸的分页组件"
341
+ },
342
+ {
343
+ "id": "pagination_flat",
344
+ "title": "无边框样式",
345
+ "description": "扁平无边框的分页样式",
346
+ "difficulty": "easy",
347
+ "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Pagination } from '@king-design/vue';\n\nconst currentPage = ref(1);\n</script>\n<template>\n <Pagination v-model=\"currentPage\" :total=\"100\" flat />\n</template>",
348
+ "tags": [
349
+ "flat",
350
+ "borderless"
351
+ ],
352
+ "usedProps": [
353
+ "value",
354
+ "total",
355
+ "flat"
356
+ ],
357
+ "usedEvents": [],
358
+ "usedMethods": [],
359
+ "scenario": "创建无边框扁平样式的分页"
360
+ }
361
+ ],
362
+ "commonMistakes": [
363
+ {
364
+ "id": "pagination_missing_total",
365
+ "description": "未设置 total 属性",
366
+ "wrongCode": "<Pagination v-model=\"currentPage\" />",
367
+ "correctCode": "<Pagination v-model=\"currentPage\" :total=\"100\" />",
368
+ "explanation": "必须设置 total 属性来指定数据总条数,否则分页无法正确计算总页数",
369
+ "relatedProps": [
370
+ "total"
371
+ ]
372
+ },
373
+ {
374
+ "id": "pagination_size_typo",
375
+ "description": "使用不存在的 size 值 (Pagination)",
376
+ "wrongCode": "<Pagination size=\"medium\" :total=\"100\" />",
377
+ "correctCode": "<Pagination size=\"default\" :total=\"100\" />",
378
+ "explanation": "Pagination 的 size 只支持 large, default, small, mini。常见错误是使用 medium 值。",
379
+ "relatedProps": [
380
+ "size"
381
+ ]
382
+ },
383
+ {
384
+ "id": "pagination_limit_not_in_limits",
385
+ "description": "limit 值不在 limits 列表中",
386
+ "wrongCode": "<Pagination :limit=\"15\" :limits=\"[10, 20, 50]\" :total=\"100\" />",
387
+ "correctCode": "<Pagination :limit=\"10\" :limits=\"[10, 20, 50]\" :total=\"100\" />",
388
+ "explanation": "limit 的初始值应该在 limits 列表中,否则可能导致显示异常",
389
+ "relatedProps": [
390
+ "limit",
391
+ "limits"
392
+ ]
393
+ },
394
+ {
395
+ "id": "pagination_change_destructure",
396
+ "description": "change 事件参数解构错误",
397
+ "wrongCode": "const handleChange = (value, limit) => {}",
398
+ "correctCode": "const handleChange = ({value, limit}: {value: number; limit: number}) => {}",
399
+ "explanation": "change 事件的参数是一个对象,需要解构获取 value 和 limit",
400
+ "relatedProps": []
401
+ },
402
+ {
403
+ "id": "pagination_wrong_event_name",
404
+ "description": "错误使用 Element UI 风格事件名",
405
+ "wrongCode": "<Pagination @current-change=\"...\" @size-change=\"...\" />",
406
+ "correctCode": "<Pagination @change=\"...\" />",
407
+ "explanation": "KPC Pagination 不支持 `@current-change` 或 `@size-change`,请统一使用 `@change` 事件监听页码或每页条数变化。",
408
+ "relatedEvents": [
409
+ "change"
410
+ ]
411
+ },
412
+ {
413
+ "id": "pagination_binding_recommendation",
414
+ "description": "建议使用 v-model 进行双向绑定",
415
+ "wrongCode": "<Pagination :value=\"page\" :limit=\"size\" @change=\"...\" />",
416
+ "correctCode": "<Pagination v-model=\"page\" v-model:limit=\"size\" />",
417
+ "explanation": "推荐使用 `v-model` 绑定当前页码,`v-model:limit` 绑定每页条数,更加简洁。",
418
+ "relatedProps": [
419
+ "value",
420
+ "limit"
421
+ ]
422
+ }
423
+ ],
424
+ "searchKeywords": [
425
+ "分页",
426
+ "pagination",
427
+ "翻页",
428
+ "页码",
429
+ "pager",
430
+ "总数",
431
+ "每页",
432
+ "跳转"
433
+ ],
434
+ "useCases": [
435
+ "表格数据分页",
436
+ "列表分页展示",
437
+ "搜索结果分页",
438
+ "文章列表分页",
439
+ "商品列表分页"
440
+ ],
441
+ "relatedComponents": [
442
+ "Table"
443
+ ]
444
+ }
@@ -0,0 +1,74 @@
1
+ {
2
+ "id": "paginationplus",
3
+ "name": "PaginationPlus",
4
+ "displayName": "增强分页",
5
+ "category": "navigation",
6
+ "description": "集成选中统计和操作的分页组件,继承自 Pagination。",
7
+ "importStatement": "import { PaginationPlus } from '@ksyun-internal/versatile';",
8
+ "props": [
9
+ {
10
+ "name": "modelValue",
11
+ "description": "当前页码",
12
+ "type": {
13
+ "raw": "number",
14
+ "kind": "number"
15
+ },
16
+ "required": false
17
+ },
18
+ {
19
+ "name": "checkedKeys",
20
+ "description": "选中的行的 key 列表",
21
+ "type": {
22
+ "raw": "any[]",
23
+ "kind": "array"
24
+ },
25
+ "required": false
26
+ },
27
+ {
28
+ "name": "checkedLength",
29
+ "description": "选中的总数量",
30
+ "type": {
31
+ "raw": "number",
32
+ "kind": "number"
33
+ },
34
+ "required": false
35
+ },
36
+ {
37
+ "name": "showCheckedTotal",
38
+ "description": "是否显示选中统计信息",
39
+ "type": {
40
+ "raw": "boolean",
41
+ "kind": "boolean"
42
+ },
43
+ "required": false,
44
+ "default": "true"
45
+ }
46
+ ],
47
+ "events": [
48
+ {
49
+ "name": "change",
50
+ "vueEventName": "change",
51
+ "description": "页码或每页条数改变时触发",
52
+ "payload": [
53
+ {
54
+ "name": "data",
55
+ "type": "{ page: number, limit: number }",
56
+ "description": "分页信息"
57
+ }
58
+ ],
59
+ "usageExample": "<PaginationPlus @change=\"onChange\" />",
60
+ "handlerExample": "({ page, limit }) => { params.page = page; }"
61
+ }
62
+ ],
63
+ "methods": [],
64
+ "examples": [],
65
+ "searchKeywords": [
66
+ "pagination",
67
+ "page",
68
+ "paging",
69
+ "分页"
70
+ ],
71
+ "useCases": [
72
+ "列表页分页控制"
73
+ ]
74
+ }