es-grid-template 1.8.67 → 1.8.69

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 (167) hide show
  1. package/es/grid-component/hooks/useLazyKVMap.d.ts +1 -1
  2. package/es/grid-component/hooks/utils.d.ts +1 -1
  3. package/es/grid-component/index.d.ts +1 -1
  4. package/es/grid-component/type.d.ts +570 -0
  5. package/es/grid-component/type.js +1 -490
  6. package/es/table-component/ColumnsChoose.d.ts +1 -1
  7. package/es/table-component/ColumnsChoose.js +0 -2
  8. package/es/table-component/ContextMenu.d.ts +1 -2
  9. package/es/table-component/ContextMenu.js +0 -1
  10. package/es/table-component/InternalTable.d.ts +1 -2
  11. package/es/table-component/InternalTable.js +1 -32
  12. package/es/table-component/TableContainer.d.ts +1 -1
  13. package/es/table-component/TableContainer.js +4 -2
  14. package/es/table-component/TableContainerEdit.d.ts +1 -1
  15. package/es/table-component/TableContainerEdit.js +4 -2
  16. package/es/table-component/body/EditableCell.d.ts +1 -1
  17. package/es/table-component/body/EditableCell.js +1 -18
  18. package/es/table-component/body/TableBody.d.ts +1 -1
  19. package/es/table-component/body/TableBodyCell.d.ts +1 -1
  20. package/es/table-component/body/TableBodyCellEdit.d.ts +1 -1
  21. package/es/table-component/body/TableBodyRow.d.ts +1 -1
  22. package/es/table-component/components/ControlCheckbox.d.ts +1 -1
  23. package/es/table-component/components/EditForm/EditForm.js +0 -1
  24. package/es/table-component/components/InputControl/InputControl.js +0 -3
  25. package/es/table-component/components/async-select/index.d.ts +1 -1
  26. package/es/table-component/components/async-select/index.js +0 -3
  27. package/es/table-component/components/async-table-select/index.d.ts +1 -1
  28. package/es/table-component/components/async-table-select/index.js +0 -4
  29. package/es/table-component/components/checkbox-filter/CheckboxFilter.js +6 -2
  30. package/es/table-component/components/checkbox-filter/FilterSearch.d.ts +1 -1
  31. package/es/table-component/components/checkbox-filter/FilterSearch.js +1 -1
  32. package/es/table-component/components/command/Command.d.ts +1 -1
  33. package/es/table-component/components/number/index.d.ts +3 -2
  34. package/es/table-component/components/number/index.js +0 -8
  35. package/es/table-component/components/number-range/index.d.ts +3 -2
  36. package/es/table-component/components/number-range/index.js +0 -3
  37. package/es/table-component/footer/TableFooterRow.js +1 -22
  38. package/es/table-component/header/TableHead.js +0 -20
  39. package/es/table-component/header/TableHeadCell.js +0 -5
  40. package/es/table-component/header/TableHeadCell2.js +4 -2
  41. package/es/table-component/header/TableHeadGroupCell.js +0 -23
  42. package/es/table-component/header/renderFilter.d.ts +1 -1
  43. package/es/table-component/hook/useColumns.d.ts +1 -1
  44. package/es/table-component/hook/useFilterOperator.d.ts +2 -2
  45. package/es/table-component/hook/utils.d.ts +1 -1
  46. package/es/table-component/hook/utils.js +0 -3
  47. package/es/table-component/index.d.ts +1 -1
  48. package/es/table-component/index.js +0 -3
  49. package/es/table-component/table/Grid.d.ts +1 -1
  50. package/es/table-component/table/Grid.js +3 -7
  51. package/es/table-component/table/TableWrapper.d.ts +1 -1
  52. package/es/table-component/useContext.d.ts +2 -1
  53. package/es/table-virtuoso/InternalTable.d.ts +1 -1
  54. package/es/table-virtuoso/InternalTable.js +2 -1
  55. package/es/table-virtuoso/body/TableBodyCell.d.ts +1 -1
  56. package/es/table-virtuoso/body/TableBodyCell.js +1 -1
  57. package/es/table-virtuoso/body/TableBodyRow.d.ts +2 -2
  58. package/es/table-virtuoso/body/TableBodyRow.js +3 -1
  59. package/es/table-virtuoso/header/TableHeadCell.js +1 -3
  60. package/es/table-virtuoso/header/renderFilter.d.ts +1 -1
  61. package/es/table-virtuoso/header/renderFilter.js +0 -4
  62. package/es/table-virtuoso/hook/utils.d.ts +1 -1
  63. package/es/table-virtuoso/style.js +1 -1
  64. package/es/table-virtuoso/table/Grid.d.ts +1 -1
  65. package/es/table-virtuoso/table/Grid.js +2 -25
  66. package/es/table-virtuoso/table/TableContainer.d.ts +1 -1
  67. package/es/table-virtuoso/table/TableContainer.js +0 -2
  68. package/es/table-virtuoso/table/TableWrapper.d.ts +1 -1
  69. package/es/table-virtuoso/table/TableWrapper.js +3 -19
  70. package/es/table-virtuoso/useContext.d.ts +1 -1
  71. package/lib/grid-component/hooks/useLazyKVMap.d.ts +1 -1
  72. package/lib/grid-component/hooks/utils.d.ts +1 -1
  73. package/lib/grid-component/index.d.ts +1 -1
  74. package/lib/grid-component/type.d.ts +570 -0
  75. package/lib/grid-component/type.js +4 -490
  76. package/lib/table-component/ColumnsChoose.d.ts +1 -1
  77. package/lib/table-component/ColumnsChoose.js +0 -2
  78. package/lib/table-component/ContextMenu.d.ts +1 -2
  79. package/lib/table-component/ContextMenu.js +0 -2
  80. package/lib/table-component/InternalTable.d.ts +1 -2
  81. package/lib/table-component/InternalTable.js +1 -28
  82. package/lib/table-component/TableContainer.d.ts +1 -1
  83. package/lib/table-component/TableContainer.js +4 -2
  84. package/lib/table-component/TableContainerEdit.d.ts +1 -1
  85. package/lib/table-component/TableContainerEdit.js +4 -2
  86. package/lib/table-component/body/EditableCell.d.ts +1 -1
  87. package/lib/table-component/body/EditableCell.js +0 -10
  88. package/lib/table-component/body/TableBody.d.ts +1 -1
  89. package/lib/table-component/body/TableBodyCell.d.ts +1 -1
  90. package/lib/table-component/body/TableBodyCellEdit.d.ts +1 -1
  91. package/lib/table-component/body/TableBodyRow.d.ts +1 -1
  92. package/lib/table-component/components/ControlCheckbox.d.ts +1 -1
  93. package/lib/table-component/components/EditForm/EditForm.js +0 -2
  94. package/lib/table-component/components/InputControl/InputControl.js +0 -4
  95. package/lib/table-component/components/async-select/index.d.ts +1 -1
  96. package/lib/table-component/components/async-select/index.js +0 -2
  97. package/lib/table-component/components/async-table-select/index.d.ts +1 -1
  98. package/lib/table-component/components/async-table-select/index.js +0 -4
  99. package/lib/table-component/components/checkbox-filter/CheckboxFilter.js +6 -2
  100. package/lib/table-component/components/checkbox-filter/FilterSearch.d.ts +1 -1
  101. package/lib/table-component/components/checkbox-filter/FilterSearch.js +1 -1
  102. package/lib/table-component/components/command/Command.d.ts +1 -1
  103. package/lib/table-component/components/number/index.d.ts +3 -2
  104. package/lib/table-component/components/number/index.js +0 -8
  105. package/lib/table-component/components/number-range/index.d.ts +3 -2
  106. package/lib/table-component/components/number-range/index.js +0 -3
  107. package/lib/table-component/footer/TableFooterRow.js +1 -23
  108. package/lib/table-component/header/TableHead.js +0 -21
  109. package/lib/table-component/header/TableHeadCell.js +0 -5
  110. package/lib/table-component/header/TableHeadCell2.js +4 -2
  111. package/lib/table-component/header/TableHeadGroupCell.js +0 -23
  112. package/lib/table-component/header/renderFilter.d.ts +1 -1
  113. package/lib/table-component/hook/useColumns.d.ts +1 -1
  114. package/lib/table-component/hook/useFilterOperator.d.ts +2 -2
  115. package/lib/table-component/hook/utils.d.ts +1 -1
  116. package/lib/table-component/hook/utils.js +0 -4
  117. package/lib/table-component/index.d.ts +1 -1
  118. package/lib/table-component/index.js +0 -1
  119. package/lib/table-component/table/Grid.d.ts +1 -1
  120. package/lib/table-component/table/Grid.js +3 -6
  121. package/lib/table-component/table/TableWrapper.d.ts +1 -1
  122. package/lib/table-component/useContext.d.ts +2 -1
  123. package/lib/table-virtuoso/InternalTable.d.ts +1 -1
  124. package/lib/table-virtuoso/InternalTable.js +3 -1
  125. package/lib/table-virtuoso/body/TableBodyCell.d.ts +1 -1
  126. package/lib/table-virtuoso/body/TableBodyCell.js +1 -1
  127. package/lib/table-virtuoso/body/TableBodyRow.d.ts +2 -2
  128. package/lib/table-virtuoso/body/TableBodyRow.js +3 -1
  129. package/lib/table-virtuoso/header/TableHeadCell.js +4 -6
  130. package/lib/table-virtuoso/header/renderFilter.d.ts +1 -1
  131. package/lib/table-virtuoso/header/renderFilter.js +0 -4
  132. package/lib/table-virtuoso/hook/utils.d.ts +1 -1
  133. package/lib/table-virtuoso/style.js +1 -1
  134. package/lib/table-virtuoso/table/Grid.d.ts +1 -1
  135. package/lib/table-virtuoso/table/Grid.js +2 -25
  136. package/lib/table-virtuoso/table/TableContainer.d.ts +1 -1
  137. package/lib/table-virtuoso/table/TableContainer.js +0 -2
  138. package/lib/table-virtuoso/table/TableWrapper.d.ts +1 -1
  139. package/lib/table-virtuoso/table/TableWrapper.js +3 -19
  140. package/lib/table-virtuoso/useContext.d.ts +1 -1
  141. package/package.json +1 -1
  142. package/es/table-component/type.d.ts +0 -567
  143. package/es/table-component/type.js +0 -1
  144. package/es/table-virtuoso/hook/constant.d.ts +0 -73
  145. package/es/table-virtuoso/hook/constant.js +0 -240
  146. package/es/table-virtuoso/hook/convert.d.ts +0 -1
  147. package/es/table-virtuoso/hook/convert.js +0 -28
  148. package/es/table-virtuoso/hook/useColumns.d.ts +0 -28
  149. package/es/table-virtuoso/hook/useColumns.js +0 -302
  150. package/es/table-virtuoso/hook/useFilterOperator.d.ts +0 -7
  151. package/es/table-virtuoso/hook/useFilterOperator.js +0 -33
  152. package/es/table-virtuoso/style.scss +0 -1441
  153. package/es/table-virtuoso/type.d.ts +0 -0
  154. package/es/table-virtuoso/type.js +0 -785
  155. package/lib/table-component/type.d.ts +0 -567
  156. package/lib/table-component/type.js +0 -5
  157. package/lib/table-virtuoso/hook/constant.d.ts +0 -73
  158. package/lib/table-virtuoso/hook/constant.js +0 -247
  159. package/lib/table-virtuoso/hook/convert.d.ts +0 -1
  160. package/lib/table-virtuoso/hook/convert.js +0 -34
  161. package/lib/table-virtuoso/hook/useColumns.d.ts +0 -28
  162. package/lib/table-virtuoso/hook/useColumns.js +0 -315
  163. package/lib/table-virtuoso/hook/useFilterOperator.d.ts +0 -7
  164. package/lib/table-virtuoso/hook/useFilterOperator.js +0 -40
  165. package/lib/table-virtuoso/style.scss +0 -1441
  166. package/lib/table-virtuoso/type.d.ts +0 -0
  167. package/lib/table-virtuoso/type.js +0 -786
@@ -1,4 +1,4 @@
1
1
  import type { Key } from "react";
2
- import type { AnyObject, GetRowKey } from '../../table-component/type';
2
+ import type { AnyObject, GetRowKey } from '../type';
3
3
  declare const useLazyKVMap: <RecordType extends AnyObject = AnyObject>(data: readonly RecordType[], childrenColumnName: string, getRowKey: GetRowKey<RecordType>) => readonly [(key: Key) => RecordType];
4
4
  export default useLazyKVMap;
@@ -3,7 +3,7 @@ import dayjs from "dayjs";
3
3
  import type { EditType, IColumnType, TypeFilter } from "rc-master-ui";
4
4
  import type { Key } from "react";
5
5
  import type { ColumnsTable } from "./../index";
6
- import type { AnyObject, ColumnTable, GetRowKey, IFormat } from "../../table-component/type";
6
+ import type { AnyObject, ColumnTable, GetRowKey, IFormat } from "../type";
7
7
  export declare const newGuid: () => any;
8
8
  export declare const sumDataByField: (data: any[], field: string) => any;
9
9
  export declare const checkThousandSeparator: (thousandSeparator: string | undefined, decimalSeparator: string | undefined) => string;
@@ -1,5 +1,5 @@
1
1
  import TempTable from './TempTable';
2
- import type { ColumnsTable, TableProps, ColumnTable, CommandItem, ContextMenuItem } from '../table-component/type';
2
+ import type { ColumnsTable, TableProps, ColumnTable, CommandItem, ContextMenuItem } from './type';
3
3
  import type { ToolbarItem } from "rc-master-ui/es/toolbar";
4
4
  export type { ColumnsTable, TableProps, ColumnTable, ToolbarItem, CommandItem, ContextMenuItem };
5
5
  export default TempTable;
@@ -0,0 +1,570 @@
1
+ import type { CheckboxProps, TablePaginationConfig } from 'rc-master-ui';
2
+ import type { ItemType } from 'rc-master-ui/es/menu/interface';
3
+ import type { Cell, Header, OnChangeFn, Row } from '@tanstack/react-table';
4
+ import type { ReactElement, ReactNode } from 'react';
5
+ import type { ColorPickerProps } from 'antd';
6
+ import type { TableLocale } from "rc-master-ui/lib/table/interface";
7
+ import type { IOperator } from '../grid-component/hooks';
8
+ declare module "@tanstack/table-core" {
9
+ interface ColumnMeta<any, any> extends ColumnTable {
10
+ rowSpan?: number;
11
+ }
12
+ }
13
+ export type ExtendedColumnFilter = {
14
+ id: string;
15
+ value: string;
16
+ operator?: FilterOperator;
17
+ };
18
+ export type OpetorState = ColumnOperator[];
19
+ export interface OpetorTableState {
20
+ operator: OpetorState;
21
+ }
22
+ export interface ColumnOperator {
23
+ id: string;
24
+ operator: string;
25
+ }
26
+ export interface DensityOptions {
27
+ enableOperator?: boolean;
28
+ onOperatorChange?: OnChangeFn<OpetorState>;
29
+ }
30
+ export type Key = React.Key;
31
+ export type PaginationConfig = TablePaginationConfig & {
32
+ currentPage?: number;
33
+ };
34
+ export type AnyObject = Record<PropertyKey, any>;
35
+ export type IFormat = {
36
+ thousandSeparator?: string;
37
+ decimalSeparator?: string;
38
+ decimalScale?: number | undefined;
39
+ allowNegative?: boolean;
40
+ prefix?: string | undefined;
41
+ suffix?: string | undefined;
42
+ fixedDecimalScale?: boolean;
43
+ dateFormat?: string;
44
+ datetimeFormat?: string;
45
+ timeFormat?: string;
46
+ weekFormat?: string;
47
+ monthFormat?: string;
48
+ yearFormat?: string;
49
+ };
50
+ export type RowSelectMethod = 'all' | 'none' | 'invert' | 'single' | 'multiple';
51
+ export type EditType = 'text' | 'numeric' | 'asyncSelect' | 'date' | 'datetime' | 'time' | 'week' | 'month' | 'quarter' | 'year' | 'select' | 'checkbox' | 'currency' | 'image' | 'selectTable' | 'customSelect' | 'form' | 'color' | 'treeSelect' | 'file';
52
+ export type ITextAlign = 'center' | 'left' | 'right';
53
+ export type TypeFilter = 'Text' | 'Date' | 'Time' | 'Datetime' | 'DateRange' | 'Month' | 'Quarter' | 'Year' | 'Week' | 'Number' | 'NumberRange' | 'Dropdown' | 'DropTree' | 'Checkbox' | 'CheckboxTree' | 'CheckboxDropdown';
54
+ export type IColumnType = 'number' | 'time' | 'date' | 'week' | 'month' | 'file' | 'quarter' | 'year' | 'datetime' | 'string' | 'boolean' | 'checkbox' | 'color' | null | undefined;
55
+ export type FilterOperator = 'equal' | 'notEqual' | 'greaterThan' | 'greaterThanOrEqual' | 'lessThan' | 'lessThanOrEqual' | 'startsWith' | 'endsWith' | 'contains';
56
+ export type FixedType = 'left' | 'right' | boolean;
57
+ export type SelectMode = 'checkbox' | 'radio' | undefined;
58
+ type IGrid = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24;
59
+ export interface FieldNames {
60
+ value?: string;
61
+ label?: string;
62
+ groupLabel?: string;
63
+ options?: string;
64
+ }
65
+ export interface CommandItem {
66
+ id: string;
67
+ type?: string;
68
+ visible?: boolean | ((record: any) => boolean);
69
+ title: string;
70
+ color?: 'blue' | 'purple' | 'cyan' | 'green' | 'magenta' | 'pink' | 'red' | 'orange' | 'yellow' | 'volcano' | 'geekblue' | 'lime' | 'gold';
71
+ tooltip?: string;
72
+ icon?: ReactNode | ReactElement | (() => ReactNode | ReactElement);
73
+ template?: ReactNode | ReactElement | ((record: any) => ReactNode | ReactElement);
74
+ client?: boolean;
75
+ confirmDialog?: boolean;
76
+ }
77
+ export type ColumnTemplate<RecordType> = {
78
+ value: any;
79
+ rowData: RecordType;
80
+ index: number;
81
+ field: string;
82
+ };
83
+ export type GetRowKey<RecordType> = (record: RecordType, index?: number) => Key;
84
+ export type ColumnTable<RecordType = AnyObject> = {
85
+ field: string;
86
+ width?: number;
87
+ maxWidth?: number;
88
+ minWidth?: number;
89
+ type?: IColumnType;
90
+ haveSum?: boolean;
91
+ isSummary?: boolean;
92
+ summaryTemplate?: (data: number, key: string) => ReactElement | ReactNode;
93
+ format?: IFormat | ((rowData: any) => IFormat);
94
+ allowFiltering?: boolean;
95
+ /**
96
+ * @deprecated Please use `allowSortering` instead.
97
+ * @since 1.7.25
98
+ */
99
+ sorter?: boolean;
100
+ allowSortering?: boolean;
101
+ operator?: FilterOperator;
102
+ showOperator?: boolean;
103
+ placeholder?: string;
104
+ showInColumnChoose?: boolean;
105
+ typeFilter?: TypeFilter;
106
+ source?: any[];
107
+ showFilterSearch?: boolean;
108
+ headerText?: string;
109
+ /**
110
+ * @deprecated Please use `visible` instead.
111
+ * @since 1.7.33
112
+ */
113
+ hidden?: boolean;
114
+ visible?: boolean;
115
+ headerTooltip?: boolean | string | (() => ReactNode | ReactElement);
116
+ columnGroupText?: string;
117
+ /**
118
+ * @deprecated Please use `textAlign` instead.
119
+ * @since 1.7.34
120
+ */
121
+ align?: ITextAlign;
122
+ textAlign?: ITextAlign;
123
+ headerTextAlign?: ITextAlign;
124
+ template?: ReactNode | ReactElement | ((args: ColumnTemplate<RecordType>) => ReactNode | ReactElement);
125
+ showTooltip?: boolean;
126
+ tooltipDescription?: string | ((args: {
127
+ value: any;
128
+ record: RecordType;
129
+ }) => ReactNode | ReactElement);
130
+ headerTemplate?: React.ReactNode | React.ReactElement | ((column: ColumnTable<RecordType>) => React.ReactNode | React.ReactElement);
131
+ commandItems?: CommandItem[];
132
+ children?: ColumnTable<RecordType>[];
133
+ editType?: EditType | ((rowData?: RecordType) => EditType);
134
+ disable?: boolean | ((rowData: any) => boolean);
135
+ editEnable?: boolean | ((rowData: any) => boolean);
136
+ isClearable?: boolean;
137
+ maxDate?: any;
138
+ minDate?: any;
139
+ maxTime?: any;
140
+ minTime?: any;
141
+ max?: number;
142
+ min?: number;
143
+ editSelectSettings?: IEditSelectSettings;
144
+ editFromSettings?: IEditFromSettings;
145
+ /**
146
+ * @deprecated Please use `fixed` instead.
147
+ * @since 1.7.25
148
+ */
149
+ fixedType?: FixedType;
150
+ fixed?: FixedType;
151
+ /**
152
+ * @deprecated Please use `wrapSettings` instead.
153
+ * @since 1.7.34
154
+ */
155
+ headerTextWrap?: boolean;
156
+ ellipsis?: boolean;
157
+ allowResizing?: boolean;
158
+ allowSelection?: boolean | ((rowData: RecordType) => boolean);
159
+ onCellStyles?: Omit<React.CSSProperties, 'display' | 'width' | 'minWidth' | 'left' | 'right' | 'position'> | ((cellValue: any, cell: Cell<RecordType, unknown>) => Omit<React.CSSProperties, 'display' | 'width' | 'minWidth' | 'left' | 'right' | 'position'>);
160
+ onCellHeaderStyles?: Omit<React.CSSProperties, 'display' | 'width' | 'minWidth' | 'left' | 'right' | 'position'> | ((cell: Header<RecordType, unknown>) => Omit<React.CSSProperties, 'display' | 'width' | 'minWidth' | 'left' | 'right' | 'position'>);
161
+ onCellFooterStyles?: Omit<React.CSSProperties, 'display' | 'width' | 'minWidth' | 'left' | 'right' | 'position'> | ((cellValue: any, cell: Header<RecordType, unknown>) => Omit<React.CSSProperties, 'display' | 'width' | 'minWidth' | 'left' | 'right' | 'position'>);
162
+ sumGroup?: boolean;
163
+ };
164
+ export type Locale = TableLocale & {
165
+ ok_btn?: string;
166
+ cancel_btn?: string;
167
+ add_rows?: string;
168
+ add_rows_before?: string;
169
+ add_rows_after?: string;
170
+ add_1?: string;
171
+ add_10?: string;
172
+ add_50?: string;
173
+ add_100?: string;
174
+ add_children?: string;
175
+ delete_content?: string;
176
+ delete_rows?: string;
177
+ custom?: string;
178
+ filterTitle: string;
179
+ filterConfirm: string;
180
+ filterEmptyText: string;
181
+ filterCheckall: string;
182
+ filterSearchPlaceholder: string;
183
+ emptyText: string;
184
+ selectAll: string;
185
+ selectInvert: string;
186
+ selectNone: string;
187
+ selectionAll: string;
188
+ sortTitle: string;
189
+ expand: string;
190
+ collapse: string;
191
+ triggerDesc: string;
192
+ triggerAsc: string;
193
+ cancelSort: string;
194
+ };
195
+ export type ColumnsTable<RecordType = AnyObject> = ColumnTable<RecordType>[];
196
+ export type TableProps<RecordType = AnyObject> = {
197
+ id?: string;
198
+ theme?: {
199
+ theme?: 'dark' | 'light';
200
+ backgroundColor?: string;
201
+ color?: string;
202
+ };
203
+ classNames?: string;
204
+ title?: ReactNode | ((data: RecordType) => ReactNode);
205
+ fullScreenTitle?: ReactNode | (() => ReactNode);
206
+ editAble?: boolean;
207
+ rowKey?: string;
208
+ infiniteScroll?: boolean;
209
+ next?: () => void;
210
+ locale?: Locale;
211
+ groupAble?: boolean;
212
+ groupColumns?: string[];
213
+ groupSetting?: IGroupSetting;
214
+ onChooseColumns?: (props: IOnChooseColumns) => void;
215
+ pagination?: false | PaginationConfig;
216
+ showCustomTooltip?: boolean;
217
+ sortMultiple?: boolean;
218
+ dataSource: RecordType[];
219
+ columns: ColumnsTable<RecordType>;
220
+ height?: number;
221
+ minHeight?: number;
222
+ format?: IFormat;
223
+ t?: any;
224
+ lang?: string;
225
+ contextMenuItems?: ContextMenuItem[];
226
+ showDefaultContext?: boolean;
227
+ contextMenuHidden?: string[] | ((args?: Omit<ContextInfo<RecordType>, 'item' | 'event'>) => string[]);
228
+ contextMenuOpen?: (args: Omit<ContextInfo<RecordType>, 'item'>) => void;
229
+ contextMenuClick?: (args: ContextInfo<RecordType>) => void;
230
+ recordDoubleClick?: (args: RecordDoubleClickEventArgs<RecordType>) => void;
231
+ toolbarItems?: ToolbarItem[];
232
+ showColumnChoose?: boolean;
233
+ showAdvanceFilter?: boolean;
234
+ allowFiltering?: boolean;
235
+ onFilter?: (query: {
236
+ field: string;
237
+ key: string;
238
+ operator: IOperator;
239
+ predicate: 'and' | 'or';
240
+ value: any;
241
+ }[]) => void;
242
+ allowSortering?: boolean;
243
+ onSorter?: (args: Sorter[]) => void;
244
+ selectionSettings?: SelectionSettings;
245
+ rowSelection?: RowSelection<RecordType>;
246
+ rowSelected?: (args: {
247
+ type: string;
248
+ rowData: RecordType;
249
+ selected: RecordType | RecordType[];
250
+ }) => void;
251
+ dataSourceFilter?: SourceFilter[];
252
+ onFilterClick?: (column: ColumnTable<RecordType>, callback: (key: string, data: any) => void) => void;
253
+ loading?: boolean;
254
+ allowResizing?: boolean;
255
+ showToolbar?: boolean;
256
+ onDataChange?: (data: RecordType[]) => void;
257
+ defaultValue?: AnyObject | (() => AnyObject);
258
+ summary?: boolean;
259
+ showEmptyText?: boolean;
260
+ commandSettings?: CommandSettings;
261
+ rowClassName?: string | RowClassName<RecordType>;
262
+ onCellPaste?: ICellPasteModel<RecordType>;
263
+ onCellChange?: (args: CellChangeArgs<RecordType>, handleCallback: (rowData: any, index: any, value?: any) => void) => void;
264
+ onCellClick?: (args: ICellClick, callback?: any) => void;
265
+ rowEditable?: (rowData: RecordType) => boolean;
266
+ validate?: any;
267
+ onBlur?: (data: RecordType[]) => void;
268
+ onExpandClick?: (args: {
269
+ expandedKeys: string[];
270
+ key: string;
271
+ rowData: any;
272
+ }) => void;
273
+ wrapSettings?: IWrapSettings;
274
+ actionTemplate?: ReactNode | ReactElement | (() => ReactNode | ReactElement);
275
+ commandClick?: (args: CommandClick<RecordType>) => void;
276
+ expandable?: ExpandableConfig<RecordType>;
277
+ fullScreen?: boolean;
278
+ onRowStyles?: Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'> | ((data: RecordType, row: Row<RecordType>) => Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'>);
279
+ onRowHeaderStyles?: Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'> | (() => Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'>);
280
+ onRowFooterStyles?: Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'> | (() => Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'>);
281
+ };
282
+ export type ExpandableConfig<RecordType> = {
283
+ expandedRowKeys?: readonly Key[];
284
+ defaultExpandedRowKeys?: readonly Key[];
285
+ expandedRowRender?: ExpandedRowRender<RecordType>;
286
+ columnTitle?: React.ReactNode;
287
+ expandRowByClick?: boolean;
288
+ expandIcon?: RenderExpandIcon<RecordType>;
289
+ onExpand?: (expanded: boolean, record: RecordType) => void;
290
+ onExpandedRowsChange?: (expandedKeys: readonly Key[]) => void;
291
+ defaultExpandAllRows?: boolean;
292
+ indentSize?: number;
293
+ expandIconColumnIndex?: number;
294
+ showExpandColumn?: boolean;
295
+ expandedRowClassName?: string | RowClassName<RecordType>;
296
+ childrenColumnName?: string;
297
+ rowExpandable?: (record: RecordType) => boolean;
298
+ columnWidth?: number | string;
299
+ fixed?: FixedType;
300
+ };
301
+ export type RenderExpandIcon<RecordType> = (props: RenderExpandIconProps<RecordType>) => React.ReactNode;
302
+ export interface RenderExpandIconProps<RecordType> {
303
+ prefixCls: string;
304
+ expanded: boolean;
305
+ record: RecordType;
306
+ expandable: boolean;
307
+ onExpand: TriggerEventHandler<RecordType>;
308
+ }
309
+ export type TriggerEventHandler<RecordType> = (record: RecordType, event: React.MouseEvent<HTMLElement>) => void;
310
+ export type RowClassName<RecordType> = (record: RecordType, index: number, indent: number) => string;
311
+ export type ExpandedRowRender<ValueType> = (record: ValueType, index: number, indent: number, expanded: boolean) => React.ReactNode;
312
+ export type CommandClick<T> = {
313
+ id: string;
314
+ rowId: string;
315
+ rowData: any;
316
+ index: number;
317
+ rows: T[];
318
+ };
319
+ export type IEditSelectSettings = {
320
+ fieldKey?: string;
321
+ options: any[] | ((rowData: any, field: string) => any[]);
322
+ /** get value form other field **/
323
+ fieldValue?: string;
324
+ /** get label form other field **/
325
+ fieldLabel?: string;
326
+ /** cho phép nhập giá trị - onBlur: giá trị search được set thành value **/
327
+ searchTextAsValue?: boolean;
328
+ /**
329
+ * @deprecated Please use `allowSorter` instead.
330
+ * @since 1.7.25
331
+ */
332
+ inputKey?: string;
333
+ filterKey?: string[];
334
+ selectMode?: SelectMode;
335
+ getPasteValue?: (value: any) => Record<string, any> | null;
336
+ validateOption?: (rowData: any, field: string) => any[];
337
+ defaultOptions?: any[];
338
+ defaultValue?: (value: any, rowData: any) => {
339
+ value: any;
340
+ label: string;
341
+ [key: string]: string;
342
+ } | null;
343
+ formatOptionLabel?: (option: any) => ReactNode | ReactElement;
344
+ loadOptions?: (search: string, callback: (newOptions: any[]) => void, args?: LoadOptionsArgs) => void;
345
+ isMulti?: boolean;
346
+ closeMenuOnSelect?: boolean;
347
+ menuWidth?: number;
348
+ menuHeight?: number;
349
+ columns?: ColumnSelectTable[];
350
+ toolbarItems?: ToolbarItem[];
351
+ toolbarClick?: (props: ToolbarClick) => void;
352
+ toolbarHeight?: number;
353
+ hideSelectedOptions?: boolean;
354
+ showItems?: number;
355
+ isLengthSelected?: boolean;
356
+ fieldNames?: FieldNames;
357
+ filterOption?: boolean | FilterFunc<any>;
358
+ };
359
+ export type IEditFromSettings = {
360
+ fieldKey: string;
361
+ formOpen?: (props: IFormOpen) => void;
362
+ formClose?: (props: IFormOpen) => void;
363
+ formatLabel?: (value: any) => string;
364
+ menuWidth?: number;
365
+ menuHeight?: number;
366
+ labelWith?: number;
367
+ items: any[];
368
+ layout?: {
369
+ xl?: IGrid;
370
+ lg?: IGrid;
371
+ md?: IGrid;
372
+ sm?: IGrid;
373
+ xs?: IGrid;
374
+ };
375
+ defaultValues?: Record<string, any>;
376
+ schema?: any;
377
+ };
378
+ export type IFormOpen = {
379
+ value?: any;
380
+ setValue?: any;
381
+ getValues?: any;
382
+ reset?: any;
383
+ rowData?: any;
384
+ };
385
+ export type FilterFunc<OptionType> = (inputValue: string, option?: OptionType) => boolean;
386
+ export type ToolbarClick = {
387
+ item: any;
388
+ column: any;
389
+ };
390
+ export type ColumnSelectTable = {
391
+ field: string;
392
+ dataIndex?: string;
393
+ type?: IColumnType;
394
+ headerText?: string;
395
+ fixedType?: 'left' | 'right' | undefined;
396
+ width?: number | undefined;
397
+ minWidth?: number;
398
+ maxWidth?: number;
399
+ visible?: boolean;
400
+ textAlign?: ITextAlign;
401
+ headerTextAlign?: ITextAlign;
402
+ template?: (props: ITemplateColumn) => ReactNode | ReactElement;
403
+ headerTemplate?: any;
404
+ ellipsis?: boolean | undefined;
405
+ format?: IFormat;
406
+ tooltipDescription?: string | ((rowData: any) => string | ReactNode);
407
+ showTooltip?: boolean;
408
+ showTooltipHeader?: boolean;
409
+ };
410
+ export type ITemplateColumn = {
411
+ value: any;
412
+ column: any;
413
+ rowData: any;
414
+ field: number | string;
415
+ index: number;
416
+ };
417
+ export type RawValueType = string | number;
418
+ export type ToolbarItem = {
419
+ position?: 'Top' | 'Bottom';
420
+ align?: ITextAlign;
421
+ onClick?: (args: any) => void;
422
+ key?: React.Key;
423
+ value?: RawValueType;
424
+ label?: React.ReactNode;
425
+ template?: React.ReactNode | React.ReactElement | (() => React.ReactNode | React.ReactElement);
426
+ title?: React.ReactNode;
427
+ disabled?: boolean;
428
+ [key: string]: any;
429
+ };
430
+ export type LoadOptionsArgs = {
431
+ rowData?: any;
432
+ };
433
+ export type GroupTemplate = {
434
+ rowData: any;
435
+ value: any;
436
+ column: ColumnTable;
437
+ };
438
+ export type IGroupSetting = {
439
+ client?: boolean;
440
+ onGroup?: (props: IOnGroup) => void;
441
+ groupColumnSpan?: number;
442
+ hiddenColumnGroup?: boolean;
443
+ showHeaderColumn?: boolean;
444
+ showGroupIcon?: boolean;
445
+ unClearableLevel?: 1 | 2 | 3 | undefined;
446
+ sumGroup?: boolean;
447
+ groupTemplate?: React.ReactNode | React.ReactElement | ((args: GroupTemplate) => React.ReactNode | React.ReactElement);
448
+ };
449
+ type IOnGroup = {
450
+ columnGrouped: string[];
451
+ columns: ColumnsTable;
452
+ flattenColumns: ColumnsTable;
453
+ };
454
+ export type IOnChooseColumns = {
455
+ columns: ColumnsTable;
456
+ showColumns: ColumnsTable;
457
+ flattenColumns: ColumnsTable;
458
+ };
459
+ export type ContextMenuItem = ItemType;
460
+ export type CommandSettings = {
461
+ client?: boolean;
462
+ confirmDialog?: boolean;
463
+ };
464
+ export interface ICellPasteModel<RecordType = AnyObject> {
465
+ onPasted?: (args: IOnPastedProps, handleCallback: (callbackData: any[]) => void) => void;
466
+ dataChange?: (data: RecordType[]) => void;
467
+ getCallbackData?: (props: any) => void;
468
+ maxRowsPaste?: number;
469
+ }
470
+ export type IOnPastedProps = {
471
+ data: any[];
472
+ copyRows: any[];
473
+ pastedColumns: string[];
474
+ pasteData: any[];
475
+ type: 'onPaste' | 'onChange' | 'onCellPaste';
476
+ };
477
+ export type ICellClick = {
478
+ index: number;
479
+ indexCol?: number;
480
+ rowId: string | number;
481
+ type: 'Editing' | 'Default';
482
+ field: string;
483
+ cellValue: any;
484
+ rowData: any;
485
+ };
486
+ export type CellChangeArgs<T> = {
487
+ type: 'onPaste' | 'onChange' | 'onCellPaste';
488
+ value: any;
489
+ option: AnyObject;
490
+ rowData: T;
491
+ rowsData: T[];
492
+ indexRow: number;
493
+ rowId?: string;
494
+ field: string | undefined;
495
+ indexCol: any;
496
+ sumValue?: any[];
497
+ };
498
+ export type IWrapMode = 'Header' | 'Both' | 'Content';
499
+ export type IWrapSettings = {
500
+ wrapMode?: IWrapMode;
501
+ };
502
+ export type SelectionSettings<T = AnyObject> = {
503
+ mode?: 'checkbox' | 'radio';
504
+ type?: 'single' | 'multiple';
505
+ checkboxOnly?: boolean;
506
+ checkStrictly?: boolean;
507
+ columnWidth?: number;
508
+ hideSelectAll?: boolean;
509
+ selectedRowKeys?: Key[];
510
+ defaultSelectedRowKeys?: Key[];
511
+ getCheckboxProps?: (record: T) => Partial<Omit<CheckboxProps, 'checked' | 'defaultChecked'>>;
512
+ };
513
+ export type SelectionSelectFn<T = AnyObject> = (record: T, selected: boolean, selectedRows: T[], nativeEvent: Event) => void;
514
+ export type RowSelection<T> = {
515
+ preserveSelectedRowKeys?: boolean;
516
+ selectedRowKeys?: Key[];
517
+ defaultSelectedRowKeys?: Key[];
518
+ onChange?: (selectedRowKeys: Key[], selectedRows: T[], info: {
519
+ type: RowSelectMethod;
520
+ }, selectedRow: T) => void;
521
+ getCheckboxProps?: (record: T) => Partial<Omit<CheckboxProps, 'checked' | 'defaultChecked'>>;
522
+ onSelect?: SelectionSelectFn<T>;
523
+ /** @deprecated This function is deprecated and should use `onChange` instead */
524
+ onSelectMultiple?: (selected: boolean, selectedRows: T[], changeRows: T[]) => void;
525
+ /** @deprecated This function is deprecated and should use `onChange` instead */
526
+ onSelectAll?: (selected: boolean, selectedRows: T[], changeRows: T[]) => void;
527
+ /** @deprecated This function is deprecated and should use `onChange` instead */
528
+ onSelectInvert?: (selectedRowKeys: Key[]) => void;
529
+ /** @deprecated This function is deprecated and should use `onChange` instead */
530
+ onSelectNone?: () => void;
531
+ fixed?: FixedType;
532
+ columnTitle?: React.ReactNode | ((checkboxNode: React.ReactNode) => React.ReactNode);
533
+ checkStrictly?: boolean;
534
+ checkboxOnly?: boolean;
535
+ arrowKey?: boolean;
536
+ };
537
+ export type RecordDoubleClickEventArgs<RecordType> = {
538
+ rowData: RecordType;
539
+ rowIndex: number | undefined;
540
+ e: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>;
541
+ };
542
+ export type SourceFilter = {
543
+ key: string;
544
+ data: any[];
545
+ loadOptions?: (search: string, callback: (newOptions: any[]) => void) => void;
546
+ };
547
+ export type ContextInfo<RecordType> = {
548
+ rowInfo: {
549
+ rowData: RecordType | null;
550
+ };
551
+ event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>;
552
+ item: ItemType;
553
+ };
554
+ export type Presets = Required<ColorPickerProps>['presets'][number];
555
+ export type RangeState = {
556
+ rowRange: string[];
557
+ colRange: string[];
558
+ startRowIndex: number | undefined;
559
+ endRowIndex: number | undefined;
560
+ startColIndex: number | undefined;
561
+ endColIndex: number | undefined;
562
+ rowIds: string[];
563
+ colIds: string[];
564
+ };
565
+ export type Sorter = {
566
+ columnKey: string;
567
+ field: string;
568
+ order: 'ascend' | 'descend';
569
+ };
570
+ export {};