@kdcloudjs/table 1.2.0-canary.8 → 1.2.0
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 +634 -125
- package/dist/@kdcloudjs/table.js.map +1 -1
- package/dist/@kdcloudjs/table.min.css +1 -1
- package/dist/@kdcloudjs/table.min.js +8 -8
- package/dist/@kdcloudjs/table.min.js.map +1 -1
- package/es/table/base/header.d.ts +2 -1
- package/es/table/base/header.js +4 -2
- package/es/table/base/helpers/TableDOMUtils.js +3 -1
- package/es/table/base/html-table.js +1 -1
- package/es/table/base/renderTemplates.js +24 -10
- package/es/table/base/styles.d.ts +7 -0
- package/es/table/base/styles.js +9 -2
- package/es/table/base/table.d.ts +2 -1
- package/es/table/base/table.js +73 -46
- package/es/table/interfaces.d.ts +2 -0
- package/es/table/pipeline/features/autoFill.js +3 -1
- package/es/table/pipeline/features/columnDrag.js +11 -7
- package/es/table/pipeline/features/columnFilter.js +15 -5
- 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 +18 -35
- package/es/table/pipeline/features/rangeSelection.js +3 -2
- package/es/table/pipeline/features/rowDrag.d.ts +30 -0
- package/es/table/pipeline/features/rowDrag.js +349 -0
- package/es/table/pipeline/features/singleSelect.js +6 -4
- package/es/table/pipeline/features/sort.js +22 -3
- package/es/table/pipeline/features/treeMode.js +6 -0
- package/es/table/pipeline/pipeline.d.ts +2 -0
- package/es/table/pipeline/pipeline.js +9 -1
- package/es/table/utils/index.d.ts +1 -0
- package/es/table/utils/index.js +2 -1
- package/es/table/utils/selectColumn.d.ts +4 -0
- package/es/table/utils/selectColumn.js +6 -0
- package/lib/table/base/header.d.ts +2 -1
- package/lib/table/base/header.js +4 -2
- package/lib/table/base/helpers/TableDOMUtils.js +3 -1
- package/lib/table/base/html-table.js +1 -1
- package/lib/table/base/renderTemplates.js +24 -10
- package/lib/table/base/styles.d.ts +7 -0
- package/lib/table/base/styles.js +9 -2
- package/lib/table/base/table.d.ts +2 -1
- package/lib/table/base/table.js +73 -46
- package/lib/table/interfaces.d.ts +2 -0
- package/lib/table/pipeline/features/autoFill.js +3 -1
- package/lib/table/pipeline/features/columnDrag.js +10 -6
- package/lib/table/pipeline/features/columnFilter.js +16 -6
- package/lib/table/pipeline/features/index.d.ts +1 -0
- package/lib/table/pipeline/features/index.js +9 -1
- package/lib/table/pipeline/features/multiSelect.js +20 -38
- package/lib/table/pipeline/features/rangeSelection.js +3 -2
- package/lib/table/pipeline/features/rowDrag.d.ts +30 -0
- package/lib/table/pipeline/features/rowDrag.js +371 -0
- package/lib/table/pipeline/features/singleSelect.js +8 -5
- package/lib/table/pipeline/features/sort.js +22 -3
- package/lib/table/pipeline/features/treeMode.js +6 -0
- package/lib/table/pipeline/pipeline.d.ts +2 -0
- package/lib/table/pipeline/pipeline.js +9 -1
- package/lib/table/utils/index.d.ts +1 -0
- package/lib/table/utils/index.js +21 -1
- package/lib/table/utils/selectColumn.d.ts +4 -0
- package/lib/table/utils/selectColumn.js +16 -0
- package/package.json +3 -3
|
@@ -71,6 +71,11 @@ export function treeMode() {
|
|
|
71
71
|
return pipeline.mapDataSource(processDataSource).mapColumns(processColumns);
|
|
72
72
|
|
|
73
73
|
function processDataSource(input) {
|
|
74
|
+
if (pipeline.isSameInputDataSource() && openKeys === pipeline.getFeatureOptions('lastOpenKeys')) {
|
|
75
|
+
return pipeline.getFeatureOptions('lastTreeMode');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
pipeline.setFeatureOptions('lastOpenKeys', pipeline.getStateAtKey(stateKey) || openKeys);
|
|
74
79
|
var result = [];
|
|
75
80
|
dfs(input, 0);
|
|
76
81
|
|
|
@@ -111,6 +116,7 @@ export function treeMode() {
|
|
|
111
116
|
}
|
|
112
117
|
}
|
|
113
118
|
|
|
119
|
+
pipeline.setFeatureOptions('lastTreeMode', result);
|
|
114
120
|
return result;
|
|
115
121
|
}
|
|
116
122
|
|
|
@@ -35,6 +35,7 @@ export declare class TablePipeline {
|
|
|
35
35
|
private readonly _rowPropsGetters;
|
|
36
36
|
private _tableProps;
|
|
37
37
|
private _dataSource;
|
|
38
|
+
private _isSameInputDataSource;
|
|
38
39
|
private _columns;
|
|
39
40
|
private _footerDataSource?;
|
|
40
41
|
static defaultIndents: TablePipelineIndentsConfig;
|
|
@@ -51,6 +52,7 @@ export declare class TablePipeline {
|
|
|
51
52
|
appendRowPropsGetter(getter: RowPropsGetter): this;
|
|
52
53
|
addTableProps(props: React.HTMLAttributes<HTMLTableElement>): void;
|
|
53
54
|
getDataSource(name?: string): any[];
|
|
55
|
+
isSameInputDataSource(): boolean;
|
|
54
56
|
getColumns(name?: string): any[];
|
|
55
57
|
getFooterDataSource(): any[];
|
|
56
58
|
getStateAtKey<T = any>(stateKey: string, defaultValue?: T): T;
|
|
@@ -76,6 +76,11 @@ export var TablePipeline = /*#__PURE__*/function () {
|
|
|
76
76
|
return this._snapshots[name].dataSource;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
+
}, {
|
|
80
|
+
key: "isSameInputDataSource",
|
|
81
|
+
value: function isSameInputDataSource() {
|
|
82
|
+
return this._isSameInputDataSource;
|
|
83
|
+
}
|
|
79
84
|
}, {
|
|
80
85
|
key: "getColumns",
|
|
81
86
|
value: function getColumns(name) {
|
|
@@ -127,9 +132,12 @@ export var TablePipeline = /*#__PURE__*/function () {
|
|
|
127
132
|
|
|
128
133
|
if (this._dataSource != null || this._columns != null) {
|
|
129
134
|
throw new Error('input 不能调用两次');
|
|
130
|
-
}
|
|
135
|
+
} // 在 pipeline 中识别本次更新是否有数据变化
|
|
136
|
+
|
|
131
137
|
|
|
138
|
+
this._isSameInputDataSource = _input.dataSource === this.ref.current._lastInputDataSource;
|
|
132
139
|
this._dataSource = _input.dataSource;
|
|
140
|
+
this.ref.current._lastInputDataSource = _input.dataSource;
|
|
133
141
|
this._columns = _mapInstanceProperty(_context = _input.columns).call(_context, function (col) {
|
|
134
142
|
return _extends(_extends({}, col), {
|
|
135
143
|
key: _this.guid()
|
|
@@ -17,3 +17,4 @@ export { default as layeredFilter } from './layeredFilter';
|
|
|
17
17
|
export { getEventPath, isElementInEventPath, getTargetEleInEventPath, calculatePointerRelative, calculatePopupRelative, keepWithinBounds } from './element';
|
|
18
18
|
export { default as console } from './console';
|
|
19
19
|
export { browserType } from './browserType';
|
|
20
|
+
export { MULTI_SELECT_MARK_PROPNAME, SINGLE_SELECT_MARK_PROPNAME, isSelectColumn } from './selectColumn';
|
package/es/table/utils/index.js
CHANGED
|
@@ -16,4 +16,5 @@ export { copyDataToClipboard, executeOnTempElement } from './copyToClipboard';
|
|
|
16
16
|
export { default as layeredFilter } from './layeredFilter';
|
|
17
17
|
export { getEventPath, isElementInEventPath, getTargetEleInEventPath, calculatePointerRelative, calculatePopupRelative, keepWithinBounds } from './element';
|
|
18
18
|
export { default as console } from './console';
|
|
19
|
-
export { browserType } from './browserType';
|
|
19
|
+
export { browserType } from './browserType';
|
|
20
|
+
export { MULTI_SELECT_MARK_PROPNAME, SINGLE_SELECT_MARK_PROPNAME, isSelectColumn } from './selectColumn';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export var MULTI_SELECT_MARK_PROPNAME = 'checkboxSelection';
|
|
2
|
+
export var SINGLE_SELECT_MARK_PROPNAME = 'radioSelection';
|
|
3
|
+
export function isSelectColumn(column) {
|
|
4
|
+
var features = column.features || {};
|
|
5
|
+
return features[MULTI_SELECT_MARK_PROPNAME] === true || features[SINGLE_SELECT_MARK_PROPNAME] === true;
|
|
6
|
+
}
|
|
@@ -4,6 +4,7 @@ interface TableHeaderProps {
|
|
|
4
4
|
info: RenderInfo;
|
|
5
5
|
theaderPosition?: 'left' | 'center' | 'right';
|
|
6
6
|
rowCount?: number;
|
|
7
|
+
stickyRightOffset?: number;
|
|
7
8
|
}
|
|
8
|
-
export default function TableHeader({ info, theaderPosition, rowCount: _rowCount }: TableHeaderProps): JSX.Element;
|
|
9
|
+
export default function TableHeader({ info, theaderPosition, rowCount: _rowCount, stickyRightOffset }: TableHeaderProps): JSX.Element;
|
|
9
10
|
export {};
|
package/lib/table/base/header.js
CHANGED
|
@@ -249,7 +249,8 @@ function TableHeader(_ref2) {
|
|
|
249
249
|
|
|
250
250
|
var info = _ref2.info,
|
|
251
251
|
theaderPosition = _ref2.theaderPosition,
|
|
252
|
-
_rowCount = _ref2.rowCount
|
|
252
|
+
_rowCount = _ref2.rowCount,
|
|
253
|
+
stickyRightOffset = _ref2.stickyRightOffset;
|
|
253
254
|
var nested = info.nested,
|
|
254
255
|
flat = (0, _flat.default)(info),
|
|
255
256
|
stickyLeftMap = info.stickyLeftMap,
|
|
@@ -293,7 +294,8 @@ function TableHeader(_ref2) {
|
|
|
293
294
|
positionStyle.left = stickyLeftMap.get(colIndex);
|
|
294
295
|
} else if (colIndex >= fullFlatCount - rightFlatCount) {
|
|
295
296
|
positionStyle.position = 'sticky';
|
|
296
|
-
|
|
297
|
+
var stickyRightIndex = colSpan > 1 ? colIndex + colSpan - 1 : colIndex;
|
|
298
|
+
positionStyle.right = stickyRightMap.get(stickyRightIndex) + stickyRightOffset;
|
|
297
299
|
}
|
|
298
300
|
|
|
299
301
|
var justifyContent = col.align === 'right' ? 'flex-end' : col.align === 'center' ? 'center' : 'flex-start';
|
|
@@ -107,7 +107,9 @@ var TableDOMHelper = /*#__PURE__*/function () {
|
|
|
107
107
|
this.tableFooter = this.artTable.querySelector(".".concat(_styles.Classes.tableFooter));
|
|
108
108
|
this.tableFooterMain = this.artTable.querySelector(".".concat(_styles.Classes.tableFooterMain));
|
|
109
109
|
var stickyScrollSelector = (0, _concat.default)(_context2 = (0, _concat.default)(_context3 = ".".concat(_styles.Classes.artTable, " + .")).call(_context3, _styles.Classes.horizontalStickyScrollContainer, " .")).call(_context2, _styles.Classes.stickyScroll);
|
|
110
|
-
|
|
110
|
+
var stickyScrolls = artTableWrapper.querySelectorAll(stickyScrollSelector);
|
|
111
|
+
this.stickyScroll = stickyScrolls[stickyScrolls.length - 1]; // 当嵌套多层表格时,需要查找最后一个,否则会查找到父表格内嵌套的子表格的
|
|
112
|
+
|
|
111
113
|
this.stickyScrollItem = this.stickyScroll.querySelector(".".concat(_styles.Classes.stickyScrollItem));
|
|
112
114
|
}
|
|
113
115
|
|
|
@@ -141,7 +141,7 @@ function HtmlTable(_ref) {
|
|
|
141
141
|
positionStyle.left = hozInfo.stickyLeftMap.get(colIndex);
|
|
142
142
|
} else if (colIndex >= fullFlatCount - rightFlatCount) {
|
|
143
143
|
positionStyle.position = 'sticky';
|
|
144
|
-
positionStyle.right = hozInfo.stickyRightMap.get(colIndex)
|
|
144
|
+
positionStyle.right = hozInfo.stickyRightMap.get(colIndex) + (typeof stickyRightOffset === 'number' ? stickyRightOffset : 0);
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
return /*#__PURE__*/_react.default.createElement('td', (0, _extends2.default)((0, _extends2.default)((0, _extends2.default)((0, _extends2.default)({
|
|
@@ -50,7 +50,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
50
50
|
*/
|
|
51
51
|
var TEMPLATES = new _map.default();
|
|
52
52
|
|
|
53
|
-
function renderTableHeaderInIE(info, props) {
|
|
53
|
+
function renderTableHeaderInIE(info, props, extra) {
|
|
54
54
|
var stickyTop = props.stickyTop,
|
|
55
55
|
hasHeader = props.hasHeader;
|
|
56
56
|
var flat = (0, _flat.default)(info),
|
|
@@ -63,6 +63,9 @@ function renderTableHeaderInIE(info, props) {
|
|
|
63
63
|
rightNested = nested.right,
|
|
64
64
|
full = nested.full;
|
|
65
65
|
var rowCount = (0, _utils2.getTreeDepth)(full) + 1;
|
|
66
|
+
var fixedRightTableStyle = {
|
|
67
|
+
right: (extra === null || extra === void 0 ? void 0 : extra.stickyRightOffset) || 0
|
|
68
|
+
};
|
|
66
69
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
67
70
|
className: (0, _classnames.default)(_styles.Classes.tableHeader)
|
|
68
71
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -74,6 +77,11 @@ function renderTableHeaderInIE(info, props) {
|
|
|
74
77
|
}, /*#__PURE__*/_react.default.createElement(_header.default, {
|
|
75
78
|
info: info,
|
|
76
79
|
theaderPosition: hasLockColumn ? 'center' : undefined
|
|
80
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
81
|
+
className: _styles.Classes.verticalScrollPlaceholder,
|
|
82
|
+
style: typeof (extra === null || extra === void 0 ? void 0 : extra.stickyRightOffset) === 'number' ? {
|
|
83
|
+
width: extra === null || extra === void 0 ? void 0 : extra.stickyRightOffset
|
|
84
|
+
} : undefined
|
|
77
85
|
})), left.length > 0 ? /*#__PURE__*/_react.default.createElement("div", {
|
|
78
86
|
className: _styles.Classes.fixedLeft
|
|
79
87
|
}, /*#__PURE__*/_react.default.createElement(_header.default, {
|
|
@@ -101,7 +109,8 @@ function renderTableHeaderInIE(info, props) {
|
|
|
101
109
|
theaderPosition: "left",
|
|
102
110
|
rowCount: rowCount
|
|
103
111
|
})) : null, right.length > 0 ? /*#__PURE__*/_react.default.createElement("div", {
|
|
104
|
-
className: _styles.Classes.fixedRight
|
|
112
|
+
className: _styles.Classes.fixedRight,
|
|
113
|
+
style: fixedRightTableStyle
|
|
105
114
|
}, /*#__PURE__*/_react.default.createElement(_header.default, {
|
|
106
115
|
info: (0, _extends2.default)((0, _extends2.default)({}, info), {
|
|
107
116
|
flat: {
|
|
@@ -154,9 +163,6 @@ function renderTableBodyInIE(info, props, extra) {
|
|
|
154
163
|
primaryKey: primaryKey,
|
|
155
164
|
data: (0, _slice.default)(dataSource).call(dataSource, topIndex, bottomIndex)
|
|
156
165
|
};
|
|
157
|
-
var fixedRightTableStyle = {
|
|
158
|
-
right: -extra.stickyRightOffset
|
|
159
|
-
};
|
|
160
166
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
161
167
|
className: (0, _classnames.default)(_styles.Classes.tableBody, _styles.Classes.horizontalScrollContainer)
|
|
162
168
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -209,8 +215,7 @@ function renderTableBodyInIE(info, props, extra) {
|
|
|
209
215
|
height: bottomBlank
|
|
210
216
|
}
|
|
211
217
|
})) : null, right.length > 0 ? /*#__PURE__*/_react.default.createElement("div", {
|
|
212
|
-
className: _styles.Classes.fixedRight
|
|
213
|
-
style: fixedRightTableStyle
|
|
218
|
+
className: _styles.Classes.fixedRight
|
|
214
219
|
}, topBlank > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
215
220
|
key: "top-blank",
|
|
216
221
|
className: (0, _classnames.default)(_styles.Classes.virtualBlank, 'top'),
|
|
@@ -221,7 +226,6 @@ function renderTableBodyInIE(info, props, extra) {
|
|
|
221
226
|
tbodyHtmlTag: "tbody"
|
|
222
227
|
}, commonProps, {
|
|
223
228
|
tbodyPosition: "right",
|
|
224
|
-
stickyRightOffset: extra.stickyRightOffset,
|
|
225
229
|
horizontalRenderInfo: (0, _extends2.default)((0, _extends2.default)({}, info), {
|
|
226
230
|
flat: {
|
|
227
231
|
center: right,
|
|
@@ -269,6 +273,9 @@ function renderTableFooterInIE(info, props, extra) {
|
|
|
269
273
|
primaryKey: primaryKey,
|
|
270
274
|
verticalRenderInfo: verticalRenderInfo
|
|
271
275
|
};
|
|
276
|
+
var fixedRightTableStyle = {
|
|
277
|
+
right: (extra === null || extra === void 0 ? void 0 : extra.stickyRightOffset) || 0
|
|
278
|
+
};
|
|
272
279
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
273
280
|
className: (0, _classnames.default)(_styles.Classes.tableFooter),
|
|
274
281
|
style: {
|
|
@@ -281,7 +288,13 @@ function renderTableFooterInIE(info, props, extra) {
|
|
|
281
288
|
}, commonProps, {
|
|
282
289
|
tbodyPosition: hasLockColumn ? 'center' : undefined,
|
|
283
290
|
horizontalRenderInfo: info
|
|
284
|
-
}))
|
|
291
|
+
})), footerDataSource.length > 0 ? /*#__PURE__*/_react.default.createElement("div", {
|
|
292
|
+
className: _styles.Classes.verticalScrollPlaceholder,
|
|
293
|
+
style: typeof (extra === null || extra === void 0 ? void 0 : extra.stickyRightOffset) === 'number' ? {
|
|
294
|
+
width: extra === null || extra === void 0 ? void 0 : extra.stickyRightOffset,
|
|
295
|
+
visibility: 'initial'
|
|
296
|
+
} : undefined
|
|
297
|
+
}) : null), left.length > 0 ? /*#__PURE__*/_react.default.createElement("div", {
|
|
285
298
|
className: _styles.Classes.fixedLeft
|
|
286
299
|
}, /*#__PURE__*/_react.default.createElement(_htmlTable.HtmlTable, (0, _extends2.default)({
|
|
287
300
|
tbodyHtmlTag: "tfoot"
|
|
@@ -297,7 +310,8 @@ function renderTableFooterInIE(info, props, extra) {
|
|
|
297
310
|
visible: (0, _slice.default)(visible).call(visible, 0, left.length)
|
|
298
311
|
})
|
|
299
312
|
}))) : null, right.length > 0 ? /*#__PURE__*/_react.default.createElement("div", {
|
|
300
|
-
className: _styles.Classes.fixedRight
|
|
313
|
+
className: _styles.Classes.fixedRight,
|
|
314
|
+
style: fixedRightTableStyle
|
|
301
315
|
}, /*#__PURE__*/_react.default.createElement(_htmlTable.HtmlTable, (0, _extends2.default)({
|
|
302
316
|
tbodyHtmlTag: "tfoot"
|
|
303
317
|
}, commonProps, {
|
|
@@ -70,6 +70,13 @@ export declare const Classes: {
|
|
|
70
70
|
readonly popup: string;
|
|
71
71
|
readonly popupHeader: string;
|
|
72
72
|
readonly popupBody: string;
|
|
73
|
+
readonly rowDragging: string;
|
|
74
|
+
readonly rowDragStart: string;
|
|
75
|
+
readonly rowDragEnd: string;
|
|
76
|
+
readonly rowDragEndToTop: string;
|
|
77
|
+
readonly rowDragEndToBottom: string;
|
|
78
|
+
readonly rowDragElement: string;
|
|
79
|
+
readonly rowDragCell: string;
|
|
73
80
|
};
|
|
74
81
|
export declare const MenuClasses: {
|
|
75
82
|
menu: string;
|
package/lib/table/base/styles.js
CHANGED
|
@@ -105,7 +105,14 @@ var Classes = {
|
|
|
105
105
|
collapsed: "".concat(prefix, "collapsed"),
|
|
106
106
|
popup: "".concat(prefix, "popup"),
|
|
107
107
|
popupHeader: "".concat(prefix, "popup-header"),
|
|
108
|
-
popupBody: "".concat(prefix, "popup-body")
|
|
108
|
+
popupBody: "".concat(prefix, "popup-body"),
|
|
109
|
+
rowDragging: "".concat(prefix, "row-dragging"),
|
|
110
|
+
rowDragStart: "".concat(prefix, "row-drag-start"),
|
|
111
|
+
rowDragEnd: "".concat(prefix, "row-drag-end"),
|
|
112
|
+
rowDragEndToTop: "".concat(prefix, "row-drag-end-to-top"),
|
|
113
|
+
rowDragEndToBottom: "".concat(prefix, "row-drag-end-to-bottom"),
|
|
114
|
+
rowDragElement: "".concat(prefix, "row-drag-element"),
|
|
115
|
+
rowDragCell: "".concat(prefix, "row-drag-cell")
|
|
109
116
|
};
|
|
110
117
|
exports.Classes = Classes;
|
|
111
118
|
var MenuClasses = {
|
|
@@ -162,7 +169,7 @@ exports.variableConst = variableConst;
|
|
|
162
169
|
var notBorderedStyleMixin = (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n --cell-border-vertical: none;\n --header-cell-border-vertical: none;\n"])));
|
|
163
170
|
var borderedStyleMixin = (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n //th\u9690\u85CF\u5217\u5BBD\u62D6\u62FD\u7684\u80CC\u666F\u8272\uFF0C\u4F7F\u7528th\u7684\u53F3\u8FB9\u6846\u4EE3\u66FF\n .", "::after{\n background-color: inherit;\n }\n"])), Classes.tableHeaderCellResize);
|
|
164
171
|
|
|
165
|
-
var StyledArtTableWrapper = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\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 // \u8868\u683C\u4E0D\u542F\u7528\u8FB9\u6846\u7EBF\uFF0C\u9690\u85CFth\u3001td\u7684\u5355\u5143\u683C\u5DE6\u53F3\u8FB9\u6846\u7EBF\n &:not(.", ") {\n ", "\n }\n &.", "{\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: 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 user-select:none;\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: var(--header-cell-border-vertical)\n }\n\n th.", " {\n border-right: var(--header-cell-border-vertical);\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 display:flex;\n background: var(--bgcolor);\n }\n .", "{\n height: 1px;\n flex-shrink: 0;\n border-top: 1px solid var(--border-color);\n }\n\n .", "{\n height: 1px;\n flex-shrink: 0;\n border-top: 1px solid var(--border-color);\n }\n .", " {\n overflow-y: hidden;\n overflow-x: auto;\n z-index: ", ";\n flex-shrink: 1;\n flex-grow: 0;\n border-top: 1px solid var(--border-color);\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: hidden;//\u5217\u5168\u90E8\u56FA\u5B9A\u65F6\uFF0C\u5B58\u5728\u53CC\u6A2A\u5411\u6EDA\u52A8\u6761\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 padding: 6px 4px;\n &:hover{\n background-color: #e5e5e5;\n }\n &:focus {\n outline: none\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 .", " {\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\n //#region \u62D6\u62FD\u5217\u5BBD\u5927\u5C0F\n .", "::after{\n background-color: var(--border-color);\n }\n //\u89E3\u51B3\u90E8\u5206\u6D4F\u89C8\u5668(chrome109)\u6700\u540E\u4E00\u4E2A\u5355\u5143\u683C\u7684\u5217\u5BBD\u62D6\u62FD\u533A\u57DF\u7EDD\u5BF9\u5B9A\u4F4D\u8D85\u51FA\u8868\u683C\uFF0C\u5BFC\u81F4\u8868\u683C\u7AD6\u5206\u5272\u7EBF\u65E0\u6CD5\u5BF9\u9F50\n .", " th.", " .", "{\n right: 0;\n width: 5px;\n &::after{\n left: 4px;\n }\n }\n //#endregion\n\n "])), variableConst, variableConst, outerBorderStyleMixin, Classes.artTableBordered, notBorderedStyleMixin, Classes.artTableBordered, borderedStyleMixin, Classes.artTable, Classes.tableHeader, Classes.tableHeaderCellContent, Classes.virtual, Classes.tableFooter, Classes.tableBody, Classes.tableFooter, Classes.tableRow, Classes.tableBody, Classes.tableFooter, Classes.tableCellRangeSelected, Classes.tableCellRangeTop, Classes.tableCellRangeLeft, Classes.tableCellRangeBottom, Classes.tableCellRangeRight, Classes.rangeSelection, 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.horizontalStickyScrollContainer, Classes.horizontalScrollLeftSpacer, Classes.horizontalScrollRightSpacer, Classes.stickyScroll, Z.scrollItem, Classes.stickyScrollItem, Classes.loadingWrapper, Classes.loadingContentWrapper, Classes.loadingIndicatorWrapper, Classes.loadingIndicator, Z.loadingIndicator, Classes.tableFilterTrigger, Classes.tableSortIcon, Classes.tableExtendIcon, Classes.verticalScrollPlaceholder, Classes.tableFooter, Classes.verticalScrollPlaceholder, Classes.tableHeaderCellResize, Classes.tableHeaderRow, Classes.last, Classes.tableHeaderCellResize);
|
|
172
|
+
var StyledArtTableWrapper = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\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 // \u8868\u683C\u4E0D\u542F\u7528\u8FB9\u6846\u7EBF\uFF0C\u9690\u85CFth\u3001td\u7684\u5355\u5143\u683C\u5DE6\u53F3\u8FB9\u6846\u7EBF\n &:not(.", ") {\n ", "\n }\n &.", "{\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: 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 user-select:none;\n }\n\n .", " {\n user-select:none;\n .", " .", " >td{\n cursor:move;\n }\n\n .", " .", " >td{\n cursor:no-drop;\n }\n \n }\n\n .", "{\n opacity: 0.5;\n }\n\n\n .", " td{\n border-top: 1px solid var(--primary-color) !important;\n }\n\n .", " td{\n border-bottom: 1px solid var(--primary-color) !important;\n \n }\n\n .", " {\n cursor:pointer;\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: var(--header-cell-border-vertical)\n }\n\n th.", " {\n border-right: var(--header-cell-border-vertical);\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 display: flex;\n }\n .", " {\n position: relative;\n }\n\n .", " {\n display: flex;\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 display:flex;\n background: var(--bgcolor);\n }\n .", "{\n height: 1px;\n flex-shrink: 0;\n border-top: 1px solid var(--border-color);\n }\n\n .", "{\n height: 1px;\n flex-shrink: 0;\n border-top: 1px solid var(--border-color);\n }\n .", " {\n overflow-y: hidden;\n overflow-x: auto;\n z-index: ", ";\n flex-shrink: 1;\n flex-grow: 0;\n border-top: 1px solid var(--border-color);\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: hidden;//\u5217\u5168\u90E8\u56FA\u5B9A\u65F6\uFF0C\u5B58\u5728\u53CC\u6A2A\u5411\u6EDA\u52A8\u6761\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 padding: 6px 4px;\n &:hover{\n background-color: #e5e5e5;\n }\n &:focus {\n outline: none\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 .", " {\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\n //#region \u62D6\u62FD\u5217\u5BBD\u5927\u5C0F\n .", "::after{\n background-color: var(--border-color);\n }\n //\u89E3\u51B3\u90E8\u5206\u6D4F\u89C8\u5668(chrome109)\u6700\u540E\u4E00\u4E2A\u5355\u5143\u683C\u7684\u5217\u5BBD\u62D6\u62FD\u533A\u57DF\u7EDD\u5BF9\u5B9A\u4F4D\u8D85\u51FA\u8868\u683C\uFF0C\u5BFC\u81F4\u8868\u683C\u7AD6\u5206\u5272\u7EBF\u65E0\u6CD5\u5BF9\u9F50\n .", " th.", " .", "{\n right: 0;\n width: 5px;\n &::after{\n left: 4px;\n }\n }\n //#endregion\n\n "])), variableConst, variableConst, outerBorderStyleMixin, Classes.artTableBordered, notBorderedStyleMixin, Classes.artTableBordered, borderedStyleMixin, Classes.artTable, Classes.tableHeader, Classes.tableHeaderCellContent, Classes.virtual, Classes.tableFooter, Classes.tableBody, Classes.tableFooter, Classes.tableRow, Classes.tableBody, Classes.tableFooter, Classes.tableCellRangeSelected, Classes.tableCellRangeTop, Classes.tableCellRangeLeft, Classes.tableCellRangeBottom, Classes.tableCellRangeRight, Classes.rangeSelection, Classes.rowDragging, Classes.tableBody, Classes.tableRow, Classes.tableFooter, Classes.tableRow, Classes.rowDragStart, Classes.rowDragEndToTop, Classes.rowDragEndToBottom, Classes.rowDragCell, 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.horizontalStickyScrollContainer, Classes.horizontalScrollLeftSpacer, Classes.horizontalScrollRightSpacer, Classes.stickyScroll, Z.scrollItem, Classes.stickyScrollItem, Classes.loadingWrapper, Classes.loadingContentWrapper, Classes.loadingIndicatorWrapper, Classes.loadingIndicator, Z.loadingIndicator, Classes.tableFilterTrigger, Classes.tableSortIcon, Classes.tableExtendIcon, Classes.verticalScrollPlaceholder, Classes.tableFooter, Classes.verticalScrollPlaceholder, Classes.tableHeaderCellResize, Classes.tableHeaderRow, Classes.last, Classes.tableHeaderCellResize);
|
|
166
173
|
|
|
167
174
|
exports.StyledArtTableWrapper = StyledArtTableWrapper;
|
|
168
175
|
var ButtonCSS = (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\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);
|
|
@@ -130,11 +130,11 @@ export declare class BaseTable extends React.Component<BaseTableProps, BaseTable
|
|
|
130
130
|
private artTableWrapperRef;
|
|
131
131
|
private domHelper;
|
|
132
132
|
private rootSubscription;
|
|
133
|
+
private resizeSubject;
|
|
133
134
|
private lastInfo;
|
|
134
135
|
private props$;
|
|
135
136
|
private hasScrollY;
|
|
136
137
|
private resizeObserver?;
|
|
137
|
-
private resizeSubject;
|
|
138
138
|
private offsetY;
|
|
139
139
|
/** @deprecated BaseTable.getDoms() 已经过时,请勿调用 */
|
|
140
140
|
getDoms(): TableDOMHelper;
|
|
@@ -154,6 +154,7 @@ export declare class BaseTable extends React.Component<BaseTableProps, BaseTable
|
|
|
154
154
|
private renderLockShadows;
|
|
155
155
|
private renderStickyScroll;
|
|
156
156
|
private getScrollBarWidth;
|
|
157
|
+
private getStickyScrollContainerStyle;
|
|
157
158
|
render(): JSX.Element;
|
|
158
159
|
componentDidMount(): void;
|
|
159
160
|
componentDidUpdate(prevProps: Readonly<BaseTableProps>, prevState: Readonly<BaseTableState>): void;
|
package/lib/table/base/table.js
CHANGED
|
@@ -113,9 +113,7 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
113
113
|
_this = _super.call(this, props);
|
|
114
114
|
_this.rowHeightManager = (0, _rowHeightManager.makeRowHeightManager)(_this.props.dataSource.length, _this.props.estimatedRowHeight);
|
|
115
115
|
_this.artTableWrapperRef = /*#__PURE__*/_react.default.createRef();
|
|
116
|
-
_this.rootSubscription = new _rxjs.Subscription();
|
|
117
116
|
_this.hasScrollY = false;
|
|
118
|
-
_this.resizeSubject = new _rxjs.Subject();
|
|
119
117
|
_this.offsetY = 0;
|
|
120
118
|
|
|
121
119
|
_this.handleRowMouseEnter = function (e) {
|
|
@@ -182,7 +180,6 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
182
180
|
bottomBlank = _info$verticalRenderR.bottomBlank,
|
|
183
181
|
topBlank = _info$verticalRenderR.topBlank,
|
|
184
182
|
bottomIndex = _info$verticalRenderR.bottomIndex;
|
|
185
|
-
var stickyRightOffset = _this.hasScrollY ? _this.getScrollBarWidth() : 0;
|
|
186
183
|
var renderBody = (0, _renderTemplates.default)('body');
|
|
187
184
|
|
|
188
185
|
if (typeof renderBody === 'function') {
|
|
@@ -190,8 +187,7 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
190
187
|
rowProps: {
|
|
191
188
|
onMouseEnter: _this.handleRowMouseEnter,
|
|
192
189
|
onMouseLeave: _this.handleRowMouseLeave
|
|
193
|
-
}
|
|
194
|
-
stickyRightOffset: stickyRightOffset
|
|
190
|
+
}
|
|
195
191
|
});
|
|
196
192
|
}
|
|
197
193
|
|
|
@@ -212,7 +208,6 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
212
208
|
getRowProps: getRowProps,
|
|
213
209
|
primaryKey: primaryKey,
|
|
214
210
|
data: (0, _slice.default)(dataSource).call(dataSource, topIndex, bottomIndex),
|
|
215
|
-
stickyRightOffset: stickyRightOffset,
|
|
216
211
|
horizontalRenderInfo: info,
|
|
217
212
|
verticalRenderInfo: {
|
|
218
213
|
first: 0,
|
|
@@ -273,6 +268,9 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
273
268
|
var tableBodyHtmlTable = this.domHelper.getTableBodyHtmlTable();
|
|
274
269
|
var innerTableWidth = tableBodyHtmlTable.offsetWidth;
|
|
275
270
|
var artTableWidth = artTable.offsetWidth;
|
|
271
|
+
var artTableHeight = artTable.offsetHeight; // 表格隐藏后,不需要对表格的滚动条做额外的逻辑处理
|
|
272
|
+
|
|
273
|
+
if (artTableWidth === 0 && artTableHeight === 0) return;
|
|
276
274
|
var stickyScrollHeightProp = this.props.stickyScrollHeight;
|
|
277
275
|
var stickyScrollHeight = stickyScrollHeightProp === 'auto' ? this.getScrollBarWidth() : stickyScrollHeightProp; // stickyScroll.style.marginTop = `-${stickyScrollHeight + 1}px`
|
|
278
276
|
// 设置滚动条高度
|
|
@@ -302,10 +300,10 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
302
300
|
// }
|
|
303
301
|
this.hasScrollY = true;
|
|
304
302
|
} else {
|
|
305
|
-
stickyScroll.style.paddingRight =
|
|
303
|
+
// stickyScroll.style.paddingRight = `${stickyScrollHeight}px`
|
|
304
|
+
// this.setState({
|
|
306
305
|
// hasScrollY: false
|
|
307
306
|
// })
|
|
308
|
-
|
|
309
307
|
this.hasScrollY = false;
|
|
310
308
|
}
|
|
311
309
|
|
|
@@ -316,9 +314,10 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
316
314
|
var _this$lastInfo = this.lastInfo,
|
|
317
315
|
leftLockTotalWidth = _this$lastInfo.leftLockTotalWidth,
|
|
318
316
|
rightLockTotalWidth = _this$lastInfo.rightLockTotalWidth;
|
|
319
|
-
var lockTotalWidth = leftLockTotalWidth + rightLockTotalWidth;
|
|
317
|
+
var lockTotalWidth = leftLockTotalWidth + rightLockTotalWidth;
|
|
318
|
+
var stickyRightOffset = this.hasScrollY ? this.getScrollBarWidth() : 0; // 设置子节点宽度
|
|
320
319
|
|
|
321
|
-
stickyScrollItem.style.width = "".concat(innerTableWidth - lockTotalWidth, "px");
|
|
320
|
+
stickyScrollItem.style.width = "".concat(innerTableWidth - lockTotalWidth + stickyRightOffset, "px");
|
|
322
321
|
}
|
|
323
322
|
}, {
|
|
324
323
|
key: "renderTableHeader",
|
|
@@ -327,9 +326,12 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
327
326
|
stickyTop = _this$props3.stickyTop,
|
|
328
327
|
hasHeader = _this$props3.hasHeader;
|
|
329
328
|
var renderHeader = (0, _renderTemplates.default)('header');
|
|
329
|
+
var stickyRightOffset = this.hasScrollY ? this.getScrollBarWidth() : 0;
|
|
330
330
|
|
|
331
331
|
if (typeof renderHeader === 'function') {
|
|
332
|
-
return renderHeader(info, this.props
|
|
332
|
+
return renderHeader(info, this.props, {
|
|
333
|
+
stickyRightOffset: stickyRightOffset
|
|
334
|
+
});
|
|
333
335
|
}
|
|
334
336
|
|
|
335
337
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -339,7 +341,8 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
339
341
|
display: hasHeader ? undefined : 'none'
|
|
340
342
|
}
|
|
341
343
|
}, /*#__PURE__*/_react.default.createElement(_header.default, {
|
|
342
|
-
info: info
|
|
344
|
+
info: info,
|
|
345
|
+
stickyRightOffset: stickyRightOffset
|
|
343
346
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
344
347
|
className: _styles.Classes.verticalScrollPlaceholder,
|
|
345
348
|
style: this.hasScrollY ? {
|
|
@@ -419,6 +422,7 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
419
422
|
getRowProps = _this$props4.getRowProps,
|
|
420
423
|
primaryKey = _this$props4.primaryKey,
|
|
421
424
|
stickyBottom = _this$props4.stickyBottom;
|
|
425
|
+
var stickyRightOffset = this.hasScrollY ? this.getScrollBarWidth() : 0;
|
|
422
426
|
var renderFooter = (0, _renderTemplates.default)('footer');
|
|
423
427
|
|
|
424
428
|
if (typeof renderFooter === 'function') {
|
|
@@ -426,7 +430,8 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
426
430
|
rowProps: {
|
|
427
431
|
onMouseEnter: this.handleRowMouseEnter,
|
|
428
432
|
onMouseLeave: this.handleRowMouseLeave
|
|
429
|
-
}
|
|
433
|
+
},
|
|
434
|
+
stickyRightOffset: stickyRightOffset
|
|
430
435
|
});
|
|
431
436
|
}
|
|
432
437
|
|
|
@@ -440,6 +445,7 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
440
445
|
data: footerDataSource,
|
|
441
446
|
horizontalRenderInfo: info,
|
|
442
447
|
getRowProps: getRowProps,
|
|
448
|
+
stickyRightOffset: stickyRightOffset,
|
|
443
449
|
primaryKey: primaryKey,
|
|
444
450
|
verticalRenderInfo: {
|
|
445
451
|
offset: 0,
|
|
@@ -458,7 +464,8 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
458
464
|
}, {
|
|
459
465
|
key: "renderLockShadows",
|
|
460
466
|
value: function renderLockShadows(info) {
|
|
461
|
-
// console.log('render LockShadows')
|
|
467
|
+
var stickyRightOffset = this.hasScrollY ? this.getScrollBarWidth() : 0; // console.log('render LockShadows')
|
|
468
|
+
|
|
462
469
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
463
470
|
className: _styles.Classes.lockShadowMask,
|
|
464
471
|
style: {
|
|
@@ -471,7 +478,7 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
471
478
|
className: _styles.Classes.lockShadowMask,
|
|
472
479
|
style: {
|
|
473
480
|
right: 0,
|
|
474
|
-
width: info.rightLockTotalWidth + _styles.LOCK_SHADOW_PADDING
|
|
481
|
+
width: info.rightLockTotalWidth + _styles.LOCK_SHADOW_PADDING + stickyRightOffset
|
|
475
482
|
}
|
|
476
483
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
477
484
|
className: (0, _classnames.default)(_styles.Classes.lockShadow, _styles.Classes.rightLockShadow)
|
|
@@ -485,17 +492,21 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
485
492
|
hasStickyScroll = _this$props5.hasStickyScroll,
|
|
486
493
|
stickyBottom = _this$props5.stickyBottom;
|
|
487
494
|
var hasScroll = this.state.hasScroll;
|
|
495
|
+
var isScroll = hasStickyScroll && hasScroll;
|
|
496
|
+
var stickyScrollContainerStyle = this.getStickyScrollContainerStyle();
|
|
488
497
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
489
|
-
className: (0, _classnames.default)(_styles.Classes.horizontalScrollContainer, _styles.Classes.horizontalStickyScrollContainer)
|
|
498
|
+
className: (0, _classnames.default)(_styles.Classes.horizontalScrollContainer, _styles.Classes.horizontalStickyScrollContainer),
|
|
499
|
+
style: stickyScrollContainerStyle
|
|
490
500
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
491
501
|
className: (0, _classnames.default)(_styles.Classes.horizontalScrollLeftSpacer),
|
|
492
502
|
style: {
|
|
493
|
-
width: info.leftLockTotalWidth
|
|
503
|
+
width: info.leftLockTotalWidth,
|
|
504
|
+
display: isScroll ? 'block' : 'none'
|
|
494
505
|
}
|
|
495
506
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
496
507
|
className: (0, _classnames.default)(_styles.Classes.stickyScroll),
|
|
497
508
|
style: {
|
|
498
|
-
display:
|
|
509
|
+
display: isScroll ? 'block' : 'none',
|
|
499
510
|
bottom: stickyBottom
|
|
500
511
|
}
|
|
501
512
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -503,7 +514,8 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
503
514
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
504
515
|
className: (0, _classnames.default)(_styles.Classes.horizontalScrollRightSpacer),
|
|
505
516
|
style: {
|
|
506
|
-
width: info.rightLockTotalWidth
|
|
517
|
+
width: info.rightLockTotalWidth,
|
|
518
|
+
display: isScroll ? 'block' : 'none'
|
|
507
519
|
}
|
|
508
520
|
}));
|
|
509
521
|
}
|
|
@@ -512,6 +524,22 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
512
524
|
value: function getScrollBarWidth() {
|
|
513
525
|
return this.props.scrollbarWidth || (0, _utils.getScrollbarSize)().width;
|
|
514
526
|
}
|
|
527
|
+
}, {
|
|
528
|
+
key: "getStickyScrollContainerStyle",
|
|
529
|
+
value: function getStickyScrollContainerStyle() {
|
|
530
|
+
var _this$props6 = this.props,
|
|
531
|
+
hasStickyScroll = _this$props6.hasStickyScroll,
|
|
532
|
+
stickyScrollHeight = _this$props6.stickyScrollHeight;
|
|
533
|
+
var hasScroll = this.state.hasScroll;
|
|
534
|
+
var isScroll = hasStickyScroll && hasScroll;
|
|
535
|
+
var height = stickyScrollHeight === 'auto' ? this.getScrollBarWidth() : stickyScrollHeight;
|
|
536
|
+
var stickyHeight = isScroll ? height : 0;
|
|
537
|
+
return {
|
|
538
|
+
height: stickyHeight,
|
|
539
|
+
maxHeight: stickyHeight,
|
|
540
|
+
minHeight: stickyHeight
|
|
541
|
+
};
|
|
542
|
+
}
|
|
515
543
|
}, {
|
|
516
544
|
key: "render",
|
|
517
545
|
value: function render() {
|
|
@@ -520,20 +548,20 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
520
548
|
// console.log('render table')
|
|
521
549
|
var info = (0, _calculations.calculateRenderInfo)(this);
|
|
522
550
|
this.lastInfo = info;
|
|
523
|
-
var _this$
|
|
524
|
-
dataSource = _this$
|
|
525
|
-
className = _this$
|
|
526
|
-
style = _this$
|
|
527
|
-
hasHeader = _this$
|
|
528
|
-
useOuterBorder = _this$
|
|
529
|
-
isStickyHead = _this$
|
|
530
|
-
isStickyHeader = _this$
|
|
531
|
-
isStickyFooter = _this$
|
|
532
|
-
isLoading = _this$
|
|
533
|
-
getTableProps = _this$
|
|
534
|
-
footerDataSource = _this$
|
|
535
|
-
components = _this$
|
|
536
|
-
bordered = _this$
|
|
551
|
+
var _this$props7 = this.props,
|
|
552
|
+
dataSource = _this$props7.dataSource,
|
|
553
|
+
className = _this$props7.className,
|
|
554
|
+
style = _this$props7.style,
|
|
555
|
+
hasHeader = _this$props7.hasHeader,
|
|
556
|
+
useOuterBorder = _this$props7.useOuterBorder,
|
|
557
|
+
isStickyHead = _this$props7.isStickyHead,
|
|
558
|
+
isStickyHeader = _this$props7.isStickyHeader,
|
|
559
|
+
isStickyFooter = _this$props7.isStickyFooter,
|
|
560
|
+
isLoading = _this$props7.isLoading,
|
|
561
|
+
getTableProps = _this$props7.getTableProps,
|
|
562
|
+
footerDataSource = _this$props7.footerDataSource,
|
|
563
|
+
components = _this$props7.components,
|
|
564
|
+
bordered = _this$props7.bordered;
|
|
537
565
|
var artTableWrapperClassName = (0, _classnames.default)(_styles.Classes.artTableWrapper, (_cx = {
|
|
538
566
|
'use-outer-border': useOuterBorder,
|
|
539
567
|
empty: dataSource.length === 0,
|
|
@@ -559,20 +587,19 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
559
587
|
}, {
|
|
560
588
|
key: "componentDidMount",
|
|
561
589
|
value: function componentDidMount() {
|
|
562
|
-
var _a, _b, _c, _d, _e, _f;
|
|
563
|
-
// console.log('update dom helper start')
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
this.updateDOMHelper(); // console.log('update dom helper end')
|
|
590
|
+
var _a, _b, _c, _d, _e, _f;
|
|
567
591
|
|
|
592
|
+
this.rootSubscription = new _rxjs.Subscription();
|
|
593
|
+
this.resizeSubject = new _rxjs.Subject();
|
|
594
|
+
this.updateDOMHelper();
|
|
568
595
|
this.props$ = new _rxjs.BehaviorSubject(this.props);
|
|
569
596
|
this.initSubscriptions();
|
|
570
597
|
this.didMountOrUpdate(); // console.log('did mount end')
|
|
571
598
|
|
|
572
|
-
var _this$
|
|
573
|
-
cssVariables = _this$
|
|
574
|
-
enableCSSVariables = _this$
|
|
575
|
-
bordered = _this$
|
|
599
|
+
var _this$props8 = this.props,
|
|
600
|
+
cssVariables = _this$props8.cssVariables,
|
|
601
|
+
enableCSSVariables = _this$props8.enableCSSVariables,
|
|
602
|
+
bordered = _this$props8.bordered;
|
|
576
603
|
(0, _utils.cssPolifill)({
|
|
577
604
|
variables: cssVariables || {},
|
|
578
605
|
enableCSSVariables: enableCSSVariables,
|
|
@@ -588,10 +615,10 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
588
615
|
var _a; // console.log('did update start')
|
|
589
616
|
|
|
590
617
|
|
|
591
|
-
var _this$
|
|
592
|
-
cssVariables = _this$
|
|
593
|
-
enableCSSVariables = _this$
|
|
594
|
-
bordered = _this$
|
|
618
|
+
var _this$props9 = this.props,
|
|
619
|
+
cssVariables = _this$props9.cssVariables,
|
|
620
|
+
enableCSSVariables = _this$props9.enableCSSVariables,
|
|
621
|
+
bordered = _this$props9.bordered;
|
|
595
622
|
|
|
596
623
|
if (!(0, _utils.shallowEqual)(prevProps === null || prevProps === void 0 ? void 0 : prevProps.cssVariables, (_a = this.props) === null || _a === void 0 ? void 0 : _a.cssVariables)) {
|
|
597
624
|
(0, _utils.cssPolifill)({
|