@dt-frames/ui 1.0.8 → 1.0.11
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/curd/src/components/dialog.d.ts +1 -0
- package/es/components/forms/src/components/formIcon.d.ts +1 -1
- package/es/components/forms/src/types/form.type.d.ts +3 -3
- package/es/components/index.d.ts +3 -2
- package/es/components/modal/src/types/modal.type.d.ts +1 -1
- package/es/components/source/src/hooks/useFetch.d.ts +2 -2
- package/es/components/source/src/hooks/useSource.d.ts +8 -8
- 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/TableHeader.d.ts +2 -2
- package/es/components/table/src/components/editable/CellComponent.d.ts +14 -0
- package/es/components/table/src/components/editable/EditTableCell.d.ts +88 -0
- package/es/components/table/src/components/editable/componentMap.d.ts +4 -0
- package/es/components/table/src/components/editable/index.d.ts +9 -0
- 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 +9 -5
- package/es/components/table/src/props.d.ts +1 -1
- package/es/components/table/src/types/table.type.d.ts +16 -0
- 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 +2788 -0
- package/es/components/upload/src/props.d.ts +40 -0
- package/es/components/upload/src/upload.d.ts +1634 -0
- package/es/index.js +2035 -308
- package/es/style/components/table/index.less +8 -2
- package/es/style/components/tree/index.less +41 -0
- package/es/style/components/upload/index.less +43 -0
- package/es/style/theme/header/index.less +1 -1
- 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/components/dialog.vue +4 -2
- 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/hooks/useModal.ts +5 -3
- package/src/components/modal/src/index.vue +2 -2
- package/src/components/modal/src/types/modal.type.ts +1 -1
- package/src/components/source/src/hooks/useFetch.ts +10 -6
- package/src/components/source/src/hooks/useSource.ts +32 -11
- package/src/components/source/src/types/table.type.ts +1 -1
- package/src/components/table/index.less +8 -2
- package/src/components/table/src/components/TableHeader.vue +2 -2
- package/src/components/table/src/components/TableRender.vue +1 -3
- package/src/components/table/src/components/editable/CellComponent.ts +57 -0
- package/src/components/table/src/components/editable/EditTableCell.vue +181 -0
- package/src/components/table/src/components/editable/componentMap.ts +18 -0
- package/src/components/table/src/components/editable/index.ts +58 -0
- package/src/components/table/src/hooks/useColumns.ts +15 -8
- package/src/components/table/src/hooks/useDataSource.ts +0 -13
- package/src/components/table/src/hooks/useTableHeader.ts +2 -2
- package/src/components/table/src/index.vue +6 -1
- package/src/components/table/src/props.ts +1 -1
- package/src/components/table/src/types/table.type.ts +28 -1
- 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/header/index.less +1 -1
- 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
|
@@ -84,6 +84,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
84
84
|
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any);
|
|
85
85
|
}>>;
|
|
86
86
|
registerDialog: import("../../../modal/src/types/modal.type").RegisterFn;
|
|
87
|
+
closeModal: (rsp?: Recordable<any>) => void;
|
|
87
88
|
registerForm: (formInstance: import("../../../forms").FormActionType) => void;
|
|
88
89
|
getFormValues: () => Recordable<any>;
|
|
89
90
|
setFormValues: (values: Recordable<any>) => Promise<void>;
|
|
@@ -5,7 +5,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
5
5
|
iconRef: any;
|
|
6
6
|
register: import("../../../modal/src/types/modal.type").RegisterFn;
|
|
7
7
|
openModal: <T = any>(props?: boolean, data?: T, openOnSet?: boolean) => void;
|
|
8
|
-
closeModal: (rsp
|
|
8
|
+
closeModal: (rsp?: import("@dt-frames/core").Recordable<any>) => void;
|
|
9
9
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
10
10
|
value: StringConstructor;
|
|
11
11
|
placeholder: StringConstructor;
|
|
@@ -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 };
|
|
@@ -12,7 +12,7 @@ export interface ReturnMethods extends ModalMethods {
|
|
|
12
12
|
}
|
|
13
13
|
export interface ReturnInnerMethods extends ModalMethods {
|
|
14
14
|
openModal: <T = any>(props?: boolean, data?: T, openOnSet?: boolean) => void;
|
|
15
|
-
closeModal: (rsp
|
|
15
|
+
closeModal: (rsp?: Recordable) => void;
|
|
16
16
|
changeLoading: (loading: boolean) => void;
|
|
17
17
|
getVisible?: ComputedRef<boolean>;
|
|
18
18
|
redoModalHeight: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApiType } from "@dt-frames/core";
|
|
2
2
|
export declare function useFetch(api: string | ApiType, baseUrl?: string): {
|
|
3
|
-
fetch: (params
|
|
3
|
+
fetch: (params: any) => Promise<unknown>;
|
|
4
4
|
};
|
|
@@ -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>;
|
|
@@ -25,19 +25,19 @@ export declare function useSource(opt: SourceType): {
|
|
|
25
25
|
loading: Ref<boolean>;
|
|
26
26
|
};
|
|
27
27
|
curd: {
|
|
28
|
-
onAdd: (model: Recordable) => void
|
|
28
|
+
onAdd: (model: Recordable) => Promise<void>;
|
|
29
29
|
onQueryById: (id: string) => Promise<unknown>;
|
|
30
|
-
onUpdate: (model: Recordable) => void
|
|
30
|
+
onUpdate: (model: Recordable) => Promise<void>;
|
|
31
31
|
onDeletes: (ids: any) => void;
|
|
32
32
|
};
|
|
33
33
|
loading: {
|
|
34
34
|
[key: string]: Ref<boolean>;
|
|
35
35
|
};
|
|
36
|
-
onAdd: (model: Recordable) => void
|
|
36
|
+
onAdd: (model: Recordable) => Promise<void>;
|
|
37
37
|
onQueryById: (id: string) => Promise<unknown>;
|
|
38
38
|
onDeletes: (ids: any) => void;
|
|
39
|
-
onUpdate: (model: Recordable) => void
|
|
39
|
+
onUpdate: (model: Recordable) => Promise<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
|
};
|
|
@@ -2,7 +2,7 @@ import { PropType } from "vue";
|
|
|
2
2
|
import type { BtnsType, ColumnChangeParam, TableSetting } from "../types/table.type";
|
|
3
3
|
declare const _default: import("vue").DefineComponent<{
|
|
4
4
|
tableTools: {
|
|
5
|
-
type: PropType<TableSetting>;
|
|
5
|
+
type: PropType<boolean | TableSetting>;
|
|
6
6
|
};
|
|
7
7
|
toolbar: {
|
|
8
8
|
type: PropType<BtnsType[]>;
|
|
@@ -14,7 +14,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
14
14
|
handleMethod: (e: any) => void;
|
|
15
15
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "columns-change"[], "columns-change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
16
|
tableTools: {
|
|
17
|
-
type: PropType<TableSetting>;
|
|
17
|
+
type: PropType<boolean | TableSetting>;
|
|
18
18
|
};
|
|
19
19
|
toolbar: {
|
|
20
20
|
type: PropType<BtnsType[]>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Recordable } from "@dt-frames/core";
|
|
2
|
+
import { FunctionalComponent, Ref } from "vue";
|
|
3
|
+
export declare type EditRecordRow<T = Recordable> = Partial<{
|
|
4
|
+
onEdit: (editable: boolean, submit?: boolean) => Promise<boolean>;
|
|
5
|
+
onValid: () => Promise<boolean>;
|
|
6
|
+
editable: boolean;
|
|
7
|
+
onCancel: Function;
|
|
8
|
+
onSubmit: Function;
|
|
9
|
+
submitCbs: Function[];
|
|
10
|
+
cancelCbs: Function[];
|
|
11
|
+
validCbs: Function[];
|
|
12
|
+
editValueRefs: Recordable<Ref>;
|
|
13
|
+
} & T>;
|
|
14
|
+
export declare const CellComponent: FunctionalComponent;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Recordable } from "@dt-frames/core";
|
|
2
|
+
import { PropType } from "vue";
|
|
3
|
+
import { BasicColumn, LableValOptions } from "../../types/table.type";
|
|
4
|
+
declare const _default: import("vue").DefineComponent<{
|
|
5
|
+
value: {
|
|
6
|
+
type: PropType<string | number | boolean | Recordable<any>>;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
record: {
|
|
10
|
+
type: PropType<Partial<{
|
|
11
|
+
onEdit: (editable: boolean, submit?: boolean) => Promise<boolean>;
|
|
12
|
+
onValid: () => Promise<boolean>;
|
|
13
|
+
editable: boolean;
|
|
14
|
+
onCancel: Function;
|
|
15
|
+
onSubmit: Function;
|
|
16
|
+
submitCbs: Function[];
|
|
17
|
+
cancelCbs: Function[];
|
|
18
|
+
validCbs: Function[];
|
|
19
|
+
editValueRefs: Recordable<import("vue").Ref<any>>;
|
|
20
|
+
} & Recordable<any>>>;
|
|
21
|
+
};
|
|
22
|
+
column: {
|
|
23
|
+
type: PropType<BasicColumn>;
|
|
24
|
+
default: () => BasicColumn;
|
|
25
|
+
};
|
|
26
|
+
index: NumberConstructor;
|
|
27
|
+
}, {
|
|
28
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
29
|
+
value: {
|
|
30
|
+
type: PropType<string | number | boolean | Recordable<any>>;
|
|
31
|
+
default: string;
|
|
32
|
+
};
|
|
33
|
+
record: {
|
|
34
|
+
type: PropType<Partial<{
|
|
35
|
+
onEdit: (editable: boolean, submit?: boolean) => Promise<boolean>;
|
|
36
|
+
onValid: () => Promise<boolean>;
|
|
37
|
+
editable: boolean;
|
|
38
|
+
onCancel: Function;
|
|
39
|
+
onSubmit: Function;
|
|
40
|
+
submitCbs: Function[];
|
|
41
|
+
cancelCbs: Function[];
|
|
42
|
+
validCbs: Function[];
|
|
43
|
+
editValueRefs: Recordable<import("vue").Ref<any>>;
|
|
44
|
+
} & Recordable<any>>>;
|
|
45
|
+
};
|
|
46
|
+
column: {
|
|
47
|
+
type: PropType<BasicColumn>;
|
|
48
|
+
default: () => BasicColumn;
|
|
49
|
+
};
|
|
50
|
+
index: NumberConstructor;
|
|
51
|
+
}>> & {
|
|
52
|
+
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any);
|
|
53
|
+
}>>;
|
|
54
|
+
getComponentProps: import("vue").ComputedRef<any>;
|
|
55
|
+
getRuleVisible: import("vue").ComputedRef<boolean>;
|
|
56
|
+
editRule: boolean | ((text: string, record: Recordable<any>) => Promise<string>);
|
|
57
|
+
ruleMessage: import("vue").Ref<string>;
|
|
58
|
+
getWrapperClass: import("vue").ComputedRef<string>;
|
|
59
|
+
handleChange: (e: any) => Promise<void>;
|
|
60
|
+
handleOptionsChange: (options: LableValOptions) => void;
|
|
61
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
62
|
+
value: {
|
|
63
|
+
type: PropType<string | number | boolean | Recordable<any>>;
|
|
64
|
+
default: string;
|
|
65
|
+
};
|
|
66
|
+
record: {
|
|
67
|
+
type: PropType<Partial<{
|
|
68
|
+
onEdit: (editable: boolean, submit?: boolean) => Promise<boolean>;
|
|
69
|
+
onValid: () => Promise<boolean>;
|
|
70
|
+
editable: boolean;
|
|
71
|
+
onCancel: Function;
|
|
72
|
+
onSubmit: Function;
|
|
73
|
+
submitCbs: Function[];
|
|
74
|
+
cancelCbs: Function[];
|
|
75
|
+
validCbs: Function[];
|
|
76
|
+
editValueRefs: Recordable<import("vue").Ref<any>>;
|
|
77
|
+
} & Recordable<any>>>;
|
|
78
|
+
};
|
|
79
|
+
column: {
|
|
80
|
+
type: PropType<BasicColumn>;
|
|
81
|
+
default: () => BasicColumn;
|
|
82
|
+
};
|
|
83
|
+
index: NumberConstructor;
|
|
84
|
+
}>>, {
|
|
85
|
+
value: string;
|
|
86
|
+
column: BasicColumn;
|
|
87
|
+
}>;
|
|
88
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BasicColumn } from "../../types/table.type";
|
|
2
|
+
declare function renderEditCell(column: BasicColumn): ({ text: value, record, index }: {
|
|
3
|
+
text: any;
|
|
4
|
+
record: any;
|
|
5
|
+
index: any;
|
|
6
|
+
}) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}>;
|
|
9
|
+
export { renderEditCell };
|
|
@@ -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
|
};
|
|
@@ -7,7 +7,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
7
7
|
default: boolean;
|
|
8
8
|
};
|
|
9
9
|
tableSetting: {
|
|
10
|
-
type: import("vue").PropType<import("./types/table.type").TableSetting>;
|
|
10
|
+
type: import("vue").PropType<boolean | import("./types/table.type").TableSetting>;
|
|
11
11
|
default: () => {};
|
|
12
12
|
};
|
|
13
13
|
striped: {
|
|
@@ -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;
|
|
@@ -352,13 +352,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
352
352
|
}>>, filters: Partial<Recordable<string[]>>, sorter: import("./types/table.type").SorterResult) => any;
|
|
353
353
|
getSelectRows: () => Recordable<any>[];
|
|
354
354
|
handleResizeColumn: (w: any, col: any) => void;
|
|
355
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("register" | "columns-change" | "selection-change")[], "register" | "columns-change" | "selection-change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
355
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("register" | "columns-change" | "selection-change" | "row-click" | "row-dbClick" | "expanded-rows-change" | "edit-change")[], "register" | "columns-change" | "selection-change" | "row-click" | "row-dbClick" | "expanded-rows-change" | "edit-change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
356
356
|
clickRowSelect: {
|
|
357
357
|
type: BooleanConstructor;
|
|
358
358
|
default: boolean;
|
|
359
359
|
};
|
|
360
360
|
tableSetting: {
|
|
361
|
-
type: import("vue").PropType<import("./types/table.type").TableSetting>;
|
|
361
|
+
type: import("vue").PropType<boolean | import("./types/table.type").TableSetting>;
|
|
362
362
|
default: () => {};
|
|
363
363
|
};
|
|
364
364
|
striped: {
|
|
@@ -548,10 +548,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
548
548
|
onRegister?: (...args: any[]) => any;
|
|
549
549
|
"onColumns-change"?: (...args: any[]) => any;
|
|
550
550
|
"onSelection-change"?: (...args: any[]) => any;
|
|
551
|
+
"onRow-click"?: (...args: any[]) => any;
|
|
552
|
+
"onRow-dbClick"?: (...args: any[]) => any;
|
|
553
|
+
"onExpanded-rows-change"?: (...args: any[]) => any;
|
|
554
|
+
"onEdit-change"?: (...args: any[]) => any;
|
|
551
555
|
}, {
|
|
552
556
|
size: SizeType;
|
|
553
557
|
loading: boolean;
|
|
554
558
|
bordered: boolean;
|
|
559
|
+
onDownload: Function;
|
|
555
560
|
columns: import("./types/table.type").BasicColumn[];
|
|
556
561
|
scroll: {};
|
|
557
562
|
rowKey: string;
|
|
@@ -572,7 +577,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
572
577
|
templates: {};
|
|
573
578
|
ellipsis: boolean;
|
|
574
579
|
onTableChange: Function;
|
|
575
|
-
onDownload: Function;
|
|
576
580
|
showIndexColumn: boolean;
|
|
577
581
|
indexColumnProps: import("./types/table.type").BasicColumn[];
|
|
578
582
|
isTreeTable: boolean;
|
|
@@ -64,6 +64,12 @@ export declare type ActionType = {
|
|
|
64
64
|
fixed?: 'left' | 'right' | 'auto';
|
|
65
65
|
btns?: BtnsType[];
|
|
66
66
|
};
|
|
67
|
+
export declare type ComponentType = 'Input' | 'InputNumber' | 'Select' | 'TreeSelect' | 'Checkbox' | 'Switch' | 'DatePicker' | 'TimePicker';
|
|
68
|
+
export declare type LableValOptions = {
|
|
69
|
+
label: string;
|
|
70
|
+
value: any;
|
|
71
|
+
[key: string]: string | number | boolean;
|
|
72
|
+
}[];
|
|
67
73
|
export interface BasicColumn extends ColumnProps {
|
|
68
74
|
children?: BasicColumn[];
|
|
69
75
|
defaultHidden?: boolean;
|
|
@@ -72,6 +78,15 @@ export interface BasicColumn extends ColumnProps {
|
|
|
72
78
|
render?: CellFormat;
|
|
73
79
|
edit?: boolean;
|
|
74
80
|
editRow?: boolean;
|
|
81
|
+
editable?: boolean;
|
|
82
|
+
editComponent?: ComponentType;
|
|
83
|
+
editComponentProps?: ((opt: {
|
|
84
|
+
text: string | number | boolean | Recordable;
|
|
85
|
+
record: Recordable;
|
|
86
|
+
column: BasicColumn;
|
|
87
|
+
index: number;
|
|
88
|
+
}) => Recordable) | Recordable;
|
|
89
|
+
editRule?: boolean | ((text: string, record: Recordable) => Promise<string>);
|
|
75
90
|
showIndexColumn?: boolean;
|
|
76
91
|
expand?: boolean;
|
|
77
92
|
}
|
|
@@ -86,4 +101,5 @@ export declare type TableActionType = {
|
|
|
86
101
|
setCacheColumnsByField?: (dataIndex: string | undefined, value: BasicColumn) => void;
|
|
87
102
|
getSelectRows: () => void;
|
|
88
103
|
getSelectRowKeys: () => void;
|
|
104
|
+
emit?: any;
|
|
89
105
|
};
|
|
@@ -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;
|