es-grid-template 1.9.65 → 1.9.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) 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/style.js +2 -2
  17. package/es/table-component/style.scss +1 -24
  18. package/es/table-component/table/Grid.js +7 -1
  19. package/es/table-component/useContext.d.ts +1 -0
  20. package/es/table-virtuoso/InternalTable.js +0 -2
  21. package/es/table-virtuoso/body/TableBodyCell.js +7 -4
  22. package/es/table-virtuoso/style.js +1 -1
  23. package/lib/ali-table/ColumnsConfig.js +2 -0
  24. package/lib/ali-table/Grid.d.ts +4 -0
  25. package/lib/ali-table/InternalTable.js +131 -33
  26. package/lib/ali-table/base-table/cell/EditCell.d.ts +0 -2
  27. package/lib/ali-table/base-table/cell/EditCell.js +45 -40
  28. package/lib/ali-table/base-table/styles.js +2 -2
  29. package/lib/ali-table/base-table/styles.scss +14 -0
  30. package/lib/ali-table/pipeline/features/columnCustom.d.ts +3 -0
  31. package/lib/ali-table/pipeline/features/columnCustom.js +136 -139
  32. package/lib/ali-table/pipeline/features/treeSelect.js +10 -3
  33. package/lib/grid-component/type.d.ts +0 -3
  34. package/lib/table-component/TableContainerEdit.js +8 -7
  35. package/lib/table-component/body/TableBodyCellEdit.js +5 -2
  36. package/lib/table-component/style.js +2 -2
  37. package/lib/table-component/style.scss +1 -24
  38. package/lib/table-component/table/Grid.js +7 -1
  39. package/lib/table-component/useContext.d.ts +1 -0
  40. package/lib/table-virtuoso/InternalTable.js +0 -2
  41. package/lib/table-virtuoso/body/TableBodyCell.js +7 -4
  42. package/lib/table-virtuoso/style.js +1 -1
  43. package/package.json +1 -1
@@ -68,11 +68,11 @@ const outerBorderStyleMixin = (0, _styledComponents.css)(["border-top:var(--cell
68
68
  const StyleTableContainer = exports.StyleTableContainer = _styledComponents.default.div.withConfig({
69
69
  displayName: "StyleTableContainer",
70
70
  componentId: "es-grid-template__sc-ipj1ht-0"
71
- })(["--row-height:34px;--color:#333;--bgcolor:white;--body-hover-bgcolor:#f5f5f5;--body-hover-color:#333;--hover-bgcolor:var(--body-hover-bgcolor,#f5f5f5);--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;&.", "{--bgcolor:#343e59;--footer-bgcolor:#2e3342;--header-bgcolor:#343e59;--hover-bgcolor:#232b43;--header-hover-bgcolor:#606164;--highlight-bgcolor:#eff2f5;--header-highlight-bgcolor:#191a1b;--hover-color:#dadde1;--color:#dadde1;--header-color:#dadde1;--lock-shadow:rgb(37 37 37 / 0.5) 0 0 6px 2px;--border-color:#4f5266;background-color:var(--bgcolor);}&.use-outer-border{", ";}&.", "{.", "{border-left:0;border-right:0;td,th{border-right:0;}td.first,th.first{border-left:0;}td.last,th.last{}thead tr.first th,tbody tr.first td{}tr{td{&.lock-left,&.lock-right{border-bottom-width:0;box-shadow:0 -1px 0 0 var(--border-color),0 0px 0 0 var(--border-color),0px 0 0 0 var(--border-color);}}}&.has-footer tfoot tr.last td{}&.has-footer tbody tr.last td{}&.has-footer tfoot tr td{}&:not(.has-footer) tbody tr.last td{}&:has(.", ") thead tr.first th{}}}&.", "{&.use-outer-border{border-bottom:var(--header-cell-border);}.", "{border-top:0;td,th{border-bottom:0;border-top:0;}td.lock-left{box-shadow:none;}td.first,th.first{}td.last,th.last{}thead tr.first th,tbody tr.first td{}&.has-footer tfoot tr td{border-bottom:0;border-top:0;}&.has-footer tbody tr.last td{}&.has-footer tfoot tr td{}&:not(.has-footer) tbody tr.last td{}&:has(.", ") thead tr.first th{}}}&.", "{.", "{border:0;td,th{border-right:0;border-bottom:0;}td.lock-left{box-shadow:none;}td,th{border:0;}td.last,th.last{}thead tr.first th,tbody tr.first td{}&.has-footer tfoot tr td{border-bottom:0;border-top:0;}&.has-footer tbody tr.last td{}&.has-footer tfoot tr td{}&:not(.has-footer) tbody tr.last td{}&:has(.", ") thead tr.first th{border-top:0;border:0;}}}.", "{padding:8px;}&.ui-rc-grid .ui-rc-pagination{background-color:var(--bgcolor);color:var(--color);padding:10px;background-color:var(--bgcolor);.ui-rc-pagination-prev{.anticon.anticon-left{color:var(--color);}}.ui-rc-pagination-disabled{.anticon.anticon-left{color:#7d7a7a;}}.ui-rc-pagination-next{.anticon.anticon-right{color:var(--color);}&.ui-rc-pagination-disabled{.anticon.anticon-right{color:#7d7a7a;}}}}&.auto-height{.ui-rc-grid-bottom{border-top:0;}}.ui-rc-grid-bottom{border-top:var(--cell-border-horizontal);}.ui-rc-toolbar-bottom{.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{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;}}}&.", "{&.ui-rc-grid{.ui-rc-toolbar-bottom{background-color:var(--footer-bgcolor);color:#ffffff;}}.ui-rc-grid-top-toolbar{border-color:var(--border-color);color:#ffffff;}.ui-rc-toolbar{.ui-rc-toolbar-selection-item{background-color:var(--footer-bgcolor);color:#ffffff;}}}"], Classes.tableThemeDark, outerBorderStyleMixin, Classes.gridHorizontal, Classes.tableWrapper, Classes.tableTop, Classes.gridVertical, Classes.tableWrapper, Classes.tableTop, Classes.gridNone, Classes.tableWrapper, Classes.tableTop, Classes.tableTop, Classes.tableThemeDark);
71
+ })(["--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;&.", "{--bgcolor:#343e59;--footer-bgcolor:#2e3342;--header-bgcolor:#343e59;--hover-bgcolor:#232b43;--header-hover-bgcolor:#606164;--highlight-bgcolor:#eff2f5;--header-highlight-bgcolor:#191a1b;--hover-color:#dadde1;--color:#dadde1;--header-color:#dadde1;--lock-shadow:rgb(37 37 37 / 0.5) 0 0 6px 2px;--border-color:#4f5266;background-color:var(--bgcolor);}&.use-outer-border{", ";}&.", "{.", "{border-left:0;border-right:0;td,th{border-right:0;}td.first,th.first{border-left:0;}td.last,th.last{}thead tr.first th,tbody tr.first td{}tr{td{&.lock-left,&.lock-right{border-bottom-width:0;box-shadow:0 -1px 0 0 var(--border-color),0 0px 0 0 var(--border-color),0px 0 0 0 var(--border-color);}}}&.has-footer tfoot tr.last td{}&.has-footer tbody tr.last td{}&.has-footer tfoot tr td{}&:not(.has-footer) tbody tr.last td{}&:has(.", ") thead tr.first th{}}}&.", "{&.use-outer-border{border-bottom:var(--header-cell-border);}.", "{border-top:0;td,th{border-bottom:0;border-top:0;}td.lock-left{box-shadow:none;}td.first,th.first{}td.last,th.last{}thead tr.first th,tbody tr.first td{}&.has-footer tfoot tr td{border-bottom:0;border-top:0;}&.has-footer tbody tr.last td{}&.has-footer tfoot tr td{}&:not(.has-footer) tbody tr.last td{}&:has(.", ") thead tr.first th{}}}&.", "{.", "{border:0;td,th{border-right:0;border-bottom:0;}td.lock-left{box-shadow:none;}td,th{border:0;}td.last,th.last{}thead tr.first th,tbody tr.first td{}&.has-footer tfoot tr td{border-bottom:0;border-top:0;}&.has-footer tbody tr.last td{}&.has-footer tfoot tr td{}&:not(.has-footer) tbody tr.last td{}&:has(.", ") thead tr.first th{border-top:0;border:0;}}}.", "{padding:8px;}&.ui-rc-grid .ui-rc-pagination{background-color:var(--bgcolor);color:var(--color);padding:10px;background-color:var(--bgcolor);.ui-rc-pagination-prev{.anticon.anticon-left{color:var(--color);}}.ui-rc-pagination-disabled{.anticon.anticon-left{color:#7d7a7a;}}.ui-rc-pagination-next{.anticon.anticon-right{color:var(--color);}&.ui-rc-pagination-disabled{.anticon.anticon-right{color:#7d7a7a;}}}}&.auto-height{.ui-rc-grid-bottom{border-top:0;}}.ui-rc-grid-bottom{border-top:var(--cell-border-horizontal);}.ui-rc-toolbar-bottom{.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{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;}}}&.", "{&.ui-rc-grid{.ui-rc-toolbar-bottom{background-color:var(--footer-bgcolor);color:#ffffff;}}.ui-rc-grid-top-toolbar{border-color:var(--border-color);color:#ffffff;}.ui-rc-toolbar{.ui-rc-toolbar-selection-item{background-color:var(--footer-bgcolor);color:#ffffff;}}}"], Classes.tableThemeDark, outerBorderStyleMixin, Classes.gridHorizontal, Classes.tableWrapper, Classes.tableTop, Classes.gridVertical, Classes.tableWrapper, Classes.tableTop, Classes.gridNone, Classes.tableWrapper, Classes.tableTop, Classes.tableTop, Classes.tableThemeDark);
72
72
  const StyledArtTableWrapper = exports.StyledArtTableWrapper = _styledComponents.default.div.withConfig({
73
73
  displayName: "StyledArtTableWrapper",
74
74
  componentId: "es-grid-template__sc-ipj1ht-1"
75
- })(["box-sizing:border-box;*{box-sizing:border-box;}cursor:default;color:var(--color);font-size:var(--font-size);line-height:var(--line-height);position:relative;overflow-anchor:none;&::-webkit-scrollbar{}&::-webkit-scrollbar-track{}&::-webkit-scrollbar-thumb{}&::-webkit-scrollbar-thumb:hover{}&.dark{&::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.3);}&::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,0.5);}}&.", "{border-left:var(--cell-border-vertical);border-right:var(--cell-border-vertical);border-top:var(--cell-border-vertical);border-bottom:0;&.has-footer{border-bottom:0;.", "{td{}}}&.has-vertical-scroll{border-bottom:var(--cell-border-vertical);th.first{border-left:0;}td.first{border-left:0;}&.has-footer{border-bottom:var(--cell-border-vertical);}.", "{tr.last{td{border-bottom:0;}}}.", "{tr.last{td{border-bottom:0;}}}+ .ui-rc-grid-bottom{border-top:0;}&:not(.has-footer){+ .ui-rc-grid-bottom{border-top:var(--cell-border-vertical);}}}&:not(.has-vertical-scroll){border-left:0;border-right:0;}&:not(.has-header){border-top:0;}}&.use-outer-border{}.no-scrollbar{scrollbar-width:none;::-webkit-scrollbar{}}.", "{overflow-x:auto;overflow-y:hidden;background:var(--header-bgcolor);.ui-rc-table-column-title{flex:1;min-width:0;text-align:start;}.", "{font-weight:500;.ui-rc-header-trigger{padding-left:6px;display:flex;align-items:center;.ui-rc-table-column-sorter-cancel{opacity:0;}}&:hover{.ui-rc-header-trigger{.ui-rc-table-column-sorter-cancel{opacity:1;}}}.", "{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}.", "{width:100%;white-space:normal;word-break:break-word;}.", "{text-align:center;}.", "{text-align:right;}}}.", "{.", "{&.", "{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;.expansion-cell{.expansion-content{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}}&.", "{width:100%;white-space:normal;word-break:break-word;}&.", "{text-align:center;}&.", "{text-align:right;}}.", "{background:var(--footer-bgcolor);}}.", ",.", "{overflow-x:auto;overflow-y:hidden;}&.sticky-header .", "{position:sticky;top:0;z-index:", ";}&.sticky-footer .", "{position:sticky;bottom:0;z-index:", ";}.", "{tr{td.cell-edit{&.lock-left,&.lock-right{}}td.first{&.lock-left{border-bottom-width:1px;}}}tr.ui-rc-grid-table-row{td.cell-edit.cell-border-bottom{}}}table{width:100%;table-layout:fixed;border-collapse:separate;border-spacing:0;display:table;margin:0;padding:0;}tr:not(.no-hover):hover > td{background:var(--hover-bgcolor);color:var(--hover-color);}tr:not(.no-highlight).highlight > td{}th{font-weight:normal;text-align:left;padding:var(--cell-padding);height:var(--header-row-height);color:var(--header-color);background:var(--header-bgcolor);border:none;border-right:var(--header-cell-border-vertical);border-bottom:var(--header-cell-border-horizontal);&.", "{background-color:#fcf5f2;}&.cell-border-bottom{border-bottom:var(--cell-border-select);}&.cell-border-right{border-right:var(--cell-border-select);}&.cell-border-left{position:relative;}&.cell-border-top{position:relative;}&.cell-border-left::before{content:'';position:absolute;top:0;left:0;height:102%;width:1px;border-left:var(--cell-border-select);pointer-events:none;z-index:1;}&.cell-border-top::after{content:'';position:absolute;top:0px;left:0;height:1px;width:100%;border-top:var(--cell-border-select);pointer-events:none;z-index:1;}textarea.ui-rc-input{line-height:1.8;max-height:calc(var(--header-row-height) - 1px) !important;min-height:calc(var(--header-row-height) - 1px) !important;}}tr.first th{}th.first{border-left:var(--header-cell-border-vertical);}td{padding:var(--cell-padding);background:var(--bgcolor);height:var(--row-height);border:none;border-right:var(--cell-border-vertical);border-bottom:var(--cell-border-horizontal);outline:none;&.cell-edit{user-select:none;&:has(.dragging-point){position:relative;}.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:var(--border-color-select);bottom:0;right:0;}}&.disable{background-color:#f0f0f0;}}&.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,.ui-rc-input{height:100% !important;&:focus-visible{outline:none;}}.ui-rc-color-picker-trigger{width:100%;border-radius:0;.ui-rc-color-picker-color-block{width:100%;}}textarea.ui-rc-input{line-height:1.8;max-height:calc(var(--row-height) - 1px) !important;min-height:calc(var(--row-height) - 1px) !important;}input.be-cell-editing,.ant-picker,.ui-rc-picker,.ui-rc-select-selector,.ui-rc-table-select-selector{padding-inline:7px;}.#{$prefix}-checkbox-wrapper{.#{$prefix}-checkbox{background-color:red;}.#{$prefix}-checkbox-input{&:focus-visible{outline:none;}}}.ant-input,.ant-picker,.ui-rc-picker{border-radius:0;}.ant-color-picker-trigger{height:100%;border-radius:0;.ant-color-picker-color-block{height:100%;width:100%;}}.#{$prefix}-table-select-single .#{$prefix}-table-select-selector,.#{$prefix}-select-single .#{$prefix}-select-selector,.ui-rc-table-select-selector{border-radius:0 !important;}.#{$prefix}-table-select-single:not( .#{$prefix}-table-select-customize-input ){.#{$prefix}-table-select-selector{.#{$prefix}-table-select-selection-search-input{height:auto;}}}}.abccccc{box-shadow:0 -1px 0 0 var(--border-color),0 1px 0 0 var(--border-color),-1px 0 0 0 var(--border-color),1px 0 0 0 var(--border-color);}&.", "{background-color:#fcf5f2;}&.cell-border-bottom{border-bottom:var(--cell-border-select);}&.cell-border-right{border-right:var(--cell-border-select);}&.cell-border-left{position:relative;}&.cell-border-top{position:relative;}&.cell-border-left::before{content:'';position:absolute;top:0;left:0;height:102%;width:1px;border-left:var(--cell-border-select);pointer-events:none;z-index:1;}&.cell-border-top::after{content:'';position:absolute;top:0px;left:0;height:1px;width:100%;border-top:var(--cell-border-select);pointer-events:none;z-index:1;}&.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{position:relative;&::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;}}td.first{border-left:var(--cell-border-vertical);}tr.first td{border-top:var(--cell-border-horizontal);}tr td.last,tr th.last{border-right:var(--cell-border-horizontal);}&.has-header tbody tr.first td{border-top:none;}&.has-footer tbody tr.last td{border-bottom:none;}&.has-footer tfoot tr > td{background:var(--footer-bgcolor);color:var(--footer-color);}&.has-footer tfoot tr:not(.no-hover):hover > td{background:var(--footer-bgcolor);}.lock-left,.lock-right{z-index:", ";}.resize-handle{width:6px;height:100%;position:absolute;top:0;right:0;cursor:col-resize;background-color:transparent;border-right:2px solid transparent;}.", "{position:absolute;top:0;bottom:0;z-index:", ";pointer-events:none;overflow:hidden;.", "{height:100%;}.", "{margin-right:", "px;box-shadow:none;&.show-shadow{box-shadow:var(--lock-shadow);border-right:var(--cell-border-vertical);}}.", "{margin-left:", "px;box-shadow:none;&.show-shadow{box-shadow:var(--lock-shadow);border-left:var(--cell-border-vertical);}}}.", "{pointer-events:none;color:#99a3b3;font-size:12px;text-align:center;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);.empty-image{width:50px;height:50px;}.empty-tips{margin-top:16px;line-height:1.5;}}.", "{overflow:auto;position:sticky;bottom:0;z-index:", ";margin-top:-17px;}.ui-rc-grid-loading-wrapper{}.ui-rc-grid-table{}.art-loading-content-wrapper{height:100%;}.", "{height:1px;visibility:hidden;}.", "{position:relative;height:100%;.", "{position:absolute;inset:0;pointer-events:none;}.", "{position:sticky;z-index:", ";transform:translateY(-50%);}}"], Classes.tableWrapper, Classes.tableFooter, Classes.tableBody, Classes.tableFooter, Classes.tableHeader, Classes.tableHeaderCell, Classes.cellEllipsis, Classes.cellWrap, Classes.cellTextCenter, Classes.cellTextRight, Classes.tableBody, Classes.tableCell, Classes.cellEllipsis, Classes.cellWrap, Classes.cellTextCenter, Classes.cellTextRight, Classes.tableFooter, Classes.tableBody, Classes.tableFooter, Classes.tableHeader, Z.header, Classes.tableFooter, Z.footer, Classes.tableBody, Classes.cellSelected, Classes.cellSelected, Z.lock, Classes.lockShadowMask, Z.lockShadow, Classes.lockShadow, Classes.leftLockShadow, LOCK_SHADOW_PADDING, Classes.rightLockShadow, LOCK_SHADOW_PADDING, Classes.emptyWrapper, Classes.stickyScroll, Z.scrollItem, Classes.stickyScrollItem, Classes.loadingWrapper, Classes.loadingIndicatorWrapper, Classes.loadingIndicator, Z.loadingIndicator);
75
+ })(["box-sizing:border-box;*{box-sizing:border-box;}cursor:default;color:var(--color);font-size:var(--font-size);line-height:var(--line-height);position:relative;overflow-anchor:none;&::-webkit-scrollbar{}&::-webkit-scrollbar-track{}&::-webkit-scrollbar-thumb{}&::-webkit-scrollbar-thumb:hover{}&.dark{&::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.3);}&::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,0.5);}}&.", "{border-left:var(--cell-border-vertical);border-right:var(--cell-border-vertical);border-top:var(--cell-border-vertical);border-bottom:0;&.has-footer{border-bottom:0;.", "{td{}}}&.has-vertical-scroll{border-bottom:var(--cell-border-vertical);th.first{border-left:0;}td.first{border-left:0;}&.has-footer{border-bottom:var(--cell-border-vertical);}.", "{tr.last{td{border-bottom:0;}}}.", "{tr.last{td{border-bottom:0;}}}+ .ui-rc-grid-bottom{border-top:0;}&:not(.has-footer){+ .ui-rc-grid-bottom{border-top:var(--cell-border-vertical);}}}&:not(.has-vertical-scroll){border-left:0;border-right:0;}&:not(.has-header){border-top:0;}}&.use-outer-border{}.no-scrollbar{scrollbar-width:none;::-webkit-scrollbar{}}.", "{overflow-x:auto;overflow-y:hidden;background:var(--header-bgcolor);.ui-rc-table-column-title{flex:1;min-width:0;text-align:start;}.", "{font-weight:500;.ui-rc-header-trigger{padding-left:6px;display:flex;align-items:center;.ui-rc-table-column-sorter-cancel{opacity:0;}}&:hover{.ui-rc-header-trigger{.ui-rc-table-column-sorter-cancel{opacity:1;}}}.", "{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}.", "{width:100%;white-space:normal;word-break:break-word;}.", "{text-align:center;}.", "{text-align:right;}}}.", "{.", "{&.", "{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;.expansion-cell{.expansion-content{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}}&.", "{width:100%;white-space:normal;word-break:break-word;}&.", "{text-align:center;}&.", "{text-align:right;}}.", "{background:var(--footer-bgcolor);}}.", ",.", "{overflow-x:auto;overflow-y:hidden;}&.sticky-header .", "{position:sticky;top:0;z-index:", ";}&.sticky-footer .", "{position:sticky;bottom:0;z-index:", ";}.", "{tr{td.cell-edit{&.lock-left,&.lock-right{}}td.first{&.lock-left{border-bottom-width:1px;}}}tr.ui-rc-grid-table-row{td.cell-edit.cell-border-bottom{}}}table{width:100%;table-layout:fixed;border-collapse:separate;border-spacing:0;display:table;margin:0;padding:0;}tr:not(.no-hover):hover > td{background:var(--hover-bgcolor);color:var(--hover-color);}tr:not(.no-highlight).highlight > td{}th{font-weight:normal;text-align:left;padding:var(--cell-padding);height:var(--header-row-height);color:var(--header-color);background:var(--header-bgcolor);border:none;border-right:var(--header-cell-border-vertical);border-bottom:var(--header-cell-border-horizontal);&.", "{background-color:#fcf5f2;}&.cell-border-bottom{border-bottom:var(--cell-border-select);}&.cell-border-right{border-right:var(--cell-border-select);}&.cell-border-left{position:relative;}&.cell-border-top{position:relative;}&.cell-border-left::before{content:'';position:absolute;top:0;left:0;height:102%;width:1px;border-left:var(--cell-border-select);pointer-events:none;z-index:1;}&.cell-border-top::after{content:'';position:absolute;top:0px;left:0;height:1px;width:100%;border-top:var(--cell-border-select);pointer-events:none;z-index:1;}textarea.ui-rc-input{line-height:1.8;max-height:calc(var(--header-row-height) - 1px) !important;min-height:calc(var(--header-row-height) - 1px) !important;}}tr.first th{}th.first{border-left:var(--header-cell-border-vertical);}td{padding:var(--cell-padding);background:var(--bgcolor);height:var(--row-height);border:none;border-right:var(--cell-border-vertical);border-bottom:var(--cell-border-horizontal);outline:none;&.cell-edit{user-select:none;&:has(.dragging-point){position:relative;}.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:var(--border-color-select);bottom:0;right:0;}}&.disable{background-color:#f0f0f0;}}&.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,.ui-rc-input{height:100% !important;&:focus-visible{outline:none;}}.ui-rc-color-picker-trigger{width:100%;border-radius:0;.ui-rc-color-picker-color-block{width:100%;}}textarea.ui-rc-input{line-height:1.8;height:100%;max-height:calc(var(--row-height) - 1px) !important;min-height:calc(var(--row-height) - 1px) !important;}input.be-cell-editing,.ant-picker,.ui-rc-picker,.ui-rc-select-selector,.ui-rc-table-select-selector{padding-inline:7px;}.#{$prefix}-checkbox-wrapper{.#{$prefix}-checkbox{background-color:red;}.#{$prefix}-checkbox-input{&:focus-visible{outline:none;}}}.ant-input,.ant-picker,.ui-rc-picker{border-radius:0;}.ant-color-picker-trigger{height:100%;border-radius:0;.ant-color-picker-color-block{height:100%;width:100%;}}.#{$prefix}-table-select-single .#{$prefix}-table-select-selector,.#{$prefix}-select-single .#{$prefix}-select-selector,.ui-rc-table-select-selector{border-radius:0 !important;}.#{$prefix}-table-select-single:not( .#{$prefix}-table-select-customize-input ){.#{$prefix}-table-select-selector{.#{$prefix}-table-select-selection-search-input{height:auto;}}}}.abccccc{box-shadow:0 -1px 0 0 var(--border-color),0 1px 0 0 var(--border-color),-1px 0 0 0 var(--border-color),1px 0 0 0 var(--border-color);}&.", "{background-color:#fcf5f2;}&.cell-border-bottom{border-bottom:var(--cell-border-select);}&.cell-border-right{border-right:var(--cell-border-select);}&.cell-border-left{position:relative;}&.cell-border-top{position:relative;}&.cell-border-left::before{content:'';position:absolute;top:0;left:0;height:102%;width:1px;border-left:var(--cell-border-select);pointer-events:none;z-index:1;}&.cell-border-top::after{content:'';position:absolute;top:0px;left:0;height:1px;width:100%;border-top:var(--cell-border-select);pointer-events:none;z-index:1;}&.cell-paste-border-top{position:relative;&::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{position:relative;&::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;}}td.first{border-left:var(--cell-border-vertical);}tr.first td{border-top:var(--cell-border-horizontal);}tr td.last,tr th.last{border-right:var(--cell-border-horizontal);}&.has-header tbody tr.first td{border-top:none;}&.has-footer tbody tr.last td{border-bottom:none;}&.has-footer tfoot tr > td{background:var(--footer-bgcolor);color:var(--footer-color);}&.has-footer tfoot tr:not(.no-hover):hover > td{background:var(--footer-bgcolor);}.lock-left,.lock-right{z-index:", ";}.resize-handle{width:6px;height:100%;position:absolute;top:0;right:0;cursor:col-resize;background-color:transparent;border-right:2px solid transparent;}.", "{position:absolute;top:0;bottom:0;z-index:", ";pointer-events:none;overflow:hidden;.", "{height:100%;}.", "{margin-right:", "px;box-shadow:none;&.show-shadow{box-shadow:var(--lock-shadow);border-right:var(--cell-border-vertical);}}.", "{margin-left:", "px;box-shadow:none;&.show-shadow{box-shadow:var(--lock-shadow);border-left:var(--cell-border-vertical);}}}.", "{pointer-events:none;color:#99a3b3;font-size:12px;text-align:center;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);.empty-image{width:50px;height:50px;}.empty-tips{margin-top:16px;line-height:1.5;}}.", "{overflow:auto;position:sticky;bottom:0;z-index:", ";margin-top:-17px;}.ui-rc-grid-loading-wrapper{}.ui-rc-grid-table{}.art-loading-content-wrapper{height:100%;}.", "{height:1px;visibility:hidden;}.", "{position:relative;height:100%;.", "{position:absolute;inset:0;pointer-events:none;}.", "{position:sticky;z-index:", ";transform:translateY(-50%);}}"], Classes.tableWrapper, Classes.tableFooter, Classes.tableBody, Classes.tableFooter, Classes.tableHeader, Classes.tableHeaderCell, Classes.cellEllipsis, Classes.cellWrap, Classes.cellTextCenter, Classes.cellTextRight, Classes.tableBody, Classes.tableCell, Classes.cellEllipsis, Classes.cellWrap, Classes.cellTextCenter, Classes.cellTextRight, Classes.tableFooter, Classes.tableBody, Classes.tableFooter, Classes.tableHeader, Z.header, Classes.tableFooter, Z.footer, Classes.tableBody, Classes.cellSelected, Classes.cellSelected, Z.lock, Classes.lockShadowMask, Z.lockShadow, Classes.lockShadow, Classes.leftLockShadow, LOCK_SHADOW_PADDING, Classes.rightLockShadow, LOCK_SHADOW_PADDING, Classes.emptyWrapper, Classes.stickyScroll, Z.scrollItem, Classes.stickyScrollItem, Classes.loadingWrapper, Classes.loadingIndicatorWrapper, Classes.loadingIndicator, Z.loadingIndicator);
76
76
 
77
77
  // type StyleTableContainerProps = {
78
78
 
@@ -17,3 +17,17 @@ $prefix: 'ui-rc' !default;
17
17
  box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
18
18
  overflow: hidden;
19
19
  }
20
+
21
+ .cell-editor {
22
+ position: fixed;
23
+ z-index: 99999;
24
+
25
+ box-sizing: border-box;
26
+ padding: 0;
27
+ margin: 0;
28
+
29
+ border: 1px solid #1677ff;
30
+ background: white;
31
+
32
+ outline: none;
33
+ }
@@ -58,6 +58,7 @@ export interface ColumnFeatureOptions {
58
58
  currentPage?: number;
59
59
  pageSize?: number;
60
60
  editAble?: boolean;
61
+ isAddAble?: boolean;
61
62
  rowEditable?: (rowData: any) => boolean;
62
63
  setValue?: any;
63
64
  reset?: any;
@@ -70,6 +71,8 @@ export interface ColumnFeatureOptions {
70
71
  handleSubmit: any;
71
72
  onSubmit: any;
72
73
  handleCellChange: any;
74
+ handleCellChangeAndAddRow: any;
75
+ handleAddMulti: any;
73
76
  handleHeaderCellChange?: any;
74
77
  dataErrors?: any[];
75
78
  headerData?: any;
@@ -50,7 +50,10 @@ function columnCustom(opts) {
50
50
  isDataTree,
51
51
  defaultSorter,
52
52
  defaultFilter,
53
+ rowIndexMap,
54
+ // Edit
53
55
  editAble,
56
+ isAddAble,
54
57
  rowEditable,
55
58
  setValue,
56
59
  reset,
@@ -63,11 +66,12 @@ function columnCustom(opts) {
63
66
  handleSubmit,
64
67
  onSubmit,
65
68
  handleCellChange,
69
+ handleCellChangeAndAddRow,
66
70
  handleHeaderCellChange,
71
+ handleAddMulti,
67
72
  dataErrors,
68
73
  headerData,
69
74
  headerEditAble,
70
- rowIndexMap,
71
75
  onCellClick
72
76
  // originData
73
77
 
@@ -82,7 +86,6 @@ function columnCustom(opts) {
82
86
  const rowKey = 'rowId';
83
87
  return function columnResizeFeature(pipeline) {
84
88
  // State table
85
-
86
89
  const sizes = opts.sizes ?? pipeline.getStateAtKey(_constants.stateKeyResize) ?? opts.defaultSizes ?? [];
87
90
  const filterState = pipeline.getStateAtKey(_constants.stateKeyFilter) ?? defaultFilter ?? [];
88
91
  const visible = pipeline.getStateAtKey(_constants.stateKeyVisible) ?? '';
@@ -106,11 +109,16 @@ function columnCustom(opts) {
106
109
  // const rowIdsHeader = Array.from({ length: deppthCols }, (_, index) => `field-${index}`)
107
110
 
108
111
  const allCols = [...leafColumns];
112
+ const defaultCellEditing = {
113
+ editing: false,
114
+ element: null,
115
+ rect: null
116
+ };
109
117
 
110
118
  // State for Edit
111
119
 
112
120
  const focusedCell = pipeline.getStateAtKey(_constants.stateKeyFocusedCell) ?? {};
113
- const isEditing = pipeline.getStateAtKey(_constants.stateKeyIsEditing) ?? false;
121
+ const isEditing = pipeline.getStateAtKey(_constants.stateKeyIsEditing) ?? defaultCellEditing;
114
122
  const editCellSettings = pipeline.getStateAtKey(_constants.stateKeyEditCellSettings);
115
123
  const isSelecting = pipeline.getStateAtKey(_constants.stateKeyIsSelecting) ?? false;
116
124
  const isPasting = pipeline.getStateAtKey(_constants.stateKeyIsPasting) ?? false;
@@ -120,7 +128,7 @@ function columnCustom(opts) {
120
128
  const endPasteCell = pipeline.getStateAtKey(_constants.stateKeyEndPasteCell) ?? undefined;
121
129
  const typePaste = pipeline.getStateAtKey(_constants.stateKeyTypePaste) ?? undefined;
122
130
  const rangeState = startCell && endCell ? (0, _utils2.getSelectedCellMatrix1)(allRows, leafColumns, startCell, endCell) : undefined;
123
- const rangePasteState = startPasteCell && endPasteCell ? (0, _utils2.getSelectedCellMatrix1)(allRows, leafColumns, startPasteCell, endPasteCell, typePaste) : undefined;
131
+ const rangePasteState = startPasteCell && endPasteCell && typePaste ? (0, _utils2.getSelectedCellMatrix1)(allRows, leafColumns, startPasteCell, endPasteCell, typePaste) : undefined;
124
132
  const nextColumn = focusedCell?.colId ? (0, _utils2.getNextColumn1)(leafColumns, focusedCell?.colId) : undefined;
125
133
  const {
126
134
  rowRange,
@@ -130,6 +138,15 @@ function columnCustom(opts) {
130
138
  endColIndex,
131
139
  endRowIndex
132
140
  } = rangeState ?? {};
141
+ const {
142
+ rowRange: rowPasteRange,
143
+ colRange: colPasteRange,
144
+ startColIndex: startPasteColIndex,
145
+ startRowIndex: startPasteRowIndex,
146
+ endColIndex: endPasteColIndex,
147
+ endRowIndex: endPasteRowIndex,
148
+ type: pasteType
149
+ } = rangePasteState ?? {};
133
150
  const rowPasteIds = (0, _utils2.getRowIdsBetween3)(allRows, rowIndexMap, startPasteCell?.rowId ?? '', endPasteCell?.rowId ?? '');
134
151
  const colPasteds = (0, _utils2.getColIdsBetween1)(leafColumns, startPasteCell?.colId ?? '', endPasteCell?.colId ?? '');
135
152
  const rowSelectIds = (0, _utils2.getRowIdsBetween3)(allRows, rowIndexMap, startCell?.rowId ?? '', endCell?.rowId ?? '');
@@ -305,8 +322,31 @@ function columnCustom(opts) {
305
322
  // Chức năng edit
306
323
 
307
324
  const handleEdit = (e, record, col, editType, isKeyDown, isHeader) => {
308
- pipeline.setStateAtKey(_constants.stateKeyIsEditing, true);
309
325
  reset?.();
326
+ const cell = e.currentTarget;
327
+ pipeline.setStateAtKey(_constants.stateKeyIsEditing, {
328
+ editing: true,
329
+ element: cell,
330
+ rect: cell.getBoundingClientRect()
331
+ });
332
+
333
+ // editor = document.createElement('div')
334
+
335
+ // editor.className = 'cell-editor'
336
+
337
+ // editor.contentEditable = 'true'
338
+
339
+ // editor.style.left = `${rect.left}px`
340
+ // editor.style.top = `${rect.top}px`
341
+ // editor.style.width = `${rect.width}px`
342
+ // editor.style.height = `${rect.height}px`
343
+
344
+ // editor.innerText = cell.innerText
345
+
346
+ // document.body.appendChild(editor)
347
+
348
+ // editor.focus()
349
+
310
350
  if (!(0, _hooks.isObjEmpty)(record)) {
311
351
  Object.entries(record).forEach(([name, value]) => {
312
352
  setValue?.(name, value);
@@ -350,7 +390,9 @@ function columnCustom(opts) {
350
390
  });
351
391
  dataSelected.push(rowData);
352
392
  });
353
- const copyRows = (0, _utils2.flattenData)('children', dataSource).filter(it => rowSelectIds.includes(it[rowKey]));
393
+
394
+ // const copyRows = flattenData('children', dataSource).filter((it) => rowSelectIds.includes(it[rowKey]))
395
+ const copyRows = allRows.filter(it => rowSelectIds.includes(it[rowKey]));
354
396
  let newRange;
355
397
  if (pasteState.type === 'down') {
356
398
  // kéo xuóng
@@ -387,7 +429,7 @@ function columnCustom(opts) {
387
429
  }
388
430
 
389
431
  // Cập nhật data mới
390
- const newData = (0, _utils2.flattenArray)(allRows);
432
+ const newData = allRows;
391
433
  const pastedRows = [];
392
434
  if (pasteState.type === 'down' || pasteState.type === 'up') {
393
435
  newRange.addedRows.forEach((rowValues, rowIndex1) => {
@@ -454,8 +496,8 @@ function columnCustom(opts) {
454
496
  });
455
497
  }
456
498
 
457
- // const rsFilterData = updateOrInsert(flattenArray(dataSource), newData)
458
- const rsFilterData = (0, _utility.updateOrInsert)(dataSource, newData);
499
+ // const rsFilterData = updateOrInsert(dataSource, newData)
500
+ const rsFilterData = (0, _utility.updateOrInsert)(allRows, newData);
459
501
  const rs = (0, _utility.unFlattenData)(rsFilterData);
460
502
  triggerPaste?.(pastedRows, colPasteds, rs, copyRows);
461
503
  pipeline.setStateAtKey(_constants.stateKeyEndCell, endPasteCell);
@@ -482,7 +524,7 @@ function columnCustom(opts) {
482
524
  const newRange = ctrlKey ? (0, _utils2.addRowsDownWithCtrl)(dataSelected, rowsPasteId.length) : (0, _utils2.addRowsDown)(dataSelected, rowsPasteId.length);
483
525
 
484
526
  // Cập nhật data mới
485
- const newData = (0, _utils2.flattenArray)(dataSource);
527
+ const newData = allRows;
486
528
  const pastedRows = [];
487
529
  newRange.addedRows.forEach((rowValues, rowIndex1) => {
488
530
  const targetRow = pasteState?.startRowIndex + rowIndex1;
@@ -502,6 +544,8 @@ function columnCustom(opts) {
502
544
  // Lưu dòng được paste
503
545
  pastedRows.push(newData[targetRow]);
504
546
  });
547
+
548
+ // const rsFilterData = updateOrInsert(dataSource, newData)
505
549
  const rsFilterData = (0, _utility.updateOrInsert)(dataSource, newData);
506
550
  const rs = (0, _utility.unFlattenData)(rsFilterData);
507
551
  triggerPaste?.(pastedRows, colsPastedId, rs, copyRows);
@@ -524,7 +568,7 @@ function columnCustom(opts) {
524
568
  rowId,
525
569
  colId
526
570
  });
527
- pipeline.setStateAtKey(_constants.stateKeyIsEditing, false);
571
+ pipeline.setStateAtKey(_constants.stateKeyIsEditing, defaultCellEditing);
528
572
  });
529
573
  } else {}
530
574
  };
@@ -776,7 +820,7 @@ function columnCustom(opts) {
776
820
  // handleDeleteContent?.()
777
821
 
778
822
  if (startCell && endCell) {
779
- const tmpData = (0, _utils2.flattenArray)([...dataSource]);
823
+ const tmpData = allRows;
780
824
  const rs = tmpData.map((row, index) => {
781
825
  if (!rangeState?.rowRange.includes(row.rowId)) {
782
826
  return row;
@@ -887,98 +931,6 @@ function columnCustom(opts) {
887
931
  return;
888
932
  }
889
933
 
890
- // if (e.key === 'ArrowRight') {
891
-
892
- // // e.preventDefault();
893
- // // e.stopPropagation()
894
-
895
- // const nextCol = getNextColumn(leafColumns, column.field)
896
-
897
- // if (nextCol.column && !nextCol.isWrapped) {
898
-
899
- // const nextCellPosition = { rowId, colId: nextCol.column.field }
900
-
901
- // pipeline.setStateAtKey(stateKeyFocusedCell, nextCellPosition)
902
- // pipeline.setStateAtKey(stateKeyStartCell, nextCellPosition)
903
- // pipeline.setStateAtKey(stateKeyEndCell, nextCellPosition)
904
-
905
- // }
906
-
907
- // return
908
- // }
909
-
910
- // if (e.key === 'ArrowLeft') {
911
-
912
- // // e.preventDefault()
913
- // // e.stopPropagation()
914
-
915
- // const prevCol = getPrevColumn(leafColumns, column.field)
916
-
917
- // if (prevCol) {
918
-
919
- // const nextCellPosition = { rowId, colId: prevCol.field }
920
- // pipeline.setStateAtKey(stateKeyFocusedCell, nextCellPosition)
921
- // pipeline.setStateAtKey(stateKeyStartCell, nextCellPosition)
922
- // pipeline.setStateAtKey(stateKeyEndCell, nextCellPosition)
923
-
924
- // }
925
- // return
926
- // }
927
-
928
- // if (e.key === 'ArrowDown') {
929
-
930
- // // e.preventDefault()
931
- // // e.stopPropagation()
932
-
933
- // const nextRow = allRows[rowIndex + 1]
934
-
935
- // if (nextRow) {
936
- // const nextRowId = nextRow.rowId
937
-
938
- // const nextCellPosition = { rowId: nextRowId, colId }
939
- // // setFocusedCell?.({ rowId: nextRowId, colId });
940
- // // setStartCell?.({ rowId: nextRowId, colId });
941
- // // setEndCell?.({ rowId: nextRowId, colId });
942
-
943
- // // setRangeState?.(getSelectedCellMatrix(table, { rowId: nextRowId, colId }, { rowId: nextRowId, colId }))
944
-
945
- // // columnVirtualizer.scrollToIndex(nextCol.getIndex(), { align: 'center' })
946
- // // rowVirtualizer.scrollToIndex(nextRow.index, { align: 'center' })
947
-
948
- // pipeline.setStateAtKey(stateKeyFocusedCell, nextCellPosition)
949
- // pipeline.setStateAtKey(stateKeyStartCell, nextCellPosition)
950
- // pipeline.setStateAtKey(stateKeyEndCell, nextCellPosition)
951
-
952
- // // const rowElement: any = document.querySelector(`.ui-rc-grid-table-row[data-row-key="${nextRowId}"]`)
953
-
954
- // // const cellFocus = rowElement?.querySelector('.ui-rc-grid-cell')
955
-
956
- // }
957
-
958
- // return
959
- // }
960
-
961
- // if (e.key === 'ArrowUp') {
962
-
963
- // // e.preventDefault()
964
- // // e.stopPropagation()
965
-
966
- // const nextRow = allRows[rowIndex - 1]
967
-
968
- // if (nextRow) {
969
- // const nextRowId = nextRow.rowId
970
-
971
- // const nextCellPosition = { rowId: nextRowId, colId }
972
-
973
- // pipeline.setStateAtKey(stateKeyFocusedCell, nextCellPosition)
974
- // pipeline.setStateAtKey(stateKeyStartCell, nextCellPosition)
975
- // pipeline.setStateAtKey(stateKeyEndCell, nextCellPosition)
976
-
977
- // }
978
-
979
- // return
980
- // }
981
-
982
934
  // if (e.key === 'Delete') {
983
935
  // handleDeleteContent?.()
984
936
  // return
@@ -996,7 +948,7 @@ function columnCustom(opts) {
996
948
  handleEdit(e, record, column, editType, true, true);
997
949
  }
998
950
  };
999
- const handleChange = (record, column, indexCol) => {
951
+ const handleChange = (record, column, indexCol, type) => {
1000
952
  const currentRowIndex = allRows.findIndex(r => r.rowId === record.rowId);
1001
953
  const formState = getValues();
1002
954
  const itemState = getValues(column.field);
@@ -1012,10 +964,54 @@ function columnCustom(opts) {
1012
964
  option: newState,
1013
965
  indexCol: indexCol,
1014
966
  indexRow: currentRowIndex,
1015
- type: 'blur'
967
+ type: type ?? 'blur'
1016
968
  });
1017
969
  } else {}
1018
970
  };
971
+ const handleChangeAndCreateRow = (record, column, indexCol) => {
972
+ const currentRowIndex = allRows.findIndex(r => r.rowId === record.rowId);
973
+ const formState = getValues();
974
+ const itemState = getValues(column.field);
975
+ const prevState = record[column.field];
976
+ const newState = itemState;
977
+ if (newState !== prevState) {
978
+ // vừa cell change + add new row
979
+ handleCellChangeAndAddRow?.({
980
+ key: record.rowId,
981
+ field: column.field,
982
+ record: formState,
983
+ prevState,
984
+ newState,
985
+ option: newState,
986
+ indexCol: indexCol,
987
+ indexRow: currentRowIndex,
988
+ type: 'blur'
989
+ });
990
+ } else {
991
+ // chỉ add new row
992
+
993
+ const newRowId = (0, _utils2.newGuid)();
994
+ handleAddMulti?.({}, 1, newRowId);
995
+ const nextCellPosition = {
996
+ rowId: newRowId,
997
+ colId: column.field
998
+ };
999
+ pipeline.setStateAtKey(_constants.stateKeyFocusedCell, nextCellPosition);
1000
+ pipeline.setStateAtKey(_constants.stateKeyStartCell, nextCellPosition);
1001
+ pipeline.setStateAtKey(_constants.stateKeyEndCell, nextCellPosition);
1002
+ setTimeout(() => {
1003
+ const row = document.querySelector(`.ui-rc-grid-table-row[data-row-key="${newRowId}"]`);
1004
+ const cellFocus = row?.querySelector('.ui-rc-grid-cell:not(.ui-rc-grid-cell-selection)');
1005
+ if (cellFocus) {
1006
+ cellFocus.scrollIntoView({
1007
+ behavior: "smooth",
1008
+ block: "start"
1009
+ });
1010
+ cellFocus.focus();
1011
+ }
1012
+ }, 100);
1013
+ }
1014
+ };
1019
1015
  const handleHeaderChange = (record, column, indexCol) => {
1020
1016
  const currentRowIndex = allRows.findIndex(r => r.rowId === record.rowId);
1021
1017
  const formState = getValues();
@@ -1281,7 +1277,7 @@ function columnCustom(opts) {
1281
1277
  [col.field]: headerData?.[col.field] ?? ''
1282
1278
  };
1283
1279
  const headerValue = headerData?.[col.field] ?? '';
1284
- const cellHeaderEditing = isEditing && headerRowId === focusedCell.rowId && col.field === focusedCell.colId;
1280
+ const cellHeaderEditing = isEditing.editing && headerRowId === focusedCell.rowId && col.field === focusedCell.colId;
1285
1281
  const isCellSelect = headerRowId === focusedCell.rowId && startCell?.colId === col.field;
1286
1282
  const aa = (0, _utils3.getColumnsAtLevel)(originCols, headerRowIndex);
1287
1283
  const aaEditAble = aa ? aa.filter(it => it.headerEditEnable) : undefined;
@@ -1386,7 +1382,7 @@ function columnCustom(opts) {
1386
1382
  // @ts-ignore
1387
1383
  'data-col-key': col.field,
1388
1384
  ref: el => {
1389
- if (focusedCell?.rowId === headerRowId && focusedCell?.colId === col.field && !isEditing) {
1385
+ if (focusedCell?.rowId === headerRowId && focusedCell?.colId === col.field && !isEditing.editing) {
1390
1386
  el?.focus({
1391
1387
  preventScroll: true
1392
1388
  });
@@ -1431,7 +1427,7 @@ function columnCustom(opts) {
1431
1427
  // chưa editing
1432
1428
 
1433
1429
  if (headerEditAble) {
1434
- if (!isEditing) {
1430
+ if (!isEditing.editing) {
1435
1431
  handleHeaderKeyDown(e, headerRowId, col.field, headerRowIndex, col, headerRecord, headerEditType ?? 'text');
1436
1432
  } else {
1437
1433
  if (e.shiftKey && e.key === 'Enter') {
@@ -1453,7 +1449,7 @@ function columnCustom(opts) {
1453
1449
  // pipeline.setStateAtKey(stateKeyEndCell, nextCellPosition)
1454
1450
 
1455
1451
  handleHeaderChange(headerRecord, col, startIndex);
1456
- pipeline.setStateAtKey(_constants.stateKeyIsEditing, false);
1452
+ pipeline.setStateAtKey(_constants.stateKeyIsEditing, defaultCellEditing);
1457
1453
 
1458
1454
  // }
1459
1455
  }
@@ -1496,7 +1492,7 @@ function columnCustom(opts) {
1496
1492
  // }
1497
1493
  }
1498
1494
  handleHeaderChange(headerRecord, col, startIndex);
1499
- pipeline.setStateAtKey(_constants.stateKeyIsEditing, false);
1495
+ pipeline.setStateAtKey(_constants.stateKeyIsEditing, defaultCellEditing);
1500
1496
  }
1501
1497
  }
1502
1498
  }
@@ -1516,21 +1512,23 @@ function columnCustom(opts) {
1516
1512
  const canEdit = (0, _hooks.isEditable)(col, record) && isRowEditable !== false;
1517
1513
  const editType = typeof col.editType === 'function' ? col.editType(record) : col.editType;
1518
1514
  const isInRange = colRange && rowRange && rowRange.includes(record.rowId) && colRange.includes(col.field);
1519
- const isInRangePaste = rangePasteState && rangePasteState?.rowRange?.includes(record.rowId) && rangePasteState?.colRange?.includes(col.field);
1515
+ const isInRangePaste = colPasteRange && rowPasteRange && rowPasteRange?.includes(record.rowId) && colPasteRange.includes(col.field);
1520
1516
  const rowIdx = rowIds ? rowIds.indexOf(record.rowId) : -1;
1521
1517
  const colIdx = colIds ? colIds.indexOf(col.field) : -1;
1522
- const rowIdxPaste = rowIds?.indexOf(record.rowId);
1523
- const colIdxPaste = colIds?.indexOf(col.field);
1518
+ const rowIdxPaste = rowIds ? rowIds?.indexOf(record.rowId) : -1;
1519
+ const colIdxPaste = colIds ? colIds?.indexOf(col.field) : -1;
1520
+ // const colIdsPaste = rangePasteState?.colRange?.includes(col.field)
1521
+
1524
1522
  const isCellSelected = !startCell || !endCell ? false : selectRowIds.includes(record.rowId) && cols.includes(col.field);
1525
1523
  const isTop = rowIdx === startRowIndex;
1526
1524
  const isBottom = rowIdx === endRowIndex;
1527
1525
  const isLeft = colIdx === startColIndex;
1528
1526
  const isRight = colIdx === endColIndex;
1529
- const isTopPaste = rowIdxPaste === rangePasteState?.startRowIndex;
1530
- const isBottomPaste = rowIdxPaste === rangePasteState?.endRowIndex;
1531
- const isLeftPaste = colIdxPaste === rangePasteState?.startColIndex;
1532
- const isRightPaste = colIdxPaste === rangePasteState?.endColIndex;
1533
- const cellEditing = isEditing && record.rowId === focusedCell.rowId && col.field === focusedCell.colId;
1527
+ const isTopPaste = rowIdxPaste === startPasteRowIndex;
1528
+ const isBottomPaste = rowIdxPaste === endPasteRowIndex;
1529
+ const isLeftPaste = colIdxPaste === startPasteColIndex;
1530
+ const isRightPaste = colIdxPaste === endPasteColIndex;
1531
+ const cellEditing = isEditing.editing && record.rowId === focusedCell.rowId && col.field === focusedCell.colId;
1534
1532
 
1535
1533
  // content display
1536
1534
 
@@ -1556,7 +1554,7 @@ function columnCustom(opts) {
1556
1554
  'data-tooltip-id': `${id}-tooltip-content`,
1557
1555
  'data-tooltip-content': message ?? tooltipContent,
1558
1556
  ref: el => {
1559
- if (focusedCell?.rowId === record.rowId && focusedCell?.colId === col.field && !isEditing) {
1557
+ if (focusedCell?.rowId === record.rowId && focusedCell?.colId === col.field && !isEditing.editing) {
1560
1558
  el?.focus({
1561
1559
  preventScroll: true
1562
1560
  });
@@ -1579,14 +1577,14 @@ function columnCustom(opts) {
1579
1577
  disable: !canEdit,
1580
1578
  // isValid: !isEditing && rowError && rowError[col.field]?.field === col.field,
1581
1579
  [`${prefix}-grid-cell-selected`]: isCellSelected,
1582
- 'cell-border-bottom': !isEditing && isInRange && isBottom,
1583
- 'cell-border-right': !isEditing && isInRange && isRight,
1584
- 'cell-border-top': !isEditing && isInRange && isTop,
1585
- 'cell-border-left': !isEditing && isInRange && isLeft,
1586
- 'cell-paste-border-bottom': isInRangePaste && isBottomPaste && (rangePasteState.endRowIndex ?? 0) > (endRowIndex ?? 0),
1587
- 'cell-paste-border-right': isInRangePaste && isRightPaste,
1588
- 'cell-paste-border-top': isInRangePaste && isTopPaste && (rangePasteState.endRowIndex ?? 0) < (endRowIndex ?? 0),
1589
- 'cell-paste-border-left': isInRangePaste && isLeftPaste
1580
+ 'cell-border-bottom': !isEditing.editing && isInRange && isBottom,
1581
+ 'cell-border-right': !isEditing.editing && isInRange && isRight,
1582
+ 'cell-border-top': !isEditing.editing && isInRange && isTop,
1583
+ 'cell-border-left': !isEditing.editing && isInRange && isLeft,
1584
+ 'cell-paste-border-bottom': isInRangePaste && isBottomPaste && (pasteType === 'down' || pasteType === 'right' || pasteType === 'left'),
1585
+ 'cell-paste-border-right': isInRangePaste && isRightPaste && (pasteType === 'down' || pasteType === 'right' || pasteType === 'up'),
1586
+ 'cell-paste-border-top': isInRangePaste && isTopPaste && (pasteType === 'up' || pasteType === 'left' || pasteType === 'right'),
1587
+ 'cell-paste-border-left': isInRangePaste && isLeftPaste && (pasteType === 'down' || pasteType === 'left' || pasteType === 'up')
1590
1588
  }),
1591
1589
  onMouseDown: e => {
1592
1590
  prevCellProps?.onMouseDown?.(e);
@@ -1683,7 +1681,7 @@ function columnCustom(opts) {
1683
1681
  prevCellProps?.onKeyDown?.(e);
1684
1682
 
1685
1683
  // chưa editing
1686
- if (!isEditing) {
1684
+ if (!isEditing.editing) {
1687
1685
  handleKeyDown(e, record.rowId, col.field, rowIndex, col, record, editType ?? 'text');
1688
1686
  } else {
1689
1687
  if (e.shiftKey && e.key === 'Enter') {
@@ -1703,14 +1701,15 @@ function columnCustom(opts) {
1703
1701
  pipeline.setStateAtKey(_constants.stateKeyFocusedCell, nextCellPosition);
1704
1702
  pipeline.setStateAtKey(_constants.stateKeyStartCell, nextCellPosition);
1705
1703
  pipeline.setStateAtKey(_constants.stateKeyEndCell, nextCellPosition);
1706
-
1707
- // rowVirtualizer.scrollToIndex(nextRow.index, { align: 'center' })
1708
-
1709
1704
  handleChange(record, col, startIndex);
1710
- pipeline.setStateAtKey(_constants.stateKeyIsEditing, false);
1705
+ pipeline.setStateAtKey(_constants.stateKeyIsEditing, defaultCellEditing);
1711
1706
  } else {
1712
-
1713
- // handleChangeAndCreateRow()
1707
+ if (isAddAble) {
1708
+ handleChangeAndCreateRow(record, col, startIndex);
1709
+ } else {
1710
+ handleChange(record, col, startIndex, 'blur');
1711
+ pipeline.setStateAtKey(_constants.stateKeyIsEditing, defaultCellEditing);
1712
+ }
1714
1713
  }
1715
1714
  }
1716
1715
  if (e.key === 'Tab') {
@@ -1747,7 +1746,7 @@ function columnCustom(opts) {
1747
1746
  }
1748
1747
  }
1749
1748
  handleChange(record, col, startIndex);
1750
- pipeline.setStateAtKey(_constants.stateKeyIsEditing, false);
1749
+ pipeline.setStateAtKey(_constants.stateKeyIsEditing, defaultCellEditing);
1751
1750
  }
1752
1751
  }
1753
1752
  }
@@ -1767,11 +1766,9 @@ function columnCustom(opts) {
1767
1766
  format: format,
1768
1767
  errors: errors,
1769
1768
  handleCellChange: handleCellChange,
1770
- handleNextCell: () => {},
1771
1769
  getValues: getValues,
1772
1770
  rowKey: 'rowId',
1773
1771
  control: control,
1774
- startCell: startCell,
1775
1772
  handleSubmit: handleSubmit,
1776
1773
  onSubmit: onSubmit
1777
1774
  }) : editAble ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, cellContent, !isSelecting && !cellEditing && rowRange &&
@@ -1792,7 +1789,7 @@ function columnCustom(opts) {
1792
1789
  }
1793
1790
  }, /*#__PURE__*/_react.default.createElement("span", {
1794
1791
  className: 'dot-point'
1795
- })), !isEditing && rowError && rowError[col.field]?.field === col.field && /*#__PURE__*/_react.default.createElement("span", {
1792
+ })), !isEditing.editing && rowError && rowError[col.field]?.field === col.field && /*#__PURE__*/_react.default.createElement("span", {
1796
1793
  className: "isValid"
1797
1794
  })) : undefined
1798
1795
  });
@@ -223,7 +223,12 @@ function treeSelect(opts) {
223
223
  // const isChecked = isRowChecked(rowKey, value, treeIndex, checkedStrategy, isDisabled)
224
224
  const isChecked = treeDataHelper.isChecked(rowKey);
225
225
  if (clickArea !== 'cell') {
226
- return {};
226
+ return {
227
+ style: {
228
+ // cursor: 'not-allowed',
229
+ padding: 0
230
+ }
231
+ };
227
232
  }
228
233
 
229
234
  // const disabled = isNodeOrAncestorDisabled(rowKey, treeIndex, isDisabled)
@@ -231,13 +236,15 @@ function treeSelect(opts) {
231
236
  if (disabled) {
232
237
  return {
233
238
  style: {
234
- cursor: 'not-allowed'
239
+ cursor: 'not-allowed',
240
+ padding: 0
235
241
  }
236
242
  };
237
243
  }
238
244
  return (0, _utils2.mergeCellProps)(prevCellProps, {
239
245
  style: {
240
- cursor: 'pointer'
246
+ cursor: 'pointer',
247
+ padding: 0
241
248
  },
242
249
  onClick(e) {
243
250
  if (opts.stopClickEventPropagation) {
@@ -537,9 +537,6 @@ export type TableProps<RecordType = AnyObject> = {
537
537
  */
538
538
  validate?: any;
539
539
  onBlur?: (data: RecordType[]) => void;
540
- toolbarItemTopRight?: ToolbarItem[];
541
- toolbarItemsTop?: ToolbarItem[];
542
- toolbarItemsBottom?: ToolbarItem[];
543
540
  };
544
541
  export type ExpandableConfig<RecordType> = {
545
542
  expandedRowKeys?: readonly Key[];