@kdcloudjs/table 1.1.4 → 1.1.5-canary.10
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 +905 -346
- package/dist/@kdcloudjs/table.js.map +1 -1
- package/dist/@kdcloudjs/table.min.css +1 -1
- package/dist/@kdcloudjs/table.min.js +10 -9
- package/dist/@kdcloudjs/table.min.js.map +1 -1
- package/es/table/base/html-table.js +1 -1
- package/es/table/base/styles.d.ts +11 -2
- package/es/table/base/styles.js +19 -8
- package/es/table/base/table.d.ts +3 -1
- package/es/table/base/table.js +35 -56
- package/es/table/base/utils.d.ts +7 -0
- package/es/table/base/utils.js +36 -2
- package/es/table/common-views.js +1 -1
- package/es/table/pipeline/features/colGroupExtendable.d.ts +8 -0
- package/es/table/pipeline/features/colGroupExtendable.js +105 -0
- package/es/table/pipeline/features/columnDrag.js +5 -4
- package/es/table/pipeline/features/columnFilter.d.ts +8 -2
- package/es/table/pipeline/features/columnFilter.js +43 -19
- package/es/table/pipeline/features/columnResizeWidth.js +1 -1
- package/es/table/pipeline/features/contextMenu.d.ts +5 -1
- package/es/table/pipeline/features/contextMenu.js +18 -28
- package/es/table/pipeline/features/filter/DefaultFilterContent.js +27 -7
- package/es/table/pipeline/features/filter/DefaultFilterIcon.d.ts +5 -0
- package/es/table/pipeline/features/filter/DefaultFilterIcon.js +20 -0
- package/es/table/pipeline/features/filter/Filter.d.ts +5 -2
- package/es/table/pipeline/features/filter/Filter.js +65 -37
- package/es/table/pipeline/features/filter/FilterPanel.d.ts +2 -1
- package/es/table/pipeline/features/filter/FilterPanel.js +40 -21
- package/es/table/pipeline/features/filter/util.js +4 -4
- package/es/table/pipeline/features/footerDataSource.d.ts +9 -0
- package/es/table/pipeline/features/footerDataSource.js +25 -0
- package/es/table/pipeline/features/index.d.ts +2 -0
- package/es/table/pipeline/features/index.js +3 -1
- package/es/table/pipeline/features/multiSelect.js +7 -2
- package/es/table/pipeline/features/rangeSelection.d.ts +1 -1
- package/es/table/pipeline/features/rangeSelection.js +180 -30
- package/es/table/pipeline/features/singleSelect.js +4 -0
- package/es/table/pipeline/features/treeMode.d.ts +2 -0
- package/es/table/pipeline/features/treeMode.js +20 -21
- package/es/table/pipeline/pipeline.d.ts +1 -1
- package/es/table/pipeline/pipeline.js +4 -9
- package/es/table/utils/element.d.ts +1 -0
- package/es/table/utils/element.js +4 -0
- package/es/table/utils/keyCode.d.ts +5 -0
- package/es/table/utils/keyCode.js +5 -0
- package/es/table/utils/mergeCellProps.js +2 -6
- package/lib/table/base/html-table.js +1 -1
- package/lib/table/base/styles.d.ts +11 -2
- package/lib/table/base/styles.js +19 -8
- package/lib/table/base/table.d.ts +3 -1
- package/lib/table/base/table.js +35 -56
- package/lib/table/base/utils.d.ts +7 -0
- package/lib/table/base/utils.js +43 -2
- package/lib/table/common-views.js +1 -1
- package/lib/table/pipeline/features/colGroupExtendable.d.ts +8 -0
- package/lib/table/pipeline/features/colGroupExtendable.js +126 -0
- package/lib/table/pipeline/features/columnDrag.js +5 -4
- package/lib/table/pipeline/features/columnFilter.d.ts +8 -2
- package/lib/table/pipeline/features/columnFilter.js +41 -19
- package/lib/table/pipeline/features/columnResizeWidth.js +1 -1
- package/lib/table/pipeline/features/contextMenu.d.ts +5 -1
- package/lib/table/pipeline/features/contextMenu.js +17 -28
- package/lib/table/pipeline/features/filter/DefaultFilterContent.js +28 -6
- package/lib/table/pipeline/features/filter/DefaultFilterIcon.d.ts +5 -0
- package/lib/table/pipeline/features/filter/DefaultFilterIcon.js +30 -0
- package/lib/table/pipeline/features/filter/Filter.d.ts +5 -2
- package/lib/table/pipeline/features/filter/Filter.js +68 -37
- package/lib/table/pipeline/features/filter/FilterPanel.d.ts +2 -1
- package/lib/table/pipeline/features/filter/FilterPanel.js +42 -20
- package/lib/table/pipeline/features/filter/util.js +4 -4
- package/lib/table/pipeline/features/footerDataSource.d.ts +9 -0
- package/lib/table/pipeline/features/footerDataSource.js +41 -0
- package/lib/table/pipeline/features/index.d.ts +2 -0
- package/lib/table/pipeline/features/index.js +23 -1
- package/lib/table/pipeline/features/multiSelect.js +6 -1
- package/lib/table/pipeline/features/rangeSelection.d.ts +1 -1
- package/lib/table/pipeline/features/rangeSelection.js +183 -32
- package/lib/table/pipeline/features/singleSelect.js +4 -0
- package/lib/table/pipeline/features/treeMode.d.ts +2 -0
- package/lib/table/pipeline/features/treeMode.js +21 -23
- package/lib/table/pipeline/pipeline.d.ts +1 -1
- package/lib/table/pipeline/pipeline.js +4 -9
- package/lib/table/utils/element.d.ts +1 -0
- package/lib/table/utils/element.js +6 -0
- package/lib/table/utils/keyCode.d.ts +5 -0
- package/lib/table/utils/keyCode.js +12 -0
- package/lib/table/utils/mergeCellProps.js +2 -6
- package/package.json +3 -3
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
1
2
|
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
2
3
|
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
3
|
-
import _toArray from "@babel/runtime-corejs3/helpers/toArray";
|
|
4
4
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
5
5
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
6
6
|
import _toConsumableArray from "@babel/runtime-corejs3/helpers/toConsumableArray";
|
|
7
7
|
|
|
8
8
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
9
9
|
|
|
10
|
-
function _unsupportedIterableToArray(o, minLen) { var
|
|
10
|
+
function _unsupportedIterableToArray(o, minLen) { var _context2; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context2 = Object.prototype.toString.call(o)).call(_context2, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
11
|
|
|
12
12
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
13
13
|
|
|
@@ -15,7 +15,7 @@ import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
|
15
15
|
import _Set from "@babel/runtime-corejs3/core-js-stable/set";
|
|
16
16
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
17
17
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
18
|
-
import
|
|
18
|
+
import _findIndexInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find-index";
|
|
19
19
|
import cx from 'classnames';
|
|
20
20
|
import React from 'react';
|
|
21
21
|
import { ExpansionCell, icons, InlineFlexCell } from '../../common-views';
|
|
@@ -31,11 +31,6 @@ export function treeMode() {
|
|
|
31
31
|
var stateKey = 'treeMode';
|
|
32
32
|
var ctx = pipeline.ctx;
|
|
33
33
|
var primaryKey = pipeline.ensurePrimaryKey('treeMode');
|
|
34
|
-
|
|
35
|
-
if (typeof primaryKey !== 'string') {
|
|
36
|
-
throw new Error('treeMode 仅支持字符串作为 primaryKey');
|
|
37
|
-
}
|
|
38
|
-
|
|
39
34
|
var openKeys = (_c = (_b = (_a = opts.openKeys) !== null && _a !== void 0 ? _a : pipeline.getStateAtKey(stateKey)) !== null && _b !== void 0 ? _b : opts.defaultOpenKeys) !== null && _c !== void 0 ? _c : [];
|
|
40
35
|
var openKeySet = new _Set(openKeys);
|
|
41
36
|
|
|
@@ -90,7 +85,7 @@ export function treeMode() {
|
|
|
90
85
|
try {
|
|
91
86
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
92
87
|
var node = _step.value;
|
|
93
|
-
var rowKey = node
|
|
88
|
+
var rowKey = internals.safeGetRowKey(primaryKey, node, -1);
|
|
94
89
|
var expanded = openKeySet.has(rowKey);
|
|
95
90
|
var isLeaf = isLeafNode(node, {
|
|
96
91
|
depth: depth,
|
|
@@ -120,18 +115,20 @@ export function treeMode() {
|
|
|
120
115
|
}
|
|
121
116
|
|
|
122
117
|
function processColumns(columns) {
|
|
123
|
-
var _context2;
|
|
124
|
-
|
|
125
118
|
if (columns.length === 0) {
|
|
126
119
|
return columns;
|
|
127
120
|
}
|
|
128
121
|
|
|
129
|
-
var
|
|
130
|
-
|
|
131
|
-
|
|
122
|
+
var expandColIndex = _findIndexInstanceProperty(columns).call(columns, function (_ref) {
|
|
123
|
+
var code = _ref.code;
|
|
124
|
+
return code && opts.expandColCode === code;
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
expandColIndex = expandColIndex === -1 ? 0 : expandColIndex;
|
|
128
|
+
var expandCol = columns[expandColIndex];
|
|
132
129
|
|
|
133
130
|
var render = function render(value, record, recordIndex) {
|
|
134
|
-
var content = internals.safeRender(
|
|
131
|
+
var content = internals.safeRender(expandCol, record, recordIndex);
|
|
135
132
|
|
|
136
133
|
if (record[treeMetaKey] == null) {
|
|
137
134
|
// 没有 treeMeta 信息的话,就返回原先的渲染结果
|
|
@@ -191,7 +188,7 @@ export function treeMode() {
|
|
|
191
188
|
};
|
|
192
189
|
|
|
193
190
|
var getCellProps = function getCellProps(value, record, rowIndex) {
|
|
194
|
-
var prevProps = internals.safeGetCellProps(
|
|
191
|
+
var prevProps = internals.safeGetCellProps(expandCol, record, rowIndex);
|
|
195
192
|
|
|
196
193
|
if (record[treeMetaKey] == null) {
|
|
197
194
|
// 没有 treeMeta 信息的话,就返回原先的 cellProps
|
|
@@ -220,15 +217,17 @@ export function treeMode() {
|
|
|
220
217
|
});
|
|
221
218
|
};
|
|
222
219
|
|
|
223
|
-
|
|
220
|
+
columns[expandColIndex] = _extends(_extends({}, expandCol), {
|
|
224
221
|
title: /*#__PURE__*/React.createElement("span", {
|
|
225
222
|
style: {
|
|
226
|
-
marginLeft: iconIndent + iconWidth + iconGap
|
|
223
|
+
marginLeft: iconIndent + iconWidth + iconGap,
|
|
224
|
+
display: 'flex'
|
|
227
225
|
}
|
|
228
|
-
}, internals.safeRenderHeader(
|
|
226
|
+
}, internals.safeRenderHeader(expandCol)),
|
|
229
227
|
render: render,
|
|
230
|
-
getCellProps: clickArea === 'cell' ? getCellProps :
|
|
231
|
-
})
|
|
228
|
+
getCellProps: clickArea === 'cell' ? getCellProps : expandCol.getCellProps
|
|
229
|
+
});
|
|
230
|
+
return _toConsumableArray(columns);
|
|
232
231
|
}
|
|
233
232
|
};
|
|
234
233
|
}
|
|
@@ -36,7 +36,7 @@ export declare class TablePipeline {
|
|
|
36
36
|
private _tableProps;
|
|
37
37
|
private _dataSource;
|
|
38
38
|
private _columns;
|
|
39
|
-
private _footerDataSource
|
|
39
|
+
private _footerDataSource?;
|
|
40
40
|
static defaultIndents: TablePipelineIndentsConfig;
|
|
41
41
|
readonly ctx: TablePipelineCtx;
|
|
42
42
|
private readonly state;
|
|
@@ -276,16 +276,11 @@ export var TablePipeline = /*#__PURE__*/function () {
|
|
|
276
276
|
|
|
277
277
|
result.setTableDomHelper = function (domHelper) {
|
|
278
278
|
_this2.ref.current.domHelper = domHelper;
|
|
279
|
-
};
|
|
280
|
-
// result.clearRangeSelectionStatus = () => {
|
|
281
|
-
// const { rangeSelectedChange } = this.getFeatureOptions(rangeSelectionKey)
|
|
282
|
-
// const rangeSelection = this.getStateAtKey(rangeSelectionKey)
|
|
283
|
-
// if (rangeSelection) {
|
|
284
|
-
// rangeSelectedChange?.(null)
|
|
285
|
-
// }
|
|
286
|
-
// }
|
|
287
|
-
// }
|
|
279
|
+
};
|
|
288
280
|
|
|
281
|
+
result.setRowHeightManager = function (rowHeightManager) {
|
|
282
|
+
_this2.ref.current.rowHeightManager = rowHeightManager;
|
|
283
|
+
};
|
|
289
284
|
|
|
290
285
|
return result;
|
|
291
286
|
}
|
|
@@ -225,4 +225,8 @@ export function keepWithinBounds(popupParent, popup, x, y, isPerfect) {
|
|
|
225
225
|
x: x,
|
|
226
226
|
y: y
|
|
227
227
|
};
|
|
228
|
+
}
|
|
229
|
+
export function hasScroll(ele) {
|
|
230
|
+
var isHorizontal = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
231
|
+
return isHorizontal ? ele.scrollWidth > ele.clientWidth : ele.scrollHeight > ele.clientHeight;
|
|
228
232
|
}
|
|
@@ -5,13 +5,9 @@ import cx from 'classnames';
|
|
|
5
5
|
|
|
6
6
|
function composeEventHandler(handler1, handler2) {
|
|
7
7
|
return function () {
|
|
8
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
9
|
-
args[_key] = arguments[_key];
|
|
10
|
-
}
|
|
11
|
-
|
|
12
8
|
// 先执行原有的事件回调函数
|
|
13
|
-
handler1(
|
|
14
|
-
handler2(
|
|
9
|
+
handler1.apply(void 0, arguments);
|
|
10
|
+
handler2.apply(void 0, arguments); // 事件回调函数没有返回值,故这里不进行 return
|
|
15
11
|
};
|
|
16
12
|
}
|
|
17
13
|
/** 合并两个 cellProps(单元格属性)对象,返回一个合并后的全新对象。
|
|
@@ -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) - stickyRightOffset;
|
|
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)({
|
|
@@ -2,6 +2,7 @@ export declare const LOCK_SHADOW_PADDING = 20;
|
|
|
2
2
|
export declare const Classes: {
|
|
3
3
|
/** BaseTable 表格组件的外层包裹 div */
|
|
4
4
|
readonly artTableWrapper: string;
|
|
5
|
+
readonly artTableBordered: string;
|
|
5
6
|
readonly artTable: string;
|
|
6
7
|
readonly tableHeaderMain: string;
|
|
7
8
|
readonly tableHeader: string;
|
|
@@ -37,9 +38,12 @@ export declare const Classes: {
|
|
|
37
38
|
readonly tableHeaderCellLine: string;
|
|
38
39
|
readonly tableFilterTrigger: string;
|
|
39
40
|
readonly tableSortIcon: string;
|
|
41
|
+
readonly tableExtendIcon: string;
|
|
40
42
|
readonly button: string;
|
|
41
43
|
readonly buttonPrimary: string;
|
|
42
44
|
readonly filterIcon: string;
|
|
45
|
+
readonly rangeSelection: string;
|
|
46
|
+
readonly tableCellRangeSingleCell: string;
|
|
43
47
|
readonly tableCellRangeSelected: string;
|
|
44
48
|
readonly tableCellRangeTop: string;
|
|
45
49
|
readonly tableCellRangeLeft: string;
|
|
@@ -60,6 +64,9 @@ export declare const Classes: {
|
|
|
60
64
|
readonly leaf: string;
|
|
61
65
|
readonly expanded: string;
|
|
62
66
|
readonly collapsed: string;
|
|
67
|
+
readonly popup: string;
|
|
68
|
+
readonly popupHeader: string;
|
|
69
|
+
readonly popupBody: string;
|
|
63
70
|
};
|
|
64
71
|
export declare const MenuClasses: {
|
|
65
72
|
menu: string;
|
|
@@ -112,13 +119,13 @@ export declare type BaseTableCSSVariables = Partial<{
|
|
|
112
119
|
'--border-color': string;
|
|
113
120
|
/** 单元格边框,默认为 1px solid #dfe3e8 */
|
|
114
121
|
'--cell-border': string;
|
|
115
|
-
/** 单元格上下边框,默认为 #dfe3e8 */
|
|
122
|
+
/** 单元格上下边框,默认为 none ,默认值为 1px solid #dfe3e8 */
|
|
116
123
|
'--cell-border-horizontal': string;
|
|
117
124
|
/** 单元格左右边框,默认为 #dfe3e8 */
|
|
118
125
|
'--cell-border-vertical': string;
|
|
119
126
|
/** 表头单元格边框,默认为 1px solid #dfe3e8 */
|
|
120
127
|
'--header-cell-border': string;
|
|
121
|
-
/** 表头单元格上下边框,默认为 1px solid #dfe3e8 */
|
|
128
|
+
/** 表头单元格上下边框,默认为 none ,默认值为 1px solid #dfe3e8 */
|
|
122
129
|
'--header-cell-border-horizontal': string;
|
|
123
130
|
/** 表头单元格左右边框,默认为 1px solid #dfe3e8 */
|
|
124
131
|
'--header-cell-border-vertical': string;
|
|
@@ -148,7 +155,9 @@ export declare const defaultCSSVariables: {
|
|
|
148
155
|
'--cell-border-horizontal': string;
|
|
149
156
|
'---cell-border-vertical': string;
|
|
150
157
|
'--header-cell-border': string;
|
|
158
|
+
'--cell-border-vertical': string;
|
|
151
159
|
'--header-cell-border-horizontal': string;
|
|
160
|
+
'--header-cell-border-vertical': string;
|
|
152
161
|
};
|
|
153
162
|
export declare const variableConst: string;
|
|
154
163
|
export declare const StyledArtTableWrapper: any;
|
package/lib/table/base/styles.js
CHANGED
|
@@ -21,7 +21,7 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime-cor
|
|
|
21
21
|
|
|
22
22
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
23
23
|
|
|
24
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
24
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
25
25
|
|
|
26
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
27
|
|
|
@@ -33,6 +33,7 @@ var prefix = 'kd-';
|
|
|
33
33
|
var Classes = {
|
|
34
34
|
/** BaseTable 表格组件的外层包裹 div */
|
|
35
35
|
artTableWrapper: "".concat(prefix, "table-wrapper"),
|
|
36
|
+
artTableBordered: "".concat(prefix, "table-bordered"),
|
|
36
37
|
artTable: "".concat(prefix, "table"),
|
|
37
38
|
tableHeaderMain: "".concat(prefix, "table-header-main"),
|
|
38
39
|
tableHeader: "".concat(prefix, "table-header"),
|
|
@@ -73,9 +74,12 @@ var Classes = {
|
|
|
73
74
|
tableHeaderCellLine: "".concat(prefix, "table-header-cell-line"),
|
|
74
75
|
tableFilterTrigger: "".concat(prefix, "filter-trigger"),
|
|
75
76
|
tableSortIcon: "".concat(prefix, "sort-icon"),
|
|
77
|
+
tableExtendIcon: "".concat(prefix, "extend-icon"),
|
|
76
78
|
button: "".concat(prefix, "btn"),
|
|
77
79
|
buttonPrimary: "".concat(prefix, "btn-primary"),
|
|
78
80
|
filterIcon: "".concat(prefix, "filter-icon"),
|
|
81
|
+
rangeSelection: "".concat(prefix, "range-selection"),
|
|
82
|
+
tableCellRangeSingleCell: "".concat(prefix, "table-cell-range-single-cell"),
|
|
79
83
|
tableCellRangeSelected: "".concat(prefix, "table-cell-range-selected"),
|
|
80
84
|
tableCellRangeTop: "".concat(prefix, "table-cell-range-top"),
|
|
81
85
|
tableCellRangeLeft: "".concat(prefix, "table-cell-range-left"),
|
|
@@ -95,7 +99,10 @@ var Classes = {
|
|
|
95
99
|
rowSpan: "".concat(prefix, "row-span"),
|
|
96
100
|
leaf: "".concat(prefix, "leaf"),
|
|
97
101
|
expanded: "".concat(prefix, "expanded"),
|
|
98
|
-
collapsed: "".concat(prefix, "collapsed")
|
|
102
|
+
collapsed: "".concat(prefix, "collapsed"),
|
|
103
|
+
popup: "".concat(prefix, "popup"),
|
|
104
|
+
popupHeader: "".concat(prefix, "popup-header"),
|
|
105
|
+
popupBody: "".concat(prefix, "popup-body")
|
|
99
106
|
};
|
|
100
107
|
exports.Classes = Classes;
|
|
101
108
|
var MenuClasses = {
|
|
@@ -116,17 +123,17 @@ var Z = {
|
|
|
116
123
|
scrollItem: 30,
|
|
117
124
|
loadingIndicator: 40
|
|
118
125
|
};
|
|
119
|
-
var outerBorderStyleMixin = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border-top: 1px solid #cccccc;\n border-right: 1px solid #cccccc;\n border-bottom: 1px solid #cccccc;\n border-left: 1px solid #cccccc;\n\n td.", ",\n th.", " {\n border-left: none;\n }\n td.", ",\n th.", " {\n
|
|
126
|
+
var outerBorderStyleMixin = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border-top: 1px solid #cccccc;\n border-right: 1px solid #cccccc;\n border-bottom: 1px solid #cccccc;\n border-left: 1px solid #cccccc;\n\n td.", ",\n th.", " {\n border-left: none;\n }\n td.", ",\n th.", " {\n border-right: none;\n }\n\n thead tr.", " th,\n tbody tr.", " td {\n border-top: none;\n }\n &.has-footer tfoot tr.", " td {\n border-bottom: none;\n }\n &:not(.has-footer) tbody tr.", " td {\n border-bottom: none;\n }\n td.", ":not(.", "){\n border-left: var(---cell-border-vertical);\n }\n td.", ":not(.", "){\n border-right: var(---cell-border-vertical);\n }\n"])), Classes.first, Classes.first, Classes.last, Classes.last, Classes.first, Classes.first, Classes.last, Classes.last, Classes.rowSpan, Classes.first, Classes.rowSpan, Classes.last);
|
|
120
127
|
var defaultCSSVariables = {
|
|
121
128
|
'--row-height': '48px',
|
|
122
129
|
'--color': '#333',
|
|
123
130
|
'--bgcolor': 'white',
|
|
124
|
-
'--hover-bgcolor': 'var(--hover-color, #
|
|
131
|
+
'--hover-bgcolor': 'var(--hover-color, #f5f5f5)',
|
|
125
132
|
'--highlight-bgcolor': '#eee',
|
|
126
133
|
'--primary-color': '#5582F3',
|
|
127
134
|
'--primary-color-level1': 'rgb(242, 248, 255)',
|
|
128
135
|
'--primary-color-level2': 'rgb(135, 173, 255)',
|
|
129
|
-
'--icon-color': '#
|
|
136
|
+
'--icon-color': '#666666',
|
|
130
137
|
'--strong-border-color': '#d9d9d9',
|
|
131
138
|
'--header-row-height': '32px',
|
|
132
139
|
'--header-color': '#333',
|
|
@@ -142,16 +149,20 @@ var defaultCSSVariables = {
|
|
|
142
149
|
'--cell-border-horizontal': '1px solid #dfe3e8',
|
|
143
150
|
'---cell-border-vertical': '1px solid #dfe3e8',
|
|
144
151
|
'--header-cell-border': '1px solid #dfe3e8',
|
|
145
|
-
'--
|
|
152
|
+
'--cell-border-vertical': '1px solid #dfe3e8',
|
|
153
|
+
'--header-cell-border-horizontal': '1px solid #dfe3e8',
|
|
154
|
+
'--header-cell-border-vertical': '1px solid #dfe3e8'
|
|
146
155
|
};
|
|
147
156
|
exports.defaultCSSVariables = defaultCSSVariables;
|
|
148
157
|
var variableConst = getCssVariableText(defaultCSSVariables);
|
|
149
158
|
exports.variableConst = variableConst;
|
|
159
|
+
var notBorderedStyleMixin = (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n --cell-border-vertical: none;\n --header-cell-border-vertical: none;\n"])));
|
|
160
|
+
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);
|
|
150
161
|
|
|
151
|
-
var StyledArtTableWrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (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 .no-scrollbar {\n ::-webkit-scrollbar {\n display: none;\n }\n }\n\n .", " {\n overflow: auto;\n flex-shrink: 1;\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n user-select:none;\n }\n\n .", " {\n overflow: hidden;\n background: var(--header-bgcolor);\n display: flex;\n flex-shrink: 0;\n border-bottom: var(--header-cell-border-horizontal);\n }\n\n .", " {\n display: flex;\n // justify-content: flex-start;\n align-items: center;\n height: inherit;\n }\n\n .", " {\n overflow-x:auto;\n flex-shrink: 0;\n flex-grow: 0;\n scrollbar-width: none; // \u517C\u5BB9\u706B\u72D0\n & {\n ::-webkit-scrollbar {\n display:none;\n }\n }\n }\n\n .", " {\n display: flex;\n flex: none;\n }\n .", ", .", " {\n background: var(--bgcolor);\n overflow: auto;\n overflow-x: hidden;\n overflow-anchor: none;\n position:relative;\n &.empty {\n position: relative;\n }\n }\n\n .", " {\n position: relative;\n }\n .", " {\n .", "{\n background-color: #e6effb !important;\n }\n .", "{\n border-top: 1px solid #0E5FD8 !important;\n }\n .", "{\n border-left: 1px solid #0E5FD8 !important;\n }\n .", "{\n border-bottom: 1px solid #0E5FD8 !important;\n }\n .", "{\n border-right: 1px solid #0E5FD8 !important;\n }\n }\n\n\n &.sticky-header .", " {\n position: sticky;\n top: 0;\n z-index: ", ";\n }\n\n &.sticky-footer .", " {\n position: sticky;\n bottom: 0;\n z-index: ", ";\n }\n\n table {\n width: 0;\n table-layout: fixed;\n border-collapse: separate;\n border-spacing: 0;\n display: table;\n margin: 0;\n padding: 0;\n flex-shrink: 0;\n flex-grow: 0;\n position:relative;\n }\n\n // \u5728 tr \u4E0A\u8BBE\u7F6E .no-hover \u53EF\u4EE5\u7981\u7528\u9F20\u6807\u60AC\u505C\u6548\u679C\n tr:not(.no-hover):hover > td {\n background: var(--hover-bgcolor);\n }\n // \u4F7F\u7528 js \u6DFB\u52A0\u60AC\u6D6E\u6548\u679C\n tr:not(.no-hover).row-hover > td {\n background: var(--hover-bgcolor);\n }\n // \u5728 tr \u8BBE\u7F6E highlight \u53EF\u4EE5\u4E3A\u5E95\u4E0B\u7684 td \u8BBE\u7F6E\u4E3A\u9AD8\u4EAE\u8272\n // \u800C\u8BBE\u7F6E .no-highlight \u7684\u8BDD\u5219\u53EF\u4EE5\u7981\u7528\u9AD8\u4EAE\u6548\u679C\uFF1B\n tr:not(.no-highlight).highlight > td {\n background: var(--highlight-bgcolor);\n }\n\n th {\n font-weight: normal;\n text-align: left;\n padding: var(--cell-padding);\n height: var(--header-row-height);\n color: var(--header-color);\n background: var(--header-bgcolor);\n border:1px solid transparent;\n border-right: var(--header-cell-border-vertical);\n border-bottom: var(--header-cell-border-horizontal);\n position: relative;\n }\n\n th.resizeable{\n border-right:none\n }\n\n th.", " {\n border-right: none;\n border-bottom: none;\n }\n\n tr.", " th {\n border-top: var(--header-cell-border-horizontal);\n }\n th.", " {\n border-left: var(--header-cell-border-vertical);\n }\n\n td {\n padding: var(--cell-padding);\n background: var(--bgcolor);\n height: var(--row-height);\n border:1px solid transparent;\n border-right: var(--cell-border-vertical);\n border-bottom: var(--cell-border-horizontal);\n word-break: break-all;\n }\n td.", " {\n border-left: var(--cell-border-vertical);\n }\n tr.", " td {\n border-top: var(--cell-border-horizontal);\n }\n &.has-header tbody tr.", " td {\n border-top: none;\n }\n &.has-footer tbody tr.", " td {\n border-bottom: none;\n }\n\n .", ",\n .", " {\n z-index: ", ";\n }\n\n //#region \u9501\u5217\u9634\u5F71\n .", " {\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: ", ";\n pointer-events: none;\n overflow: hidden;\n\n .", " {\n height: 100%;\n }\n\n .", " {\n margin-right: ", "px;\n box-shadow: none;\n\n &.show-shadow {\n box-shadow: var(--lock-shadow);\n border-right: var(--cell-border-vertical);\n }\n }\n\n .", " {\n margin-left: ", "px;\n box-shadow: none;\n\n &.show-shadow {\n box-shadow: var(--lock-shadow);\n border-left: var(--cell-border-vertical);\n }\n }\n }\n //#endregion\n\n //#region \u7A7A\u8868\u683C\u5C55\u73B0\n .", " {\n pointer-events: none;\n color: #99a3b3;\n font-size: 12px;\n text-align: center;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n\n .empty-image {\n width: 50px;\n height: 50px;\n }\n\n .empty-tips {\n margin-top: 16px;\n line-height: 1.5;\n }\n }\n //#endregion\n\n //#region IE\u517C\u5BB9\n &.ie-polyfill-wrapper {\n //\u9501\u5B9A\u5217\u517C\u5BB9 \u4EC5\u5728\u9501\u5B9A\u5217\u7684\u60C5\u51B5\u4E0B\u751F\u6548\n .", " {\n overflow-x: hidden;\n }\n .", ", .", " {\n position:relative;\n }\n .", " {\n overflow: hidden;\n }\n .", " {\n position: relative;\n }\n\n .", " {\n overflow: auto;\n overflow-x: hidden;\n overflow-anchor: none;\n }\n\n .", ", .", "{\n position: absolute;\n z-index: ", ";\n top: 0;\n }\n .", "{\n left:0;\n }\n .", "{\n right:0;\n }\n\n .", "{\n .", "{\n position: absolute;\n top: 0;\n width: 100%;\n z-index: ", ";\n }\n }\n\n tr:not(.no-hover).row-hover > td {\n background: var(--hover-bgcolor);\n }\n }\n //#endregion\n\n //#region \u7C98\u6027\u6EDA\u52A8\u6761\n .", " {\n overflow-y: hidden;\n overflow-x: auto;\n z-index: ", ";\n flex-shrink: 0;\n flex-grow: 0;\n border-top: 1px solid var(--border-color);\n background: var(--bgcolor);\n }\n\n .", " {\n // \u5FC5\u987B\u6709\u9AD8\u5EA6\u624D\u80FD\u51FA\u73B0\u6EDA\u52A8\u6761\n height: 1px;\n visibility: hidden;\n }\n //#endregion\n\n //#region \u52A0\u8F7D\u6837\u5F0F\n .", " {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: auto;\n\n .", " {\n filter: none;\n width: 100%;\n height: 100%;\n overflow: auto;\n display: flex;\n position: relative;\n flex-direction: column;\n }\n\n .", " {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n pointer-events: none;\n }\n\n .", " {\n position: sticky;\n z-index: ", ";\n transform: translateY(-50%);\n }\n }\n //#endregion\n\n //#region \u8868\u683C\u8FC7\u6EE4\n .", " {\n color:var(--icon-color);\n &.active{\n color:var(--primary-color);\n }\n }\n //#endregion\n\n //#region \u8868\u683C\u6392\u5E8F\n .", " {\n color:var(--icon-color);\n &.active{\n color:var(--primary-color);\n }\n }\n //#endregion\n\n //#region \u6EDA\u52A8\u6761\u5360\u4F4D\n .", " {\n visibility: hidden;\n flex-shrink: 0;\n }\n .", " .", " {\n border-top: var(--cell-border-horizontal);\n }\n //#endregion\n "])), variableConst, variableConst, outerBorderStyleMixin, Classes.artTable, Classes.tableHeader, Classes.tableHeaderCellContent, Classes.virtual, Classes.tableFooter, Classes.tableBody, Classes.tableFooter, Classes.tableRow, Classes.tableBody, Classes.tableCellRangeSelected, Classes.tableCellRangeTop, Classes.tableCellRangeLeft, Classes.tableCellRangeBottom, Classes.tableCellRangeRight, Classes.tableHeader, Z.header, Classes.tableFooter, Z.footer, Classes.leaf, Classes.first, Classes.first, Classes.first, Classes.first, Classes.first, Classes.last, Classes.lockLeft, Classes.lockRight, Z.lock, Classes.lockShadowMask, Z.lockShadow, Classes.lockShadow, Classes.leftLockShadow, LOCK_SHADOW_PADDING, Classes.rightLockShadow, LOCK_SHADOW_PADDING, Classes.emptyWrapper, Classes.virtual, Classes.tableBody, Classes.tableFooter, Classes.tableHeaderMain, Classes.tableHeader, Classes.tableFooterMain, Classes.fixedLeft, Classes.fixedRight, Z.lock, Classes.fixedLeft, Classes.fixedRight, Classes.rowDetailContainer, Classes.rowDetailItem, Z.rowDetail, Classes.stickyScroll, Z.scrollItem, Classes.stickyScrollItem, Classes.loadingWrapper, Classes.loadingContentWrapper, Classes.loadingIndicatorWrapper, Classes.loadingIndicator, Z.loadingIndicator, Classes.tableFilterTrigger, Classes.tableSortIcon, Classes.verticalScrollPlaceholder, Classes.tableFooter, Classes.verticalScrollPlaceholder);
|
|
162
|
+
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 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: 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.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);
|
|
152
163
|
|
|
153
164
|
exports.StyledArtTableWrapper = StyledArtTableWrapper;
|
|
154
|
-
var ButtonCSS = (0, _styledComponents.css)(
|
|
165
|
+
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);
|
|
155
166
|
exports.ButtonCSS = ButtonCSS;
|
|
156
167
|
|
|
157
168
|
function getCssVariableText(obj) {
|
|
@@ -47,6 +47,8 @@ export interface BaseTableProps {
|
|
|
47
47
|
scrollbarWidth?: number;
|
|
48
48
|
/** 使用来自外层 div 的边框代替单元格的外边框 */
|
|
49
49
|
useOuterBorder?: boolean;
|
|
50
|
+
/** 显示表格单元格边框线 */
|
|
51
|
+
bordered?: boolean;
|
|
50
52
|
/** 表格是否在加载中 */
|
|
51
53
|
isLoading?: boolean;
|
|
52
54
|
/** 数据为空时,单元格的高度 */
|
|
@@ -75,7 +77,7 @@ export interface BaseTableProps {
|
|
|
75
77
|
getTableProps?(): React.HTMLAttributes<HTMLTableElement>;
|
|
76
78
|
setTableWidth?(tableWidth: number): void;
|
|
77
79
|
setTableDomHelper?(domHelper: TableDOMHelper): void;
|
|
78
|
-
|
|
80
|
+
setRowHeightManager?(rowHeightManager: any): void;
|
|
79
81
|
cssVariables?: {
|
|
80
82
|
[key: string]: any;
|
|
81
83
|
};
|
package/lib/table/base/table.js
CHANGED
|
@@ -31,6 +31,8 @@ var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable
|
|
|
31
31
|
|
|
32
32
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
|
33
33
|
|
|
34
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
35
|
+
|
|
34
36
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
35
37
|
|
|
36
38
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
@@ -43,8 +45,6 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
43
45
|
|
|
44
46
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
45
47
|
|
|
46
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
47
|
-
|
|
48
48
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
49
49
|
|
|
50
50
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -73,8 +73,6 @@ var _styles = require("./styles");
|
|
|
73
73
|
|
|
74
74
|
var _utils = require("./utils");
|
|
75
75
|
|
|
76
|
-
var _cssVarsPonyfill = _interopRequireDefault(require("css-vars-ponyfill"));
|
|
77
|
-
|
|
78
76
|
var _utils2 = require("../utils");
|
|
79
77
|
|
|
80
78
|
var _renderTemplates = _interopRequireDefault(require("./renderTemplates"));
|
|
@@ -83,7 +81,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "functi
|
|
|
83
81
|
|
|
84
82
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
85
83
|
|
|
86
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(
|
|
84
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
87
85
|
|
|
88
86
|
function _unsupportedIterableToArray(o, minLen) { var _context2; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty2(_context2 = Object.prototype.toString.call(o)).call(_context2, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
89
87
|
|
|
@@ -93,31 +91,6 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
93
91
|
|
|
94
92
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
95
93
|
|
|
96
|
-
var cssPolifill = function cssPolifill(_ref) {
|
|
97
|
-
var variables = _ref.variables,
|
|
98
|
-
enableCSSVariables = _ref.enableCSSVariables;
|
|
99
|
-
|
|
100
|
-
// const style = document.createElement('style')
|
|
101
|
-
// style.type = 'text/css'
|
|
102
|
-
// style.innerHTML = '.aaa{ --color: red; }'
|
|
103
|
-
// document.getElementsByTagName('head').item(0).appendChild(style)
|
|
104
|
-
// const variableNames = variableConst.match(/--.*?(?=:)/g)
|
|
105
|
-
// variables = variableNames.map((name) => rootElement.style[name])
|
|
106
|
-
if (enableCSSVariables === false) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
(0, _cssVarsPonyfill.default)({
|
|
111
|
-
// exclude: 'link[href*="semantic-ui"]',
|
|
112
|
-
// onlyLegacy: false,
|
|
113
|
-
// rootElement: rootElement,
|
|
114
|
-
include: 'style[data-styled]',
|
|
115
|
-
variables: (0, _extends2.default)({}, _styles.defaultCSSVariables, variables),
|
|
116
|
-
watch: true,
|
|
117
|
-
silent: true
|
|
118
|
-
});
|
|
119
|
-
};
|
|
120
|
-
|
|
121
94
|
var propsDotEmptyContentDeprecatedWarned = false;
|
|
122
95
|
|
|
123
96
|
function warnPropsDotEmptyContentIsDeprecated() {
|
|
@@ -526,6 +499,8 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
526
499
|
}, {
|
|
527
500
|
key: "render",
|
|
528
501
|
value: function render() {
|
|
502
|
+
var _cx;
|
|
503
|
+
|
|
529
504
|
// console.log('render table')
|
|
530
505
|
var info = (0, _calculations.calculateRenderInfo)(this);
|
|
531
506
|
this.lastInfo = info;
|
|
@@ -541,33 +516,34 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
541
516
|
isLoading = _this$props6.isLoading,
|
|
542
517
|
getTableProps = _this$props6.getTableProps,
|
|
543
518
|
footerDataSource = _this$props6.footerDataSource,
|
|
544
|
-
components = _this$props6.components
|
|
545
|
-
|
|
519
|
+
components = _this$props6.components,
|
|
520
|
+
bordered = _this$props6.bordered;
|
|
521
|
+
var artTableWrapperClassName = (0, _classnames.default)(_styles.Classes.artTableWrapper, (_cx = {
|
|
546
522
|
'use-outer-border': useOuterBorder,
|
|
547
523
|
empty: dataSource.length === 0,
|
|
548
524
|
lock: info.hasLockColumn,
|
|
549
525
|
'has-header': hasHeader,
|
|
550
526
|
'sticky-header': isStickyHeader !== null && isStickyHeader !== void 0 ? isStickyHeader : isStickyHead,
|
|
551
527
|
'has-footer': footerDataSource.length > 0,
|
|
552
|
-
'sticky-footer': isStickyFooter
|
|
553
|
-
|
|
554
|
-
}, className);
|
|
528
|
+
'sticky-footer': isStickyFooter
|
|
529
|
+
}, (0, _defineProperty2.default)(_cx, _styles.Classes.artTableBordered, bordered), (0, _defineProperty2.default)(_cx, 'ie-polyfill-wrapper', _utils2.browserType.isIE), _cx), className);
|
|
555
530
|
var artTableWrapperProps = (0, _defineProperty2.default)({
|
|
556
531
|
className: artTableWrapperClassName,
|
|
557
532
|
style: style
|
|
558
533
|
}, _utils.STYLED_REF_PROP, this.artTableWrapperRef);
|
|
534
|
+
var tableProps = getTableProps() || {};
|
|
559
535
|
return /*#__PURE__*/_react.default.createElement(_styles.StyledArtTableWrapper, (0, _extends2.default)({}, artTableWrapperProps), /*#__PURE__*/_react.default.createElement(_loading.default, {
|
|
560
536
|
visible: isLoading,
|
|
561
537
|
LoadingIcon: components.LoadingIcon,
|
|
562
538
|
LoadingContentWrapper: components.LoadingContentWrapper
|
|
563
|
-
}, /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
|
564
|
-
className: _styles.Classes.artTable
|
|
565
|
-
}
|
|
539
|
+
}, /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, tableProps, {
|
|
540
|
+
className: (0, _classnames.default)(_styles.Classes.artTable, tableProps.className)
|
|
541
|
+
}), this.renderTableHeader(info), this.renderTableBody(info), this.renderTableFooter(info), this.renderLockShadows(info)), this.renderStickyScroll(info)));
|
|
566
542
|
}
|
|
567
543
|
}, {
|
|
568
544
|
key: "componentDidMount",
|
|
569
545
|
value: function componentDidMount() {
|
|
570
|
-
var _a, _b, _c, _d; // console.log('did mount start')
|
|
546
|
+
var _a, _b, _c, _d, _e, _f; // console.log('did mount start')
|
|
571
547
|
// console.log('update dom helper start')
|
|
572
548
|
|
|
573
549
|
|
|
@@ -579,13 +555,16 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
579
555
|
|
|
580
556
|
var _this$props7 = this.props,
|
|
581
557
|
cssVariables = _this$props7.cssVariables,
|
|
582
|
-
enableCSSVariables = _this$props7.enableCSSVariables
|
|
583
|
-
|
|
558
|
+
enableCSSVariables = _this$props7.enableCSSVariables,
|
|
559
|
+
bordered = _this$props7.bordered;
|
|
560
|
+
(0, _utils.cssPolifill)({
|
|
584
561
|
variables: cssVariables || {},
|
|
585
|
-
enableCSSVariables: enableCSSVariables
|
|
562
|
+
enableCSSVariables: enableCSSVariables,
|
|
563
|
+
bordered: bordered
|
|
586
564
|
});
|
|
587
565
|
(_b = (_a = this.props).setTableWidth) === null || _b === void 0 ? void 0 : _b.call(_a, this.domHelper.tableBody.clientWidth);
|
|
588
566
|
(_d = (_c = this.props).setTableDomHelper) === null || _d === void 0 ? void 0 : _d.call(_c, this.domHelper);
|
|
567
|
+
(_f = (_e = this.props).setRowHeightManager) === null || _f === void 0 ? void 0 : _f.call(_e, this.rowHeightManager);
|
|
589
568
|
}
|
|
590
569
|
}, {
|
|
591
570
|
key: "componentDidUpdate",
|
|
@@ -618,7 +597,7 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
618
597
|
var currentHasFooter = this.props.footerDataSource.length > 0;
|
|
619
598
|
|
|
620
599
|
if (!prevHasFooter && currentHasFooter) {
|
|
621
|
-
(0, _utils.getTableScrollFooterDOM)(this.domHelper).scrollLeft = this.domHelper.
|
|
600
|
+
(0, _utils.getTableScrollFooterDOM)(this.domHelper).scrollLeft = this.domHelper.virtual.scrollLeft;
|
|
622
601
|
}
|
|
623
602
|
}
|
|
624
603
|
}
|
|
@@ -654,15 +633,15 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
654
633
|
|
|
655
634
|
this.rootSubscription.add((0, _rxjs.combineLatest)([richVisibleRects$.pipe(op.map(function (p) {
|
|
656
635
|
return p.clipRect;
|
|
657
|
-
}), op.distinctUntilChanged(_utils.shallowEqual)), this.props$.pipe(op.startWith(null), op.pairwise(), op.filter(function (
|
|
658
|
-
var
|
|
659
|
-
prevProps =
|
|
660
|
-
props =
|
|
636
|
+
}), op.distinctUntilChanged(_utils.shallowEqual)), this.props$.pipe(op.startWith(null), op.pairwise(), op.filter(function (_ref) {
|
|
637
|
+
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
638
|
+
prevProps = _ref2[0],
|
|
639
|
+
props = _ref2[1];
|
|
661
640
|
|
|
662
641
|
return prevProps == null || !prevProps.isLoading && props.isLoading;
|
|
663
|
-
}))]).subscribe(function (
|
|
664
|
-
var
|
|
665
|
-
clipRect =
|
|
642
|
+
}))]).subscribe(function (_ref3) {
|
|
643
|
+
var _ref4 = (0, _slicedToArray2.default)(_ref3, 1),
|
|
644
|
+
clipRect = _ref4[0];
|
|
666
645
|
|
|
667
646
|
var loadingIndicator = _this2.domHelper.getLoadingIndicator();
|
|
668
647
|
|
|
@@ -681,9 +660,9 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
681
660
|
horizontal = _this2$lastInfo$useVi.horizontal,
|
|
682
661
|
vertical = _this2$lastInfo$useVi.vertical;
|
|
683
662
|
return horizontal || vertical;
|
|
684
|
-
}), op.map(function (
|
|
685
|
-
var clipRect =
|
|
686
|
-
offsetY =
|
|
663
|
+
}), op.map(function (_ref5) {
|
|
664
|
+
var clipRect = _ref5.clipRect,
|
|
665
|
+
offsetY = _ref5.offsetY;
|
|
687
666
|
return {
|
|
688
667
|
maxRenderHeight: clipRect.bottom - clipRect.top,
|
|
689
668
|
maxRenderWidth: clipRect.right - clipRect.left,
|
|
@@ -700,9 +679,9 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
700
679
|
})).subscribe(function (sizeAndOffset) {
|
|
701
680
|
_this2.setState(sizeAndOffset);
|
|
702
681
|
}));
|
|
703
|
-
this.rootSubscription.add(richVisibleRects$.pipe(op.map(function (
|
|
704
|
-
var clipRect =
|
|
705
|
-
offsetY =
|
|
682
|
+
this.rootSubscription.add(richVisibleRects$.pipe(op.map(function (_ref6) {
|
|
683
|
+
var clipRect = _ref6.clipRect,
|
|
684
|
+
offsetY = _ref6.offsetY;
|
|
706
685
|
return {
|
|
707
686
|
maxRenderHeight: clipRect.bottom - clipRect.top,
|
|
708
687
|
maxRenderWidth: clipRect.right - clipRect.left,
|
|
@@ -36,4 +36,11 @@ export declare function shallowEqual<T>(objA: T, objB: T): boolean;
|
|
|
36
36
|
export declare function composeRowPropsGetter(getRowProps: (record: any, rowIndex: number) => React.HTMLAttributes<HTMLTableRowElement>, pendingRowProps?: React.HTMLAttributes<HTMLTableRowElement>): (record: any, rowIndex: number) => React.HTMLAttributes<HTMLTableRowElement>;
|
|
37
37
|
export declare function getTableScrollHeaderDOM(domHelper: TableDOMHelper): HTMLDivElement;
|
|
38
38
|
export declare function getTableScrollFooterDOM(domHelper: TableDOMHelper): HTMLDivElement;
|
|
39
|
+
export declare const cssPolifill: ({ variables, enableCSSVariables, bordered }: {
|
|
40
|
+
variables: {
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
};
|
|
43
|
+
enableCSSVariables?: boolean;
|
|
44
|
+
bordered?: boolean;
|
|
45
|
+
}) => void;
|
|
39
46
|
export {};
|