@dt-frames/ui 1.0.10 → 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.
Files changed (37) hide show
  1. package/es/components/curd/src/components/dialog.d.ts +1 -0
  2. package/es/components/forms/src/components/formIcon.d.ts +1 -1
  3. package/es/components/modal/src/types/modal.type.d.ts +1 -1
  4. package/es/components/source/src/hooks/useFetch.d.ts +2 -2
  5. package/es/components/source/src/hooks/useSource.d.ts +4 -4
  6. package/es/components/table/src/components/TableHeader.d.ts +2 -2
  7. package/es/components/table/src/components/editable/CellComponent.d.ts +14 -0
  8. package/es/components/table/src/components/editable/EditTableCell.d.ts +88 -0
  9. package/es/components/table/src/components/editable/componentMap.d.ts +4 -0
  10. package/es/components/table/src/components/editable/index.d.ts +9 -0
  11. package/es/components/table/src/index.d.ts +7 -3
  12. package/es/components/table/src/props.d.ts +1 -1
  13. package/es/components/table/src/types/table.type.d.ts +16 -0
  14. package/es/components/upload/src/index.d.ts +7 -3
  15. package/es/components/upload/src/upload.d.ts +7 -3
  16. package/es/index.js +318 -73
  17. package/es/style/components/table/index.less +6 -0
  18. package/es/style/theme/header/index.less +1 -1
  19. package/package.json +1 -1
  20. package/src/components/curd/src/components/dialog.vue +4 -2
  21. package/src/components/modal/src/hooks/useModal.ts +5 -3
  22. package/src/components/modal/src/index.vue +1 -1
  23. package/src/components/modal/src/types/modal.type.ts +1 -1
  24. package/src/components/source/src/hooks/useFetch.ts +6 -4
  25. package/src/components/source/src/hooks/useSource.ts +4 -3
  26. package/src/components/table/index.less +6 -0
  27. package/src/components/table/src/components/TableHeader.vue +2 -2
  28. package/src/components/table/src/components/editable/CellComponent.ts +57 -0
  29. package/src/components/table/src/components/editable/EditTableCell.vue +181 -0
  30. package/src/components/table/src/components/editable/componentMap.ts +18 -0
  31. package/src/components/table/src/components/editable/index.ts +58 -0
  32. package/src/components/table/src/hooks/useColumns.ts +15 -8
  33. package/src/components/table/src/hooks/useTableHeader.ts +2 -2
  34. package/src/components/table/src/index.vue +6 -1
  35. package/src/components/table/src/props.ts +1 -1
  36. package/src/components/table/src/types/table.type.ts +28 -1
  37. package/src/theme/header/index.less +1 -1
@@ -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: import("@dt-frames/core").Recordable<any>) => void;
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;
@@ -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: Recordable) => void;
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 { Recordable, ApiType } from "@dt-frames/core";
1
+ import { ApiType } from "@dt-frames/core";
2
2
  export declare function useFetch(api: string | ApiType, baseUrl?: string): {
3
- fetch: (params?: Recordable) => Promise<unknown>;
3
+ fetch: (params: any) => Promise<unknown>;
4
4
  };
@@ -25,18 +25,18 @@ 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
42
  onSearch: (model?: Recordable) => void;
@@ -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,4 @@
1
+ import { Component } from 'vue';
2
+ import { ComponentType } from '../../types/table.type';
3
+ declare const componentMap: Map<ComponentType, Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>>;
4
+ export { componentMap };
@@ -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 };
@@ -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: {
@@ -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,6 +548,10 @@ 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;
@@ -10,7 +10,7 @@ export declare const TableProps: {
10
10
  default: boolean;
11
11
  };
12
12
  tableSetting: {
13
- type: PropType<TableSetting>;
13
+ type: PropType<boolean | TableSetting>;
14
14
  default: () => {};
15
15
  };
16
16
  striped: {
@@ -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
  };
@@ -2165,7 +2165,7 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
2165
2165
  default: boolean;
2166
2166
  };
2167
2167
  tableSetting: {
2168
- type: import("vue").PropType<import("../../table/src/types/table.type").TableSetting>;
2168
+ type: import("vue").PropType<boolean | import("../../table/src/types/table.type").TableSetting>;
2169
2169
  default: () => {};
2170
2170
  };
2171
2171
  striped: {
@@ -2510,13 +2510,13 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
2510
2510
  }>>, filters: Partial<import("@dt-frames/core").Recordable<string[]>>, sorter: import("../../table/src/types/table.type").SorterResult) => any;
2511
2511
  getSelectRows: () => import("@dt-frames/core").Recordable<any>[];
2512
2512
  handleResizeColumn: (w: any, col: any) => void;
2513
- }, 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<import("vue").ExtractPropTypes<{
2513
+ }, 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<import("vue").ExtractPropTypes<{
2514
2514
  clickRowSelect: {
2515
2515
  type: BooleanConstructor;
2516
2516
  default: boolean;
2517
2517
  };
2518
2518
  tableSetting: {
2519
- type: import("vue").PropType<import("../../table/src/types/table.type").TableSetting>;
2519
+ type: import("vue").PropType<boolean | import("../../table/src/types/table.type").TableSetting>;
2520
2520
  default: () => {};
2521
2521
  };
2522
2522
  striped: {
@@ -2706,6 +2706,10 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
2706
2706
  onRegister?: (...args: any[]) => any;
2707
2707
  "onColumns-change"?: (...args: any[]) => any;
2708
2708
  "onSelection-change"?: (...args: any[]) => any;
2709
+ "onRow-click"?: (...args: any[]) => any;
2710
+ "onRow-dbClick"?: (...args: any[]) => any;
2711
+ "onExpanded-rows-change"?: (...args: any[]) => any;
2712
+ "onEdit-change"?: (...args: any[]) => any;
2709
2713
  }, {
2710
2714
  size: import("../../table/src/types/table.type").SizeType;
2711
2715
  loading: boolean;
@@ -1014,7 +1014,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
1014
1014
  default: boolean;
1015
1015
  };
1016
1016
  tableSetting: {
1017
- type: import("vue").PropType<import("../../table/src/types/table.type").TableSetting>;
1017
+ type: import("vue").PropType<boolean | import("../../table/src/types/table.type").TableSetting>;
1018
1018
  default: () => {};
1019
1019
  };
1020
1020
  striped: {
@@ -1359,13 +1359,13 @@ declare const _sfc_main: import("vue").DefineComponent<{
1359
1359
  }>>, filters: Partial<import("@dt-frames/core").Recordable<string[]>>, sorter: import("../../table/src/types/table.type").SorterResult) => any;
1360
1360
  getSelectRows: () => import("@dt-frames/core").Recordable<any>[];
1361
1361
  handleResizeColumn: (w: any, col: any) => void;
1362
- }, 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<import("vue").ExtractPropTypes<{
1362
+ }, 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<import("vue").ExtractPropTypes<{
1363
1363
  clickRowSelect: {
1364
1364
  type: BooleanConstructor;
1365
1365
  default: boolean;
1366
1366
  };
1367
1367
  tableSetting: {
1368
- type: import("vue").PropType<import("../../table/src/types/table.type").TableSetting>;
1368
+ type: import("vue").PropType<boolean | import("../../table/src/types/table.type").TableSetting>;
1369
1369
  default: () => {};
1370
1370
  };
1371
1371
  striped: {
@@ -1555,6 +1555,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
1555
1555
  onRegister?: (...args: any[]) => any;
1556
1556
  "onColumns-change"?: (...args: any[]) => any;
1557
1557
  "onSelection-change"?: (...args: any[]) => any;
1558
+ "onRow-click"?: (...args: any[]) => any;
1559
+ "onRow-dbClick"?: (...args: any[]) => any;
1560
+ "onExpanded-rows-change"?: (...args: any[]) => any;
1561
+ "onEdit-change"?: (...args: any[]) => any;
1558
1562
  }, {
1559
1563
  size: import("../../table/src/types/table.type").SizeType;
1560
1564
  loading: boolean;