es-grid-template 1.8.66 → 1.8.68

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 (177) hide show
  1. package/es/grid-component/hooks/constant.d.ts +1 -0
  2. package/es/grid-component/hooks/constant.js +2 -1
  3. package/es/grid-component/hooks/useLazyKVMap.d.ts +1 -1
  4. package/es/grid-component/hooks/utils.d.ts +1 -1
  5. package/es/grid-component/index.d.ts +1 -1
  6. package/es/grid-component/type.d.ts +567 -0
  7. package/es/grid-component/type.js +1 -490
  8. package/es/table-component/ColumnsChoose.d.ts +1 -1
  9. package/es/table-component/ColumnsChoose.js +0 -2
  10. package/es/table-component/ContextMenu.d.ts +1 -2
  11. package/es/table-component/ContextMenu.js +0 -1
  12. package/es/table-component/InternalTable.d.ts +1 -2
  13. package/es/table-component/InternalTable.js +1 -32
  14. package/es/table-component/TableContainer.d.ts +1 -1
  15. package/es/table-component/TableContainer.js +4 -2
  16. package/es/table-component/TableContainerEdit.d.ts +1 -1
  17. package/es/table-component/TableContainerEdit.js +6 -129
  18. package/es/table-component/body/EditableCell.d.ts +1 -1
  19. package/es/table-component/body/EditableCell.js +1 -18
  20. package/es/table-component/body/TableBody.d.ts +1 -1
  21. package/es/table-component/body/TableBodyCell.d.ts +1 -1
  22. package/es/table-component/body/TableBodyCellEdit.d.ts +1 -1
  23. package/es/table-component/body/TableBodyCellEdit.js +2 -9
  24. package/es/table-component/body/TableBodyRow.d.ts +1 -1
  25. package/es/table-component/components/ControlCheckbox.d.ts +1 -1
  26. package/es/table-component/components/EditForm/EditForm.js +0 -1
  27. package/es/table-component/components/InputControl/InputControl.js +0 -3
  28. package/es/table-component/components/async-select/index.d.ts +1 -1
  29. package/es/table-component/components/async-select/index.js +0 -3
  30. package/es/table-component/components/async-table-select/index.d.ts +1 -1
  31. package/es/table-component/components/async-table-select/index.js +0 -4
  32. package/es/table-component/components/checkbox-filter/CheckboxFilter.js +6 -2
  33. package/es/table-component/components/checkbox-filter/FilterSearch.d.ts +1 -1
  34. package/es/table-component/components/checkbox-filter/FilterSearch.js +1 -1
  35. package/es/table-component/components/command/Command.d.ts +1 -1
  36. package/es/table-component/components/number/index.d.ts +3 -2
  37. package/es/table-component/components/number/index.js +0 -8
  38. package/es/table-component/components/number-range/index.d.ts +3 -2
  39. package/es/table-component/components/number-range/index.js +0 -3
  40. package/es/table-component/footer/TableFooterRow.js +1 -22
  41. package/es/table-component/header/TableHead.js +0 -20
  42. package/es/table-component/header/TableHeadCell.js +1 -15
  43. package/es/table-component/header/TableHeadCell2.js +5 -3
  44. package/es/table-component/header/TableHeadGroupCell.js +0 -23
  45. package/es/table-component/header/renderFilter.d.ts +1 -1
  46. package/es/table-component/hook/useColumns.d.ts +1 -1
  47. package/es/table-component/hook/useFilterOperator.d.ts +2 -2
  48. package/es/table-component/hook/utils.d.ts +1 -1
  49. package/es/table-component/hook/utils.js +0 -3
  50. package/es/table-component/index.d.ts +1 -1
  51. package/es/table-component/index.js +0 -3
  52. package/es/table-component/table/Grid.d.ts +1 -1
  53. package/es/table-component/table/Grid.js +0 -5
  54. package/es/table-component/table/TableWrapper.d.ts +1 -1
  55. package/es/table-component/useContext.d.ts +2 -1
  56. package/es/table-virtuoso/InternalTable.d.ts +1 -1
  57. package/es/table-virtuoso/InternalTable.js +2 -1
  58. package/es/table-virtuoso/body/TableBodyCell.d.ts +1 -1
  59. package/es/table-virtuoso/body/TableBodyCell.js +1 -1
  60. package/es/table-virtuoso/body/TableBodyRow.d.ts +2 -2
  61. package/es/table-virtuoso/body/TableBodyRow.js +3 -1
  62. package/es/table-virtuoso/header/TableHeadCell.js +1 -3
  63. package/es/table-virtuoso/header/renderFilter.d.ts +1 -1
  64. package/es/table-virtuoso/header/renderFilter.js +0 -4
  65. package/es/table-virtuoso/hook/utils.d.ts +1 -1
  66. package/es/table-virtuoso/style.js +1 -1
  67. package/es/table-virtuoso/table/Grid.d.ts +1 -1
  68. package/es/table-virtuoso/table/Grid.js +0 -24
  69. package/es/table-virtuoso/table/TableContainer.d.ts +1 -1
  70. package/es/table-virtuoso/table/TableContainer.js +0 -2
  71. package/es/table-virtuoso/table/TableWrapper.d.ts +1 -1
  72. package/es/table-virtuoso/table/TableWrapper.js +3 -19
  73. package/es/table-virtuoso/useContext.d.ts +1 -1
  74. package/lib/grid-component/hooks/constant.d.ts +1 -0
  75. package/lib/grid-component/hooks/constant.js +3 -2
  76. package/lib/grid-component/hooks/useLazyKVMap.d.ts +1 -1
  77. package/lib/grid-component/hooks/utils.d.ts +1 -1
  78. package/lib/grid-component/index.d.ts +1 -1
  79. package/lib/grid-component/type.d.ts +567 -0
  80. package/lib/grid-component/type.js +4 -490
  81. package/lib/table-component/ColumnsChoose.d.ts +1 -1
  82. package/lib/table-component/ColumnsChoose.js +0 -2
  83. package/lib/table-component/ContextMenu.d.ts +1 -2
  84. package/lib/table-component/ContextMenu.js +0 -2
  85. package/lib/table-component/InternalTable.d.ts +1 -2
  86. package/lib/table-component/InternalTable.js +1 -28
  87. package/lib/table-component/TableContainer.d.ts +1 -1
  88. package/lib/table-component/TableContainer.js +4 -2
  89. package/lib/table-component/TableContainerEdit.d.ts +1 -1
  90. package/lib/table-component/TableContainerEdit.js +5 -128
  91. package/lib/table-component/body/EditableCell.d.ts +1 -1
  92. package/lib/table-component/body/EditableCell.js +0 -10
  93. package/lib/table-component/body/TableBody.d.ts +1 -1
  94. package/lib/table-component/body/TableBodyCell.d.ts +1 -1
  95. package/lib/table-component/body/TableBodyCellEdit.d.ts +1 -1
  96. package/lib/table-component/body/TableBodyCellEdit.js +5 -11
  97. package/lib/table-component/body/TableBodyRow.d.ts +1 -1
  98. package/lib/table-component/components/ControlCheckbox.d.ts +1 -1
  99. package/lib/table-component/components/EditForm/EditForm.js +0 -2
  100. package/lib/table-component/components/InputControl/InputControl.js +0 -4
  101. package/lib/table-component/components/async-select/index.d.ts +1 -1
  102. package/lib/table-component/components/async-select/index.js +0 -2
  103. package/lib/table-component/components/async-table-select/index.d.ts +1 -1
  104. package/lib/table-component/components/async-table-select/index.js +0 -4
  105. package/lib/table-component/components/checkbox-filter/CheckboxFilter.js +6 -2
  106. package/lib/table-component/components/checkbox-filter/FilterSearch.d.ts +1 -1
  107. package/lib/table-component/components/checkbox-filter/FilterSearch.js +1 -1
  108. package/lib/table-component/components/command/Command.d.ts +1 -1
  109. package/lib/table-component/components/number/index.d.ts +3 -2
  110. package/lib/table-component/components/number/index.js +0 -8
  111. package/lib/table-component/components/number-range/index.d.ts +3 -2
  112. package/lib/table-component/components/number-range/index.js +0 -3
  113. package/lib/table-component/footer/TableFooterRow.js +1 -23
  114. package/lib/table-component/header/TableHead.js +0 -21
  115. package/lib/table-component/header/TableHeadCell.js +4 -18
  116. package/lib/table-component/header/TableHeadCell2.js +8 -6
  117. package/lib/table-component/header/TableHeadGroupCell.js +0 -23
  118. package/lib/table-component/header/renderFilter.d.ts +1 -1
  119. package/lib/table-component/hook/useColumns.d.ts +1 -1
  120. package/lib/table-component/hook/useFilterOperator.d.ts +2 -2
  121. package/lib/table-component/hook/utils.d.ts +1 -1
  122. package/lib/table-component/hook/utils.js +0 -4
  123. package/lib/table-component/index.d.ts +1 -1
  124. package/lib/table-component/index.js +0 -1
  125. package/lib/table-component/table/Grid.d.ts +1 -1
  126. package/lib/table-component/table/Grid.js +0 -4
  127. package/lib/table-component/table/TableWrapper.d.ts +1 -1
  128. package/lib/table-component/useContext.d.ts +2 -1
  129. package/lib/table-virtuoso/InternalTable.d.ts +1 -1
  130. package/lib/table-virtuoso/InternalTable.js +3 -1
  131. package/lib/table-virtuoso/body/TableBodyCell.d.ts +1 -1
  132. package/lib/table-virtuoso/body/TableBodyCell.js +1 -1
  133. package/lib/table-virtuoso/body/TableBodyRow.d.ts +2 -2
  134. package/lib/table-virtuoso/body/TableBodyRow.js +3 -1
  135. package/lib/table-virtuoso/header/TableHeadCell.js +4 -6
  136. package/lib/table-virtuoso/header/renderFilter.d.ts +1 -1
  137. package/lib/table-virtuoso/header/renderFilter.js +0 -4
  138. package/lib/table-virtuoso/hook/utils.d.ts +1 -1
  139. package/lib/table-virtuoso/style.js +1 -1
  140. package/lib/table-virtuoso/table/Grid.d.ts +1 -1
  141. package/lib/table-virtuoso/table/Grid.js +0 -24
  142. package/lib/table-virtuoso/table/TableContainer.d.ts +1 -1
  143. package/lib/table-virtuoso/table/TableContainer.js +0 -2
  144. package/lib/table-virtuoso/table/TableWrapper.d.ts +1 -1
  145. package/lib/table-virtuoso/table/TableWrapper.js +3 -19
  146. package/lib/table-virtuoso/useContext.d.ts +1 -1
  147. package/package.json +1 -1
  148. package/es/table-component/hook/constant.d.ts +0 -73
  149. package/es/table-component/hook/constant.js +0 -240
  150. package/es/table-component/type.d.ts +0 -567
  151. package/es/table-component/type.js +0 -1
  152. package/es/table-virtuoso/hook/constant.d.ts +0 -73
  153. package/es/table-virtuoso/hook/constant.js +0 -240
  154. package/es/table-virtuoso/hook/convert.d.ts +0 -1
  155. package/es/table-virtuoso/hook/convert.js +0 -28
  156. package/es/table-virtuoso/hook/useColumns.d.ts +0 -28
  157. package/es/table-virtuoso/hook/useColumns.js +0 -302
  158. package/es/table-virtuoso/hook/useFilterOperator.d.ts +0 -7
  159. package/es/table-virtuoso/hook/useFilterOperator.js +0 -33
  160. package/es/table-virtuoso/style.scss +0 -1441
  161. package/es/table-virtuoso/type.d.ts +0 -0
  162. package/es/table-virtuoso/type.js +0 -785
  163. package/lib/table-component/hook/constant.d.ts +0 -73
  164. package/lib/table-component/hook/constant.js +0 -247
  165. package/lib/table-component/type.d.ts +0 -567
  166. package/lib/table-component/type.js +0 -5
  167. package/lib/table-virtuoso/hook/constant.d.ts +0 -73
  168. package/lib/table-virtuoso/hook/constant.js +0 -247
  169. package/lib/table-virtuoso/hook/convert.d.ts +0 -1
  170. package/lib/table-virtuoso/hook/convert.js +0 -34
  171. package/lib/table-virtuoso/hook/useColumns.d.ts +0 -28
  172. package/lib/table-virtuoso/hook/useColumns.js +0 -315
  173. package/lib/table-virtuoso/hook/useFilterOperator.d.ts +0 -7
  174. package/lib/table-virtuoso/hook/useFilterOperator.js +0 -40
  175. package/lib/table-virtuoso/style.scss +0 -1441
  176. package/lib/table-virtuoso/type.d.ts +0 -0
  177. package/lib/table-virtuoso/type.js +0 -786
@@ -13,7 +13,7 @@ import { TableContext } from "./useContext";
13
13
  import { yupResolver } from "@hookform/resolvers/yup";
14
14
  import { Toolbar } from "rc-master-ui";
15
15
  import classNames from "classnames";
16
- import { Maximize, Minimize, Plus, Trash2 } from "becoxy-icons";
16
+ import { Maximize, Minimize } from "becoxy-icons";
17
17
  import { ColumnsChoose } from "./ColumnsChoose";
18
18
  import TableWrapper from "./table/TableWrapper";
19
19
  import withReactContent from "sweetalert2-react-content";
@@ -77,7 +77,7 @@ const TableContainerEdit = props => {
77
77
  isSelectionChange,
78
78
  setIsSelectionChange,
79
79
  // onContextMenu,
80
- contextMenuItems: propsContext,
80
+ contextMenuItems,
81
81
  setSorterChange,
82
82
  setFilterChange,
83
83
  onCellPaste,
@@ -117,7 +117,6 @@ const TableContainerEdit = props => {
117
117
  contextMenuOpen,
118
118
  contextMenuClick,
119
119
  contextMenuHidden,
120
- showDefaultContext,
121
120
  commandSettings,
122
121
  isDataTree,
123
122
  onCellClick,
@@ -126,7 +125,8 @@ const TableContainerEdit = props => {
126
125
  columnSizing,
127
126
  columnSizingInfo,
128
127
  rowClassName,
129
- onRowStyles
128
+ onRowStyles,
129
+ dataSourceFilter
130
130
  } = props;
131
131
  const containerRef = React.useRef(null);
132
132
  const bottomToolbarRef = React.useRef(null);
@@ -141,123 +141,6 @@ const TableContainerEdit = props => {
141
141
 
142
142
  // const columnSizingState = table.getState().columnSizing;
143
143
 
144
- const defaultContext = React.useMemo(() => {
145
- return [{
146
- key: 'INSERT_BEFORE',
147
- // label: 'Thêm dòng bên trên',
148
- // label: `${t ? t(locale?.add_rows_before ?? 'Add rows before') : 'Add rows before'}`,
149
- label: locale?.add_rows_before ?? 'Add rows before',
150
- icon: /*#__PURE__*/React.createElement(Plus, {
151
- fontSize: 14
152
- }),
153
- children: [{
154
- parentKey: 'INSERT_BEFORE',
155
- key: 'INSERT_BEFORE_1',
156
- label: locale?.add_1 ?? 'Add 1 rows',
157
- row: 1
158
- }, {
159
- parentKey: 'INSERT_BEFORE',
160
- key: 'INSERT_BEFORE_10',
161
- label: locale?.add_10 ?? 'Add 10 rows',
162
- row: 10
163
- }, {
164
- parentKey: 'INSERT_BEFORE',
165
- key: 'INSERT_BEFORE_50',
166
- label: locale?.add_50 ?? 'Add 50 rows',
167
- row: 50
168
- }, {
169
- parentKey: 'INSERT_BEFORE',
170
- key: 'INSERT_BEFORE_100',
171
- label: locale?.add_100 ?? 'Add 100 rows',
172
- row: 100
173
- }, {
174
- parentKey: 'INSERT_BEFORE',
175
- key: 'INSERT_BEFORE_ADV',
176
- label: locale?.custom ?? 'Custom'
177
- }]
178
- }, {
179
- key: 'INSERT_AFTER',
180
- label: locale?.add_rows_after ?? 'Add rows after',
181
- icon: /*#__PURE__*/React.createElement(Plus, {
182
- fontSize: 14
183
- }),
184
- children: [{
185
- parentKey: 'INSERT_AFTER',
186
- key: 'INSERT_AFTER_1',
187
- label: locale?.add_1 ?? 'Add 1 rows',
188
- row: 1
189
- }, {
190
- parentKey: 'INSERT_AFTER',
191
- key: 'INSERT_AFTER_10',
192
- label: locale?.add_10 ?? 'Add 10 rows',
193
- row: 10
194
- }, {
195
- parentKey: 'INSERT_AFTER',
196
- key: 'INSERT_AFTER_50',
197
- label: locale?.add_50 ?? 'Add 50 rows',
198
- row: 50
199
- }, {
200
- parentKey: 'INSERT_AFTER',
201
- key: 'INSERT_AFTER_100',
202
- label: locale?.add_100 ?? 'Add 100 rows',
203
- row: 100
204
- }, {
205
- parentKey: 'INSERT_AFTER',
206
- key: 'INSERT_AFTER_ADV',
207
- label: locale?.custom ?? 'Custom'
208
- }]
209
- }, {
210
- key: 'INSERT_CHILDREN',
211
- // label: 'Insert item children',
212
- label: locale?.add_children ?? 'Add children',
213
- icon: /*#__PURE__*/React.createElement(Plus, {
214
- fontSize: 14
215
- })
216
- // children: [
217
- // {
218
- // parentKey: 'INSERT_AFTER',
219
- // key: 'INSERT_AFTER_1',
220
- // label: 'Thêm 1 dòng',
221
- // row: 1
222
- // },
223
- // {
224
- // parentKey: 'INSERT_AFTER',
225
- // key: 'INSERT_AFTER_10',
226
- // label: 'Thêm 10 dòng',
227
- // row: 10
228
- // },
229
- // {
230
- // parentKey: 'INSERT_AFTER',
231
- // key: 'INSERT_AFTER_50',
232
- // label: 'Thêm 50 dòng',
233
- // row: 50
234
- // },
235
- // {
236
- // parentKey: 'INSERT_AFTER',
237
- // key: 'INSERT_AFTER_100',
238
- // label: 'Thêm 100 dòng',
239
- // row: 100
240
- // },
241
- // {
242
- // parentKey: 'INSERT_AFTER',
243
- // key: 'INSERT_AFTER_ADV',
244
- // label: 'Tùy chỉnh'
245
- // }
246
- // ]
247
- }, {
248
- key: 'DELETE_CONTENT',
249
- label: locale?.delete_content ?? 'Delete content',
250
- icon: /*#__PURE__*/React.createElement(Trash2, {
251
- fontSize: 14
252
- })
253
- }, {
254
- key: 'DELETE_ROWS',
255
- label: locale?.delete_rows ?? 'Delete rows',
256
- icon: /*#__PURE__*/React.createElement(Trash2, {
257
- fontSize: 14
258
- })
259
- }];
260
- }, [locale]);
261
144
  const itemsAdd = React.useMemo(() => {
262
145
  return [{
263
146
  key: '10',
@@ -270,13 +153,6 @@ const TableContainerEdit = props => {
270
153
  label: `100 ${t ? t('rows') : 'rows'}`
271
154
  }];
272
155
  }, [t]);
273
- const contextMenuItems = React.useMemo(() => {
274
- const a = showDefaultContext !== false ? [...defaultContext] : [];
275
- const b = propsContext && propsContext.length > 0 ? [...propsContext, {
276
- type: 'divider'
277
- }] : [];
278
- return [...b, ...a];
279
- }, [defaultContext, propsContext, showDefaultContext]);
280
156
  const [dataErrors, setDataErrors] = React.useState([]);
281
157
  React.useEffect(() => {
282
158
  if (validate && dataSource && dataSource.length) {
@@ -2026,7 +1902,8 @@ const TableContainerEdit = props => {
2026
1902
  pagination,
2027
1903
  rowClassName,
2028
1904
  rowEditable,
2029
- onRowStyles
1905
+ onRowStyles,
1906
+ dataSourceFilter
2030
1907
  }
2031
1908
  }, /*#__PURE__*/React.createElement(TableWrapper, {
2032
1909
  contextMenuItems: contextMenuItems,
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import type { EditType } from "rc-master-ui";
3
- import type { ColumnTable, IFormat } from "../type";
3
+ import type { ColumnTable, IFormat } from "../../grid-component/type";
4
4
  interface EditableCellProps<DataType> extends React.HTMLAttributes<HTMLElement> {
5
5
  t?: any;
6
6
  dataIndex: string;
@@ -1,24 +1,9 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import React, { useContext } from "react";
3
3
  import { ColorPicker, DatePicker, Divider, Input, TimePicker, Row, Col } from "antd";
4
- // import type {ColumnTable, ColumnSelectTable, IFormat} from "./type"
5
-
6
- import { checkDecimalSeparator, checkThousandSeparator, checkFieldKey, convertArrayWithIndent, convertDateToDayjs,
7
- // convertDayjsToDate,
8
- convertLabelToTitle,
9
- // customWeekStartEndFormat,
10
- getDatepickerFormat,
11
- // getTemplate,
12
- isDisable, isEmpty, isNullOrUndefined, customWeekStartEndFormat, convertDayjsToDate, parseBooleanToValue, isColor, genPresets, getFormat
13
- // isEditable,
14
- // convertDayjsToDate
15
- } from "../hook/utils";
16
- // import moment from "moment";
17
- // import dayjs from "dayjs";
18
- // import {TreeSelect} from "antd";
4
+ import { checkDecimalSeparator, checkThousandSeparator, checkFieldKey, convertArrayWithIndent, convertDateToDayjs, convertLabelToTitle, getDatepickerFormat, isDisable, isEmpty, isNullOrUndefined, customWeekStartEndFormat, convertDayjsToDate, parseBooleanToValue, isColor, genPresets, getFormat } from "../hook/utils";
19
5
  import classNames from "classnames";
20
6
  import { NumericFormat } from "react-numeric-component";
21
- // import {TableContext} from "./useContext"
22
7
  import dayjs from "dayjs";
23
8
  import moment from "moment";
24
9
  import { Controller } from "react-hook-form";
@@ -28,8 +13,6 @@ import { AsyncTableSelect } from "../components/async-table-select";
28
13
  import { cyan, green, red, blue } from '@ant-design/colors';
29
14
  import { EditForm } from "../components/EditForm";
30
15
  import { TableContext } from "../useContext";
31
- // import moment from "moment";
32
-
33
16
  const {
34
17
  SHOW_PARENT
35
18
  } = TreeSelect;
@@ -1,5 +1,5 @@
1
1
  import { type Table } from "@tanstack/react-table";
2
- import type { CommandClick } from "../type";
2
+ import type { CommandClick } from "../../grid-component/type";
3
3
  import React from "react";
4
4
  interface TableBodyProps<T> {
5
5
  table: Table<T>;
@@ -1,5 +1,5 @@
1
1
  import type { Cell, Table } from "@tanstack/react-table";
2
- import type { CommandClick } from "../type";
2
+ import type { CommandClick } from "../../grid-component/type";
3
3
  import React from "react";
4
4
  import type { VirtualItem, Virtualizer } from "@tanstack/react-virtual";
5
5
  interface TableBodyCellProps<T> {
@@ -1,5 +1,5 @@
1
1
  import type { Cell, Table } from "@tanstack/react-table";
2
- import type { CommandClick } from "../type";
2
+ import type { CommandClick } from "../../grid-component/type";
3
3
  import React from "react";
4
4
  import type { VirtualItem, Virtualizer } from "@tanstack/react-virtual";
5
5
  interface TableBodyCellProps<T> {
@@ -2,21 +2,14 @@ import { flexRender } from "@tanstack/react-table";
2
2
  import Space from "rc-master-ui/es/space";
3
3
  import Command from "../components/command/Command";
4
4
  import ReactDOMServer from 'react-dom/server';
5
- import { addRowsDown, addRowsDownWithCtrl, addRowsUp, addRowsUpWithCtrl, findFirst, flattenArray, flattenData,
6
- // getCellsByPosition,
7
- getColIdsBetween, getCommonPinningStyles, getEditType, getRowIdsBetween, getSelectedCellMatrix, isEditable, isObjEmpty, isObjEqual, newGuid, unFlattenData, updateOrInsert } from "../hook/utils";
8
- // import { nonActionColumn } from "../hook/constant";
5
+ import { addRowsDown, addRowsDownWithCtrl, addRowsUp, addRowsUpWithCtrl, findFirst, flattenArray, flattenData, getColIdsBetween, getCommonPinningStyles, getEditType, getRowIdsBetween, getSelectedCellMatrix, isEditable, isObjEmpty, isObjEqual, newGuid, unFlattenData, updateOrInsert } from "../hook/utils";
9
6
  import Checkbox from "rc-master-ui/es/checkbox/Checkbox";
10
7
  import classNames from "classnames";
11
- // import type { Dispatch, SetStateAction } from "react";
12
-
13
8
  import React from "react";
14
9
  import { TableContext } from "../useContext";
15
10
  import EditableCell from "./EditableCell";
16
- import { nonActionColumn } from "../hook/constant";
11
+ import { nonActionColumn } from "../../grid-component/hooks";
17
12
  import { toggleRowSelection } from "../hook/useColumns";
18
- // import { nonActionColumn } from "../hook/constant";
19
-
20
13
  const renderCellIndex = props => {
21
14
  const {
22
15
  parrents,
@@ -1,6 +1,6 @@
1
1
  import type { VirtualItem, Virtualizer } from "@tanstack/react-virtual";
2
2
  import { type Column, type Row, type Table } from "@tanstack/react-table";
3
- import type { CommandClick } from "../type";
3
+ import type { CommandClick } from "../../grid-component/type";
4
4
  import React from "react";
5
5
  interface TableBodyRowProps<T> {
6
6
  tableId: string;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import type { ColumnTable } from "../type";
2
+ import type { ColumnTable } from "../../grid-component/type";
3
3
  type Props = {
4
4
  column: ColumnTable;
5
5
  record?: any;
@@ -3,7 +3,6 @@ import styled from "styled-components";
3
3
  import { useForm } from "react-hook-form";
4
4
  import { yupResolver } from "@hookform/resolvers/yup";
5
5
  import { Col, Row } from "rc-master-ui/es/grid";
6
- // import InputControl from "../control/InputControl/InputControl";
7
6
  import { isNullOrUndefined, isObjEmpty } from "../../hook/utils";
8
7
  import { Input } from "rc-master-ui";
9
8
  import { Dropdown } from "antd";
@@ -4,11 +4,8 @@ import { Input } from "rc-master-ui";
4
4
  import { Typography } from "antd";
5
5
  import classnames from "classnames";
6
6
  import React, { Fragment } from "react";
7
- // import {isNullOrUndefined} from "../../hooks";
8
7
  import { Col, Row } from "rc-master-ui/es/grid";
9
8
  import { isNullOrUndefined } from "../../hook/utils";
10
- // import {isNullOrUndefined} from "../../../hooks"
11
-
12
9
  const {
13
10
  Text
14
11
  } = Typography;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { BaseOptionType, DefaultOptionType } from "rc-select/lib/Select";
3
3
  import type { SelectProps } from "rc-master-ui/es/select";
4
- import type { LoadOptionsArgs } from '../../type';
4
+ import type { LoadOptionsArgs } from '../../../grid-component/type';
5
5
  export interface DebounceSelectProps<OptionType extends BaseOptionType = DefaultOptionType> extends SelectProps {
6
6
  loadOptions?: (search: string, callback: (newOptions: OptionType[]) => void, args?: LoadOptionsArgs) => void;
7
7
  debounceTimeout?: number;
@@ -2,9 +2,6 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import React, { useEffect, useMemo, useState } from 'react';
3
3
  import debounce from 'lodash/debounce';
4
4
  import { Select } from "rc-master-ui";
5
-
6
- // import type {LoadOptionsArgs} from "../type";
7
-
8
5
  export function AsyncSelect({
9
6
  loadOptions,
10
7
  debounceTimeout = 500,
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { BaseOptionType, DefaultOptionType } from "rc-select/lib/Select";
3
3
  import type { TableSelectProps } from "rc-master-ui";
4
- import type { LoadOptionsArgs } from '../../type';
4
+ import type { LoadOptionsArgs } from '../../../grid-component/type';
5
5
  export interface DebounceSelectProps<OptionType extends BaseOptionType = DefaultOptionType> extends TableSelectProps {
6
6
  loadOptions?: (search: string, callback: (newOptions: OptionType[]) => void, args?: LoadOptionsArgs) => void;
7
7
  debounceTimeout?: number;
@@ -2,10 +2,6 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import React, { useEffect, useMemo, useState } from 'react';
3
3
  import debounce from 'lodash/debounce';
4
4
  import { TableSelect } from "rc-master-ui";
5
- // import type {TableSelectProps} from "rc-master-ui/es/table-select"
6
-
7
- // import type {LoadOptionsArgs} from "../type";
8
-
9
5
  export function AsyncTableSelect({
10
6
  loadOptions,
11
7
  debounceTimeout = 500,
@@ -128,7 +128,7 @@ const CheckboxFilter = props => {
128
128
  }) => (filters || []).map((filter, index) => {
129
129
  const key = String(filter.value);
130
130
  const item = {
131
- title: filter.text,
131
+ title: filter.label,
132
132
  key: filter.value !== undefined ? key : String(index)
133
133
  };
134
134
  if (filter.children) {
@@ -213,7 +213,11 @@ const CheckboxFilter = props => {
213
213
  return filterSearch(searchValue, getFilterData(node));
214
214
  }
215
215
  return searchValueMatched(searchValue, node.title);
216
- } : undefined
216
+ } : undefined,
217
+ rootStyle: {
218
+ background: 'none',
219
+ boxShadow: 'none'
220
+ }
217
221
  })));
218
222
  }
219
223
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FilterSearch, {
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { FilterSearchType, TableLocale } from "antd/es/table/interface";
3
- import type { AnyObject } from '../../type';
3
+ import type { AnyObject } from '../../../grid-component/type';
4
4
  interface FilterSearchProps<RecordType = AnyObject> {
5
5
  value: string;
6
6
  onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import SearchOutlined from '@ant-design/icons/SearchOutlined';
3
3
  import { Input } from 'rc-master-ui';
4
4
 
5
- // import type {AnyObject} from "./type"
5
+ // import type {AnyObject} from "./../grid-component/type"
6
6
 
7
7
  const FilterSearch = props => {
8
8
  const {
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import type { CommandItem } from "../../type";
2
+ import type { CommandItem } from "../../../grid-component/type";
3
3
  type Props<T> = {
4
4
  id: string;
5
5
  record: T;
@@ -1,5 +1,6 @@
1
- import React, { KeyboardEventHandler } from "react";
2
- import type { IFormat } from "../../type";
1
+ import type { KeyboardEventHandler } from "react";
2
+ import React from "react";
3
+ import type { IFormat } from "../../../grid-component/type";
3
4
  type Props = {
4
5
  t?: any;
5
6
  format?: IFormat;
@@ -2,9 +2,6 @@ import React, { Fragment } from "react";
2
2
  import { NumericFormat } from "react-numeric-component";
3
3
  import { Input } from "rc-master-ui";
4
4
  import { checkDecimalSeparator, checkThousandSeparator } from "../../hook/utils";
5
- // import type {IFormat} from "../type"
6
- // import {checkDecimalSeparator, checkThousandSeparator} from "../hooks"
7
-
8
5
  const NumberInput = props => {
9
6
  const {
10
7
  t,
@@ -14,11 +11,6 @@ const NumberInput = props => {
14
11
  onPressEnter
15
12
  } = props;
16
13
  const values = React.useMemo(() => [value], [value]);
17
-
18
- // const [values, setValues] = React.useState<any[]>(() =>
19
- // mergedValues,
20
- // );
21
-
22
14
  return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(NumericFormat, {
23
15
  value: values[0] ?? ''
24
16
  // value={min}
@@ -1,5 +1,6 @@
1
- import React, { KeyboardEventHandler } from "react";
2
- import type { IFormat } from "../../type";
1
+ import type { KeyboardEventHandler } from "react";
2
+ import React from "react";
3
+ import type { IFormat } from "../../../grid-component/type";
3
4
  type Props = {
4
5
  t?: any;
5
6
  format?: IFormat;
@@ -2,9 +2,6 @@ import React, { Fragment } from "react";
2
2
  import { NumericFormat } from "react-numeric-component";
3
3
  import { Input } from "rc-master-ui";
4
4
  import { checkDecimalSeparator, checkThousandSeparator } from "../../hook/utils";
5
- // import type {IFormat} from "../type"
6
- // import {checkDecimalSeparator, checkThousandSeparator} from "../hooks"
7
-
8
5
  const NumberRange = props => {
9
6
  const {
10
7
  t,
@@ -1,33 +1,15 @@
1
- // import type { Virtualizer } from "@tanstack/react-virtual";
2
- // import type { Person } from "../makeData";
3
1
  import TableFooterCell from "./TableFooterCell";
4
2
  import React from "react";
5
3
  import { TableContext } from "../useContext";
6
- // import type { Person } from "../../tanstack-table/makeData";
7
- // import TableHeadCell from "./TableHeadCell";
8
-
9
4
  const TableFooterRow = ({
10
5
  table,
11
- // columnVirtualizer,
12
6
  headerGroup
13
- // virtualPaddingLeft,
14
- // virtualPaddingRight,
15
- // fixedLeftColumns,
16
- // fixedRightColumns,
17
- // virtualColumns,
18
- // columnVirtualizer
19
7
  }) => {
20
- // const virtualColumns = columnVirtualizer.getVirtualItems();
21
-
22
- // const a = table.getVisibleFlatColumns()
23
8
  const visibleColumns = table.getVisibleLeafColumns();
24
9
  const {
25
10
  onRowFooterStyles
26
11
  } = React.useContext(TableContext);
27
12
  const rowStyles = typeof onRowFooterStyles === 'function' ? onRowFooterStyles() : onRowFooterStyles;
28
-
29
- // const
30
-
31
13
  return /*#__PURE__*/React.createElement("div", {
32
14
  key: headerGroup.id,
33
15
  style: {
@@ -40,11 +22,8 @@ const TableFooterRow = ({
40
22
  className: "ui-rc-grid-footer-row"
41
23
  }, visibleColumns.map(header => {
42
24
  return /*#__PURE__*/React.createElement(TableFooterCell, {
43
- key: header.id
44
- // header={header as any}
45
- ,
25
+ key: header.id,
46
26
  column: header
47
- // columnVirtualizer={columnVirtualizer}
48
27
  });
49
28
  }));
50
29
  };
@@ -1,27 +1,10 @@
1
1
  import React, { useContext } from 'react';
2
2
  import { TableContext } from "../useContext";
3
- // import TableHeadRow from './TableHeadRow'
4
3
  import TableHeadCell2 from "./TableHeadCell2";
5
4
  import TableHeadGroupCell from "./TableHeadGroupCell";
6
- // import { getCommonPinningStyles } from '../hook/utils'
7
-
8
- // const getVisibleChildCount = <T,>(column: Column<T>): number => {
9
- // if (!column.columns?.length) return 0;
10
-
11
- // return column.columns.reduce((count: number, col: Column<T>) => {
12
- // const selfCount = col.getIsVisible() ? 1 : 0;
13
- // const childrenCount = getVisibleChildCount(col);
14
- // return count + selfCount + (childrenCount ? childrenCount - 1 : childrenCount);
15
- // }, 0);
16
- // }
17
-
18
5
  const TableHead = ({
19
6
  columnVirtualizer,
20
7
  table
21
- // virtualPaddingLeft,
22
- // virtualPaddingRight,
23
- // fixedLeftColumns,
24
- // fixedRightColumns
25
8
  }) => {
26
9
  const {
27
10
  prefix,
@@ -29,7 +12,6 @@ const TableHead = ({
29
12
  } = useContext(TableContext);
30
13
  const headerGroups = table.getFlatHeaders();
31
14
  const leafColumns = table.getVisibleFlatColumns();
32
- // const leafColumns11 = table.getIsAllColumnsVisible();
33
15
  const headerDepth = table.getHeaderGroups().length;
34
16
  const rowStyles = typeof onRowHeaderStyles === 'function' ? onRowHeaderStyles() : onRowHeaderStyles;
35
17
  return /*#__PURE__*/React.createElement("div", {
@@ -40,8 +22,6 @@ const TableHead = ({
40
22
  position: 'sticky',
41
23
  top: 0,
42
24
  zIndex: 1,
43
- // gridTemplateRows: `repeat(${table.getHeaderGroups().length}, auto)`,
44
- // gridTemplateColumns: `repeat(${table.getVisibleLeafColumns().length}, 1fr)`,
45
25
  gridTemplateColumns: `${table.getVisibleLeafColumns().map(n => `${n.getSize()}fr`).join(" ")}`
46
26
  }
47
27
  }, leafColumns.map(column => {
@@ -1,33 +1,19 @@
1
- // import { useSortable } from "@dnd-kit/sortable"
2
-
3
1
  import { flexRender } from '@tanstack/react-table';
4
2
  import React, { useContext } from 'react';
5
- // import { CSS } from '@dnd-kit/utilities'
6
- // import type { Virtualizer } from '@tanstack/react-virtual'
7
3
  import { Button, Space } from 'antd';
8
4
  import { ArrowDown, ArrowUp, FilterFill, SortCancel } from 'becoxy-icons';
9
5
  import classNames from 'classnames';
10
6
  import { Checkbox, Dropdown, Select } from 'rc-master-ui';
11
- import { booleanOperator, nonActionColumn, numberOperator, stringOperator, translateOption } from "../hook/constant";
7
+ import { booleanOperator, nonActionColumn, numberOperator, stringOperator, translateOption } from "../../grid-component/hooks";
12
8
  import { extendsObject, getCommonPinningStyles, getDefaultOperator, getTypeFilter } from "../hook/utils";
13
9
  import { TableContext } from "../useContext";
14
10
  import { renderFilter } from "./renderFilter";
15
11
  import ReactDOMServer from 'react-dom/server';
16
-
17
- // import { ColumnTable } from "../type";
18
-
19
- // import { Tooltip } from 'react-tooltip'
20
-
21
12
  const TableHeadCell = props => {
22
13
  const {
23
14
  header,
24
15
  getPopupContainer,
25
16
  table
26
- // t,
27
- // columnVirtualizer,
28
- // rowHeaderVirtualizer,
29
- // colSpan,
30
- // rowSpan
31
17
  } = props;
32
18
  const {
33
19
  t,
@@ -4,11 +4,11 @@ import { Button, Space } from 'antd';
4
4
  import { ArrowDown, ArrowUp, FilterFill, SortCancel } from 'becoxy-icons';
5
5
  import classNames from 'classnames';
6
6
  import { Checkbox, Dropdown, Select } from 'rc-master-ui';
7
- import { booleanOperator, nonActionColumn, numberOperator, stringOperator, translateOption } from "../hook/constant";
8
7
  import { excludeItems, extendsObject, getCommonPinningStyles, getDefaultOperator, getTypeFilter, removeDuplicatesByKey } from "../hook/utils";
9
8
  import { TableContext } from "../useContext";
10
9
  import { renderFilter } from "./renderFilter";
11
10
  import ReactDOMServer from 'react-dom/server';
11
+ import { booleanOperator, nonActionColumn, numberOperator, stringOperator, translateOption } from "../../grid-component/hooks";
12
12
  const TableHeadCell2 = props => {
13
13
  const {
14
14
  column,
@@ -30,7 +30,8 @@ const TableHeadCell2 = props => {
30
30
  setIsSelectionChange,
31
31
  id,
32
32
  locale,
33
- format
33
+ format,
34
+ dataSourceFilter
34
35
  } = useContext(TableContext);
35
36
  const isPinned = column.getIsPinned();
36
37
  const isLastLeftPinnedColumn = isPinned === 'left' && column.getIsLastColumn('left');
@@ -156,7 +157,8 @@ const TableHeadCell2 = props => {
156
157
  selectedKeys,
157
158
  setSelectedKeys,
158
159
  doFilter,
159
- format
160
+ format,
161
+ dataSourceFilter
160
162
 
161
163
  // selectedKeys: (column.getFilterValue() ?? []) as string[],
162
164
  // setSelectedKeys: column.setFilterValue,