es-grid-template 1.7.37 → 1.7.38

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 (78) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +1 -1
  3. package/es/grid-component/ContextMenu.d.ts +2 -3
  4. package/es/grid-component/ContextMenu.js +2 -2
  5. package/es/grid-component/InternalTable.d.ts +1 -1
  6. package/es/grid-component/InternalTable.js +31 -39
  7. package/es/grid-component/hooks/constant.js +6 -6
  8. package/es/grid-component/hooks/content/TooltipContent.d.ts +2 -1
  9. package/es/grid-component/hooks/useColumns.d.ts +3 -1
  10. package/es/grid-component/hooks/utils.d.ts +1 -1
  11. package/es/grid-component/styles.scss +1437 -1437
  12. package/es/table-component/ContextMenu.d.ts +2 -3
  13. package/es/table-component/ContextMenu.js +2 -2
  14. package/es/table-component/InternalTable.d.ts +6 -6
  15. package/es/table-component/InternalTable.js +32 -29
  16. package/es/table-component/TableContainer.d.ts +5 -5
  17. package/es/table-component/TableContainer.js +31 -32
  18. package/es/table-component/TableContainerEdit.d.ts +1 -1
  19. package/es/table-component/TableContainerEdit.js +236 -200
  20. package/es/table-component/body/EditableCell.js +154 -157
  21. package/es/table-component/body/TableBody.d.ts +1 -1
  22. package/es/table-component/body/TableBody.js +5 -5
  23. package/es/table-component/body/TableBodyCell.js +37 -18
  24. package/es/table-component/body/TableBodyCellEdit.d.ts +4 -4
  25. package/es/table-component/body/TableBodyCellEdit.js +61 -53
  26. package/es/table-component/body/TableBodyRow.js +0 -1
  27. package/es/table-component/footer/TableFooterCell.d.ts +3 -3
  28. package/es/table-component/footer/TableFooterCell.js +8 -6
  29. package/es/table-component/header/TableHead.d.ts +5 -5
  30. package/es/table-component/header/TableHead.js +2 -2
  31. package/es/table-component/hook/constant.js +6 -6
  32. package/es/table-component/hook/useFilterOperator.d.ts +1 -1
  33. package/es/table-component/hook/utils.d.ts +2 -2
  34. package/es/table-component/hook/utils.js +202 -154
  35. package/es/table-component/style.scss +1197 -1197
  36. package/es/table-component/table/TableWrapper.d.ts +4 -4
  37. package/es/table-component/table/TableWrapper.js +23 -20
  38. package/es/table-component/type.d.ts +40 -40
  39. package/es/table-component/useContext.d.ts +4 -3
  40. package/es/table-component/useContext.js +4 -4
  41. package/lib/grid-component/ContextMenu.d.ts +2 -3
  42. package/lib/grid-component/InternalTable.d.ts +1 -1
  43. package/lib/grid-component/InternalTable.js +25 -33
  44. package/lib/grid-component/hooks/constant.js +6 -6
  45. package/lib/grid-component/hooks/content/TooltipContent.d.ts +2 -1
  46. package/lib/grid-component/hooks/useColumns.d.ts +3 -1
  47. package/lib/grid-component/hooks/utils.d.ts +1 -1
  48. package/lib/grid-component/styles.scss +1437 -1437
  49. package/lib/table-component/ContextMenu.d.ts +2 -3
  50. package/lib/table-component/InternalTable.d.ts +6 -6
  51. package/lib/table-component/InternalTable.js +23 -22
  52. package/lib/table-component/TableContainer.d.ts +5 -5
  53. package/lib/table-component/TableContainer.js +24 -26
  54. package/lib/table-component/TableContainerEdit.d.ts +1 -1
  55. package/lib/table-component/TableContainerEdit.js +235 -199
  56. package/lib/table-component/body/EditableCell.js +153 -156
  57. package/lib/table-component/body/TableBody.d.ts +1 -1
  58. package/lib/table-component/body/TableBody.js +5 -5
  59. package/lib/table-component/body/TableBodyCell.js +36 -17
  60. package/lib/table-component/body/TableBodyCellEdit.d.ts +4 -4
  61. package/lib/table-component/body/TableBodyCellEdit.js +58 -50
  62. package/lib/table-component/body/TableBodyRow.js +0 -1
  63. package/lib/table-component/footer/TableFooterCell.d.ts +3 -3
  64. package/lib/table-component/footer/TableFooterCell.js +7 -5
  65. package/lib/table-component/header/TableHead.d.ts +5 -5
  66. package/lib/table-component/header/TableHead.js +1 -1
  67. package/lib/table-component/hook/constant.js +6 -6
  68. package/lib/table-component/hook/useFilterOperator.d.ts +1 -1
  69. package/lib/table-component/hook/utils.d.ts +2 -2
  70. package/lib/table-component/hook/utils.js +201 -153
  71. package/lib/table-component/style.scss +1197 -1197
  72. package/lib/table-component/table/TableWrapper.d.ts +4 -4
  73. package/lib/table-component/table/TableWrapper.js +23 -20
  74. package/lib/table-component/type.d.ts +40 -40
  75. package/lib/table-component/useContext.d.ts +4 -3
  76. package/lib/table-component/useContext.js +3 -3
  77. package/package.json +2 -2
  78. package/CHANGELOG.md +0 -6
@@ -129,7 +129,7 @@ const TableContainerEdit = props => {
129
129
  const containerRef = _react.default.useRef(null);
130
130
  const bottomToolbarRef = _react.default.useRef(null);
131
131
  const topToolbarRef = _react.default.useRef(null);
132
- const childrenColumnName = 'children';
132
+ const childrenColumnName = "children";
133
133
 
134
134
  // const visibleColumns = table.getVisibleLeafColumns()
135
135
 
@@ -140,73 +140,73 @@ const TableContainerEdit = props => {
140
140
 
141
141
  const defaultContext = _react.default.useMemo(() => {
142
142
  return [{
143
- key: 'INSERT_BEFORE',
143
+ key: "INSERT_BEFORE",
144
144
  // label: 'Thêm dòng bên trên',
145
145
  // label: `${t ? t(locale?.add_rows_before ?? 'Add rows before') : 'Add rows before'}`,
146
- label: locale?.add_rows_before ?? 'Add rows before',
146
+ label: locale?.add_rows_before ?? "Add rows before",
147
147
  icon: /*#__PURE__*/_react.default.createElement(_becoxyIcons.Plus, {
148
148
  fontSize: 14
149
149
  }),
150
150
  children: [{
151
- parentKey: 'INSERT_BEFORE',
152
- key: 'INSERT_BEFORE_1',
153
- label: locale?.add_1 ?? 'Add 1 rows',
151
+ parentKey: "INSERT_BEFORE",
152
+ key: "INSERT_BEFORE_1",
153
+ label: locale?.add_1 ?? "Add 1 rows",
154
154
  row: 1
155
155
  }, {
156
- parentKey: 'INSERT_BEFORE',
157
- key: 'INSERT_BEFORE_10',
158
- label: locale?.add_10 ?? 'Add 10 rows',
156
+ parentKey: "INSERT_BEFORE",
157
+ key: "INSERT_BEFORE_10",
158
+ label: locale?.add_10 ?? "Add 10 rows",
159
159
  row: 10
160
160
  }, {
161
- parentKey: 'INSERT_BEFORE',
162
- key: 'INSERT_BEFORE_50',
163
- label: locale?.add_50 ?? 'Add 50 rows',
161
+ parentKey: "INSERT_BEFORE",
162
+ key: "INSERT_BEFORE_50",
163
+ label: locale?.add_50 ?? "Add 50 rows",
164
164
  row: 50
165
165
  }, {
166
- parentKey: 'INSERT_BEFORE',
167
- key: 'INSERT_BEFORE_100',
168
- label: locale?.add_100 ?? 'Add 100 rows',
166
+ parentKey: "INSERT_BEFORE",
167
+ key: "INSERT_BEFORE_100",
168
+ label: locale?.add_100 ?? "Add 100 rows",
169
169
  row: 100
170
170
  }, {
171
- parentKey: 'INSERT_BEFORE',
172
- key: 'INSERT_BEFORE_ADV',
173
- label: locale?.custom ?? 'Custom'
171
+ parentKey: "INSERT_BEFORE",
172
+ key: "INSERT_BEFORE_ADV",
173
+ label: locale?.custom ?? "Custom"
174
174
  }]
175
175
  }, {
176
- key: 'INSERT_AFTER',
177
- label: locale?.add_rows_after ?? 'Add rows after',
176
+ key: "INSERT_AFTER",
177
+ label: locale?.add_rows_after ?? "Add rows after",
178
178
  icon: /*#__PURE__*/_react.default.createElement(_becoxyIcons.Plus, {
179
179
  fontSize: 14
180
180
  }),
181
181
  children: [{
182
- parentKey: 'INSERT_AFTER',
183
- key: 'INSERT_AFTER_1',
184
- label: locale?.add_1 ?? 'Add 1 rows',
182
+ parentKey: "INSERT_AFTER",
183
+ key: "INSERT_AFTER_1",
184
+ label: locale?.add_1 ?? "Add 1 rows",
185
185
  row: 1
186
186
  }, {
187
- parentKey: 'INSERT_AFTER',
188
- key: 'INSERT_AFTER_10',
189
- label: locale?.add_10 ?? 'Add 10 rows',
187
+ parentKey: "INSERT_AFTER",
188
+ key: "INSERT_AFTER_10",
189
+ label: locale?.add_10 ?? "Add 10 rows",
190
190
  row: 10
191
191
  }, {
192
- parentKey: 'INSERT_AFTER',
193
- key: 'INSERT_AFTER_50',
194
- label: locale?.add_50 ?? 'Add 50 rows',
192
+ parentKey: "INSERT_AFTER",
193
+ key: "INSERT_AFTER_50",
194
+ label: locale?.add_50 ?? "Add 50 rows",
195
195
  row: 50
196
196
  }, {
197
- parentKey: 'INSERT_AFTER',
198
- key: 'INSERT_AFTER_100',
199
- label: locale?.add_100 ?? 'Add 100 rows',
197
+ parentKey: "INSERT_AFTER",
198
+ key: "INSERT_AFTER_100",
199
+ label: locale?.add_100 ?? "Add 100 rows",
200
200
  row: 100
201
201
  }, {
202
- parentKey: 'INSERT_AFTER',
203
- key: 'INSERT_AFTER_ADV',
204
- label: locale?.custom ?? 'Custom'
202
+ parentKey: "INSERT_AFTER",
203
+ key: "INSERT_AFTER_ADV",
204
+ label: locale?.custom ?? "Custom"
205
205
  }]
206
206
  }, {
207
- key: 'INSERT_CHILDREN',
207
+ key: "INSERT_CHILDREN",
208
208
  // label: 'Insert item children',
209
- label: locale?.add_children ?? 'Add children',
209
+ label: locale?.add_children ?? "Add children",
210
210
  icon: /*#__PURE__*/_react.default.createElement(_becoxyIcons.Plus, {
211
211
  fontSize: 14
212
212
  })
@@ -242,14 +242,14 @@ const TableContainerEdit = props => {
242
242
  // }
243
243
  // ]
244
244
  }, {
245
- key: 'DELETE_CONTENT',
246
- label: locale?.delete_content ?? 'Delete content',
245
+ key: "DELETE_CONTENT",
246
+ label: locale?.delete_content ?? "Delete content",
247
247
  icon: /*#__PURE__*/_react.default.createElement(_becoxyIcons.Trash2, {
248
248
  fontSize: 14
249
249
  })
250
250
  }, {
251
- key: 'DELETE_ROWS',
252
- label: locale?.delete_rows ?? 'Delete rows',
251
+ key: "DELETE_ROWS",
252
+ label: locale?.delete_rows ?? "Delete rows",
253
253
  icon: /*#__PURE__*/_react.default.createElement(_becoxyIcons.Trash2, {
254
254
  fontSize: 14
255
255
  })
@@ -257,20 +257,20 @@ const TableContainerEdit = props => {
257
257
  }, [locale]);
258
258
  const itemsAdd = _react.default.useMemo(() => {
259
259
  return [{
260
- key: '10',
261
- label: `10 ${t ? t('rows') : 'rows'}`
260
+ key: "10",
261
+ label: `10 ${t ? t("rows") : "rows"}`
262
262
  }, {
263
- key: '50',
264
- label: `50 ${t ? t('rows') : 'rows'}`
263
+ key: "50",
264
+ label: `50 ${t ? t("rows") : "rows"}`
265
265
  }, {
266
- key: '100',
267
- label: `100 ${t ? t('rows') : 'rows'}`
266
+ key: "100",
267
+ label: `100 ${t ? t("rows") : "rows"}`
268
268
  }];
269
269
  }, [t]);
270
270
  const contextMenuItems = _react.default.useMemo(() => {
271
271
  const a = showDefaultContext !== false ? [...defaultContext] : [];
272
272
  const b = propsContext && propsContext.length > 0 ? [...propsContext, {
273
- type: 'divider'
273
+ type: "divider"
274
274
  }] : [];
275
275
  return [...b, ...a];
276
276
  }, [defaultContext, propsContext, showDefaultContext]);
@@ -303,7 +303,7 @@ const TableContainerEdit = props => {
303
303
  // return element?.getBoundingClientRect().width;
304
304
  // },
305
305
 
306
- measureElement: typeof window !== 'undefined' && navigator.userAgent.indexOf('Firefox') === -1 ? element => element?.getBoundingClientRect().height : undefined,
306
+ measureElement: typeof window !== "undefined" && navigator.userAgent.indexOf("Firefox") === -1 ? element => element?.getBoundingClientRect().height : undefined,
307
307
  overscan: 0 //how many columns to render on each side off screen each way (adjust this for performance)
308
308
  });
309
309
  const virtualColumns = columnVirtualizer.getVirtualItems();
@@ -325,7 +325,7 @@ const TableContainerEdit = props => {
325
325
  virtualPaddingRight = fixedRightColumns && fixedRightColumns.length > 0 ? pdRight - rightWidth > 0 ? pdRight - rightWidth : 0 : pdRight;
326
326
  // virtualPaddingRight = columnVirtualizer.getTotalSize() - (virtualColumns[virtualColumns.length - 1]?.end ?? 0)
327
327
  }
328
- const [editingKey, setEditingKey] = _react.default.useState('');
328
+ const [editingKey, setEditingKey] = _react.default.useState("");
329
329
  const [rangeState, setRangeState] = _react.default.useState({
330
330
  startRowIndex: undefined,
331
331
  endRowIndex: undefined,
@@ -359,7 +359,9 @@ const TableContainerEdit = props => {
359
359
  return startCell && endCell ? (0, _utils.getRowIdsBetween)(table, startCell.rowId, endCell.rowId) : [];
360
360
  }, [endCell, startCell, table]);
361
361
  const copySelectionToClipboard = _react.default.useCallback(() => {
362
- if (!startCell || !endCell) return;
362
+ if (!startCell || !endCell) {
363
+ return;
364
+ }
363
365
 
364
366
  // const allRows = table.getRowModel().rows;
365
367
  const allRows = table.getRowModel().flatRows;
@@ -370,18 +372,20 @@ const TableContainerEdit = props => {
370
372
  const dataToCopy = [];
371
373
  rowIds.forEach(rowId => {
372
374
  const row = allRows.find(r => r.id === rowId);
373
- if (!row) return;
375
+ if (!row) {
376
+ return;
377
+ }
374
378
  const rowData = [];
375
379
  colIds.forEach(colId => {
376
380
  const cellll = row.getVisibleCells().find(c => c.column.id === colId);
377
381
  const value = cellll?.getValue();
378
- rowData.push(value !== undefined ? String(value) : '');
382
+ rowData.push(value !== undefined ? String(value) : "");
379
383
  });
380
384
  dataToCopy.push(rowData);
381
385
  });
382
386
 
383
387
  // Convert to TSV string
384
- const tsv = dataToCopy.map(row => row.join('\t')).join('\n');
388
+ const tsv = dataToCopy.map(row => row.join("\t")).join("\n");
385
389
 
386
390
  // Copy to clipboard
387
391
  navigator.clipboard.writeText(tsv).then(() => {});
@@ -401,7 +405,7 @@ const TableContainerEdit = props => {
401
405
  onCellPaste.onPasted({
402
406
  pasteData: pastedRows,
403
407
  copyRows,
404
- type: 'onPaste',
408
+ type: "onPaste",
405
409
  data: originData,
406
410
  pastedColumns: pastedColumnsArray
407
411
  }, handlePasteCallback);
@@ -409,7 +413,7 @@ const TableContainerEdit = props => {
409
413
  // không có callback
410
414
  onCellPaste.onPasted({
411
415
  pasteData: pastedRows,
412
- type: 'onPaste',
416
+ type: "onPaste",
413
417
  copyRows,
414
418
  data: originData,
415
419
  pastedColumns: pastedColumnsArray
@@ -465,11 +469,11 @@ const TableContainerEdit = props => {
465
469
  }
466
470
  const columnTarget = allCols[targetCol];
467
471
  const columnOri = columnTarget.columnDef.meta ?? {};
468
- const isEdit = typeof columnOri?.editEnable === 'function' ? columnOri.editEnable(newData[targetRow]) : columnOri.editEnable;
472
+ const isEdit = typeof columnOri?.editEnable === "function" ? columnOri.editEnable(newData[targetRow]) : columnOri.editEnable;
469
473
  if (isEdit) {
470
474
  const columnKey = allCols[targetCol].id;
471
- if (columnOri.type === 'number' && (0, _utils.isFormattedNumber)(cellValue.trim())) {
472
- const colFormat = typeof columnOri.format === 'function' ? columnOri.format(record) : columnOri.format;
475
+ if (columnOri.type === "number" && (0, _utils.isFormattedNumber)(cellValue.trim())) {
476
+ const colFormat = typeof columnOri.format === "function" ? columnOri.format(record) : columnOri.format;
473
477
  const valuePasteFormat = (0, _utils.detectSeparators)(cellValue.trim());
474
478
  const cellFormat = (0, _utils.getFormat)(colFormat, format);
475
479
  const thousandSeparator = valuePasteFormat?.thousandSeparator ?? cellFormat?.thousandSeparator;
@@ -527,7 +531,7 @@ const TableContainerEdit = props => {
527
531
  childData.push({
528
532
  id: undefined,
529
533
  rowId: (0, _utils.newGuid)(),
530
- parentId: parent[rowKey ?? 'id']
534
+ parentId: parent[rowKey ?? "id"]
531
535
  });
532
536
  }
533
537
  rowValues.forEach((cellValue, colIndex) => {
@@ -541,7 +545,7 @@ const TableContainerEdit = props => {
541
545
  // const isEdit = typeof columnTarget.editEnable === 'function' ? columnTarget.editEnable(childData[targetRow]) : columnTarget.editEnable
542
546
 
543
547
  const columnOri = columnTarget.columnDef.meta ?? {};
544
- const isEdit = typeof columnOri?.editEnable === 'function' ? columnOri.editEnable(childData[targetRow]) : columnOri.editEnable;
548
+ const isEdit = typeof columnOri?.editEnable === "function" ? columnOri.editEnable(childData[targetRow]) : columnOri.editEnable;
545
549
  if (isEdit) {
546
550
  const columnKey = allCols[targetCol].id;
547
551
  childData[targetRow] = {
@@ -566,12 +570,14 @@ const TableContainerEdit = props => {
566
570
  }
567
571
  }, [dataSource, format, onCellPaste?.maxRowsPaste, originData, rowKey, startCell, table, triggerPaste]);
568
572
  const handlePasteToTable = _react.default.useCallback(pasteData => {
569
- if (!startCell) return;
573
+ if (!startCell) {
574
+ return;
575
+ }
570
576
 
571
577
  // const pastedRows = pasted.trim().split('\n').map(row => row.split('\t'));
572
578
 
573
579
  // Chuyển đổi dữ liệu từ clipboard thành mảng
574
- const rowsPasted = pasteData.split("\n").filter(row => row !== '').map(row =>
580
+ const rowsPasted = pasteData.split("\n").filter(row => row !== "").map(row =>
575
581
  // const rows = pasteData.split("\n").map((row: any) =>
576
582
  row.replace(/\r/g, "").split("\t"));
577
583
  if (rowsPasted.length > (onCellPaste?.maxRowsPaste ?? 200)) {
@@ -580,17 +586,17 @@ const TableContainerEdit = props => {
580
586
  _antd.Modal.confirm({
581
587
  content: /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(Paragraph, {
582
588
  style: {
583
- marginBottom: '.25rem',
589
+ marginBottom: ".25rem",
584
590
  fontSize: 14
585
591
  }
586
592
  }, "D\u1EEF li\u1EC7u sao ch\xE9p v\u01B0\u1EE3t qu\xE1 s\u1ED1 d\xF2ng cho ph\xE9p (500 d\xF2ng).Ph\u1EA7n m\u1EC1n s\u1EBD ch\u1EC9 l\u1EA5y 500 d\xF2ng \u0111\u1EA7u ti\xEAn."), /*#__PURE__*/_react.default.createElement(Title, {
587
593
  level: 5,
588
594
  style: {
589
- marginTop: '.75rem'
595
+ marginTop: ".75rem"
590
596
  }
591
597
  }, "B\u1EA1n c\xF3 mu\u1ED1n ti\u1EBFp t\u1EE5c sao ch\xE9p kh\xF4ng?")),
592
598
  centered: true,
593
- className: 'be-popup-container',
599
+ className: "be-popup-container",
594
600
  onOk: () => {
595
601
  handlePasted(rowsPasted);
596
602
  }
@@ -607,28 +613,32 @@ const TableContainerEdit = props => {
607
613
  }, [handlePasted, onCellPaste?.maxRowsPaste, startCell]);
608
614
  _react.default.useEffect(() => {
609
615
  const handleKeyDown = e => {
610
- if (e.ctrlKey && e.key === 'c' && startCell && endCell) {
616
+ console.log({
617
+ e
618
+ });
619
+ if (e.ctrlKey && e.key === "c" && startCell && endCell) {
611
620
  e.preventDefault();
612
621
  copySelectionToClipboard();
613
622
  }
614
623
  };
615
- window.addEventListener('keydown', handleKeyDown);
616
- return () => window.removeEventListener('keydown', handleKeyDown);
624
+ window.addEventListener("keydown", handleKeyDown);
625
+ return () => window.removeEventListener("keydown", handleKeyDown);
617
626
  }, [startCell, endCell, table, copySelectionToClipboard]);
618
627
  _react.default.useEffect(() => {
619
628
  const handlePaste = e => {
620
629
  if (startCell && !editingKey) {
621
630
  e.preventDefault(); // Chặn hành vi mặc định
622
- const clipboardText = e.clipboardData?.getData('text/plain') ?? '';
631
+ const clipboardText = e.clipboardData?.getData("text/plain") ?? "";
623
632
  handlePasteToTable(clipboardText);
624
633
  }
625
634
  };
626
- window.addEventListener('paste', handlePaste);
627
- return () => window.removeEventListener('paste', handlePaste);
635
+ window.addEventListener("paste", handlePaste);
636
+ return () => window.removeEventListener("paste", handlePaste);
628
637
  }, [startCell, endCell, table, handlePasteToTable, editingKey]);
629
638
  _react.default.useEffect(() => {
630
639
  const handleClickOutside = event => {
631
640
  const element = event.target;
641
+ console.log("event", event);
632
642
  const container = document.querySelector(".be-popup-container");
633
643
  const containerContextMenu = document.querySelector(".popup-context-menu");
634
644
  const tableBody = document.querySelector(`#${id} .ui-rc-grid-tbody`);
@@ -646,7 +656,7 @@ const TableContainerEdit = props => {
646
656
  onBlur?.(dataSource);
647
657
  }
648
658
  setTimeout(() => {
649
- setEditingKey('');
659
+ setEditingKey("");
650
660
  // editingKey.current = ''
651
661
  });
652
662
  setEndCell(undefined);
@@ -656,12 +666,12 @@ const TableContainerEdit = props => {
656
666
  };
657
667
 
658
668
  // document.addEventListener('click', handleClickOutside)
659
- document.addEventListener('mousedown', handleClickOutside);
669
+ document.addEventListener("mousedown", handleClickOutside);
660
670
  // document.addEventListener('touchstart', handleClickOutside)
661
671
 
662
672
  return () => {
663
673
  // document.removeEventListener('click', handleClickOutside)
664
- document.removeEventListener('mousedown', handleClickOutside);
674
+ document.removeEventListener("mousedown", handleClickOutside);
665
675
  // document.removeEventListener('touchstart', handleClickOutside)
666
676
  };
667
677
  }, [dataSource, editingKey, id, onBlur]);
@@ -672,7 +682,9 @@ const TableContainerEdit = props => {
672
682
  });
673
683
  }, [columnSizingState, columnVirtualizer]);
674
684
  _react.default.useEffect(() => {
675
- if (!containerRef.current) return;
685
+ if (!containerRef.current) {
686
+ return;
687
+ }
676
688
  const containerWidth = containerRef.current.offsetWidth - 1;
677
689
  const totalWidth = table.getTotalSize();
678
690
  if (totalWidth && totalWidth < containerWidth) {
@@ -704,7 +716,7 @@ const TableContainerEdit = props => {
704
716
  errors
705
717
  }
706
718
  } = (0, _reactHookForm.useForm)({
707
- mode: 'onChange',
719
+ mode: "onChange",
708
720
  resolver: validate ? (0, _yup.yupResolver)(validate) : undefined
709
721
  });
710
722
  const onSubmit = formData => {
@@ -724,7 +736,7 @@ const TableContainerEdit = props => {
724
736
  triggerChangeData?.(rs);
725
737
  }
726
738
  } catch (errInfo) {
727
- console.log('Validate Failed:', errInfo);
739
+ console.log("Validate Failed:", errInfo);
728
740
  }
729
741
  };
730
742
  const handleCellChange = args => {
@@ -739,7 +751,7 @@ const TableContainerEdit = props => {
739
751
  indexRow,
740
752
  key
741
753
  } = args;
742
- if (changeType === 'blur') {
754
+ if (changeType === "blur") {
743
755
  const handleChangeCallback = callbackData => {
744
756
  const callbackRecord = callbackData;
745
757
  Object.entries(callbackRecord).forEach(([name, value]) => {
@@ -752,7 +764,7 @@ const TableContainerEdit = props => {
752
764
  onCellChange({
753
765
  field,
754
766
  indexCol,
755
- type: 'onChange',
767
+ type: "onChange",
756
768
  value: newState,
757
769
  option,
758
770
  indexRow,
@@ -766,7 +778,7 @@ const TableContainerEdit = props => {
766
778
  onCellChange({
767
779
  field,
768
780
  indexCol,
769
- type: 'onChange',
781
+ type: "onChange",
770
782
  option,
771
783
  value: newState,
772
784
  indexRow,
@@ -780,7 +792,7 @@ const TableContainerEdit = props => {
780
792
  }
781
793
  }
782
794
  }
783
- if (prevState && newState && prevState !== newState && changeType === 'enter') {
795
+ if (prevState && newState && prevState !== newState && changeType === "enter") {
784
796
  onSubmit(record);
785
797
  }
786
798
  };
@@ -1028,7 +1040,29 @@ const TableContainerEdit = props => {
1028
1040
  const filterData = (0, _utils.flattenArray)([...originData]);
1029
1041
  const rs = filterData.filter(it => !rowsFocus.includes(it[rowKey]));
1030
1042
  const newDaa = (0, _utils.unFlattenData)(rs);
1031
- triggerChangeData?.([...newDaa]);
1043
+ if (commandSettings && commandSettings.confirmDialog) {
1044
+ MySwal.fire({
1045
+ title: t ? t("Confirm") : "Confirm",
1046
+ text: t ? t("Do you want to delete item?") : "Do you want to delete item?",
1047
+ // icon: 'warning',
1048
+ allowOutsideClick: false,
1049
+ showCancelButton: true,
1050
+ confirmButtonText: t ? t("Delete") : "Delete",
1051
+ cancelButtonText: t ? t("Cancel") : "Cancel",
1052
+ customClass: {
1053
+ confirmButton: "be-button btn-primary",
1054
+ cancelButton: "be-button btn-danger ms-1"
1055
+ },
1056
+ buttonsStyling: false
1057
+ }).then(async result => {
1058
+ if (result.value) {
1059
+ triggerChangeData?.([...newDaa]);
1060
+ } else if (result.dismiss === MySwal.DismissReason.cancel) {}
1061
+ });
1062
+ } else {
1063
+ // không hiện dialog
1064
+ triggerChangeData?.([...newDaa]);
1065
+ }
1032
1066
  }
1033
1067
  }, [originData, rowKey, rowsFocus, triggerChangeData]);
1034
1068
  const handleDeleteAll = _react.default.useCallback(() => {
@@ -1048,17 +1082,17 @@ const TableContainerEdit = props => {
1048
1082
  const column = table.getVisibleFlatColumns().find(it => it.id === colId)?.columnDef.meta;
1049
1083
  const columnIndex = table.getVisibleFlatColumns().findIndex(it => it.id === colId);
1050
1084
  if ((0, _utils.isEditable)(column, row)) {
1051
- updatedRow[colId] = '';
1085
+ updatedRow[colId] = "";
1052
1086
  handleCellChange({
1053
1087
  key: row[rowKey],
1054
1088
  field: column.field ?? column.dataIndex,
1055
1089
  record: updatedRow,
1056
1090
  prevState: row[column.field],
1057
- newState: '',
1058
- option: '',
1091
+ newState: "",
1092
+ option: "",
1059
1093
  indexCol: columnIndex,
1060
1094
  indexRow: index,
1061
- type: 'blur'
1095
+ type: "blur"
1062
1096
  });
1063
1097
  }
1064
1098
  }
@@ -1070,35 +1104,35 @@ const TableContainerEdit = props => {
1070
1104
  };
1071
1105
  const toolbarItemsBottom = _react.default.useMemo(() => {
1072
1106
  if (!rowsFocus || rowsFocus.length === 0) {
1073
- return toolbarItems?.filter(it => it.position === 'Bottom' && it.visible !== false && it.key !== 'DUPLICATE' && it.key !== 'INSERT_BEFORE' && it.key !== 'INSERT_AFTER' && it.key !== 'DELETE_ROWS' && it.key !== 'INSERT_CHILDREN').map(item => {
1074
- if (item.key === 'ADD') {
1107
+ return toolbarItems?.filter(it => it.position === "Bottom" && it.visible !== false && it.key !== "DUPLICATE" && it.key !== "INSERT_BEFORE" && it.key !== "INSERT_AFTER" && it.key !== "DELETE_ROWS" && it.key !== "INSERT_CHILDREN").map(item => {
1108
+ if (item.key === "ADD") {
1075
1109
  return {
1076
1110
  ...item,
1077
1111
  template: () => {
1078
- return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, item.key === 'ADD' && /*#__PURE__*/_react.default.createElement("div", {
1112
+ return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, item.key === "ADD" && /*#__PURE__*/_react.default.createElement("div", {
1079
1113
  className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
1080
1114
  }, /*#__PURE__*/_react.default.createElement(_antd.Dropdown.Button, {
1081
- overlayClassName: 'be-popup-container',
1082
- trigger: ['click'],
1115
+ overlayClassName: "be-popup-container",
1116
+ trigger: ["click"],
1083
1117
  style: {
1084
- color: '#28c76f',
1085
- borderColor: '#28c76f'
1118
+ color: "#28c76f",
1119
+ borderColor: "#28c76f"
1086
1120
  },
1087
- className: 'toolbar-button toolbar-dropdown-button',
1121
+ className: "toolbar-button toolbar-dropdown-button",
1088
1122
  menu: {
1089
1123
  items: itemsAdd,
1090
1124
  onClick: e => handleAddMulti(item, Number(e.key))
1091
1125
  }
1092
1126
  }, /*#__PURE__*/_react.default.createElement("span", {
1093
1127
  style: {
1094
- color: '#28c76f'
1128
+ color: "#28c76f"
1095
1129
  },
1096
1130
  onClick: () => handleAddMulti(item, 1)
1097
- }, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item'))));
1131
+ }, item.label ? t ? t(item.label) : item.label : t ? t("Add item") : "Add item"))));
1098
1132
  }
1099
1133
  };
1100
1134
  }
1101
- if (item.key === 'DELETE') {
1135
+ if (item.key === "DELETE") {
1102
1136
  return {
1103
1137
  ...item,
1104
1138
  template: () => {
@@ -1106,13 +1140,13 @@ const TableContainerEdit = props => {
1106
1140
  className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
1107
1141
  }, /*#__PURE__*/_react.default.createElement(_antd.Button, {
1108
1142
  style: {
1109
- color: '#eb4619',
1110
- borderColor: '#eb4619'
1143
+ color: "#eb4619",
1144
+ borderColor: "#eb4619"
1111
1145
  },
1112
- variant: 'outlined',
1146
+ variant: "outlined",
1113
1147
  onClick: handleDeleteAll,
1114
1148
  className: "d-flex toolbar-button"
1115
- }, item.label ? t ? t(item.label) : item.label : t ? t('Delete all item') : 'Delete all item'));
1149
+ }, item.label ? t ? t(item.label) : item.label : t ? t("Delete all item") : "Delete all item"));
1116
1150
  }
1117
1151
  };
1118
1152
  }
@@ -1121,104 +1155,104 @@ const TableContainerEdit = props => {
1121
1155
  };
1122
1156
  });
1123
1157
  }
1124
- return toolbarItems?.filter(it => it.position === 'Bottom' && it.visible !== false).map(item => {
1125
- if (item.key === 'ADD') {
1158
+ return toolbarItems?.filter(it => it.position === "Bottom" && it.visible !== false).map(item => {
1159
+ if (item.key === "ADD") {
1126
1160
  return {
1127
1161
  ...item,
1128
1162
  template: () => {
1129
- return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, item.key === 'ADD' && /*#__PURE__*/_react.default.createElement("div", {
1163
+ return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, item.key === "ADD" && /*#__PURE__*/_react.default.createElement("div", {
1130
1164
  className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
1131
1165
  }, /*#__PURE__*/_react.default.createElement(_antd.Dropdown.Button, {
1132
- overlayClassName: 'be-popup-container',
1166
+ overlayClassName: "be-popup-container",
1133
1167
  style: {
1134
- color: '#28c76f',
1135
- borderColor: '#28c76f'
1168
+ color: "#28c76f",
1169
+ borderColor: "#28c76f"
1136
1170
  },
1137
- className: 'toolbar-button toolbar-dropdown-button',
1171
+ className: "toolbar-button toolbar-dropdown-button",
1138
1172
  menu: {
1139
1173
  items: itemsAdd,
1140
1174
  onClick: e => handleAddMulti(item, Number(e.key))
1141
1175
  }
1142
1176
  }, /*#__PURE__*/_react.default.createElement("span", {
1143
1177
  style: {
1144
- color: '#28c76f'
1178
+ color: "#28c76f"
1145
1179
  },
1146
1180
  onClick: () => handleAddMulti(item, 1)
1147
- }, item.label ? t ? t(item.label) : item.label : t ? t('Add item') : 'Add item'))));
1181
+ }, item.label ? t ? t(item.label) : item.label : t ? t("Add item") : "Add item"))));
1148
1182
  }
1149
1183
  };
1150
1184
  }
1151
- if (item.key === 'DUPLICATE') {
1185
+ if (item.key === "DUPLICATE") {
1152
1186
  return {
1153
1187
  ...item,
1154
1188
  template: () => {
1155
- return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, item.key === 'DUPLICATE' && item.visible !== false && rowsFocus.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
1189
+ return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, item.key === "DUPLICATE" && item.visible !== false && rowsFocus.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
1156
1190
  className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
1157
1191
  }, /*#__PURE__*/_react.default.createElement(_antd.Button, {
1158
1192
  style: {
1159
- color: '#28c76f',
1160
- borderColor: '#28c76f'
1193
+ color: "#28c76f",
1194
+ borderColor: "#28c76f"
1161
1195
  },
1162
- variant: 'outlined',
1196
+ variant: "outlined",
1163
1197
  onClick: handleDuplicate,
1164
1198
  className: "d-flex toolbar-button"
1165
- }, item.label ? t ? t(item.label) : item.label : t ? t('Duplicate') : 'Duplicate')));
1199
+ }, item.label ? t ? t(item.label) : item.label : t ? t("Duplicate") : "Duplicate")));
1166
1200
  }
1167
1201
  };
1168
1202
  }
1169
- if (item.key === 'INSERT_BEFORE') {
1203
+ if (item.key === "INSERT_BEFORE") {
1170
1204
  return {
1171
1205
  ...item,
1172
1206
  template: () => {
1173
1207
  return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
1174
1208
  className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
1175
1209
  }, /*#__PURE__*/_react.default.createElement(_antd.Dropdown.Button, {
1176
- overlayClassName: 'be-popup-container',
1210
+ overlayClassName: "be-popup-container",
1177
1211
  style: {
1178
- color: '#28c76f',
1179
- borderColor: '#28c76f'
1212
+ color: "#28c76f",
1213
+ borderColor: "#28c76f"
1180
1214
  },
1181
- className: 'toolbar-button toolbar-dropdown-button',
1215
+ className: "toolbar-button toolbar-dropdown-button",
1182
1216
  menu: {
1183
1217
  items: itemsAdd,
1184
1218
  onClick: e => handleInsertBefore(item, Number(e.key))
1185
1219
  }
1186
1220
  }, /*#__PURE__*/_react.default.createElement("span", {
1187
1221
  style: {
1188
- color: '#28c76f'
1222
+ color: "#28c76f"
1189
1223
  },
1190
1224
  onClick: () => handleInsertBefore(item, 1)
1191
- }, item.label ? t ? t(item.label) : item.label : t ? t('Insert item before') : 'Insert item before'))));
1225
+ }, item.label ? t ? t(item.label) : item.label : t ? t("Insert item before") : "Insert item before"))));
1192
1226
  }
1193
1227
  };
1194
1228
  }
1195
- if (item.key === 'INSERT_AFTER') {
1229
+ if (item.key === "INSERT_AFTER") {
1196
1230
  return {
1197
1231
  ...item,
1198
1232
  template: () => {
1199
1233
  return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
1200
1234
  className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
1201
1235
  }, /*#__PURE__*/_react.default.createElement(_antd.Dropdown.Button, {
1202
- overlayClassName: 'be-popup-container',
1236
+ overlayClassName: "be-popup-container",
1203
1237
  style: {
1204
- color: '#28c76f',
1205
- borderColor: '#28c76f'
1238
+ color: "#28c76f",
1239
+ borderColor: "#28c76f"
1206
1240
  },
1207
- className: 'toolbar-button toolbar-dropdown-button',
1241
+ className: "toolbar-button toolbar-dropdown-button",
1208
1242
  menu: {
1209
1243
  items: itemsAdd,
1210
1244
  onClick: e => handleInsertAfter(item, Number(e.key))
1211
1245
  }
1212
1246
  }, /*#__PURE__*/_react.default.createElement("span", {
1213
1247
  style: {
1214
- color: '#28c76f'
1248
+ color: "#28c76f"
1215
1249
  },
1216
1250
  onClick: () => handleInsertAfter(item, 1)
1217
- }, item.label ? t ? t(item.label) : item.label : t ? t('Insert item after') : 'Insert item after'))));
1251
+ }, item.label ? t ? t(item.label) : item.label : t ? t("Insert item after") : "Insert item after"))));
1218
1252
  }
1219
1253
  };
1220
1254
  }
1221
- if (item.key === 'INSERT_CHILDREN') {
1255
+ if (item.key === "INSERT_CHILDREN") {
1222
1256
  return {
1223
1257
  ...item,
1224
1258
  template: () => {
@@ -1226,17 +1260,17 @@ const TableContainerEdit = props => {
1226
1260
  className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
1227
1261
  }, /*#__PURE__*/_react.default.createElement(_antd.Button, {
1228
1262
  style: {
1229
- color: '#28c76f',
1230
- borderColor: '#28c76f'
1263
+ color: "#28c76f",
1264
+ borderColor: "#28c76f"
1231
1265
  },
1232
- variant: 'outlined',
1266
+ variant: "outlined",
1233
1267
  onClick: () => handleInsertChild(item),
1234
1268
  className: "d-flex toolbar-button"
1235
- }, item.label ? t ? t(item.label) : item.label : t ? t('Insert item children') : 'Insert item children')));
1269
+ }, item.label ? t ? t(item.label) : item.label : t ? t("Insert item children") : "Insert item children")));
1236
1270
  }
1237
1271
  };
1238
1272
  }
1239
- if (item.key === 'DELETE') {
1273
+ if (item.key === "DELETE") {
1240
1274
  return {
1241
1275
  ...item,
1242
1276
  template: () => {
@@ -1244,17 +1278,17 @@ const TableContainerEdit = props => {
1244
1278
  className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
1245
1279
  }, /*#__PURE__*/_react.default.createElement(_antd.Button, {
1246
1280
  style: {
1247
- color: '#eb4619',
1248
- borderColor: '#eb4619'
1281
+ color: "#eb4619",
1282
+ borderColor: "#eb4619"
1249
1283
  },
1250
- variant: 'outlined',
1284
+ variant: "outlined",
1251
1285
  onClick: handleDeleteAll,
1252
1286
  className: "d-flex toolbar-button"
1253
- }, item.label ? t ? t(item.label) : item.label : t ? t('Delete all item') : 'Delete all item'));
1287
+ }, item.label ? t ? t(item.label) : item.label : t ? t("Delete all item") : "Delete all item"));
1254
1288
  }
1255
1289
  };
1256
1290
  }
1257
- if (item.key === 'DELETE_ROWS') {
1291
+ if (item.key === "DELETE_ROWS") {
1258
1292
  return {
1259
1293
  ...item,
1260
1294
  template: () => {
@@ -1262,13 +1296,13 @@ const TableContainerEdit = props => {
1262
1296
  className: (0, _classnames.default)(`be-toolbar-item`, item?.className)
1263
1297
  }, /*#__PURE__*/_react.default.createElement(_antd.Button, {
1264
1298
  style: {
1265
- color: '#eb4619',
1266
- borderColor: '#eb4619'
1299
+ color: "#eb4619",
1300
+ borderColor: "#eb4619"
1267
1301
  },
1268
- variant: 'outlined',
1302
+ variant: "outlined",
1269
1303
  onClick: () => handleDeleteRows(item),
1270
1304
  className: "d-flex toolbar-button"
1271
- }, t ? `${t('Delete')} ${rowsFocus.length} ${t('row')}` : `Delete ${rowsFocus.length} item`));
1305
+ }, t ? `${t("Delete")} ${rowsFocus.length} ${t("row")}` : `Delete ${rowsFocus.length} item`));
1272
1306
  }
1273
1307
  };
1274
1308
  }
@@ -1285,20 +1319,20 @@ const TableContainerEdit = props => {
1285
1319
  index
1286
1320
  } = args;
1287
1321
  const tmpData = [...dataSource];
1288
- if (idCommand === 'DELETE') {
1322
+ if (idCommand === "DELETE") {
1289
1323
  // bật modal confirm
1290
1324
  if (commandSettings && commandSettings.confirmDialog) {
1291
1325
  MySwal.fire({
1292
- title: t ? t('Confirm') : 'Confirm',
1293
- text: t ? t('Do you want to delete item?') : 'Do you want to delete item?',
1326
+ title: t ? t("Confirm") : "Confirm",
1327
+ text: t ? t("Do you want to delete item?") : "Do you want to delete item?",
1294
1328
  // icon: 'warning',
1295
1329
  allowOutsideClick: false,
1296
1330
  showCancelButton: true,
1297
- confirmButtonText: t ? t('Delete') : 'Delete',
1298
- cancelButtonText: t ? t('Cancel') : 'Cancel',
1331
+ confirmButtonText: t ? t("Delete") : "Delete",
1332
+ cancelButtonText: t ? t("Cancel") : "Cancel",
1299
1333
  customClass: {
1300
- confirmButton: 'be-button btn-primary',
1301
- cancelButton: 'be-button btn-danger ms-1'
1334
+ confirmButton: "be-button btn-primary",
1335
+ cancelButton: "be-button btn-danger ms-1"
1302
1336
  },
1303
1337
  buttonsStyling: false
1304
1338
  }).then(async result => {
@@ -1400,10 +1434,9 @@ const TableContainerEdit = props => {
1400
1434
  }
1401
1435
  };
1402
1436
  const triggerContextMenuClick = args => {
1403
- if (args.item?.parentKey && args.item.parentKey === 'INSERT_BEFORE') {
1404
- if (args.item.key === 'INSERT_BEFORE_ADV') {
1437
+ if (args.item?.parentKey && args.item.parentKey === "INSERT_BEFORE") {
1438
+ if (args.item.key === "INSERT_BEFORE_ADV") {
1405
1439
  // mở Modal
1406
-
1407
1440
  // setOpenModalAddRow((prev) => (
1408
1441
  // {
1409
1442
  // ...prev,
@@ -1416,9 +1449,8 @@ const TableContainerEdit = props => {
1416
1449
  }
1417
1450
  return;
1418
1451
  }
1419
- if (args.item?.parentKey && args.item.parentKey === 'INSERT_AFTER') {
1420
- if (args.item.key === 'INSERT_AFTER_ADV') {
1421
-
1452
+ if (args.item?.parentKey && args.item.parentKey === "INSERT_AFTER") {
1453
+ if (args.item.key === "INSERT_AFTER_ADV") {
1422
1454
  // setOpenModalAddRow((prev) => (
1423
1455
  // {
1424
1456
  // ...prev,
@@ -1431,15 +1463,15 @@ const TableContainerEdit = props => {
1431
1463
  }
1432
1464
  return;
1433
1465
  }
1434
- if (args.item.key === 'INSERT_CHILDREN') {
1466
+ if (args.item.key === "INSERT_CHILDREN") {
1435
1467
  handleInsertChild(args.item);
1436
1468
  return;
1437
1469
  }
1438
- if (args.item.key === 'DELETE_ROWS') {
1470
+ if (args.item.key === "DELETE_ROWS") {
1439
1471
  handleDeleteRows(args.item);
1440
1472
  return;
1441
1473
  }
1442
- if (args.item.key === 'DELETE_CONTENT') {
1474
+ if (args.item.key === "DELETE_CONTENT") {
1443
1475
  handleDeleteContent();
1444
1476
  return;
1445
1477
  }
@@ -1447,6 +1479,7 @@ const TableContainerEdit = props => {
1447
1479
  };
1448
1480
  const handleCellClick = (rowNumber, record, column, rowId, cellValue) => {
1449
1481
  const cellClickCallback = newOptions => {
1482
+ console.log("newOptions", newOptions);
1450
1483
  if (newOptions) {
1451
1484
  const newElem = {
1452
1485
  ...column,
@@ -1457,8 +1490,8 @@ const TableContainerEdit = props => {
1457
1490
  options: newOptions
1458
1491
  }
1459
1492
  };
1460
- const rrr = (0, _utils.updateArrayByKey)([...columns], newElem, 'field');
1461
- triggerChangeColumns?.(rrr, 'click');
1493
+ const rrr = (0, _utils.updateArrayByKey)([...propsColumns], newElem, "field");
1494
+ triggerChangeColumns?.(rrr, [], "cellClick");
1462
1495
  }
1463
1496
  };
1464
1497
  if (onCellClick) {
@@ -1473,55 +1506,55 @@ const TableContainerEdit = props => {
1473
1506
  }
1474
1507
  };
1475
1508
  return /*#__PURE__*/_react.default.createElement("div", {
1476
- ref: containerRef,
1477
- id: id
1509
+ ref: containerRef
1510
+ // id={id}
1478
1511
  }, (showToolbar !== false || fullScreen !== false || showColumnChoose) && /*#__PURE__*/_react.default.createElement("div", {
1479
1512
  ref: topToolbarRef,
1480
1513
  className: (0, _classnames.default)(`${prefix}-grid-top-toolbar`, {})
1481
1514
  }, /*#__PURE__*/_react.default.createElement("div", {
1482
1515
  style: {
1483
- display: 'flex',
1484
- justifyContent: 'space-between',
1485
- alignItems: 'center',
1486
- gap: '.75rem'
1516
+ display: "flex",
1517
+ justifyContent: "space-between",
1518
+ alignItems: "center",
1519
+ gap: ".75rem"
1487
1520
  }
1488
1521
  }, /*#__PURE__*/_react.default.createElement("div", {
1489
1522
  style: {
1490
1523
  flex: 1,
1491
- overflow: 'hidden'
1524
+ overflow: "hidden"
1492
1525
  }
1493
1526
  }, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Toolbar, {
1494
- items: (toolbarItems ?? []).filter(it => it.position !== 'Bottom'),
1495
- mode: 'scroll'
1527
+ items: (toolbarItems ?? []).filter(it => it.position !== "Bottom"),
1528
+ mode: "scroll"
1496
1529
  })), /*#__PURE__*/_react.default.createElement("div", {
1497
1530
  style: {
1498
- display: 'flex',
1499
- justifyContent: 'space-between',
1500
- alignItems: 'center',
1501
- gap: '.75rem'
1531
+ display: "flex",
1532
+ justifyContent: "space-between",
1533
+ alignItems: "center",
1534
+ gap: ".75rem"
1502
1535
  }
1503
- }, pagination && pagination.onChange && pagination?.position && pagination?.position[0] === 'topRight' && /*#__PURE__*/_react.default.createElement(_pagination.default, (0, _extends2.default)({
1536
+ }, pagination && pagination.onChange && pagination?.position && pagination?.position[0] === "topRight" && /*#__PURE__*/_react.default.createElement(_pagination.default, (0, _extends2.default)({
1504
1537
  showSizeChanger: true,
1505
1538
  responsive: true,
1506
- size: 'small',
1507
- rootClassName: 'top-pagination',
1539
+ size: "small",
1540
+ rootClassName: "top-pagination",
1508
1541
  showTotal: (total, range) =>
1509
1542
  // @ts-ignore
1510
- `${range[0]}-${range[1]} / ${total} ${t ? t(pagination?.locale?.items ?? 'items') : 'items'}`
1511
- }, pagination)), typeof actionTemplate === 'function' ? actionTemplate() : actionTemplate, fullScreen !== false && (isFullScreen ? /*#__PURE__*/_react.default.createElement(_becoxyIcons.Minimize, {
1543
+ `${range[0]}-${range[1]} / ${total} ${t ? t(pagination?.locale?.items ?? "items") : "items"}`
1544
+ }, pagination)), typeof actionTemplate === "function" ? actionTemplate() : actionTemplate, fullScreen !== false && (isFullScreen ? /*#__PURE__*/_react.default.createElement(_becoxyIcons.Minimize, {
1512
1545
  fontSize: 16,
1513
1546
  onClick: () => {
1514
1547
  setIsFullScreen(!isFullScreen);
1515
1548
  },
1516
1549
  "data-tooltip-id": `${id}-tooltip-content`,
1517
- "data-tooltip-content": t ? t('Minimized') : 'Minimized'
1550
+ "data-tooltip-content": t ? t("Minimized") : "Minimized"
1518
1551
  }) : /*#__PURE__*/_react.default.createElement(_becoxyIcons.Maximize, {
1519
1552
  fontSize: 16,
1520
1553
  onClick: () => {
1521
1554
  setIsFullScreen(!isFullScreen);
1522
1555
  },
1523
1556
  "data-tooltip-id": `${id}-tooltip-content`,
1524
- "data-tooltip-content": t ? t('Full screen') : 'Full screen'
1557
+ "data-tooltip-content": t ? t("Full screen") : "Full screen"
1525
1558
  })), showColumnChoose && /*#__PURE__*/_react.default.createElement(_ColumnsChoose.ColumnsChoose, {
1526
1559
  columns: columns,
1527
1560
  originColumns: propsColumns,
@@ -1572,7 +1605,7 @@ const TableContainerEdit = props => {
1572
1605
  setIsPasting,
1573
1606
  setEndPasteCell,
1574
1607
  setStartPasteCell,
1575
- //
1608
+ //
1576
1609
  control,
1577
1610
  // trigger,
1578
1611
  errors,
@@ -1585,7 +1618,8 @@ const TableContainerEdit = props => {
1585
1618
  handleAddMulti,
1586
1619
  dataErrors,
1587
1620
  windowSize,
1588
- handleCellClick
1621
+ handleCellClick,
1622
+ isFullScreen
1589
1623
  }
1590
1624
  }, /*#__PURE__*/_react.default.createElement(_TableWrapper.default, {
1591
1625
  contextMenuItems: contextMenuItems,
@@ -1599,7 +1633,9 @@ const TableContainerEdit = props => {
1599
1633
  contextMenuClick: triggerContextMenuClick,
1600
1634
  contextMenuHidden: contextMenuHidden,
1601
1635
  contextMenuOpen: contextMenuOpen,
1602
- editAble: editAble,
1636
+ editAble: editAble
1637
+ // editAble={false}
1638
+ ,
1603
1639
  showEmptyText: showEmptyText,
1604
1640
  summary: summary,
1605
1641
  dataSource: dataSource,
@@ -1614,30 +1650,30 @@ const TableContainerEdit = props => {
1614
1650
  }))), /*#__PURE__*/_react.default.createElement("div", {
1615
1651
  ref: bottomToolbarRef
1616
1652
  }, toolbarItemsBottom && toolbarItemsBottom.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
1617
- className: 'ui-rc-toolbar-bottom'
1653
+ className: "ui-rc-toolbar-bottom"
1618
1654
  // style={{ border: '0 1px 1px 1px solid #e0e0e0' }}
1619
1655
  ,
1620
1656
  style: {
1621
- borderBottom: '1px solid #e0e0e0',
1622
- borderRight: '1px solid #e0e0e0',
1623
- borderLeft: '1px solid #e0e0e0'
1657
+ borderBottom: "1px solid #e0e0e0",
1658
+ borderRight: "1px solid #e0e0e0",
1659
+ borderLeft: "1px solid #e0e0e0"
1624
1660
  }
1625
1661
  }, /*#__PURE__*/_react.default.createElement(_rcMasterUi.Toolbar, {
1626
1662
  style: {
1627
- width: '100%'
1663
+ width: "100%"
1628
1664
  },
1629
1665
  items: toolbarItemsBottom ?? [],
1630
- mode: 'scroll',
1666
+ mode: "scroll",
1631
1667
  onClick: ({}) => {
1632
- setEditingKey('');
1668
+ setEditingKey("");
1633
1669
  }
1634
1670
  })), pagination && !infiniteScroll && /*#__PURE__*/_react.default.createElement(_pagination.default
1635
1671
  // style={{padding: '0.75rem 1rem'}}
1636
1672
  , (0, _extends2.default)({}, pagination, {
1637
- rootClassName: 'pagination-template',
1673
+ rootClassName: "pagination-template",
1638
1674
  showSizeChanger: true,
1639
1675
  responsive: true,
1640
- size: 'small',
1676
+ size: "small",
1641
1677
  total: pagination.total,
1642
1678
  pageSize: pagination.onChange ? pagination?.pageSize : table.getState().pagination.pageSize,
1643
1679
  pageSizeOptions: [20, 50, 100, 1000, 10000],
@@ -1650,11 +1686,11 @@ const TableContainerEdit = props => {
1650
1686
  }
1651
1687
  },
1652
1688
  showTotal: (total, range) => `${(0, _reactNumericComponent.numericFormatter)((range[0] ?? 0).toString(), {
1653
- thousandSeparator: '.'
1689
+ thousandSeparator: "."
1654
1690
  })}-${(0, _reactNumericComponent.numericFormatter)((range[1] ?? 0).toString(), {
1655
- thousandSeparator: '.'
1691
+ thousandSeparator: "."
1656
1692
  })} / ${(0, _reactNumericComponent.numericFormatter)((total ?? 0).toString(), {
1657
- thousandSeparator: '.'
1693
+ thousandSeparator: "."
1658
1694
  })} items`
1659
1695
  }))));
1660
1696
  };