es-grid-template 1.9.73 → 1.9.74
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.
- package/es/ali-table/Grid.js +0 -1
- package/es/ali-table/InternalTable.js +169 -29
- package/es/ali-table/base-table/html-table.js +1 -1
- package/es/ali-table/base-table/styles.d.ts +1 -0
- package/es/ali-table/base-table/styles.js +2 -1
- package/es/ali-table/pipeline/features/columnCustom.d.ts +1 -0
- package/es/ali-table/pipeline/features/columnCustom.js +143 -10
- package/es/ali-table/utils/utility.d.ts +11 -0
- package/es/ali-table/utils/utility.js +49 -0
- package/es/group-component/hook/utils.d.ts +3 -3
- package/lib/ali-table/Grid.js +0 -1
- package/lib/ali-table/InternalTable.js +167 -27
- package/lib/ali-table/base-table/html-table.js +1 -1
- package/lib/ali-table/base-table/styles.d.ts +1 -0
- package/lib/ali-table/base-table/styles.js +2 -1
- package/lib/ali-table/pipeline/features/columnCustom.d.ts +1 -0
- package/lib/ali-table/pipeline/features/columnCustom.js +144 -12
- package/lib/ali-table/utils/utility.d.ts +11 -0
- package/lib/ali-table/utils/utility.js +55 -3
- package/package.json +2 -2
|
@@ -23,6 +23,7 @@ export declare const Classes: {
|
|
|
23
23
|
readonly tableCell: "ui-rc-grid-table-cell";
|
|
24
24
|
readonly gridCell: "ui-rc-grid-cell";
|
|
25
25
|
readonly cellSelected: "ui-rc-grid-cell-selected";
|
|
26
|
+
readonly cellIndexSelected: "ui-rc-grid-cell-index-selected";
|
|
26
27
|
readonly cellEllipsis: "ui-rc-grid-cell-ellipsis";
|
|
27
28
|
readonly cellWrap: "ui-rc-grid-cell-wrap";
|
|
28
29
|
readonly cellTextCenter: "ui-rc-grid-cell-text-center";
|
|
@@ -37,6 +37,7 @@ const Classes = exports.Classes = {
|
|
|
37
37
|
tableCell: `${prefix}table-cell`,
|
|
38
38
|
gridCell: `${prefix}cell`,
|
|
39
39
|
cellSelected: `${prefix}cell-selected`,
|
|
40
|
+
cellIndexSelected: `${prefix}cell-index-selected`,
|
|
40
41
|
cellEllipsis: `${prefix}cell-ellipsis`,
|
|
41
42
|
cellWrap: `${prefix}cell-wrap`,
|
|
42
43
|
cellTextCenter: `${prefix}cell-text-center`,
|
|
@@ -75,7 +76,7 @@ const StyleTableContainer = exports.StyleTableContainer = _styledComponents.defa
|
|
|
75
76
|
const StyledArtTableWrapper = exports.StyledArtTableWrapper = _styledComponents.default.div.withConfig({
|
|
76
77
|
displayName: "StyledArtTableWrapper",
|
|
77
78
|
componentId: "es-grid-template__sc-ipj1ht-1"
|
|
78
|
-
})(["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;}}}.", "{.", "{td{background:var(--row-odd-bgcolor);}}.", "{td{background:var(--row-even-bgcolor);}}.", "{td{background:var(--row-parent-bgcolor);font-weight:500;}}.", "{&.", "{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;}&.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;}}}}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.tableRowOdd, Classes.tableRowEven, Classes.tableRowParent, 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);
|
|
79
|
+
})(["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;}}}.", "{.", "{td{background:var(--row-odd-bgcolor);}}.", "{td{background:var(--row-even-bgcolor);}}.", "{td{background:var(--row-parent-bgcolor);font-weight:500;}}.", "{&.", "{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{&.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);}}}tr{td.cell-edit{&.lock-left,&.lock-right{box-shadow:0 -1px 0 0 var(--border-color),0 0px 0 0 var(--border-color),-1px 0 0 0 var(--border-color);}}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;}&.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;}}}}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;&.", "{background-color:var(--border-color-select);color:#ffffff;}&.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.tableRowOdd, Classes.tableRowEven, Classes.tableRowParent, 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.cellIndexSelected, 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);
|
|
79
80
|
|
|
80
81
|
// type StyleTableContainerProps = {
|
|
81
82
|
|
|
@@ -20,7 +20,7 @@ var _EditCell = _interopRequireDefault(require("../../base-table/cell/EditCell")
|
|
|
20
20
|
var _HeaderEditCell = _interopRequireDefault(require("../../base-table/cell/HeaderEditCell"));
|
|
21
21
|
var _constants = require("../../utils/constants");
|
|
22
22
|
var _utils3 = require("../../base-table/utils");
|
|
23
|
-
|
|
23
|
+
// import { unFlattenData } from '../../utils/utility';
|
|
24
24
|
// import { getMaxDepth } from '../../utils/utility';
|
|
25
25
|
|
|
26
26
|
function clamp(min, x, max) {
|
|
@@ -47,6 +47,7 @@ function columnCustom(opts) {
|
|
|
47
47
|
wrapSettings,
|
|
48
48
|
// ignoreAccents,
|
|
49
49
|
dataSource,
|
|
50
|
+
dataFlatten,
|
|
50
51
|
isDataTree,
|
|
51
52
|
defaultSorter,
|
|
52
53
|
defaultFilter,
|
|
@@ -437,7 +438,7 @@ function columnCustom(opts) {
|
|
|
437
438
|
}
|
|
438
439
|
|
|
439
440
|
// Cập nhật data mới
|
|
440
|
-
const newData =
|
|
441
|
+
const newData = dataFlatten;
|
|
441
442
|
const pastedRows = [];
|
|
442
443
|
if (pasteState.type === 'down' || pasteState.type === 'up') {
|
|
443
444
|
newRange.addedRows.forEach((rowValues, rowIndex1) => {
|
|
@@ -505,8 +506,8 @@ function columnCustom(opts) {
|
|
|
505
506
|
}
|
|
506
507
|
|
|
507
508
|
// const rsFilterData = updateOrInsert(dataSource, newData)
|
|
508
|
-
const rsFilterData = (0,
|
|
509
|
-
const rs = (0,
|
|
509
|
+
const rsFilterData = (0, _utils2.updateOrInsert)(dataFlatten, newData);
|
|
510
|
+
const rs = (0, _utils2.unFlattenData)(rsFilterData);
|
|
510
511
|
triggerPaste?.(pastedRows, colPasteds, rs, copyRows);
|
|
511
512
|
pipeline.setStateAtKey(_constants.stateKeyEndCell, endPasteCell);
|
|
512
513
|
pipeline.setStateAtKey(_constants.stateKeyEndPasteCell, undefined);
|
|
@@ -532,7 +533,7 @@ function columnCustom(opts) {
|
|
|
532
533
|
const newRange = ctrlKey ? (0, _utils2.addRowsDownWithCtrl)(dataSelected, rowsPasteId.length) : (0, _utils2.addRowsDown)(dataSelected, rowsPasteId.length);
|
|
533
534
|
|
|
534
535
|
// Cập nhật data mới
|
|
535
|
-
const newData =
|
|
536
|
+
const newData = dataFlatten;
|
|
536
537
|
const pastedRows = [];
|
|
537
538
|
newRange.addedRows.forEach((rowValues, rowIndex1) => {
|
|
538
539
|
const targetRow = pasteState?.startRowIndex + rowIndex1;
|
|
@@ -554,8 +555,8 @@ function columnCustom(opts) {
|
|
|
554
555
|
});
|
|
555
556
|
|
|
556
557
|
// const rsFilterData = updateOrInsert(dataSource, newData)
|
|
557
|
-
const rsFilterData = (0,
|
|
558
|
-
const rs = (0,
|
|
558
|
+
const rsFilterData = (0, _utils2.updateOrInsert)(dataFlatten, newData);
|
|
559
|
+
const rs = (0, _utils2.unFlattenData)(rsFilterData);
|
|
559
560
|
triggerPaste?.(pastedRows, colsPastedId, rs, copyRows);
|
|
560
561
|
};
|
|
561
562
|
const handleMouseDown = (rowId, colId) => {
|
|
@@ -867,7 +868,7 @@ function columnCustom(opts) {
|
|
|
867
868
|
}
|
|
868
869
|
return updatedRow;
|
|
869
870
|
});
|
|
870
|
-
const newData = (0,
|
|
871
|
+
const newData = (0, _utils2.unFlattenData)(rs);
|
|
871
872
|
triggerChangeData?.([...newData], {
|
|
872
873
|
type: 'DELETE_CONTENT'
|
|
873
874
|
});
|
|
@@ -1058,6 +1059,73 @@ function columnCustom(opts) {
|
|
|
1058
1059
|
pipeline.setStateAtKey(_constants.stateKeyEndCell, cellEnd);
|
|
1059
1060
|
triggerPointPaste(selectPasteState, cellStart, cellEnd, e.ctrlKey);
|
|
1060
1061
|
};
|
|
1062
|
+
|
|
1063
|
+
// cell Số thứ tự
|
|
1064
|
+
|
|
1065
|
+
const handleMouseDownIndex = rowId => {
|
|
1066
|
+
// setIsSelecting?.(true);
|
|
1067
|
+
pipeline.setStateAtKey(_constants.stateKeyIsSelecting, true);
|
|
1068
|
+
const allColumns = allCols.filter(it => !_hooks.nonActionColumn.includes(it.field));
|
|
1069
|
+
|
|
1070
|
+
// const firstCOlSpin = findFirst(allColumns)
|
|
1071
|
+
|
|
1072
|
+
const startCol = allColumns[0].field;
|
|
1073
|
+
const endCol = allColumns[allColumns.length - 1].field;
|
|
1074
|
+
|
|
1075
|
+
// setStartCell?.({ rowId, colId: startCol });
|
|
1076
|
+
// setEndCell?.({ rowId, colId: endCol });
|
|
1077
|
+
|
|
1078
|
+
pipeline.setStateAtKey(_constants.stateKeyStartCell, {
|
|
1079
|
+
rowId,
|
|
1080
|
+
colId: startCol
|
|
1081
|
+
});
|
|
1082
|
+
pipeline.setStateAtKey(_constants.stateKeyEndCell, {
|
|
1083
|
+
rowId,
|
|
1084
|
+
colId: endCol
|
|
1085
|
+
});
|
|
1086
|
+
|
|
1087
|
+
// if (firstCOlSpin) {
|
|
1088
|
+
// setFocusedCell?.({ rowId: cell.row.id, colId: firstCOlSpin.id })
|
|
1089
|
+
// } else {
|
|
1090
|
+
// const firstCOlVisible = allColumns[0]
|
|
1091
|
+
// setFocusedCell?.({ rowId: cell.row.id, colId: firstCOlVisible.id })
|
|
1092
|
+
// }
|
|
1093
|
+
pipeline.setStateAtKey(_constants.stateKeyFocusedCell, {
|
|
1094
|
+
rowId,
|
|
1095
|
+
colId: startCol
|
|
1096
|
+
});
|
|
1097
|
+
|
|
1098
|
+
// setRangeState?.(getSelectedCellMatrix(table, { rowId, colId: startCol }, { rowId, colId: endCol }))
|
|
1099
|
+
};
|
|
1100
|
+
const handleMouseEnterIndex = rowId => {
|
|
1101
|
+
if (isSelecting) {
|
|
1102
|
+
const allColumns = allCols.filter(it => !_hooks.nonActionColumn.includes(it.field));
|
|
1103
|
+
|
|
1104
|
+
// const firstCOl = findFirst(allColumns)
|
|
1105
|
+
|
|
1106
|
+
// const startCol = allColumns[0].id
|
|
1107
|
+
const endCol = allColumns[allColumns.length - 1].field;
|
|
1108
|
+
|
|
1109
|
+
// // setStartCell?.({ rowId, colId: startCol });
|
|
1110
|
+
// setEndCell?.({ rowId, colId: endCol });
|
|
1111
|
+
pipeline.setStateAtKey(_constants.stateKeyEndCell, {
|
|
1112
|
+
rowId,
|
|
1113
|
+
colId: endCol
|
|
1114
|
+
});
|
|
1115
|
+
}
|
|
1116
|
+
};
|
|
1117
|
+
const handleMouseUpIndex = () => {
|
|
1118
|
+
// setIsSelecting?.(false);
|
|
1119
|
+
|
|
1120
|
+
pipeline.setStateAtKey(_constants.stateKeyIsSelecting, false);
|
|
1121
|
+
|
|
1122
|
+
// const selectState = getSelectedCellMatrix(table, startCell, endCell)
|
|
1123
|
+
|
|
1124
|
+
// if (!isObjEqual(rangeState, selectState)) {
|
|
1125
|
+
|
|
1126
|
+
// setRangeState?.(selectState)
|
|
1127
|
+
// }
|
|
1128
|
+
};
|
|
1061
1129
|
pipeline.mapColumns((0, _utils.makeRecursiveMapper)((col, params) => {
|
|
1062
1130
|
const {
|
|
1063
1131
|
startIndex,
|
|
@@ -1210,6 +1278,7 @@ function columnCustom(opts) {
|
|
|
1210
1278
|
// cell Index
|
|
1211
1279
|
if (col.field === '#') {
|
|
1212
1280
|
const prevContent = col.template;
|
|
1281
|
+
const prevGetCellProps = col?.getCellProps;
|
|
1213
1282
|
return {
|
|
1214
1283
|
...col,
|
|
1215
1284
|
lock: !!col.fixed,
|
|
@@ -1244,7 +1313,73 @@ function columnCustom(opts) {
|
|
|
1244
1313
|
overflow: 'visible',
|
|
1245
1314
|
position: 'relative'
|
|
1246
1315
|
}
|
|
1247
|
-
})
|
|
1316
|
+
}),
|
|
1317
|
+
getCellProps(value, record, rowIndex) {
|
|
1318
|
+
const prevCellProps = prevGetCellProps?.(value, record, rowIndex);
|
|
1319
|
+
|
|
1320
|
+
// const isCellSelected = (!startCell || !endCell) ? false : selectRowIds.includes(record.rowId) && cols.includes(col.field);
|
|
1321
|
+
|
|
1322
|
+
return (0, _utils.mergeCellProps)(prevCellProps, {
|
|
1323
|
+
// @ts-ignore
|
|
1324
|
+
'data-col-key': col.field,
|
|
1325
|
+
ref: el => {
|
|
1326
|
+
if (focusedCell?.rowId === record.rowId && focusedCell?.colId === col.field && !isEditing.editing) {
|
|
1327
|
+
el?.focus({
|
|
1328
|
+
preventScroll: true
|
|
1329
|
+
});
|
|
1330
|
+
}
|
|
1331
|
+
},
|
|
1332
|
+
style: {
|
|
1333
|
+
...prevCellProps?.style,
|
|
1334
|
+
userSelect: 'none'
|
|
1335
|
+
// padding: cellEditing ? 0 : undefined
|
|
1336
|
+
// ...cellStyles,
|
|
1337
|
+
},
|
|
1338
|
+
className: (0, _classnames.default)(prevCellProps?.className, `${prefix}-grid-cell`, {
|
|
1339
|
+
[`${prefix}-grid-cell-ellipsis`]: !wrapSettings || !(wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Content')),
|
|
1340
|
+
[`${prefix}-grid-cell-wrap`]: wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Content'),
|
|
1341
|
+
[`${prefix}-grid-cell-text-center`]: col?.textAlign === 'center',
|
|
1342
|
+
[`${prefix}-grid-cell-text-right`]: col?.textAlign === 'right' || col.type === 'number',
|
|
1343
|
+
[`${prefix}-grid-cell-index-selected`]: selectRowIds?.includes(record.rowId),
|
|
1344
|
+
'no-hover': editAble
|
|
1345
|
+
|
|
1346
|
+
// isValid: !isEditing && rowError && rowError[col.field]?.field === col.field,
|
|
1347
|
+
// [`${prefix}-grid-cell-selected`]: isCellSelected,
|
|
1348
|
+
}),
|
|
1349
|
+
onMouseDown: e => {
|
|
1350
|
+
prevCellProps?.onMouseDown?.(e);
|
|
1351
|
+
if (editAble) {
|
|
1352
|
+
// if (record[rowKey] === editingKey) {
|
|
1353
|
+
if (isEditing.editing) {
|
|
1354
|
+
// setFocusedCell?.({ rowId: cell.row.id, colId: cell.column.id })
|
|
1355
|
+
} else {
|
|
1356
|
+
handleMouseDownIndex(record.rowId);
|
|
1357
|
+
if (isEditing.editing) {
|
|
1358
|
+
setTimeout(() => {
|
|
1359
|
+
// setEditingKey?.('')
|
|
1360
|
+
pipeline.setStateAtKey(_constants.stateKeyIsEditing, defaultCellEditing);
|
|
1361
|
+
reset?.();
|
|
1362
|
+
});
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
},
|
|
1367
|
+
onMouseEnter: e => {
|
|
1368
|
+
prevCellProps?.onMouseEnter?.(e);
|
|
1369
|
+
// Edit
|
|
1370
|
+
|
|
1371
|
+
if (editAble) {
|
|
1372
|
+
handleMouseEnterIndex(record.rowId);
|
|
1373
|
+
}
|
|
1374
|
+
},
|
|
1375
|
+
onMouseUp: e => {
|
|
1376
|
+
prevCellProps?.onMouseUp?.(e);
|
|
1377
|
+
if (editAble) {
|
|
1378
|
+
handleMouseUpIndex();
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
});
|
|
1382
|
+
}
|
|
1248
1383
|
};
|
|
1249
1384
|
}
|
|
1250
1385
|
|
|
@@ -1511,9 +1646,6 @@ function columnCustom(opts) {
|
|
|
1511
1646
|
}),
|
|
1512
1647
|
getCellProps(value, record, rowIndex) {
|
|
1513
1648
|
const prevCellProps = prevGetCellProps?.(value, record, rowIndex);
|
|
1514
|
-
|
|
1515
|
-
// console.log('record', record)
|
|
1516
|
-
|
|
1517
1649
|
const fomatedValue = ['color', 'checkbox', 'field'].includes(col.type ?? '') ? '' : (0, _useColumns.renderValueCell)(col, value, record, rowIndex, 0, format, false);
|
|
1518
1650
|
const tooltipContent = isOpenTooltip === false ? '' : col?.tooltipDescription ? typeof col.tooltipDescription === 'function' ? col.tooltipDescription({
|
|
1519
1651
|
value,
|
|
@@ -25,4 +25,15 @@ export declare function filterVisibleColumns<T extends ColumnTable>(columns: T[]
|
|
|
25
25
|
export declare const sortByType: (arr: ColumnTable[], rowDnd?: RowDnd) => ColumnTable[];
|
|
26
26
|
export declare function getVisibleColumnFields<T extends ColumnTable>(columns: T[]): string[];
|
|
27
27
|
export declare const getOnlyInA: (a: string[], b: string[]) => string[];
|
|
28
|
+
export declare const buildParentMap: <T extends {
|
|
29
|
+
id: string;
|
|
30
|
+
rowId: string;
|
|
31
|
+
children?: T[];
|
|
32
|
+
}>(tree: T[]) => Map<string, T>;
|
|
33
|
+
export declare const flattenTree: <T extends {
|
|
34
|
+
children?: T[];
|
|
35
|
+
}>(tree: T[]) => T[];
|
|
36
|
+
export declare const flattenTree2: <T extends {
|
|
37
|
+
children?: T[];
|
|
38
|
+
}>(tree: T[]) => Omit<T, 'children'>[];
|
|
28
39
|
export {};
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.addRowIdArray = void 0;
|
|
6
|
+
exports.buildParentMap = exports.addRowIdArray = void 0;
|
|
7
7
|
exports.filterDataByColumns1 = filterDataByColumns1;
|
|
8
8
|
exports.filterVisibleColumns = filterVisibleColumns;
|
|
9
|
-
exports.getOnlyInA = exports.getMaxDepth = exports.flattenArray = void 0;
|
|
9
|
+
exports.getOnlyInA = exports.getMaxDepth = exports.flattenTree2 = exports.flattenTree = exports.flattenArray = void 0;
|
|
10
10
|
exports.getVisibleColumnFields = getVisibleColumnFields;
|
|
11
11
|
exports.sortByType = exports.shouldIncludeOptimized = void 0;
|
|
12
12
|
exports.sortData = sortData;
|
|
@@ -723,4 +723,56 @@ const getOnlyInA = (a, b) => {
|
|
|
723
723
|
const setB = new Set(b);
|
|
724
724
|
return a.filter(item => !setB.has(item));
|
|
725
725
|
};
|
|
726
|
-
exports.getOnlyInA = getOnlyInA;
|
|
726
|
+
exports.getOnlyInA = getOnlyInA;
|
|
727
|
+
const buildParentMap = tree => {
|
|
728
|
+
const parentMap = new Map();
|
|
729
|
+
const stack = [...tree];
|
|
730
|
+
while (stack.length) {
|
|
731
|
+
const node = stack.pop();
|
|
732
|
+
const children = node.children;
|
|
733
|
+
if (!children?.length) continue;
|
|
734
|
+
for (let i = 0; i < children.length; i++) {
|
|
735
|
+
const child = children[i];
|
|
736
|
+
parentMap.set(child.rowId, node);
|
|
737
|
+
stack.push(child);
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
return parentMap;
|
|
741
|
+
};
|
|
742
|
+
exports.buildParentMap = buildParentMap;
|
|
743
|
+
const flattenTree = tree => {
|
|
744
|
+
const result = [];
|
|
745
|
+
const stack = [...tree];
|
|
746
|
+
while (stack.length) {
|
|
747
|
+
const node = stack.pop();
|
|
748
|
+
result.push(node);
|
|
749
|
+
const children = node.children;
|
|
750
|
+
if (children?.length) {
|
|
751
|
+
// Push ngược để giữ nguyên thứ tự tree
|
|
752
|
+
for (let i = children.length - 1; i >= 0; i--) {
|
|
753
|
+
stack.push(children[i]);
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
return result;
|
|
758
|
+
};
|
|
759
|
+
exports.flattenTree = flattenTree;
|
|
760
|
+
const flattenTree2 = tree => {
|
|
761
|
+
const result = [];
|
|
762
|
+
const stack = [...tree];
|
|
763
|
+
while (stack.length) {
|
|
764
|
+
const node = stack.pop();
|
|
765
|
+
const {
|
|
766
|
+
children,
|
|
767
|
+
...item
|
|
768
|
+
} = node;
|
|
769
|
+
result.push(item);
|
|
770
|
+
if (children?.length) {
|
|
771
|
+
for (let i = children.length - 1; i >= 0; i--) {
|
|
772
|
+
stack.push(children[i]);
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
return result;
|
|
777
|
+
};
|
|
778
|
+
exports.flattenTree2 = flattenTree2;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "es-grid-template",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.74",
|
|
4
4
|
"description": "es-grid-template",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"rc-checkbox": "3.5.0",
|
|
67
67
|
"rc-dropdown": "4.2.1",
|
|
68
68
|
"rc-field-form": "2.6.0",
|
|
69
|
-
"rc-master-ui": "1.1.
|
|
69
|
+
"rc-master-ui": "1.1.64",
|
|
70
70
|
"rc-select": "14.16.3",
|
|
71
71
|
"rc-tooltip": "6.3.0",
|
|
72
72
|
"rc-tree": "5.10.1",
|