es-grid-template 1.9.65 → 1.9.67

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 (45) hide show
  1. package/es/ali-table/ColumnsConfig.js +1 -0
  2. package/es/ali-table/Grid.d.ts +4 -0
  3. package/es/ali-table/Grid.js +1 -0
  4. package/es/ali-table/InternalTable.js +131 -33
  5. package/es/ali-table/base-table/cell/EditCell.d.ts +0 -2
  6. package/es/ali-table/base-table/cell/EditCell.js +45 -40
  7. package/es/ali-table/base-table/styles.js +2 -2
  8. package/es/ali-table/base-table/styles.scss +14 -0
  9. package/es/ali-table/pipeline/features/columnCustom.d.ts +3 -0
  10. package/es/ali-table/pipeline/features/columnCustom.js +139 -140
  11. package/es/ali-table/pipeline/features/treeSelect.js +10 -3
  12. package/es/grid-component/type.d.ts +0 -3
  13. package/es/group-component/hook/utils.d.ts +3 -3
  14. package/es/table-component/TableContainerEdit.js +8 -7
  15. package/es/table-component/body/TableBodyCellEdit.js +5 -2
  16. package/es/table-component/hook/useColumns.js +1 -1
  17. package/es/table-component/style.js +2 -2
  18. package/es/table-component/style.scss +1 -24
  19. package/es/table-component/table/Grid.js +7 -1
  20. package/es/table-component/useContext.d.ts +1 -0
  21. package/es/table-virtuoso/InternalTable.js +0 -2
  22. package/es/table-virtuoso/body/TableBodyCell.js +7 -4
  23. package/es/table-virtuoso/style.js +1 -1
  24. package/lib/ali-table/ColumnsConfig.js +2 -0
  25. package/lib/ali-table/Grid.d.ts +4 -0
  26. package/lib/ali-table/InternalTable.js +131 -33
  27. package/lib/ali-table/base-table/cell/EditCell.d.ts +0 -2
  28. package/lib/ali-table/base-table/cell/EditCell.js +45 -40
  29. package/lib/ali-table/base-table/styles.js +2 -2
  30. package/lib/ali-table/base-table/styles.scss +14 -0
  31. package/lib/ali-table/pipeline/features/columnCustom.d.ts +3 -0
  32. package/lib/ali-table/pipeline/features/columnCustom.js +136 -139
  33. package/lib/ali-table/pipeline/features/treeSelect.js +10 -3
  34. package/lib/grid-component/type.d.ts +0 -3
  35. package/lib/table-component/TableContainerEdit.js +8 -7
  36. package/lib/table-component/body/TableBodyCellEdit.js +5 -2
  37. package/lib/table-component/hook/useColumns.js +1 -1
  38. package/lib/table-component/style.js +2 -2
  39. package/lib/table-component/style.scss +1 -24
  40. package/lib/table-component/table/Grid.js +7 -1
  41. package/lib/table-component/useContext.d.ts +1 -0
  42. package/lib/table-virtuoso/InternalTable.js +0 -2
  43. package/lib/table-virtuoso/body/TableBodyCell.js +7 -4
  44. package/lib/table-virtuoso/style.js +1 -1
  45. package/package.json +1 -1
@@ -9,7 +9,7 @@ const color = '#000000';
9
9
  const fontSize = '12px';
10
10
  const fwBody = '500';
11
11
  const fwHeader = '600';
12
- const BgColor = '#ffffff ';
12
+ // const BgColor = '#ffffff ';
13
13
 
14
14
  // const primary = "#eb4619";
15
15
 
@@ -48,4 +48,4 @@ const colorDark = '#e6e4f3e6 ';
48
48
  export const GridStyle = styled.div.withConfig({
49
49
  displayName: "GridStyle",
50
50
  componentId: "es-grid-template__sc-hdqm5k-0"
51
- })(["&.", "-grid{color:", ";font-size:", ";background-color:", ";font-family:", ";&.", "-grid-editable{.", "-grid-container{.", "-grid-tbody{.", "-grid-row{background-color:", ";color:", ";&.", "-grid-row-parent{background-color:#ffffff;font-weight:500;}}}}}table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";border-right:0;&::after{position:absolute;top:0px;right:0;z-index:1;height:100%;border-right:1px solid ", ";content:'';pointer-events:none;}.", "-grid-cell{padding:5px 8px;&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-right{justify-content:flex-end;text-align:right;}&.", "-grid-cell-link{text-decoration:underline;color:#336cc9;&:has(textarea){text-decoration:none;}}&.editable{.ui-rc_cell-content{height:100%}}&.", "-grid-cell-ellipsis{.ui-rc_cell-content{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;&.select-cell{padding-right:18px;position:relative;}.caret-down{float:right;position:absolute;right:0;&::before{content:'';display:inline-block;margin-left:4px;vertical-align:middle;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #6f7777;}}}}&.", "-grid-cell-wrap{white-space:normal;text-overflow:ellipsis;word-break:break-word;}.", "-grid-header-text-wrap{white-space:normal;overflow:hidden;text-overflow:ellipsis;word-break:break-word;}}.", "-grid-thead{background-color:", ";font-weight:", ";.", "-grid-cell{font-weight:inherit;color:", ";background-color:inherit;border-inline-end:1px solid ", ";border-bottom:1px solid ", ";&.ui-rc-grid-cell-ellipsis{.ui-rc-table-column-title,.", "-grid-cell-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}&.ui-rc-grid-cell-wrap{.ui-rc-table-column-title,.", "-grid-cell-text-wrap{white-space:normal;word-break:break-word;overflow:hidden;}}&:hover{.ui-rc-header-trigger{.ui-rc-table-column-sorter-cancel{opacity:1;}}}.", "-grid-filter-column{display:flex;justify-content:space-between;width:100%;align-items:center;position:relative;z-index:3;}.ui-rc-header-trigger{padding-left:6px;display:flex;align-items:center;.ui-rc-table-column-sorter-cancel{opacity:0;}}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;z-index:3;touch-action:none;user-select:none;width:5px;}.resizer.isResizing{opacity:1;}}}.", "-grid-tbody{.", "-grid-row{font-weight:", ";background-color:", ";color:", ";&.", "-grid-row-odd{background-color:#f9f8fd;}&.", "-grid-row-even{}&.", "-grid-row-parent{background-color:#f5f5f5;font-weight:500;}}}.", "-grid-tfoot{.", "-grid-footer-row{border-bottom-width:1px;border-bottom-color:", ";border-bottom-style:solid;border-top-width:1px;border-top-color:", ";border-top-style:solid;background-color:#fafafa;}.", "-grid-cell{background-color:inherit;border-inline-end:1px solid ", ";}}}&.", "-grid-dark{background-color:", ";color:", ";.", "-grid-container{border-color:", ";&::after{border-right-color:", ";}}}.ui-rc-toolbar-bottom{border-right:1px solid #e0e0e0;border-left:1px solid #e0e0e0;.be-toolbar-item{.ui-rc-btn{font-size:12px;line-height:1.5}.toolbar-dropdown-button{font-size:12px;.ui-rc-btn.ui-rc-btn-default.ui-rc-btn-variant-outlined.ui-rc-btn-compact-item.ui-rc-btn-compact-first-item{border-color:#28c76f;}.ui-rc-btn.ui-rc-btn-default.ui-rc-btn-variant-outlined.ui-rc-btn-compact-item.ui-rc-btn-compact-last-item{border-color:#28c76f;.ui-rc-btn-icon{color:#28c76f;}}}}}.ui-rc-toolbar-bottom_border-bottom{border-bottom:1px solid #e0e0e0;}.ui-rc-toolbar-bottom{position:relative;padding:.15rem 0.5rem;background-color:#ffffff;.toolbar-button{border-radius:3px;}.ui-rc-btn{border-radius:3px;height:28px;&.ui-rc-btn-compact-item.ui-rc-btn-compact-last-item{border-start-start-radius:0;border-end-start-radius:0;}&.ui-rc-btn-compact-item.ui-rc-btn-compact-first-item{border-start-end-radius:0;border-end-end-radius:0;}}}}"], props => props.$prefix, color, fontSize, BgColor, fontFamily, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, fwHeader, props => props.$prefix, props => `${props.$theme.color ? props.$theme.color : color}`, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, fwBody, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, tableBorderColor, props => props.$prefix, BgColorDark, colorDark, props => props.$prefix, tableBorderColorDark, tableBorderColorDark);
51
+ })(["--row-height:34px;--color:#333;--bgcolor:white;--body-hover-bgcolor:#f5f5f5;--body-hover-color:#333;--hover-bgcolor:var(--body-hover-bgcolor);--hover-color:var(--body-hover-color);--highlight-bgcolor:#eee;--header-row-height:34px;--header-color:#000000de;--header-bgcolor:#ffffff;--header-hover-bgcolor:#ddd;--header-highlight-bgcolor:#e4e8ed;--cell-padding:7px 8px;--font-size:13px;--line-height:1.28571;--lock-shadow:rgba(152,152,152,0.5) 0 0 6px 2px;--border-color:#dfe3e8;--border-color-select:#eb4619;--cell-border:1px solid var(--border-color);--cell-border-select:1px solid var(--border-color-select);--cell-border-horizontal:var(--cell-border);--cell-border-vertical:var(--cell-border);--header-cell-border:1px solid var(--border-color);--header-cell-border-horizontal:var(--header-cell-border);--header-cell-border-vertical:var(--header-cell-border);--footer-bgcolor:#fafafa;&.", "-grid{color:", ";font-size:", ";background-color:var(--bgcolor);font-family:", ";&.", "-grid-editable{.", "-grid-container{.", "-grid-tbody{.", "-grid-row{background-color:", ";color:", ";&.", "-grid-row-parent{background-color:#ffffff;font-weight:500;}}}}}table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";border-right:0;&::after{position:absolute;top:0px;right:0;z-index:1;height:100%;border-right:1px solid ", ";content:'';pointer-events:none;}.", "-grid-cell{padding:5px 8px;&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-right{justify-content:flex-end;text-align:right;}&.", "-grid-cell-link{text-decoration:underline;color:#336cc9;&:has(textarea){text-decoration:none;}}&.editable{.ui-rc_cell-content{height:100%}}&.", "-grid-cell-ellipsis{.ui-rc_cell-content{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;&.select-cell{padding-right:18px;position:relative;}.caret-down{float:right;position:absolute;right:0;&::before{content:'';display:inline-block;margin-left:4px;vertical-align:middle;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #6f7777;}}}}&.", "-grid-cell-wrap{white-space:normal;text-overflow:ellipsis;word-break:break-word;}.", "-grid-header-text-wrap{white-space:normal;overflow:hidden;text-overflow:ellipsis;word-break:break-word;}}.", "-grid-thead{background-color:var(--header-bgcolor);font-weight:", ";.", "-grid-cell{font-weight:inherit;color:", ";background-color:inherit;border-inline-end:1px solid ", ";border-bottom:1px solid ", ";&.ui-rc-grid-cell-ellipsis{.ui-rc-table-column-title,.", "-grid-cell-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}&.ui-rc-grid-cell-wrap{.ui-rc-table-column-title,.", "-grid-cell-text-wrap{white-space:normal;word-break:break-word;overflow:hidden;}}&:hover{.ui-rc-header-trigger{.ui-rc-table-column-sorter-cancel{opacity:1;}}}.", "-grid-filter-column{display:flex;justify-content:space-between;width:100%;align-items:center;position:relative;z-index:3;}.ui-rc-header-trigger{padding-left:6px;display:flex;align-items:center;.ui-rc-table-column-sorter-cancel{opacity:0;}}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;z-index:3;touch-action:none;user-select:none;width:5px;}.resizer.isResizing{opacity:1;}}}.", "-grid-tbody{.", "-grid-row{font-weight:", ";background-color:var(--bgcolor);color:", ";&.", "-grid-row-odd{background-color:#f9f8fd;}&.", "-grid-row-even{}&.", "-grid-row-parent{background-color:#f5f5f5;font-weight:500;}}}.", "-grid-tfoot{.", "-grid-footer-row{border-bottom-width:1px;border-bottom-color:", ";border-bottom-style:solid;border-top-width:1px;border-top-color:", ";border-top-style:solid;background-color:var(--footer-bgcolor);font-weight:600;}.", "-grid-cell{background-color:inherit;border-inline-end:1px solid ", ";}}}&.", "-grid-dark{background-color:", ";color:", ";.", "-grid-container{border-color:", ";&::after{border-right-color:", ";}}}.ui-rc-toolbar-bottom{border-right:1px solid #e0e0e0;border-left:1px solid #e0e0e0;.be-toolbar-item{.ui-rc-btn{font-size:12px;line-height:1.5}.toolbar-dropdown-button{font-size:12px;.ui-rc-btn.ui-rc-btn-default.ui-rc-btn-variant-outlined.ui-rc-btn-compact-item.ui-rc-btn-compact-first-item{border-color:#28c76f;}.ui-rc-btn.ui-rc-btn-default.ui-rc-btn-variant-outlined.ui-rc-btn-compact-item.ui-rc-btn-compact-last-item{border-color:#28c76f;.ui-rc-btn-icon{color:#28c76f;}}}}}.ui-rc-toolbar-bottom_border-bottom{border-bottom:1px solid #e0e0e0;}.ui-rc-toolbar-bottom{position:relative;padding:.15rem 0.5rem;background-color:#ffffff;.toolbar-button{border-radius:3px;}.ui-rc-btn{border-radius:3px;height:28px;&.ui-rc-btn-compact-item.ui-rc-btn-compact-last-item{border-start-start-radius:0;border-end-start-radius:0;}&.ui-rc-btn-compact-item.ui-rc-btn-compact-first-item{border-start-end-radius:0;border-end-end-radius:0;}}}}"], props => props.$prefix, color, fontSize, fontFamily, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : 'var(--bgcolor)'}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, fwHeader, props => props.$prefix, props => `${props.$theme.color ? props.$theme.color : color}`, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, fwBody, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, tableBorderColor, props => props.$prefix, BgColorDark, colorDark, props => props.$prefix, tableBorderColorDark, tableBorderColorDark);
@@ -442,30 +442,7 @@ $cell-index-focus-bg-Dark: #E6EFFD !default;
442
442
 
443
443
  }
444
444
 
445
- .#{$prefix}-grid-tfoot {
446
- // background-color: rgb(250, 250, 250);
447
-
448
- .#{$prefix}-grid-footer-row {
449
- border-bottom-width: 1px;
450
- border-bottom-color: $tableBorderColor;
451
- border-bottom-style: solid;
452
-
453
- border-top-width: 1px;
454
- border-top-color: $tableBorderColor;
455
- border-top-style: solid;
456
-
457
- background-color: #fafafa;
458
-
459
- }
460
-
461
- .#{$prefix}-grid-cell {
462
-
463
- background-color: inherit;
464
-
465
- border-inline-end: 1px solid $tableBorderColor;
466
- font-weight: 500;
467
- }
468
- }
445
+
469
446
 
470
447
  }
471
448
 
@@ -293,6 +293,11 @@ const Grid = props => {
293
293
  }
294
294
  }
295
295
  const sensors = useSensors(useSensor(MouseSensor, {}), useSensor(TouchSensor, {}), useSensor(KeyboardSensor, {}));
296
+ const tableWrapperProps = {
297
+ style: {
298
+ ...theme?.cssVariables
299
+ }
300
+ };
296
301
  const ContainerComponent = editAble ? TableContainerEdit : TableContainer;
297
302
  return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(GridStyle, {
298
303
  $prefix: prefix,
@@ -309,7 +314,8 @@ const Grid = props => {
309
314
  minHeight: minHeight ?? undefined,
310
315
  maxHeight: height ?? undefined,
311
316
  backgroundColor: theme?.backgroundColor ?? undefined,
312
- transition: 'max-height 0.3s ease'
317
+ transition: 'max-height 0.3s ease',
318
+ ...tableWrapperProps.style
313
319
  // overflow: 'hidden'
314
320
  }
315
321
  }, /*#__PURE__*/React.createElement(DndContext, {
@@ -44,6 +44,7 @@ export interface IContext<T> {
44
44
  innerHeight: number;
45
45
  innerWidth: number;
46
46
  };
47
+ isAddAble?: any;
47
48
  control?: any;
48
49
  errors?: any;
49
50
  handleSubmit?: any;
@@ -197,8 +197,6 @@ const InternalTable = props => {
197
197
  });
198
198
  }
199
199
  };
200
- console.log('tableData', tableData);
201
- console.log('isDataTree', isDataTree);
202
200
  const table = useReactTable({
203
201
  _features: [OperatorFeature],
204
202
  data: tableData,
@@ -345,8 +345,6 @@ const TableBodyCell = props => {
345
345
  "data-tooltip-id": `${id}-tooltip-content`,
346
346
  "data-tooltip-content": tooltipContent,
347
347
  className: classNames(`${prefix}-grid-cell`, {
348
- // [`${prefix}-grid-cell-ellipsis`]: true,
349
-
350
348
  [`${prefix}-grid-cell-ellipsis`]: !isLastLeftPinnedColumn && !isFirstRightPinnedColumn && (!wrapSettings || !(wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Content'))),
351
349
  [`${prefix}-grid-cell-text-wrap`]: wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Content'),
352
350
  // [`${prefix}-grid-cell-selected`]: isCellSelected,
@@ -437,7 +435,10 @@ const TableBodyCell = props => {
437
435
  }
438
436
  }
439
437
  }, cell.column.getIndex() === expandIconColumnIndex && isDataTree ? /*#__PURE__*/React.createElement("div", {
440
- className: classNames('ui-rc_cell-content', {})
438
+ className: classNames('ui-rc_cell-content', {}),
439
+ style: {
440
+ display: 'flex'
441
+ }
441
442
  }, cell.column.getIndex() === expandIconColumnIndex && isDataTree && /*#__PURE__*/React.createElement("div", {
442
443
  className: "ui-rc-table-row-expand-trigger",
443
444
  style: {
@@ -478,7 +479,9 @@ const TableBodyCell = props => {
478
479
  className: "ui-rc-table-row-expand-icon ui-rc-table-row-expand-icon-collapsed"
479
480
  })) : /*#__PURE__*/React.createElement("span", {
480
481
  className: "ui-rc-table-row-expand-icon ui-rc-table-row-expand-icon-spaced"
481
- }))), groupValue ? groupValue : cellContent) : /*#__PURE__*/React.createElement(React.Fragment, null, isLastLeftPinnedColumn ? /*#__PURE__*/React.createElement("div", {
482
+ }))), /*#__PURE__*/React.createElement("span", {
483
+ className: classNames('group-content')
484
+ }, groupValue ? groupValue : cellContent)) : /*#__PURE__*/React.createElement(React.Fragment, null, isLastLeftPinnedColumn ? /*#__PURE__*/React.createElement("div", {
482
485
  className: classNames('ui-rc_cell-content', {
483
486
  [`${prefix}-grid-cell-ellipsis`]: !wrapSettings || !(wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Content')),
484
487
  [`${prefix}-grid-cell-text-wrap`]: wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Content'),
@@ -11,4 +11,4 @@ const colorDark = '#e6e4f3e6';
11
11
  export const GridStyle = styled.div.withConfig({
12
12
  displayName: "GridStyle",
13
13
  componentId: "es-grid-template__sc-rs980s-0"
14
- })(["&.", "-grid{color:", ";font-size:13px;background-color:", ";table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";.", "-grid-thead{&:has(.resizer.isResizing){.", "-grid-cell{touch-action:none;user-select:none;}}.", "-grid-cell{background-color:#ffffff;&:has(.resizer.isResizing){touch-action:none;user-select:none;}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;touch-action:none;user-select:none;width:5px;}}}tbody{.", "-grid-row{&.", "-grid-row-parent{.", "-grid-cell{font-weight:600;background-color:#f5f5f5;}}}}.", "-grid-tfoot{z-index:3 !important;.ui-rc-grid-footer-row{.ui-rc-grid-cell{border-top:1px solid ", ";border-bottom:1px solid ", ";font-weight:500;}}}.", "-grid-cell{padding:5px 8px;&.", "-grid-cell-fix-left-last{.", "-grid-cell-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}&::after{position:absolute;top:0;right:0;bottom:-1px;width:30px;transform:translateX(100%);transition:box-shadow 0.3s;content:'';pointer-events:none;box-shadow:inset 10px 0 8px -8px rgba(5,5,5,0.09);}}&.", "-grid-cell-fix-right-first{.", "-grid-cell-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}&::after{position:absolute;top:0;bottom:-1px;left:0;width:30px;transform:translateX(-100%);transition:box-shadow 0.3s;content:'';pointer-events:none;box-shadow:inset -10px 0 8px -8px rgba(5,5,5,0.09);}&::before{content:'';position:absolute;inset-block:0;inset-inline-start:-1px;border-inline-start:1px solid #e0e0e0;}}.class-content:has(*){background:lightblue;}.class-content:not(:has(*)){background:lightgreen;}&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-righ{text-align:right;justify-content:flex-end;}}.", "-grid-cell:not(:has(*)){&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-right{text-align:right;justify-content:flex-end;}&.", "-grid-cell-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}}&.", "-grid-light{.", "-grid-container{.", "-grid-thead{z-index:3 !important;background-color:", ";font-weight:500;.", "-grid-cell{font-weight:inherit;color:", ";background-color:#ffffff;border-inline-end:1px solid ", ";border-bottom:1px solid ", ";&.ui-rc-grid-cell-ellipsis{.ui-rc-table-column-title,.", "-grid-cell-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}&.ui-rc-grid-cell-wrap{.ui-rc-table-column-title,.", "-grid-cell-text-wrap{white-space:normal;word-break:break-word;overflow:hidden;}}&:hover{.ui-rc-header-trigger{.ui-rc-table-column-sorter-cancel{opacity:1;}}}.", "-grid-filter-column{display:flex;justify-content:space-between;width:100%;align-items:center;position:relative;}.ui-rc-header-trigger{padding-left:6px;display:flex;align-items:center;.ui-rc-table-column-sorter-cancel{opacity:0;}}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;touch-action:none;user-select:none;width:5px;}.resizer.isResizing{opacity:1;}}}.", "-grid-tbody{.", "-grid-row{background-color:", ";color:", ";}}tbody{background-color:", ";color:", ";.", "-grid-row{&.ui-rc-grid-row-selected{.", "-grid-cell{background-color:", ";}}}.", "-grid-cell{outline:none;background-color:#ffffff;border-inline-end:1px solid ", ";border-bottom:1px solid ", ";&.ui-rc-grid-cell-selected{background-color:", " !important;}&.disable{background-color:#f0f0f0;}&.cell-editable{user-select:none;&.cell-border-top{&::after{content:'';position:absolute;top:0px;left:0;height:1px;width:100%;border-top:1px solid ", ";pointer-events:none;z-index:1;}}&.cell-border-bottom{border-bottom:1px solid ", ";}&.cell-border-left{&::before{content:'';position:absolute;top:0;left:0;height:102%;width:1px;border-left:1px solid ", ";pointer-events:none;z-index:1;}}&.cell-border-right{border-inline-end:1px solid ", ";}&.cell-paste-border-top{&::after{content:'';position:absolute;top:0px;left:0;height:1px;width:100%;border-top:1px dashed #949494;pointer-events:none;z-index:1;}&.ui-rc-grid-cell-fix-left-last{&::after{left:-100%;}}&.ui-rc-grid-cell-fix-right-first{&::after{left:100%;}}}&.cell-paste-border-bottom{border-bottom:1px dashed #949494;}&.cell-paste-border-left{&::before{content:'';position:absolute;top:0;left:0;height:102%;width:1px;border-left:1px dashed #949494;pointer-events:none;z-index:1;}}&.cell-paste-border-right{border-inline-end:1px dashed #949494;}.dragging-point{width:6px;height:6px;position:absolute;cursor:crosshair;right:0px;bottom:0px;&.hidden{display:none;}.dot-point{position:absolute;width:6px;height:6px;border-radius:0px;background-color:", ";bottom:0;right:0;}}}&.cell-editing{padding:0;&:focus-visible{outline:none;}.ant-form-item,.ant-row.ant-form-item-row,.ant-col.ant-form-item-control,.ant-form-item-control-input,.ant-form-item-control-input-content,.ant-input{height:100% !important;&:focus-visible{outline:none;}}textarea.ant-input{line-height:1.8;height:36px !important;min-height:36px !important;}input.be-cell-editing,.ant-picker,.ui-rc-select-selector,.ui-rc-table-select-selector{padding-inline:7px;}.", "-checkbox-wrapper{.", "-checkbox{background-color:red;}.", "-checkbox-input{&:focus-visible{outline:none;}}}.ant-input,.ant-picker{border-radius:0;}.ant-color-picker-trigger{height:100%;border-radius:0;.ant-color-picker-color-block{height:100%;width:100%;}}.", "-table-select-single .", "-table-select-selector,.", "-select-single .", "-select-selector,.ui-rc-table-select-selector{border-radius:0 !important;}.", "-table-select-single:not(.", "-table-select-customize-input){.", "-table-select-selector{.", "-table-select-selection-search-input{height:auto;}}}}}}.", "-grid-tfoot{.", "-grid-footer-row{border-bottom-width:1px;border-bottom-color:", ";border-bottom-style:solid;border-top-width:1px;border-top-color:", ";border-top-style:solid;background-color:#fafafa;}.", "-grid-cell{background-color:inherit;border-inline-end:1px solid ", ";}}}}&.", "-grid-dark{background-color:", ";color:", ";.", "-grid-container{border-color:", ";&::after{border-right-color:", ";}}}}"], props => props.$prefix, color, BgColor, props => props.$prefix, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => props.$prefix, props => `${props.$theme.color ? props.$theme.color : color}`, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, rowSelectedBg, props => props.$prefix, tableBorderColor, tableBorderColor, cellSelectedBg, borderSelectedColor, borderSelectedColor, borderSelectedColor, borderSelectedColor, borderSelectedColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, tableBorderColor, props => props.$prefix, BgColorDark, colorDark, props => props.$prefix, tableBorderColorDark, tableBorderColorDark);
14
+ })(["&.", "-grid{color:", ";font-size:13px;background-color:", ";table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";.", "-grid-thead{&:has(.resizer.isResizing){.", "-grid-cell{touch-action:none;user-select:none;}}.", "-grid-cell{background-color:#ffffff;&:has(.resizer.isResizing){touch-action:none;user-select:none;}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;touch-action:none;user-select:none;width:5px;}}}tbody{.", "-grid-row{&.", "-grid-row-parent{.", "-grid-cell{font-weight:600;background-color:#f5f5f5;}}}}.", "-grid-tfoot{z-index:3 !important;.ui-rc-grid-footer-row{.ui-rc-grid-cell{border-top:1px solid ", ";border-bottom:1px solid ", ";font-weight:500;}}}.", "-grid-cell{padding:5px 8px;&.", "-grid-cell-fix-left-last{.", "-grid-cell-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}&::after{position:absolute;top:0;right:0;bottom:-1px;width:30px;transform:translateX(100%);transition:box-shadow 0.3s;content:'';pointer-events:none;box-shadow:inset 10px 0 8px -8px rgba(5,5,5,0.09);}}&.", "-grid-cell-fix-right-first{.", "-grid-cell-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}&::after{position:absolute;top:0;bottom:-1px;left:0;width:30px;transform:translateX(-100%);transition:box-shadow 0.3s;content:'';pointer-events:none;box-shadow:inset -10px 0 8px -8px rgba(5,5,5,0.09);}&::before{content:'';position:absolute;inset-block:0;inset-inline-start:-1px;border-inline-start:1px solid #e0e0e0;}}&.", "-grid-cell-ellipsis{.group-content{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}.class-content:has(*){background:lightblue;}.class-content:not(:has(*)){background:lightgreen;}&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-righ{text-align:right;justify-content:flex-end;}}.", "-grid-cell:not(:has(*)){&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-right{text-align:right;justify-content:flex-end;}&.", "-grid-cell-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}}&.", "-grid-light{.", "-grid-container{.", "-grid-thead{z-index:3 !important;background-color:", ";font-weight:500;.", "-grid-cell{font-weight:inherit;color:", ";background-color:#ffffff;border-inline-end:1px solid ", ";border-bottom:1px solid ", ";&.ui-rc-grid-cell-ellipsis{.ui-rc-table-column-title,.", "-grid-cell-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}&.ui-rc-grid-cell-wrap{.ui-rc-table-column-title,.", "-grid-cell-text-wrap{white-space:normal;word-break:break-word;overflow:hidden;}}&:hover{.ui-rc-header-trigger{.ui-rc-table-column-sorter-cancel{opacity:1;}}}.", "-grid-filter-column{display:flex;justify-content:space-between;width:100%;align-items:center;position:relative;}.ui-rc-header-trigger{padding-left:6px;display:flex;align-items:center;.ui-rc-table-column-sorter-cancel{opacity:0;}}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;touch-action:none;user-select:none;width:5px;}.resizer.isResizing{opacity:1;}}}.", "-grid-tbody{.", "-grid-row{background-color:", ";color:", ";}}tbody{background-color:", ";color:", ";.", "-grid-row{&.ui-rc-grid-row-selected{.", "-grid-cell{background-color:", ";}}}.", "-grid-cell{outline:none;background-color:#ffffff;border-inline-end:1px solid ", ";border-bottom:1px solid ", ";&.ui-rc-grid-cell-selected{background-color:", " !important;}&.disable{background-color:#f0f0f0;}&.cell-editable{user-select:none;&.cell-border-top{&::after{content:'';position:absolute;top:0px;left:0;height:1px;width:100%;border-top:1px solid ", ";pointer-events:none;z-index:1;}}&.cell-border-bottom{border-bottom:1px solid ", ";}&.cell-border-left{&::before{content:'';position:absolute;top:0;left:0;height:102%;width:1px;border-left:1px solid ", ";pointer-events:none;z-index:1;}}&.cell-border-right{border-inline-end:1px solid ", ";}&.cell-paste-border-top{&::after{content:'';position:absolute;top:0px;left:0;height:1px;width:100%;border-top:1px dashed #949494;pointer-events:none;z-index:1;}&.ui-rc-grid-cell-fix-left-last{&::after{left:-100%;}}&.ui-rc-grid-cell-fix-right-first{&::after{left:100%;}}}&.cell-paste-border-bottom{border-bottom:1px dashed #949494;}&.cell-paste-border-left{&::before{content:'';position:absolute;top:0;left:0;height:102%;width:1px;border-left:1px dashed #949494;pointer-events:none;z-index:1;}}&.cell-paste-border-right{border-inline-end:1px dashed #949494;}.dragging-point{width:6px;height:6px;position:absolute;cursor:crosshair;right:0px;bottom:0px;&.hidden{display:none;}.dot-point{position:absolute;width:6px;height:6px;border-radius:0px;background-color:", ";bottom:0;right:0;}}}&.cell-editing{padding:0;&:focus-visible{outline:none;}.ant-form-item,.ant-row.ant-form-item-row,.ant-col.ant-form-item-control,.ant-form-item-control-input,.ant-form-item-control-input-content,.ant-input{height:100% !important;&:focus-visible{outline:none;}}textarea.ant-input{line-height:1.8;height:36px !important;min-height:36px !important;}input.be-cell-editing,.ant-picker,.ui-rc-select-selector,.ui-rc-table-select-selector{padding-inline:7px;}.", "-checkbox-wrapper{.", "-checkbox{background-color:red;}.", "-checkbox-input{&:focus-visible{outline:none;}}}.ant-input,.ant-picker{border-radius:0;}.ant-color-picker-trigger{height:100%;border-radius:0;.ant-color-picker-color-block{height:100%;width:100%;}}.", "-table-select-single .", "-table-select-selector,.", "-select-single .", "-select-selector,.ui-rc-table-select-selector{border-radius:0 !important;}.", "-table-select-single:not(.", "-table-select-customize-input){.", "-table-select-selector{.", "-table-select-selection-search-input{height:auto;}}}}}}.", "-grid-tfoot{.", "-grid-footer-row{border-bottom-width:1px;border-bottom-color:", ";border-bottom-style:solid;border-top-width:1px;border-top-color:", ";border-top-style:solid;background-color:#fafafa;}.", "-grid-cell{background-color:inherit;border-inline-end:1px solid ", ";}}}}&.", "-grid-dark{background-color:", ";color:", ";.", "-grid-container{border-color:", ";&::after{border-right-color:", ";}}}}"], props => props.$prefix, color, BgColor, props => props.$prefix, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => props.$prefix, props => `${props.$theme.color ? props.$theme.color : color}`, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, rowSelectedBg, props => props.$prefix, tableBorderColor, tableBorderColor, cellSelectedBg, borderSelectedColor, borderSelectedColor, borderSelectedColor, borderSelectedColor, borderSelectedColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, tableBorderColor, props => props.$prefix, BgColorDark, colorDark, props => props.$prefix, tableBorderColorDark, tableBorderColorDark);
@@ -12,6 +12,8 @@ var _aliTable = _interopRequireDefault(require("../ali-table"));
12
12
  var _hooks = require("../grid-component/hooks");
13
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
+ // import TableAli from '../table-template'
16
+
15
17
  const align = {
16
18
  left: 'Left',
17
19
  right: 'Right'
@@ -5,6 +5,7 @@ import './base-table/styles.scss';
5
5
  import type { BaseTable } from "./base-table/table";
6
6
  import type { VirtualEnum } from "./base-table/interfaces";
7
7
  import type { TableProps } from "../grid-component";
8
+ import type { ToolbarItem } from "../grid-component/type";
8
9
  declare const Grid: React.ForwardRefExoticComponent<Omit<TableProps, "useVirtual"> & {
9
10
  isFullScreen: boolean;
10
11
  setIsFullScreen: Dispatch<SetStateAction<boolean>>;
@@ -18,5 +19,8 @@ declare const Grid: React.ForwardRefExoticComponent<Omit<TableProps, "useVirtual
18
19
  header?: VirtualEnum;
19
20
  };
20
21
  dataRowIds: any[];
22
+ toolbarItemTopRight?: ToolbarItem[];
23
+ toolbarItemsTop?: ToolbarItem[];
24
+ toolbarItemsBottom?: ToolbarItem[];
21
25
  } & React.RefAttributes<BaseTable>>;
22
26
  export default Grid;
@@ -35,6 +35,7 @@ var _reactNumericComponent = require("react-numeric-component");
35
35
  var _moment = _interopRequireDefault(require("moment"));
36
36
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
37
37
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
38
+ // import { createPortal } from "react-dom"
38
39
  const MySwal = (0, _sweetalert2ReactContent.default)(_sweetalert.default);
39
40
  const {
40
41
  Paragraph,
@@ -179,6 +180,12 @@ const InternalTable = props => {
179
180
  return (0, _utils.getVisibleFields)(columns);
180
181
  }, [columns]);
181
182
  const dataIds = _react.default.useMemo(() => convertData.map(it => it.rowId), [convertData]);
183
+ const isAddAble = _react.default.useMemo(() => {
184
+ if (!toolbarItems) {
185
+ return false;
186
+ }
187
+ return toolbarItems.find(it => it.key === 'ADD') ? true : false;
188
+ }, [toolbarItems]);
182
189
 
183
190
  // const columnVisibility = React.useMemo(() => {
184
191
  // return getVisibleFields(columns)
@@ -319,11 +326,103 @@ const InternalTable = props => {
319
326
  if (!onCellChange) {
320
327
  onSubmit(record);
321
328
  }
322
- }
323
- if (prevState && newState && prevState !== newState && changeType === 'enter') {
329
+ } else if (prevState && newState && prevState !== newState && changeType === 'enter') {
324
330
  onSubmit(record);
325
331
  }
326
332
  };
333
+ const onSubmit2 = (formData, newOriginData) => {
334
+ try {
335
+ // const record = (await form.validateFields()) as RecordType;
336
+ const row = {
337
+ ...formData
338
+ };
339
+
340
+ // const newData = [...dataSource]
341
+ const newData = [...newOriginData];
342
+
343
+ // @ts-ignore
344
+ const index = (0, _utils.flattenData)(childrenColumnName, newData).findIndex(item => formData[rowKey] === item[rowKey]);
345
+ const rs = (0, _utils.updateArrayByKey)(newData, row, rowKey);
346
+ if (index > -1) {
347
+ triggerChangeData?.(rs, {
348
+ type: 'CellChange'
349
+ });
350
+ }
351
+ } catch (errInfo) {
352
+ console.log('Validate Failed:', errInfo);
353
+ }
354
+ };
355
+ const handleCellChangeAndAddRow = args => {
356
+ const {
357
+ record,
358
+ type: changeType,
359
+ newState,
360
+ option,
361
+ field,
362
+ indexCol,
363
+ indexRow,
364
+ key
365
+ } = args;
366
+
367
+ // add new row
368
+
369
+ const defaultRowValue = (0, _utils.getDefaultValue)(defaultValue);
370
+ const newRowId = (0, _utils.newGuid)();
371
+ const newRows = Array.from({
372
+ length: 1
373
+ }).map(() => defaultRowValue ? {
374
+ ...defaultRowValue,
375
+ id: undefined,
376
+ rowId: newRowId
377
+ } : {
378
+ id: undefined,
379
+ rowId: newRowId
380
+ });
381
+
382
+ // const kkk = getAllRowKey(newRows) ?? []
383
+
384
+ // const rs = mergedFilterKeys ? [...mergedFilterKeys, ...kkk] : [...kkk]
385
+
386
+ // setMergedFilterKeys?.(rs)
387
+
388
+ const newData = convertData.concat(newRows);
389
+ if (changeType === 'blur') {
390
+ const handleChangeCallback = callbackData => {
391
+ const callbackRecord = callbackData;
392
+ onSubmit2(callbackRecord, [...newData]);
393
+ };
394
+ if (onCellChange) {
395
+ if (onCellChange.length > 1) {
396
+ onCellChange({
397
+ field,
398
+ indexCol,
399
+ type: 'onChange',
400
+ value: newState,
401
+ option,
402
+ indexRow,
403
+ rowData: record,
404
+ rowId: key,
405
+ rowsData: [...newData],
406
+ sumValue: []
407
+ }, handleChangeCallback);
408
+ } else {
409
+ onCellChange({
410
+ field,
411
+ indexCol,
412
+ type: 'onChange',
413
+ option,
414
+ value: newState,
415
+ indexRow,
416
+ rowData: record,
417
+ rowId: key,
418
+ rowsData: [...newData],
419
+ sumValue: []
420
+ }, handleChangeCallback);
421
+ onSubmit2(record, [...newData]);
422
+ }
423
+ }
424
+ }
425
+ };
327
426
  const handleHeaderCellChange = args => {
328
427
  const {
329
428
  record,
@@ -359,6 +458,27 @@ const InternalTable = props => {
359
458
  onSubmit(record);
360
459
  }
361
460
  };
461
+ const handleAddMulti = _react.default.useCallback((item, n, newId) => {
462
+ if (item.onClick) {
463
+ item.onClick({
464
+ toolbar: item
465
+ });
466
+ } else {
467
+ const defaultRowValue = (0, _utils.getDefaultValue)(defaultValue);
468
+ const newRows = Array.from({
469
+ length: n
470
+ }).map(() => defaultRowValue ? {
471
+ ...defaultRowValue,
472
+ id: undefined,
473
+ rowId: n === 1 && newId ? newId : (0, _utils.newGuid)()
474
+ } : {
475
+ id: undefined,
476
+ rowId: n === 1 && newId ? newId : (0, _utils.newGuid)()
477
+ });
478
+ const newData = convertData.concat(newRows);
479
+ triggerChangeData?.(newData);
480
+ }
481
+ }, [convertData, defaultValue, triggerChangeData]);
362
482
  const pipeline = (0, _pipeline.useTablePipeline)({
363
483
  components: fusion
364
484
  }).input({
@@ -391,7 +511,7 @@ const InternalTable = props => {
391
511
  checkboxColumn: {
392
512
  lock: true
393
513
  },
394
- clickArea: selectionSettings?.checkboxOnly ? 'checkbox' : 'row',
514
+ clickArea: selectionSettings?.checkboxOnly || editAble ? 'checkbox' : 'row',
395
515
  // clickArea: 'row',
396
516
  onChange: (nextValue, rowData, type) => {
397
517
  const rs = (0, _selected.getRowsByKeysKeepTreeOrder)(nextValue, mergedData ?? [], rowKey);
@@ -450,6 +570,7 @@ const InternalTable = props => {
450
570
  },
451
571
  // Edit
452
572
  editAble,
573
+ isAddAble,
453
574
  rowEditable,
454
575
  setValue,
455
576
  reset,
@@ -464,11 +585,15 @@ const InternalTable = props => {
464
585
  handleHeaderCellChange,
465
586
  headerData,
466
587
  triggerChangeData,
467
- onCellClick
588
+ onCellClick,
589
+ handleAddMulti,
590
+ handleCellChangeAndAddRow
468
591
  })).use(_pipeline.features.paginationFeature({
469
592
  pagination
470
593
  }));
471
594
 
595
+ // const editingCell = pipeline.getStateAtKey(stateKeyIsEditing)
596
+
472
597
  // const onResizeEnd = (args: any[]) => {
473
598
 
474
599
  // }
@@ -674,34 +799,6 @@ const InternalTable = props => {
674
799
  }
675
800
  }
676
801
  }, [commandSettings, t, triggerChangeData]);
677
- const handleAddMulti = _react.default.useCallback((item, n, newId) => {
678
- if (item.onClick) {
679
- item.onClick({
680
- toolbar: item
681
- });
682
- } else {
683
- const defaultRowValue = (0, _utils.getDefaultValue)(defaultValue);
684
- const newRows = Array.from({
685
- length: n
686
- }).map(() => defaultRowValue ? {
687
- ...defaultRowValue,
688
- id: undefined,
689
- rowId: n === 1 && newId ? newId : (0, _utils.newGuid)()
690
- } : {
691
- id: undefined,
692
- rowId: n === 1 && newId ? newId : (0, _utils.newGuid)()
693
- });
694
-
695
- // const kkk = getAllRowKey(newRows) ?? []
696
-
697
- // const rs = mergedFilterKeys ? [...mergedFilterKeys, ...kkk] : [...kkk]
698
-
699
- // setMergedFilterKeys?.(rs)
700
-
701
- const newData = convertData.concat(newRows);
702
- triggerChangeData?.(newData);
703
- }
704
- }, [convertData, defaultValue, triggerChangeData]);
705
802
  const handleDuplicate = _react.default.useCallback(() => {
706
803
  // không tính tree
707
804
 
@@ -1026,7 +1123,8 @@ const InternalTable = props => {
1026
1123
  };
1027
1124
  document.addEventListener('keydown', handleKeyDown);
1028
1125
  return () => document.removeEventListener('keydown', handleKeyDown);
1029
- }, [startCell, endCell, copySelectionToClipboard, isEditing, convertData, triggerChangeData, leafColumns, handleCellChange, rangeState?.rowRange, rangeState?.colRange]);
1126
+ }, [startCell, endCell, copySelectionToClipboard, isEditing, convertData, triggerChangeData, leafColumns, rangeState?.rowRange, rangeState?.colRange]);
1127
+ // }, [startCell, endCell, copySelectionToClipboard, isEditing, convertData, triggerChangeData, leafColumns, handleCellChange, rangeState?.rowRange, rangeState?.colRange]);
1030
1128
 
1031
1129
  // Copy
1032
1130
 
@@ -12,12 +12,10 @@ interface EditableCellProps<DataType> extends React.HTMLAttributes<HTMLElement>
12
12
  indexCol: number;
13
13
  cellEditing?: any;
14
14
  visibleColumns?: Column<DataType>[];
15
- handleNextCell?: () => void;
16
15
  control?: any;
17
16
  getValues?: any;
18
17
  errors?: any;
19
18
  rowKey?: any;
20
- startCell?: any;
21
19
  handleCellChange?: any;
22
20
  tableId: string;
23
21
  onSubmit: any;
@@ -59,7 +59,7 @@ const EditCell = props => {
59
59
  handleCellChange,
60
60
  errors,
61
61
  tableId,
62
- startCell,
62
+ // startCell,
63
63
  rowKey,
64
64
  t,
65
65
  // handleNextCell,
@@ -134,8 +134,8 @@ const EditCell = props => {
134
134
  format: dateFormat,
135
135
  type: 'mask'
136
136
  },
137
- autoFocus: column.field === startCell?.colId,
138
- defaultOpen: column.field === startCell?.colId,
137
+ autoFocus: true,
138
+ defaultOpen: true,
139
139
  style: {
140
140
  width: '100%',
141
141
  height: '100%'
@@ -209,8 +209,8 @@ const EditCell = props => {
209
209
  status: isInvalid ? 'error' : undefined,
210
210
  "data-tooltip-content": message,
211
211
  "data-tooltip-id": `${tableId}-tooltip-error`,
212
- autoFocus: column.field === startCell?.colId,
213
- defaultOpen: column.field === startCell?.colId
212
+ autoFocus: true,
213
+ defaultOpen: true
214
214
  // needConfirm={true}
215
215
  ,
216
216
 
@@ -270,8 +270,8 @@ const EditCell = props => {
270
270
  status: isInvalid ? 'error' : undefined,
271
271
  "data-tooltip-content": message,
272
272
  "data-tooltip-id": `${tableId}-tooltip-error`,
273
- autoFocus: column.field === startCell?.colId,
274
- defaultOpen: column.field === startCell?.colId
273
+ autoFocus: true,
274
+ defaultOpen: true
275
275
  });
276
276
  case 'week':
277
277
  const weekFormat = (0, _utils.getDatepickerFormat)(editType, cellFormat);
@@ -292,8 +292,8 @@ const EditCell = props => {
292
292
  status: isInvalid ? 'error' : undefined,
293
293
  "data-tooltip-content": message,
294
294
  "data-tooltip-id": `${tableId}-tooltip-error`,
295
- autoFocus: column.field === startCell?.colId,
296
- defaultOpen: column.field === startCell?.colId
295
+ autoFocus: true,
296
+ defaultOpen: true
297
297
  });
298
298
  case 'time':
299
299
  const timeFormat = (0, _utils.getDatepickerFormat)(editType, cellFormat);
@@ -336,8 +336,8 @@ const EditCell = props => {
336
336
  status: isInvalid ? 'error' : undefined,
337
337
  "data-tooltip-content": message,
338
338
  "data-tooltip-id": `${tableId}-tooltip-error`,
339
- autoFocus: column.field === startCell?.colId,
340
- defaultOpen: column.field === startCell?.colId
339
+ autoFocus: true,
340
+ defaultOpen: true
341
341
 
342
342
  // onChange={(newDate, dateString) => {
343
343
 
@@ -519,13 +519,13 @@ const EditCell = props => {
519
519
  width: '100%',
520
520
  height: '100%'
521
521
  },
522
- defaultOpen: column.field === startCell?.colId,
523
- autoFocus: column.field === startCell?.colId,
522
+ defaultOpen: true,
523
+ autoFocus: true,
524
524
  placeholder: t && column.placeholder ? t(column.placeholder) : tableLocal?.selectPlaceholder,
525
525
  allowClear: column.isClearable ?? false,
526
526
  maxTagCount: 'responsive',
527
527
  rowKey: keySelect,
528
- popupMatchSelectWidth: menuWidth ? menuWidth + 10 : undefined,
528
+ popupMatchSelectWidth: menuWidth ? menuWidth + 10 : (column.width ?? 150) + 10,
529
529
  optionFilterProp: "label",
530
530
  popupClassName: 'be-popup-container',
531
531
  loadOptions: loadOptions,
@@ -666,8 +666,8 @@ const EditCell = props => {
666
666
  showSearch: true,
667
667
  mode: isMulti || selectMode === 'checkbox' ? 'multiple' : undefined,
668
668
  valueSelectAble: true,
669
- defaultOpen: column.field === startCell?.colId,
670
- autoFocus: column.field === startCell?.colId,
669
+ defaultOpen: true,
670
+ autoFocus: true,
671
671
  style: {
672
672
  width: '100%',
673
673
  height: '100%'
@@ -807,8 +807,8 @@ const EditCell = props => {
807
807
  // autoDestroy={true}
808
808
  ,
809
809
  showSearch: true,
810
- defaultOpen: column.field === startCell?.colId,
811
- autoFocus: column.field === startCell?.colId,
810
+ defaultOpen: true,
811
+ autoFocus: true,
812
812
  mode: isMulti || selectMode === 'checkbox' ? 'multiple' : undefined,
813
813
  valueSelectAble: true,
814
814
  style: {
@@ -911,8 +911,8 @@ const EditCell = props => {
911
911
  treeData: newTreeData,
912
912
  placeholder: t && column.placeholder ? t(column.placeholder) : tableLocal?.selectPlaceholder,
913
913
  treeDefaultExpandAll: true,
914
- defaultOpen: column.field === startCell?.colId,
915
- autoFocus: column.field === startCell?.colId,
914
+ defaultOpen: true,
915
+ autoFocus: true,
916
916
  virtual: true,
917
917
  allowClear: true,
918
918
  showSearch: true,
@@ -1156,7 +1156,7 @@ const EditCell = props => {
1156
1156
  'be-cell-edit-align-left': column.align === 'left',
1157
1157
  'be-cell-edit-align-right': !column.align || column.align === 'right'
1158
1158
  }),
1159
- autoFocus: column.field === startCell?.colId,
1159
+ autoFocus: true,
1160
1160
  onValueChange: values => {
1161
1161
  onChange(values?.floatValue || 0);
1162
1162
  },
@@ -1189,9 +1189,10 @@ const EditCell = props => {
1189
1189
  return /*#__PURE__*/_react.default.createElement(TextArea, {
1190
1190
  id: `col${indexCol}-record${indexRow}`,
1191
1191
  style: {
1192
- textAlign: column.align,
1192
+ // textAlign: column.align,
1193
1193
  resize: 'none',
1194
1194
  height: '100%'
1195
+ // maxHeight: 'none'
1195
1196
  },
1196
1197
  disabled: (0, _utils.isDisable)(column, record) ?? false,
1197
1198
  className: (0, _classnames.default)('be-cell-editing rounded-0 input-element'),
@@ -1217,26 +1218,30 @@ const EditCell = props => {
1217
1218
  type: 'blur'
1218
1219
  });
1219
1220
  }
1220
- },
1221
- onPressEnter: () => {
1222
- const formState = getValues();
1223
- const newState = getValues(dataIndex);
1224
- // @ts-ignore
1225
- const prevState = record[dataIndex];
1221
+ }
1226
1222
 
1227
- // @ts-ignore
1223
+ // onPressEnter={() => {
1224
+
1225
+ // const formState = getValues()
1226
+ // const newState = getValues(dataIndex)
1227
+ // // @ts-ignore
1228
+ // const prevState = record[dataIndex]
1229
+
1230
+ // // @ts-ignore
1231
+
1232
+ // handleCellChange?.({
1233
+ // key: key as any,
1234
+ // newState,
1235
+ // prevState,
1236
+ // record: formState,
1237
+ // indexCol,
1238
+ // indexRow,
1239
+ // type: 'enter'
1240
+ // })
1241
+ // // }
1242
+ // }}
1243
+ ,
1228
1244
 
1229
- handleCellChange?.({
1230
- key: key,
1231
- newState,
1232
- prevState,
1233
- record: formState,
1234
- indexCol,
1235
- indexRow,
1236
- type: 'enter'
1237
- });
1238
- // }
1239
- },
1240
1245
  onChange: onChange,
1241
1246
  status: isInvalid ? 'error' : undefined,
1242
1247
  "data-tooltip-content": message,