@kdcloudjs/table 1.1.3-canary.4 → 1.1.3-canary.5

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 (58) hide show
  1. package/CHANGELOG.md +0 -0
  2. package/LICENSE +568 -568
  3. package/README.md +111 -111
  4. package/dist/@kdcloudjs/table.css +1 -1
  5. package/dist/@kdcloudjs/table.js +1187 -1337
  6. package/dist/@kdcloudjs/table.js.map +1 -1
  7. package/dist/@kdcloudjs/table.min.css +1 -1
  8. package/dist/@kdcloudjs/table.min.js +15 -24
  9. package/dist/@kdcloudjs/table.min.js.map +1 -1
  10. package/dist/kd-ui-complete.less +777 -777
  11. package/es/style/color/colors.less +1 -1
  12. package/es/style/core/index.less +1 -1
  13. package/es/style/core/motion/other.less +27 -27
  14. package/es/style/core/motion/slide.less +53 -53
  15. package/es/style/core/motion.less +1 -1
  16. package/es/style/core/reset.less +185 -185
  17. package/es/style/index.less +1 -1
  18. package/es/style/mixins/index.less +18 -18
  19. package/es/style/mixins/overlay.less +21 -21
  20. package/es/style/mixins/reset.less +12 -12
  21. package/es/style/themes/default.less +445 -445
  22. package/es/table/base/helpers/TableDOMUtils.d.ts +2 -0
  23. package/es/table/base/helpers/TableDOMUtils.js +48 -12
  24. package/es/table/base/styles.js +1 -1
  25. package/es/table/base/table.d.ts +0 -1
  26. package/es/table/base/table.js +9 -24
  27. package/es/table/pipeline/features/filter/Filter.js +1 -1
  28. package/es/table/pipeline/features/filter/FilterPanel.js +1 -1
  29. package/es/table/pipeline/features/index.d.ts +1 -0
  30. package/es/table/pipeline/features/index.js +2 -1
  31. package/es/table/pipeline/features/mergeCellHover.d.ts +2 -0
  32. package/es/table/pipeline/features/mergeCellHover.js +32 -0
  33. package/es/table/style/index.less +1 -1
  34. package/lib/style/color/colors.less +1 -1
  35. package/lib/style/components.less +1 -1
  36. package/lib/style/core/index.less +1 -1
  37. package/lib/style/core/motion/other.less +27 -27
  38. package/lib/style/core/motion/slide.less +53 -53
  39. package/lib/style/core/motion.less +1 -1
  40. package/lib/style/core/reset.less +185 -185
  41. package/lib/style/index.less +1 -1
  42. package/lib/style/mixins/index.less +18 -18
  43. package/lib/style/mixins/overlay.less +21 -21
  44. package/lib/style/mixins/reset.less +12 -12
  45. package/lib/style/themes/default.less +445 -445
  46. package/lib/table/base/helpers/TableDOMUtils.d.ts +2 -0
  47. package/lib/table/base/helpers/TableDOMUtils.js +51 -12
  48. package/lib/table/base/styles.js +1 -1
  49. package/lib/table/base/table.d.ts +0 -1
  50. package/lib/table/base/table.js +9 -24
  51. package/lib/table/pipeline/features/filter/Filter.js +1 -1
  52. package/lib/table/pipeline/features/filter/FilterPanel.js +1 -1
  53. package/lib/table/pipeline/features/index.d.ts +1 -0
  54. package/lib/table/pipeline/features/index.js +9 -1
  55. package/lib/table/pipeline/features/mergeCellHover.d.ts +2 -0
  56. package/lib/table/pipeline/features/mergeCellHover.js +43 -0
  57. package/lib/table/style/index.less +1 -1
  58. package/package.json +218 -218
@@ -18,4 +18,6 @@ export declare class TableDOMHelper {
18
18
  getRightLockShadow(): HTMLDivElement;
19
19
  getLoadingIndicator(): HTMLDivElement;
20
20
  getRowTop(rowIndex: number): number;
21
+ getRowNodeListByEvent: (e: React.MouseEvent<HTMLTableRowElement, MouseEvent>) => HTMLElement[];
22
+ getInRangeRowByCellEvent: (e: React.MouseEvent<HTMLTableCellElement, MouseEvent>) => unknown[];
21
23
  }
@@ -1,5 +1,7 @@
1
1
  import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime-corejs3/helpers/createClass";
3
+ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
4
+ import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
3
5
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
4
6
  import { Classes } from '../styles'; // 表格 DOM 结构
5
7
  // div.art-table-wrapper
@@ -41,10 +43,44 @@ import { Classes } from '../styles'; // 表格 DOM 结构
41
43
 
42
44
  export var TableDOMHelper = /*#__PURE__*/function () {
43
45
  function TableDOMHelper(artTableWrapper) {
44
- var _context;
46
+ var _this = this,
47
+ _context2;
45
48
 
46
49
  _classCallCheck(this, TableDOMHelper);
47
50
 
51
+ this.getRowNodeListByEvent = function (e) {
52
+ var nodeList = null;
53
+ var rowIndex = e.currentTarget.dataset.rowindex;
54
+
55
+ if (rowIndex !== undefined) {
56
+ var targetParent = _this.tableBody.contains(e.currentTarget) ? _this.tableBody : _this.tableFooter;
57
+ nodeList = targetParent.querySelectorAll("tr[data-rowindex=\"".concat(rowIndex, "\"]"));
58
+ }
59
+
60
+ return nodeList;
61
+ };
62
+
63
+ this.getInRangeRowByCellEvent = function (e) {
64
+ var _context;
65
+
66
+ var _a;
67
+
68
+ var getParentNode = function getParentNode(ele, target) {
69
+ if (ele.parentNode.nodeName === target) {
70
+ return ele.parentNode;
71
+ }
72
+
73
+ return getParentNode(ele.parentNode, target);
74
+ };
75
+
76
+ e = e instanceof Array ? e[0] : e;
77
+ var curCell = e === null || e === void 0 ? void 0 : e.currentTarget;
78
+ var curRow = getParentNode(curCell, 'TR');
79
+ var curRowSpan = parseInt(e.currentTarget.getAttribute('rowspan')) || 1;
80
+ var rows = (_a = getParentNode(curCell, 'TABLE')) === null || _a === void 0 ? void 0 : _a.rows;
81
+ return _sliceInstanceProperty(_context = _Array$from(rows)).call(_context, curRow.rowIndex, curRow.rowIndex + curRowSpan);
82
+ };
83
+
48
84
  this.artTableWrapper = artTableWrapper;
49
85
  this.artTable = artTableWrapper.querySelector(".".concat(Classes.artTable));
50
86
  this.tableHeader = this.artTable.querySelector(".".concat(Classes.tableHeader));
@@ -55,7 +91,7 @@ export var TableDOMHelper = /*#__PURE__*/function () {
55
91
  this.tableFooter = this.artTable.querySelector(".".concat(Classes.tableFooter));
56
92
  this.tableFooterMain = this.artTable.querySelector(".".concat(Classes.tableFooterMain));
57
93
 
58
- var stickyScrollSelector = _concatInstanceProperty(_context = ".".concat(Classes.artTable, " + .")).call(_context, Classes.stickyScroll);
94
+ var stickyScrollSelector = _concatInstanceProperty(_context2 = ".".concat(Classes.artTable, " + .")).call(_context2, Classes.stickyScroll);
59
95
 
60
96
  this.stickyScroll = artTableWrapper.querySelector(stickyScrollSelector);
61
97
  this.stickyScrollItem = this.stickyScroll.querySelector(".".concat(Classes.stickyScrollItem));
@@ -69,33 +105,33 @@ export var TableDOMHelper = /*#__PURE__*/function () {
69
105
  }, {
70
106
  key: "getTableRows",
71
107
  value: function getTableRows() {
72
- var _context2;
108
+ var _context3;
73
109
 
74
- var tbody = this.artTable.querySelector(_concatInstanceProperty(_context2 = ".".concat(Classes.tableBody, " .")).call(_context2, Classes.virtual, " table tbody"));
110
+ var tbody = this.artTable.querySelector(_concatInstanceProperty(_context3 = ".".concat(Classes.tableBody, " .")).call(_context3, Classes.virtual, " table tbody"));
75
111
  return tbody.childNodes;
76
112
  }
77
113
  }, {
78
114
  key: "getTableBodyHtmlTable",
79
115
  value: function getTableBodyHtmlTable() {
80
- var _context3;
116
+ var _context4;
81
117
 
82
- return this.artTable.querySelector(_concatInstanceProperty(_context3 = ".".concat(Classes.tableBody, " .")).call(_context3, Classes.virtual, " table"));
118
+ return this.artTable.querySelector(_concatInstanceProperty(_context4 = ".".concat(Classes.tableBody, " .")).call(_context4, Classes.virtual, " table"));
83
119
  }
84
120
  }, {
85
121
  key: "getLeftLockShadow",
86
122
  value: function getLeftLockShadow() {
87
- var _context4;
123
+ var _context5;
88
124
 
89
- var selector = _concatInstanceProperty(_context4 = ".".concat(Classes.lockShadowMask, " .")).call(_context4, Classes.leftLockShadow);
125
+ var selector = _concatInstanceProperty(_context5 = ".".concat(Classes.lockShadowMask, " .")).call(_context5, Classes.leftLockShadow);
90
126
 
91
127
  return this.artTable.querySelector(selector);
92
128
  }
93
129
  }, {
94
130
  key: "getRightLockShadow",
95
131
  value: function getRightLockShadow() {
96
- var _context5;
132
+ var _context6;
97
133
 
98
- var selector = _concatInstanceProperty(_context5 = ".".concat(Classes.lockShadowMask, " .")).call(_context5, Classes.rightLockShadow);
134
+ var selector = _concatInstanceProperty(_context6 = ".".concat(Classes.lockShadowMask, " .")).call(_context6, Classes.rightLockShadow);
99
135
 
100
136
  return this.artTable.querySelector(selector);
101
137
  }
@@ -107,11 +143,11 @@ export var TableDOMHelper = /*#__PURE__*/function () {
107
143
  }, {
108
144
  key: "getRowTop",
109
145
  value: function getRowTop(rowIndex) {
110
- var _context6, _context7;
146
+ var _context7, _context8;
111
147
 
112
148
  if (rowIndex === 0) return 0;
113
149
 
114
- var selector = _concatInstanceProperty(_context6 = _concatInstanceProperty(_context7 = ".".concat(Classes.tableBody, " .")).call(_context7, Classes.tableRow, "[data-rowindex=\"")).call(_context6, rowIndex, "\"]");
150
+ var selector = _concatInstanceProperty(_context7 = _concatInstanceProperty(_context8 = ".".concat(Classes.tableBody, " .")).call(_context8, Classes.tableRow, "[data-rowindex=\"")).call(_context7, rowIndex, "\"]");
115
151
 
116
152
  var row = this.artTable.querySelector(selector);
117
153
  var rowOffsetTop = row && row.offsetTop || 0;
@@ -120,7 +120,7 @@ export var defaultCSSVariables = {
120
120
  '--header-cell-border-horizontal': '1px solid #dfe3e8'
121
121
  };
122
122
  export var variableConst = getCssVariableText(defaultCSSVariables);
123
- export var StyledArtTableWrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n :root {\n ", "\n }\n ", "\n\n box-sizing: border-box;\n * {\n box-sizing: border-box;\n }\n cursor: default;\n color: var(--color);\n font-size: var(--font-size);\n line-height: var(--line-height);\n position: relative;\n\n // \u8868\u683C\u5916\u8FB9\u6846\u7531 art-table-wrapper \u63D0\u4F9B\uFF0C\u800C\u4E0D\u662F\u7531\u5355\u5143\u683C\u63D0\u4F9B\n &.use-outer-border {\n ", ";\n }\n\n .no-scrollbar {\n ::-webkit-scrollbar {\n display: none;\n }\n }\n\n .", " {\n overflow: auto;\n flex-shrink: 1;\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n user-select:none;\n }\n\n .", " {\n overflow: hidden;\n background: var(--header-bgcolor);\n display: flex;\n flex-shrink: 0;\n border-bottom: var(--header-cell-border-horizontal);\n }\n\n .", " {\n display: flex;\n // justify-content: flex-start;\n align-items: center;\n height: inherit;\n }\n\n .", " {\n overflow-x:auto;\n flex-shrink: 0;\n flex-grow: 0;\n scrollbar-width: none; // \u517C\u5BB9\u706B\u72D0\n & {\n ::-webkit-scrollbar {\n display:none;\n }\n }\n }\n\n .", " {\n display: flex;\n flex: none;\n }\n .", ", .", " {\n background: var(--bgcolor);\n overflow: auto;\n overflow-x: hidden;\n overflow-anchor: none;\n position:relative;\n &.empty {\n position: relative;\n }\n }\n\n .", " {\n position: relative;\n }\n .", " {\n .", "{\n background-color: #e6effb !important;\n }\n .", "{\n border-top: 1px solid #0E5FD8 !important;\n }\n .", "{\n border-left: 1px solid #0E5FD8 !important;\n }\n .", "{\n border-bottom: 1px solid #0E5FD8 !important;\n }\n .", "{\n border-right: 1px solid #0E5FD8 !important;\n }\n }\n \n\n &.sticky-header .", " {\n position: sticky;\n top: 0;\n z-index: ", ";\n }\n\n &.sticky-footer .", " {\n position: sticky;\n bottom: 0;\n z-index: ", ";\n }\n\n table {\n width: 0;\n table-layout: fixed;\n border-collapse: separate;\n border-spacing: 0;\n display: table;\n margin: 0;\n padding: 0;\n flex-shrink: 0;\n flex-grow: 0;\n position:relative;\n }\n\n // \u5728 tr \u4E0A\u8BBE\u7F6E .no-hover \u53EF\u4EE5\u7981\u7528\u9F20\u6807\u60AC\u505C\u6548\u679C\n tr:not(.no-hover):hover > td {\n background: var(--hover-bgcolor);\n }\n // \u5728 tr \u8BBE\u7F6E highlight \u53EF\u4EE5\u4E3A\u5E95\u4E0B\u7684 td \u8BBE\u7F6E\u4E3A\u9AD8\u4EAE\u8272\n // \u800C\u8BBE\u7F6E .no-highlight \u7684\u8BDD\u5219\u53EF\u4EE5\u7981\u7528\u9AD8\u4EAE\u6548\u679C\uFF1B\n tr:not(.no-highlight).highlight > td {\n background: var(--highlight-bgcolor);\n }\n\n th {\n font-weight: normal;\n text-align: left;\n padding: var(--cell-padding);\n height: var(--header-row-height);\n color: var(--header-color);\n background: var(--header-bgcolor);\n border:1px solid transparent;\n border-right: var(--header-cell-border-vertical);\n border-bottom: var(--header-cell-border-horizontal);\n position: relative;\n }\n\n th.resizeable{\n border-right:none\n }\n\n th.", " {\n border-right: none;\n border-bottom: none;\n }\n\n tr.", " th {\n border-top: var(--header-cell-border-horizontal);\n }\n th.", " {\n border-left: var(--header-cell-border-vertical);\n }\n\n td {\n padding: var(--cell-padding);\n background: var(--bgcolor);\n height: var(--row-height);\n border:1px solid transparent;\n border-right: var(--cell-border-vertical);\n border-bottom: var(--cell-border-horizontal);\n word-break: break-all;\n }\n td.", " {\n border-left: var(--cell-border-vertical);\n }\n tr.", " td {\n border-top: var(--cell-border-horizontal);\n }\n &.has-header tbody tr.", " td {\n border-top: none;\n }\n &.has-footer tbody tr.", " td {\n border-bottom: none;\n }\n\n .", ",\n .", " {\n z-index: ", ";\n }\n\n //#region \u9501\u5217\u9634\u5F71\n .", " {\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: ", ";\n pointer-events: none;\n overflow: hidden;\n\n .", " {\n height: 100%;\n }\n\n .", " {\n margin-right: ", "px;\n box-shadow: none;\n\n &.show-shadow {\n box-shadow: var(--lock-shadow);\n border-right: var(--cell-border-vertical);\n }\n }\n\n .", " {\n margin-left: ", "px;\n box-shadow: none;\n\n &.show-shadow {\n box-shadow: var(--lock-shadow);\n border-left: var(--cell-border-vertical);\n }\n }\n }\n //#endregion\n\n //#region \u7A7A\u8868\u683C\u5C55\u73B0\n .", " {\n pointer-events: none;\n color: #99a3b3;\n font-size: 12px;\n text-align: center;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n\n .empty-image {\n width: 50px;\n height: 50px;\n }\n\n .empty-tips {\n margin-top: 16px;\n line-height: 1.5;\n }\n }\n //#endregion\n\n //#region IE\u517C\u5BB9\n &.ie-polyfill-wrapper {\n //\u9501\u5B9A\u5217\u517C\u5BB9 \u4EC5\u5728\u9501\u5B9A\u5217\u7684\u60C5\u51B5\u4E0B\u751F\u6548\n .", " {\n overflow-x: hidden;\n }\n .", ", .", " {\n position:relative;\n }\n .", " {\n overflow: hidden;\n }\n .", " {\n position: relative;\n }\n\n .", " {\n overflow: auto;\n overflow-x: hidden;\n overflow-anchor: none;\n }\n\n .", ", .", "{\n position: absolute;\n z-index: ", ";\n top: 0;\n }\n .", "{\n left:0;\n }\n .", "{\n right:0;\n }\n\n .", "{\n .", "{\n position: absolute;\n top: 0;\n width: 100%;\n z-index: ", ";\n }\n }\n\n tr:not(.no-hover).row-hover > td {\n background: var(--hover-bgcolor);\n }\n }\n //#endregion\n\n //#region \u7C98\u6027\u6EDA\u52A8\u6761\n .", " {\n overflow-y: hidden;\n overflow-x: auto;\n z-index: ", ";\n flex-shrink: 0;\n flex-grow: 0;\n border-top: 1px solid var(--border-color);\n background: var(--bgcolor);\n }\n\n .", " {\n // \u5FC5\u987B\u6709\u9AD8\u5EA6\u624D\u80FD\u51FA\u73B0\u6EDA\u52A8\u6761\n height: 1px;\n visibility: hidden;\n }\n //#endregion\n\n //#region \u52A0\u8F7D\u6837\u5F0F\n .", " {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: auto;\n\n .", " {\n filter: none;\n width: 100%;\n height: 100%;\n overflow: auto;\n display: flex;\n position: relative;\n flex-direction: column;\n }\n\n .", " {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n pointer-events: none;\n }\n\n .", " {\n position: sticky;\n z-index: ", ";\n transform: translateY(-50%);\n }\n }\n //#endregion\n \n //#region \u8868\u683C\u8FC7\u6EE4\n .", " {\n color:var(--icon-color);\n &.active{\n color:var(--primary-color);\n }\n }\n //#endregion\n\n //#region \u8868\u683C\u6392\u5E8F\n .", " {\n color:var(--icon-color);\n &.active{\n color:var(--primary-color);\n }\n }\n //#endregion\n\n //#region \u6EDA\u52A8\u6761\u5360\u4F4D\n .", " {\n visibility: hidden;\n flex-shrink: 0;\n }\n .", " .", " {\n border-top: var(--cell-border-horizontal);\n }\n //#endregion\n "])), variableConst, variableConst, outerBorderStyleMixin, Classes.artTable, Classes.tableHeader, Classes.tableHeaderCellContent, Classes.virtual, Classes.tableFooter, Classes.tableBody, Classes.tableFooter, Classes.tableRow, Classes.tableBody, Classes.tableCellRangeSelected, Classes.tableCellRangeTop, Classes.tableCellRangeLeft, Classes.tableCellRangeBottom, Classes.tableCellRangeRight, Classes.tableHeader, Z.header, Classes.tableFooter, Z.footer, Classes.leaf, Classes.first, Classes.first, Classes.first, Classes.first, Classes.first, Classes.last, Classes.lockLeft, Classes.lockRight, Z.lock, Classes.lockShadowMask, Z.lockShadow, Classes.lockShadow, Classes.leftLockShadow, LOCK_SHADOW_PADDING, Classes.rightLockShadow, LOCK_SHADOW_PADDING, Classes.emptyWrapper, Classes.virtual, Classes.tableBody, Classes.tableFooter, Classes.tableHeaderMain, Classes.tableHeader, Classes.tableFooterMain, Classes.fixedLeft, Classes.fixedRight, Z.lock, Classes.fixedLeft, Classes.fixedRight, Classes.rowDetailContainer, Classes.rowDetailItem, Z.rowDetail, Classes.stickyScroll, Z.scrollItem, Classes.stickyScrollItem, Classes.loadingWrapper, Classes.loadingContentWrapper, Classes.loadingIndicatorWrapper, Classes.loadingIndicator, Z.loadingIndicator, Classes.tableFilterTrigger, Classes.tableSortIcon, Classes.verticalScrollPlaceholder, Classes.tableFooter, Classes.verticalScrollPlaceholder);
123
+ export var StyledArtTableWrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n :root {\n ", "\n }\n ", "\n\n box-sizing: border-box;\n * {\n box-sizing: border-box;\n }\n cursor: default;\n color: var(--color);\n font-size: var(--font-size);\n line-height: var(--line-height);\n position: relative;\n\n // \u8868\u683C\u5916\u8FB9\u6846\u7531 art-table-wrapper \u63D0\u4F9B\uFF0C\u800C\u4E0D\u662F\u7531\u5355\u5143\u683C\u63D0\u4F9B\n &.use-outer-border {\n ", ";\n }\n\n .no-scrollbar {\n ::-webkit-scrollbar {\n display: none;\n }\n }\n\n .", " {\n overflow: auto;\n flex-shrink: 1;\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n user-select:none;\n }\n\n .", " {\n overflow: hidden;\n background: var(--header-bgcolor);\n display: flex;\n flex-shrink: 0;\n border-bottom: var(--header-cell-border-horizontal);\n }\n\n .", " {\n display: flex;\n // justify-content: flex-start;\n align-items: center;\n height: inherit;\n }\n\n .", " {\n overflow-x:auto;\n flex-shrink: 0;\n flex-grow: 0;\n scrollbar-width: none; // \u517C\u5BB9\u706B\u72D0\n & {\n ::-webkit-scrollbar {\n display:none;\n }\n }\n }\n\n .", " {\n display: flex;\n flex: none;\n }\n .", ", .", " {\n background: var(--bgcolor);\n overflow: auto;\n overflow-x: hidden;\n overflow-anchor: none;\n position:relative;\n &.empty {\n position: relative;\n }\n }\n\n .", " {\n position: relative;\n }\n .", " {\n .", "{\n background-color: #e6effb !important;\n }\n .", "{\n border-top: 1px solid #0E5FD8 !important;\n }\n .", "{\n border-left: 1px solid #0E5FD8 !important;\n }\n .", "{\n border-bottom: 1px solid #0E5FD8 !important;\n }\n .", "{\n border-right: 1px solid #0E5FD8 !important;\n }\n }\n\n\n &.sticky-header .", " {\n position: sticky;\n top: 0;\n z-index: ", ";\n }\n\n &.sticky-footer .", " {\n position: sticky;\n bottom: 0;\n z-index: ", ";\n }\n\n table {\n width: 0;\n table-layout: fixed;\n border-collapse: separate;\n border-spacing: 0;\n display: table;\n margin: 0;\n padding: 0;\n flex-shrink: 0;\n flex-grow: 0;\n position:relative;\n }\n\n // \u5728 tr \u4E0A\u8BBE\u7F6E .no-hover \u53EF\u4EE5\u7981\u7528\u9F20\u6807\u60AC\u505C\u6548\u679C\n tr:not(.no-hover):hover > td {\n background: var(--hover-bgcolor);\n }\n // \u4F7F\u7528 js \u6DFB\u52A0\u60AC\u6D6E\u6548\u679C\n tr:not(.no-hover).row-hover > td {\n background: var(--hover-bgcolor);\n }\n // \u5728 tr \u8BBE\u7F6E highlight \u53EF\u4EE5\u4E3A\u5E95\u4E0B\u7684 td \u8BBE\u7F6E\u4E3A\u9AD8\u4EAE\u8272\n // \u800C\u8BBE\u7F6E .no-highlight \u7684\u8BDD\u5219\u53EF\u4EE5\u7981\u7528\u9AD8\u4EAE\u6548\u679C\uFF1B\n tr:not(.no-highlight).highlight > td {\n background: var(--highlight-bgcolor);\n }\n\n th {\n font-weight: normal;\n text-align: left;\n padding: var(--cell-padding);\n height: var(--header-row-height);\n color: var(--header-color);\n background: var(--header-bgcolor);\n border:1px solid transparent;\n border-right: var(--header-cell-border-vertical);\n border-bottom: var(--header-cell-border-horizontal);\n position: relative;\n }\n\n th.resizeable{\n border-right:none\n }\n\n th.", " {\n border-right: none;\n border-bottom: none;\n }\n\n tr.", " th {\n border-top: var(--header-cell-border-horizontal);\n }\n th.", " {\n border-left: var(--header-cell-border-vertical);\n }\n\n td {\n padding: var(--cell-padding);\n background: var(--bgcolor);\n height: var(--row-height);\n border:1px solid transparent;\n border-right: var(--cell-border-vertical);\n border-bottom: var(--cell-border-horizontal);\n word-break: break-all;\n }\n td.", " {\n border-left: var(--cell-border-vertical);\n }\n tr.", " td {\n border-top: var(--cell-border-horizontal);\n }\n &.has-header tbody tr.", " td {\n border-top: none;\n }\n &.has-footer tbody tr.", " td {\n border-bottom: none;\n }\n\n .", ",\n .", " {\n z-index: ", ";\n }\n\n //#region \u9501\u5217\u9634\u5F71\n .", " {\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: ", ";\n pointer-events: none;\n overflow: hidden;\n\n .", " {\n height: 100%;\n }\n\n .", " {\n margin-right: ", "px;\n box-shadow: none;\n\n &.show-shadow {\n box-shadow: var(--lock-shadow);\n border-right: var(--cell-border-vertical);\n }\n }\n\n .", " {\n margin-left: ", "px;\n box-shadow: none;\n\n &.show-shadow {\n box-shadow: var(--lock-shadow);\n border-left: var(--cell-border-vertical);\n }\n }\n }\n //#endregion\n\n //#region \u7A7A\u8868\u683C\u5C55\u73B0\n .", " {\n pointer-events: none;\n color: #99a3b3;\n font-size: 12px;\n text-align: center;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n\n .empty-image {\n width: 50px;\n height: 50px;\n }\n\n .empty-tips {\n margin-top: 16px;\n line-height: 1.5;\n }\n }\n //#endregion\n\n //#region IE\u517C\u5BB9\n &.ie-polyfill-wrapper {\n //\u9501\u5B9A\u5217\u517C\u5BB9 \u4EC5\u5728\u9501\u5B9A\u5217\u7684\u60C5\u51B5\u4E0B\u751F\u6548\n .", " {\n overflow-x: hidden;\n }\n .", ", .", " {\n position:relative;\n }\n .", " {\n overflow: hidden;\n }\n .", " {\n position: relative;\n }\n\n .", " {\n overflow: auto;\n overflow-x: hidden;\n overflow-anchor: none;\n }\n\n .", ", .", "{\n position: absolute;\n z-index: ", ";\n top: 0;\n }\n .", "{\n left:0;\n }\n .", "{\n right:0;\n }\n\n .", "{\n .", "{\n position: absolute;\n top: 0;\n width: 100%;\n z-index: ", ";\n }\n }\n\n tr:not(.no-hover).row-hover > td {\n background: var(--hover-bgcolor);\n }\n }\n //#endregion\n\n //#region \u7C98\u6027\u6EDA\u52A8\u6761\n .", " {\n overflow-y: hidden;\n overflow-x: auto;\n z-index: ", ";\n flex-shrink: 0;\n flex-grow: 0;\n border-top: 1px solid var(--border-color);\n background: var(--bgcolor);\n }\n\n .", " {\n // \u5FC5\u987B\u6709\u9AD8\u5EA6\u624D\u80FD\u51FA\u73B0\u6EDA\u52A8\u6761\n height: 1px;\n visibility: hidden;\n }\n //#endregion\n\n //#region \u52A0\u8F7D\u6837\u5F0F\n .", " {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: auto;\n\n .", " {\n filter: none;\n width: 100%;\n height: 100%;\n overflow: auto;\n display: flex;\n position: relative;\n flex-direction: column;\n }\n\n .", " {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n pointer-events: none;\n }\n\n .", " {\n position: sticky;\n z-index: ", ";\n transform: translateY(-50%);\n }\n }\n //#endregion\n\n //#region \u8868\u683C\u8FC7\u6EE4\n .", " {\n color:var(--icon-color);\n &.active{\n color:var(--primary-color);\n }\n }\n //#endregion\n\n //#region \u8868\u683C\u6392\u5E8F\n .", " {\n color:var(--icon-color);\n &.active{\n color:var(--primary-color);\n }\n }\n //#endregion\n\n //#region \u6EDA\u52A8\u6761\u5360\u4F4D\n .", " {\n visibility: hidden;\n flex-shrink: 0;\n }\n .", " .", " {\n border-top: var(--cell-border-horizontal);\n }\n //#endregion\n "])), variableConst, variableConst, outerBorderStyleMixin, Classes.artTable, Classes.tableHeader, Classes.tableHeaderCellContent, Classes.virtual, Classes.tableFooter, Classes.tableBody, Classes.tableFooter, Classes.tableRow, Classes.tableBody, Classes.tableCellRangeSelected, Classes.tableCellRangeTop, Classes.tableCellRangeLeft, Classes.tableCellRangeBottom, Classes.tableCellRangeRight, Classes.tableHeader, Z.header, Classes.tableFooter, Z.footer, Classes.leaf, Classes.first, Classes.first, Classes.first, Classes.first, Classes.first, Classes.last, Classes.lockLeft, Classes.lockRight, Z.lock, Classes.lockShadowMask, Z.lockShadow, Classes.lockShadow, Classes.leftLockShadow, LOCK_SHADOW_PADDING, Classes.rightLockShadow, LOCK_SHADOW_PADDING, Classes.emptyWrapper, Classes.virtual, Classes.tableBody, Classes.tableFooter, Classes.tableHeaderMain, Classes.tableHeader, Classes.tableFooterMain, Classes.fixedLeft, Classes.fixedRight, Z.lock, Classes.fixedLeft, Classes.fixedRight, Classes.rowDetailContainer, Classes.rowDetailItem, Z.rowDetail, Classes.stickyScroll, Z.scrollItem, Classes.stickyScrollItem, Classes.loadingWrapper, Classes.loadingContentWrapper, Classes.loadingIndicatorWrapper, Classes.loadingIndicator, Z.loadingIndicator, Classes.tableFilterTrigger, Classes.tableSortIcon, Classes.verticalScrollPlaceholder, Classes.tableFooter, Classes.verticalScrollPlaceholder);
124
124
  export var ButtonCSS = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n //#region \u6309\u94AE\n .", "{\n color: var(--color);\n background:#ffffff;\n border:1px solid var(--strong-border-color);\n border-radius: 2px;\n cursor: pointer;\n &:hover{\n color: var(--primary-color);\n border:1px solid var(--primary-color);\n }\n }\n .", " {\n color:#ffffff;\n background-color: var(--primary-color);\n border:none;\n &:hover{\n color:#ffffff;\n background-color: var(--primary-color-level2);\n border:none;\n }\n }\n//#endregion\n"])), variableConst, Classes.button, Classes.buttonPrimary);
125
125
 
126
126
  function getCssVariableText(obj) {
@@ -145,7 +145,6 @@ export declare class BaseTable extends React.Component<BaseTableProps, BaseTable
145
145
  /** 同步横向滚动偏移量 */
146
146
  private syncHorizontalScroll;
147
147
  getVerticalRenderRange(useVirtual: ResolvedUseVirtual): VerticalRenderRange;
148
- private getRowNodeListByEvent;
149
148
  private handleRowMouseEnter;
150
149
  private handleRowMouseLeave;
151
150
  private renderTableBody;
@@ -95,23 +95,8 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
95
95
  _this.resizeSubject = new Subject();
96
96
  _this.offsetY = 0;
97
97
 
98
- _this.getRowNodeListByEvent = function (e) {
99
- var nodeList = null;
100
- var rowIndex = e.currentTarget.dataset.rowindex;
101
-
102
- if (rowIndex !== undefined) {
103
- var _this$domHelper = _this.domHelper,
104
- tableBody = _this$domHelper.tableBody,
105
- tableFooter = _this$domHelper.tableFooter;
106
- var targetParent = tableBody.contains(e.currentTarget) ? tableBody : tableFooter;
107
- nodeList = targetParent.querySelectorAll("tr[data-rowindex=\"".concat(rowIndex, "\"]"));
108
- }
109
-
110
- return nodeList;
111
- };
112
-
113
98
  _this.handleRowMouseEnter = function (e) {
114
- var nodeList = _this.getRowNodeListByEvent(e);
99
+ var nodeList = _this.domHelper.getRowNodeListByEvent(e);
115
100
 
116
101
  nodeList && nodeList.forEach(function (node) {
117
102
  node.classList.add('row-hover');
@@ -119,7 +104,7 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
119
104
  };
120
105
 
121
106
  _this.handleRowMouseLeave = function (e) {
122
- var nodeList = _this.getRowNodeListByEvent(e);
107
+ var nodeList = _this.domHelper.getRowNodeListByEvent(e);
123
108
 
124
109
  nodeList && nodeList.forEach(function (node) {
125
110
  node.classList.remove('row-hover');
@@ -251,10 +236,10 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
251
236
  value: function updateStickyScroll() {
252
237
  var _a, _b;
253
238
 
254
- var _this$domHelper2 = this.domHelper,
255
- stickyScroll = _this$domHelper2.stickyScroll,
256
- artTable = _this$domHelper2.artTable,
257
- stickyScrollItem = _this$domHelper2.stickyScrollItem;
239
+ var _this$domHelper = this.domHelper,
240
+ stickyScroll = _this$domHelper.stickyScroll,
241
+ artTable = _this$domHelper.artTable,
242
+ stickyScrollItem = _this$domHelper.stickyScrollItem;
258
243
  var _lastHasScrollY = this.hasScrollY;
259
244
 
260
245
  if (!artTable) {
@@ -595,9 +580,9 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
595
580
  value: function initSubscriptions() {
596
581
  var _this2 = this;
597
582
 
598
- var _this$domHelper3 = this.domHelper,
599
- virtual = _this$domHelper3.virtual,
600
- stickyScroll = _this$domHelper3.stickyScroll;
583
+ var _this$domHelper2 = this.domHelper,
584
+ virtual = _this$domHelper2.virtual,
585
+ stickyScroll = _this$domHelper2.stickyScroll;
601
586
  this.rootSubscription.add(throttledWindowResize$.subscribe(function () {
602
587
  _this2.updateStickyScroll();
603
588
 
@@ -136,7 +136,7 @@ function Filter(_ref2) {
136
136
  fill: "currentColor",
137
137
  "aria-hidden": "true"
138
138
  }, /*#__PURE__*/React.createElement("path", {
139
- d: "M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3\n 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5\n 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"
139
+ d: "M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3\r\n 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5\r\n 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"
140
140
  }))), showPanel && /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(Panel, {
141
141
  ele: iconRef.current,
142
142
  filterIcon: filterIcon,
@@ -72,7 +72,7 @@ function FilterPanel(_ref) {
72
72
  fill: "currentColor",
73
73
  "aria-hidden": "true"
74
74
  }, /*#__PURE__*/React.createElement("path", {
75
- d: "M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3\n 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5\n 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"
75
+ d: "M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3\r\n 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5\r\n 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"
76
76
  })))), /*#__PURE__*/React.createElement("div", {
77
77
  className: "popup-body"
78
78
  }, children));
@@ -15,3 +15,4 @@ export { columnResize, ColumnResizeOptions } from './columnResizeWidth';
15
15
  export { contextMenu, ContextMenuFeatureOptions } from './contextMenu';
16
16
  export { filter, FilterFeatureOptions } from './columnFilter';
17
17
  export { rangeSelection, RangeSelectionFeatureOptions } from './rangeSelection';
18
+ export { mergeCellHover } from './mergeCellHover';
@@ -14,4 +14,5 @@ export { columnDrag } from './columnDrag';
14
14
  export { columnResize } from './columnResizeWidth';
15
15
  export { contextMenu } from './contextMenu';
16
16
  export { filter } from './columnFilter';
17
- export { rangeSelection } from './rangeSelection';
17
+ export { rangeSelection } from './rangeSelection';
18
+ export { mergeCellHover } from './mergeCellHover';
@@ -0,0 +1,2 @@
1
+ import { TablePipeline } from '../pipeline';
2
+ export declare function mergeCellHover(): (pipeline: TablePipeline) => TablePipeline;
@@ -0,0 +1,32 @@
1
+ import _extends from "@babel/runtime-corejs3/helpers/extends";
2
+ import { isLeafNode, makeRecursiveMapper, mergeCellProps } from '../../utils';
3
+ export function mergeCellHover() {
4
+ return function (pipeline) {
5
+ return pipeline.mapColumns(makeRecursiveMapper(function (col) {
6
+ if (!isLeafNode(col)) {
7
+ return col;
8
+ }
9
+
10
+ var prevGetCellProps = col.getCellProps;
11
+ return _extends(_extends({}, col), {
12
+ getCellProps: function getCellProps(value, record, rowIndex) {
13
+ var prevCellProps = prevGetCellProps === null || prevGetCellProps === void 0 ? void 0 : prevGetCellProps(value, record, rowIndex);
14
+ return mergeCellProps(prevCellProps, {
15
+ onMouseEnter: function onMouseEnter(e) {
16
+ var InRangeRow = pipeline.ref.current.domHelper.getInRangeRowByCellEvent(e);
17
+ InRangeRow.forEach(function (row) {
18
+ row.classList.add('row-hover');
19
+ });
20
+ },
21
+ onMouseLeave: function onMouseLeave(e) {
22
+ var InRangeRow = pipeline.ref.current.domHelper.getInRangeRowByCellEvent(e);
23
+ InRangeRow.forEach(function (row) {
24
+ row.classList.remove('row-hover');
25
+ });
26
+ }
27
+ });
28
+ }
29
+ });
30
+ }));
31
+ };
32
+ }
@@ -1 +1 @@
1
-
1
+
@@ -1,2 +1,2 @@
1
- // color palettes
1
+ // color palettes
2
2
  @blue-base: #1890ff;
@@ -1 +1 @@
1
- @import "../table/style/index.less";
1
+ @import "../table\style\index.less";
@@ -1,2 +1,2 @@
1
- @import 'motion';
1
+ @import 'motion';
2
2
  @import 'reset';
@@ -1,28 +1,28 @@
1
- @keyframes loadingcircle {
2
- 100% {
3
- transform: rotate(360deg);
4
- }
5
- }
6
-
7
- @keyframes waveEffect {
8
- 100% {
9
- box-shadow: 0 0 0 6px @theme-color;
10
- }
11
- }
12
-
13
- @keyframes fadeEffect {
14
- 100% {
15
- opacity: 0;
16
- }
17
- }
18
-
19
- @keyframes kdRadioEffect {
20
- 0% {
21
- transform: translateY(-50%) scale(0.5);
22
- opacity: 0;
23
- }
24
- 100% {
25
- transform: translateY(-50%) scale(1);
26
- opacity: 1;
27
- }
1
+ @keyframes loadingcircle {
2
+ 100% {
3
+ transform: rotate(360deg);
4
+ }
5
+ }
6
+
7
+ @keyframes waveEffect {
8
+ 100% {
9
+ box-shadow: 0 0 0 6px @theme-color;
10
+ }
11
+ }
12
+
13
+ @keyframes fadeEffect {
14
+ 100% {
15
+ opacity: 0;
16
+ }
17
+ }
18
+
19
+ @keyframes kdRadioEffect {
20
+ 0% {
21
+ transform: translateY(-50%) scale(0.5);
22
+ opacity: 0;
23
+ }
24
+ 100% {
25
+ transform: translateY(-50%) scale(1);
26
+ opacity: 1;
27
+ }
28
28
  }
@@ -1,53 +1,53 @@
1
- @keyframes kdSlideDownIn {
2
- 0% {
3
- transform: scaleY(0.8);
4
- transform-origin: 50% 0%;
5
- opacity: 0;
6
- }
7
- 100% {
8
- transform: scaleY(1);
9
- transform-origin: 50% 0%;
10
- opacity: 1;
11
- }
12
- }
13
-
14
- @keyframes kdSlideDownOut {
15
- 0% {
16
- transform: scaleY(1);
17
- transform-origin: 50% 0%;
18
- opacity: 1;
19
- }
20
- 100% {
21
- transform: scaleY(0.9);
22
- transform-origin: 50% 0%;
23
- opacity: 0;
24
- }
25
- }
26
-
27
- @keyframes kdSlideUpIn {
28
- 0% {
29
- transform-origin: 50% 100%;
30
- opacity: 0;
31
- }
32
- 5% {
33
- transform: scaleY(0.8);
34
- }
35
- 100% {
36
- transform: scaleY(1);
37
- transform-origin: 50% 100%;
38
- opacity: 1;
39
- }
40
- }
41
-
42
- @keyframes kdSlideUpOut {
43
- 0% {
44
- transform: scaleY(1);
45
- transform-origin: 50% 100%;
46
- opacity: 1;
47
- }
48
- 100% {
49
- transform: scaleY(0.9);
50
- transform-origin: 50% 100%;
51
- opacity: 0;
52
- }
53
- }
1
+ @keyframes kdSlideDownIn {
2
+ 0% {
3
+ transform: scaleY(0.8);
4
+ transform-origin: 50% 0%;
5
+ opacity: 0;
6
+ }
7
+ 100% {
8
+ transform: scaleY(1);
9
+ transform-origin: 50% 0%;
10
+ opacity: 1;
11
+ }
12
+ }
13
+
14
+ @keyframes kdSlideDownOut {
15
+ 0% {
16
+ transform: scaleY(1);
17
+ transform-origin: 50% 0%;
18
+ opacity: 1;
19
+ }
20
+ 100% {
21
+ transform: scaleY(0.9);
22
+ transform-origin: 50% 0%;
23
+ opacity: 0;
24
+ }
25
+ }
26
+
27
+ @keyframes kdSlideUpIn {
28
+ 0% {
29
+ transform-origin: 50% 100%;
30
+ opacity: 0;
31
+ }
32
+ 5% {
33
+ transform: scaleY(0.8);
34
+ }
35
+ 100% {
36
+ transform: scaleY(1);
37
+ transform-origin: 50% 100%;
38
+ opacity: 1;
39
+ }
40
+ }
41
+
42
+ @keyframes kdSlideUpOut {
43
+ 0% {
44
+ transform: scaleY(1);
45
+ transform-origin: 50% 100%;
46
+ opacity: 1;
47
+ }
48
+ 100% {
49
+ transform: scaleY(0.9);
50
+ transform-origin: 50% 100%;
51
+ opacity: 0;
52
+ }
53
+ }
@@ -1,2 +1,2 @@
1
- @import 'motion/other';
1
+ @import 'motion/other';
2
2
  @import 'motion/slide';