es-grid-template 1.9.52 → 1.9.55

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 (122) hide show
  1. package/es/ali-table/Grid.d.ts +1 -0
  2. package/es/ali-table/Grid.js +12 -4
  3. package/es/ali-table/InternalTable.js +39 -7
  4. package/es/ali-table/base-table/html-table-default.d.ts +20 -0
  5. package/es/ali-table/base-table/html-table-default.js +224 -0
  6. package/es/ali-table/base-table/html-table-new.d.ts +20 -0
  7. package/es/ali-table/base-table/html-table-new.js +417 -0
  8. package/es/ali-table/base-table/html-table.js +324 -182
  9. package/es/ali-table/base-table/styles.d.ts +1 -0
  10. package/es/ali-table/base-table/styles.js +5 -4
  11. package/es/ali-table/base-table/table.d.ts +4 -0
  12. package/es/ali-table/base-table/table.js +24 -5
  13. package/es/ali-table/common-views.d.ts +1 -1
  14. package/es/ali-table/pipeline/features/columnCustom.js +3 -3
  15. package/es/ali-table/pipeline/features/pagination.js +1 -1
  16. package/es/ali-table/utils/convertColumnsChoose.d.ts +2 -2
  17. package/es/grid-component/control/InputControl/InputControl.js +2 -3
  18. package/es/grid-component/hooks/calender.d.ts +19 -0
  19. package/es/grid-component/hooks/calender.js +32 -0
  20. package/es/grid-component/type.d.ts +15 -2
  21. package/es/group-component/ColumnsChoose.js +1 -2
  22. package/es/group-component/ColumnsGroup/ColumnsGroup.js +1 -2
  23. package/es/group-component/TableContainerEdit.js +1 -2
  24. package/es/group-component/body/EditableCell.js +7 -6
  25. package/es/group-component/components/EditForm/EditForm.js +1 -2
  26. package/es/group-component/components/InputControl/InputControl.js +1 -2
  27. package/es/group-component/components/checkbox-filter/CheckboxFilter.js +1 -2
  28. package/es/group-component/components/checkbox-filter/FilterSearch.d.ts +1 -1
  29. package/es/group-component/components/checkbox-filter/FilterSearch.js +0 -3
  30. package/es/group-component/header/TableHeadCell.js +1 -2
  31. package/es/group-component/header/TableHeadCell2.js +1 -2
  32. package/es/group-component/hook/utils.d.ts +9 -9
  33. package/es/group-component/table/Grid.js +1 -1
  34. package/es/index.d.ts +2 -2
  35. package/es/index.js +1 -1
  36. package/es/table-component/ColumnsChoose.js +1 -1
  37. package/es/table-component/ColumnsConfig.d.ts +17 -0
  38. package/es/table-component/ColumnsConfig.js +302 -0
  39. package/es/table-component/ContextMenu.js +1 -1
  40. package/es/table-component/InternalTable.js +30 -9
  41. package/es/table-component/TableContainer.js +4 -2
  42. package/es/table-component/TableContainerEdit.js +3 -3
  43. package/es/table-component/body/EditableCell.js +9 -5
  44. package/es/table-component/body/TableBodyRow.js +0 -5
  45. package/es/table-component/components/EditForm/EditForm.js +1 -4
  46. package/es/table-component/components/InputControl/InputControl.js +1 -1
  47. package/es/table-component/components/checkbox-filter/CheckboxFilter.js +1 -2
  48. package/es/table-component/components/checkbox-filter/FilterSearch.d.ts +1 -1
  49. package/es/table-component/components/checkbox-filter/FilterSearch.js +4 -2
  50. package/es/table-component/header/TableHeadCell.js +1 -1
  51. package/es/table-component/header/TableHeadCell2.js +1 -1
  52. package/es/table-component/header/TableHeadRow.js +6 -6
  53. package/es/table-component/hook/useColumns.js +0 -1
  54. package/es/table-component/hook/utils.d.ts +3 -3
  55. package/es/table-component/hook/utils.js +35 -6
  56. package/es/table-component/style.js +1 -1
  57. package/es/table-component/table/Grid.js +2 -1
  58. package/es/table-virtuoso/InternalTable.js +2 -0
  59. package/es/table-virtuoso/body/TableBodyCell.js +11 -6
  60. package/lib/ali-table/Grid.d.ts +1 -0
  61. package/lib/ali-table/Grid.js +12 -4
  62. package/lib/ali-table/InternalTable.js +39 -7
  63. package/lib/ali-table/base-table/html-table-default.d.ts +20 -0
  64. package/lib/ali-table/base-table/html-table-default.js +231 -0
  65. package/lib/ali-table/base-table/html-table-new.d.ts +20 -0
  66. package/lib/ali-table/base-table/html-table-new.js +424 -0
  67. package/lib/ali-table/base-table/html-table.js +324 -182
  68. package/lib/ali-table/base-table/styles.d.ts +1 -0
  69. package/lib/ali-table/base-table/styles.js +5 -4
  70. package/lib/ali-table/base-table/table.d.ts +4 -0
  71. package/lib/ali-table/base-table/table.js +24 -5
  72. package/lib/ali-table/pipeline/features/columnCustom.js +4 -4
  73. package/lib/ali-table/pipeline/features/pagination.js +1 -1
  74. package/lib/ali-table/utils/convertColumnsChoose.d.ts +2 -2
  75. package/lib/grid-component/control/InputControl/InputControl.js +4 -6
  76. package/lib/grid-component/hooks/calender.d.ts +19 -0
  77. package/lib/grid-component/hooks/calender.js +40 -0
  78. package/lib/grid-component/type.d.ts +15 -2
  79. package/lib/group-component/ColumnsChoose.js +6 -7
  80. package/lib/group-component/ColumnsGroup/ColumnsGroup.js +3 -4
  81. package/lib/group-component/TableContainerEdit.js +2 -3
  82. package/lib/group-component/body/EditableCell.js +14 -13
  83. package/lib/group-component/components/EditForm/EditForm.js +1 -2
  84. package/lib/group-component/components/InputControl/InputControl.js +4 -6
  85. package/lib/group-component/components/checkbox-filter/CheckboxFilter.js +1 -2
  86. package/lib/group-component/components/checkbox-filter/FilterSearch.d.ts +1 -1
  87. package/lib/group-component/components/checkbox-filter/FilterSearch.js +0 -2
  88. package/lib/group-component/header/TableHeadCell.js +3 -4
  89. package/lib/group-component/header/TableHeadCell2.js +3 -4
  90. package/lib/group-component/hook/utils.d.ts +1 -1
  91. package/lib/group-component/table/Grid.js +2 -2
  92. package/lib/index.d.ts +2 -2
  93. package/lib/index.js +2 -2
  94. package/lib/table-component/ColumnsChoose.js +5 -5
  95. package/lib/table-component/ColumnsConfig.d.ts +17 -0
  96. package/lib/table-component/ColumnsConfig.js +312 -0
  97. package/lib/table-component/ContextMenu.js +3 -3
  98. package/lib/table-component/InternalTable.js +25 -8
  99. package/lib/table-component/TableContainer.js +4 -2
  100. package/lib/table-component/TableContainerEdit.js +5 -6
  101. package/lib/table-component/body/EditableCell.js +18 -15
  102. package/lib/table-component/body/TableBodyRow.js +0 -5
  103. package/lib/table-component/components/EditForm/EditForm.js +3 -6
  104. package/lib/table-component/components/InputControl/InputControl.js +1 -2
  105. package/lib/table-component/components/checkbox-filter/CheckboxFilter.js +1 -2
  106. package/lib/table-component/components/checkbox-filter/FilterSearch.d.ts +1 -1
  107. package/lib/table-component/components/checkbox-filter/FilterSearch.js +5 -2
  108. package/lib/table-component/header/TableHeadCell.js +4 -5
  109. package/lib/table-component/header/TableHeadCell2.js +2 -3
  110. package/lib/table-component/header/TableHeadRow.js +6 -6
  111. package/lib/table-component/hook/useColumns.js +0 -1
  112. package/lib/table-component/hook/utils.d.ts +3 -3
  113. package/lib/table-component/hook/utils.js +35 -6
  114. package/lib/table-component/style.js +1 -1
  115. package/lib/table-component/table/Grid.js +3 -2
  116. package/lib/table-virtuoso/InternalTable.js +2 -0
  117. package/lib/table-virtuoso/body/TableBodyCell.js +10 -5
  118. package/package.json +2 -2
  119. /package/es/{datepicker → datePicker}/index.d.ts +0 -0
  120. /package/es/{datepicker → datePicker}/index.js +0 -0
  121. /package/lib/{datepicker → datePicker}/index.d.ts +0 -0
  122. /package/lib/{datepicker → datePicker}/index.js +0 -0
@@ -0,0 +1,302 @@
1
+ import React, { useEffect, useState } from "react";
2
+ import { Button, Checkbox, Drawer, Input, InputNumber, Select, Space } from "rc-master-ui";
3
+ import { Info, Settings } from "becoxy-icons";
4
+ import TableAli from "../ali-table";
5
+ import { updateArrayByKey } from "../grid-component/hooks";
6
+ const align = {
7
+ left: 'Left',
8
+ right: 'Right'
9
+ };
10
+ export const ColumnsConfig = props => {
11
+ const {
12
+ originColumns,
13
+ triggerChangeColumns,
14
+ t,
15
+ id,
16
+ locale,
17
+ tableLocal
18
+ } = props;
19
+ const [tmpColumn, settmpColumn] = useState([...originColumns]);
20
+ useEffect(() => {
21
+ if (originColumns) {
22
+ settmpColumn([...originColumns]);
23
+ }
24
+ }, [originColumns]);
25
+
26
+ // const treeColumns = React.useMemo(() => {
27
+ // return convertColumnsToTreeData(propsColumns, columnsGroup)
28
+ // }, [propsColumns, columnsGroup])
29
+
30
+ // const [mergedSelectedKeys, setMergedSelectedKeys] = useMergedState(
31
+ // defaultSelectedKeys && defaultSelectedKeys.length ? defaultSelectedKeys : undefined,
32
+ // {
33
+ // value: undefined,
34
+ // },
35
+ // );
36
+ const getWindowSize = () => {
37
+ const {
38
+ innerWidth,
39
+ innerHeight
40
+ } = window;
41
+ return {
42
+ innerWidth,
43
+ innerHeight
44
+ };
45
+ };
46
+ const [windowSize, setWindowSize] = useState(getWindowSize());
47
+ const [open, setOpen] = useState(false);
48
+ const [currentRow, setCurrentRow] = useState('');
49
+ useEffect(() => {
50
+ const handleWindowResize = () => {
51
+ setWindowSize(getWindowSize());
52
+ };
53
+ window.addEventListener('resize', handleWindowResize);
54
+ return () => {
55
+ window.removeEventListener('resize', handleWindowResize);
56
+ };
57
+ }, []);
58
+ const onClose = () => {
59
+ setOpen(!open);
60
+ };
61
+ const handleAccept = () => {
62
+ triggerChangeColumns?.(tmpColumn, [], 'columnChoose');
63
+ onClose();
64
+ };
65
+ const handleChange = newElemt => {
66
+ const newEle = {
67
+ ...newElemt
68
+ };
69
+ const abc = updateArrayByKey(tmpColumn, newEle, 'field');
70
+ settmpColumn(abc);
71
+ };
72
+ const columns = [{
73
+ field: 'headerText1',
74
+ headerText: 'Tên cột',
75
+ template: args => {
76
+ const {
77
+ rowData
78
+ } = args;
79
+ return /*#__PURE__*/React.createElement("span", null, rowData.headerText);
80
+ },
81
+ getCellProps(value, row) {
82
+ return {
83
+ style: {},
84
+ onClick: () => {
85
+ setCurrentRow(row.field);
86
+ }
87
+ };
88
+ }
89
+ }, {
90
+ field: 'headerText',
91
+ headerText: 'Tên cột hiển thị',
92
+ width: 200,
93
+ getCellProps(value, row) {
94
+ return {
95
+ style: {
96
+ paddingBlock: currentRow === row.field ? 0 : undefined
97
+ },
98
+ onClick: () => {
99
+ setCurrentRow(row.field);
100
+ }
101
+ };
102
+ },
103
+ template: args => {
104
+ const {
105
+ value,
106
+ rowData
107
+ } = args;
108
+ if (currentRow === rowData.field) {
109
+ return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Input, {
110
+ defaultValue: value,
111
+ allowClear: true,
112
+ onBlur: e => {
113
+ const newData = {
114
+ ...rowData,
115
+ visible: e.target.value
116
+ };
117
+ handleChange(newData);
118
+ }
119
+ }));
120
+ }
121
+ return /*#__PURE__*/React.createElement("span", null, value);
122
+ }
123
+ }, {
124
+ field: 'visible',
125
+ headerText: 'Hiển thị',
126
+ textAlign: 'center',
127
+ headerTextAlign: 'center',
128
+ width: 80,
129
+ template: args => {
130
+ const {
131
+ value,
132
+ rowData
133
+ } = args;
134
+ return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Checkbox, {
135
+ defaultChecked: value !== false,
136
+ onChange: e => {
137
+ const newData = {
138
+ ...rowData,
139
+ visible: e.target.checked
140
+ };
141
+ handleChange(newData);
142
+ }
143
+ }));
144
+ }
145
+ }, {
146
+ field: 'fixed',
147
+ headerText: 'Cố định cột',
148
+ getCellProps(value, row) {
149
+ return {
150
+ style: {
151
+ paddingBlock: currentRow === row.field ? 0 : undefined
152
+ },
153
+ onClick: () => {
154
+ setCurrentRow(row.field);
155
+ }
156
+ };
157
+ },
158
+ template: args => {
159
+ const {
160
+ value,
161
+ rowData
162
+ } = args;
163
+ const rs = value ?? rowData.fixedType;
164
+ if (currentRow === rowData.field) {
165
+ return /*#__PURE__*/React.createElement(Select, {
166
+ value: rs,
167
+ allowClear: true,
168
+ style: {
169
+ width: '100%'
170
+ },
171
+ options: [{
172
+ value: 'left',
173
+ label: 'Trái'
174
+ }, {
175
+ value: 'right',
176
+ label: 'Phải'
177
+ }],
178
+ onChange: val => {
179
+ const newData = {
180
+ ...rowData,
181
+ fixed: val
182
+ };
183
+ handleChange(newData);
184
+ }
185
+ });
186
+ }
187
+ if (rs) {
188
+ return /*#__PURE__*/React.createElement("span", null, t ? t?.(align[rs]) : align[rs]);
189
+ }
190
+ return '';
191
+ }
192
+ }, {
193
+ field: 'width',
194
+ headerText: 'Độ rộng cột (px)',
195
+ getCellProps(value, row) {
196
+ return {
197
+ style: {
198
+ paddingBlock: currentRow === row.field ? 0 : undefined
199
+ },
200
+ onClick: () => {
201
+ setCurrentRow(row.field);
202
+ }
203
+ };
204
+ },
205
+ template: args => {
206
+ const {
207
+ value,
208
+ rowData
209
+ } = args;
210
+ if (currentRow === rowData.field) {
211
+ return /*#__PURE__*/React.createElement(InputNumber, {
212
+ defaultValue: value,
213
+ style: {
214
+ width: '100%'
215
+ },
216
+ changeOnWheel: true,
217
+ onBlur: e => {
218
+ const newData = {
219
+ ...rowData,
220
+ visible: e.target.value
221
+ };
222
+ handleChange(newData);
223
+ }
224
+ });
225
+ }
226
+ return /*#__PURE__*/React.createElement("span", null, value);
227
+ }
228
+ }];
229
+ const handleReset = () => {
230
+ settmpColumn([...originColumns]);
231
+ };
232
+ const footer = /*#__PURE__*/React.createElement("div", {
233
+ className: "d-flex justify-content-end gap-2 w-100"
234
+ }, /*#__PURE__*/React.createElement(Button, {
235
+ type: "primary",
236
+ onClick: () => handleReset(),
237
+ styles: {
238
+ icon: {}
239
+ }
240
+ }, "Thi\u1EBFt l\u1EADp l\u1EA1i"), /*#__PURE__*/React.createElement(Button, {
241
+ type: "primary",
242
+ styles: {
243
+ icon: {}
244
+ },
245
+ onClick: () => handleAccept()
246
+ }, "X\xE1c nh\u1EADn"), /*#__PURE__*/React.createElement(Button, {
247
+ onClick: () => onClose(),
248
+ styles: {
249
+ icon: {}
250
+ }
251
+ }, "Cancel"));
252
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Settings, {
253
+ "data-tooltip-id": `${id}-tooltip-content`,
254
+ "data-tooltip-content": locale?.table?.setting || tableLocal?.setting || 'Setting',
255
+ fontSize: 16,
256
+ style: {
257
+ cursor: 'pointer'
258
+ },
259
+ className: "toolbar-icon",
260
+ onClick: () => setOpen(true)
261
+ }), /*#__PURE__*/React.createElement(Drawer, {
262
+ title: `Cấu hình cột`,
263
+ placement: "right"
264
+ // size={'large'}
265
+ ,
266
+ styles: {
267
+ wrapper: {
268
+ width: 1200
269
+ },
270
+ body: {
271
+ paddingBlock: 6
272
+ }
273
+ },
274
+ onClose: onClose,
275
+ open: open,
276
+ footer: footer,
277
+ extra: /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Info, {
278
+ "data-tooltip-id": `${id}-tooltip-content`,
279
+ "data-tooltip-content": 'Click vào dòng để chỉnh sửa'
280
+ }))
281
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TableAli, {
282
+ fullScreen: false,
283
+ columns: columns,
284
+ dataSource: tmpColumn,
285
+ gridLines: "Horizontal",
286
+ height: windowSize.innerHeight - 125,
287
+ minHeight: windowSize.innerHeight - 125,
288
+ rowDnd: {
289
+ enabled: true,
290
+ onChange: args => {
291
+ settmpColumn(args.rows);
292
+ }
293
+ },
294
+ expandable: {
295
+ expandIconColumnIndex: 1,
296
+ defaultExpandAllRows: true
297
+ },
298
+ useOuterBorder: true,
299
+ allowFiltering: false,
300
+ allowResizing: false
301
+ }))));
302
+ };
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { Dropdown, Menu } from "antd";
2
+ import { Dropdown, Menu } from "rc-master-ui";
3
3
  export const findItemByKey = (array, key, value) => {
4
4
  for (let i = 0; i < array.length; i++) {
5
5
  const item = array[i];
@@ -9,7 +9,11 @@ import "./style.scss";
9
9
  import { faker } from '@faker-js/faker';
10
10
  import useMergedState from "rc-util/es/hooks/useMergedState";
11
11
  import Grid from "./table/Grid";
12
- import { addRowIdArray, convertFlatColumn1, convertToObj, convertToObjTrue, filterDataByColumns, findAllChildrenKeys2, flatColumns2, getAllRowKey, getDiffent2Array, getFixedFields, getInvisibleColumns, getTreeDepth, groupArrayByColumns, isTreeArray, updateWidthsByOther } from "./hook/utils";
12
+ import { addRowIdArray, convertFlatColumn1,
13
+ // convertToObj,
14
+ convertToObjTrue, filterDataByColumns, findAllChildrenKeys2, flatColumns2, getAllRowKey,
15
+ // getDiffent2Array,
16
+ getFixedFields, getInvisibleColumns, getTreeDepth, groupArrayByColumns, isTreeArray, updateWidthsByOther } from "./hook/utils";
13
17
  import { convertToTanStackColumns } from "./hook/useColumns";
14
18
  import { convertColumns } from "./hook/convert";
15
19
  import { removeInvisibleColumns } from "../grid-component/hooks";
@@ -98,6 +102,12 @@ const InternalTable = props => {
98
102
  const depthData = React.useMemo(() => {
99
103
  return getTreeDepth(convertData);
100
104
  }, [convertData]);
105
+
106
+ // const dataIds = React.useMemo<UniqueIdentifier[]>(
107
+ // () => convertData.map((it: any) => it.rowId),
108
+ // [convertData],
109
+ // )
110
+
101
111
  const expandIconColumnIndex = expandable?.expandIconColumnIndex ?? 0;
102
112
  const flatColumns = React.useMemo(() => {
103
113
  return flatColumns2(propsColumns);
@@ -164,17 +174,26 @@ const InternalTable = props => {
164
174
  const columnVisibility = React.useMemo(() => {
165
175
  return getInvisibleColumns(columns);
166
176
  }, [columns]);
167
- const [columnsHiddenKeys, setColumnsHiddenKeys] = useMergedState(undefined, {
168
- value: undefined
169
- });
177
+
178
+ // const [columnsHiddenKeys, setColumnsHiddenKeys] = useMergedState(
179
+ // undefined,
180
+ // {
181
+ // value: undefined,
182
+ // },
183
+ // );
184
+
170
185
  const triggerChangeColumns = (cols, keys, type) => {
171
186
  if (type === 'cellClick') {
172
187
  setColumns(cols);
173
188
  } else {
174
189
  setColumns(cols);
175
- const aa = flatColumns2(columns).map(it => it.field);
176
- const rsss = getDiffent2Array(aa, keys);
177
- setColumnsHiddenKeys(rsss);
190
+
191
+ // const aa = flatColumns2(columns).map((it) => it.field)
192
+
193
+ // const rsss = getDiffent2Array(aa, keys)
194
+
195
+ // setColumnsHiddenKeys(rsss as any)
196
+
178
197
  onChooseColumns?.({
179
198
  showColumns: removeInvisibleColumns([...cols]),
180
199
  columns: [...cols],
@@ -246,8 +265,10 @@ const InternalTable = props => {
246
265
  groupSetting: groupSetting,
247
266
  groupAble: groupAble,
248
267
  groupColumns: groupColumns,
249
- columnPinning: columnPinning,
250
- columnHidden: columnsHiddenKeys ? convertToObj(columnsHiddenKeys) : columnVisibility,
268
+ columnPinning: columnPinning
269
+ // columnHidden={columnsHiddenKeys ? convertToObj(columnsHiddenKeys) : columnVisibility}
270
+ ,
271
+ columnHidden: columnVisibility,
251
272
  triggerFilter: setFilterState,
252
273
  triggerSorter: setSorterStates,
253
274
  defaultFilter: defaultFilter,
@@ -5,12 +5,14 @@ import { TableContext } from "./useContext";
5
5
  import Pagination from 'rc-master-ui/es/pagination';
6
6
  import { Toolbar } from 'rc-master-ui';
7
7
  import { Maximize, Minimize } from 'becoxy-icons';
8
- import { ColumnsChoose } from "./ColumnsChoose";
9
8
  import { numericFormatter } from 'react-numeric-component';
10
9
  import TableWrapper from "./table/TableWrapper";
11
10
  import { getTableHeight, sumSize, updateColumnWidthsRecursive } from "./hook/utils";
12
11
  import { useVirtualizer } from '@tanstack/react-virtual';
13
12
  import { useLocale } from "rc-master-ui/es/locale";
13
+
14
+ // import { ColumnsChoose } from './ColumnsChoose'
15
+ import { ColumnsConfig } from "./ColumnsConfig";
14
16
  const TableContainer = props => {
15
17
  const {
16
18
  t,
@@ -287,7 +289,7 @@ const TableContainer = props => {
287
289
  },
288
290
  "data-tooltip-id": `${id}-tooltip-content`,
289
291
  "data-tooltip-content": locale?.table?.fullScreen || tableLocal?.fullScreen || 'Full screen'
290
- })), showColumnChoose && /*#__PURE__*/React.createElement(ColumnsChoose, {
292
+ })), showColumnChoose && /*#__PURE__*/React.createElement(ColumnsConfig, {
291
293
  id: id,
292
294
  table: table,
293
295
  locale: locale,
@@ -13,7 +13,7 @@ sumSize,
13
13
  unFlattenData, updateArrayByKey, updateColumnWidthsRecursive, updateOrInsert } from "./hook/utils";
14
14
  import { useVirtualizer } from "@tanstack/react-virtual";
15
15
  import { useForm } from 'react-hook-form';
16
- import { Modal, Typography } from "antd";
16
+ import { Modal, Typography } from "rc-master-ui";
17
17
  import Button from "rc-master-ui/es/button";
18
18
  import Dropdown from "rc-master-ui/es/dropdown";
19
19
  import Pagination from "rc-master-ui/es/pagination";
@@ -23,7 +23,7 @@ import { yupResolver } from "@hookform/resolvers/yup";
23
23
  import { Toolbar } from "rc-master-ui";
24
24
  import classNames from "classnames";
25
25
  import { Maximize, Minimize } from "becoxy-icons";
26
- import { ColumnsChoose } from "./ColumnsChoose";
26
+ import { ColumnsConfig } from "./ColumnsConfig";
27
27
  import TableWrapper from "./table/TableWrapper";
28
28
  import withReactContent from "sweetalert2-react-content";
29
29
  import Swal from "sweetalert2";
@@ -2113,7 +2113,7 @@ const TableContainerEdit = props => {
2113
2113
  },
2114
2114
  "data-tooltip-id": `${id}-tooltip-content`,
2115
2115
  "data-tooltip-content": locale?.table?.fullScreen || tableLocal?.fullScreen || 'Full screen'
2116
- })), showColumnChoose && /*#__PURE__*/React.createElement(ColumnsChoose, {
2116
+ })), showColumnChoose && /*#__PURE__*/React.createElement(ColumnsConfig, {
2117
2117
  table: table,
2118
2118
  columns: columns,
2119
2119
  originColumns: propsColumns,
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import React, { useContext } from "react";
3
3
  import { DatePicker, TimePicker, ColorPicker, Input } from "rc-master-ui";
4
- import { Divider, Row, Col, Button } from "antd";
4
+ import { Divider, Row, Col, Button } from "rc-master-ui";
5
5
  import { checkDecimalSeparator, checkThousandSeparator, checkFieldKey, convertArrayWithIndent, convertDateToDayjs, convertLabelToTitle, getDatepickerFormat, isDisable, isEmpty, isNullOrUndefined, customWeekStartEndFormat, convertDayjsToDate, parseBooleanToValue, isColor, genPresets, getFormat, removeVietnameseTones, getDateValueType } from "../hook/utils";
6
6
  import classNames from "classnames";
7
7
  import { NumericFormat } from "react-numeric-component";
@@ -667,8 +667,11 @@ const EditableCell = props => {
667
667
  indexRow,
668
668
  type: 'blur'
669
669
  });
670
- },
671
- autoDestroy: true,
670
+ }
671
+ // destroyOnHidden
672
+ // des
673
+ // autoDestroy={true}
674
+ ,
672
675
  showSearch: true,
673
676
  mode: isMulti || selectMode === 'checkbox' ? 'multiple' : undefined,
674
677
  valueSelectAble: true,
@@ -805,8 +808,9 @@ const EditableCell = props => {
805
808
  indexRow,
806
809
  type: 'blur'
807
810
  });
808
- },
809
- autoDestroy: true,
811
+ }
812
+ // autoDestroy={true}
813
+ ,
810
814
  showSearch: true,
811
815
  defaultOpen: column.field === startCell?.colId,
812
816
  autoFocus: column.field === startCell?.colId,
@@ -59,17 +59,12 @@ const TableBodyRow = ({
59
59
  [`${prefix}-grid-row-even`]: striped && virtualRow.index % 2 === 0
60
60
  }),
61
61
  style: {
62
- // display: 'flex',
63
62
  display: 'grid',
64
- // position: 'absolute',
65
63
  transform: `translateY(${virtualRow.start}px)`,
66
64
  //this should always be a `style` as it changes on scroll
67
- // height: isEditing ? '36px' : undefined,
68
65
  gridTemplateColumns: `${templateColumns.map(n => `${n}fr`).join(" ")}`,
69
66
  height: isEditing ? virtualRow.size : undefined,
70
67
  minHeight: isEditing ? undefined : virtualRow.size,
71
- // backgroundColor: Array.isArray(row.originalSubRows) ? '#f5f5f5' : undefined,
72
- // fontWeight: Array.isArray(row.originalSubRows) ? '500' : undefined,
73
68
  ...rowStyles
74
69
  },
75
70
  onDoubleClick: e => {
@@ -4,10 +4,7 @@ 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
6
  import { isNullOrUndefined, isObjEmpty } from "../../hook/utils";
7
- import { Input } from "rc-master-ui";
8
- import { Dropdown } from "antd";
9
- import Divider from "rc-master-ui/es/divider";
10
- import Button from "rc-master-ui/es/button";
7
+ import { Input, Dropdown, Divider, Button } from "rc-master-ui";
11
8
  import InputControl from "../InputControl/InputControl";
12
9
  export const SelectStyle = styled.div.withConfig({
13
10
  displayName: "SelectStyle",
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { Controller } from "react-hook-form";
3
3
  import { Input } from "rc-master-ui";
4
- import { Typography } from "antd";
4
+ import { Typography } from "rc-master-ui";
5
5
  import classnames from "classnames";
6
6
  import React, { Fragment } from "react";
7
7
  import { Col, Row } from "rc-master-ui/es/grid";
@@ -1,7 +1,6 @@
1
1
  import * as React from "react";
2
2
  import classNames from "classnames";
3
- import { Checkbox, Menu, Radio, Empty } from "rc-master-ui";
4
- import { Tree } from "antd";
3
+ import { Checkbox, Menu, Radio, Empty, Tree } from "rc-master-ui";
5
4
  import { flattenKeys } from "rc-master-ui/es/table/hooks/useFilter";
6
5
  import FilterSearch from "./FilterSearch";
7
6
  function searchValueMatched(searchValue, text) {
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import type { FilterSearchType, TableLocale } from "antd/es/table/interface";
3
2
  import type { AnyObject } from '../../../grid-component/type';
3
+ import type { FilterSearchType, TableLocale } from 'rc-master-ui/es/table/interface';
4
4
  interface FilterSearchProps<RecordType = AnyObject> {
5
5
  value: string;
6
6
  onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
@@ -1,7 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import SearchOutlined from '@ant-design/icons/SearchOutlined';
3
3
  import { Input } from 'rc-master-ui';
4
+ // import type {FilterSearchType, TableLocale} from "antd/es/table/interface"
4
5
 
6
+ // import type { TableLocale } from 'rc-master-ui/es/locales';
5
7
  // import type {AnyObject} from "./../grid-component/type"
6
8
 
7
9
  const FilterSearch = props => {
@@ -9,8 +11,8 @@ const FilterSearch = props => {
9
11
  value,
10
12
  filterSearch,
11
13
  tablePrefixCls,
12
- locale,
13
- onChange
14
+ onChange,
15
+ locale
14
16
  } = props;
15
17
  if (!filterSearch) {
16
18
  return null;
@@ -1,5 +1,5 @@
1
1
  import React, { useContext } from 'react';
2
- import { Button, Space } from 'antd';
2
+ import { Button, Space } from 'rc-master-ui';
3
3
  import { ArrowDown, ArrowUp, FilterFill, SortCancel } from 'becoxy-icons';
4
4
  import classNames from 'classnames';
5
5
  import { Checkbox, Dropdown, Select } from 'rc-master-ui';
@@ -1,5 +1,5 @@
1
1
  import React, { useContext } from 'react';
2
- import { Space } from 'antd';
2
+ import { Space } from 'rc-master-ui';
3
3
  import Button from 'rc-master-ui/es/button';
4
4
  import { ArrowDown, ArrowUp, FilterFill, SortCancel } from 'becoxy-icons';
5
5
  import classNames from 'classnames';
@@ -1,4 +1,5 @@
1
- import { horizontalListSortingStrategy, SortableContext } from '@dnd-kit/sortable';
1
+ // import { horizontalListSortingStrategy, SortableContext } from '@dnd-kit/sortable'
2
+
2
3
  import React from 'react';
3
4
  import { TableContext } from "../useContext";
4
5
  import TableHeadCell from "./TableHeadCell";
@@ -11,7 +12,9 @@ const TableHeadRow = ({
11
12
  prefix,
12
13
  onRowHeaderStyles
13
14
  } = React.useContext(TableContext);
14
- const columnOrder = table.getState().columnOrder;
15
+
16
+ // const columnOrder = table.getState().columnOrder
17
+
15
18
  const rowStyles = typeof onRowHeaderStyles === 'function' ? onRowHeaderStyles() : onRowHeaderStyles;
16
19
  return /*#__PURE__*/React.createElement("div", {
17
20
  key: headerGroup.id
@@ -26,9 +29,6 @@ const TableHeadRow = ({
26
29
  ...rowStyles,
27
30
  width: '100%'
28
31
  }
29
- }, /*#__PURE__*/React.createElement(SortableContext, {
30
- items: columnOrder,
31
- strategy: horizontalListSortingStrategy
32
32
  }, headerGroup.headers.map(header => {
33
33
  const columnRelativeDepth = header.depth - header.column.depth;
34
34
  if (columnRelativeDepth > 1) {
@@ -47,6 +47,6 @@ const TableHeadRow = ({
47
47
  colSpan: header.colSpan,
48
48
  rowSpan: rowSpan
49
49
  });
50
- })));
50
+ }));
51
51
  };
52
52
  export default TableHeadRow;
@@ -39,7 +39,6 @@ export const renderValueCell = (column, value, record, rowIndex, colIndex, forma
39
39
  return value ? dayjs(value).format(format?.dateFormat ?? 'DD/MM/YYYY') : '';
40
40
  case 'time':
41
41
  const timeFormat = format?.timeFormat;
42
- console.log('timeFormat', timeFormat);
43
42
  const abc = convertToDate(value, timeFormat);
44
43
  const timeValue = value ? dayjs(abc).format(timeFormat ?? 'HH:mm') : '';
45
44
  return timeValue ?? '';
@@ -1,13 +1,13 @@
1
1
  import type { Row, Table } from "@tanstack/react-table";
2
2
  import type { Column } from "@tanstack/react-table";
3
3
  import type { VirtualItem } from "@tanstack/react-virtual";
4
- import type { AnyObject, ColumnsTable, ColumnTable, EditType, FilterItem, FilterOperator, IColumnType, IFormat, RangeState, Sorter, TypeFilter } from "./../../grid-component/type";
4
+ import type { AnyObject, ColumnsTable, ColumnTable, EditType, FilterItem, FilterOperator, IColumnType, IFormat, RangeState, RowDnd, Sorter, TypeFilter } from "./../../grid-component/type";
5
5
  import type { Key } from "react";
6
6
  import type { CSSProperties } from "react";
7
7
  import dayjs from "dayjs";
8
8
  import type { IPositionCell } from "../useContext";
9
9
  import type { ColumnDef } from "@tanstack/react-table";
10
- import type { TreeDataNode } from "antd";
10
+ import type { TreeDataNode } from "rc-master-ui";
11
11
  import type { FilterState } from "../../ali-table/interfaces";
12
12
  export declare const newGuid: () => any;
13
13
  export declare const convertDayjsToDate: (dateString: string, format?: string) => Date;
@@ -136,7 +136,7 @@ export declare const getVisibleColumnKeys: (columns: any[]) => string[];
136
136
  export declare const getVisibleColumnKeys1: (columns: any[]) => string[];
137
137
  export declare function getVisibleFields(columns: ColumnTable[]): string[];
138
138
  export declare function isObjEqual(obj1: any, obj2: any): boolean;
139
- export declare const sortByType: <T>(arr: ColumnTable<T>[]) => ColumnTable<T>[];
139
+ export declare const sortByType: <T>(arr: ColumnTable<T>[], rowDnd?: RowDnd) => ColumnTable<T>[];
140
140
  export declare function convertColumnsToTreeData<T>(columns: ColumnDef<T, any>[], groupColumns?: string[]): TreeDataNode[];
141
141
  export declare const updateColumns1: (columns: ColumnTable[], includes: string[]) => ColumnTable[];
142
142
  export declare const convertToObj: (arr: any) => {