@arim-aisdc/public-components 2.3.33 → 2.3.35
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/components/BaseInfo/BaseInfo.d.ts +1 -1
- package/dist/components/ConfigProvider/context.d.ts +1 -0
- package/dist/components/TableMax/TableBody/Row.js +8 -6
- package/dist/components/TableMax/TableBody/index.js +25 -3
- package/dist/components/TableMax/TableMax.js +5 -3
- package/dist/components/TableMax/components/ColumnFilterV2/customFilterFns.d.ts +1 -0
- package/dist/components/TableMax/components/ColumnFilterV2/customFilterFns.js +12 -1
- package/dist/components/TableMax/components/ColumnFilterV2/index.js +1 -1
- package/dist/components/TableMax/components/ColumnSort/customSortFns.d.ts +8 -8
- package/package.json +1 -1
- /package/dist/components/TableMax/TableBody/{Row copy.d.ts → Row1.d.ts} +0 -0
- /package/dist/components/TableMax/TableBody/{Row copy.js → Row1.js} +0 -0
|
@@ -17,7 +17,7 @@ export declare const foramtBaseInfoField: (data: any, dataField: BaseInfoFieldTy
|
|
|
17
17
|
value: any;
|
|
18
18
|
field: string;
|
|
19
19
|
label?: string;
|
|
20
|
-
text: string | Element |
|
|
20
|
+
text: string | JSX.Element | Element;
|
|
21
21
|
units?: string;
|
|
22
22
|
width?: string;
|
|
23
23
|
labelWidth?: string;
|
|
@@ -246,7 +246,7 @@ var Row = function Row(_ref) {
|
|
|
246
246
|
} else if (Object.keys(selectionConfig).length > 1) {
|
|
247
247
|
delete selectionConfig[row.id];
|
|
248
248
|
}
|
|
249
|
-
setRowSelection(
|
|
249
|
+
// setRowSelection({ ...selectionConfig });
|
|
250
250
|
}, [row, table]);
|
|
251
251
|
var handleShiftSelection = useCallback(function () {
|
|
252
252
|
var min = Math.min(initselectedIndex || 0, row.index);
|
|
@@ -257,11 +257,12 @@ var Row = function Row(_ref) {
|
|
|
257
257
|
}).forEach(function (row) {
|
|
258
258
|
selectionConfig[row.id] = true;
|
|
259
259
|
});
|
|
260
|
-
|
|
260
|
+
|
|
261
|
+
// setRowSelection(selectionConfig);
|
|
261
262
|
}, [row, table]);
|
|
262
263
|
var handleSingleRowSelection = useCallback(function () {
|
|
263
264
|
initselectedIndex = row.index;
|
|
264
|
-
setRowSelection(
|
|
265
|
+
// setRowSelection({ [row?.id]: true });
|
|
265
266
|
}, [row, table]);
|
|
266
267
|
var handleShiftSelectionWithCheckbox = useCallback(function () {
|
|
267
268
|
var selectionConfig = _objectSpread({}, table.getState().rowSelection);
|
|
@@ -272,7 +273,8 @@ var Row = function Row(_ref) {
|
|
|
272
273
|
}).forEach(function (row) {
|
|
273
274
|
selectionConfig[row.id] = true;
|
|
274
275
|
});
|
|
275
|
-
|
|
276
|
+
|
|
277
|
+
// setRowSelection(selectionConfig);
|
|
276
278
|
}, [row, table]);
|
|
277
279
|
var handleToggleSelection = useCallback(function () {
|
|
278
280
|
if (!row.getIsSelected()) {
|
|
@@ -280,7 +282,7 @@ var Row = function Row(_ref) {
|
|
|
280
282
|
}
|
|
281
283
|
var selectionConfig = _objectSpread(_objectSpread({}, table.getState().rowSelection), {}, _defineProperty({}, row.id, !row.getIsSelected()));
|
|
282
284
|
if (row.getCanSelect()) {
|
|
283
|
-
setRowSelection(selectionConfig);
|
|
285
|
+
// setRowSelection(selectionConfig);
|
|
284
286
|
}
|
|
285
287
|
}, [row, table]);
|
|
286
288
|
var handleSingleSelection = useCallback(function (evt) {
|
|
@@ -390,7 +392,7 @@ var Row = function Row(_ref) {
|
|
|
390
392
|
className: rowClassNames,
|
|
391
393
|
children: row.getVisibleCells().map(renderCell)
|
|
392
394
|
});
|
|
393
|
-
}, [row, rowEditing, tableId, editting, canRowDrag, disableDragRowIds, isDragging, selectedRowDragging, rowStyle, handleRowClick, rowMouseEnter, rowMouseLeave, rowClassNames, leftLastColumnId, rightFirstColumnId, cellClassName, theme, rowHeight, table, handleCellRightClick, getCellProps, tableTooltip, onEditValueChange, dateFormat]);
|
|
395
|
+
}, [row, rowEditing, tableId, editting, canRowDrag, disableDragRowIds, isDragging, selectedRowDragging, rowStyle, handleRowClick, rowMouseEnter, rowMouseLeave, rowClassNames, leftLastColumnId, rightFirstColumnId, cellClassName, theme, rowHeight, table, handleCellRightClick, getCellProps, tableTooltip, onEditValueChange, dateFormat, row.getVisibleCells(), row.getIsSelected(), row.getValue(), row.renderValue()]);
|
|
394
396
|
var rowCom = function rowCom() {
|
|
395
397
|
var renderCell = function renderCell(cell) {
|
|
396
398
|
var _cellClassName2;
|
|
@@ -18,7 +18,7 @@ import { CustomDragLayer } from "../components/CustomDragerLayer";
|
|
|
18
18
|
// import RowContent from "../components/RowContent";
|
|
19
19
|
import { DropSide } from "../type";
|
|
20
20
|
import { events, useEventBus } from "../../..";
|
|
21
|
-
import React, { useCallback, useMemo, useState } from 'react';
|
|
21
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
22
22
|
import { createPortal } from 'react-dom';
|
|
23
23
|
import { useConfig } from "../../ConfigProvider";
|
|
24
24
|
import Empty from "../../Empty";
|
|
@@ -181,6 +181,9 @@ var TableBody = function TableBody(_ref) {
|
|
|
181
181
|
visible: false
|
|
182
182
|
}));
|
|
183
183
|
}, []);
|
|
184
|
+
useEffect(function () {
|
|
185
|
+
console.log("emptyTheme-tableMax", theme);
|
|
186
|
+
}, [theme]);
|
|
184
187
|
|
|
185
188
|
// useEffect(() => {
|
|
186
189
|
// if (tbodyRef.current) {
|
|
@@ -307,6 +310,7 @@ var TableBody = function TableBody(_ref) {
|
|
|
307
310
|
_useDrop4 = _slicedToArray(_useDrop3, 2),
|
|
308
311
|
dropTableEmptyRef = _useDrop4[1];
|
|
309
312
|
var LoadingAndEmptyContent = function LoadingAndEmptyContent() {
|
|
313
|
+
console.log('emptyTheme0');
|
|
310
314
|
return /*#__PURE__*/_jsx("div", {
|
|
311
315
|
className: "empty-container",
|
|
312
316
|
style: {
|
|
@@ -389,7 +393,7 @@ var TableBody = function TableBody(_ref) {
|
|
|
389
393
|
// console.log('rowHeight :>>', rowHeight);
|
|
390
394
|
|
|
391
395
|
var TableRow = useMemo(function () {
|
|
392
|
-
console.log(
|
|
396
|
+
console.log(table.getRowModel().rows, 'TableRow');
|
|
393
397
|
return table.getRowModel().rows;
|
|
394
398
|
}, [table, table.getState().rowSelection]);
|
|
395
399
|
return (
|
|
@@ -485,7 +489,25 @@ var TableBody = function TableBody(_ref) {
|
|
|
485
489
|
})]
|
|
486
490
|
})]
|
|
487
491
|
})
|
|
488
|
-
}) :
|
|
492
|
+
}) : /*#__PURE__*/_jsx("div", {
|
|
493
|
+
className: "empty-container",
|
|
494
|
+
style: {
|
|
495
|
+
width: table.getTotalSize()
|
|
496
|
+
},
|
|
497
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
498
|
+
className: "empty-wrapper",
|
|
499
|
+
style: {
|
|
500
|
+
width: "".concat(tableContainerWidth - 10, "px")
|
|
501
|
+
},
|
|
502
|
+
children: loading ? /*#__PURE__*/_jsx(Spin, {}) : /*#__PURE__*/_jsx("span", {
|
|
503
|
+
className: "empty-content",
|
|
504
|
+
ref: dropEmptyRef,
|
|
505
|
+
children: /*#__PURE__*/_jsx(Empty, {})
|
|
506
|
+
})
|
|
507
|
+
})
|
|
508
|
+
})
|
|
509
|
+
// LoadingAndEmptyContent()
|
|
510
|
+
, /*#__PURE__*/_jsx(ContextMenu, _objectSpread(_objectSpread({}, contextMenuData), {}, {
|
|
489
511
|
onClickContextMenu: onClickContextMenu,
|
|
490
512
|
closeContextMenu: closeContextMenu
|
|
491
513
|
}))]
|
|
@@ -216,10 +216,12 @@ var TableMax = function TableMax(_ref) {
|
|
|
216
216
|
var tableMaxConfig = useMemo(function () {
|
|
217
217
|
var _ref2 = tableMax || {},
|
|
218
218
|
globalPageSizeOptions = _ref2.pageSizeOptions,
|
|
219
|
-
cacheMaxAge = _ref2.cacheMaxAge
|
|
219
|
+
cacheMaxAge = _ref2.cacheMaxAge,
|
|
220
|
+
openMemo = _ref2.openMemo;
|
|
220
221
|
return {
|
|
221
222
|
globalPageSizeOptions: globalPageSizeOptions,
|
|
222
|
-
cacheMaxAge: cacheMaxAge
|
|
223
|
+
cacheMaxAge: cacheMaxAge,
|
|
224
|
+
openMemo: openMemo
|
|
223
225
|
};
|
|
224
226
|
}, [JSON.stringify(tableMax)]);
|
|
225
227
|
|
|
@@ -1069,7 +1071,7 @@ var TableMax = function TableMax(_ref) {
|
|
|
1069
1071
|
hasTotalRow: hasTotalRow,
|
|
1070
1072
|
totalDatas: totalDatas,
|
|
1071
1073
|
setRowSelection: setRowSelection,
|
|
1072
|
-
openMemo: openMemo
|
|
1074
|
+
openMemo: openMemo !== null && openMemo !== void 0 ? openMemo : tableMaxConfig === null || tableMaxConfig === void 0 ? void 0 : tableMaxConfig.openMemo
|
|
1073
1075
|
};
|
|
1074
1076
|
var changeCompactMode = function changeCompactMode() {
|
|
1075
1077
|
setCompactMode(!compactMode);
|
|
@@ -3,5 +3,6 @@ declare const customFilterFns: {
|
|
|
3
3
|
fuzzyFilter: (row: any, columnId: any, filterValue: any) => boolean;
|
|
4
4
|
multiSelectFilter: (row: any, columnId: any, filterValue: any) => any;
|
|
5
5
|
numberRangeFilter: (row: any, columnId: any, filterValue: any) => boolean;
|
|
6
|
+
singleSelectFilter: (row: any, columnId: any, filterValue: any) => boolean;
|
|
6
7
|
};
|
|
7
8
|
export default customFilterFns;
|
|
@@ -15,6 +15,16 @@ var fuzzyFilter = function fuzzyFilter(row, columnId, filterValue) {
|
|
|
15
15
|
return rowStringValue.toUpperCase().indexOf(filterStringValue.toUpperCase().trim()) !== -1;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
+
// singleSelect使用的模糊筛选
|
|
19
|
+
var singleSelectFilter = function singleSelectFilter(row, columnId, filterValue) {
|
|
20
|
+
var _row$getValue2;
|
|
21
|
+
var value = filterValue.filterValue;
|
|
22
|
+
var filterStringValue = (value !== null && value !== void 0 ? value : '') + '';
|
|
23
|
+
var rowStringValue = ((_row$getValue2 = row.getValue(columnId)) !== null && _row$getValue2 !== void 0 ? _row$getValue2 : '') + '';
|
|
24
|
+
// console.log('object :>> ', rowStringValue, filterStringValue);
|
|
25
|
+
return rowStringValue.toUpperCase().indexOf(filterStringValue.toUpperCase().trim()) !== -1;
|
|
26
|
+
};
|
|
27
|
+
|
|
18
28
|
// 多选筛选
|
|
19
29
|
var multiSelectFilter = function multiSelectFilter(row, columnId, filterValue) {
|
|
20
30
|
var rowValue = row.getValue(columnId);
|
|
@@ -49,6 +59,7 @@ var customFilterFns = {
|
|
|
49
59
|
timeRangeFilter: timeRangeFilter,
|
|
50
60
|
fuzzyFilter: fuzzyFilter,
|
|
51
61
|
multiSelectFilter: multiSelectFilter,
|
|
52
|
-
numberRangeFilter: numberRangeFilter
|
|
62
|
+
numberRangeFilter: numberRangeFilter,
|
|
63
|
+
singleSelectFilter: singleSelectFilter
|
|
53
64
|
};
|
|
54
65
|
export default customFilterFns;
|
|
@@ -36,7 +36,7 @@ export var FilterType = /*#__PURE__*/function (FilterType) {
|
|
|
36
36
|
return FilterType;
|
|
37
37
|
}({}); // 输入框
|
|
38
38
|
// 不同筛选类型需要特定的过滤函数
|
|
39
|
-
var FILTER_FN_ENUM = (_FILTER_FN_ENUM = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_FILTER_FN_ENUM, FilterType.Date, 'timeRangeFilter'), FilterType.DateRange, 'timeRangeFilter'), FilterType.SingleDate, 'fuzzyFilter'), FilterType.MultiSelect, 'multiSelectFilter'), FilterType.Integer, 'numberRangeFilter'), FilterType.NumberRange, 'numberRangeFilter'), FilterType.SingleInteger, 'fuzzyFilter'), FilterType.SingleNumber, 'fuzzyFilter'), FilterType.SingleSelect, '
|
|
39
|
+
var FILTER_FN_ENUM = (_FILTER_FN_ENUM = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_FILTER_FN_ENUM, FilterType.Date, 'timeRangeFilter'), FilterType.DateRange, 'timeRangeFilter'), FilterType.SingleDate, 'fuzzyFilter'), FilterType.MultiSelect, 'multiSelectFilter'), FilterType.Integer, 'numberRangeFilter'), FilterType.NumberRange, 'numberRangeFilter'), FilterType.SingleInteger, 'fuzzyFilter'), FilterType.SingleNumber, 'fuzzyFilter'), FilterType.SingleSelect, 'singleSelectFilter'), FilterType.AutoComplete, 'fuzzyFilter'), _defineProperty(_FILTER_FN_ENUM, FilterType.Input, 'fuzzyFilter'));
|
|
40
40
|
|
|
41
41
|
// 给columns配置填充默认的过滤函数
|
|
42
42
|
export function setDefaultFilterFn(columns) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { TableMaxColumnType } from "../../type";
|
|
2
|
-
export declare const numberSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
3
|
-
export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
4
|
-
export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
5
|
-
export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
2
|
+
export declare const numberSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
|
|
3
|
+
export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
|
|
4
|
+
export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
|
|
5
|
+
export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
|
|
6
6
|
declare const customSortFns: {
|
|
7
|
-
numberSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
8
|
-
stringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
9
|
-
timeSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
10
|
-
numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
7
|
+
numberSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
|
|
8
|
+
stringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
|
|
9
|
+
timeSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
|
|
10
|
+
numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
|
|
11
11
|
};
|
|
12
12
|
export default customSortFns;
|
|
13
13
|
export type SortFnType = keyof typeof customSortFns | undefined;
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|