@arim-aisdc/public-components 0.0.1 → 0.0.3
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/Foo/index.less +3 -3
- package/dist/TableMax/TableBody/Row.js +21 -17
- package/dist/TableMax/TableBody/index.js +51 -25
- package/dist/TableMax/TableBody/index.less +0 -34
- package/dist/TableMax/TableHeader/Cell.js +9 -9
- package/dist/TableMax/TableHeader/index.js +11 -5
- package/dist/TableMax/TableHeader/index.less +55 -81
- package/dist/TableMax/TableHeader/utils.js +31 -25
- package/dist/TableMax/components/ColumnEdit/components/numberRange/index.js +29 -0
- package/dist/TableMax/components/ColumnEdit/components/numberRange/index.less +3 -0
- package/dist/TableMax/components/ColumnEdit/index.js +8 -2
- package/dist/TableMax/components/ColumnEdit/index.less +20 -18
- package/dist/TableMax/components/ColumnFilter/FilterDateRange/index.js +4 -4
- package/dist/TableMax/components/ColumnFilter/FilterDateRange/index.less +0 -34
- package/dist/TableMax/components/ColumnFilter/MultipleSelect/index.js +1 -1
- package/dist/TableMax/components/ColumnFilter/MultipleSelect/index.less +11 -14
- package/dist/TableMax/components/ColumnFilter/SingleSelect/index.js +1 -1
- package/dist/TableMax/components/ColumnFilter/SingleSelect/index.less +1 -1
- package/dist/TableMax/components/ColumnSetting/index.js +37 -27
- package/dist/TableMax/components/ColumnSetting/index.less +1 -35
- package/dist/TableMax/components/CustomDragerLayer/index.js +7 -5
- package/dist/TableMax/components/CustomDragerLayer/index.less +35 -0
- package/dist/TableMax/index.js +276 -237
- package/dist/TableMax/index.less +12 -48
- package/dist/TableMax/type.js +1 -0
- package/dist/TableMax/utils.js +1 -9
- package/dist/utils/index.js +8 -0
- package/package.json +89 -89
- package/dist/TableMax/components/FilterDateRange/index.js +0 -75
- package/dist/TableMax/components/FilterDateRange/index.less +0 -70
- package/dist/TableMax/components/PaginationMax/index.js +0 -111
- package/dist/TableMax/components/PaginationMax/index.less +0 -0
- package/dist/TableMax/components/RowContent/index.js +0 -225
- package/dist/TableMax/components/RowContent/index.less +0 -84
- package/dist/TableMax/components/ScrollBar/index.js +0 -49
- package/dist/TableMax/components/ScrollBar/index.less +0 -61
- package/dist/TableMax/components/Selection/index.js +0 -29
- package/dist/TableMax/type.d.ts +0 -208
package/dist/Foo/index.less
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
.title {
|
|
2
|
-
color: @
|
|
3
|
-
}
|
|
1
|
+
.title {
|
|
2
|
+
color: @globalColor1;
|
|
3
|
+
}
|
|
@@ -10,7 +10,6 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
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; }
|
|
11
11
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
// import { layoutContext } from '@/layouts';
|
|
14
13
|
import { flexRender } from '@tanstack/react-table';
|
|
15
14
|
import { useEffect, useRef } from 'react';
|
|
16
15
|
import { useDrag, useDrop } from 'react-dnd';
|
|
@@ -40,7 +39,7 @@ var Row = function Row(_ref) {
|
|
|
40
39
|
rowStyle = _ref.rowStyle,
|
|
41
40
|
getCellProps = _ref.getCellProps,
|
|
42
41
|
editting = _ref.editting,
|
|
43
|
-
|
|
42
|
+
rowEditing = _ref.rowEditing,
|
|
44
43
|
renderSubComponent = _ref.renderSubComponent,
|
|
45
44
|
selectedRowDragging = _ref.selectedRowDragging,
|
|
46
45
|
setSelectedRowDragging = _ref.setSelectedRowDragging,
|
|
@@ -51,9 +50,10 @@ var Row = function Row(_ref) {
|
|
|
51
50
|
rowHeight = _ref.rowHeight,
|
|
52
51
|
disableDragRowIds = _ref.disableDragRowIds,
|
|
53
52
|
selectRowWhenClick = _ref.selectRowWhenClick,
|
|
54
|
-
hasVerticalScrollBar = _ref.hasVerticalScrollBar
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
hasVerticalScrollBar = _ref.hasVerticalScrollBar,
|
|
54
|
+
handleEditRowWhenDClick = _ref.handleEditRowWhenDClick,
|
|
55
|
+
canEditRowWhenDClick = _ref.canEditRowWhenDClick,
|
|
56
|
+
theme = _ref.theme;
|
|
57
57
|
var timerRef = useRef();
|
|
58
58
|
var _useDrop = useDrop({
|
|
59
59
|
accept: 'TABLE_ROW',
|
|
@@ -122,9 +122,10 @@ var Row = function Row(_ref) {
|
|
|
122
122
|
setSelectedRowDragging && row.getIsSelected() && setSelectedRowDragging(isDragging);
|
|
123
123
|
}, [isDragging, row.getIsSelected()]);
|
|
124
124
|
var rowClickHandler = function rowClickHandler(evt) {
|
|
125
|
-
//
|
|
125
|
+
// 触发单击回调
|
|
126
126
|
onRowMouseClick === null || onRowMouseClick === void 0 || onRowMouseClick(row);
|
|
127
127
|
if (!selectRowWhenClick) {
|
|
128
|
+
// 如果配置了selectRowWhenClick这个props,单击时不选中
|
|
128
129
|
return;
|
|
129
130
|
}
|
|
130
131
|
if (canSelection) {
|
|
@@ -140,8 +141,8 @@ var Row = function Row(_ref) {
|
|
|
140
141
|
var rowClickOrDoubleClick = function rowClickOrDoubleClick(e) {
|
|
141
142
|
// console.log('rowClickOrDoubleClick');
|
|
142
143
|
if (editting) return;
|
|
143
|
-
if (onRowMouseDoubleClick) {
|
|
144
|
-
// 监听了双击事件
|
|
144
|
+
if (onRowMouseDoubleClick || canEditRowWhenDClick) {
|
|
145
|
+
// 监听了双击事件 | 双击可以编辑行
|
|
145
146
|
if (!timerRef.current) {
|
|
146
147
|
timerRef.current = setTimeout(function () {
|
|
147
148
|
rowClickHandler(e);
|
|
@@ -151,7 +152,8 @@ var Row = function Row(_ref) {
|
|
|
151
152
|
} else {
|
|
152
153
|
clearTimeout(timerRef.current);
|
|
153
154
|
timerRef.current = undefined;
|
|
154
|
-
onRowMouseDoubleClick(row);
|
|
155
|
+
onRowMouseDoubleClick === null || onRowMouseDoubleClick === void 0 || onRowMouseDoubleClick(row);
|
|
156
|
+
canEditRowWhenDClick && handleEditRowWhenDClick(row);
|
|
155
157
|
}
|
|
156
158
|
} else {
|
|
157
159
|
// 没有监听双击事件,直接触发单击逻辑
|
|
@@ -167,6 +169,7 @@ var Row = function Row(_ref) {
|
|
|
167
169
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
168
170
|
children: [/*#__PURE__*/_jsx("tr", {
|
|
169
171
|
// ref={canRowDrag && !editting ? dropRef : null}
|
|
172
|
+
id: rowEditing ? "".concat(tableId, "-tbody-tr-editing") : undefined,
|
|
170
173
|
ref: function ref(node) {
|
|
171
174
|
dropRef(node && !editting ? node : null);
|
|
172
175
|
dragRef(node && canRowDrag && !editting && !disableDragRowIds.includes(row.id) ? node : null);
|
|
@@ -178,19 +181,20 @@ var Row = function Row(_ref) {
|
|
|
178
181
|
onClick: rowClickOrDoubleClick,
|
|
179
182
|
onMouseEnter: rowMouseEnter,
|
|
180
183
|
onMouseLeave: rowMouseLeave,
|
|
181
|
-
className: "
|
|
182
|
-
return "".concat(item);
|
|
184
|
+
className: "tbody-tr ".concat(String(row.id) === String(rowSelectedId) || row.getIsSelected() ? 'tbody-tr-selected' : '', " ").concat((rowClassName === null || rowClassName === void 0 ? void 0 : rowClassName(row).map(function (item) {
|
|
185
|
+
return "".concat(item, "-").concat(theme);
|
|
183
186
|
}).join(' ')) || ''),
|
|
184
187
|
children: (_row = row["getVisibleCells"]) === null || _row === void 0 ? void 0 : _row.call(row).map(function (cell, idx) {
|
|
185
188
|
var _cell$column$columnDe = cell.column.columnDef,
|
|
186
|
-
|
|
189
|
+
columnEditable = _cell$column$columnDe.editable,
|
|
187
190
|
required = _cell$column$columnDe.required,
|
|
188
191
|
accessorKey = _cell$column$columnDe.accessorKey,
|
|
189
192
|
header = _cell$column$columnDe.header,
|
|
190
193
|
columnClassName = _cell$column$columnDe.columnClassName;
|
|
191
|
-
|
|
194
|
+
// 当前列是否编辑中
|
|
195
|
+
var columnEditing = rowEditing && columnEditable;
|
|
192
196
|
return /*#__PURE__*/_jsx("td", _objectSpread(_objectSpread({
|
|
193
|
-
className: "".concat(
|
|
197
|
+
className: "".concat(columnEditing ? 'tbody-tr-td-editting' : '', " ").concat(columnClassName ? columnClassName.join(' ') : '', " ").concat((cellClassName === null || cellClassName === void 0 ? void 0 : cellClassName(cell).map(function (item) {
|
|
194
198
|
return "".concat(item, "-").concat(theme);
|
|
195
199
|
})) || '', " tbody-tr-td"),
|
|
196
200
|
style: _objectSpread({
|
|
@@ -198,7 +202,7 @@ var Row = function Row(_ref) {
|
|
|
198
202
|
}, getPinningStyle(cell, table, false))
|
|
199
203
|
}, getCellProps === null || getCellProps === void 0 ? void 0 : getCellProps(cell.getContext())), {}, {
|
|
200
204
|
children: EditableCell(_objectSpread(_objectSpread({}, cell.column.columnDef), {}, {
|
|
201
|
-
editing:
|
|
205
|
+
editing: columnEditing,
|
|
202
206
|
dataIndex: accessorKey,
|
|
203
207
|
title: header,
|
|
204
208
|
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
@@ -206,7 +210,7 @@ var Row = function Row(_ref) {
|
|
|
206
210
|
}), cell.id);
|
|
207
211
|
})
|
|
208
212
|
}), row.getIsExpanded() && /*#__PURE__*/_jsx("tr", {
|
|
209
|
-
className:
|
|
213
|
+
className: "tbody-tr-subrow",
|
|
210
214
|
children: /*#__PURE__*/_jsx("td", {
|
|
211
215
|
colSpan: (_row2 = row["getVisibleCells"]) === null || _row2 === void 0 ? void 0 : _row2.call(row).length,
|
|
212
216
|
style: {
|
|
@@ -214,7 +218,7 @@ var Row = function Row(_ref) {
|
|
|
214
218
|
},
|
|
215
219
|
children: tableContainerWidth && /*#__PURE__*/_jsx("div", {
|
|
216
220
|
id: "".concat(tableId, "_expand-table"),
|
|
217
|
-
className:
|
|
221
|
+
className: "subRowWrapper"
|
|
218
222
|
// 减去10,避免被父表滚动条覆盖
|
|
219
223
|
,
|
|
220
224
|
style: {
|
|
@@ -1,14 +1,23 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(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); }
|
|
4
|
+
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; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
1
7
|
import { Spin } from 'antd';
|
|
8
|
+
// import { useVirtualizer } from "@tanstack/react-virtual";
|
|
9
|
+
import { useDrop } from 'react-dnd';
|
|
2
10
|
import { CustomDragLayer } from "../components/CustomDragerLayer";
|
|
11
|
+
// import RowContent from "../components/RowContent";
|
|
3
12
|
import "./index.less";
|
|
4
13
|
import Row from "./Row";
|
|
5
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
7
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
16
|
var TableBody = function TableBody(_ref) {
|
|
9
17
|
var _headerGroups;
|
|
10
18
|
var table = _ref.table,
|
|
11
19
|
tableId = _ref.tableId,
|
|
20
|
+
theme = _ref.theme,
|
|
12
21
|
reorderRow = _ref.reorderRow,
|
|
13
22
|
rowSelectedId = _ref.rowSelectedId,
|
|
14
23
|
setRowSelectedId = _ref.setRowSelectedId,
|
|
@@ -35,8 +44,6 @@ var TableBody = function TableBody(_ref) {
|
|
|
35
44
|
rowStyle = _ref.rowStyle,
|
|
36
45
|
getCellProps = _ref.getCellProps,
|
|
37
46
|
rowHeight = _ref.rowHeight,
|
|
38
|
-
editting = _ref.editting,
|
|
39
|
-
selectEditKey = _ref.selectEditKey,
|
|
40
47
|
renderSubComponent = _ref.renderSubComponent,
|
|
41
48
|
isAllRowExpanded = _ref.isAllRowExpanded,
|
|
42
49
|
onRowMouseEnter = _ref.onRowMouseEnter,
|
|
@@ -49,12 +56,12 @@ var TableBody = function TableBody(_ref) {
|
|
|
49
56
|
selectRowWhenClick = _ref.selectRowWhenClick,
|
|
50
57
|
hasVerticalScrollBar = _ref.hasVerticalScrollBar,
|
|
51
58
|
datas = _ref.datas,
|
|
52
|
-
emptyDataHeight = _ref.emptyDataHeight
|
|
59
|
+
emptyDataHeight = _ref.emptyDataHeight,
|
|
60
|
+
canEditRowWhenDClick = _ref.canEditRowWhenDClick,
|
|
61
|
+
editingRowId = _ref.editingRowId,
|
|
62
|
+
handleEditRowWhenDClick = _ref.handleEditRowWhenDClick;
|
|
53
63
|
// const tbodyRef = useRef<any>(null);
|
|
54
64
|
// const theadRef = useRef<any>(null);
|
|
55
|
-
// const { theme } = useContext(layoutContext);
|
|
56
|
-
var _dark = 'dark',
|
|
57
|
-
theme = _dark.theme;
|
|
58
65
|
var headerGroups = table.getHeaderGroups();
|
|
59
66
|
|
|
60
67
|
// const { rows } = table.getRowModel();
|
|
@@ -144,25 +151,47 @@ var TableBody = function TableBody(_ref) {
|
|
|
144
151
|
|
|
145
152
|
// console.log('object', rowVirtualizer.getVirtualItems(), rows);
|
|
146
153
|
|
|
154
|
+
var _useDrop = useDrop({
|
|
155
|
+
accept: 'TABLE_ROW',
|
|
156
|
+
drop: function drop(formDatas, monitor) {
|
|
157
|
+
return reorderRow === null || reorderRow === void 0 ? void 0 : reorderRow(formDatas, {
|
|
158
|
+
hoverRow: {
|
|
159
|
+
index: 0
|
|
160
|
+
},
|
|
161
|
+
targetTableId: tableId
|
|
162
|
+
});
|
|
163
|
+
// return reorderRow?.(draggedRow, { ...row, tableId });
|
|
164
|
+
}
|
|
165
|
+
}),
|
|
166
|
+
_useDrop2 = _slicedToArray(_useDrop, 2),
|
|
167
|
+
dropRef = _useDrop2[1];
|
|
168
|
+
var tbodyRender = function tbodyRender() {
|
|
169
|
+
if (!loading && datas.length !== 0) {
|
|
170
|
+
return TBodyContent();
|
|
171
|
+
}
|
|
172
|
+
return EmptyContent();
|
|
173
|
+
};
|
|
147
174
|
var EmptyContent = function EmptyContent() {
|
|
148
175
|
return /*#__PURE__*/_jsx("tr", {
|
|
149
|
-
className:
|
|
176
|
+
className: "empty-container",
|
|
150
177
|
style: {
|
|
151
178
|
width: table.getTotalSize()
|
|
152
179
|
},
|
|
153
180
|
children: /*#__PURE__*/_jsx("td", {
|
|
154
|
-
className:
|
|
181
|
+
className: "empty-wapper",
|
|
155
182
|
style: {
|
|
156
183
|
width: "".concat(tableContainerWidth - (hasVerticalScrollBar ? 10 : 0), "px"),
|
|
157
184
|
height: emptyDataHeight
|
|
158
185
|
},
|
|
159
|
-
children: loading ? /*#__PURE__*/_jsx(Spin, {}) : /*#__PURE__*/_jsxs(
|
|
186
|
+
children: loading ? /*#__PURE__*/_jsx(Spin, {}) : /*#__PURE__*/_jsxs("span", {
|
|
187
|
+
className: "empty-content",
|
|
188
|
+
ref: dropRef,
|
|
160
189
|
children: [/*#__PURE__*/_jsx("img", {
|
|
161
|
-
className:
|
|
190
|
+
className: "empty-img",
|
|
162
191
|
src: "/images/data-empty-".concat(theme, ".png"),
|
|
163
192
|
height: "60"
|
|
164
193
|
}), /*#__PURE__*/_jsx("span", {
|
|
165
|
-
className:
|
|
194
|
+
className: "empty-text",
|
|
166
195
|
children: "\u6682\u65E0\u6570\u636E"
|
|
167
196
|
})]
|
|
168
197
|
})
|
|
@@ -171,12 +200,14 @@ var TableBody = function TableBody(_ref) {
|
|
|
171
200
|
};
|
|
172
201
|
var TBodyContent = function TBodyContent() {
|
|
173
202
|
return table.getRowModel().rows.map(function (row) {
|
|
174
|
-
|
|
203
|
+
// 当前行是否编辑中
|
|
204
|
+
var rowEditing = row.id === editingRowId;
|
|
175
205
|
return /*#__PURE__*/_jsx(Row, {
|
|
176
206
|
table: table,
|
|
177
207
|
tableId: tableId,
|
|
178
208
|
tableContainerWidth: tableContainerWidth,
|
|
179
209
|
row: row,
|
|
210
|
+
theme: theme,
|
|
180
211
|
reorderRow: reorderRow,
|
|
181
212
|
rowSelectedId: rowSelectedId,
|
|
182
213
|
setRowSelectedId: setRowSelectedId,
|
|
@@ -187,13 +218,12 @@ var TableBody = function TableBody(_ref) {
|
|
|
187
218
|
setSelectedRowDragging: setSelectedRowDragging,
|
|
188
219
|
rowSelectionChange: rowSelectionChange,
|
|
189
220
|
canRowDrag: canRowDrag,
|
|
190
|
-
rowKey: rowKey,
|
|
191
221
|
rowClassName: rowClassName,
|
|
192
222
|
cellClassName: cellClassName,
|
|
193
223
|
rowStyle: rowStyle,
|
|
194
224
|
getCellProps: getCellProps,
|
|
195
|
-
editting:
|
|
196
|
-
|
|
225
|
+
editting: !!editingRowId,
|
|
226
|
+
rowEditing: rowEditing,
|
|
197
227
|
renderSubComponent: renderSubComponent,
|
|
198
228
|
onRowMouseEnter: onRowMouseEnter,
|
|
199
229
|
onRowMouseLeave: onRowMouseLeave,
|
|
@@ -202,24 +232,19 @@ var TableBody = function TableBody(_ref) {
|
|
|
202
232
|
rowHeight: rowHeight,
|
|
203
233
|
disableDragRowIds: disableDragRowIds,
|
|
204
234
|
selectRowWhenClick: selectRowWhenClick,
|
|
205
|
-
hasVerticalScrollBar: hasVerticalScrollBar
|
|
235
|
+
hasVerticalScrollBar: hasVerticalScrollBar,
|
|
236
|
+
handleEditRowWhenDClick: handleEditRowWhenDClick,
|
|
237
|
+
canEditRowWhenDClick: canEditRowWhenDClick
|
|
206
238
|
}, row.id);
|
|
207
239
|
});
|
|
208
240
|
};
|
|
209
|
-
var tbodyRender = function tbodyRender() {
|
|
210
|
-
if (!loading && datas.length !== 0) {
|
|
211
|
-
return TBodyContent();
|
|
212
|
-
}
|
|
213
|
-
return EmptyContent();
|
|
214
|
-
};
|
|
215
241
|
return /*#__PURE__*/_jsxs("div", {
|
|
216
|
-
className: 'table-tbody',
|
|
217
242
|
style: {
|
|
218
243
|
height: "".concat(tableBodyHeight, "px"),
|
|
219
244
|
width: table.getTotalSize()
|
|
220
245
|
},
|
|
221
246
|
children: [/*#__PURE__*/_jsx("div", {
|
|
222
|
-
children: canRowDrag && !
|
|
247
|
+
children: canRowDrag && !editingRowId && /*#__PURE__*/_jsx(CustomDragLayer, {
|
|
223
248
|
getCellProps: getCellProps,
|
|
224
249
|
rowClassName: rowClassName,
|
|
225
250
|
cellClassName: cellClassName,
|
|
@@ -241,6 +266,7 @@ var TableBody = function TableBody(_ref) {
|
|
|
241
266
|
}, header.id);
|
|
242
267
|
})
|
|
243
268
|
}), /*#__PURE__*/_jsx("tbody", {
|
|
269
|
+
id: "table-max-tableBody-tbody-".concat(tableId),
|
|
244
270
|
children: tbodyRender()
|
|
245
271
|
})]
|
|
246
272
|
})]
|
|
@@ -1,37 +1,3 @@
|
|
|
1
|
-
@globalColor0: #f5f6f7; // 文字颜色
|
|
2
|
-
@globalColor1: #05081a; // 文字颜色
|
|
3
|
-
@globalColor2: #5e6175;
|
|
4
|
-
@globalColor3: #838695;
|
|
5
|
-
@globalColor4: #dadbdf;
|
|
6
|
-
@globalColor5: #ececee; // 网格线色
|
|
7
|
-
@globalColor6: #f5f6f7;
|
|
8
|
-
@globalColor7: #ffffff; // 背景色
|
|
9
|
-
@globalColor8: #f5f6f7; // 背景衬托色
|
|
10
|
-
@globalColor9: #f7f7f9; // 网格遮罩色(passed)
|
|
11
|
-
@globalColor_18: #fdfdfe; // 网格遮罩色
|
|
12
|
-
@globalColor_10: #f5f6f7; // 网格遮罩色
|
|
13
|
-
@globalColor_11: #ececee; //
|
|
14
|
-
@globalColor_12: #838695; // 铁包运行左侧菜单线
|
|
15
|
-
@globalColor_13: #dadbdf; // 甘特图网格线颜色
|
|
16
|
-
@globalColor_14: #dadbdf; // 表头背景色
|
|
17
|
-
@globalColor_15: #C1C2CA; // 表格头线对应色
|
|
18
|
-
@globalColor_16: #F5F5F6; // 内嵌卡片背景
|
|
19
|
-
@globalColor_17: #C1C2CA; // 时间轴和工位栏颜色
|
|
20
|
-
|
|
21
|
-
@tableColor1: #212121; // 表格字体颜色
|
|
22
|
-
@tableColor2: rgba(94, 97, 117, 0.4); // 表格边框颜色
|
|
23
|
-
@tableColor3: #DADBDFFF; // 表格边框颜色
|
|
24
|
-
@tableColor4: #DADBDF7F; // 表格筛选区时间选择框分割线颜色
|
|
25
|
-
@tableColor5: #ffffff; // 表格列设置区拖拽图标颜色
|
|
26
|
-
@tableColor6: #FA541CFF; // 表格列设置区列显隐图标颜色
|
|
27
|
-
@tableColor7: #1A1D2EFF; // 表格列设置区列表元素边框颜色
|
|
28
|
-
@scrollThumb: rgba(255, 255, 255, 0.2);
|
|
29
|
-
@scrollThumbHover: rgba(255, 255, 255, 0.3);
|
|
30
|
-
@sliderRightBorder: #3e3b3b;
|
|
31
|
-
// @selectTableRow: var(--select-table-row, rgb(245 246 247 / 15%));
|
|
32
|
-
@selectTableRow: #d0e37b;
|
|
33
|
-
@globalColor_table-line: #f0f0f0; // table行分隔线颜色
|
|
34
|
-
|
|
35
1
|
table {
|
|
36
2
|
table-layout: fixed;
|
|
37
3
|
|
|
@@ -67,19 +67,19 @@ var Cell = function Cell(_ref) {
|
|
|
67
67
|
function sortingRender() {
|
|
68
68
|
return {
|
|
69
69
|
asc: /*#__PURE__*/_jsxs("span", {
|
|
70
|
-
className:
|
|
70
|
+
className: "sort-flag",
|
|
71
71
|
children: [/*#__PURE__*/_jsx("i", {
|
|
72
|
-
className:
|
|
72
|
+
className: "triangle-up triangle-up-red"
|
|
73
73
|
}), /*#__PURE__*/_jsx("i", {
|
|
74
|
-
className:
|
|
74
|
+
className: "triangle-down"
|
|
75
75
|
})]
|
|
76
76
|
}),
|
|
77
77
|
desc: /*#__PURE__*/_jsxs("span", {
|
|
78
|
-
className:
|
|
78
|
+
className: "sort-flag",
|
|
79
79
|
children: [/*#__PURE__*/_jsx("i", {
|
|
80
|
-
className:
|
|
80
|
+
className: "triangle-up"
|
|
81
81
|
}), /*#__PURE__*/_jsx("i", {
|
|
82
|
-
className:
|
|
82
|
+
className: "triangle-down triangle-down-red"
|
|
83
83
|
})]
|
|
84
84
|
})
|
|
85
85
|
}[header.column.getIsSorted()];
|
|
@@ -87,13 +87,13 @@ var Cell = function Cell(_ref) {
|
|
|
87
87
|
return /*#__PURE__*/_jsx("div", {
|
|
88
88
|
ref: dropRef,
|
|
89
89
|
children: /*#__PURE__*/_jsxs("div", {
|
|
90
|
-
className: "cell-wapper ".concat(header.column.columnDef.columns ? 'wapper-top-parent' : ''),
|
|
90
|
+
className: "cell-wapper ".concat(header.column.columnDef.columns ? 'wapper-top-parent' : '', " tableMax-cell-wrapper"),
|
|
91
91
|
ref: previewRef,
|
|
92
92
|
style: _objectSpread({
|
|
93
93
|
transform: header.column.parent || header.column.columnDef.columns || !hasGroup ? 'translateY(0px)' : 'translateY(-20px)'
|
|
94
94
|
}, getHeaderCellProps === null || getHeaderCellProps === void 0 ? void 0 : getHeaderCellProps(header.column.columnDef.columns)),
|
|
95
95
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
96
|
-
className:
|
|
96
|
+
className: "cell-left",
|
|
97
97
|
onClick: header.column.getToggleSortingHandler(),
|
|
98
98
|
style: {
|
|
99
99
|
display: 'inline-block',
|
|
@@ -101,7 +101,7 @@ var Cell = function Cell(_ref) {
|
|
|
101
101
|
},
|
|
102
102
|
children: [flexRender(header.column.columnDef.header, header.getContext()), canSorting ? sortingRender() : null]
|
|
103
103
|
}), /*#__PURE__*/_jsx("div", {
|
|
104
|
-
className:
|
|
104
|
+
className: "cell-right",
|
|
105
105
|
onClick: header.column.getToggleSortingHandler(),
|
|
106
106
|
children: header.column.id === ColumnType.Darg || header.column.id === ColumnType.Selection || header.column.id === ColumnType.PlaceHolder ? null : /*#__PURE__*/_jsx("i", {
|
|
107
107
|
ref: dragRef,
|
|
@@ -8,7 +8,6 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
8
8
|
// import { useDrag, useDrop } from 'ahooks';
|
|
9
9
|
import { useEffect, useMemo } from 'react';
|
|
10
10
|
import { Filter } from "../components/ColumnFilter";
|
|
11
|
-
// import ColumnHeader from '../components/ColumnHeader';
|
|
12
11
|
import Cell from "./Cell";
|
|
13
12
|
import "./index.less";
|
|
14
13
|
import { getPinningStyle } from "./utils";
|
|
@@ -53,7 +52,14 @@ var TableHeader = function TableHeader(_ref) {
|
|
|
53
52
|
|
|
54
53
|
// console.log(666, table.getLeftHeaderGroups(), table.getCenterHeaderGroups(), table.getRightHeaderGroups())
|
|
55
54
|
|
|
56
|
-
console.log(
|
|
55
|
+
// console.log(
|
|
56
|
+
// 'header',
|
|
57
|
+
// table.getLeftHeaderGroups(),
|
|
58
|
+
// table.getCenterHeaderGroups(),
|
|
59
|
+
// table.getRightHeaderGroups(),
|
|
60
|
+
// table.getHeaderGroups(),
|
|
61
|
+
// );
|
|
62
|
+
|
|
57
63
|
return /*#__PURE__*/_jsxs("table", {
|
|
58
64
|
style: {
|
|
59
65
|
width: table.getTotalSize() + hasVerticalScrollBar ? 10 : 0
|
|
@@ -73,7 +79,7 @@ var TableHeader = function TableHeader(_ref) {
|
|
|
73
79
|
}), /*#__PURE__*/_jsxs("thead", {
|
|
74
80
|
children: [headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups.map(function (headerGroup) {
|
|
75
81
|
return /*#__PURE__*/_jsxs("tr", {
|
|
76
|
-
className:
|
|
82
|
+
className: "table-thead-tr cus-table-thead-tr",
|
|
77
83
|
style: {
|
|
78
84
|
height: hasGroup && headerGroup.depth === 0 ? '40px' : 'auto',
|
|
79
85
|
width: '100%'
|
|
@@ -98,10 +104,10 @@ var TableHeader = function TableHeader(_ref) {
|
|
|
98
104
|
}, "scroll") : null]
|
|
99
105
|
}, headerGroup.id);
|
|
100
106
|
}), canFilter && enableFilters ? /*#__PURE__*/_jsxs("tr", {
|
|
101
|
-
className:
|
|
107
|
+
className: "table-filter-tr",
|
|
102
108
|
children: [headerGroups === null || headerGroups === void 0 || (_headerGroups2 = headerGroups[headerGroups.length - 1]) === null || _headerGroups2 === void 0 || (_headerGroups2 = _headerGroups2.headers) === null || _headerGroups2 === void 0 ? void 0 : _headerGroups2.map(function (header) {
|
|
103
109
|
return /*#__PURE__*/_jsx("th", {
|
|
104
|
-
className:
|
|
110
|
+
className: "table-filter-th",
|
|
105
111
|
style: _objectSpread({}, getPinningStyle(header, table, hasVerticalScrollBar)),
|
|
106
112
|
children: header.column.getCanFilter() ? /*#__PURE__*/_jsx("div", {
|
|
107
113
|
children: /*#__PURE__*/_jsx(Filter, {
|
|
@@ -1,38 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
@globalColor1: #05081a; // 文字颜色
|
|
3
|
-
@globalColor2: #5e6175;
|
|
4
|
-
@globalColor3: #838695;
|
|
5
|
-
@globalColor4: #dadbdf;
|
|
6
|
-
@globalColor5: #ececee; // 网格线色
|
|
7
|
-
@globalColor6: #f5f6f7;
|
|
8
|
-
@globalColor7: #ffffff; // 背景色
|
|
9
|
-
@globalColor8: #f5f6f7; // 背景衬托色
|
|
10
|
-
@globalColor9: #f7f7f9; // 网格遮罩色(passed)
|
|
11
|
-
@globalColor_18: #fdfdfe; // 网格遮罩色
|
|
12
|
-
@globalColor_10: #f5f6f7; // 网格遮罩色
|
|
13
|
-
@globalColor_11: #ececee; //
|
|
14
|
-
@globalColor_12: #838695; // 铁包运行左侧菜单线
|
|
15
|
-
@globalColor_13: #dadbdf; // 甘特图网格线颜色
|
|
16
|
-
@globalColor_14: #dadbdf; // 表头背景色
|
|
17
|
-
@globalColor_15: #C1C2CA; // 表格头线对应色
|
|
18
|
-
@globalColor_16: #F5F5F6; // 内嵌卡片背景
|
|
19
|
-
@globalColor_17: #C1C2CA; // 时间轴和工位栏颜色
|
|
20
|
-
|
|
21
|
-
@tableColor1: #212121; // 表格字体颜色
|
|
22
|
-
@tableColor2: rgba(94, 97, 117, 0.4); // 表格边框颜色
|
|
23
|
-
@tableColor3: #DADBDFFF; // 表格边框颜色
|
|
24
|
-
@tableColor4: #DADBDF7F; // 表格筛选区时间选择框分割线颜色
|
|
25
|
-
@tableColor5: #ffffff; // 表格列设置区拖拽图标颜色
|
|
26
|
-
@tableColor6: #FA541CFF; // 表格列设置区列显隐图标颜色
|
|
27
|
-
@tableColor7: #1A1D2EFF; // 表格列设置区列表元素边框颜色
|
|
28
|
-
|
|
29
|
-
@scrollThumb: rgba(255, 255, 255, 0.2);
|
|
30
|
-
@scrollThumbHover: rgba(255, 255, 255, 0.3);
|
|
31
|
-
@sliderRightBorder: #3e3b3b;
|
|
32
|
-
// @selectTableRow: var(--select-table-row, rgb(245 246 247 / 15%));
|
|
33
|
-
@selectTableRow: #d0e37b;
|
|
34
|
-
@globalColor_table-line: #f0f0f0; // table行分隔线颜色
|
|
35
|
-
|
|
36
1
|
table {
|
|
37
2
|
table-layout: fixed;
|
|
38
3
|
// background: @globalColor_14;
|
|
@@ -60,6 +25,7 @@ table {
|
|
|
60
25
|
font-weight: 400;
|
|
61
26
|
padding: 0 8px;
|
|
62
27
|
text-align: left;
|
|
28
|
+
border-bottom: 1px solid @tableColor2;
|
|
63
29
|
|
|
64
30
|
.cell-left {
|
|
65
31
|
flex: 1;
|
|
@@ -77,6 +43,8 @@ table {
|
|
|
77
43
|
display: none;
|
|
78
44
|
// opacity: 0;
|
|
79
45
|
cursor: move;
|
|
46
|
+
position: absolute;
|
|
47
|
+
right: 5px;
|
|
80
48
|
}
|
|
81
49
|
|
|
82
50
|
&:hover .drag-handler {
|
|
@@ -143,6 +111,12 @@ table {
|
|
|
143
111
|
}
|
|
144
112
|
}
|
|
145
113
|
|
|
114
|
+
.table-thead-tr:nth-last-child(2) {
|
|
115
|
+
.tableMax-cell-wrapper {
|
|
116
|
+
border-bottom: none !important;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
146
120
|
.table-filter-tr {
|
|
147
121
|
border-top: 1px solid @tableColor2;
|
|
148
122
|
|
|
@@ -151,62 +125,62 @@ table {
|
|
|
151
125
|
vertical-align: top;
|
|
152
126
|
padding: 6px 2px;
|
|
153
127
|
|
|
154
|
-
:global {
|
|
155
|
-
.custom-light-select:not(.custom-light-select-customize-input) .custom-light-select-selector {
|
|
156
|
-
border-radius: 2px;
|
|
157
|
-
background-color: #F5F6F7FF;
|
|
158
|
-
padding: 0 2px;
|
|
159
|
-
}
|
|
160
128
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
129
|
+
.custom-light-select:not(.custom-light-select-customize-input) .custom-light-select-selector {
|
|
130
|
+
border-radius: 2px;
|
|
131
|
+
background-color: #F5F6F7FF;
|
|
132
|
+
padding: 0 2px;
|
|
133
|
+
}
|
|
166
134
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
135
|
+
.custom-dark-select:not(.custom-dark-select-customize-input) .custom-dark-select-selector {
|
|
136
|
+
border-radius: 2px;
|
|
137
|
+
background-color: #494C5DFF;
|
|
138
|
+
padding: 0 2px;
|
|
139
|
+
}
|
|
172
140
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
141
|
+
.custom-light-input-number {
|
|
142
|
+
width: 100% !important;
|
|
143
|
+
border-radius: 2px;
|
|
144
|
+
background-color: #F5F6F7FF;
|
|
145
|
+
}
|
|
178
146
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
147
|
+
.custom-dark-input-number {
|
|
148
|
+
width: 100% !important;
|
|
149
|
+
border-radius: 2px;
|
|
150
|
+
background-color: #494C5DFF;
|
|
151
|
+
}
|
|
183
152
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
153
|
+
.custom-dark-select-single .custom-dark-select-selector .custom-dark-select-selection-search {
|
|
154
|
+
left: 2px;
|
|
155
|
+
right: 2px;
|
|
156
|
+
}
|
|
187
157
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
158
|
+
.custom-dark-select-single .custom-dark-select-clear {
|
|
159
|
+
background: transparent;
|
|
160
|
+
}
|
|
192
161
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
162
|
+
.custom-light-select-single .custom-light-select-selector .custom-light-select-selection-search {
|
|
163
|
+
left: 2px;
|
|
164
|
+
right: 2px;
|
|
165
|
+
}
|
|
197
166
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
167
|
+
.custom-dark-picker {
|
|
168
|
+
padding: 4px;
|
|
169
|
+
background: #494C5DFF;
|
|
170
|
+
}
|
|
201
171
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
172
|
+
.custom-dark-picker-input .custom-dark-picker-clear {
|
|
173
|
+
background: #494C5DFF;
|
|
174
|
+
}
|
|
206
175
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
176
|
+
.custom-light-picker {
|
|
177
|
+
padding: 4px;
|
|
178
|
+
background: #F5F6F7FF;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.custom-light-picker-input .custom-light-picker-clear {
|
|
182
|
+
background: #F5F6F7FF;
|
|
210
183
|
}
|
|
211
184
|
}
|
|
185
|
+
|
|
212
186
|
}
|