@kdcloudjs/table 1.0.1 → 1.0.4
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/LICENSE +1 -1
- package/README.md +34 -33
- package/dist/@kdcloudjs/table.css +1 -1
- package/dist/@kdcloudjs/table.css.map +1 -1
- package/dist/@kdcloudjs/table.js +6555 -3388
- package/dist/@kdcloudjs/table.js.map +1 -1
- package/dist/@kdcloudjs/table.min.css +1 -1
- package/dist/@kdcloudjs/table.min.js +32 -24
- package/dist/@kdcloudjs/table.min.js.map +1 -1
- package/es/_utils/hooks.js +1 -2
- package/es/_utils/numberUtil.js +3 -4
- package/es/locale/locale.js +1 -2
- package/es/table/base/calculations.js +3 -4
- package/es/table/base/empty.js +2 -2
- package/es/table/base/header.d.ts +6 -2
- package/es/table/base/header.js +41 -22
- package/es/table/base/helpers/SpanManager.js +1 -1
- package/es/table/base/helpers/TableDOMUtils.d.ts +3 -0
- package/es/table/base/helpers/TableDOMUtils.js +23 -5
- package/es/table/base/helpers/getRichVisibleRectsStream.d.ts +23 -0
- package/es/table/base/helpers/getRichVisibleRectsStream.js +216 -0
- package/es/table/base/html-table.d.ts +3 -1
- package/es/table/base/html-table.js +43 -26
- package/es/table/base/interfaces.d.ts +1 -0
- package/es/table/base/renderTemplates.d.ts +1 -0
- package/es/table/base/renderTemplates.js +344 -0
- package/es/table/base/styles.d.ts +24 -0
- package/es/table/base/styles.js +31 -9
- package/es/table/base/table.d.ts +12 -4
- package/es/table/base/table.js +183 -136
- package/es/table/base/utils.d.ts +6 -3
- package/es/table/base/utils.js +27 -6
- package/es/table/common-views.js +3 -3
- package/es/table/pipeline/features/autoFill.js +7 -1
- package/es/table/pipeline/features/columnDrag.js +168 -59
- package/es/table/pipeline/features/columnFilter.js +7 -9
- package/es/table/pipeline/features/columnResizeWidth.d.ts +3 -0
- package/es/table/pipeline/features/columnResizeWidth.js +11 -4
- package/es/table/pipeline/features/contextMenu.js +78 -31
- package/es/table/pipeline/features/filter/Filter.js +74 -37
- package/es/table/pipeline/features/index.d.ts +1 -0
- package/es/table/pipeline/features/index.js +2 -1
- package/es/table/pipeline/features/multiSelect.js +85 -79
- package/es/table/pipeline/features/rangeSelection.d.ts +10 -0
- package/es/table/pipeline/features/rangeSelection.js +231 -0
- package/es/table/pipeline/features/rowDetail.js +39 -16
- package/es/table/pipeline/features/rowGrouping.js +2 -1
- package/es/table/pipeline/features/singleSelect.js +4 -1
- package/es/table/pipeline/features/sort.js +2 -3
- package/es/table/pipeline/features/treeMode.js +4 -4
- package/es/table/pipeline/pipeline.d.ts +8 -0
- package/es/table/pipeline/pipeline.js +49 -5
- package/es/table/pivot/cross-table/buildCrossTable.js +1 -2
- package/es/table/pivot/cross-tree-table/buildCrossTreeTable.js +1 -2
- package/es/table/pivot/pivot-utils/builders.js +1 -2
- package/es/table/pivot/pivot-utils/convert-utils.js +5 -4
- package/es/table/transforms/autoWidth.js +1 -2
- package/es/table/transforms/sort.js +1 -2
- package/es/table/transforms/treeMode.js +1 -2
- package/es/table/utils/applyTransforms.js +1 -3
- package/es/table/utils/browserType.d.ts +6 -0
- package/es/table/utils/browserType.js +6 -0
- package/es/table/utils/buildTree.js +4 -5
- package/es/table/utils/collectNodes.js +1 -2
- package/es/table/utils/exportTableAsExcel.js +1 -2
- package/es/table/utils/getTreeDepth.js +1 -2
- package/es/table/utils/groupBy.js +1 -2
- package/es/table/utils/index.d.ts +1 -0
- package/es/table/utils/index.js +2 -1
- package/es/table/utils/layeredSort.js +5 -2
- package/es/table/utils/makeRecursiveMapper.js +4 -5
- package/es/table/utils/others.d.ts +1 -1
- package/es/table/utils/others.js +20 -14
- package/es/table/utils/traverseColumn.js +1 -2
- package/es/table/utils/tree-data-helpers/StrictTreeDataHelper.js +4 -5
- package/es/table/utils/tree-data-helpers/TreeDataHelper.js +4 -5
- package/lib/_utils/formatUtil.js +1 -1
- package/lib/_utils/hooks.js +2 -4
- package/lib/_utils/numberUtil.js +7 -9
- package/lib/_utils/usePopper.js +9 -1
- package/lib/config-provider/configProvider.js +9 -1
- package/lib/config-provider/index.js +5 -5
- package/lib/locale/index.js +14 -6
- package/lib/locale/locale.js +2 -4
- package/lib/table/base/calculations.js +4 -6
- package/lib/table/base/empty.js +11 -3
- package/lib/table/base/header.d.ts +6 -2
- package/lib/table/base/header.js +39 -19
- package/lib/table/base/helpers/SpanManager.js +1 -1
- package/lib/table/base/helpers/TableDOMUtils.d.ts +3 -0
- package/lib/table/base/helpers/TableDOMUtils.js +21 -5
- package/lib/table/base/helpers/getRichVisibleRectsStream.d.ts +23 -0
- package/lib/table/base/helpers/getRichVisibleRectsStream.js +246 -0
- package/lib/table/base/html-table.d.ts +3 -1
- package/lib/table/base/html-table.js +44 -26
- package/lib/table/base/index.js +4 -4
- package/lib/table/base/interfaces.d.ts +1 -0
- package/lib/table/base/renderTemplates.d.ts +1 -0
- package/lib/table/base/renderTemplates.js +370 -0
- package/lib/table/base/styles.d.ts +24 -0
- package/lib/table/base/styles.js +42 -13
- package/lib/table/base/table.d.ts +12 -4
- package/lib/table/base/table.js +191 -137
- package/lib/table/base/utils.d.ts +6 -3
- package/lib/table/base/utils.js +47 -10
- package/lib/table/common-views.js +3 -3
- package/lib/table/pipeline/features/autoFill.js +9 -2
- package/lib/table/pipeline/features/columnDrag.js +168 -59
- package/lib/table/pipeline/features/columnFilter.js +6 -9
- package/lib/table/pipeline/features/columnResizeWidth.d.ts +3 -0
- package/lib/table/pipeline/features/columnResizeWidth.js +21 -5
- package/lib/table/pipeline/features/contextMenu.js +89 -32
- package/lib/table/pipeline/features/filter/DefaultFilterContent.js +10 -2
- package/lib/table/pipeline/features/filter/Filter.js +88 -37
- package/lib/table/pipeline/features/filter/FilterPanel.js +10 -2
- package/lib/table/pipeline/features/filter/index.js +4 -4
- package/lib/table/pipeline/features/index.d.ts +1 -0
- package/lib/table/pipeline/features/index.js +37 -27
- package/lib/table/pipeline/features/multiSelect.js +81 -75
- package/lib/table/pipeline/features/rangeSelection.d.ts +10 -0
- package/lib/table/pipeline/features/rangeSelection.js +256 -0
- package/lib/table/pipeline/features/rowDetail.js +42 -16
- package/lib/table/pipeline/features/rowGrouping.js +3 -1
- package/lib/table/pipeline/features/singleSelect.js +4 -1
- package/lib/table/pipeline/features/sort.js +2 -4
- package/lib/table/pipeline/features/treeMode.js +6 -6
- package/lib/table/pipeline/index.js +11 -3
- package/lib/table/pipeline/pipeline.d.ts +8 -0
- package/lib/table/pipeline/pipeline.js +50 -7
- package/lib/table/pivot/cross-table/buildCrossTable.js +1 -3
- package/lib/table/pivot/cross-table/index.js +4 -4
- package/lib/table/pivot/cross-tree-table/buildCrossTreeTable.js +1 -3
- package/lib/table/pivot/pivot-utils/builders.js +2 -4
- package/lib/table/pivot/pivot-utils/convert-utils.js +7 -5
- package/lib/table/pivot/pivot-utils/index.js +4 -4
- package/lib/table/transforms/autoWidth.js +10 -4
- package/lib/table/transforms/columnResize.js +10 -2
- package/lib/table/transforms/index.js +32 -32
- package/lib/table/transforms/sort.js +10 -4
- package/lib/table/transforms/treeMode.js +9 -3
- package/lib/table/utils/applyTransforms.js +1 -5
- package/lib/table/utils/browserType.d.ts +6 -0
- package/lib/table/utils/browserType.js +13 -0
- package/lib/table/utils/buildTree.js +1 -3
- package/lib/table/utils/collectNodes.js +1 -3
- package/lib/table/utils/copyToClipboard.js +1 -1
- package/lib/table/utils/element.js +3 -3
- package/lib/table/utils/exportTableAsExcel.js +1 -3
- package/lib/table/utils/getTreeDepth.js +1 -3
- package/lib/table/utils/groupBy.js +1 -3
- package/lib/table/utils/index.d.ts +1 -0
- package/lib/table/utils/index.js +57 -49
- package/lib/table/utils/layeredSort.js +6 -2
- package/lib/table/utils/makeRecursiveMapper.js +1 -3
- package/lib/table/utils/others.d.ts +1 -1
- package/lib/table/utils/others.js +23 -18
- package/lib/table/utils/traverseColumn.js +1 -3
- package/lib/table/utils/tree-data-helpers/StrictTreeDataHelper.js +5 -7
- package/lib/table/utils/tree-data-helpers/TreeDataHelper.js +5 -7
- package/package.json +6 -2
- package/dist/kd-table.css +0 -422
- package/dist/kd-table.css.map +0 -1
- package/dist/kd-table.js +0 -38578
- package/dist/kd-table.js.map +0 -1
- package/dist/kd-table.min.css +0 -9
- package/dist/kd-table.min.js +0 -208
- package/dist/kd-table.min.js.map +0 -1
- package/es/table/base/helpers/__test__/visible-part.test.d.ts +0 -1
- package/es/table/base/helpers/__test__/visible-part.test.js +0 -28
- package/es/table/base/helpers/visible-part.d.ts +0 -23
- package/es/table/base/helpers/visible-part.js +0 -58
- package/es/table/pipeline/features/__test__/multiSelect.test.d.ts +0 -1
- package/es/table/pipeline/features/__test__/multiSelect.test.js +0 -152
- package/es/table/pipeline/features/__test__/rowDetail.test.d.ts +0 -1
- package/es/table/pipeline/features/__test__/rowDetail.test.js +0 -223
- package/es/table/pipeline/features/__test__/rowGrouping.test.d.ts +0 -1
- package/es/table/pipeline/features/__test__/rowGrouping.test.js +0 -120
- package/es/table/pipeline/features/__test__/singleSelect.test.d.ts +0 -1
- package/es/table/pipeline/features/__test__/singleSelect.test.js +0 -191
- package/es/table/pipeline/features/__test__/sort.test.d.ts +0 -1
- package/es/table/pipeline/features/__test__/sort.test.js +0 -213
- package/es/table/pipeline/features/__test__/tips.test.d.ts +0 -1
- package/es/table/pipeline/features/__test__/tips.test.js +0 -123
- package/es/table/pipeline/features/__test__/treeMode.test.d.ts +0 -1
- package/es/table/pipeline/features/__test__/treeMode.test.js +0 -202
- package/es/table/pipeline/features/filter/__test__/Filter.test.d.ts +0 -1
- package/es/table/pipeline/features/filter/__test__/Filter.test.js +0 -29
- package/lib/table/base/helpers/__test__/visible-part.test.d.ts +0 -1
- package/lib/table/base/helpers/__test__/visible-part.test.js +0 -31
- package/lib/table/base/helpers/visible-part.d.ts +0 -23
- package/lib/table/base/helpers/visible-part.js +0 -72
- package/lib/table/pipeline/features/__test__/multiSelect.test.d.ts +0 -1
- package/lib/table/pipeline/features/__test__/multiSelect.test.js +0 -163
- package/lib/table/pipeline/features/__test__/rowDetail.test.d.ts +0 -1
- package/lib/table/pipeline/features/__test__/rowDetail.test.js +0 -230
- package/lib/table/pipeline/features/__test__/rowGrouping.test.d.ts +0 -1
- package/lib/table/pipeline/features/__test__/rowGrouping.test.js +0 -129
- package/lib/table/pipeline/features/__test__/singleSelect.test.d.ts +0 -1
- package/lib/table/pipeline/features/__test__/singleSelect.test.js +0 -201
- package/lib/table/pipeline/features/__test__/sort.test.d.ts +0 -1
- package/lib/table/pipeline/features/__test__/sort.test.js +0 -218
- package/lib/table/pipeline/features/__test__/tips.test.d.ts +0 -1
- package/lib/table/pipeline/features/__test__/tips.test.js +0 -133
- package/lib/table/pipeline/features/__test__/treeMode.test.d.ts +0 -1
- package/lib/table/pipeline/features/__test__/treeMode.test.js +0 -206
- package/lib/table/pipeline/features/filter/__test__/Filter.test.d.ts +0 -1
- package/lib/table/pipeline/features/filter/__test__/Filter.test.js +0 -36
package/es/table/base/styles.js
CHANGED
|
@@ -2,7 +2,6 @@ import _taggedTemplateLiteral from "@babel/runtime-corejs3/helpers/taggedTemplat
|
|
|
2
2
|
|
|
3
3
|
var _templateObject, _templateObject2, _templateObject3;
|
|
4
4
|
|
|
5
|
-
import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
|
|
6
5
|
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
7
6
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
8
7
|
import styled, { css } from 'styled-components';
|
|
@@ -12,10 +11,12 @@ export var Classes = {
|
|
|
12
11
|
/** BaseTable 表格组件的外层包裹 div */
|
|
13
12
|
artTableWrapper: "".concat(prefix, "table-wrapper"),
|
|
14
13
|
artTable: "".concat(prefix, "table"),
|
|
14
|
+
tableHeaderMain: "".concat(prefix, "table-header-main"),
|
|
15
15
|
tableHeader: "".concat(prefix, "table-header"),
|
|
16
16
|
tableBody: "".concat(prefix, "table-body"),
|
|
17
17
|
virtual: "".concat(prefix, "virtual"),
|
|
18
18
|
tableFooter: "".concat(prefix, "table-footer"),
|
|
19
|
+
tableFooterMain: "".concat(prefix, "table-footer-main"),
|
|
19
20
|
|
|
20
21
|
/** 表格行 */
|
|
21
22
|
tableRow: "".concat(prefix, "table-row"),
|
|
@@ -34,6 +35,7 @@ export var Classes = {
|
|
|
34
35
|
stickyScroll: "".concat(prefix, "sticky-scroll"),
|
|
35
36
|
stickyScrollItem: "".concat(prefix, "sticky-scroll-item"),
|
|
36
37
|
horizontalScrollContainer: "".concat(prefix, "horizontal-scroll-container"),
|
|
38
|
+
verticalScrollPlaceholder: "".concat(prefix, "vertical-scroll-placeholder"),
|
|
37
39
|
lockShadowMask: "".concat(prefix, "lock-shadow-mask"),
|
|
38
40
|
lockShadow: "".concat(prefix, "lock-shadow"),
|
|
39
41
|
leftLockShadow: "".concat(prefix, "left-lock-shadow"),
|
|
@@ -50,13 +52,34 @@ export var Classes = {
|
|
|
50
52
|
tableSortIcon: "".concat(prefix, "sort-icon"),
|
|
51
53
|
button: "".concat(prefix, "btn"),
|
|
52
54
|
buttonPrimary: "".concat(prefix, "btn-primary"),
|
|
53
|
-
filterIcon: "".concat(prefix, "filter-icon")
|
|
55
|
+
filterIcon: "".concat(prefix, "filter-icon"),
|
|
56
|
+
tableCellRangeSelected: "".concat(prefix, "table-cell-range-selected"),
|
|
57
|
+
tableCellRangeTop: "".concat(prefix, "table-cell-range-top"),
|
|
58
|
+
tableCellRangeLeft: "".concat(prefix, "table-cell-range-left"),
|
|
59
|
+
tableCellRangeBottom: "".concat(prefix, "table-cell-range-bottom"),
|
|
60
|
+
tableCellRangeRight: "".concat(prefix, "table-cell-range-right"),
|
|
61
|
+
fixedLeft: "".concat(prefix, "fixed-left"),
|
|
62
|
+
fixedRight: "".concat(prefix, "fixed-right"),
|
|
63
|
+
rowDetailContainer: "".concat(prefix, "row-detail-container"),
|
|
64
|
+
rowDetailItem: "".concat(prefix, "row-detail-item"),
|
|
65
|
+
emptyColCell: "".concat(prefix, "empty-col-cell"),
|
|
66
|
+
first: "".concat(prefix, "first"),
|
|
67
|
+
last: "".concat(prefix, "last"),
|
|
68
|
+
even: "".concat(prefix, "even"),
|
|
69
|
+
odd: "".concat(prefix, "odd"),
|
|
70
|
+
lockLeft: "".concat(prefix, "lock-left"),
|
|
71
|
+
lockRight: "".concat(prefix, "lock-right"),
|
|
72
|
+
rowSpan: "".concat(prefix, "row-span"),
|
|
73
|
+
leaf: "".concat(prefix, "leaf"),
|
|
74
|
+
expanded: "".concat(prefix, "expanded"),
|
|
75
|
+
collapsed: "".concat(prefix, "collapsed")
|
|
54
76
|
};
|
|
55
77
|
export var MenuClasses = {
|
|
56
78
|
menu: "".concat(prefix, "table-menu"),
|
|
57
79
|
menuList: "".concat(prefix, "table-menu-list"),
|
|
58
80
|
menuOption: "".concat(prefix, "table-menu-option"),
|
|
59
81
|
menuOptionActive: "".concat(prefix, "table-menu-option-active"),
|
|
82
|
+
menuOptionDisable: "".concat(prefix, "table-menu-option-disable"),
|
|
60
83
|
menuOptionText: "".concat(prefix, "table-menu-option-text")
|
|
61
84
|
};
|
|
62
85
|
var Z = {
|
|
@@ -64,10 +87,11 @@ var Z = {
|
|
|
64
87
|
header: 15,
|
|
65
88
|
footer: 10,
|
|
66
89
|
lockShadow: 20,
|
|
90
|
+
rowDetail: 25,
|
|
67
91
|
scrollItem: 30,
|
|
68
92
|
loadingIndicator: 40
|
|
69
93
|
};
|
|
70
|
-
var outerBorderStyleMixin = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-top: 1px solid #cccccc;\n border-right: 1px solid #cccccc;\n border-bottom: 1px solid #cccccc;\n border-left: 1px solid #cccccc;\n\n td.
|
|
94
|
+
var outerBorderStyleMixin = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-top: 1px solid #cccccc;\n border-right: 1px solid #cccccc;\n border-bottom: 1px solid #cccccc;\n border-left: 1px solid #cccccc;\n\n td.", ",\n th.", " {\n border-left: none;\n }\n td.", ",\n th.", " {\n --border-right: none;\n }\n\n thead tr.", " th,\n tbody tr.", " td {\n border-top: none;\n }\n &.has-footer tfoot tr.", " td {\n border-bottom: none;\n }\n &:not(.has-footer) tbody tr.", " td {\n border-bottom: none;\n }\n td.", ":not(.", "){\n border-left: var(---cell-border-vertical);\n }\n td.", ":not(.", "){\n border-right: var(---cell-border-vertical);\n }\n"])), Classes.first, Classes.first, Classes.last, Classes.last, Classes.first, Classes.first, Classes.last, Classes.last, Classes.rowSpan, Classes.first, Classes.rowSpan, Classes.last);
|
|
71
95
|
export var defaultCSSVariables = {
|
|
72
96
|
'--row-height': '48px',
|
|
73
97
|
'--color': '#333',
|
|
@@ -97,16 +121,14 @@ export var defaultCSSVariables = {
|
|
|
97
121
|
'--header-cell-border-vertical': '1px solid #dfe3e8'
|
|
98
122
|
};
|
|
99
123
|
export var variableConst = getCssVariableText(defaultCSSVariables);
|
|
100
|
-
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 }\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:
|
|
124
|
+
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);
|
|
101
125
|
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);
|
|
102
126
|
|
|
103
127
|
function getCssVariableText(obj) {
|
|
104
|
-
|
|
128
|
+
return _Object$keys(obj).reduce(function (acc, key) {
|
|
129
|
+
var _context;
|
|
105
130
|
|
|
106
|
-
|
|
107
|
-
var _context2;
|
|
108
|
-
|
|
109
|
-
acc += _concatInstanceProperty(_context2 = "".concat(key, ":")).call(_context2, obj[key], ";");
|
|
131
|
+
acc += _concatInstanceProperty(_context = "".concat(key, ":")).call(_context, obj[key], ";");
|
|
110
132
|
return acc;
|
|
111
133
|
}, '');
|
|
112
134
|
}
|
package/es/table/base/table.d.ts
CHANGED
|
@@ -62,12 +62,18 @@ export interface BaseTableProps {
|
|
|
62
62
|
};
|
|
63
63
|
/** 列的默认宽度 */
|
|
64
64
|
defaultColumnWidth?: number;
|
|
65
|
-
/**
|
|
66
|
-
*
|
|
67
|
-
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated
|
|
67
|
+
* flowRoot 在表格 v2.4 后不再需要提供,请移除该属性
|
|
68
|
+
* */
|
|
69
|
+
flowRoot?: never;
|
|
70
|
+
/** 虚拟滚动调试标签,用于表格内部调试使用 */
|
|
71
|
+
virtualDebugLabel?: string;
|
|
68
72
|
getRowProps?(record: any, rowIndex: number): React.HTMLAttributes<HTMLTableRowElement>;
|
|
69
73
|
getTableProps?(): React.HTMLAttributes<HTMLTableElement>;
|
|
70
74
|
setTableWidth?(tableWidth: number): void;
|
|
75
|
+
setTableDomHelper?(domHelper: TableDOMHelper): void;
|
|
76
|
+
clearRangeSelectionStatus?(): void;
|
|
71
77
|
cssVariables?: {
|
|
72
78
|
[key: string]: any;
|
|
73
79
|
};
|
|
@@ -107,7 +113,6 @@ export declare class BaseTable extends React.Component<BaseTableProps, BaseTable
|
|
|
107
113
|
components: {};
|
|
108
114
|
getTableProps: typeof noop;
|
|
109
115
|
getRowProps: typeof noop;
|
|
110
|
-
flowRoot: string;
|
|
111
116
|
dataSource: any[];
|
|
112
117
|
useOuterBorder: boolean;
|
|
113
118
|
};
|
|
@@ -131,6 +136,9 @@ export declare class BaseTable extends React.Component<BaseTableProps, BaseTable
|
|
|
131
136
|
/** 同步横向滚动偏移量 */
|
|
132
137
|
private syncHorizontalScroll;
|
|
133
138
|
getVerticalRenderRange(useVirtual: ResolvedUseVirtual): VerticalRenderRange;
|
|
139
|
+
private getRowNodeListByEvent;
|
|
140
|
+
private handleRowMouseEnter;
|
|
141
|
+
private handleRowMouseLeave;
|
|
134
142
|
private renderTableBody;
|
|
135
143
|
private renderTableFooter;
|
|
136
144
|
private renderLockShadows;
|