@arim-aisdc/public-components 2.3.36 → 2.3.37
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/TableMax/TableBody/Row.js +6 -4
- package/dist/components/TableMax/TableBody/index.d.ts +0 -1
- package/dist/components/TableMax/TableBody/index.js +4 -3
- package/dist/components/TableMax/components/ColumnSort/customSortFns.d.ts +8 -8
- package/package.json +1 -1
|
@@ -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 |
|
|
20
|
+
text: string | Element | JSX.Element;
|
|
21
21
|
units?: string;
|
|
22
22
|
width?: string;
|
|
23
23
|
labelWidth?: string;
|
|
@@ -327,7 +327,7 @@ var Row = function Row(_ref) {
|
|
|
327
327
|
}, []);
|
|
328
328
|
|
|
329
329
|
// 优化:将行渲染逻辑提取为useMemo
|
|
330
|
-
var rowComMemo =
|
|
330
|
+
var rowComMemo = useCallback(function (row) {
|
|
331
331
|
var renderCell = function renderCell(cell) {
|
|
332
332
|
var _cellClassName;
|
|
333
333
|
var _cell$column$columnDe = cell.column.columnDef,
|
|
@@ -392,7 +392,9 @@ var Row = function Row(_ref) {
|
|
|
392
392
|
className: rowClassNames,
|
|
393
393
|
children: row.getVisibleCells().map(renderCell)
|
|
394
394
|
});
|
|
395
|
-
}, [
|
|
395
|
+
}, [rowEditing, tableId, editting, canRowDrag, disableDragRowIds, isDragging, selectedRowDragging, rowStyle, handleRowClick, rowMouseEnter, rowMouseLeave, rowClassNames, leftLastColumnId, rightFirstColumnId, cellClassName, theme, rowHeight, table, handleCellRightClick, getCellProps, tableTooltip, onEditValueChange, dateFormat
|
|
396
|
+
// row, row.getVisibleCells(), row.getIsSelected(), row.getValue(), row.renderValue()
|
|
397
|
+
]);
|
|
396
398
|
var rowCom = function rowCom() {
|
|
397
399
|
var renderCell = function renderCell(cell) {
|
|
398
400
|
var _cellClassName2;
|
|
@@ -469,8 +471,8 @@ var Row = function Row(_ref) {
|
|
|
469
471
|
getPopupContainer: function getPopupContainer() {
|
|
470
472
|
return tableBodyRef.current || document.body;
|
|
471
473
|
},
|
|
472
|
-
children: openMemo ? rowComMemo : rowCom()
|
|
473
|
-
})) : openMemo ? rowComMemo : rowCom(), row.getIsExpanded() && /*#__PURE__*/_jsx("tr", {
|
|
474
|
+
children: openMemo ? rowComMemo(row) : rowCom()
|
|
475
|
+
})) : openMemo ? rowComMemo(row) : rowCom(), row.getIsExpanded() && /*#__PURE__*/_jsx("tr", {
|
|
474
476
|
className: "tbody-tr-subrow",
|
|
475
477
|
children: /*#__PURE__*/_jsx("td", {
|
|
476
478
|
colSpan: row.getVisibleCells().length,
|
|
@@ -78,4 +78,3 @@ type TableBodyPropsType = {
|
|
|
78
78
|
};
|
|
79
79
|
declare const TableBody: ({ tableBodyRef, table, tableId, theme, reorderRow, rowSelectedId, setRowSelectedId, rowHighLightId, setRowHighLightId, selectedRowChange, onSelectChange, canSelection, selectionWithoutChecked, tableContainerWidth, selectedRowDragging, setSelectedRowDragging, canRowDrag, rowKey, loading, rowClassName, cellClassName, rowStyle, getCellProps, rowHeight, renderSubComponent, onRowMouseEnter, onRowMouseLeave, onRowMouseClick, onRowMouseDoubleClick, disableDragRowIds, selectRowWhenClick, datas, canEditRowWhenDClick, editingRowId, handleEditRowWhenDClick, dragBeforeStart, shadowColumnInfo, getContextMenu, onClickContextMenu, getRowHoverTipConfig, tableTooltip, compactMode, onEditValueChange, hasTotalRow, totalDatas, setRowSelection, openMemo }: TableBodyPropsType) => import("react/jsx-runtime").JSX.Element;
|
|
80
80
|
export default TableBody;
|
|
81
|
-
export declare const MemoizedTableBody: ({ tableBodyRef, table, tableId, theme, reorderRow, rowSelectedId, setRowSelectedId, rowHighLightId, setRowHighLightId, selectedRowChange, onSelectChange, canSelection, selectionWithoutChecked, tableContainerWidth, selectedRowDragging, setSelectedRowDragging, canRowDrag, rowKey, loading, rowClassName, cellClassName, rowStyle, getCellProps, rowHeight, renderSubComponent, onRowMouseEnter, onRowMouseLeave, onRowMouseClick, onRowMouseDoubleClick, disableDragRowIds, selectRowWhenClick, datas, canEditRowWhenDClick, editingRowId, handleEditRowWhenDClick, dragBeforeStart, shadowColumnInfo, getContextMenu, onClickContextMenu, getRowHoverTipConfig, tableTooltip, compactMode, onEditValueChange, hasTotalRow, totalDatas, setRowSelection, openMemo }: TableBodyPropsType) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -517,6 +517,7 @@ var TableBody = function TableBody(_ref) {
|
|
|
517
517
|
export default TableBody;
|
|
518
518
|
// export default React.memo(TableBody, (prev, next) => prev.table.getState() !== next.table.getState() );
|
|
519
519
|
|
|
520
|
-
export
|
|
521
|
-
|
|
522
|
-
|
|
520
|
+
// export const MemoizedTableBody = React.memo(
|
|
521
|
+
// TableBody,
|
|
522
|
+
// (prev, next) => prev.table.options.data === next.table.options.data
|
|
523
|
+
// ) as typeof TableBody
|
|
@@ -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) => 0 | 1 | -1;
|
|
3
|
+
export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
4
|
+
export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
5
|
+
export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -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) => 0 | 1 | -1;
|
|
8
|
+
stringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
9
|
+
timeSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
10
|
+
numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
11
11
|
};
|
|
12
12
|
export default customSortFns;
|
|
13
13
|
export type SortFnType = keyof typeof customSortFns | undefined;
|