king-design-analyzer 2.1.9 → 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 +4 -3
- package/dist/ast/index.mjs +2 -1
- package/dist/{chunk-DSWKLUIX.mjs → chunk-3LYQ5XFM.mjs} +1 -1
- package/dist/chunk-BI5TIQID.mjs +330 -0
- package/dist/{chunk-F26GUCGG.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-KF5YBEM5.js +143 -0
- package/dist/{chunk-H2ET6MMM.mjs → chunk-KMIDURUR.mjs} +42 -47
- package/dist/chunk-QC6VTSA3.mjs +117 -0
- package/dist/{chunk-2W6OCG2S.js → chunk-SZYVGYKK.js} +42 -48
- package/dist/{chunk-WYSRJVX4.js → chunk-TA3SV4SP.js} +2 -2
- package/dist/{chunk-OJOHB64C.mjs → chunk-XGPHQHLR.mjs} +4 -4
- package/dist/full/index.js +7 -6
- package/dist/full/index.mjs +5 -4
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +14 -13
- package/dist/index.mjs +6 -5
- package/dist/metadata/index.d.mts +22 -2
- package/dist/metadata/index.d.ts +22 -2
- package/dist/metadata/index.js +26 -16
- package/dist/metadata/index.mjs +26 -15
- package/dist/resolve-BsLBxlBi.d.mts +24 -0
- package/dist/resolve-BsLBxlBi.d.ts +24 -0
- package/dist/runtime/index.js +4 -4
- package/dist/runtime/index.mjs +2 -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 +5 -5
- package/dist/static/index.mjs +2 -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-HPAUCD5I.js +0 -156
- package/dist/chunk-L4DS3EXI.mjs +0 -133
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { C as ComponentInheritance } from '../resolve-BsLBxlBi.mjs';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Components 元数据模块入口
|
|
3
5
|
* 提供对 components 目录中 JSON 元数据的访问
|
|
4
6
|
*/
|
|
7
|
+
|
|
5
8
|
/**
|
|
6
9
|
* 组件元数据类型定义
|
|
7
10
|
*/
|
|
@@ -15,11 +18,13 @@ interface ComponentProp {
|
|
|
15
18
|
required?: boolean;
|
|
16
19
|
default?: string;
|
|
17
20
|
usageExample?: string;
|
|
21
|
+
tags?: string[];
|
|
18
22
|
}
|
|
19
23
|
interface ComponentEvent {
|
|
20
24
|
name: string;
|
|
21
25
|
vueEventName?: string;
|
|
22
26
|
description: string;
|
|
27
|
+
params?: ComponentActionParam[];
|
|
23
28
|
payload?: {
|
|
24
29
|
name: string;
|
|
25
30
|
type: string;
|
|
@@ -27,6 +32,20 @@ interface ComponentEvent {
|
|
|
27
32
|
}[];
|
|
28
33
|
usageExample?: string;
|
|
29
34
|
}
|
|
35
|
+
interface ComponentActionParam {
|
|
36
|
+
name: string;
|
|
37
|
+
type: string;
|
|
38
|
+
description: string;
|
|
39
|
+
optional?: boolean;
|
|
40
|
+
default?: string;
|
|
41
|
+
}
|
|
42
|
+
interface ComponentMethod {
|
|
43
|
+
name: string;
|
|
44
|
+
description: string;
|
|
45
|
+
params?: ComponentActionParam[];
|
|
46
|
+
returnType?: string;
|
|
47
|
+
usageExample?: string;
|
|
48
|
+
}
|
|
30
49
|
interface ComponentSlot {
|
|
31
50
|
name: string;
|
|
32
51
|
description: string;
|
|
@@ -43,13 +62,14 @@ interface ComponentMetadata {
|
|
|
43
62
|
props: ComponentProp[];
|
|
44
63
|
events: ComponentEvent[];
|
|
45
64
|
slots: ComponentSlot[];
|
|
46
|
-
methods?:
|
|
65
|
+
methods?: ComponentMethod[];
|
|
47
66
|
examples?: any[];
|
|
48
67
|
subComponents?: any[];
|
|
49
68
|
commonMistakes?: any[];
|
|
50
69
|
searchKeywords?: string[];
|
|
51
70
|
useCases?: string[];
|
|
52
71
|
relatedComponents?: string[];
|
|
72
|
+
inherits?: ComponentInheritance[];
|
|
53
73
|
}
|
|
54
74
|
/**
|
|
55
75
|
* 获取所有可用的组件名称列表
|
|
@@ -74,4 +94,4 @@ declare function getComponentsDir(): string;
|
|
|
74
94
|
*/
|
|
75
95
|
declare function getComponentPath(componentName: string): string;
|
|
76
96
|
|
|
77
|
-
export { type ComponentEvent, type ComponentMetadata, type ComponentProp, type ComponentSlot, getAllComponentsMetadata, getComponentMetadata, getComponentPath, getComponentsDir, getComponentsList };
|
|
97
|
+
export { type ComponentActionParam, type ComponentEvent, type ComponentMetadata, type ComponentMethod, type ComponentProp, type ComponentSlot, getAllComponentsMetadata, getComponentMetadata, getComponentPath, getComponentsDir, getComponentsList };
|
package/dist/metadata/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { C as ComponentInheritance } from '../resolve-BsLBxlBi.js';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Components 元数据模块入口
|
|
3
5
|
* 提供对 components 目录中 JSON 元数据的访问
|
|
4
6
|
*/
|
|
7
|
+
|
|
5
8
|
/**
|
|
6
9
|
* 组件元数据类型定义
|
|
7
10
|
*/
|
|
@@ -15,11 +18,13 @@ interface ComponentProp {
|
|
|
15
18
|
required?: boolean;
|
|
16
19
|
default?: string;
|
|
17
20
|
usageExample?: string;
|
|
21
|
+
tags?: string[];
|
|
18
22
|
}
|
|
19
23
|
interface ComponentEvent {
|
|
20
24
|
name: string;
|
|
21
25
|
vueEventName?: string;
|
|
22
26
|
description: string;
|
|
27
|
+
params?: ComponentActionParam[];
|
|
23
28
|
payload?: {
|
|
24
29
|
name: string;
|
|
25
30
|
type: string;
|
|
@@ -27,6 +32,20 @@ interface ComponentEvent {
|
|
|
27
32
|
}[];
|
|
28
33
|
usageExample?: string;
|
|
29
34
|
}
|
|
35
|
+
interface ComponentActionParam {
|
|
36
|
+
name: string;
|
|
37
|
+
type: string;
|
|
38
|
+
description: string;
|
|
39
|
+
optional?: boolean;
|
|
40
|
+
default?: string;
|
|
41
|
+
}
|
|
42
|
+
interface ComponentMethod {
|
|
43
|
+
name: string;
|
|
44
|
+
description: string;
|
|
45
|
+
params?: ComponentActionParam[];
|
|
46
|
+
returnType?: string;
|
|
47
|
+
usageExample?: string;
|
|
48
|
+
}
|
|
30
49
|
interface ComponentSlot {
|
|
31
50
|
name: string;
|
|
32
51
|
description: string;
|
|
@@ -43,13 +62,14 @@ interface ComponentMetadata {
|
|
|
43
62
|
props: ComponentProp[];
|
|
44
63
|
events: ComponentEvent[];
|
|
45
64
|
slots: ComponentSlot[];
|
|
46
|
-
methods?:
|
|
65
|
+
methods?: ComponentMethod[];
|
|
47
66
|
examples?: any[];
|
|
48
67
|
subComponents?: any[];
|
|
49
68
|
commonMistakes?: any[];
|
|
50
69
|
searchKeywords?: string[];
|
|
51
70
|
useCases?: string[];
|
|
52
71
|
relatedComponents?: string[];
|
|
72
|
+
inherits?: ComponentInheritance[];
|
|
53
73
|
}
|
|
54
74
|
/**
|
|
55
75
|
* 获取所有可用的组件名称列表
|
|
@@ -74,4 +94,4 @@ declare function getComponentsDir(): string;
|
|
|
74
94
|
*/
|
|
75
95
|
declare function getComponentPath(componentName: string): string;
|
|
76
96
|
|
|
77
|
-
export { type ComponentEvent, type ComponentMetadata, type ComponentProp, type ComponentSlot, getAllComponentsMetadata, getComponentMetadata, getComponentPath, getComponentsDir, getComponentsList };
|
|
97
|
+
export { type ComponentActionParam, type ComponentEvent, type ComponentMetadata, type ComponentMethod, type ComponentProp, type ComponentSlot, getAllComponentsMetadata, getComponentMetadata, getComponentPath, getComponentsDir, getComponentsList };
|
package/dist/metadata/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var chunkKF5YBEM5_js = require('../chunk-KF5YBEM5.js');
|
|
3
4
|
require('../chunk-JSBRDJBE.js');
|
|
4
5
|
var fs = require('fs');
|
|
5
6
|
var path = require('path');
|
|
6
|
-
var url = require('url');
|
|
7
7
|
|
|
8
|
-
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
9
8
|
function _interopNamespace(e) {
|
|
10
9
|
if (e && e.__esModule) return e;
|
|
11
10
|
var n = Object.create(null);
|
|
@@ -27,9 +26,21 @@ function _interopNamespace(e) {
|
|
|
27
26
|
var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
|
|
28
27
|
var path__namespace = /*#__PURE__*/_interopNamespace(path);
|
|
29
28
|
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
var COMPONENTS_DIR = chunkKF5YBEM5_js.resolvePackageResourceDir("components");
|
|
30
|
+
function loadAllRawComponents() {
|
|
31
|
+
const metadata = {};
|
|
32
|
+
try {
|
|
33
|
+
const files = fs__namespace.readdirSync(COMPONENTS_DIR).filter((f) => f.endsWith(".json"));
|
|
34
|
+
for (const file of files) {
|
|
35
|
+
const content = fs__namespace.readFileSync(path__namespace.join(COMPONENTS_DIR, file), "utf-8");
|
|
36
|
+
const data = JSON.parse(content);
|
|
37
|
+
metadata[data.name] = data;
|
|
38
|
+
}
|
|
39
|
+
} catch {
|
|
40
|
+
return {};
|
|
41
|
+
}
|
|
42
|
+
return metadata;
|
|
43
|
+
}
|
|
33
44
|
function getComponentsList() {
|
|
34
45
|
try {
|
|
35
46
|
return fs__namespace.readdirSync(COMPONENTS_DIR).filter((f) => f.endsWith(".json")).map((f) => f.replace(".json", ""));
|
|
@@ -39,23 +50,22 @@ function getComponentsList() {
|
|
|
39
50
|
}
|
|
40
51
|
function getComponentMetadata(componentName) {
|
|
41
52
|
try {
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
|
|
53
|
+
const rawMetadata = loadAllRawComponents();
|
|
54
|
+
const target = Object.values(rawMetadata).find(
|
|
55
|
+
(component) => component.name === componentName || component.id === componentName
|
|
56
|
+
);
|
|
57
|
+
return target ? chunkKF5YBEM5_js.resolveMetadataInheritance(target, rawMetadata) : null;
|
|
45
58
|
} catch {
|
|
46
59
|
return null;
|
|
47
60
|
}
|
|
48
61
|
}
|
|
49
62
|
function getAllComponentsMetadata() {
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
for (const
|
|
53
|
-
|
|
54
|
-
if (data) {
|
|
55
|
-
metadata[name] = data;
|
|
56
|
-
}
|
|
63
|
+
const rawMetadata = loadAllRawComponents();
|
|
64
|
+
const resolvedMetadata = {};
|
|
65
|
+
for (const component of Object.values(rawMetadata)) {
|
|
66
|
+
resolvedMetadata[component.name] = chunkKF5YBEM5_js.resolveMetadataInheritance(component, rawMetadata);
|
|
57
67
|
}
|
|
58
|
-
return
|
|
68
|
+
return resolvedMetadata;
|
|
59
69
|
}
|
|
60
70
|
function getComponentsDir() {
|
|
61
71
|
return COMPONENTS_DIR;
|
package/dist/metadata/index.mjs
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
|
+
import { resolvePackageResourceDir, resolveMetadataInheritance } from '../chunk-QC6VTSA3.mjs';
|
|
1
2
|
import '../chunk-UJCSKKID.mjs';
|
|
2
3
|
import * as fs from 'fs';
|
|
3
4
|
import * as path from 'path';
|
|
4
|
-
import { fileURLToPath } from 'url';
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
var COMPONENTS_DIR = resolvePackageResourceDir("components");
|
|
7
|
+
function loadAllRawComponents() {
|
|
8
|
+
const metadata = {};
|
|
9
|
+
try {
|
|
10
|
+
const files = fs.readdirSync(COMPONENTS_DIR).filter((f) => f.endsWith(".json"));
|
|
11
|
+
for (const file of files) {
|
|
12
|
+
const content = fs.readFileSync(path.join(COMPONENTS_DIR, file), "utf-8");
|
|
13
|
+
const data = JSON.parse(content);
|
|
14
|
+
metadata[data.name] = data;
|
|
15
|
+
}
|
|
16
|
+
} catch {
|
|
17
|
+
return {};
|
|
18
|
+
}
|
|
19
|
+
return metadata;
|
|
20
|
+
}
|
|
9
21
|
function getComponentsList() {
|
|
10
22
|
try {
|
|
11
23
|
return fs.readdirSync(COMPONENTS_DIR).filter((f) => f.endsWith(".json")).map((f) => f.replace(".json", ""));
|
|
@@ -15,23 +27,22 @@ function getComponentsList() {
|
|
|
15
27
|
}
|
|
16
28
|
function getComponentMetadata(componentName) {
|
|
17
29
|
try {
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
30
|
+
const rawMetadata = loadAllRawComponents();
|
|
31
|
+
const target = Object.values(rawMetadata).find(
|
|
32
|
+
(component) => component.name === componentName || component.id === componentName
|
|
33
|
+
);
|
|
34
|
+
return target ? resolveMetadataInheritance(target, rawMetadata) : null;
|
|
21
35
|
} catch {
|
|
22
36
|
return null;
|
|
23
37
|
}
|
|
24
38
|
}
|
|
25
39
|
function getAllComponentsMetadata() {
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
for (const
|
|
29
|
-
|
|
30
|
-
if (data) {
|
|
31
|
-
metadata[name] = data;
|
|
32
|
-
}
|
|
40
|
+
const rawMetadata = loadAllRawComponents();
|
|
41
|
+
const resolvedMetadata = {};
|
|
42
|
+
for (const component of Object.values(rawMetadata)) {
|
|
43
|
+
resolvedMetadata[component.name] = resolveMetadataInheritance(component, rawMetadata);
|
|
33
44
|
}
|
|
34
|
-
return
|
|
45
|
+
return resolvedMetadata;
|
|
35
46
|
}
|
|
36
47
|
function getComponentsDir() {
|
|
37
48
|
return COMPONENTS_DIR;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface ComponentInheritance {
|
|
2
|
+
component: string;
|
|
3
|
+
include?: Array<'props' | 'events' | 'slots' | 'methods'>;
|
|
4
|
+
exclude?: string[];
|
|
5
|
+
}
|
|
6
|
+
type NamedItem = {
|
|
7
|
+
name: string;
|
|
8
|
+
tags?: string[];
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
};
|
|
11
|
+
interface ResolvableComponentMetadata {
|
|
12
|
+
id?: string;
|
|
13
|
+
name: string;
|
|
14
|
+
props?: NamedItem[];
|
|
15
|
+
events?: NamedItem[];
|
|
16
|
+
slots?: NamedItem[];
|
|
17
|
+
methods?: NamedItem[];
|
|
18
|
+
inherits?: ComponentInheritance[];
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
}
|
|
21
|
+
declare function normalizeMetadataName(value: string): string;
|
|
22
|
+
declare function resolveMetadataInheritance<T extends ResolvableComponentMetadata>(metadata: T, lookup: Record<string, T>, visited?: Set<string>): T;
|
|
23
|
+
|
|
24
|
+
export { type ComponentInheritance as C, type ResolvableComponentMetadata as R, normalizeMetadataName as n, resolveMetadataInheritance as r };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface ComponentInheritance {
|
|
2
|
+
component: string;
|
|
3
|
+
include?: Array<'props' | 'events' | 'slots' | 'methods'>;
|
|
4
|
+
exclude?: string[];
|
|
5
|
+
}
|
|
6
|
+
type NamedItem = {
|
|
7
|
+
name: string;
|
|
8
|
+
tags?: string[];
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
};
|
|
11
|
+
interface ResolvableComponentMetadata {
|
|
12
|
+
id?: string;
|
|
13
|
+
name: string;
|
|
14
|
+
props?: NamedItem[];
|
|
15
|
+
events?: NamedItem[];
|
|
16
|
+
slots?: NamedItem[];
|
|
17
|
+
methods?: NamedItem[];
|
|
18
|
+
inherits?: ComponentInheritance[];
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
}
|
|
21
|
+
declare function normalizeMetadataName(value: string): string;
|
|
22
|
+
declare function resolveMetadataInheritance<T extends ResolvableComponentMetadata>(metadata: T, lookup: Record<string, T>, visited?: Set<string>): T;
|
|
23
|
+
|
|
24
|
+
export { type ComponentInheritance as C, type ResolvableComponentMetadata as R, normalizeMetadataName as n, resolveMetadataInheritance as r };
|
package/dist/runtime/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkEYKZY2F3_js = require('../chunk-EYKZY2F3.js');
|
|
4
|
+
var chunkCR3GC4H3_js = require('../chunk-CR3GC4H3.js');
|
|
5
5
|
require('../chunk-JSBRDJBE.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "validateRuntimePrecheck", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkEYKZY2F3_js.validateRuntimePrecheck; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "compileSFC", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkCR3GC4H3_js.compileSFC; }
|
|
16
16
|
});
|
package/dist/runtime/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { validateRuntimePrecheck } from '../chunk-
|
|
2
|
-
export { compileSFC } from '../chunk-
|
|
1
|
+
export { validateRuntimePrecheck } from '../chunk-D2SXGGTX.mjs';
|
|
2
|
+
export { compileSFC } from '../chunk-BI5TIQID.mjs';
|
|
3
3
|
import '../chunk-UJCSKKID.mjs';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { C as ComponentInheritance, R as ResolvableComponentMetadata, n as normalizeMetadataName, r as resolveMetadataInheritance } from '../resolve-BsLBxlBi.mjs';
|
|
2
|
+
|
|
3
|
+
interface ResolvePackagePathOptions {
|
|
4
|
+
cwd?: string;
|
|
5
|
+
packageName?: string;
|
|
6
|
+
}
|
|
7
|
+
declare function resolvePackageRoot(options?: ResolvePackagePathOptions): string | null;
|
|
8
|
+
declare function resolvePackageResourceDir(resourceDirName: string, options?: ResolvePackagePathOptions): string;
|
|
9
|
+
|
|
10
|
+
export { type ResolvePackagePathOptions, resolvePackageResourceDir, resolvePackageRoot };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { C as ComponentInheritance, R as ResolvableComponentMetadata, n as normalizeMetadataName, r as resolveMetadataInheritance } from '../resolve-BsLBxlBi.js';
|
|
2
|
+
|
|
3
|
+
interface ResolvePackagePathOptions {
|
|
4
|
+
cwd?: string;
|
|
5
|
+
packageName?: string;
|
|
6
|
+
}
|
|
7
|
+
declare function resolvePackageRoot(options?: ResolvePackagePathOptions): string | null;
|
|
8
|
+
declare function resolvePackageResourceDir(resourceDirName: string, options?: ResolvePackagePathOptions): string;
|
|
9
|
+
|
|
10
|
+
export { type ResolvePackagePathOptions, resolvePackageResourceDir, resolvePackageRoot };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkKF5YBEM5_js = require('../chunk-KF5YBEM5.js');
|
|
4
|
+
require('../chunk-JSBRDJBE.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "normalizeMetadataName", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkKF5YBEM5_js.normalizeMetadataName; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "resolveMetadataInheritance", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunkKF5YBEM5_js.resolveMetadataInheritance; }
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "resolvePackageResourceDir", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return chunkKF5YBEM5_js.resolvePackageResourceDir; }
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "resolvePackageRoot", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return chunkKF5YBEM5_js.resolvePackageRoot; }
|
|
23
|
+
});
|
package/dist/static/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkTA3SV4SP_js = require('../chunk-TA3SV4SP.js');
|
|
4
|
+
var chunkCR3GC4H3_js = require('../chunk-CR3GC4H3.js');
|
|
5
5
|
require('../chunk-JSBRDJBE.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "validateCompilation", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkTA3SV4SP_js.validateCompilation; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "compileSFC", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkCR3GC4H3_js.compileSFC; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "scopeStyles", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkCR3GC4H3_js.scopeStyles; }
|
|
20
20
|
});
|
package/dist/static/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { validateCompilation } from '../chunk-
|
|
2
|
-
export { compileSFC, scopeStyles } from '../chunk-
|
|
1
|
+
export { validateCompilation } from '../chunk-3LYQ5XFM.mjs';
|
|
2
|
+
export { compileSFC, scopeStyles } from '../chunk-BI5TIQID.mjs';
|
|
3
3
|
import '../chunk-UJCSKKID.mjs';
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# 操作按钮集 (Actions)
|
|
2
|
+
|
|
3
|
+
用于组织主操作和次操作的按钮集合组件,常放在表格操作列、详情页头部和工具栏右侧,避免页面出现过多平铺按钮。
|
|
4
|
+
|
|
5
|
+
**关键词**: actions, action buttons, 操作按钮集, 更多操作, 主次操作, 操作列按钮
|
|
6
|
+
|
|
7
|
+
**使用场景**: 表格操作列、页面头部操作区、主次操作分层展示
|
|
8
|
+
|
|
9
|
+
## 导入语句
|
|
10
|
+
```typescript
|
|
11
|
+
import { Actions } from '@ksyun-internal/versatile';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 属性 (Props)
|
|
15
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
|
|
16
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
17
|
+
| primaries | `ActionConfig[]` | `[]` | 否 | 一级操作按钮列表 | - | - |
|
|
18
|
+
| secondaries | `ActionConfig[]` | `[]` | 否 | 二级操作按钮列表,通常展示在“更多”菜单中 | - | - |
|
|
19
|
+
|
|
20
|
+
## 插槽 (Slots)
|
|
21
|
+
| 插槽名 | 说明 | 模板写法 | 示例 |
|
|
22
|
+
| --- | --- | --- | --- |
|
|
23
|
+
| btnText | 自定义按钮文案渲染 | `<template #btnText="{ action }">...</template>` | - |
|
|
24
|
+
|
|
25
|
+
## 使用示例
|
|
26
|
+
### 表格操作列中的主次操作
|
|
27
|
+
**场景**: 在列表行内同时承载高频与低频操作,减少操作列拥挤。
|
|
28
|
+
|
|
29
|
+
将高频操作直接展示,低频操作折叠到更多菜单中。
|
|
30
|
+
|
|
31
|
+
**使用的 API**: 属性: primaries, secondaries
|
|
32
|
+
|
|
33
|
+
```vue
|
|
34
|
+
<script setup lang="ts">
|
|
35
|
+
import { Actions } from '@ksyun-internal/versatile';
|
|
36
|
+
|
|
37
|
+
const primaries = [
|
|
38
|
+
{ text: '重启', type: 'primary', onClick: () => console.log('restart') },
|
|
39
|
+
];
|
|
40
|
+
const secondaries = [
|
|
41
|
+
{ text: '续费', onClick: () => console.log('renew') },
|
|
42
|
+
{ text: '释放', danger: true, onClick: () => console.log('delete') },
|
|
43
|
+
];
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<template>
|
|
47
|
+
<Actions :primaries="primaries" :secondaries="secondaries" />
|
|
48
|
+
</template>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 自定义操作按钮文案
|
|
52
|
+
**场景**: 在操作区给危险动作补充更明确的文案提示。
|
|
53
|
+
|
|
54
|
+
使用 btnText 插槽为危险操作补充风险提示。
|
|
55
|
+
|
|
56
|
+
**使用的 API**: 属性: primaries, secondaries
|
|
57
|
+
|
|
58
|
+
```vue
|
|
59
|
+
<script setup lang="ts">
|
|
60
|
+
import { Actions } from '@ksyun-internal/versatile';
|
|
61
|
+
|
|
62
|
+
const primaries = [{ text: '启动', onClick: () => console.log('start') }];
|
|
63
|
+
const secondaries = [{ text: '释放', danger: true, onClick: () => console.log('release') }];
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<template>
|
|
67
|
+
<Actions :primaries="primaries" :secondaries="secondaries">
|
|
68
|
+
<template #btnText="{ action }">
|
|
69
|
+
{{ action.danger ? action.text + '(高风险)' : action.text }}
|
|
70
|
+
</template>
|
|
71
|
+
</Actions>
|
|
72
|
+
</template>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## 相关组件
|
|
76
|
+
ButtonLink, IconTooltip
|
|
77
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# 高级设置开关 (AdvancedSet)
|
|
2
|
+
|
|
3
|
+
用于折叠和展开高级配置区域的业务组件,适合购买页、创建页中把非高频参数收进“高级设置”。
|
|
4
|
+
|
|
5
|
+
**关键词**: advanced set, advanced options, 高级设置, 折叠配置区, 高级参数
|
|
6
|
+
|
|
7
|
+
**使用场景**: 高级参数开关、可折叠配置区、编辑页默认展开高级设置
|
|
8
|
+
|
|
9
|
+
## 导入语句
|
|
10
|
+
```typescript
|
|
11
|
+
import { AdvancedSet } from '@ksyun-internal/versatile';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 属性 (Props)
|
|
15
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
|
|
16
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
17
|
+
| modelValue | `boolean` | `undefined` | 否 | 是否展开高级设置 | - | - |
|
|
18
|
+
| label | `string` | `undefined` | 否 | 标题文案 | - | - |
|
|
19
|
+
| appendTip | `string` | `undefined` | 否 | 追加提示文案 | - | - |
|
|
20
|
+
|
|
21
|
+
## 事件 (Events)
|
|
22
|
+
| 事件名 | Vue事件名 | 说明 | 回调参数 | 示例 |
|
|
23
|
+
| --- | --- | --- | --- | --- |
|
|
24
|
+
| update:modelValue | `@update:modelValue` | 用户展开或收起高级设置区域时触发,可用于同步表单状态或埋点。 | `value?: boolean` | - |
|
|
25
|
+
|
|
26
|
+
### 事件参数说明
|
|
27
|
+
**update:modelValue**
|
|
28
|
+
|
|
29
|
+
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
30
|
+
| --- | --- | --- | --- | --- |
|
|
31
|
+
| value | `boolean` | 否 | - | 当前高级设置区域的展开状态。 |
|
|
32
|
+
|
|
33
|
+
## 插槽 (Slots)
|
|
34
|
+
| 插槽名 | 说明 | 模板写法 | 示例 |
|
|
35
|
+
| --- | --- | --- | --- |
|
|
36
|
+
| default | 高级设置内容区域 | `<AdvancedSet>...</AdvancedSet>` | - |
|
|
37
|
+
|
|
38
|
+
## 使用示例
|
|
39
|
+
### 购买页中的高级设置折叠区
|
|
40
|
+
**场景**: 创建实例时把网络、命名等低频参数收纳到高级设置区。
|
|
41
|
+
|
|
42
|
+
默认收起高级参数,只在用户主动展开后展示额外配置。
|
|
43
|
+
|
|
44
|
+
**使用的 API**: 属性: modelValue, label, appendTip | 事件: update:modelValue
|
|
45
|
+
|
|
46
|
+
```vue
|
|
47
|
+
<script setup lang="ts">
|
|
48
|
+
import { ref } from 'vue';
|
|
49
|
+
import { AdvancedSet, FormItemInput, FormItemSpinner } from '@ksyun-internal/versatile';
|
|
50
|
+
|
|
51
|
+
const advanced = ref(false);
|
|
52
|
+
const hostname = ref('web-01');
|
|
53
|
+
const bandwidth = ref(20);
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<template>
|
|
57
|
+
<AdvancedSet v-model="advanced" label="高级设置" append-tip="修改后将影响实例网络配置">
|
|
58
|
+
<FormItemInput v-model="hostname" label="主机名" />
|
|
59
|
+
<FormItemSpinner v-model="bandwidth" label="带宽峰值" unit="Mbps" />
|
|
60
|
+
</AdvancedSet>
|
|
61
|
+
</template>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 默认展开高级设置
|
|
65
|
+
**场景**: 在编辑页面中默认展开高级参数,方便用户快速核对设置。
|
|
66
|
+
|
|
67
|
+
在编辑已有配置时直接展开高级区域,减少额外点击。
|
|
68
|
+
|
|
69
|
+
**使用的 API**: 属性: modelValue, label, appendTip | 事件: update:modelValue
|
|
70
|
+
|
|
71
|
+
```vue
|
|
72
|
+
<script setup lang="ts">
|
|
73
|
+
import { ref } from 'vue';
|
|
74
|
+
import { AdvancedSet, FormItemSwitch } from '@ksyun-internal/versatile';
|
|
75
|
+
|
|
76
|
+
const advanced = ref(true);
|
|
77
|
+
const enableMonitor = ref(false);
|
|
78
|
+
</script>
|
|
79
|
+
|
|
80
|
+
<template>
|
|
81
|
+
<AdvancedSet v-model="advanced" label="高级设置" append-tip="修改后即时生效">
|
|
82
|
+
<FormItemSwitch v-model="enableMonitor" label="开启监控增强" />
|
|
83
|
+
</AdvancedSet>
|
|
84
|
+
</template>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## 相关组件
|
|
88
|
+
FormItemInput, FormItemSpinner
|
|
89
|
+
|
|
@@ -12,25 +12,33 @@ import { Affix } from '@king-design/vue';
|
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
## 属性 (Props)
|
|
15
|
-
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 示例 |
|
|
16
|
-
| --- | --- | --- | --- | --- | --- |
|
|
17
|
-
| top | `number` | `undefined` | 否 | 距离窗口顶部的偏移量,设置为 undefined 则不生效 | `<Affix :top="100"></Affix>` |
|
|
18
|
-
| bottom | `number` | `undefined` | 否 | 距离窗口底部的偏移量,设置为 undefined 则不生效 | `<Affix :bottom="50"></Affix>` |
|
|
19
|
-
| shouldFix | `Function` | `undefined` | 否 | 自定义是否需要固定的函数,返回 boolean | `<Affix :shouldFix="checkFix"></Affix>` |
|
|
20
|
-
| exclude | `Function` | `undefined` | 否 | 自定义排除固定的函数,返回 boolean 表示不固定 | `<Affix :exclude="checkExclude"></Affix>` |
|
|
21
|
-
| disabled | `boolean` | `false` | 否 | 是否禁用固定功能 | `<Affix disabled></Affix>` |
|
|
15
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
|
|
16
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
17
|
+
| top | `number` | `undefined` | 否 | 距离窗口顶部的偏移量,设置为 undefined 则不生效 | - | `<Affix :top="100"></Affix>` |
|
|
18
|
+
| bottom | `number` | `undefined` | 否 | 距离窗口底部的偏移量,设置为 undefined 则不生效 | - | `<Affix :bottom="50"></Affix>` |
|
|
19
|
+
| shouldFix | `Function` | `undefined` | 否 | 自定义是否需要固定的函数,返回 boolean | - | `<Affix :shouldFix="checkFix"></Affix>` |
|
|
20
|
+
| exclude | `Function` | `undefined` | 否 | 自定义排除固定的函数,返回 boolean 表示不固定 | - | `<Affix :exclude="checkExclude"></Affix>` |
|
|
21
|
+
| disabled | `boolean` | `false` | 否 | 是否禁用固定功能 | - | `<Affix disabled></Affix>` |
|
|
22
22
|
|
|
23
23
|
## 事件 (Events)
|
|
24
24
|
| 事件名 | Vue事件名 | 说明 | 回调参数 | 示例 |
|
|
25
25
|
| --- | --- | --- | --- | --- |
|
|
26
26
|
| change | `@change` | 固定状态改变时触发 | `isFixed: boolean` | `<Affix @change="handleChange"></Affix>` |
|
|
27
27
|
|
|
28
|
+
### 事件参数说明
|
|
29
|
+
**change**
|
|
30
|
+
|
|
31
|
+
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
32
|
+
| --- | --- | --- | --- | --- |
|
|
33
|
+
| isFixed | `boolean` | 是 | - | 当前是否处于固定状态 |
|
|
34
|
+
|
|
28
35
|
## 插槽 (Slots)
|
|
29
36
|
| 插槽名 | 说明 | 模板写法 | 示例 |
|
|
30
37
|
| --- | --- | --- | --- |
|
|
31
38
|
| default | 需要被固定的元素 | `#default` | `<Affix><Button>Fixed Button</Button></Affix>` |
|
|
32
39
|
|
|
33
40
|
## 常见错误与正确用法 (Anti-Hallucination)
|
|
41
|
+
### 父容器滚动问题
|
|
34
42
|
> **错误用法**: `<div style="overflow: auto; height: 200px;">
|
|
35
43
|
<Affix :top="10">...</Affix>
|
|
36
44
|
</div>`
|