es-grid-template 1.8.65 → 1.8.66

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 (146) hide show
  1. package/es/grid-component/TempTable.d.ts +2 -2
  2. package/es/grid-component/TempTable.js +3 -3
  3. package/es/grid-component/hooks/index.js +0 -1
  4. package/es/grid-component/hooks/useLazyKVMap.d.ts +1 -1
  5. package/es/grid-component/hooks/useLazyKVMap.js +0 -4
  6. package/es/grid-component/hooks/utils.d.ts +3 -4
  7. package/es/grid-component/hooks/utils.js +2 -1
  8. package/es/grid-component/styles.scss +1394 -1394
  9. package/es/grid-component/type.d.ts +0 -414
  10. package/es/grid-component/type.js +490 -1
  11. package/es/table-component/type.d.ts +2 -0
  12. package/es/table-virtuoso/ColumnsGroup/ColumnsGroup.js +1 -3
  13. package/es/table-virtuoso/InternalTable.js +6 -28
  14. package/es/table-virtuoso/body/TableBodyCell.js +0 -9
  15. package/es/table-virtuoso/body/TableBodyRow.js +0 -4
  16. package/es/table-virtuoso/style.js +2 -1
  17. package/es/table-virtuoso/style.scss +2 -1
  18. package/es/table-virtuoso/table/Grid.js +0 -4
  19. package/es/table-virtuoso/table/TableContainer.js +31 -44
  20. package/es/table-virtuoso/table/TableWrapper.d.ts +2 -0
  21. package/es/table-virtuoso/table/TableWrapper.js +5 -2
  22. package/lib/grid-component/TempTable.d.ts +2 -2
  23. package/lib/grid-component/TempTable.js +3 -5
  24. package/lib/grid-component/hooks/useLazyKVMap.d.ts +1 -1
  25. package/lib/grid-component/hooks/useLazyKVMap.js +0 -3
  26. package/lib/grid-component/hooks/utils.d.ts +3 -4
  27. package/lib/grid-component/hooks/utils.js +3 -0
  28. package/lib/grid-component/styles.scss +1394 -1394
  29. package/lib/grid-component/type.d.ts +0 -414
  30. package/lib/grid-component/type.js +490 -4
  31. package/lib/table-component/type.d.ts +2 -0
  32. package/lib/table-virtuoso/ColumnsGroup/ColumnsGroup.js +1 -3
  33. package/lib/table-virtuoso/InternalTable.js +6 -28
  34. package/lib/table-virtuoso/body/TableBodyCell.js +0 -9
  35. package/lib/table-virtuoso/body/TableBodyRow.js +0 -5
  36. package/lib/table-virtuoso/style.js +2 -1
  37. package/lib/table-virtuoso/style.scss +2 -1
  38. package/lib/table-virtuoso/table/Grid.js +0 -4
  39. package/lib/table-virtuoso/table/TableContainer.js +29 -42
  40. package/lib/table-virtuoso/table/TableWrapper.d.ts +2 -0
  41. package/lib/table-virtuoso/table/TableWrapper.js +4 -2
  42. package/package.json +1 -1
  43. package/es/grid-component/AdvanceFilter.d.ts +0 -14
  44. package/es/grid-component/AdvanceFilter.js +0 -454
  45. package/es/grid-component/CheckboxFilter.d.ts +0 -20
  46. package/es/grid-component/CheckboxFilter.js +0 -244
  47. package/es/grid-component/CheckboxFilter2.d.ts +0 -20
  48. package/es/grid-component/CheckboxFilter2.js +0 -244
  49. package/es/grid-component/ColumnsChoose.d.ts +0 -10
  50. package/es/grid-component/ColumnsChoose.js +0 -230
  51. package/es/grid-component/ColumnsGroup/ColumnsGroup.d.ts +0 -12
  52. package/es/grid-component/ColumnsGroup/ColumnsGroup.js +0 -232
  53. package/es/grid-component/ColumnsGroup/index.d.ts +0 -1
  54. package/es/grid-component/ColumnsGroup/index.js +0 -1
  55. package/es/grid-component/Command.d.ts +0 -8
  56. package/es/grid-component/Command.js +0 -80
  57. package/es/grid-component/ContextMenu.d.ts +0 -20
  58. package/es/grid-component/ContextMenu.js +0 -130
  59. package/es/grid-component/EditForm/EditForm.d.ts +0 -27
  60. package/es/grid-component/EditForm/EditForm.js +0 -394
  61. package/es/grid-component/EditForm/index.d.ts +0 -1
  62. package/es/grid-component/EditForm/index.js +0 -1
  63. package/es/grid-component/EditableCell.d.ts +0 -20
  64. package/es/grid-component/EditableCell.js +0 -1030
  65. package/es/grid-component/FilterSearch.d.ts +0 -12
  66. package/es/grid-component/FilterSearch.js +0 -33
  67. package/es/grid-component/GridStyle.d.ts +0 -8
  68. package/es/grid-component/GridStyle.js +0 -5
  69. package/es/grid-component/TableGrid.d.ts +0 -21
  70. package/es/grid-component/TableGrid.js +0 -493
  71. package/es/grid-component/async-select/index.d.ts +0 -11
  72. package/es/grid-component/async-select/index.js +0 -38
  73. package/es/grid-component/async-table-select/index.d.ts +0 -11
  74. package/es/grid-component/async-table-select/index.js +0 -40
  75. package/es/grid-component/checkbox-control/index.d.ts +0 -13
  76. package/es/grid-component/checkbox-control/index.js +0 -40
  77. package/es/grid-component/hooks/columns/index.d.ts +0 -10
  78. package/es/grid-component/hooks/columns/index.js +0 -503
  79. package/es/grid-component/hooks/content/ControlCheckbox.d.ts +0 -13
  80. package/es/grid-component/hooks/content/ControlCheckbox.js +0 -87
  81. package/es/grid-component/hooks/content/HeaderContent.d.ts +0 -14
  82. package/es/grid-component/hooks/content/HeaderContent.js +0 -44
  83. package/es/grid-component/hooks/content/TooltipContent.d.ts +0 -13
  84. package/es/grid-component/hooks/content/TooltipContent.js +0 -74
  85. package/es/grid-component/hooks/useColumns.d.ts +0 -19
  86. package/es/grid-component/hooks/useColumns.js +0 -317
  87. package/es/grid-component/number/index.d.ts +0 -10
  88. package/es/grid-component/number/index.js +0 -39
  89. package/es/grid-component/number-range/index.d.ts +0 -11
  90. package/es/grid-component/number-range/index.js +0 -63
  91. package/es/grid-component/useContext.d.ts +0 -34
  92. package/es/grid-component/useContext.js +0 -8
  93. package/es/table-virtuoso/body/TableBody.d.ts +0 -14
  94. package/es/table-virtuoso/body/TableBody.js +0 -84
  95. package/lib/grid-component/AdvanceFilter.d.ts +0 -14
  96. package/lib/grid-component/AdvanceFilter.js +0 -463
  97. package/lib/grid-component/CheckboxFilter.d.ts +0 -20
  98. package/lib/grid-component/CheckboxFilter.js +0 -253
  99. package/lib/grid-component/CheckboxFilter2.d.ts +0 -20
  100. package/lib/grid-component/CheckboxFilter2.js +0 -253
  101. package/lib/grid-component/ColumnsChoose.d.ts +0 -10
  102. package/lib/grid-component/ColumnsChoose.js +0 -240
  103. package/lib/grid-component/ColumnsGroup/ColumnsGroup.d.ts +0 -12
  104. package/lib/grid-component/ColumnsGroup/ColumnsGroup.js +0 -243
  105. package/lib/grid-component/ColumnsGroup/index.d.ts +0 -1
  106. package/lib/grid-component/ColumnsGroup/index.js +0 -16
  107. package/lib/grid-component/Command.d.ts +0 -8
  108. package/lib/grid-component/Command.js +0 -88
  109. package/lib/grid-component/ContextMenu.d.ts +0 -20
  110. package/lib/grid-component/ContextMenu.js +0 -140
  111. package/lib/grid-component/EditForm/EditForm.d.ts +0 -27
  112. package/lib/grid-component/EditForm/EditForm.js +0 -404
  113. package/lib/grid-component/EditForm/index.d.ts +0 -1
  114. package/lib/grid-component/EditForm/index.js +0 -16
  115. package/lib/grid-component/EditableCell.d.ts +0 -20
  116. package/lib/grid-component/EditableCell.js +0 -1032
  117. package/lib/grid-component/FilterSearch.d.ts +0 -12
  118. package/lib/grid-component/FilterSearch.js +0 -42
  119. package/lib/grid-component/GridStyle.d.ts +0 -8
  120. package/lib/grid-component/GridStyle.js +0 -12
  121. package/lib/grid-component/TableGrid.d.ts +0 -21
  122. package/lib/grid-component/TableGrid.js +0 -493
  123. package/lib/grid-component/async-select/index.d.ts +0 -11
  124. package/lib/grid-component/async-select/index.js +0 -47
  125. package/lib/grid-component/async-table-select/index.d.ts +0 -11
  126. package/lib/grid-component/async-table-select/index.js +0 -49
  127. package/lib/grid-component/checkbox-control/index.d.ts +0 -13
  128. package/lib/grid-component/checkbox-control/index.js +0 -48
  129. package/lib/grid-component/hooks/columns/index.d.ts +0 -10
  130. package/lib/grid-component/hooks/columns/index.js +0 -518
  131. package/lib/grid-component/hooks/content/ControlCheckbox.d.ts +0 -13
  132. package/lib/grid-component/hooks/content/ControlCheckbox.js +0 -95
  133. package/lib/grid-component/hooks/content/HeaderContent.d.ts +0 -14
  134. package/lib/grid-component/hooks/content/HeaderContent.js +0 -53
  135. package/lib/grid-component/hooks/content/TooltipContent.d.ts +0 -13
  136. package/lib/grid-component/hooks/content/TooltipContent.js +0 -81
  137. package/lib/grid-component/hooks/useColumns.d.ts +0 -19
  138. package/lib/grid-component/hooks/useColumns.js +0 -328
  139. package/lib/grid-component/number/index.d.ts +0 -10
  140. package/lib/grid-component/number/index.js +0 -47
  141. package/lib/grid-component/number-range/index.d.ts +0 -11
  142. package/lib/grid-component/number-range/index.js +0 -71
  143. package/lib/grid-component/useContext.d.ts +0 -34
  144. package/lib/grid-component/useContext.js +0 -13
  145. package/lib/table-virtuoso/body/TableBody.d.ts +0 -14
  146. package/lib/table-virtuoso/body/TableBody.js +0 -95
@@ -1 +1,490 @@
1
- export {};
1
+ // import type { Key, ReactElement, ReactNode } from "react"
2
+ // import type React from "react"
3
+ // import type { IOperator } from "./hooks"
4
+ // import type {
5
+ // TypeFilter,
6
+ // TableProps as RcTableProps,
7
+ // TableColumnType as RcColumnType,
8
+ // EditType,
9
+ // TablePaginationConfig
10
+ // } from "rc-master-ui"
11
+ // import type { FilterOperator, TableRowSelection } from "rc-master-ui/es/table/interface"
12
+ // import type { ToolbarItem as RcToolbarItem } from "rc-master-ui/es/toolbar"
13
+ // import type { ItemType } from "rc-master-ui/es/menu/interface"
14
+ // import type { FieldNames, FilterFunc } from "rc-select/es/Select"
15
+ // import type { ColorPickerProps } from "antd"
16
+ // import type { FixedType } from "rc-base-table/lib/interface"
17
+ // import type { TableLocale } from "rc-master-ui/lib/table/interface"
18
+ // import type { Cell, Header, Row } from '@tanstack/react-table'
19
+
20
+ // export type IColumnType = "number" | "time" | "date" | "week" | "month" | "file" | "quarter" | "year" | "datetime" | "string" | "boolean" | "checkbox" | "color" | null | undefined
21
+
22
+ // export type AnyObject = Record<PropertyKey, any>;
23
+
24
+ // export type SelectMode = 'checkbox' | 'radio' | undefined
25
+ // export type ITextAlign = 'center' | 'left' | 'right'
26
+ // export type Frozen = 'left' | 'right' | 'Left' | 'Right'
27
+
28
+ // export type ToolbarItem = Omit<RcToolbarItem, 'position' | 'align'> & {
29
+ // position?: 'Top' | 'Bottom',
30
+ // align?: ITextAlign
31
+ // onClick?: (args: any) => void
32
+ // };
33
+
34
+ // // export type ContextMenuItem = MenuProps['items'] & {}
35
+ // export type ContextMenuItem = ItemType
36
+
37
+ // export type ITemplateColumn = {
38
+ // value: any
39
+ // column: any
40
+ // rowData: any
41
+ // field: number | string
42
+ // index: number
43
+ // // [key: string]: any
44
+ // }
45
+
46
+ // export type ColumnSelectTable = {
47
+ // field: string,
48
+ // dataIndex?: string,
49
+ // type?: IColumnType
50
+ // headerText?: string,
51
+ // fixedType?: 'left' | 'right' | undefined,
52
+ // width?: number | undefined,
53
+ // minWidth?: number,
54
+ // maxWidth?: number,
55
+ // visible?: boolean
56
+ // textAlign?: ITextAlign
57
+ // headerTextAlign?: ITextAlign
58
+ // // eslint-disable-next-line no-unused-vars
59
+ // template?: (props: ITemplateColumn) => ReactNode | ReactElement
60
+ // headerTemplate?: any
61
+ // ellipsis?: boolean | undefined
62
+ // format?: IFormat
63
+ // // eslint-disable-next-line no-unused-vars
64
+ // tooltipDescription?: string | ((rowData: any) => string | ReactNode)
65
+ // // tooltipDescription?: string | ((rowData: any) => string | React.FC<any> | ReactNode)
66
+ // showTooltip?: boolean
67
+ // showTooltipHeader?: boolean
68
+ // }
69
+
70
+ // export type IEditSelectSettings = {
71
+ // fieldKey?: string
72
+ // options: any[] | ((rowData: any, field: string) => any[])
73
+ // /** get value form other field **/
74
+ // fieldValue?: string
75
+ // /** get label form other field **/
76
+ // fieldLabel?: string
77
+ // /** cho phép nhập giá trị - onBlur: giá trị search được set thành value **/
78
+ // searchTextAsValue?: boolean
79
+
80
+ // inputKey?: string
81
+
82
+ // filterKey?: string[]
83
+ // selectMode?: SelectMode
84
+
85
+ // // eslint-disable-next-line no-unused-vars
86
+ // getPasteValue?: (value: any) => Record<string, any> | null
87
+ // // eslint-disable-next-line no-unused-vars
88
+ // validateOption?: (rowData: any, field: string) => any[]
89
+
90
+ // defaultOptions?: any[]
91
+ // // eslint-disable-next-line no-unused-vars
92
+ // defaultValue?: (value: any, rowData: any) => {
93
+ // value: any
94
+ // label: string
95
+ // [key: string]: string
96
+
97
+ // } | null
98
+
99
+ // formatOptionLabel?: (option: any) => ReactNode | ReactElement
100
+ // // loadOptions?: (search: string, callback: (newOptions: any[]) => void) => void
101
+ // loadOptions?: (search: string, callback: (newOptions: any[]) => void, args?: LoadOptionsArgs) => void;
102
+ // isMulti?: boolean
103
+ // closeMenuOnSelect?: boolean
104
+ // menuWidth?: number
105
+ // menuHeight?: number
106
+
107
+ // columns?: ColumnSelectTable[]
108
+ // toolbarItems?: ToolbarItem[]
109
+ // // eslint-disable-next-line no-unused-vars
110
+ // toolbarClick?: (props: ToolbarClick) => void
111
+ // toolbarHeight?: number
112
+ // hideSelectedOptions?: boolean
113
+ // showItems?: number
114
+ // isLengthSelected?: boolean
115
+ // fieldNames?: FieldNames
116
+ // filterOption?: boolean | FilterFunc<any>;
117
+ // }
118
+ // export type ToolbarClick = {
119
+ // item: any
120
+ // column: any
121
+ // }
122
+ // export type LoadOptionsArgs = {
123
+ // rowData?: any
124
+
125
+ // }
126
+
127
+ // export type ColumnTable<RecordType = AnyObject> = Omit<RcColumnType<RecordType>, 'headerTemplate' | 'title' | 'format' | 'commandItems'> & {
128
+ // field?: string,
129
+ // key?: any,
130
+ // type?: IColumnType,
131
+ // /** @deprecated This function is deprecated and should use `onChange` instead */
132
+ // haveSum?: boolean
133
+ // isSummary?: boolean
134
+ // summaryTemplate?: (data: number, key: string) => ReactElement | ReactNode
135
+ // maxWidth?: string | number
136
+ // format?: IFormat | ((rowData: any) => IFormat)
137
+ // allowFiltering?: boolean
138
+ // allowSortering?: boolean
139
+ // operator?: FilterOperator
140
+ // hideOperator?: boolean
141
+ // placeholder?: string
142
+ // showInColumnChoose?: boolean
143
+ // typeFilter?: TypeFilter
144
+ // source?: any[]
145
+ // showFilterSearch?: boolean
146
+ // headerText?: string
147
+ // visible?: boolean
148
+ // headerTooltip?: boolean | string | (() => ReactNode | ReactElement)
149
+ // columnGroupText?: string
150
+ // textAlign?: ITextAlign
151
+ // headerTextAlign?: ITextAlign
152
+ // // template?: ReactNode | ReactElement | ((value: any, record: RecordType, index: number) => ReactNode | ReactElement)
153
+ // template?: ReactNode | ReactElement | ((args: ColumnTemplate<RecordType>) => ReactNode | ReactElement)
154
+ // showTooltip?: boolean
155
+ // tooltipDescription?: ReactNode | ReactElement | ((args: { value: any, record: RecordType }) => ReactNode | ReactElement)
156
+ // headerTemplate?: React.ReactNode | React.ReactElement | ((column: ColumnTable<RecordType>) => React.ReactNode | React.ReactElement);
157
+ // commandItems?: CommandItem[]
158
+
159
+ // children?: ColumnTable<RecordType>[]
160
+
161
+ // editType?: EditType | ((rowData?: RecordType) => EditType)
162
+ // disable?: boolean | ((rowData: any) => boolean)
163
+ // editEnable?: boolean | ((rowData: any) => boolean)
164
+ // isClearable?: boolean
165
+ // maxDate?: any
166
+ // minDate?: any
167
+ // maxTime?: any
168
+ // minTime?: any
169
+ // max?: number
170
+ // min?: number
171
+ // editSelectSettings?: IEditSelectSettings
172
+ // editFromSettings?: IEditFromSettings
173
+ // fixedType?: FixedType,
174
+ // headerTextWrap?: boolean
175
+ // // children?: ColumnEditType<RecordType>[]
176
+
177
+ // sumGroup?: boolean
178
+
179
+ // allowSelection?: boolean | ((rowData: RecordType) => boolean)
180
+
181
+ // 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'>)
182
+ // onCellHeaderStyles?: Omit<React.CSSProperties, 'display' | 'width' | 'minWidth' | 'left' | 'right' | 'position'> | ((cell: Header<RecordType, unknown>) => Omit<React.CSSProperties, 'display' | 'width' | 'minWidth' | 'left' | 'right' | 'position'>)
183
+ // 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'>)
184
+
185
+ // }
186
+
187
+ // export type IFormOpen = {
188
+ // value?: any
189
+ // setValue?: any
190
+ // getValues?: any
191
+ // reset?: any
192
+ // rowData?: any
193
+ // }
194
+
195
+ // export type IEditFromSettings = {
196
+ // fieldKey: string
197
+ // // eslint-disable-next-line no-unused-vars
198
+ // formOpen?: (props: IFormOpen) => void
199
+ // // eslint-disable-next-line no-unused-vars
200
+ // formClose?: (props: IFormOpen) => void
201
+ // // eslint-disable-next-line no-unused-vars
202
+ // formatLabel?: (value: any) => string
203
+ // menuWidth?: number
204
+ // menuHeight?: number
205
+ // labelWith?: number
206
+ // items: any[]
207
+ // layout?: {
208
+ // xl?: IGrid
209
+ // lg?: IGrid
210
+ // md?: IGrid
211
+ // sm?: IGrid
212
+ // xs?: IGrid
213
+ // }
214
+
215
+ // defaultValues?: Record<string, any>
216
+
217
+ // schema?: any
218
+ // }
219
+
220
+ // 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
221
+
222
+ // export type ColumnTemplate<RecordType> = {
223
+ // value: any,
224
+ // rowData: RecordType,
225
+ // index: number,
226
+ // field: string
227
+ // }
228
+
229
+ // export type ColumnsTable<RecordType = AnyObject> = ColumnTable<RecordType>[]
230
+
231
+ // export type Locale = TableLocale & {
232
+ // ok_btn: string
233
+ // cancel_btn: string
234
+ // add_rows: string
235
+ // add_rows_before: string
236
+ // add_rows_after: string
237
+ // add_1: string
238
+ // add_10: string
239
+ // add_50: string
240
+ // add_100: string
241
+ // add_children: string
242
+ // delete_content: string
243
+ // delete_rows: string
244
+ // custom: string
245
+ // }
246
+
247
+ // export type Sort = {
248
+ // columnKey: string,
249
+ // field: string,
250
+ // order: 'ascend' | 'descend' | null
251
+ // }
252
+
253
+ // export interface TableProps<RecordType = AnyObject> extends Omit<RcTableProps<RecordType>, 'columns' | 'rowSelection' | 'loading' | 'dataSource' | 'summary' | 'pagination' | 'locale' | 'virtual'> {
254
+ // editAble?: boolean
255
+ // infiniteScroll?: boolean
256
+ // theme?: {
257
+ // theme?: 'dark' | 'light',
258
+ // backgroundColor?: string
259
+ // color?: string
260
+ // }
261
+ // virtualRow?: boolean
262
+ // virtualColumns?: boolean
263
+ // next?: () => void
264
+ // locale?: Locale
265
+ // groupAble?: boolean
266
+ // groupColumns?: string[]
267
+ // groupSetting?: IGroupSetting
268
+ // onChooseColumns?: (props: IOnChooseColumns) => void
269
+ // pagination?: false | PaginationConfig;
270
+ // showCustomTooltip?: boolean
271
+
272
+ // sortMultiple?: boolean
273
+ // dataSource: RecordType[]
274
+ // columns: ColumnsTable<RecordType>,
275
+ // height?: number
276
+ // minHeight?: number
277
+ // format?: IFormat
278
+ // t?: any
279
+ // lang?: string
280
+ // contextMenuItems?: ContextMenuItem[]
281
+ // showDefaultContext?: boolean
282
+ // contextMenuHidden?: string[] | ((args?: Omit<ContextInfo<RecordType>, 'item' | 'event'>) => string[])
283
+ // contextMenuOpen?: (args: Omit<ContextInfo<RecordType>, 'item'>) => void
284
+ // contextMenuClick?: (args: ContextInfo<RecordType>) => void
285
+ // recordDoubleClick?: (args: RecordDoubleClickEventArgs<RecordType>) => void
286
+ // toolbarItems?: ToolbarItem[]
287
+ // showColumnChoose?: boolean
288
+ // showAdvanceFilter?: boolean
289
+
290
+ // allowFiltering?: boolean
291
+ // onFilter?: (query: { field: string, key: string, operator: IOperator, predicate: 'and' | 'or', value: any }[]) => void
292
+ // allowSortering?: boolean
293
+ // onSorter?: (args: { column: ColumnTable<RecordType>, columnKey: string, field: string, order: 'ascend' | 'descend' | null }) => void
294
+ // defaultSorter?: Sort[]
295
+ // selectionSettings?: SelectionSettings
296
+ // // rowKey?: string
297
+ // rowKey?: string | keyof RecordType | GetRowKey<RecordType>;
298
+
299
+ // rowSelection?: RowSelection<RecordType>
300
+ // rowSelected?: (args: { type: string, rowData: RecordType, selected: RecordType | RecordType[] }) => void
301
+ // dataSourceFilter?: SourceFilter[]
302
+ // onFilterClick?: (column: ColumnTable<RecordType>, callback: (key: string, data: any) => void) => void
303
+ // loading?: boolean
304
+ // allowResizing?: boolean
305
+ // showToolbar?: boolean
306
+ // onDataChange?: (data: RecordType[]) => void
307
+ // defaultValue?: AnyObject | (() => AnyObject)
308
+
309
+ // summary?: boolean | ((data: readonly RecordType[]) => React.ReactNode);
310
+ // showEmptyText?: boolean
311
+ // commandSettings?: CommandSettings
312
+
313
+ // // columns: ColumnsTable<RecordType>
314
+ // onCellPaste?: ICellPasteModel<RecordType>
315
+ // onCellChange?: (args: CellChangeArgs<RecordType>, handleCallback: (rowData: any, index: any, value?: any) => void) => void
316
+ // onCellClick?: (args: ICellClick, callback?: any) => void
317
+ // rowEditable?: (rowData: RecordType) => boolean
318
+ // validate?: any
319
+ // onBlur?: (data: RecordType[]) => void
320
+
321
+ // onExpandClick?: (args: { expandedKeys: string[], key: string, rowData: any }) => void
322
+
323
+ // wrapSettings?: IWrapSettings,
324
+
325
+ // actionTemplate?: ReactNode | ReactElement | (() => ReactNode | ReactElement)
326
+
327
+ // fullScreen?: boolean
328
+
329
+ // onRowStyles?: Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'> | ((data: RecordType, row: Row<RecordType>) => Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'>)
330
+ // onRowHeaderStyles?: Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'> | (() => Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'>)
331
+ // onRowFooterStyles?: Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'> | (() => Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'>)
332
+
333
+ // fullScreenTitle?: ReactNode | (() => ReactNode)
334
+ // }
335
+
336
+ // // export interface TableEditProps<RecordType = AnyObject> extends Omit<TableProps<RecordType>, 'columns' > {
337
+ // // columns: ColumnsTable<RecordType>
338
+ // // onCellPaste?: ICellPasteModel<RecordType>
339
+ // // onCellChange?: (args: CellChangeArgs<RecordType>, handleCallback: (rowData: any, index: any, value?: any) => void) => void
340
+ // // onCellClick?: (args: ICellClick, callback?: any) => void
341
+ // // rowEditable?: (rowData: RecordType) => boolean
342
+ // // }
343
+
344
+ // export type PaginationConfig = TablePaginationConfig & {
345
+ // currentPage?: number
346
+ // }
347
+ // export type ICellClick = {
348
+ // index: number
349
+ // indexCol?: number
350
+ // rowId: string | number
351
+ // type: 'Editing' | 'Default'
352
+ // field: string
353
+ // cellValue: any
354
+ // rowData: any
355
+ // }
356
+
357
+ // export type GridTableProps<RecordType = AnyObject> = TableProps<RecordType>
358
+
359
+ // export interface CommandItem {
360
+ // id: string
361
+ // type?: string
362
+ // visible?: boolean | ((record: any) => boolean)
363
+ // title: string
364
+ // color?: 'blue' | 'purple' | 'cyan' | 'green' | 'magenta' | 'pink' | 'red' | 'orange' | 'yellow' | 'volcano' | 'geekblue' | 'lime' | 'gold';
365
+ // tooltip?: string
366
+ // icon?: ReactNode | ReactElement | (() => ReactNode | ReactElement)
367
+ // template?: ReactNode | ReactElement | ((record: any) => ReactNode | ReactElement)
368
+ // client?: boolean
369
+ // confirmDialog?: boolean
370
+ // }
371
+
372
+ // export type GroupTemplate = {
373
+ // rowData: any
374
+ // value: any
375
+ // column: ColumnTable
376
+ // }
377
+
378
+ // export type IGroupSetting = {
379
+ // client?: boolean
380
+ // onGroup?: (props: IOnGroup) => void
381
+ // groupColumnSpan?: number
382
+ // hiddenColumnGroup?: boolean
383
+ // showHeaderColumn?: boolean
384
+ // showGroupIcon?: boolean
385
+ // unClearableLevel?: 1 | 2 | 3 | undefined
386
+ // sumGroup?: boolean
387
+ // groupTemplate?: React.ReactNode | React.ReactElement | ((args: GroupTemplate) => React.ReactNode | React.ReactElement)
388
+ // }
389
+
390
+ // type IOnGroup = {
391
+ // columnGrouped: string[]
392
+ // columns: ColumnsTable
393
+ // flattenColumns: ColumnsTable
394
+ // }
395
+
396
+ // export type IOnChooseColumns = {
397
+ // columns: ColumnsTable
398
+ // showColumns: ColumnsTable
399
+ // flattenColumns: ColumnsTable
400
+ // }
401
+
402
+ // export type CellChangeArgs<T> = {
403
+ // type: 'onPaste' | 'onChange' | 'onCellPaste'
404
+ // value: any
405
+ // option: AnyObject
406
+ // rowData: T
407
+ // rowsData: T[]
408
+ // indexRow: number
409
+ // rowId?: string
410
+ // field: string | undefined
411
+ // indexCol: any
412
+ // sumValue?: any[]
413
+ // }
414
+
415
+ // export type IOnPastedProps = {
416
+ // data: any[]
417
+ // copyRows: any[]
418
+ // pastedColumns: string[]
419
+ // pasteData: any[]
420
+ // type: 'onPaste' | 'onChange' | 'onCellPaste'
421
+ // }
422
+
423
+ // export interface ICellPasteModel<RecordType = AnyObject> {
424
+
425
+ // onPasted?: (args: IOnPastedProps, handleCallback: (callbackData: any[]) => void) => void
426
+
427
+ // dataChange?: (data: RecordType[]) => void
428
+ // getCallbackData?: (props: any) => void
429
+ // maxRowsPaste?: number
430
+ // }
431
+
432
+ // export type SourceFilter = {
433
+ // key: string
434
+ // data: any[]
435
+ // loadOptions?: (search: string, callback: (newOptions: any[]) => void) => void;
436
+
437
+ // }
438
+
439
+ // export type RowSelection<RecordType> = Omit<TableRowSelection<RecordType>, 'type' | 'columnWidth' | 'hideSelectAll' | 'defaultSelectedRowKeys'>
440
+
441
+ // export type SelectionSettings = Omit<TableRowSelection, 'type' | 'onChange' | 'onSelect' | 'onSelectAll' | 'onSelectNone' | 'onSelectMultiple'> & {
442
+ // mode?: 'checkbox' | 'radio'
443
+ // type?: 'single' | 'multiple'
444
+ // checkboxOnly?: boolean
445
+ // }
446
+
447
+ // export type RecordDoubleClickEventArgs<RecordType> = {
448
+ // rowData: RecordType
449
+ // rowIndex: number | undefined
450
+ // e: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>;
451
+ // }
452
+
453
+ // export type ContextInfo<RecordType> = {
454
+ // rowInfo: {
455
+ // rowData: RecordType | null
456
+ // }
457
+ // event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>;
458
+ // item: ItemType
459
+ // }
460
+
461
+ // export type IFormat = {
462
+ // thousandSeparator?: string
463
+ // decimalSeparator?: string
464
+ // decimalScale?: number | undefined // bao nhiêu số sau số thập phân
465
+ // allowNegative?: boolean // check nhập số âm
466
+ // prefix?: string | undefined
467
+ // suffix?: string | undefined
468
+ // fixedDecimalScale?: boolean // mặc định thêm số 0 sau số thập phân
469
+ // dateFormat?: string
470
+ // datetimeFormat?: string
471
+ // timeFormat?: string
472
+ // weekFormat?: string
473
+ // monthFormat?: string
474
+ // yearFormat?: string
475
+ // }
476
+
477
+ // export type GetRowKey<RecordType> = (record: RecordType, index?: number) => Key;
478
+
479
+ // export type Presets = Required<ColorPickerProps>['presets'][number];
480
+
481
+ // export type CommandSettings = {
482
+ // client?: boolean
483
+ // confirmDialog?: boolean
484
+ // }
485
+
486
+ // export type IWrapMode = 'Header' | 'Both' | 'Content'
487
+
488
+ // export type IWrapSettings = {
489
+ // wrapMode?: IWrapMode
490
+ // }
@@ -80,6 +80,7 @@ export type ColumnTemplate<RecordType> = {
80
80
  index: number;
81
81
  field: string;
82
82
  };
83
+ export type GetRowKey<RecordType> = (record: RecordType, index?: number) => Key;
83
84
  export type ColumnTable<RecordType = AnyObject> = {
84
85
  field: string;
85
86
  width?: number;
@@ -200,6 +201,7 @@ export type TableProps<RecordType = AnyObject> = {
200
201
  title?: ReactNode | ((data: RecordType) => ReactNode);
201
202
  fullScreenTitle?: ReactNode | (() => ReactNode);
202
203
  editAble?: boolean;
204
+ rowKey?: string;
203
205
  infiniteScroll?: boolean;
204
206
  next?: () => void;
205
207
  locale?: Locale;
@@ -27,12 +27,9 @@ export const ColumnsGroup = props => {
27
27
  const menuRef = useRef();
28
28
  const [tempGroup, setTempGroup] = useState([]);
29
29
  const [clicked, setClicked] = useState(false);
30
- console.log('columns', columns);
31
- console.log('columnsGrouped', columnsGrouped);
32
30
  const rsCol = React.useMemo(() => {
33
31
  return columns.filter(it => it.visible !== false && !tempGroup.includes(it.field) && it.field !== '#' && it.field !== 'selection_column' && it.field !== 'command');
34
32
  }, [columns, tempGroup]);
35
- console.log('rsCol', rsCol);
36
33
  const options = React.useMemo(() => {
37
34
  return rsCol.map(it => ({
38
35
  ...it,
@@ -225,6 +222,7 @@ export const ColumnsGroup = props => {
225
222
  title: 'Nhóm dữ liệu'
226
223
  }, /*#__PURE__*/React.createElement(Group, {
227
224
  fontSize: 18,
225
+ color: "#555555",
228
226
  style: {
229
227
  cursor: 'pointer'
230
228
  }
@@ -5,21 +5,15 @@ import 'react-resizable/css/styles.css';
5
5
  import dayjs from 'dayjs';
6
6
  import 'dayjs/locale/es';
7
7
  import 'dayjs/locale/vi';
8
-
9
- // import './style.scss'
10
-
11
8
  import { faker } from '@faker-js/faker';
12
9
  import useMergedState from "rc-util/es/hooks/useMergedState";
13
10
  import { getCoreRowModel, getExpandedRowModel, getGroupedRowModel, getPaginationRowModel, useReactTable } from '@tanstack/react-table';
14
11
  import { addRowIdArray, convertFlatColumn1, convertToObj, convertToObjTrue, filterDataByColumns, findAllChildrenKeys2, flatColumns2, getAllRowKey, getDiffent2Array, getFixedFields, getInvisibleColumns, groupArrayByColumns, isTreeArray, removeKeys } from "./hook/utils";
15
12
  import { convertToTanStackColumns } from "./hook/useColumns";
16
- // import { convertColumns } from './hook/convert'
17
13
  import { removeInvisibleColumns } from "../grid-component/hooks";
18
14
  import Grid from "./table/Grid";
19
15
  import { removeColumns } from "../table-component/hook/utils";
20
16
  import { OperatorFeature } from "../table-component/features/operator";
21
- // import { ColumnsGroup } from '../grid-component/ColumnsGroup'
22
-
23
17
  dayjs.extend(customParseFormat);
24
18
  export const SELECTION_COLUMN = {};
25
19
  const InternalTable = props => {
@@ -126,24 +120,6 @@ const InternalTable = props => {
126
120
  // setColumns(updateWidthsByOther(propsColumns, columns))
127
121
  setColumns(propsColumns);
128
122
  }, [propsColumns]);
129
-
130
- // const convertData = React.useMemo(() => {
131
-
132
- // if (groupAble && groupSetting && groupSetting.client !== false) {
133
-
134
- // const bbc = addRowIdArray(dataSource)
135
-
136
- // const abc = groupArrayByColumns(bbc, groupColumns)
137
-
138
- // return abc
139
- // } else {
140
-
141
- // return addRowIdArray(dataSource)
142
-
143
- // }
144
-
145
- // }, [dataSource, groupAble, groupColumns, groupSetting])
146
-
147
123
  const mergedColumns = React.useMemo(() => {
148
124
  return convertToTanStackColumns({
149
125
  t,
@@ -151,8 +127,6 @@ const InternalTable = props => {
151
127
  format,
152
128
  editAble
153
129
  });
154
-
155
- // return convertToTanStackColumns<RecordType>(columns)
156
130
  }, [t, columns, format, editAble]);
157
131
  const isDataTree = React.useMemo(() => {
158
132
  return isTreeArray(tableData);
@@ -191,8 +165,12 @@ const InternalTable = props => {
191
165
 
192
166
  React.useEffect(() => {
193
167
  const a = getInvisibleColumns(columns);
194
- setColumnVisibility(a);
195
- }, [columns]);
168
+ const bcd = convertToObj(groupColumns);
169
+ setColumnVisibility({
170
+ ...a,
171
+ ...bcd
172
+ });
173
+ }, [columns, groupColumns]);
196
174
  const [columnsHiddenKeys, setColumnsHiddenKeys] = useMergedState(undefined, {
197
175
  value: undefined
198
176
  });
@@ -1,7 +1,5 @@
1
1
  import { flexRender } from "@tanstack/react-table";
2
2
  import Space from "rc-master-ui/es/space";
3
- // import Command from "../components/command/Command";
4
-
5
3
  import ReactDOMServer from 'react-dom/server';
6
4
  import { getCommonPinningStyles } from "../hook/utils";
7
5
  import Checkbox from "rc-master-ui/es/checkbox/Checkbox";
@@ -61,7 +59,6 @@ const renderCommand = args => {
61
59
  onClick: () => {
62
60
  commandClick?.({
63
61
  id: item.id,
64
- // rowId: getRowKey(record, index) as any,
65
62
  rowId: record.rowId,
66
63
  rowData: record,
67
64
  index: cell.row.index,
@@ -186,12 +183,6 @@ const TableBodyCell = props => {
186
183
  const isLastLeftPinnedColumn = isPinned === "left" && cell.column.getIsLastColumn("left");
187
184
  const isFirstRightPinnedColumn = isPinned === "right" && cell.column.getIsFirstColumn("right");
188
185
  const enableClick = typeof columnMeta.allowSelection === 'function' ? columnMeta.allowSelection(record) : columnMeta.allowSelection;
189
-
190
- // const firstVisibleNormalColumn = table.getVisibleLeafColumns().filter(col => col.id !== 'selection' && col.id !== '#')[0];
191
- // const firstVisibleNormalColumn = table.getVisibleLeafColumns().filter(col => col.id !== 'selection' && col.id !== '#')[0];
192
-
193
- // const parrents = cell.row.getParentRows();
194
-
195
186
  if (cell.column.id === "#") {
196
187
  return /*#__PURE__*/React.createElement("td", {
197
188
  key: cell.id,
@@ -1,5 +1,4 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- // import type { VirtualItem, Virtualizer } from "@tanstack/react-virtual"
3
2
  import TableBodyCell from "./TableBodyCell";
4
3
  import { flexRender } from "@tanstack/react-table";
5
4
  import React from "react";
@@ -67,9 +66,6 @@ const TableBodyRow = ({
67
66
  field
68
67
  } = row.original ?? {};
69
68
  const cellGroup = allCells.find(it => it.column.id === field);
70
-
71
- // const header = allColumns.find((it) => it.id === field)
72
-
73
69
  const headerContext = cellGroup && groupSetting?.showHeaderColumn !== false ? {
74
70
  table,
75
71
  column: cellGroup.column,