@done-coding/admin-core 0.8.3-alpha.0 → 0.9.1-alpha.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/docs/nested-config-paradigm.md +80 -0
- package/es/bridge/config-hook.mjs +37 -0
- package/es/bridge/index.mjs +157 -62
- package/es/bridge/plugin.mjs +29 -0
- package/es/bridge/theme.mjs +65 -0
- package/es/components/app-layout/AppBody.vue.mjs +1 -1
- package/es/components/app-layout/AppBody.vue2.mjs +47 -49
- package/es/components/app-layout/AppBreadcrumb.vue.mjs +1 -1
- package/es/components/app-layout/AppBreadcrumb.vue2.mjs +35 -41
- package/es/components/app-layout/AppFooter.vue.mjs +2 -2
- package/es/components/app-layout/AppFooter.vue2.mjs +8 -8
- package/es/components/app-layout/AppHeader.vue.mjs +1 -1
- package/es/components/app-layout/AppHeader.vue2.mjs +60 -69
- package/es/components/app-layout/AppLayout.vue.mjs +2 -2
- package/es/components/app-layout/AppLayout.vue2.mjs +95 -93
- package/es/components/app-layout/AppSidebar.vue.mjs +2 -2
- package/es/components/app-layout/AppSidebar.vue2.mjs +79 -82
- package/es/components/app-layout/AppTheme.vue.mjs +7 -0
- package/es/components/app-layout/AppTheme.vue2.mjs +38 -0
- package/es/components/data-view/DataListView.vue.mjs +2 -2
- package/es/components/data-view/DataListView.vue2.mjs +36 -36
- package/es/components/display/ActionConfirm.vue2.mjs +16 -16
- package/es/components/display/HeightProvider.vue.mjs +10 -10
- package/es/components/display/TabsHeader.vue.mjs +4 -4
- package/es/components/display/TabsHeader.vue2.mjs +34 -34
- package/es/components/display/TabsMain.vue.mjs +40 -39
- package/es/components/display/TabsRefineFlow.vue.mjs +30 -28
- package/es/components/form/FormItem.vue.mjs +1 -1
- package/es/components/form/FormItem.vue2.mjs +75 -81
- package/es/components/form/FormItemNestForm.vue.mjs +7 -0
- package/es/components/form/FormItemNestForm.vue2.mjs +49 -0
- package/es/components/form/FormItemNestFormList.vue.mjs +7 -0
- package/es/components/form/FormItemNestFormList.vue2.mjs +137 -0
- package/es/components/form/FormMain.vue.mjs +5 -147
- package/es/components/form/FormMain.vue2.mjs +160 -2
- package/es/components/form/FormRadioGroup.vue.mjs +42 -49
- package/es/components/form/FormSearch.vue.mjs +2 -2
- package/es/components/form/FormSearch.vue2.mjs +122 -128
- package/es/components/form/FormSelect.vue.mjs +34 -40
- package/es/components/form/FormSubmitBtn.vue.mjs +23 -28
- package/es/components/form/FormSubmitPanel.vue.mjs +2 -2
- package/es/components/form/FormSubmitPanel.vue2.mjs +29 -28
- package/es/components/form/FormTree.vue.mjs +16 -21
- package/es/components/form/FormVerifyCode.vue.mjs +37 -43
- package/es/components/form/FormVerifyImage.vue.mjs +2 -2
- package/es/components/form/FormVerifyImage.vue2.mjs +36 -41
- package/es/components/form/nest-form-item-list.mjs +71 -0
- package/es/components/form/nest-form-item.mjs +42 -0
- package/es/components/form/nest-registry.mjs +7 -0
- package/es/components/form/use-nest-form-list.mjs +22 -0
- package/es/components/form/use-nest-form.mjs +34 -0
- package/es/components/form/use-nest-layout-scale.mjs +14 -0
- package/es/components/form/utils.mjs +77 -61
- package/es/components/list-page/ListPage.vue.mjs +2 -2
- package/es/components/list-page/ListPage.vue2.mjs +134 -139
- package/es/components/menu/MenuItemSub.vue.mjs +41 -48
- package/es/components/menu/MenuTree.vue.mjs +58 -65
- package/es/components/misc/AutoRefresh.vue.mjs +2 -2
- package/es/components/misc/AutoRefresh.vue2.mjs +44 -51
- package/es/components/misc/AutoRefreshGroup.vue.mjs +2 -2
- package/es/components/misc/AutoRefreshGroup.vue2.mjs +37 -43
- package/es/components/modal/ConfirmModal.vue.mjs +3 -4
- package/es/components/modal/ConfirmModal.vue2.mjs +83 -111
- package/es/components/modal/DetailModal.vue.mjs +38 -41
- package/es/components/panel/PanelEditSwitch.vue.mjs +1 -1
- package/es/components/panel/PanelEditSwitch.vue2.mjs +50 -55
- package/es/components/panel/PanelItemNestForm.vue.mjs +7 -0
- package/es/components/panel/PanelItemNestForm.vue2.mjs +69 -0
- package/es/components/panel/PanelItemNestPanel.vue.mjs +34 -0
- package/es/components/panel/PanelItemNestPanel.vue2.mjs +4 -0
- package/es/components/panel/PanelMain.vue.mjs +1 -1
- package/es/components/panel/PanelMain.vue2.mjs +72 -72
- package/es/components/panel/nest-panel-form.mjs +53 -0
- package/es/components/panel/nest-panel-item.mjs +25 -0
- package/es/components/table/TableMain.vue.mjs +2 -2
- package/es/components/table/TableMain.vue2.mjs +221 -229
- package/es/components/table/TableToolbar.vue.mjs +2 -2
- package/es/components/table/TableToolbar.vue2.mjs +115 -126
- package/es/hooks/use-admin-theme-apply.mjs +84 -0
- package/es/hooks/use-admin-viewport-apply.mjs +27 -0
- package/es/index.mjs +190 -153
- package/es/inject/key.mjs +15 -6
- package/es/store/app.mjs +75 -84
- package/es/style.css +1 -1
- package/es/utils/theme-scale.mjs +37 -0
- package/package.json +2 -4
- package/types/bridge/config-hook.d.ts +91 -0
- package/types/bridge/index.d.ts +108 -8
- package/types/bridge/plugin.d.ts +39 -0
- package/types/bridge/theme.d.ts +85 -0
- package/types/components/app-layout/AppTheme.vue.d.ts +2 -0
- package/types/components/app-layout/types.d.ts +1 -1
- package/types/components/form/FormItem.vue.d.ts +12 -12
- package/types/components/form/FormItemNestForm.vue.d.ts +36 -0
- package/types/components/form/FormItemNestFormList.vue.d.ts +63 -0
- package/types/components/form/FormMain.vue.d.ts +2 -2
- package/types/components/form/FormSearch.vue.d.ts +2 -2
- package/types/components/form/FormTree.vue.d.ts +50 -50
- package/types/components/form/index.d.ts +9 -1
- package/types/components/form/nest-form-item-list.d.ts +63 -0
- package/types/components/form/nest-form-item.d.ts +36 -0
- package/types/components/form/nest-registry.d.ts +22 -0
- package/types/components/form/types.d.ts +2 -0
- package/types/components/form/use-nest-form-list.d.ts +20 -0
- package/types/components/form/use-nest-form.d.ts +26 -0
- package/types/components/form/use-nest-layout-scale.d.ts +17 -0
- package/types/components/form/utils.d.ts +26 -1
- package/types/components/menu/MenuTree.vue.d.ts +10 -10
- package/types/components/modal/ModalShelf.vue.d.ts +1 -1
- package/types/components/panel/PanelItemNestForm.vue.d.ts +35 -0
- package/types/components/panel/PanelItemNestPanel.vue.d.ts +22 -0
- package/types/components/panel/index.d.ts +5 -1
- package/types/components/panel/nest-panel-form.d.ts +38 -0
- package/types/components/panel/nest-panel-item.d.ts +28 -0
- package/types/components/panel/types.d.ts +2 -0
- package/types/components/table/TableMain.vue.d.ts +3 -3
- package/types/hooks/activated.d.ts +2 -2
- package/types/hooks/feel-size.d.ts +1 -1
- package/types/hooks/index.d.ts +2 -0
- package/types/hooks/menus-dispatch.d.ts +5 -5
- package/types/hooks/use-admin-theme-apply.d.ts +17 -0
- package/types/hooks/use-admin-viewport-apply.d.ts +15 -0
- package/types/hooks/use-breakpoint.d.ts +1 -1
- package/types/inject/key.d.ts +46 -1
- package/types/store/app.d.ts +138 -59
- package/types/utils/index.d.ts +1 -0
- package/types/utils/theme-scale.d.ts +35 -0
|
@@ -3,9 +3,9 @@ import { ColProps } from 'element-plus';
|
|
|
3
3
|
declare const _default: <PO extends Record<string, any>, SO extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
4
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
5
5
|
readonly onSubmit?: ((type: FormItemSubmitType) => any) | undefined;
|
|
6
|
-
readonly onLoadingChange?: ((status: boolean) => any) | undefined;
|
|
7
6
|
readonly onVisibleChange?: ((status: boolean) => any) | undefined;
|
|
8
|
-
|
|
7
|
+
readonly onLoadingChange?: ((status: boolean) => any) | undefined;
|
|
8
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onSubmit" | "onVisibleChange" | "onLoadingChange"> & FormMainProps<PO, SO> & Partial<{}>> & import('vue').PublicProps;
|
|
9
9
|
expose(exposed: import('vue').ShallowUnwrapRef<FormMainInstance<PO, SO>>): void;
|
|
10
10
|
attrs: any;
|
|
11
11
|
slots: Partial<Record<NonNullable<Extract<keyof PO, string>>, (_: {
|
|
@@ -2,9 +2,9 @@ import { FormSearchInstance, FormSearchProps, FormSearchSearchType } from './typ
|
|
|
2
2
|
declare const _default: <PO extends Record<string, any>, SO extends Record<string, any>, SQ extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
3
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
4
4
|
readonly onSearch?: ((data: import('./types').ExcludeNeverProperties<import('./types').ExtractFormStringifyRawFromObject<PO, SO>> & SQ, type: FormSearchSearchType) => any) | undefined;
|
|
5
|
-
readonly onVisibleChange?: ((status: boolean) => any) | undefined;
|
|
6
5
|
readonly onHeightChange?: ((height: number) => any) | undefined;
|
|
7
|
-
|
|
6
|
+
readonly onVisibleChange?: ((status: boolean) => any) | undefined;
|
|
7
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onHeightChange" | "onSearch" | "onVisibleChange"> & FormSearchProps<PO, SO, SQ> & Partial<{}>> & import('vue').PublicProps;
|
|
8
8
|
expose(exposed: import('vue').ShallowUnwrapRef<FormSearchInstance<PO, SO>>): void;
|
|
9
9
|
attrs: any;
|
|
10
10
|
slots: Partial<Record<NonNullable<Extract<keyof PO, string>>, (_: any) => any>>;
|
|
@@ -13,10 +13,10 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
13
13
|
}>, {
|
|
14
14
|
tree: FormTreeItem[];
|
|
15
15
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
16
|
-
elTree: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<
|
|
16
|
+
elTree: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
17
17
|
readonly data: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => import('element-plus').TreeData) | (() => import('element-plus').TreeData) | (((new (...args: any[]) => import('element-plus').TreeData) | (() => import('element-plus').TreeData)) | null)[], unknown, unknown, () => never[], boolean>;
|
|
18
18
|
readonly emptyText: {
|
|
19
|
-
readonly type:
|
|
19
|
+
readonly type: import('vue').PropType<string>;
|
|
20
20
|
readonly required: false;
|
|
21
21
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
22
22
|
__epPropKey: true;
|
|
@@ -31,25 +31,25 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
31
31
|
readonly checkDescendants: BooleanConstructor;
|
|
32
32
|
readonly autoExpandParent: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
33
33
|
readonly defaultCheckedKeys: {
|
|
34
|
-
readonly type:
|
|
34
|
+
readonly type: import('vue').PropType<import('element-plus').TreeKey[]>;
|
|
35
35
|
readonly required: false;
|
|
36
36
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
37
37
|
__epPropKey: true;
|
|
38
38
|
};
|
|
39
39
|
readonly defaultExpandedKeys: {
|
|
40
|
-
readonly type:
|
|
40
|
+
readonly type: import('vue').PropType<import('element-plus').TreeKey[]>;
|
|
41
41
|
readonly required: false;
|
|
42
42
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
43
43
|
__epPropKey: true;
|
|
44
44
|
};
|
|
45
45
|
readonly currentNodeKey: {
|
|
46
|
-
readonly type:
|
|
46
|
+
readonly type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | (((new (...args: any[]) => string | number) | (() => string | number)) | null)[], unknown, unknown>>;
|
|
47
47
|
readonly required: false;
|
|
48
48
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
49
49
|
__epPropKey: true;
|
|
50
50
|
};
|
|
51
51
|
readonly renderContent: {
|
|
52
|
-
readonly type:
|
|
52
|
+
readonly type: import('vue').PropType<import('element-plus').RenderContentFunction>;
|
|
53
53
|
readonly required: false;
|
|
54
54
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
55
55
|
__epPropKey: true;
|
|
@@ -57,13 +57,13 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
57
57
|
readonly showCheckbox: BooleanConstructor;
|
|
58
58
|
readonly draggable: BooleanConstructor;
|
|
59
59
|
readonly allowDrag: {
|
|
60
|
-
readonly type:
|
|
60
|
+
readonly type: import('vue').PropType<import('element-plus').AllowDragFunction>;
|
|
61
61
|
readonly required: false;
|
|
62
62
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
63
63
|
__epPropKey: true;
|
|
64
64
|
};
|
|
65
65
|
readonly allowDrop: {
|
|
66
|
-
readonly type:
|
|
66
|
+
readonly type: import('vue').PropType<import('element-plus').AllowDropFunction>;
|
|
67
67
|
readonly required: false;
|
|
68
68
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
69
69
|
__epPropKey: true;
|
|
@@ -76,13 +76,13 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
76
76
|
readonly lazy: BooleanConstructor;
|
|
77
77
|
readonly highlightCurrent: BooleanConstructor;
|
|
78
78
|
readonly load: {
|
|
79
|
-
readonly type:
|
|
79
|
+
readonly type: import('vue').PropType<import('element-plus').LoadFunction>;
|
|
80
80
|
readonly required: false;
|
|
81
81
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
82
82
|
__epPropKey: true;
|
|
83
83
|
};
|
|
84
84
|
readonly filterNodeMethod: {
|
|
85
|
-
readonly type:
|
|
85
|
+
readonly type: import('vue').PropType<import('element-plus').FilterNodeMethodFunction>;
|
|
86
86
|
readonly required: false;
|
|
87
87
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
88
88
|
__epPropKey: true;
|
|
@@ -90,7 +90,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
90
90
|
readonly accordion: BooleanConstructor;
|
|
91
91
|
readonly indent: import('element-plus/es/utils/index.mjs').EpPropFinalized<NumberConstructor, unknown, unknown, 18, boolean>;
|
|
92
92
|
readonly icon: {
|
|
93
|
-
readonly type:
|
|
93
|
+
readonly type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<(new (...args: any[]) => (string | import('vue').Component) & {}) | (() => string | import('vue').Component) | (((new (...args: any[]) => (string | import('vue').Component) & {}) | (() => string | import('vue').Component)) | null)[], unknown, unknown>>;
|
|
94
94
|
readonly required: false;
|
|
95
95
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
96
96
|
__epPropKey: true;
|
|
@@ -111,7 +111,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
111
111
|
"onNode-drag-over"?: ((draggingNode: import('element-plus/es/components/tree/src/model/node.mjs').Node, dropNode: import('element-plus/es/components/tree/src/model/node.mjs').Node, evt: DragEvent) => any) | undefined;
|
|
112
112
|
}>, {
|
|
113
113
|
ns: {
|
|
114
|
-
namespace:
|
|
114
|
+
namespace: import('vue').ComputedRef<string>;
|
|
115
115
|
b: (blockSuffix?: string) => string;
|
|
116
116
|
e: (element?: string) => string;
|
|
117
117
|
m: (modifier?: string) => string;
|
|
@@ -128,7 +128,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
128
128
|
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
129
129
|
cssVarBlockName: (name: string) => string;
|
|
130
130
|
};
|
|
131
|
-
store:
|
|
131
|
+
store: import('vue').Ref<{
|
|
132
132
|
currentNode: {
|
|
133
133
|
id: number;
|
|
134
134
|
text: string | null;
|
|
@@ -415,7 +415,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
415
415
|
setUserCurrentNode: (node: import('element-plus/es/components/tree/src/model/node.mjs').Node, shouldAutoExpandParent?: boolean) => void;
|
|
416
416
|
setCurrentNodeKey: (key: import('element-plus').TreeKey | null, shouldAutoExpandParent?: boolean) => void;
|
|
417
417
|
}>;
|
|
418
|
-
root:
|
|
418
|
+
root: import('vue').Ref<{
|
|
419
419
|
id: number;
|
|
420
420
|
text: string | null;
|
|
421
421
|
checked: boolean;
|
|
@@ -504,7 +504,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
504
504
|
eachNode: (callback: (node: import('element-plus/es/components/tree/src/model/node.mjs').Node) => void) => void;
|
|
505
505
|
reInitChecked: () => void;
|
|
506
506
|
}>;
|
|
507
|
-
currentNode:
|
|
507
|
+
currentNode: import('vue').Ref<{
|
|
508
508
|
id: number;
|
|
509
509
|
text: string | null;
|
|
510
510
|
checked: boolean;
|
|
@@ -593,7 +593,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
593
593
|
eachNode: (callback: (node: import('element-plus/es/components/tree/src/model/node.mjs').Node) => void) => void;
|
|
594
594
|
reInitChecked: () => void;
|
|
595
595
|
} | null>;
|
|
596
|
-
dragState:
|
|
596
|
+
dragState: import('vue').Ref<{
|
|
597
597
|
allowDrop: boolean;
|
|
598
598
|
dropType: import('element-plus').NodeDropType | null;
|
|
599
599
|
draggingNode: {
|
|
@@ -800,9 +800,9 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
800
800
|
$el?: HTMLElement | undefined;
|
|
801
801
|
} | null;
|
|
802
802
|
}>;
|
|
803
|
-
el$:
|
|
804
|
-
dropIndicator$:
|
|
805
|
-
isEmpty:
|
|
803
|
+
el$: import('vue').Ref<import('element-plus').Nullable<HTMLElement>, import('element-plus').Nullable<HTMLElement>>;
|
|
804
|
+
dropIndicator$: import('vue').Ref<import('element-plus').Nullable<HTMLElement>, import('element-plus').Nullable<HTMLElement>>;
|
|
805
|
+
isEmpty: import('vue').ComputedRef<boolean>;
|
|
806
806
|
filter: (value: import('element-plus').FilterValue) => void;
|
|
807
807
|
getNodeKey: (node: import('element-plus/es/components/tree/src/model/node.mjs').Node) => any;
|
|
808
808
|
getNodePath: (data: import('element-plus').TreeKey | import('element-plus').TreeNodeData) => import('element-plus').TreeNodeData[];
|
|
@@ -857,13 +857,13 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
857
857
|
readonly checkDescendants: boolean;
|
|
858
858
|
readonly highlightCurrent: boolean;
|
|
859
859
|
}, true, {}, {}, {
|
|
860
|
-
ElTreeNode: import('vue').DefineComponent<
|
|
860
|
+
ElTreeNode: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
861
861
|
node: {
|
|
862
862
|
type: typeof import('element-plus/es/components/tree/src/model/node.mjs').Node;
|
|
863
863
|
default: () => {};
|
|
864
864
|
};
|
|
865
865
|
props: {
|
|
866
|
-
type:
|
|
866
|
+
type: import('vue').PropType<import('element-plus').TreeOptionProps>;
|
|
867
867
|
default: () => {};
|
|
868
868
|
};
|
|
869
869
|
accordion: BooleanConstructor;
|
|
@@ -872,7 +872,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
872
872
|
showCheckbox: BooleanConstructor;
|
|
873
873
|
}>, {
|
|
874
874
|
ns: {
|
|
875
|
-
namespace:
|
|
875
|
+
namespace: import('vue').ComputedRef<string>;
|
|
876
876
|
b: (blockSuffix?: string) => string;
|
|
877
877
|
e: (element?: string) => string;
|
|
878
878
|
m: (modifier?: string) => string;
|
|
@@ -889,12 +889,12 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
889
889
|
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
890
890
|
cssVarBlockName: (name: string) => string;
|
|
891
891
|
};
|
|
892
|
-
node$:
|
|
892
|
+
node$: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
893
893
|
tree: import('element-plus').RootTreeType;
|
|
894
|
-
expanded:
|
|
895
|
-
childNodeRendered:
|
|
896
|
-
oldChecked:
|
|
897
|
-
oldIndeterminate:
|
|
894
|
+
expanded: import('vue').Ref<boolean, boolean>;
|
|
895
|
+
childNodeRendered: import('vue').Ref<boolean, boolean>;
|
|
896
|
+
oldChecked: import('vue').Ref<boolean | undefined, boolean | undefined>;
|
|
897
|
+
oldIndeterminate: import('vue').Ref<boolean | undefined, boolean | undefined>;
|
|
898
898
|
getNodeKey: (node: import('element-plus/es/components/tree/src/model/node.mjs').Node) => any;
|
|
899
899
|
getNodeClass: (node: import('element-plus/es/components/tree/src/model/node.mjs').Node) => {
|
|
900
900
|
[key: string]: boolean;
|
|
@@ -910,13 +910,13 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
910
910
|
handleDrop: (event: DragEvent) => void;
|
|
911
911
|
handleDragEnd: (event: DragEvent) => void;
|
|
912
912
|
CaretRight: import('vue').DefineComponent<{}, void, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
913
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "node-expand"[], "node-expand", import('vue').PublicProps, Readonly<
|
|
913
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "node-expand"[], "node-expand", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
914
914
|
node: {
|
|
915
915
|
type: typeof import('element-plus/es/components/tree/src/model/node.mjs').Node;
|
|
916
916
|
default: () => {};
|
|
917
917
|
};
|
|
918
918
|
props: {
|
|
919
|
-
type:
|
|
919
|
+
type: import('vue').PropType<import('element-plus').TreeOptionProps>;
|
|
920
920
|
default: () => {};
|
|
921
921
|
};
|
|
922
922
|
accordion: BooleanConstructor;
|
|
@@ -1174,13 +1174,13 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
1174
1174
|
};
|
|
1175
1175
|
});
|
|
1176
1176
|
};
|
|
1177
|
-
NodeContent: import('vue').DefineComponent<
|
|
1177
|
+
NodeContent: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
1178
1178
|
node: {
|
|
1179
1179
|
type: ObjectConstructor;
|
|
1180
1180
|
required: true;
|
|
1181
1181
|
};
|
|
1182
1182
|
renderContent: FunctionConstructor;
|
|
1183
|
-
}>, () => any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<
|
|
1183
|
+
}>, () => any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
1184
1184
|
node: {
|
|
1185
1185
|
type: ObjectConstructor;
|
|
1186
1186
|
required: true;
|
|
@@ -1213,10 +1213,10 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
1213
1213
|
C: {};
|
|
1214
1214
|
M: {};
|
|
1215
1215
|
Defaults: {};
|
|
1216
|
-
}, Readonly<
|
|
1216
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
1217
1217
|
readonly data: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => import('element-plus').TreeData) | (() => import('element-plus').TreeData) | (((new (...args: any[]) => import('element-plus').TreeData) | (() => import('element-plus').TreeData)) | null)[], unknown, unknown, () => never[], boolean>;
|
|
1218
1218
|
readonly emptyText: {
|
|
1219
|
-
readonly type:
|
|
1219
|
+
readonly type: import('vue').PropType<string>;
|
|
1220
1220
|
readonly required: false;
|
|
1221
1221
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
1222
1222
|
__epPropKey: true;
|
|
@@ -1231,25 +1231,25 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
1231
1231
|
readonly checkDescendants: BooleanConstructor;
|
|
1232
1232
|
readonly autoExpandParent: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
1233
1233
|
readonly defaultCheckedKeys: {
|
|
1234
|
-
readonly type:
|
|
1234
|
+
readonly type: import('vue').PropType<import('element-plus').TreeKey[]>;
|
|
1235
1235
|
readonly required: false;
|
|
1236
1236
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
1237
1237
|
__epPropKey: true;
|
|
1238
1238
|
};
|
|
1239
1239
|
readonly defaultExpandedKeys: {
|
|
1240
|
-
readonly type:
|
|
1240
|
+
readonly type: import('vue').PropType<import('element-plus').TreeKey[]>;
|
|
1241
1241
|
readonly required: false;
|
|
1242
1242
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
1243
1243
|
__epPropKey: true;
|
|
1244
1244
|
};
|
|
1245
1245
|
readonly currentNodeKey: {
|
|
1246
|
-
readonly type:
|
|
1246
|
+
readonly type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | (((new (...args: any[]) => string | number) | (() => string | number)) | null)[], unknown, unknown>>;
|
|
1247
1247
|
readonly required: false;
|
|
1248
1248
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
1249
1249
|
__epPropKey: true;
|
|
1250
1250
|
};
|
|
1251
1251
|
readonly renderContent: {
|
|
1252
|
-
readonly type:
|
|
1252
|
+
readonly type: import('vue').PropType<import('element-plus').RenderContentFunction>;
|
|
1253
1253
|
readonly required: false;
|
|
1254
1254
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
1255
1255
|
__epPropKey: true;
|
|
@@ -1257,13 +1257,13 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
1257
1257
|
readonly showCheckbox: BooleanConstructor;
|
|
1258
1258
|
readonly draggable: BooleanConstructor;
|
|
1259
1259
|
readonly allowDrag: {
|
|
1260
|
-
readonly type:
|
|
1260
|
+
readonly type: import('vue').PropType<import('element-plus').AllowDragFunction>;
|
|
1261
1261
|
readonly required: false;
|
|
1262
1262
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
1263
1263
|
__epPropKey: true;
|
|
1264
1264
|
};
|
|
1265
1265
|
readonly allowDrop: {
|
|
1266
|
-
readonly type:
|
|
1266
|
+
readonly type: import('vue').PropType<import('element-plus').AllowDropFunction>;
|
|
1267
1267
|
readonly required: false;
|
|
1268
1268
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
1269
1269
|
__epPropKey: true;
|
|
@@ -1276,13 +1276,13 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
1276
1276
|
readonly lazy: BooleanConstructor;
|
|
1277
1277
|
readonly highlightCurrent: BooleanConstructor;
|
|
1278
1278
|
readonly load: {
|
|
1279
|
-
readonly type:
|
|
1279
|
+
readonly type: import('vue').PropType<import('element-plus').LoadFunction>;
|
|
1280
1280
|
readonly required: false;
|
|
1281
1281
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
1282
1282
|
__epPropKey: true;
|
|
1283
1283
|
};
|
|
1284
1284
|
readonly filterNodeMethod: {
|
|
1285
|
-
readonly type:
|
|
1285
|
+
readonly type: import('vue').PropType<import('element-plus').FilterNodeMethodFunction>;
|
|
1286
1286
|
readonly required: false;
|
|
1287
1287
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
1288
1288
|
__epPropKey: true;
|
|
@@ -1290,7 +1290,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
1290
1290
|
readonly accordion: BooleanConstructor;
|
|
1291
1291
|
readonly indent: import('element-plus/es/utils/index.mjs').EpPropFinalized<NumberConstructor, unknown, unknown, 18, boolean>;
|
|
1292
1292
|
readonly icon: {
|
|
1293
|
-
readonly type:
|
|
1293
|
+
readonly type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<(new (...args: any[]) => (string | import('vue').Component) & {}) | (() => string | import('vue').Component) | (((new (...args: any[]) => (string | import('vue').Component) & {}) | (() => string | import('vue').Component)) | null)[], unknown, unknown>>;
|
|
1294
1294
|
readonly required: false;
|
|
1295
1295
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
1296
1296
|
__epPropKey: true;
|
|
@@ -1311,7 +1311,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
1311
1311
|
"onNode-drag-over"?: ((draggingNode: import('element-plus/es/components/tree/src/model/node.mjs').Node, dropNode: import('element-plus/es/components/tree/src/model/node.mjs').Node, evt: DragEvent) => any) | undefined;
|
|
1312
1312
|
}>, {
|
|
1313
1313
|
ns: {
|
|
1314
|
-
namespace:
|
|
1314
|
+
namespace: import('vue').ComputedRef<string>;
|
|
1315
1315
|
b: (blockSuffix?: string) => string;
|
|
1316
1316
|
e: (element?: string) => string;
|
|
1317
1317
|
m: (modifier?: string) => string;
|
|
@@ -1328,7 +1328,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
1328
1328
|
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
1329
1329
|
cssVarBlockName: (name: string) => string;
|
|
1330
1330
|
};
|
|
1331
|
-
store:
|
|
1331
|
+
store: import('vue').Ref<{
|
|
1332
1332
|
currentNode: {
|
|
1333
1333
|
id: number;
|
|
1334
1334
|
text: string | null;
|
|
@@ -1615,7 +1615,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
1615
1615
|
setUserCurrentNode: (node: import('element-plus/es/components/tree/src/model/node.mjs').Node, shouldAutoExpandParent?: boolean) => void;
|
|
1616
1616
|
setCurrentNodeKey: (key: import('element-plus').TreeKey | null, shouldAutoExpandParent?: boolean) => void;
|
|
1617
1617
|
}>;
|
|
1618
|
-
root:
|
|
1618
|
+
root: import('vue').Ref<{
|
|
1619
1619
|
id: number;
|
|
1620
1620
|
text: string | null;
|
|
1621
1621
|
checked: boolean;
|
|
@@ -1704,7 +1704,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
1704
1704
|
eachNode: (callback: (node: import('element-plus/es/components/tree/src/model/node.mjs').Node) => void) => void;
|
|
1705
1705
|
reInitChecked: () => void;
|
|
1706
1706
|
}>;
|
|
1707
|
-
currentNode:
|
|
1707
|
+
currentNode: import('vue').Ref<{
|
|
1708
1708
|
id: number;
|
|
1709
1709
|
text: string | null;
|
|
1710
1710
|
checked: boolean;
|
|
@@ -1793,7 +1793,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
1793
1793
|
eachNode: (callback: (node: import('element-plus/es/components/tree/src/model/node.mjs').Node) => void) => void;
|
|
1794
1794
|
reInitChecked: () => void;
|
|
1795
1795
|
} | null>;
|
|
1796
|
-
dragState:
|
|
1796
|
+
dragState: import('vue').Ref<{
|
|
1797
1797
|
allowDrop: boolean;
|
|
1798
1798
|
dropType: import('element-plus').NodeDropType | null;
|
|
1799
1799
|
draggingNode: {
|
|
@@ -2000,9 +2000,9 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
2000
2000
|
$el?: HTMLElement | undefined;
|
|
2001
2001
|
} | null;
|
|
2002
2002
|
}>;
|
|
2003
|
-
el$:
|
|
2004
|
-
dropIndicator$:
|
|
2005
|
-
isEmpty:
|
|
2003
|
+
el$: import('vue').Ref<import('element-plus').Nullable<HTMLElement>, import('element-plus').Nullable<HTMLElement>>;
|
|
2004
|
+
dropIndicator$: import('vue').Ref<import('element-plus').Nullable<HTMLElement>, import('element-plus').Nullable<HTMLElement>>;
|
|
2005
|
+
isEmpty: import('vue').ComputedRef<boolean>;
|
|
2006
2006
|
filter: (value: import('element-plus').FilterValue) => void;
|
|
2007
2007
|
getNodeKey: (node: import('element-plus/es/components/tree/src/model/node.mjs').Node) => any;
|
|
2008
2008
|
getNodePath: (data: import('element-plus').TreeKey | import('element-plus').TreeNodeData) => import('element-plus').TreeNodeData[];
|
|
@@ -7,6 +7,14 @@ import { default as FormSubmitBtn } from './FormSubmitBtn.vue';
|
|
|
7
7
|
import { default as FormSubmitPanel } from './FormSubmitPanel.vue';
|
|
8
8
|
import { default as FormVerifyImage } from './FormVerifyImage.vue';
|
|
9
9
|
import { default as FormVerifyCode } from './FormVerifyCode.vue';
|
|
10
|
+
import { default as FormItemNestForm } from './FormItemNestForm.vue';
|
|
11
|
+
import { default as FormItemNestFormList } from './FormItemNestFormList.vue';
|
|
10
12
|
export * from './types';
|
|
11
13
|
export * from './utils';
|
|
12
|
-
export
|
|
14
|
+
export * from './nest-registry';
|
|
15
|
+
export * from './use-nest-form';
|
|
16
|
+
export * from './nest-form-item';
|
|
17
|
+
export * from './use-nest-form-list';
|
|
18
|
+
export * from './nest-form-item-list';
|
|
19
|
+
export * from './use-nest-layout-scale';
|
|
20
|
+
export { FormMain, FormSelect, FormSearch, FormSubmitBtn, FormSubmitPanel, FormRadioGroup, FormTree, FormVerifyImage, FormVerifyCode, FormItemNestForm, FormItemNestFormList, };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { VNodeChild } from 'vue';
|
|
2
|
+
import { ColProps } from 'element-plus';
|
|
3
|
+
import { FormItemConfig, FormItemConfigList } from './types';
|
|
4
|
+
import { ActionBtnConfirmConfig } from '../display';
|
|
5
|
+
export interface NestFormItemListOptions {
|
|
6
|
+
/** 父 item key */
|
|
7
|
+
key: string;
|
|
8
|
+
/** 父 item label */
|
|
9
|
+
label: string;
|
|
10
|
+
/** 每行子表单配置列表 */
|
|
11
|
+
list: FormItemConfigList;
|
|
12
|
+
/** 行稳定标识字段(指向行对象内稳定 id);缺省走内部自增 rowId */
|
|
13
|
+
rowKey?: string;
|
|
14
|
+
/** 新增行工厂;缺省 generateFormData(list) */
|
|
15
|
+
itemFactory?: () => Record<string, any>;
|
|
16
|
+
/** 最少行数 */
|
|
17
|
+
min?: number;
|
|
18
|
+
/** 最多行数 */
|
|
19
|
+
max?: number;
|
|
20
|
+
/** 父 item 栅格布局 */
|
|
21
|
+
layout?: Partial<ColProps>;
|
|
22
|
+
/** 每行子表单行间距 */
|
|
23
|
+
rowGutter?: number;
|
|
24
|
+
/** 新增 / 删除按钮文案 */
|
|
25
|
+
addText?: string;
|
|
26
|
+
removeText?: string;
|
|
27
|
+
/** 顶部自定义渲染(render-fn;label 由父 FormItem 渲染,本组件不出 title) */
|
|
28
|
+
headerRender?: (scope: {
|
|
29
|
+
count: number;
|
|
30
|
+
max: number;
|
|
31
|
+
}) => VNodeChild;
|
|
32
|
+
/** 底部自定义渲染;缺省 = 内置「新增」按钮 */
|
|
33
|
+
footerRender?: (scope: {
|
|
34
|
+
count: number;
|
|
35
|
+
max: number;
|
|
36
|
+
canAdd: boolean;
|
|
37
|
+
add: () => void;
|
|
38
|
+
}) => VNodeChild;
|
|
39
|
+
/** 联结组件外环 + 每行分割阴影颜色 */
|
|
40
|
+
shadowColor?: string;
|
|
41
|
+
/** 业务校验规则;与自动织入的 min/max 长度规则合并(长度规则在前) */
|
|
42
|
+
rules?: FormItemConfig["rules"];
|
|
43
|
+
/** 覆盖默认 init(缺省 = 空数组 [],[MUST NOT] 改初始值补 min;min/max 走校验) */
|
|
44
|
+
init?: FormItemConfig["init"];
|
|
45
|
+
/** 覆盖默认 stringify(缺省 = 数组逐项 `stringifyFormData(t, list)`) */
|
|
46
|
+
stringify?: FormItemConfig["stringify"];
|
|
47
|
+
/** 覆盖默认 parse(缺省 = 数组逐项 `parseFormData(t, list)`) */
|
|
48
|
+
parse?: FormItemConfig["parse"];
|
|
49
|
+
/** 是否叠本层嵌套布局 rebase(P3,缺省 true;false = 逆向逃生口,子层 layout 原样直透) */
|
|
50
|
+
rebase?: boolean;
|
|
51
|
+
/** 行删除二次确认(缺省 true=默认 popconfirm「确认删除该项?」;false=直删;对象=自定义) */
|
|
52
|
+
removeConfirm?: boolean | ActionBtnConfirmConfig;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* 生成「父 item 内嵌数组子表单(N 行 FormMain)」的 FormItemConfig(C4 配套 helper)
|
|
56
|
+
* ----
|
|
57
|
+
* render 出口挂 FormItemNestFormList(值贯通数组 in-place + 增删 + 聚合校验穿透自动接线)。
|
|
58
|
+
* ----
|
|
59
|
+
* **序列化 pack(ADR-6,对齐 §34)**:自动织入 init/stringify/parse —— 父 FormMain 的
|
|
60
|
+
* generate()/stringify()/parse() 逐项命中即对数组逐项递归(行内若再嵌 nestFormItem /
|
|
61
|
+
* nestFormItemList → 逐层组合)。业务传 init/stringify/parse 则以业务为准。
|
|
62
|
+
*/
|
|
63
|
+
export declare function nestFormItemList(options: NestFormItemListOptions): FormItemConfig;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ColProps } from 'element-plus';
|
|
2
|
+
import { FormItemConfig, FormItemConfigList } from './types';
|
|
3
|
+
export interface NestFormItemOptions {
|
|
4
|
+
/** 父 item key */
|
|
5
|
+
key: string;
|
|
6
|
+
/** 父 item label */
|
|
7
|
+
label: string;
|
|
8
|
+
/** 子表单配置列表 */
|
|
9
|
+
list: FormItemConfigList;
|
|
10
|
+
/** 父 item 栅格布局 */
|
|
11
|
+
layout?: Partial<ColProps>;
|
|
12
|
+
/** 子表单行间距 */
|
|
13
|
+
rowGutter?: number;
|
|
14
|
+
/** 联结组件外环阴影颜色 */
|
|
15
|
+
shadowColor?: string;
|
|
16
|
+
/** 覆盖默认 init(缺省 = `generateFormData(list)`,产子默认对象) */
|
|
17
|
+
init?: FormItemConfig["init"];
|
|
18
|
+
/** 覆盖默认 stringify(缺省 = 递归 `stringifyFormData(value, list)`) */
|
|
19
|
+
stringify?: FormItemConfig["stringify"];
|
|
20
|
+
/** 覆盖默认 parse(缺省 = 递归 `parseFormData(value, list)`) */
|
|
21
|
+
parse?: FormItemConfig["parse"];
|
|
22
|
+
/** 是否叠本层嵌套布局 rebase(P3,缺省 true;false = 逆向逃生口,子层 layout 原样直透) */
|
|
23
|
+
rebase?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 生成「父 item 内嵌子 FormMain」的 FormItemConfig(C1 配套 helper)
|
|
27
|
+
* ----
|
|
28
|
+
* 降低业务方手写 h(FormItemNestForm) 噪音:传 key/label/子 list 即得一个满足 FormItemConfig
|
|
29
|
+
* 的配置项,渲染出口挂 FormItemNestForm(值贯通 + 校验级联自动接线)。
|
|
30
|
+
* ----
|
|
31
|
+
* **stringify/parse/init 自动 pack**:FormItemConfig 的 per-item `init`/`stringify`/`parse`
|
|
32
|
+
* 钩子 + 纯 list 驱动 util(generate/stringify/parseFormData)→ 自动织入「递归进子 list」,
|
|
33
|
+
* 父 FormMain 的 `generate()`/`stringify()`/`parse()` 逐项命中即递归序列化/回显嵌套子表单,
|
|
34
|
+
* 多层自然组合(孙 nestFormItem 的钩子同理逐层)。业务传 init/stringify/parse 则以业务为准。
|
|
35
|
+
*/
|
|
36
|
+
export declare function nestFormItem(options: NestFormItemOptions): FormItemConfig;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FormMainInstance } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* 嵌套子 FormMain 级联 expose 子集
|
|
4
|
+
* ----
|
|
5
|
+
* 联结组件(FormItemNestForm)把所持子 FormMain 的级联方法注册进父 FormMain 的 exposeMap,
|
|
6
|
+
* 使父顶层 validate/clearValidate/resetFields 可级联到子。
|
|
7
|
+
*/
|
|
8
|
+
export interface NestFormExpose {
|
|
9
|
+
validate: FormMainInstance["validate"];
|
|
10
|
+
clearValidate: FormMainInstance["clearValidate"];
|
|
11
|
+
resetFields: FormMainInstance["resetFields"];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 嵌套子表单 exposeMap
|
|
15
|
+
* ----
|
|
16
|
+
* key = 联结组件所属父 item 的 key(天然唯一,供父 FormMain 对齐 hideKeyList:隐藏 item 不级联 validate)。
|
|
17
|
+
* 用 `shallowReactive`:顶层 key 增删响应式(注册/摘除可被响应式消费),value(expose 对象)保持 raw
|
|
18
|
+
* 不深代理——既规避 expose 引用循环,又留响应式消费口。每个 FormMain 经工厂在闭包内 new 一份,零模块级单例。
|
|
19
|
+
*/
|
|
20
|
+
export type NestFormExposeMap = Record<string, NestFormExpose>;
|
|
21
|
+
/** 创建一个嵌套子表单 exposeMap(shallowReactive) */
|
|
22
|
+
export declare function createNestFormExposeMap(): NestFormExposeMap;
|
|
@@ -161,6 +161,8 @@ export interface FormMainProps<PO extends Record<string, any>, SO extends Record
|
|
|
161
161
|
data: PO;
|
|
162
162
|
layout?: Partial<ColProps>;
|
|
163
163
|
rowGutter?: number;
|
|
164
|
+
/** P3 嵌套 rebase 累乘因子(缺省 1 = 顶级行为不变,向后兼容)。由联结薄壳算出后传子 FormMain */
|
|
165
|
+
layoutScale?: number;
|
|
164
166
|
}
|
|
165
167
|
/** FormSearch props */
|
|
166
168
|
export interface FormSearchProps<PO extends Record<string, any>, SO extends Record<string, any>, SQ extends Record<string, any>> extends FormMainProps<PO, SO> {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import { FormMainInstance } from './types';
|
|
3
|
+
export interface UseNestFormListOptions {
|
|
4
|
+
/** 当前存活行子 FormMain 实例(getter,每次取最新存活集合) */
|
|
5
|
+
rowInstances: () => FormMainInstance[];
|
|
6
|
+
/**
|
|
7
|
+
* 父 item key——注册到父 FormMain exposeMap 的索引(C4 必传);
|
|
8
|
+
* 无父 FormMain registry(脱离嵌套上下文)时 inject 返回 null → 跳过注册。
|
|
9
|
+
*/
|
|
10
|
+
key?: MaybeRefOrGetter<string | undefined>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 数组子表单聚合注册 composable(C4 配套,ADR-1/2)
|
|
14
|
+
* ----
|
|
15
|
+
* 向最近祖先 FormMain registry 注册【1 个聚合 expose】(key = 本 item key),方法体
|
|
16
|
+
* fan-out 遍历当前存活 N 行子 FormMain:validate=Promise.all、clearValidate/resetFields=forEach。
|
|
17
|
+
* → 父 registry 仍「1 item 1 entry」,父 validate 的 hideKeyList 过滤按 item key 命中(守 ADR-8)。
|
|
18
|
+
* 职责收窄:仅聚合注册 + 摘除,[MUST NOT] 碰值贯通 / 增删(组件自管)。
|
|
19
|
+
*/
|
|
20
|
+
export declare function useNestFormList(options: UseNestFormListOptions): void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { MaybeRefOrGetter, Ref } from 'vue';
|
|
2
|
+
import { FormMainInstance } from './types';
|
|
3
|
+
export interface UseNestFormOptions {
|
|
4
|
+
/** 子 FormMain 实例 ref(联结组件内 FormMain 的 defineExpose) */
|
|
5
|
+
childRef: Ref<FormMainInstance | undefined>;
|
|
6
|
+
/**
|
|
7
|
+
* 所属父 item key——注册到父 FormMain exposeMap 时必传(C1 form 族,作 map 索引);
|
|
8
|
+
* panel 上下文(C3)无父 FormMain exposeMap,可省(inject 返回 null → 跳过注册)。
|
|
9
|
+
* 接受 ref/getter,挂载/摘除时经 toValue 取值(避免 setup 根作用域读 props 失响应式)。
|
|
10
|
+
*/
|
|
11
|
+
key?: MaybeRefOrGetter<string | undefined>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 嵌套联结组件子表单接线 composable
|
|
15
|
+
* ----
|
|
16
|
+
* 职责(ADR-7,刻意收窄):
|
|
17
|
+
* 1. 代理子 FormMain 的 validate / clearValidate / resetFields;
|
|
18
|
+
* 2. context 自适应注册——inject 到最近祖先 FormMain 的 exposeMap 则按 key 写入(onMounted)+
|
|
19
|
+
* 删除(onBeforeUnmount);无(panel 上下文)则跳过。
|
|
20
|
+
* [MUST NOT] 在此处理值贯通——值语义 form/panel 两族不同(ADR-5),由各联结组件自管。
|
|
21
|
+
*/
|
|
22
|
+
export declare function useNestForm(options: UseNestFormOptions): {
|
|
23
|
+
validateChild: () => Promise<void>;
|
|
24
|
+
clearChild: (k?: string) => void;
|
|
25
|
+
resetChild: () => void;
|
|
26
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MaybeRefOrGetter, ComputedRef } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 联结薄壳计算子 Form/PanelMain 的嵌套布局 rebase 因子(P3,4 薄壳共用)。
|
|
4
|
+
* ----
|
|
5
|
+
* `childScale = parentScale × (24 / parentSpan)`:
|
|
6
|
+
* - parentScale 经 inject 从最近祖先 Form/PanelMain 取(顶级 / 未嵌套 → 缺省 1);
|
|
7
|
+
* - parentSpan = 父 item 实际分配的代表 span(薄壳由 helper 经 props 传入,缺省 24 = 本层不缩);
|
|
8
|
+
* - `rebase === false`(逆向逃生口)→ 不叠本层因子(= parentScale),layout 原样直透子层。
|
|
9
|
+
* ----
|
|
10
|
+
* 返回 ComputedRef,薄壳作 `layoutScale` 传子 FormMain/PanelMain(其再 resolveFormLayout 取整到档集)。
|
|
11
|
+
*/
|
|
12
|
+
export declare function useNestLayoutScale(options: {
|
|
13
|
+
/** 父 item 代表 span(来自 helper 的 resolveLayoutSpan(layout)) */
|
|
14
|
+
parentSpan: MaybeRefOrGetter<number | undefined>;
|
|
15
|
+
/** 是否叠本层 rebase 因子(缺省 true;false = 逆向逃生口) */
|
|
16
|
+
rebase: MaybeRefOrGetter<boolean | undefined>;
|
|
17
|
+
}): ComputedRef<number>;
|