@kdcloudjs/table 1.1.0 → 1.1.2
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/dist/@kdcloudjs/table.css +1 -1
- package/dist/@kdcloudjs/table.js +74 -25
- package/dist/@kdcloudjs/table.js.map +1 -1
- package/dist/@kdcloudjs/table.min.css +1 -1
- package/dist/@kdcloudjs/table.min.js +6 -6
- package/dist/@kdcloudjs/table.min.js.map +1 -1
- package/es/table/base/helpers/TableDOMUtils.js +12 -10
- package/es/table/base/html-table.d.ts +2 -2
- package/es/table/base/html-table.js +2 -4
- package/es/table/base/renderTemplates.js +5 -5
- package/es/table/base/styles.d.ts +0 -1
- package/es/table/base/styles.js +1 -2
- package/es/table/base/table.d.ts +10 -0
- package/es/table/base/table.js +56 -6
- package/es/table/pipeline/features/filter/FilterPanel.js +6 -6
- package/es/table/pipeline/features/rangeSelection.js +2 -0
- package/es/table/utils/element.d.ts +2 -2
- package/lib/table/base/helpers/TableDOMUtils.js +12 -10
- package/lib/table/base/html-table.d.ts +2 -2
- package/lib/table/base/html-table.js +2 -5
- package/lib/table/base/renderTemplates.js +4 -4
- package/lib/table/base/styles.d.ts +0 -1
- package/lib/table/base/styles.js +1 -2
- package/lib/table/base/table.d.ts +10 -0
- package/lib/table/base/table.js +55 -5
- package/lib/table/pipeline/features/filter/FilterPanel.js +6 -6
- package/lib/table/pipeline/features/rangeSelection.js +2 -0
- package/lib/table/utils/element.d.ts +2 -2
- package/package.json +1 -1
|
@@ -69,31 +69,33 @@ export var TableDOMHelper = /*#__PURE__*/function () {
|
|
|
69
69
|
}, {
|
|
70
70
|
key: "getTableRows",
|
|
71
71
|
value: function getTableRows() {
|
|
72
|
-
var
|
|
73
|
-
|
|
72
|
+
var _context2;
|
|
73
|
+
|
|
74
|
+
var tbody = this.artTable.querySelector(_concatInstanceProperty(_context2 = ".".concat(Classes.tableBody, " .")).call(_context2, Classes.virtual, " table tbody"));
|
|
75
|
+
return tbody.childNodes;
|
|
74
76
|
}
|
|
75
77
|
}, {
|
|
76
78
|
key: "getTableBodyHtmlTable",
|
|
77
79
|
value: function getTableBodyHtmlTable() {
|
|
78
|
-
var
|
|
80
|
+
var _context3;
|
|
79
81
|
|
|
80
|
-
return this.artTable.querySelector(_concatInstanceProperty(
|
|
82
|
+
return this.artTable.querySelector(_concatInstanceProperty(_context3 = ".".concat(Classes.tableBody, " .")).call(_context3, Classes.virtual, " table"));
|
|
81
83
|
}
|
|
82
84
|
}, {
|
|
83
85
|
key: "getLeftLockShadow",
|
|
84
86
|
value: function getLeftLockShadow() {
|
|
85
|
-
var
|
|
87
|
+
var _context4;
|
|
86
88
|
|
|
87
|
-
var selector = _concatInstanceProperty(
|
|
89
|
+
var selector = _concatInstanceProperty(_context4 = ".".concat(Classes.lockShadowMask, " .")).call(_context4, Classes.leftLockShadow);
|
|
88
90
|
|
|
89
91
|
return this.artTable.querySelector(selector);
|
|
90
92
|
}
|
|
91
93
|
}, {
|
|
92
94
|
key: "getRightLockShadow",
|
|
93
95
|
value: function getRightLockShadow() {
|
|
94
|
-
var
|
|
96
|
+
var _context5;
|
|
95
97
|
|
|
96
|
-
var selector = _concatInstanceProperty(
|
|
98
|
+
var selector = _concatInstanceProperty(_context5 = ".".concat(Classes.lockShadowMask, " .")).call(_context5, Classes.rightLockShadow);
|
|
97
99
|
|
|
98
100
|
return this.artTable.querySelector(selector);
|
|
99
101
|
}
|
|
@@ -105,11 +107,11 @@ export var TableDOMHelper = /*#__PURE__*/function () {
|
|
|
105
107
|
}, {
|
|
106
108
|
key: "getRowTop",
|
|
107
109
|
value: function getRowTop(rowIndex) {
|
|
108
|
-
var
|
|
110
|
+
var _context6, _context7;
|
|
109
111
|
|
|
110
112
|
if (rowIndex === 0) return 0;
|
|
111
113
|
|
|
112
|
-
var selector = _concatInstanceProperty(
|
|
114
|
+
var selector = _concatInstanceProperty(_context6 = _concatInstanceProperty(_context7 = ".".concat(Classes.tableBody, " .")).call(_context7, Classes.tableRow, "[data-rowindex=\"")).call(_context6, rowIndex, "\"]");
|
|
113
115
|
|
|
114
116
|
var row = this.artTable.querySelector(selector);
|
|
115
117
|
var rowOffsetTop = row && row.offsetTop || 0;
|
|
@@ -4,7 +4,7 @@ import { BaseTableProps } from './table';
|
|
|
4
4
|
export interface HtmlTableProps extends Required<Pick<BaseTableProps, 'getRowProps' | 'primaryKey'>> {
|
|
5
5
|
tbodyHtmlTag: 'tbody' | 'tfoot';
|
|
6
6
|
data: any[];
|
|
7
|
-
|
|
7
|
+
stickyRightOffset?: number;
|
|
8
8
|
horizontalRenderInfo: Pick<RenderInfo, 'flat' | 'visible' | 'horizontalRenderRange' | 'stickyLeftMap' | 'stickyRightMap'>;
|
|
9
9
|
verticalRenderInfo: {
|
|
10
10
|
offset: number;
|
|
@@ -14,4 +14,4 @@ export interface HtmlTableProps extends Required<Pick<BaseTableProps, 'getRowPro
|
|
|
14
14
|
};
|
|
15
15
|
tbodyPosition?: 'left' | 'center' | 'right';
|
|
16
16
|
}
|
|
17
|
-
export declare function HtmlTable({ tbodyHtmlTag, getRowProps, primaryKey,
|
|
17
|
+
export declare function HtmlTable({ tbodyHtmlTag, getRowProps, primaryKey, stickyRightOffset, data, verticalRenderInfo: verInfo, horizontalRenderInfo: hozInfo, tbodyPosition }: HtmlTableProps): JSX.Element;
|
|
@@ -9,12 +9,11 @@ import { internals } from '../internals';
|
|
|
9
9
|
import { Colgroup } from './colgroup';
|
|
10
10
|
import SpanManager from './helpers/SpanManager';
|
|
11
11
|
import { Classes } from './styles';
|
|
12
|
-
import { getScrollbarSize } from './utils';
|
|
13
12
|
export function HtmlTable(_ref) {
|
|
14
13
|
var tbodyHtmlTag = _ref.tbodyHtmlTag,
|
|
15
14
|
getRowProps = _ref.getRowProps,
|
|
16
15
|
primaryKey = _ref.primaryKey,
|
|
17
|
-
|
|
16
|
+
stickyRightOffset = _ref.stickyRightOffset,
|
|
18
17
|
data = _ref.data,
|
|
19
18
|
verInfo = _ref.verticalRenderInfo,
|
|
20
19
|
hozInfo = _ref.horizontalRenderInfo,
|
|
@@ -119,14 +118,13 @@ export function HtmlTable(_ref) {
|
|
|
119
118
|
rowSpan = Math.max(rowSpan, 1);
|
|
120
119
|
colSpan = Math.max(colSpan, 1);
|
|
121
120
|
var positionStyle = {};
|
|
122
|
-
var scrollbarWidth = hasScrollY ? getScrollbarSize().width : 0;
|
|
123
121
|
|
|
124
122
|
if (colIndex < leftFlatCount) {
|
|
125
123
|
positionStyle.position = 'sticky';
|
|
126
124
|
positionStyle.left = hozInfo.stickyLeftMap.get(colIndex);
|
|
127
125
|
} else if (colIndex >= fullFlatCount - rightFlatCount) {
|
|
128
126
|
positionStyle.position = 'sticky';
|
|
129
|
-
positionStyle.right = hozInfo.stickyRightMap.get(colIndex) -
|
|
127
|
+
positionStyle.right = hozInfo.stickyRightMap.get(colIndex) - stickyRightOffset;
|
|
130
128
|
}
|
|
131
129
|
|
|
132
130
|
return /*#__PURE__*/React.createElement('td', _extends(_extends(_extends(_extends({
|
|
@@ -14,7 +14,7 @@ import ReactDom from 'react-dom';
|
|
|
14
14
|
import cx from 'classnames';
|
|
15
15
|
import { HtmlTable } from './html-table';
|
|
16
16
|
import { Classes } from './styles';
|
|
17
|
-
import { composeRowPropsGetter
|
|
17
|
+
import { composeRowPropsGetter } from './utils';
|
|
18
18
|
import { getTreeDepth, browserType } from '../utils';
|
|
19
19
|
import TableHeader from './header';
|
|
20
20
|
var TEMPLATES = new _Map();
|
|
@@ -127,14 +127,14 @@ function renderTableBodyInIE(info, props, extra) {
|
|
|
127
127
|
primaryKey: primaryKey,
|
|
128
128
|
data: _sliceInstanceProperty(dataSource).call(dataSource, topIndex, bottomIndex)
|
|
129
129
|
};
|
|
130
|
-
var scrollbarWidth = extra.hasScrollY ? getScrollbarSize().width : 0;
|
|
131
130
|
var fixedRightTableStyle = {
|
|
132
|
-
right: -
|
|
131
|
+
right: -extra.stickyRightOffset
|
|
133
132
|
};
|
|
134
133
|
return /*#__PURE__*/React.createElement("div", {
|
|
135
134
|
className: cx(Classes.tableBody, Classes.horizontalScrollContainer)
|
|
136
135
|
}, /*#__PURE__*/React.createElement("div", {
|
|
137
|
-
className: Classes.virtual
|
|
136
|
+
className: Classes.virtual,
|
|
137
|
+
tabIndex: -1
|
|
138
138
|
}, topBlank > 0 && /*#__PURE__*/React.createElement("div", {
|
|
139
139
|
key: "top-blank",
|
|
140
140
|
className: cx(Classes.virtualBlank, 'top'),
|
|
@@ -194,7 +194,7 @@ function renderTableBodyInIE(info, props, extra) {
|
|
|
194
194
|
tbodyHtmlTag: "tbody"
|
|
195
195
|
}, commonProps, {
|
|
196
196
|
tbodyPosition: "right",
|
|
197
|
-
|
|
197
|
+
stickyRightOffset: extra.stickyRightOffset,
|
|
198
198
|
horizontalRenderInfo: _extends(_extends({}, info), {
|
|
199
199
|
flat: {
|
|
200
200
|
center: right,
|
|
@@ -149,7 +149,6 @@ export declare const defaultCSSVariables: {
|
|
|
149
149
|
'---cell-border-vertical': string;
|
|
150
150
|
'--header-cell-border': string;
|
|
151
151
|
'--header-cell-border-horizontal': string;
|
|
152
|
-
'--header-cell-border-vertical': string;
|
|
153
152
|
};
|
|
154
153
|
export declare const variableConst: string;
|
|
155
154
|
export declare const StyledArtTableWrapper: any;
|
package/es/table/base/styles.js
CHANGED
|
@@ -117,8 +117,7 @@ export var defaultCSSVariables = {
|
|
|
117
117
|
'--cell-border-horizontal': '1px solid #dfe3e8',
|
|
118
118
|
'---cell-border-vertical': '1px solid #dfe3e8',
|
|
119
119
|
'--header-cell-border': '1px solid #dfe3e8',
|
|
120
|
-
'--header-cell-border-horizontal': '1px solid #dfe3e8'
|
|
121
|
-
'--header-cell-border-vertical': '1px solid #dfe3e8'
|
|
120
|
+
'--header-cell-border-horizontal': '1px solid #dfe3e8'
|
|
122
121
|
};
|
|
123
122
|
export var variableConst = getCssVariableText(defaultCSSVariables);
|
|
124
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);
|
package/es/table/base/table.d.ts
CHANGED
|
@@ -43,6 +43,8 @@ export interface BaseTableProps {
|
|
|
43
43
|
hasStickyScroll?: boolean;
|
|
44
44
|
/** 横向粘性滚动条高度 */
|
|
45
45
|
stickyScrollHeight?: 'auto' | number;
|
|
46
|
+
/** 表格滚动条的宽度 */
|
|
47
|
+
scrollbarWidth?: number;
|
|
46
48
|
/** 使用来自外层 div 的边框代替单元格的外边框 */
|
|
47
49
|
useOuterBorder?: boolean;
|
|
48
50
|
/** 表格是否在加载中 */
|
|
@@ -78,6 +80,12 @@ export interface BaseTableProps {
|
|
|
78
80
|
[key: string]: any;
|
|
79
81
|
};
|
|
80
82
|
enableCSSVariables?: boolean;
|
|
83
|
+
scrollLoad?: {
|
|
84
|
+
/** 表格滚动加载回调 */
|
|
85
|
+
callback(startIndex: number): void;
|
|
86
|
+
/** 每个数据块的数据条数 */
|
|
87
|
+
blockSize?: number;
|
|
88
|
+
};
|
|
81
89
|
}
|
|
82
90
|
export interface BaseTableState {
|
|
83
91
|
/** 是否要展示自定义滚动条(stickyScroll) */
|
|
@@ -125,6 +133,7 @@ export declare class BaseTable extends React.Component<BaseTableProps, BaseTable
|
|
|
125
133
|
private hasScrollY;
|
|
126
134
|
private resizeObserver?;
|
|
127
135
|
private resizeSubject;
|
|
136
|
+
private offsetY;
|
|
128
137
|
/** @deprecated BaseTable.getDoms() 已经过时,请勿调用 */
|
|
129
138
|
getDoms(): TableDOMHelper;
|
|
130
139
|
constructor(props: Readonly<BaseTableProps>);
|
|
@@ -143,6 +152,7 @@ export declare class BaseTable extends React.Component<BaseTableProps, BaseTable
|
|
|
143
152
|
private renderTableFooter;
|
|
144
153
|
private renderLockShadows;
|
|
145
154
|
private renderStickyScroll;
|
|
155
|
+
private getScrollBarWidth;
|
|
146
156
|
render(): JSX.Element;
|
|
147
157
|
componentDidMount(): void;
|
|
148
158
|
componentDidUpdate(prevProps: Readonly<BaseTableProps>, prevState: Readonly<BaseTableState>): void;
|
package/es/table/base/table.js
CHANGED
|
@@ -27,7 +27,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_R
|
|
|
27
27
|
|
|
28
28
|
import cx from 'classnames';
|
|
29
29
|
import React from 'react';
|
|
30
|
-
import { BehaviorSubject, combineLatest, noop, Subscription, Subject } from 'rxjs';
|
|
30
|
+
import { BehaviorSubject, combineLatest, noop, Subscription, Subject, from } from 'rxjs';
|
|
31
31
|
import * as op from 'rxjs/operators';
|
|
32
32
|
import { calculateRenderInfo } from './calculations';
|
|
33
33
|
import { EmptyHtmlTable } from './empty';
|
|
@@ -93,6 +93,7 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
93
93
|
_this.rootSubscription = new Subscription();
|
|
94
94
|
_this.hasScrollY = false;
|
|
95
95
|
_this.resizeSubject = new Subject();
|
|
96
|
+
_this.offsetY = 0;
|
|
96
97
|
|
|
97
98
|
_this.getRowNodeListByEvent = function (e) {
|
|
98
99
|
var nodeList = null;
|
|
@@ -158,6 +159,7 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
158
159
|
className: cx(tableBodyClassName, 'empty')
|
|
159
160
|
}, /*#__PURE__*/React.createElement("div", {
|
|
160
161
|
className: Classes.virtual,
|
|
162
|
+
tabIndex: -1,
|
|
161
163
|
style: virtualStyle
|
|
162
164
|
}, /*#__PURE__*/React.createElement(EmptyHtmlTable, {
|
|
163
165
|
descriptors: info.visible,
|
|
@@ -172,6 +174,7 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
172
174
|
bottomBlank = _info$verticalRenderR.bottomBlank,
|
|
173
175
|
topBlank = _info$verticalRenderR.topBlank,
|
|
174
176
|
bottomIndex = _info$verticalRenderR.bottomIndex;
|
|
177
|
+
var stickyRightOffset = _this.hasScrollY ? _this.getScrollBarWidth() : 0;
|
|
175
178
|
var renderBody = getTableRenderTemplate('body');
|
|
176
179
|
|
|
177
180
|
if (typeof renderBody === 'function') {
|
|
@@ -180,7 +183,7 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
180
183
|
onMouseEnter: _this.handleRowMouseEnter,
|
|
181
184
|
onMouseLeave: _this.handleRowMouseLeave
|
|
182
185
|
},
|
|
183
|
-
|
|
186
|
+
stickyRightOffset: stickyRightOffset
|
|
184
187
|
});
|
|
185
188
|
}
|
|
186
189
|
|
|
@@ -188,6 +191,7 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
188
191
|
className: tableBodyClassName
|
|
189
192
|
}, /*#__PURE__*/React.createElement("div", {
|
|
190
193
|
className: Classes.virtual,
|
|
194
|
+
tabIndex: -1,
|
|
191
195
|
style: virtualStyle
|
|
192
196
|
}, topBlank > 0 && /*#__PURE__*/React.createElement("div", {
|
|
193
197
|
key: "top-blank",
|
|
@@ -200,7 +204,7 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
200
204
|
getRowProps: getRowProps,
|
|
201
205
|
primaryKey: primaryKey,
|
|
202
206
|
data: _sliceInstanceProperty(dataSource).call(dataSource, topIndex, bottomIndex),
|
|
203
|
-
|
|
207
|
+
stickyRightOffset: stickyRightOffset,
|
|
204
208
|
horizontalRenderInfo: info,
|
|
205
209
|
verticalRenderInfo: {
|
|
206
210
|
first: 0,
|
|
@@ -261,7 +265,7 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
261
265
|
var innerTableWidth = tableBodyHtmlTable.offsetWidth;
|
|
262
266
|
var artTableWidth = artTable.offsetWidth;
|
|
263
267
|
var stickyScrollHeightProp = this.props.stickyScrollHeight;
|
|
264
|
-
var stickyScrollHeight = stickyScrollHeightProp === 'auto' ?
|
|
268
|
+
var stickyScrollHeight = stickyScrollHeightProp === 'auto' ? this.getScrollBarWidth() : stickyScrollHeightProp; // stickyScroll.style.marginTop = `-${stickyScrollHeight + 1}px`
|
|
265
269
|
// 设置滚动条高度
|
|
266
270
|
|
|
267
271
|
stickyScroll.style.height = "".concat(stickyScrollHeight, "px");
|
|
@@ -326,7 +330,7 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
326
330
|
}), /*#__PURE__*/React.createElement("div", {
|
|
327
331
|
className: Classes.verticalScrollPlaceholder,
|
|
328
332
|
style: this.hasScrollY ? {
|
|
329
|
-
width:
|
|
333
|
+
width: this.getScrollBarWidth()
|
|
330
334
|
} : undefined
|
|
331
335
|
}));
|
|
332
336
|
}
|
|
@@ -435,7 +439,7 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
435
439
|
}), /*#__PURE__*/React.createElement("div", {
|
|
436
440
|
className: Classes.verticalScrollPlaceholder,
|
|
437
441
|
style: this.hasScrollY ? {
|
|
438
|
-
width:
|
|
442
|
+
width: this.getScrollBarWidth(),
|
|
439
443
|
visibility: 'initial'
|
|
440
444
|
} : undefined
|
|
441
445
|
}));
|
|
@@ -480,6 +484,11 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
480
484
|
className: Classes.stickyScrollItem
|
|
481
485
|
}));
|
|
482
486
|
}
|
|
487
|
+
}, {
|
|
488
|
+
key: "getScrollBarWidth",
|
|
489
|
+
value: function getScrollBarWidth() {
|
|
490
|
+
return this.props.scrollbarWidth || getScrollbarSize().width;
|
|
491
|
+
}
|
|
483
492
|
}, {
|
|
484
493
|
key: "render",
|
|
485
494
|
value: function render() {
|
|
@@ -654,6 +663,47 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
654
663
|
})).subscribe(function (sizeAndOffset) {
|
|
655
664
|
_this2.setState(sizeAndOffset);
|
|
656
665
|
}));
|
|
666
|
+
this.rootSubscription.add(richVisibleRects$.pipe(op.map(function (_ref7) {
|
|
667
|
+
var clipRect = _ref7.clipRect,
|
|
668
|
+
offsetY = _ref7.offsetY;
|
|
669
|
+
return {
|
|
670
|
+
maxRenderHeight: clipRect.bottom - clipRect.top,
|
|
671
|
+
maxRenderWidth: clipRect.right - clipRect.left,
|
|
672
|
+
offsetY: offsetY
|
|
673
|
+
};
|
|
674
|
+
}), op.distinctUntilChanged(function (x, y) {
|
|
675
|
+
return x.offsetY - y.offsetY === 0;
|
|
676
|
+
}), // 计算得到当前行索引对应的数据块,blocks改成数组的形式,兼容快速拖动可视区域出现两个数据块的情况
|
|
677
|
+
op.map(function (sizeAndOffset) {
|
|
678
|
+
var _a;
|
|
679
|
+
|
|
680
|
+
var offsetY = sizeAndOffset.offsetY,
|
|
681
|
+
maxRenderHeight = sizeAndOffset.maxRenderHeight;
|
|
682
|
+
var scrollDirection = offsetY - _this2.offsetY >= 0 ? 'down' : 'up';
|
|
683
|
+
_this2.offsetY = offsetY;
|
|
684
|
+
var rowCount = _this2.props.dataSource.length;
|
|
685
|
+
|
|
686
|
+
var vertical = _this2.rowHeightManager.getRenderRange(offsetY, maxRenderHeight, rowCount);
|
|
687
|
+
|
|
688
|
+
var topIndex = vertical.topIndex,
|
|
689
|
+
bottomIndex = vertical.bottomIndex;
|
|
690
|
+
var blockSize = ((_a = _this2.props.scrollLoad) === null || _a === void 0 ? void 0 : _a.blockSize) || 200;
|
|
691
|
+
var topBlockStartIndex = Math.floor(Math.max(topIndex - 1, 0) / blockSize) * blockSize;
|
|
692
|
+
var bottomBlockStartIndex = Math.floor((bottomIndex + 1) / blockSize) * blockSize;
|
|
693
|
+
return scrollDirection === 'down' ? [topBlockStartIndex, bottomBlockStartIndex] : [bottomBlockStartIndex, topBlockStartIndex];
|
|
694
|
+
}), op.distinctUntilChanged(function (x, y) {
|
|
695
|
+
return x[0] === y[0] && x[1] === y[1];
|
|
696
|
+
}), op.switchMap(function (startIndexs) {
|
|
697
|
+
var event$ = from(startIndexs);
|
|
698
|
+
return event$.pipe(op.map(function (startIndex) {
|
|
699
|
+
return startIndex;
|
|
700
|
+
}));
|
|
701
|
+
}), // 过滤掉重复掉值
|
|
702
|
+
op.distinctUntilChanged()).subscribe(function (startIndex) {
|
|
703
|
+
var _a;
|
|
704
|
+
|
|
705
|
+
(_a = _this2.props.scrollLoad) === null || _a === void 0 ? void 0 : _a.callback(startIndex);
|
|
706
|
+
}));
|
|
657
707
|
}
|
|
658
708
|
}, {
|
|
659
709
|
key: "componentWillUnmount",
|
|
@@ -36,8 +36,8 @@ function FilterPanel(_ref) {
|
|
|
36
36
|
|
|
37
37
|
var _useState3 = useState(false),
|
|
38
38
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
visible = _useState4[0],
|
|
40
|
+
setVisible = _useState4[1];
|
|
41
41
|
|
|
42
42
|
var ref = React.useRef(null);
|
|
43
43
|
|
|
@@ -47,16 +47,16 @@ function FilterPanel(_ref) {
|
|
|
47
47
|
|
|
48
48
|
useEffect(function () {
|
|
49
49
|
setPerfectPosition(keepWithinBounds(document.body, ref.current, position.x, position.y, true));
|
|
50
|
-
|
|
50
|
+
setVisible(true);
|
|
51
51
|
}, [position]);
|
|
52
52
|
useWindowEvents(function (e) {
|
|
53
53
|
return !isContainPanel(e) && onClose();
|
|
54
54
|
}, ['mousedown']);
|
|
55
55
|
return /*#__PURE__*/React.createElement(FilterPanelStyle, {
|
|
56
56
|
style: _extends(_extends({}, style), {
|
|
57
|
-
left: perfectPosition.x,
|
|
58
|
-
top: perfectPosition.y,
|
|
59
|
-
opacity:
|
|
57
|
+
left: visible ? perfectPosition.x : 0,
|
|
58
|
+
top: visible ? perfectPosition.y : 0,
|
|
59
|
+
opacity: visible ? 1 : 0
|
|
60
60
|
}),
|
|
61
61
|
ref: ref
|
|
62
62
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -126,6 +126,8 @@ export function rangeSelection(opts) {
|
|
|
126
126
|
};
|
|
127
127
|
|
|
128
128
|
var onKeyDown = function onKeyDown(e) {
|
|
129
|
+
if (!isElementInEventPath(tableBody, e.nativeEvent)) return;
|
|
130
|
+
|
|
129
131
|
if ((e.ctrlKey || e.metaKey) && e.key === 'a') {
|
|
130
132
|
var rowLen = pipeline.getDataSource().length;
|
|
131
133
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
/** elementUtil html元素用的工具函数 */
|
|
3
|
-
export declare function getEventPath(event: MouseEvent | React.MouseEvent<HTMLTableElement, MouseEvent>): any;
|
|
3
|
+
export declare function getEventPath(event: MouseEvent | React.MouseEvent<HTMLTableElement, MouseEvent> | KeyboardEvent): any;
|
|
4
4
|
/**
|
|
5
5
|
* 获取点击事件是否发生在元素内部
|
|
6
6
|
* @param ele
|
|
7
7
|
* @param event
|
|
8
8
|
*/
|
|
9
|
-
export declare function isElementInEventPath(ele?: HTMLElement, event?: MouseEvent): boolean;
|
|
9
|
+
export declare function isElementInEventPath(ele?: HTMLElement, event?: MouseEvent | KeyboardEvent): boolean;
|
|
10
10
|
/**
|
|
11
11
|
* 根据点击路径获取对应元素
|
|
12
12
|
* @param path
|
|
@@ -79,30 +79,32 @@ var TableDOMHelper = /*#__PURE__*/function () {
|
|
|
79
79
|
}, {
|
|
80
80
|
key: "getTableRows",
|
|
81
81
|
value: function getTableRows() {
|
|
82
|
-
var
|
|
83
|
-
|
|
82
|
+
var _context2;
|
|
83
|
+
|
|
84
|
+
var tbody = this.artTable.querySelector((0, _concat.default)(_context2 = ".".concat(_styles.Classes.tableBody, " .")).call(_context2, _styles.Classes.virtual, " table tbody"));
|
|
85
|
+
return tbody.childNodes;
|
|
84
86
|
}
|
|
85
87
|
}, {
|
|
86
88
|
key: "getTableBodyHtmlTable",
|
|
87
89
|
value: function getTableBodyHtmlTable() {
|
|
88
|
-
var
|
|
90
|
+
var _context3;
|
|
89
91
|
|
|
90
|
-
return this.artTable.querySelector((0, _concat.default)(
|
|
92
|
+
return this.artTable.querySelector((0, _concat.default)(_context3 = ".".concat(_styles.Classes.tableBody, " .")).call(_context3, _styles.Classes.virtual, " table"));
|
|
91
93
|
}
|
|
92
94
|
}, {
|
|
93
95
|
key: "getLeftLockShadow",
|
|
94
96
|
value: function getLeftLockShadow() {
|
|
95
|
-
var
|
|
97
|
+
var _context4;
|
|
96
98
|
|
|
97
|
-
var selector = (0, _concat.default)(
|
|
99
|
+
var selector = (0, _concat.default)(_context4 = ".".concat(_styles.Classes.lockShadowMask, " .")).call(_context4, _styles.Classes.leftLockShadow);
|
|
98
100
|
return this.artTable.querySelector(selector);
|
|
99
101
|
}
|
|
100
102
|
}, {
|
|
101
103
|
key: "getRightLockShadow",
|
|
102
104
|
value: function getRightLockShadow() {
|
|
103
|
-
var
|
|
105
|
+
var _context5;
|
|
104
106
|
|
|
105
|
-
var selector = (0, _concat.default)(
|
|
107
|
+
var selector = (0, _concat.default)(_context5 = ".".concat(_styles.Classes.lockShadowMask, " .")).call(_context5, _styles.Classes.rightLockShadow);
|
|
106
108
|
return this.artTable.querySelector(selector);
|
|
107
109
|
}
|
|
108
110
|
}, {
|
|
@@ -113,10 +115,10 @@ var TableDOMHelper = /*#__PURE__*/function () {
|
|
|
113
115
|
}, {
|
|
114
116
|
key: "getRowTop",
|
|
115
117
|
value: function getRowTop(rowIndex) {
|
|
116
|
-
var
|
|
118
|
+
var _context6, _context7;
|
|
117
119
|
|
|
118
120
|
if (rowIndex === 0) return 0;
|
|
119
|
-
var selector = (0, _concat.default)(
|
|
121
|
+
var selector = (0, _concat.default)(_context6 = (0, _concat.default)(_context7 = ".".concat(_styles.Classes.tableBody, " .")).call(_context7, _styles.Classes.tableRow, "[data-rowindex=\"")).call(_context6, rowIndex, "\"]");
|
|
120
122
|
var row = this.artTable.querySelector(selector);
|
|
121
123
|
var rowOffsetTop = row && row.offsetTop || 0;
|
|
122
124
|
var tableOffsetTop = this.tableElement.offsetTop || 0;
|
|
@@ -4,7 +4,7 @@ import { BaseTableProps } from './table';
|
|
|
4
4
|
export interface HtmlTableProps extends Required<Pick<BaseTableProps, 'getRowProps' | 'primaryKey'>> {
|
|
5
5
|
tbodyHtmlTag: 'tbody' | 'tfoot';
|
|
6
6
|
data: any[];
|
|
7
|
-
|
|
7
|
+
stickyRightOffset?: number;
|
|
8
8
|
horizontalRenderInfo: Pick<RenderInfo, 'flat' | 'visible' | 'horizontalRenderRange' | 'stickyLeftMap' | 'stickyRightMap'>;
|
|
9
9
|
verticalRenderInfo: {
|
|
10
10
|
offset: number;
|
|
@@ -14,4 +14,4 @@ export interface HtmlTableProps extends Required<Pick<BaseTableProps, 'getRowPro
|
|
|
14
14
|
};
|
|
15
15
|
tbodyPosition?: 'left' | 'center' | 'right';
|
|
16
16
|
}
|
|
17
|
-
export declare function HtmlTable({ tbodyHtmlTag, getRowProps, primaryKey,
|
|
17
|
+
export declare function HtmlTable({ tbodyHtmlTag, getRowProps, primaryKey, stickyRightOffset, data, verticalRenderInfo: verInfo, horizontalRenderInfo: hozInfo, tbodyPosition }: HtmlTableProps): JSX.Element;
|
|
@@ -29,13 +29,11 @@ var _SpanManager = _interopRequireDefault(require("./helpers/SpanManager"));
|
|
|
29
29
|
|
|
30
30
|
var _styles = require("./styles");
|
|
31
31
|
|
|
32
|
-
var _utils = require("./utils");
|
|
33
|
-
|
|
34
32
|
function HtmlTable(_ref) {
|
|
35
33
|
var tbodyHtmlTag = _ref.tbodyHtmlTag,
|
|
36
34
|
getRowProps = _ref.getRowProps,
|
|
37
35
|
primaryKey = _ref.primaryKey,
|
|
38
|
-
|
|
36
|
+
stickyRightOffset = _ref.stickyRightOffset,
|
|
39
37
|
data = _ref.data,
|
|
40
38
|
verInfo = _ref.verticalRenderInfo,
|
|
41
39
|
hozInfo = _ref.horizontalRenderInfo,
|
|
@@ -137,14 +135,13 @@ function HtmlTable(_ref) {
|
|
|
137
135
|
rowSpan = Math.max(rowSpan, 1);
|
|
138
136
|
colSpan = Math.max(colSpan, 1);
|
|
139
137
|
var positionStyle = {};
|
|
140
|
-
var scrollbarWidth = hasScrollY ? (0, _utils.getScrollbarSize)().width : 0;
|
|
141
138
|
|
|
142
139
|
if (colIndex < leftFlatCount) {
|
|
143
140
|
positionStyle.position = 'sticky';
|
|
144
141
|
positionStyle.left = hozInfo.stickyLeftMap.get(colIndex);
|
|
145
142
|
} else if (colIndex >= fullFlatCount - rightFlatCount) {
|
|
146
143
|
positionStyle.position = 'sticky';
|
|
147
|
-
positionStyle.right = hozInfo.stickyRightMap.get(colIndex) -
|
|
144
|
+
positionStyle.right = hozInfo.stickyRightMap.get(colIndex) - stickyRightOffset;
|
|
148
145
|
}
|
|
149
146
|
|
|
150
147
|
return /*#__PURE__*/_react.default.createElement('td', (0, _extends2.default)((0, _extends2.default)((0, _extends2.default)((0, _extends2.default)({
|
|
@@ -154,14 +154,14 @@ function renderTableBodyInIE(info, props, extra) {
|
|
|
154
154
|
primaryKey: primaryKey,
|
|
155
155
|
data: (0, _slice.default)(dataSource).call(dataSource, topIndex, bottomIndex)
|
|
156
156
|
};
|
|
157
|
-
var scrollbarWidth = extra.hasScrollY ? (0, _utils.getScrollbarSize)().width : 0;
|
|
158
157
|
var fixedRightTableStyle = {
|
|
159
|
-
right: -
|
|
158
|
+
right: -extra.stickyRightOffset
|
|
160
159
|
};
|
|
161
160
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
162
161
|
className: (0, _classnames.default)(_styles.Classes.tableBody, _styles.Classes.horizontalScrollContainer)
|
|
163
162
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
164
|
-
className: _styles.Classes.virtual
|
|
163
|
+
className: _styles.Classes.virtual,
|
|
164
|
+
tabIndex: -1
|
|
165
165
|
}, topBlank > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
166
166
|
key: "top-blank",
|
|
167
167
|
className: (0, _classnames.default)(_styles.Classes.virtualBlank, 'top'),
|
|
@@ -221,7 +221,7 @@ function renderTableBodyInIE(info, props, extra) {
|
|
|
221
221
|
tbodyHtmlTag: "tbody"
|
|
222
222
|
}, commonProps, {
|
|
223
223
|
tbodyPosition: "right",
|
|
224
|
-
|
|
224
|
+
stickyRightOffset: extra.stickyRightOffset,
|
|
225
225
|
horizontalRenderInfo: (0, _extends2.default)((0, _extends2.default)({}, info), {
|
|
226
226
|
flat: {
|
|
227
227
|
center: right,
|
|
@@ -149,7 +149,6 @@ export declare const defaultCSSVariables: {
|
|
|
149
149
|
'---cell-border-vertical': string;
|
|
150
150
|
'--header-cell-border': string;
|
|
151
151
|
'--header-cell-border-horizontal': string;
|
|
152
|
-
'--header-cell-border-vertical': string;
|
|
153
152
|
};
|
|
154
153
|
export declare const variableConst: string;
|
|
155
154
|
export declare const StyledArtTableWrapper: any;
|
package/lib/table/base/styles.js
CHANGED
|
@@ -142,8 +142,7 @@ var defaultCSSVariables = {
|
|
|
142
142
|
'--cell-border-horizontal': '1px solid #dfe3e8',
|
|
143
143
|
'---cell-border-vertical': '1px solid #dfe3e8',
|
|
144
144
|
'--header-cell-border': '1px solid #dfe3e8',
|
|
145
|
-
'--header-cell-border-horizontal': '1px solid #dfe3e8'
|
|
146
|
-
'--header-cell-border-vertical': '1px solid #dfe3e8'
|
|
145
|
+
'--header-cell-border-horizontal': '1px solid #dfe3e8'
|
|
147
146
|
};
|
|
148
147
|
exports.defaultCSSVariables = defaultCSSVariables;
|
|
149
148
|
var variableConst = getCssVariableText(defaultCSSVariables);
|
|
@@ -43,6 +43,8 @@ export interface BaseTableProps {
|
|
|
43
43
|
hasStickyScroll?: boolean;
|
|
44
44
|
/** 横向粘性滚动条高度 */
|
|
45
45
|
stickyScrollHeight?: 'auto' | number;
|
|
46
|
+
/** 表格滚动条的宽度 */
|
|
47
|
+
scrollbarWidth?: number;
|
|
46
48
|
/** 使用来自外层 div 的边框代替单元格的外边框 */
|
|
47
49
|
useOuterBorder?: boolean;
|
|
48
50
|
/** 表格是否在加载中 */
|
|
@@ -78,6 +80,12 @@ export interface BaseTableProps {
|
|
|
78
80
|
[key: string]: any;
|
|
79
81
|
};
|
|
80
82
|
enableCSSVariables?: boolean;
|
|
83
|
+
scrollLoad?: {
|
|
84
|
+
/** 表格滚动加载回调 */
|
|
85
|
+
callback(startIndex: number): void;
|
|
86
|
+
/** 每个数据块的数据条数 */
|
|
87
|
+
blockSize?: number;
|
|
88
|
+
};
|
|
81
89
|
}
|
|
82
90
|
export interface BaseTableState {
|
|
83
91
|
/** 是否要展示自定义滚动条(stickyScroll) */
|
|
@@ -125,6 +133,7 @@ export declare class BaseTable extends React.Component<BaseTableProps, BaseTable
|
|
|
125
133
|
private hasScrollY;
|
|
126
134
|
private resizeObserver?;
|
|
127
135
|
private resizeSubject;
|
|
136
|
+
private offsetY;
|
|
128
137
|
/** @deprecated BaseTable.getDoms() 已经过时,请勿调用 */
|
|
129
138
|
getDoms(): TableDOMHelper;
|
|
130
139
|
constructor(props: Readonly<BaseTableProps>);
|
|
@@ -143,6 +152,7 @@ export declare class BaseTable extends React.Component<BaseTableProps, BaseTable
|
|
|
143
152
|
private renderTableFooter;
|
|
144
153
|
private renderLockShadows;
|
|
145
154
|
private renderStickyScroll;
|
|
155
|
+
private getScrollBarWidth;
|
|
146
156
|
render(): JSX.Element;
|
|
147
157
|
componentDidMount(): void;
|
|
148
158
|
componentDidUpdate(prevProps: Readonly<BaseTableProps>, prevState: Readonly<BaseTableState>): void;
|