@kdcloudjs/table 1.1.6 → 1.2.0-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 +835 -187
- 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/locale/locale.d.ts +8 -4
- package/es/locale/zh-CN.d.ts +8 -4
- package/es/locale/zh-CN.js +10 -4
- package/es/table/base/helpers/TableDOMUtils.js +17 -14
- package/es/table/base/styles.d.ts +10 -0
- package/es/table/base/styles.js +12 -2
- package/es/table/base/table.js +38 -7
- package/es/table/common-views.js +3 -1
- package/es/table/interfaces.d.ts +5 -0
- package/es/table/pipeline/features/autoFill.js +7 -3
- package/es/table/pipeline/features/columnFilter.js +17 -5
- package/es/table/pipeline/features/columnResizeWidth.js +3 -1
- package/es/table/pipeline/features/filter/DefaultFilterContent.d.ts +1 -1
- package/es/table/pipeline/features/filter/DefaultFilterContent.js +11 -5
- package/es/table/pipeline/features/filter/Filter.d.ts +4 -1
- package/es/table/pipeline/features/filter/Filter.js +4 -2
- 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 +31 -12
- package/es/table/pipeline/features/rangeSelection.d.ts +22 -1
- package/es/table/pipeline/features/rangeSelection.js +274 -100
- package/es/table/pipeline/features/rowDrag.d.ts +28 -0
- package/es/table/pipeline/features/rowDrag.js +325 -0
- package/es/table/pipeline/features/sort.js +22 -3
- package/lib/locale/locale.d.ts +8 -4
- package/lib/locale/zh-CN.d.ts +8 -4
- package/lib/locale/zh-CN.js +10 -4
- package/lib/table/base/helpers/TableDOMUtils.js +17 -14
- package/lib/table/base/styles.d.ts +10 -0
- package/lib/table/base/styles.js +12 -2
- package/lib/table/base/table.js +38 -7
- package/lib/table/common-views.js +3 -1
- package/lib/table/interfaces.d.ts +5 -0
- package/lib/table/pipeline/features/autoFill.js +7 -3
- package/lib/table/pipeline/features/columnFilter.js +18 -6
- package/lib/table/pipeline/features/columnResizeWidth.js +3 -1
- package/lib/table/pipeline/features/filter/DefaultFilterContent.d.ts +1 -1
- package/lib/table/pipeline/features/filter/DefaultFilterContent.js +11 -5
- package/lib/table/pipeline/features/filter/Filter.d.ts +4 -1
- package/lib/table/pipeline/features/filter/Filter.js +4 -2
- 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 +33 -12
- package/lib/table/pipeline/features/rangeSelection.d.ts +22 -1
- package/lib/table/pipeline/features/rangeSelection.js +282 -104
- package/lib/table/pipeline/features/rowDrag.d.ts +28 -0
- package/lib/table/pipeline/features/rowDrag.js +347 -0
- package/lib/table/pipeline/features/sort.js +22 -3
- package/package.json +3 -3
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TablePipeline } from '../pipeline';
|
|
2
|
+
import { ArtColumn } from '../../interfaces';
|
|
3
|
+
interface RowDragEvent {
|
|
4
|
+
startRowIndex: number;
|
|
5
|
+
startRow: any;
|
|
6
|
+
endRowIndex: number;
|
|
7
|
+
endRow: any;
|
|
8
|
+
isFinished: boolean;
|
|
9
|
+
dragPosition: string;
|
|
10
|
+
}
|
|
11
|
+
export interface RowDragFeatureOptions {
|
|
12
|
+
/** 拖拽开始事件 */
|
|
13
|
+
onDragStart?: (event: RowDragEvent) => void;
|
|
14
|
+
/** 拖拽移动事件 */
|
|
15
|
+
onDragMove?: (event: RowDragEvent) => void;
|
|
16
|
+
/** 拖拽结束事件 */
|
|
17
|
+
onDragEnd?: (event: RowDragEvent) => void;
|
|
18
|
+
/** 判断一行是否要禁用拖拽 */
|
|
19
|
+
isDisabled?: (row: any, rowIndex: number) => boolean;
|
|
20
|
+
/** 拖拽列定义 */
|
|
21
|
+
rowDragColumn?: ArtColumn;
|
|
22
|
+
/** 行高 */
|
|
23
|
+
rowHeight?: number;
|
|
24
|
+
}
|
|
25
|
+
export declare const ROW_DRAG_COLUMN_CODE = "$_row_drag_column_&";
|
|
26
|
+
export declare const rowDragKey = "rowDragKey";
|
|
27
|
+
export declare function rowDrag(opt: RowDragFeatureOptions): (pipeline: TablePipeline) => TablePipeline;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
2
|
+
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
3
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { fromEvent } from 'rxjs';
|
|
6
|
+
import { map, takeUntil } from 'rxjs/operators';
|
|
7
|
+
import cx from 'classnames';
|
|
8
|
+
import { Classes } from '../../base/styles';
|
|
9
|
+
export var ROW_DRAG_COLUMN_CODE = '$_row_drag_column_&';
|
|
10
|
+
export var rowDragKey = 'rowDragKey';
|
|
11
|
+
var SCROLL_OFFSET = 30;
|
|
12
|
+
var defaultRowDragColumn = {
|
|
13
|
+
name: '拖拽列',
|
|
14
|
+
code: ROW_DRAG_COLUMN_CODE,
|
|
15
|
+
lock: true,
|
|
16
|
+
title: '',
|
|
17
|
+
width: 40,
|
|
18
|
+
align: 'center',
|
|
19
|
+
getCellProps: function getCellProps(value, row, rowIndex) {
|
|
20
|
+
return {
|
|
21
|
+
className: cx(Classes.rowDragCell)
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
render: function render(value, row, rowIndex) {
|
|
25
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
26
|
+
viewBox: '0 0 1024 1024',
|
|
27
|
+
version: '1.1',
|
|
28
|
+
xmlns: 'http://www.w3.org/1999/xlink',
|
|
29
|
+
"data-icon": 'drag',
|
|
30
|
+
width: '16',
|
|
31
|
+
height: '16'
|
|
32
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
33
|
+
d: 'M298.688 192a64 64 0 1 0 128 0 64 64 0 0 0-128 0z m298.624 0a64 64 0 1 0 128 0 64 64 0 0 0-128 0zM298.688 512a64 64 0 1 0 128 0 64 64 0 0 0-128 0z m298.624 0a64 64 0 1 0 128 0 64 64 0 0 0-128 0z m-298.624 320a64 64 0 1 0 128 0 64 64 0 0 0-128 0z m298.624 0a64 64 0 1 0 128 0 64 64 0 0 0-128 0z',
|
|
34
|
+
"p-id": '4278'
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
export function rowDrag(opt) {
|
|
39
|
+
return function rowDragStep(pipeline) {
|
|
40
|
+
var _context;
|
|
41
|
+
|
|
42
|
+
var tableBody = pipeline.ref.current.domHelper && pipeline.ref.current.domHelper.tableBody;
|
|
43
|
+
var artTable = pipeline.ref.current.domHelper && pipeline.ref.current.domHelper.artTable;
|
|
44
|
+
if (!tableBody) return pipeline;
|
|
45
|
+
var dataSource = pipeline.getDataSource();
|
|
46
|
+
var rowHeight = (opt === null || opt === void 0 ? void 0 : opt.rowHeight) || 48;
|
|
47
|
+
|
|
48
|
+
var handleDragStrat = function handleDragStrat(event) {
|
|
49
|
+
var _a; // 开始拖拽
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
artTable.classList.add(cx(Classes.rowDragging));
|
|
53
|
+
(_a = opt === null || opt === void 0 ? void 0 : opt.onDragStart) === null || _a === void 0 ? void 0 : _a.call(opt, event);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
var handleDragMove = function handleDragMove(event) {
|
|
57
|
+
var _a;
|
|
58
|
+
|
|
59
|
+
(_a = opt === null || opt === void 0 ? void 0 : opt.onDragMove) === null || _a === void 0 ? void 0 : _a.call(opt, event);
|
|
60
|
+
pipeline.setStateAtKey(rowDragKey, event);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
var handleDragEnd = function handleDragEnd(event, isOutOfRange) {
|
|
64
|
+
var _a;
|
|
65
|
+
|
|
66
|
+
artTable.classList.remove(cx(Classes.rowDragging));
|
|
67
|
+
pipeline.setStateAtKey(rowDragKey, event); // 超出拖拽范围不触发dragend事件
|
|
68
|
+
|
|
69
|
+
if (!isOutOfRange) {
|
|
70
|
+
(_a = opt === null || opt === void 0 ? void 0 : opt.onDragEnd) === null || _a === void 0 ? void 0 : _a.call(opt, event);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
var getDragEvent = function getDragEvent(startRowInfo, endRowInfo, _ref) {
|
|
75
|
+
var isFinished = _ref.isFinished,
|
|
76
|
+
_ref$dragPosition = _ref.dragPosition,
|
|
77
|
+
dragPosition = _ref$dragPosition === void 0 ? 'bottom' : _ref$dragPosition;
|
|
78
|
+
return {
|
|
79
|
+
startRowIndex: startRowInfo.rowIndex,
|
|
80
|
+
startRow: startRowInfo.row,
|
|
81
|
+
endRowIndex: endRowInfo.rowIndex,
|
|
82
|
+
endRow: endRowInfo.row,
|
|
83
|
+
dragPosition: dragPosition,
|
|
84
|
+
isFinished: isFinished
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
var updateScrollPosition = function updateScrollPosition(mouseMoveEvent) {
|
|
89
|
+
var clientY = mouseMoveEvent.clientY;
|
|
90
|
+
var tableBodyClientRect = tableBody.getBoundingClientRect();
|
|
91
|
+
var top = tableBodyClientRect.top,
|
|
92
|
+
height = tableBodyClientRect.height;
|
|
93
|
+
|
|
94
|
+
if (clientY + SCROLL_OFFSET >= top + height) {
|
|
95
|
+
pipeline.ref.current.domHelper.tableBody.scrollTop += SCROLL_OFFSET;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (clientY + SCROLL_OFFSET <= top) {
|
|
99
|
+
pipeline.ref.current.domHelper.tableBody.scrollTop -= SCROLL_OFFSET;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
var onMouseDown = function onMouseDown(mouseDownEvent) {
|
|
104
|
+
var _a;
|
|
105
|
+
|
|
106
|
+
var startRowInfo = getTargetRowInfo(mouseDownEvent.target, tableBody, dataSource);
|
|
107
|
+
var endRowInfo = startRowInfo;
|
|
108
|
+
if (!startRowInfo || startRowInfo.code !== rowDragColumn.code) return;
|
|
109
|
+
if ((_a = opt === null || opt === void 0 ? void 0 : opt.isDisabled) === null || _a === void 0 ? void 0 : _a.call(opt, startRowInfo.row, startRowInfo.rowIndex)) return; // 默认拖拽插入的位置是向下
|
|
110
|
+
|
|
111
|
+
var dragPosition = 'bottom';
|
|
112
|
+
var isOutOfRange = false;
|
|
113
|
+
var dragStartEvent = getDragEvent(startRowInfo, endRowInfo, {
|
|
114
|
+
isFinished: false,
|
|
115
|
+
dragPosition: 'bottom'
|
|
116
|
+
});
|
|
117
|
+
handleDragStrat(dragStartEvent);
|
|
118
|
+
var tableWidth = tableBody.clientWidth;
|
|
119
|
+
var startRowRects = startRowInfo.cell.getBoundingClientRect(); // 光标位置距离初始拖拽行的偏移量
|
|
120
|
+
|
|
121
|
+
var startOffset = mouseDownEvent.clientY - startRowRects.y;
|
|
122
|
+
var dragElement = createDragElement(startRowRects, tableWidth, rowHeight); // 可拖拽的范围
|
|
123
|
+
|
|
124
|
+
var dragRange = getDragRange(tableBody, {
|
|
125
|
+
startOffset: startOffset,
|
|
126
|
+
rowHeight: startRowRects.height
|
|
127
|
+
});
|
|
128
|
+
var mousemove$ = fromEvent(window, 'mousemove');
|
|
129
|
+
var mouseup$ = fromEvent(window, 'mouseup');
|
|
130
|
+
var rowDrag$ = mousemove$.pipe(map(function (mouseMoveEvent) {
|
|
131
|
+
var clientX = mouseMoveEvent.clientX,
|
|
132
|
+
clientY = mouseMoveEvent.clientY;
|
|
133
|
+
var tagretRow = getTargetRowInfo(mouseMoveEvent.target, tableBody, dataSource);
|
|
134
|
+
|
|
135
|
+
if (tagretRow) {
|
|
136
|
+
endRowInfo = tagretRow;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
var targetRowRects = endRowInfo.cell.getBoundingClientRect(); // 判断拖拽插入的位置,拖拽框上边框位于目标行之上则向上插入,否则向下插入
|
|
140
|
+
|
|
141
|
+
var isMoveToTop = clientY - startOffset < targetRowRects.y;
|
|
142
|
+
dragPosition = isMoveToTop ? 'top' : 'bottom';
|
|
143
|
+
isOutOfRange = isOutOfDragRange({
|
|
144
|
+
x: clientX,
|
|
145
|
+
y: clientY
|
|
146
|
+
}, dragRange);
|
|
147
|
+
updateScrollPosition(mouseMoveEvent); // 拖拽到底时让滚动条可以滚动
|
|
148
|
+
|
|
149
|
+
updateDragElementPosition(dragElement, dragRange, {
|
|
150
|
+
x: clientX,
|
|
151
|
+
y: clientY,
|
|
152
|
+
startOffset: startOffset
|
|
153
|
+
});
|
|
154
|
+
updateCurSorStyle(isOutOfRange);
|
|
155
|
+
return {
|
|
156
|
+
startRowInfo: startRowInfo,
|
|
157
|
+
endRowInfo: endRowInfo,
|
|
158
|
+
dragPosition: dragPosition
|
|
159
|
+
};
|
|
160
|
+
}), takeUntil(mouseup$));
|
|
161
|
+
rowDrag$.subscribe({
|
|
162
|
+
next: function next(_ref2) {
|
|
163
|
+
var startRowInfo = _ref2.startRowInfo,
|
|
164
|
+
endRowInfo = _ref2.endRowInfo,
|
|
165
|
+
dragPosition = _ref2.dragPosition;
|
|
166
|
+
var dragMoveEvent = getDragEvent(startRowInfo, endRowInfo, {
|
|
167
|
+
isFinished: false,
|
|
168
|
+
dragPosition: dragPosition
|
|
169
|
+
});
|
|
170
|
+
handleDragMove(dragMoveEvent);
|
|
171
|
+
},
|
|
172
|
+
complete: function complete() {
|
|
173
|
+
var dragEndEvent = getDragEvent(startRowInfo, endRowInfo, {
|
|
174
|
+
isFinished: true,
|
|
175
|
+
dragPosition: dragPosition
|
|
176
|
+
});
|
|
177
|
+
handleDragEnd(dragEndEvent, isOutOfRange);
|
|
178
|
+
removeDragElement(dragElement);
|
|
179
|
+
removeCurSorStyle();
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
var rowDragColumn = (opt === null || opt === void 0 ? void 0 : opt.rowDragColumn) || defaultRowDragColumn;
|
|
185
|
+
|
|
186
|
+
var nextColumns = _sliceInstanceProperty(_context = pipeline.getColumns()).call(_context);
|
|
187
|
+
|
|
188
|
+
nextColumns.unshift(rowDragColumn);
|
|
189
|
+
pipeline.columns(nextColumns);
|
|
190
|
+
pipeline.addTableProps({
|
|
191
|
+
onMouseDown: onMouseDown
|
|
192
|
+
});
|
|
193
|
+
pipeline.appendRowPropsGetter(function (row, rowIndex) {
|
|
194
|
+
var _cx;
|
|
195
|
+
|
|
196
|
+
var rowDragEvent = pipeline.getStateAtKey(rowDragKey) || {};
|
|
197
|
+
var startRowIndex = rowDragEvent.startRowIndex,
|
|
198
|
+
endRowIndex = rowDragEvent.endRowIndex,
|
|
199
|
+
isFinished = rowDragEvent.isFinished,
|
|
200
|
+
dragPosition = rowDragEvent.dragPosition;
|
|
201
|
+
var isFooterCell = row[pipeline.getFeatureOptions('footerRowMetaKey')];
|
|
202
|
+
if (isFooterCell || isFinished || rowIndex !== startRowIndex && rowIndex !== endRowIndex) return;
|
|
203
|
+
var className = cx((_cx = {}, _defineProperty(_cx, Classes.rowDragStart, rowIndex === startRowIndex), _defineProperty(_cx, Classes.rowDragEnd, rowIndex === endRowIndex), _defineProperty(_cx, Classes.rowDragEndToTop, rowIndex === endRowIndex && dragPosition === 'top'), _defineProperty(_cx, Classes.rowDragEndToBottom, rowIndex === endRowIndex && dragPosition === 'bottom'), _cx));
|
|
204
|
+
return {
|
|
205
|
+
className: className
|
|
206
|
+
};
|
|
207
|
+
});
|
|
208
|
+
return pipeline;
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function getTargetRowInfo(target, tableBody, record) {
|
|
213
|
+
while (target && tableBody.contains(target)) {
|
|
214
|
+
if (target.getAttribute('data-role') === 'table-cell') {
|
|
215
|
+
var code = target.getAttribute('data-code');
|
|
216
|
+
var rowIndex = parseInt(target.getAttribute('data-rowindex'));
|
|
217
|
+
var row = record[rowIndex];
|
|
218
|
+
var isFooterCell = isEleInFooter(target);
|
|
219
|
+
if (!row || isFooterCell) return null;
|
|
220
|
+
return {
|
|
221
|
+
rowIndex: rowIndex,
|
|
222
|
+
row: row,
|
|
223
|
+
code: code,
|
|
224
|
+
cell: target
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
target = target.parentElement;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function isEleInFooter(target) {
|
|
235
|
+
while (target && !target.classList.contains(Classes.artTable)) {
|
|
236
|
+
if (target.classList.contains(Classes.tableFooter)) {
|
|
237
|
+
return true;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
target = target.parentElement;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
return false;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function createDragElement(rects, tableWidth, rowHeight) {
|
|
247
|
+
var _context2, _context3, _context4;
|
|
248
|
+
|
|
249
|
+
var x = rects.x,
|
|
250
|
+
y = rects.y;
|
|
251
|
+
var dragMoveElement = document.createElement('div');
|
|
252
|
+
dragMoveElement.className = cx(Classes.rowDragElement);
|
|
253
|
+
dragMoveElement.style.cssText = _concatInstanceProperty(_context2 = _concatInstanceProperty(_context3 = _concatInstanceProperty(_context4 = "position:fixed;z-index:9999;left:".concat(x, "px;top:")).call(_context4, y, "px;pointer-events:none;width:")).call(_context3, tableWidth, "px;height:")).call(_context2, rowHeight, "px;background:var(--primary-color);opacity: 0.1;");
|
|
254
|
+
document.body.appendChild(dragMoveElement);
|
|
255
|
+
return dragMoveElement;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function updateDragElementPosition(element, dragRange, _ref3) {
|
|
259
|
+
var x = _ref3.x,
|
|
260
|
+
y = _ref3.y,
|
|
261
|
+
startOffset = _ref3.startOffset;
|
|
262
|
+
var validPosition = getValidPosition({
|
|
263
|
+
x: x,
|
|
264
|
+
y: y
|
|
265
|
+
}, dragRange);
|
|
266
|
+
element.style.top = validPosition.y - startOffset + 'px';
|
|
267
|
+
return element;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
function removeDragElement(element) {
|
|
271
|
+
document.body.removeChild(element);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
function updateCurSorStyle(isOutOfRange) {
|
|
275
|
+
if (isOutOfRange) {
|
|
276
|
+
document.body.style.cursor = 'no-drop';
|
|
277
|
+
} else {
|
|
278
|
+
document.body.style.cursor = 'move';
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function removeCurSorStyle() {
|
|
283
|
+
document.body.style.cursor = 'default';
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
function getDragRange(tableBody, _ref4) {
|
|
287
|
+
var startOffset = _ref4.startOffset,
|
|
288
|
+
rowHeight = _ref4.rowHeight;
|
|
289
|
+
var tableBodyClientRect = tableBody.getBoundingClientRect();
|
|
290
|
+
var height = tableBodyClientRect.height,
|
|
291
|
+
width = tableBodyClientRect.width,
|
|
292
|
+
x = tableBodyClientRect.x,
|
|
293
|
+
y = tableBodyClientRect.y;
|
|
294
|
+
return {
|
|
295
|
+
minX: x,
|
|
296
|
+
maxX: x + width,
|
|
297
|
+
minY: y - rowHeight + startOffset,
|
|
298
|
+
maxY: y + height + startOffset
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function getValidPosition(position, dragRange) {
|
|
303
|
+
var x = position.x,
|
|
304
|
+
y = position.y;
|
|
305
|
+
var minX = dragRange.minX,
|
|
306
|
+
maxX = dragRange.maxX,
|
|
307
|
+
minY = dragRange.minY,
|
|
308
|
+
maxY = dragRange.maxY;
|
|
309
|
+
var newX = x < minX ? minX : x > maxX ? maxX : x;
|
|
310
|
+
var newY = y < minY ? minY : y > maxY ? maxY : y;
|
|
311
|
+
return {
|
|
312
|
+
x: newX,
|
|
313
|
+
y: newY
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
function isOutOfDragRange(position, dragRange) {
|
|
318
|
+
var x = position.x,
|
|
319
|
+
y = position.y;
|
|
320
|
+
var minX = dragRange.minX,
|
|
321
|
+
maxX = dragRange.maxX,
|
|
322
|
+
minY = dragRange.minY,
|
|
323
|
+
maxY = dragRange.maxY;
|
|
324
|
+
return x > maxX || x < minX || y > maxY || y < minY;
|
|
325
|
+
}
|
|
@@ -310,10 +310,29 @@ export function sort() {
|
|
|
310
310
|
title: col.title && col.title[0] ? col.title[0] : col.title
|
|
311
311
|
})));
|
|
312
312
|
|
|
313
|
-
|
|
314
|
-
|
|
313
|
+
var _sortNodeWithoutTitle = /*#__PURE__*/React.createElement(SortHeaderCell, {
|
|
314
|
+
onToggle: function onToggle(e) {
|
|
315
|
+
if (stopClickEventPropagation) {
|
|
316
|
+
e.stopPropagation();
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
toggle(col.code);
|
|
320
|
+
},
|
|
321
|
+
sortOrder: sortOrder,
|
|
322
|
+
column: col,
|
|
323
|
+
sortIndex: sortIndex,
|
|
324
|
+
sortOptions: sortOptions
|
|
325
|
+
}); // 开启标题行高自适应后,修改表头的渲染结构
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
if (col.renderHeader) {
|
|
329
|
+
result.title = col.renderHeader(result.title, _sortNodeWithoutTitle);
|
|
315
330
|
} else {
|
|
316
|
-
result.title
|
|
331
|
+
if (result.title && result.title[0]) {
|
|
332
|
+
result.title[0] = sortNode;
|
|
333
|
+
} else {
|
|
334
|
+
result.title = sortNode;
|
|
335
|
+
}
|
|
317
336
|
}
|
|
318
337
|
}
|
|
319
338
|
|
package/lib/locale/locale.d.ts
CHANGED
|
@@ -26,10 +26,14 @@ declare class LocaleCache {
|
|
|
26
26
|
*/
|
|
27
27
|
setLocalesData(locale: string, localeData?: LocaleDataType): {
|
|
28
28
|
locale: string;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
contain: string;
|
|
30
|
+
notContain: string;
|
|
31
|
+
equal: string;
|
|
32
|
+
notEqual: string;
|
|
33
|
+
isNull: string;
|
|
34
|
+
notIsNull: string;
|
|
35
|
+
resetFilter: string;
|
|
36
|
+
confirmFilter: string;
|
|
33
37
|
};
|
|
34
38
|
/**
|
|
35
39
|
* 获取当前语言包数据
|
package/lib/locale/zh-CN.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
declare const locale: {
|
|
2
2
|
locale: string;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
contain: string;
|
|
4
|
+
notContain: string;
|
|
5
|
+
equal: string;
|
|
6
|
+
notEqual: string;
|
|
7
|
+
isNull: string;
|
|
8
|
+
notIsNull: string;
|
|
9
|
+
resetFilter: string;
|
|
10
|
+
confirmFilter: string;
|
|
7
11
|
};
|
|
8
12
|
export default locale;
|
package/lib/locale/zh-CN.js
CHANGED
|
@@ -6,10 +6,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var locale = {
|
|
8
8
|
locale: 'zh-CN',
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
// Text Filter
|
|
10
|
+
contain: '包含',
|
|
11
|
+
notContain: '不包含',
|
|
12
|
+
equal: '等于',
|
|
13
|
+
notEqual: '不等于',
|
|
14
|
+
isNull: '为空',
|
|
15
|
+
notIsNull: '不为空',
|
|
16
|
+
// filter button
|
|
17
|
+
resetFilter: '重置',
|
|
18
|
+
confirmFilter: '确定'
|
|
13
19
|
};
|
|
14
20
|
var _default = locale;
|
|
15
21
|
exports.default = _default;
|
|
@@ -59,7 +59,8 @@ var _styles = require("../styles");
|
|
|
59
59
|
var TableDOMHelper = /*#__PURE__*/function () {
|
|
60
60
|
function TableDOMHelper(artTableWrapper) {
|
|
61
61
|
var _this = this,
|
|
62
|
-
_context2
|
|
62
|
+
_context2,
|
|
63
|
+
_context3;
|
|
63
64
|
|
|
64
65
|
(0, _classCallCheck2.default)(this, TableDOMHelper);
|
|
65
66
|
|
|
@@ -105,7 +106,7 @@ var TableDOMHelper = /*#__PURE__*/function () {
|
|
|
105
106
|
this.tableElement = this.artTable.querySelector(".".concat(_styles.Classes.tableBody, " table"));
|
|
106
107
|
this.tableFooter = this.artTable.querySelector(".".concat(_styles.Classes.tableFooter));
|
|
107
108
|
this.tableFooterMain = this.artTable.querySelector(".".concat(_styles.Classes.tableFooterMain));
|
|
108
|
-
var stickyScrollSelector = (0, _concat.default)(_context2 = ".".concat(_styles.Classes.artTable, " + .")).call(_context2, _styles.Classes.stickyScroll);
|
|
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);
|
|
109
110
|
this.stickyScroll = artTableWrapper.querySelector(stickyScrollSelector);
|
|
110
111
|
this.stickyScrollItem = this.stickyScroll.querySelector(".".concat(_styles.Classes.stickyScrollItem));
|
|
111
112
|
}
|
|
@@ -118,33 +119,35 @@ var TableDOMHelper = /*#__PURE__*/function () {
|
|
|
118
119
|
}, {
|
|
119
120
|
key: "getTableRows",
|
|
120
121
|
value: function getTableRows() {
|
|
121
|
-
var
|
|
122
|
+
var _context4;
|
|
122
123
|
|
|
123
|
-
var tbody = this.artTable.querySelector((0, _concat.default)(
|
|
124
|
+
var tbody = this.artTable.querySelector((0, _concat.default)(_context4 = ".".concat(_styles.Classes.tableBody, " .")).call(_context4, _styles.Classes.virtual, " table tbody"));
|
|
124
125
|
return tbody.childNodes;
|
|
125
126
|
}
|
|
126
127
|
}, {
|
|
127
128
|
key: "getTableBodyHtmlTable",
|
|
128
129
|
value: function getTableBodyHtmlTable() {
|
|
129
|
-
var
|
|
130
|
+
var _context5;
|
|
130
131
|
|
|
131
|
-
return this.artTable.querySelector((0, _concat.default)(
|
|
132
|
+
return this.artTable.querySelector((0, _concat.default)(_context5 = ".".concat(_styles.Classes.tableBody, " .")).call(_context5, _styles.Classes.virtual, " table"));
|
|
132
133
|
}
|
|
133
134
|
}, {
|
|
134
135
|
key: "getLeftLockShadow",
|
|
135
136
|
value: function getLeftLockShadow() {
|
|
136
|
-
var
|
|
137
|
+
var _context6;
|
|
137
138
|
|
|
138
|
-
var selector = (0, _concat.default)(
|
|
139
|
-
|
|
139
|
+
var selector = (0, _concat.default)(_context6 = ".".concat(_styles.Classes.lockShadowMask, " .")).call(_context6, _styles.Classes.leftLockShadow);
|
|
140
|
+
var allLeftLockShadow = this.artTable.querySelectorAll(selector);
|
|
141
|
+
return allLeftLockShadow[allLeftLockShadow.length - 1]; // 当table-body、table-footer嵌套多层表格时,需要查找最后一个,否则会查找到嵌套表格的
|
|
140
142
|
}
|
|
141
143
|
}, {
|
|
142
144
|
key: "getRightLockShadow",
|
|
143
145
|
value: function getRightLockShadow() {
|
|
144
|
-
var
|
|
146
|
+
var _context7;
|
|
145
147
|
|
|
146
|
-
var selector = (0, _concat.default)(
|
|
147
|
-
|
|
148
|
+
var selector = (0, _concat.default)(_context7 = ".".concat(_styles.Classes.lockShadowMask, " .")).call(_context7, _styles.Classes.rightLockShadow);
|
|
149
|
+
var allRightLockShadow = this.artTable.querySelectorAll(selector);
|
|
150
|
+
return allRightLockShadow[allRightLockShadow.length - 1]; // 当table-body、table-footer嵌套多层表格时,需要查找最后一个,否则会查找到嵌套表格的
|
|
148
151
|
}
|
|
149
152
|
}, {
|
|
150
153
|
key: "getLoadingIndicator",
|
|
@@ -154,10 +157,10 @@ var TableDOMHelper = /*#__PURE__*/function () {
|
|
|
154
157
|
}, {
|
|
155
158
|
key: "getRowTop",
|
|
156
159
|
value: function getRowTop(rowIndex) {
|
|
157
|
-
var
|
|
160
|
+
var _context8, _context9;
|
|
158
161
|
|
|
159
162
|
if (rowIndex === 0) return 0;
|
|
160
|
-
var selector = (0, _concat.default)(
|
|
163
|
+
var selector = (0, _concat.default)(_context8 = (0, _concat.default)(_context9 = ".".concat(_styles.Classes.tableBody, " .")).call(_context9, _styles.Classes.tableRow, "[data-rowindex=\"")).call(_context8, rowIndex, "\"]");
|
|
161
164
|
var row = this.artTable.querySelector(selector);
|
|
162
165
|
var rowOffsetTop = row && row.offsetTop || 0;
|
|
163
166
|
var tableOffsetTop = this.tableElement.offsetTop || 0;
|
|
@@ -25,6 +25,9 @@ export declare const Classes: {
|
|
|
25
25
|
readonly stickyScrollItem: string;
|
|
26
26
|
readonly horizontalScrollContainer: string;
|
|
27
27
|
readonly verticalScrollPlaceholder: string;
|
|
28
|
+
readonly horizontalStickyScrollContainer: string;
|
|
29
|
+
readonly horizontalScrollLeftSpacer: string;
|
|
30
|
+
readonly horizontalScrollRightSpacer: string;
|
|
28
31
|
readonly lockShadowMask: string;
|
|
29
32
|
readonly lockShadow: string;
|
|
30
33
|
readonly leftLockShadow: string;
|
|
@@ -67,6 +70,13 @@ export declare const Classes: {
|
|
|
67
70
|
readonly popup: string;
|
|
68
71
|
readonly popupHeader: string;
|
|
69
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;
|
|
70
80
|
};
|
|
71
81
|
export declare const MenuClasses: {
|
|
72
82
|
menu: string;
|
package/lib/table/base/styles.js
CHANGED
|
@@ -60,6 +60,9 @@ var Classes = {
|
|
|
60
60
|
stickyScrollItem: "".concat(prefix, "sticky-scroll-item"),
|
|
61
61
|
horizontalScrollContainer: "".concat(prefix, "horizontal-scroll-container"),
|
|
62
62
|
verticalScrollPlaceholder: "".concat(prefix, "vertical-scroll-placeholder"),
|
|
63
|
+
horizontalStickyScrollContainer: "".concat(prefix, "horizontal-sticky-scroll-container"),
|
|
64
|
+
horizontalScrollLeftSpacer: "".concat(prefix, "horizontal-scroll-left-spacer"),
|
|
65
|
+
horizontalScrollRightSpacer: "".concat(prefix, "horizontal-scroll-right-spacer"),
|
|
63
66
|
lockShadowMask: "".concat(prefix, "lock-shadow-mask"),
|
|
64
67
|
lockShadow: "".concat(prefix, "lock-shadow"),
|
|
65
68
|
leftLockShadow: "".concat(prefix, "left-lock-shadow"),
|
|
@@ -102,7 +105,14 @@ var Classes = {
|
|
|
102
105
|
collapsed: "".concat(prefix, "collapsed"),
|
|
103
106
|
popup: "".concat(prefix, "popup"),
|
|
104
107
|
popupHeader: "".concat(prefix, "popup-header"),
|
|
105
|
-
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")
|
|
106
116
|
};
|
|
107
117
|
exports.Classes = Classes;
|
|
108
118
|
var MenuClasses = {
|
|
@@ -159,7 +169,7 @@ exports.variableConst = variableConst;
|
|
|
159
169
|
var notBorderedStyleMixin = (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n --cell-border-vertical: none;\n --header-cell-border-vertical: none;\n"])));
|
|
160
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);
|
|
161
171
|
|
|
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);
|
|
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 .", "::after{\n content: \"\";\n position: absolute;\n display: block;\n left: 0px;\n width: 100%;\n height: 1px;\n top:0px;\n z-index:20;\n background-color:var(--primary-color);\n }\n\n .", "::after{\n content: \"\";\n position: absolute;\n display: block;\n left: 0px;\n width: 100%;\n height: 1px;\n bottom:0px;\n z-index:20;\n background-color:var(--primary-color);\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 }\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.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);
|
|
163
173
|
|
|
164
174
|
exports.StyledArtTableWrapper = StyledArtTableWrapper;
|
|
165
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);
|