@dt-frames/ui 1.0.9 → 1.0.10
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/es/components/forms/src/types/form.type.d.ts +3 -3
- package/es/components/index.d.ts +3 -2
- package/es/components/source/src/hooks/useSource.d.ts +4 -4
- package/es/components/source/src/types/table.type.d.ts +1 -1
- package/es/components/table/src/components/TableActions.d.ts +2 -2
- package/es/components/table/src/components/setting/Download.d.ts +2 -2
- package/es/components/table/src/components/setting/Size.d.ts +2 -2
- package/es/components/table/src/index.d.ts +2 -2
- package/es/components/tree/index.d.ts +2 -0
- package/es/components/tree/src/hooks/useTree.d.ts +14 -0
- package/es/components/tree/src/props.d.ts +101 -0
- package/es/components/tree/src/type/tree.d.ts +85 -0
- package/es/components/tree/src/utils/tree.d.ts +5 -0
- package/es/components/upload/index.d.ts +3 -0
- package/es/components/upload/src/helper.d.ts +4 -0
- package/es/components/upload/src/index.d.ts +2784 -0
- package/es/components/upload/src/props.d.ts +40 -0
- package/es/components/upload/src/upload.d.ts +1630 -0
- package/es/index.js +1697 -215
- package/es/style/components/table/index.less +2 -2
- package/es/style/components/tree/index.less +41 -0
- package/es/style/components/upload/index.less +43 -0
- package/es/theme/sider/components/basic-menu/basic-menu.d.ts +3 -3
- package/es/theme/tabs/components/TabContent.d.ts +2 -2
- package/package.json +2 -1
- package/src/components/curd/src/hooks/useCurd.tsx +1 -1
- package/src/components/forms/src/components/formItem.vue +15 -2
- package/src/components/forms/src/hooks/useFormEvents.ts +4 -3
- package/src/components/forms/src/hooks/useFormValues.ts +1 -1
- package/src/components/forms/src/types/form.type.ts +3 -3
- package/src/components/index.ts +9 -3
- package/src/components/modal/src/index.vue +1 -1
- package/src/components/source/src/hooks/useFetch.ts +5 -3
- package/src/components/source/src/hooks/useSource.ts +28 -8
- package/src/components/source/src/types/table.type.ts +1 -1
- package/src/components/table/index.less +2 -2
- package/src/components/table/src/hooks/useDataSource.ts +0 -13
- package/src/components/tree/index.less +41 -0
- package/src/components/tree/index.ts +5 -0
- package/src/components/tree/src/components/TreeHeader.vue +97 -0
- package/src/components/tree/src/hooks/useTree.ts +239 -0
- package/src/components/tree/src/index.vue +392 -0
- package/src/components/tree/src/props.ts +133 -0
- package/src/components/tree/src/type/tree.ts +105 -0
- package/src/components/tree/src/utils/tree.ts +73 -0
- package/src/components/upload/index.less +43 -0
- package/src/components/upload/index.ts +7 -0
- package/src/components/upload/src/helper.ts +32 -0
- package/src/components/upload/src/index.vue +38 -0
- package/src/components/upload/src/props.ts +48 -0
- package/src/components/upload/src/upload.vue +166 -0
- package/src/theme/header/helper/menu-tree.ts +2 -2
- package/src/theme/sider/helper/split-menu.ts +2 -2
- package/es/components/dialog/index.d.ts +0 -2
- package/es/components/dialog/src/hooks/useDialog.d.ts +0 -3
- package/src/components/dialog/index.ts +0 -5
- package/src/components/dialog/src/hooks/useDialog.ts +0 -85
|
@@ -67,7 +67,7 @@ export declare type FormProps = {
|
|
|
67
67
|
style?: Recordable;
|
|
68
68
|
};
|
|
69
69
|
export declare type FormSchema = {
|
|
70
|
-
name
|
|
70
|
+
name?: string | string[];
|
|
71
71
|
changeEvent?: string;
|
|
72
72
|
valueField?: string;
|
|
73
73
|
label?: string | VNode;
|
|
@@ -76,7 +76,7 @@ export declare type FormSchema = {
|
|
|
76
76
|
labelAlign?: 'left' | 'right';
|
|
77
77
|
toolTip?: string | ((parms: FormCallBackParams) => string | string[]);
|
|
78
78
|
toolTipProps?: ToolTipProps;
|
|
79
|
-
component
|
|
79
|
+
component?: ComponentType;
|
|
80
80
|
props?: ((opt: {
|
|
81
81
|
schema?: FormSchema;
|
|
82
82
|
formActions?: any;
|
|
@@ -90,7 +90,7 @@ export declare type FormSchema = {
|
|
|
90
90
|
defaultValue?: any;
|
|
91
91
|
span?: number;
|
|
92
92
|
show?: boolean | ((parms: FormCallBackParams) => boolean);
|
|
93
|
-
render?: (parms
|
|
93
|
+
render?: (parms?: FormCallBackParams) => VNode | VNode[] | string;
|
|
94
94
|
renderCol?: (parms: FormCallBackParams) => VNode | VNode[] | string;
|
|
95
95
|
colProps?: Partial<ColEx>;
|
|
96
96
|
renderComponent?: ((parms: FormCallBackParams) => Recordable) | VNode | VNode[] | string;
|
package/es/components/index.d.ts
CHANGED
|
@@ -8,8 +8,9 @@ import { useSource } from './source';
|
|
|
8
8
|
import { useCurd } from './curd';
|
|
9
9
|
import { export2Excel } from './excel';
|
|
10
10
|
import { DtIframe } from './iframe';
|
|
11
|
-
import {
|
|
11
|
+
import { DtUpload, DtUploadModal } from './upload';
|
|
12
|
+
import { DtTree } from './tree';
|
|
12
13
|
export declare function initComponents(): {
|
|
13
14
|
install(app: App): void;
|
|
14
15
|
};
|
|
15
|
-
export { DtBaseRouter, DtIcon, DtPickIcon, DtModal, DtForm, DtTable, FormButtons, DtIframe, useForm, useTable, useSource, useCurd, useModal, useModalOut, export2Excel
|
|
16
|
+
export { DtBaseRouter, DtIcon, DtPickIcon, DtModal, DtForm, DtTable, FormButtons, DtIframe, DtUpload, DtUploadModal, DtTree, useForm, useTable, useSource, useCurd, useModal, useModalOut, export2Excel };
|
|
@@ -4,10 +4,10 @@ import { SourceType } from "../types/source.type";
|
|
|
4
4
|
import { TableParamsType } from '../types/table.type';
|
|
5
5
|
import { DownloadType } from '../../../table/src/types/tableHeader.type';
|
|
6
6
|
export declare function useSource(opt: SourceType): {
|
|
7
|
-
api:
|
|
8
|
-
|
|
7
|
+
api: Recordable<any>;
|
|
8
|
+
apiPath: Recordable<any>;
|
|
9
9
|
form: {
|
|
10
|
-
onSearch: (model
|
|
10
|
+
onSearch: (model?: Recordable) => void;
|
|
11
11
|
onReset: (model: Recordable) => void;
|
|
12
12
|
loading: {
|
|
13
13
|
[key: string]: Ref<boolean>;
|
|
@@ -39,5 +39,5 @@ export declare function useSource(opt: SourceType): {
|
|
|
39
39
|
onUpdate: (model: Recordable) => void;
|
|
40
40
|
onTableChange: (params: TableParamsType, needSearch?: boolean) => void;
|
|
41
41
|
onDownload: (excelData: DownloadType) => void;
|
|
42
|
-
onSearch: (model
|
|
42
|
+
onSearch: (model?: Recordable) => void;
|
|
43
43
|
};
|
|
@@ -387,7 +387,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
387
387
|
'onUpdate:visible': {
|
|
388
388
|
type: PropType<(val: boolean) => void>;
|
|
389
389
|
};
|
|
390
|
-
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "visible" | "overlayStyle" | "disabled" | "
|
|
390
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "visible" | "overlayStyle" | "disabled" | "arrow" | "forceRender" | "minOverlayWidthMatchTrigger" | "destroyPopupOnHide">;
|
|
391
391
|
$attrs: {
|
|
392
392
|
[x: string]: unknown;
|
|
393
393
|
};
|
|
@@ -824,7 +824,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
824
824
|
'onUpdate:openKeys': PropType<(keys: import("ant-design-vue/lib/_util/type").Key[]) => void>;
|
|
825
825
|
'onUpdate:selectedKeys': PropType<(keys: import("ant-design-vue/lib/_util/type").Key[]) => void>;
|
|
826
826
|
'onUpdate:activeKey': PropType<(key: import("ant-design-vue/lib/_util/type").Key) => void>;
|
|
827
|
-
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "disabled" | "mode" | "
|
|
827
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "disabled" | "mode" | "multiple" | "selectable" | "inlineCollapsed" | "disabledOverflow" | "forceSubMenuRender" | "theme" | "inlineIndent" | "subMenuOpenDelay" | "subMenuCloseDelay" | "triggerSubMenuAction">;
|
|
828
828
|
$attrs: {
|
|
829
829
|
[x: string]: unknown;
|
|
830
830
|
};
|
|
@@ -330,7 +330,7 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
|
330
330
|
'onUpdate:visible': {
|
|
331
331
|
type: import("vue").PropType<(val: boolean) => void>;
|
|
332
332
|
};
|
|
333
|
-
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "visible" | "overlayStyle" | "disabled" | "
|
|
333
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "visible" | "overlayStyle" | "disabled" | "arrow" | "forceRender" | "minOverlayWidthMatchTrigger" | "destroyPopupOnHide">;
|
|
334
334
|
$attrs: {
|
|
335
335
|
[x: string]: unknown;
|
|
336
336
|
};
|
|
@@ -767,7 +767,7 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
|
767
767
|
'onUpdate:openKeys': import("vue").PropType<(keys: import("ant-design-vue/lib/_util/type").Key[]) => void>;
|
|
768
768
|
'onUpdate:selectedKeys': import("vue").PropType<(keys: import("ant-design-vue/lib/_util/type").Key[]) => void>;
|
|
769
769
|
'onUpdate:activeKey': import("vue").PropType<(key: import("ant-design-vue/lib/_util/type").Key) => void>;
|
|
770
|
-
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "disabled" | "mode" | "
|
|
770
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "disabled" | "mode" | "multiple" | "selectable" | "inlineCollapsed" | "disabledOverflow" | "forceSubMenuRender" | "theme" | "inlineIndent" | "subMenuOpenDelay" | "subMenuCloseDelay" | "triggerSubMenuAction">;
|
|
771
771
|
$attrs: {
|
|
772
772
|
[x: string]: unknown;
|
|
773
773
|
};
|
|
@@ -331,7 +331,7 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
|
331
331
|
'onUpdate:visible': {
|
|
332
332
|
type: import("vue").PropType<(val: boolean) => void>;
|
|
333
333
|
};
|
|
334
|
-
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "visible" | "overlayStyle" | "disabled" | "
|
|
334
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "visible" | "overlayStyle" | "disabled" | "arrow" | "forceRender" | "minOverlayWidthMatchTrigger" | "destroyPopupOnHide">;
|
|
335
335
|
$attrs: {
|
|
336
336
|
[x: string]: unknown;
|
|
337
337
|
};
|
|
@@ -768,7 +768,7 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
|
768
768
|
'onUpdate:openKeys': import("vue").PropType<(keys: import("ant-design-vue/lib/_util/type").Key[]) => void>;
|
|
769
769
|
'onUpdate:selectedKeys': import("vue").PropType<(keys: import("ant-design-vue/lib/_util/type").Key[]) => void>;
|
|
770
770
|
'onUpdate:activeKey': import("vue").PropType<(key: import("ant-design-vue/lib/_util/type").Key) => void>;
|
|
771
|
-
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "disabled" | "mode" | "
|
|
771
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "disabled" | "mode" | "multiple" | "selectable" | "inlineCollapsed" | "disabledOverflow" | "forceSubMenuRender" | "theme" | "inlineIndent" | "subMenuOpenDelay" | "subMenuCloseDelay" | "triggerSubMenuAction">;
|
|
772
772
|
$attrs: {
|
|
773
773
|
[x: string]: unknown;
|
|
774
774
|
};
|
|
@@ -266,6 +266,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
266
266
|
tableLayout: string;
|
|
267
267
|
size: SizeType;
|
|
268
268
|
bordered: boolean;
|
|
269
|
+
onDownload: Function;
|
|
269
270
|
customRow: (record: any, index: any) => void;
|
|
270
271
|
childrenColumnName: string;
|
|
271
272
|
clickRowSelect: boolean;
|
|
@@ -279,7 +280,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
279
280
|
templates: {};
|
|
280
281
|
ellipsis: boolean;
|
|
281
282
|
onTableChange: Function;
|
|
282
|
-
onDownload: Function;
|
|
283
283
|
showIndexColumn: boolean;
|
|
284
284
|
indexColumnProps: import("./types/table.type").BasicColumn[];
|
|
285
285
|
isTreeTable: boolean;
|
|
@@ -552,6 +552,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
552
552
|
size: SizeType;
|
|
553
553
|
loading: boolean;
|
|
554
554
|
bordered: boolean;
|
|
555
|
+
onDownload: Function;
|
|
555
556
|
columns: import("./types/table.type").BasicColumn[];
|
|
556
557
|
scroll: {};
|
|
557
558
|
rowKey: string;
|
|
@@ -572,7 +573,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
572
573
|
templates: {};
|
|
573
574
|
ellipsis: boolean;
|
|
574
575
|
onTableChange: Function;
|
|
575
|
-
onDownload: Function;
|
|
576
576
|
showIndexColumn: boolean;
|
|
577
577
|
indexColumnProps: import("./types/table.type").BasicColumn[];
|
|
578
578
|
isTreeTable: boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TreeDataItem } from "ant-design-vue/lib/tree";
|
|
2
|
+
import { ComputedRef, Ref } from "vue";
|
|
3
|
+
import { FieldNames, InsertNodeParams, TreeItem, KeyType } from "../type/tree";
|
|
4
|
+
export declare function useTree(treeDataRef: Ref<TreeDataItem[]>, getFieldNames: ComputedRef<FieldNames>): {
|
|
5
|
+
getAllKeys: (list?: TreeDataItem[]) => KeyType[];
|
|
6
|
+
getEnabledKeys: (list?: TreeDataItem[]) => KeyType[];
|
|
7
|
+
getChildrenKeys: (nodeKey: string | number, list?: TreeDataItem[]) => KeyType[];
|
|
8
|
+
updateNodeByKey: (key: string, node: TreeDataItem, list?: TreeDataItem[]) => void;
|
|
9
|
+
filterByLevel: (level?: number, list?: TreeDataItem[], currentLevel?: number) => string[] | number[];
|
|
10
|
+
insertNodeByKey: ({ parentKey, node, push }: InsertNodeParams) => void;
|
|
11
|
+
insertNodesByKey: ({ parentKey, list, push }: InsertNodeParams) => void;
|
|
12
|
+
deleteNodeByKey: (key: string, list?: TreeDataItem[]) => void;
|
|
13
|
+
getSelectedNode: (key: KeyType, list?: TreeItem[], selectedNode?: TreeItem | null) => TreeItem;
|
|
14
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Recordable } from "@dt-frames/core";
|
|
2
|
+
import { PropType } from "vue";
|
|
3
|
+
import { CheckKeys, ContextMenuItem, FieldNames, TreeActionItem, TreeItem } from "./type/tree";
|
|
4
|
+
export declare const BasicProps: {
|
|
5
|
+
loading: {
|
|
6
|
+
type: BooleanConstructor;
|
|
7
|
+
default: boolean;
|
|
8
|
+
};
|
|
9
|
+
checkStrictly: BooleanConstructor;
|
|
10
|
+
expandedKeys: {
|
|
11
|
+
type: PropType<KeyType[]>;
|
|
12
|
+
default: () => any[];
|
|
13
|
+
};
|
|
14
|
+
selectedKeys: {
|
|
15
|
+
type: PropType<KeyType[]>;
|
|
16
|
+
default: () => any[];
|
|
17
|
+
};
|
|
18
|
+
checkedKeys: {
|
|
19
|
+
type: PropType<CheckKeys>;
|
|
20
|
+
default: () => any[];
|
|
21
|
+
};
|
|
22
|
+
fieldNames: {
|
|
23
|
+
type: PropType<FieldNames>;
|
|
24
|
+
};
|
|
25
|
+
beforeRightClick: {
|
|
26
|
+
type: PropType<(...arg: any) => ContextMenuItem[]>;
|
|
27
|
+
default: any;
|
|
28
|
+
};
|
|
29
|
+
rightMenuList: {
|
|
30
|
+
type: PropType<ContextMenuItem[]>;
|
|
31
|
+
};
|
|
32
|
+
renderIcon: {
|
|
33
|
+
type: PropType<(params: Recordable) => string>;
|
|
34
|
+
};
|
|
35
|
+
highlight: {
|
|
36
|
+
type: PropType<String | Boolean>;
|
|
37
|
+
default: boolean;
|
|
38
|
+
};
|
|
39
|
+
actionList: {
|
|
40
|
+
type: PropType<TreeActionItem[]>;
|
|
41
|
+
default: () => any[];
|
|
42
|
+
};
|
|
43
|
+
clickRowToExpand: {
|
|
44
|
+
type: BooleanConstructor;
|
|
45
|
+
default: boolean;
|
|
46
|
+
};
|
|
47
|
+
searchValue: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
default: string;
|
|
50
|
+
};
|
|
51
|
+
filterFn: {
|
|
52
|
+
type: PropType<(searchValue: any, node: TreeItem, fieldNames: FieldNames) => boolean>;
|
|
53
|
+
default: any;
|
|
54
|
+
};
|
|
55
|
+
checkable: BooleanConstructor;
|
|
56
|
+
expandOnSearch: BooleanConstructor;
|
|
57
|
+
checkOnSearch: BooleanConstructor;
|
|
58
|
+
selectedOnSearch: BooleanConstructor;
|
|
59
|
+
treeData: {
|
|
60
|
+
type: PropType<import("ant-design-vue/lib/tree").DataNode[]>;
|
|
61
|
+
};
|
|
62
|
+
value: {
|
|
63
|
+
type: PropType<KeyType[] | CheckKeys>;
|
|
64
|
+
};
|
|
65
|
+
title: {
|
|
66
|
+
type: StringConstructor;
|
|
67
|
+
default: string;
|
|
68
|
+
};
|
|
69
|
+
toolbar: BooleanConstructor;
|
|
70
|
+
search: BooleanConstructor;
|
|
71
|
+
};
|
|
72
|
+
export declare const searchProps: {
|
|
73
|
+
title: {
|
|
74
|
+
type: StringConstructor;
|
|
75
|
+
default: string;
|
|
76
|
+
};
|
|
77
|
+
toolbar: {
|
|
78
|
+
type: BooleanConstructor;
|
|
79
|
+
default: boolean;
|
|
80
|
+
};
|
|
81
|
+
checkable: {
|
|
82
|
+
type: BooleanConstructor;
|
|
83
|
+
default: boolean;
|
|
84
|
+
};
|
|
85
|
+
search: {
|
|
86
|
+
type: BooleanConstructor;
|
|
87
|
+
default: boolean;
|
|
88
|
+
};
|
|
89
|
+
searchText: {
|
|
90
|
+
type: StringConstructor;
|
|
91
|
+
default: string;
|
|
92
|
+
};
|
|
93
|
+
checkAll: {
|
|
94
|
+
type: FunctionConstructor;
|
|
95
|
+
default: any;
|
|
96
|
+
};
|
|
97
|
+
expandAll: {
|
|
98
|
+
type: FunctionConstructor;
|
|
99
|
+
default: any;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Recordable } from "@dt-frames/core";
|
|
2
|
+
import { Fn } from "@vueuse/core";
|
|
3
|
+
import { TreeDataItem } from "ant-design-vue/lib/tree";
|
|
4
|
+
export declare enum ToolbarEnum {
|
|
5
|
+
SELECT_ALL = 0,
|
|
6
|
+
UN_SELECT_ALL = 1,
|
|
7
|
+
EXPAND_ALL = 2,
|
|
8
|
+
UN_EXPAND_ALL = 3,
|
|
9
|
+
CHECK_STRICTLY = 4,
|
|
10
|
+
CHECK_UN_STRICTLY = 5
|
|
11
|
+
}
|
|
12
|
+
export declare type KeyType = string | number;
|
|
13
|
+
export declare type CheckKeys = KeyType[] | {
|
|
14
|
+
checked: string[] | number[];
|
|
15
|
+
halfChecked: string[] | number[];
|
|
16
|
+
};
|
|
17
|
+
export interface TreeState {
|
|
18
|
+
expandedKeys: KeyType[];
|
|
19
|
+
selectedKeys: KeyType[];
|
|
20
|
+
checkedKeys: CheckKeys;
|
|
21
|
+
checkStrictly: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface FieldNames {
|
|
24
|
+
children?: string;
|
|
25
|
+
title?: string;
|
|
26
|
+
key?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface TreeItem extends TreeDataItem {
|
|
29
|
+
icon?: any;
|
|
30
|
+
}
|
|
31
|
+
export interface CreateContextOptions {
|
|
32
|
+
event: MouseEvent;
|
|
33
|
+
icon?: string;
|
|
34
|
+
styles?: any;
|
|
35
|
+
items?: ContextMenuItem[];
|
|
36
|
+
}
|
|
37
|
+
export interface InsertNodeParams {
|
|
38
|
+
parentKey: string | null;
|
|
39
|
+
node: TreeDataItem;
|
|
40
|
+
list?: TreeDataItem[];
|
|
41
|
+
push?: 'push' | 'unshift';
|
|
42
|
+
}
|
|
43
|
+
export interface ContextMenuItem {
|
|
44
|
+
label: string;
|
|
45
|
+
icon?: string;
|
|
46
|
+
hidden?: boolean;
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
handler?: Fn;
|
|
49
|
+
divider?: boolean;
|
|
50
|
+
children?: ContextMenuItem[];
|
|
51
|
+
}
|
|
52
|
+
export interface TreeActionItem {
|
|
53
|
+
render: (record: Recordable) => any;
|
|
54
|
+
show?: boolean | ((record: Recordable) => boolean);
|
|
55
|
+
}
|
|
56
|
+
export interface InsertNodeParams {
|
|
57
|
+
parentKey: string | null;
|
|
58
|
+
node: TreeDataItem;
|
|
59
|
+
list?: TreeDataItem[];
|
|
60
|
+
push?: 'push' | 'unshift';
|
|
61
|
+
}
|
|
62
|
+
export interface TreeHelperConfig {
|
|
63
|
+
id: string;
|
|
64
|
+
children: string;
|
|
65
|
+
pid: string;
|
|
66
|
+
}
|
|
67
|
+
export interface TreeActionType {
|
|
68
|
+
checkAll: (checkAll: boolean) => void;
|
|
69
|
+
expandAll: (expandAll: boolean) => void;
|
|
70
|
+
setExpandedKeys: (keys: KeyType[]) => void;
|
|
71
|
+
getExpandedKeys: () => KeyType[];
|
|
72
|
+
setSelectedKeys: (keys: KeyType[]) => void;
|
|
73
|
+
getSelectedKeys: () => KeyType[];
|
|
74
|
+
setCheckedKeys: (keys: CheckKeys) => void;
|
|
75
|
+
getCheckedKeys: () => CheckKeys;
|
|
76
|
+
filterByLevel: (level: number) => void;
|
|
77
|
+
insertNodeByKey: (opt: InsertNodeParams) => void;
|
|
78
|
+
insertNodesByKey: (opt: InsertNodeParams) => void;
|
|
79
|
+
deleteNodeByKey: (key: string) => void;
|
|
80
|
+
updateNodeByKey: (key: string, node: Omit<TreeDataItem, 'key'>) => void;
|
|
81
|
+
setSearchValue: (value: string) => void;
|
|
82
|
+
getSearchValue: () => string;
|
|
83
|
+
onStrictlyChange: (strictly: boolean) => void;
|
|
84
|
+
getSelectedNode: (key: KeyType, treeList?: TreeItem[], selectNode?: TreeItem | null) => TreeItem | null;
|
|
85
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TreeHelperConfig } from "../type/tree";
|
|
2
|
+
export declare function eachTree(treeDatas: any[], callBack: Function, parentNode?: {}): void;
|
|
3
|
+
export declare function forEach<T = any>(tree: T[], func: (n: T) => any, config?: Partial<TreeHelperConfig>): void;
|
|
4
|
+
export declare function filter<T = any>(tree: T[], func: (n: T) => boolean, config?: Partial<TreeHelperConfig>): T[];
|
|
5
|
+
export declare function treeToList<T = any>(tree: any, config?: Partial<TreeHelperConfig>): T;
|