es-grid-template 1.8.64 → 1.8.66
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/es/grid-component/TempTable.d.ts +2 -2
- package/es/grid-component/TempTable.js +5 -5
- package/es/grid-component/hooks/index.js +0 -1
- package/es/grid-component/hooks/useLazyKVMap.d.ts +1 -1
- package/es/grid-component/hooks/useLazyKVMap.js +0 -4
- package/es/grid-component/hooks/utils.d.ts +1 -8
- package/es/grid-component/hooks/utils.js +176 -144
- package/es/grid-component/index.d.ts +1 -1
- package/es/grid-component/index.js +0 -4
- package/es/grid-component/styles.scss +1394 -1394
- package/es/grid-component/type.d.ts +0 -407
- package/es/grid-component/type.js +490 -1
- package/es/table-component/type.d.ts +10 -0
- package/es/{grid-component → table-virtuoso}/ColumnsGroup/ColumnsGroup.js +4 -3
- package/es/{grid-component → table-virtuoso}/InternalTable.d.ts +2 -3
- package/es/table-virtuoso/InternalTable.js +391 -0
- package/es/table-virtuoso/body/TableBodyCell.d.ts +14 -0
- package/es/table-virtuoso/body/TableBodyCell.js +457 -0
- package/es/table-virtuoso/body/TableBodyRow.d.ts +13 -0
- package/es/table-virtuoso/body/TableBodyRow.js +112 -0
- package/es/table-virtuoso/footer/TableFooterCell.d.ts +7 -0
- package/es/table-virtuoso/footer/TableFooterCell.js +54 -0
- package/es/table-virtuoso/header/TableHeadCell.d.ts +14 -0
- package/es/table-virtuoso/header/TableHeadCell.js +265 -0
- package/es/table-virtuoso/header/renderFilter.d.ts +20 -0
- package/es/table-virtuoso/header/renderFilter.js +289 -0
- package/es/table-virtuoso/hook/constant.d.ts +73 -0
- package/es/table-virtuoso/hook/constant.js +240 -0
- package/es/table-virtuoso/hook/convert.d.ts +1 -0
- package/es/table-virtuoso/hook/convert.js +28 -0
- package/es/table-virtuoso/hook/useColumns.d.ts +28 -0
- package/es/table-virtuoso/hook/useColumns.js +302 -0
- package/es/table-virtuoso/hook/useFilterOperator.d.ts +7 -0
- package/es/table-virtuoso/hook/useFilterOperator.js +33 -0
- package/es/table-virtuoso/hook/utils.d.ts +159 -0
- package/es/table-virtuoso/hook/utils.js +2263 -0
- package/es/table-virtuoso/index.d.ts +2 -0
- package/es/table-virtuoso/index.js +2 -0
- package/es/table-virtuoso/style.d.ts +22 -0
- package/es/table-virtuoso/style.js +12 -0
- package/es/table-virtuoso/style.scss +1441 -0
- package/es/table-virtuoso/table/Grid.d.ts +37 -0
- package/es/table-virtuoso/table/Grid.js +298 -0
- package/es/table-virtuoso/table/TableContainer.d.ts +49 -0
- package/es/table-virtuoso/table/TableContainer.js +292 -0
- package/es/table-virtuoso/table/TableWrapper.d.ts +22 -0
- package/es/table-virtuoso/table/TableWrapper.js +161 -0
- package/es/table-virtuoso/type.d.ts +0 -0
- package/es/table-virtuoso/type.js +785 -0
- package/es/table-virtuoso/useContext.d.ts +97 -0
- package/es/table-virtuoso/useContext.js +21 -0
- package/lib/grid-component/TempTable.d.ts +2 -2
- package/lib/grid-component/TempTable.js +5 -7
- package/lib/grid-component/hooks/useLazyKVMap.d.ts +1 -1
- package/lib/grid-component/hooks/useLazyKVMap.js +0 -3
- package/lib/grid-component/hooks/utils.d.ts +1 -8
- package/lib/grid-component/hooks/utils.js +179 -152
- package/lib/grid-component/index.d.ts +1 -1
- package/lib/grid-component/index.js +0 -3
- package/lib/grid-component/styles.scss +1394 -1394
- package/lib/grid-component/type.d.ts +0 -407
- package/lib/grid-component/type.js +490 -4
- package/lib/table-component/type.d.ts +10 -0
- package/lib/{grid-component → table-virtuoso}/ColumnsGroup/ColumnsGroup.js +4 -3
- package/lib/{grid-component → table-virtuoso}/InternalTable.d.ts +2 -3
- package/lib/table-virtuoso/InternalTable.js +400 -0
- package/lib/table-virtuoso/body/TableBodyCell.d.ts +14 -0
- package/lib/table-virtuoso/body/TableBodyCell.js +464 -0
- package/lib/table-virtuoso/body/TableBodyRow.d.ts +13 -0
- package/lib/table-virtuoso/body/TableBodyRow.js +119 -0
- package/lib/table-virtuoso/footer/TableFooterCell.d.ts +7 -0
- package/lib/table-virtuoso/footer/TableFooterCell.js +63 -0
- package/lib/table-virtuoso/header/TableHeadCell.d.ts +14 -0
- package/lib/table-virtuoso/header/TableHeadCell.js +274 -0
- package/lib/table-virtuoso/header/renderFilter.d.ts +20 -0
- package/lib/table-virtuoso/header/renderFilter.js +299 -0
- package/lib/table-virtuoso/hook/constant.d.ts +73 -0
- package/lib/table-virtuoso/hook/constant.js +247 -0
- package/lib/table-virtuoso/hook/convert.d.ts +1 -0
- package/lib/table-virtuoso/hook/convert.js +34 -0
- package/lib/table-virtuoso/hook/useColumns.d.ts +28 -0
- package/lib/table-virtuoso/hook/useColumns.js +315 -0
- package/lib/table-virtuoso/hook/useFilterOperator.d.ts +7 -0
- package/lib/table-virtuoso/hook/useFilterOperator.js +40 -0
- package/lib/table-virtuoso/hook/utils.d.ts +159 -0
- package/lib/table-virtuoso/hook/utils.js +2389 -0
- package/lib/table-virtuoso/index.d.ts +2 -0
- package/lib/table-virtuoso/index.js +9 -0
- package/lib/table-virtuoso/style.d.ts +22 -0
- package/lib/table-virtuoso/style.js +19 -0
- package/lib/table-virtuoso/style.scss +1441 -0
- package/lib/table-virtuoso/table/Grid.d.ts +37 -0
- package/lib/table-virtuoso/table/Grid.js +307 -0
- package/lib/table-virtuoso/table/TableContainer.d.ts +49 -0
- package/lib/table-virtuoso/table/TableContainer.js +300 -0
- package/lib/table-virtuoso/table/TableWrapper.d.ts +22 -0
- package/lib/table-virtuoso/table/TableWrapper.js +166 -0
- package/lib/table-virtuoso/type.d.ts +0 -0
- package/lib/table-virtuoso/type.js +786 -0
- package/lib/table-virtuoso/useContext.d.ts +97 -0
- package/lib/table-virtuoso/useContext.js +27 -0
- package/package.json +2 -1
- package/es/grid-component/AdvanceFilter.d.ts +0 -14
- package/es/grid-component/AdvanceFilter.js +0 -454
- package/es/grid-component/CheckboxFilter.d.ts +0 -20
- package/es/grid-component/CheckboxFilter.js +0 -244
- package/es/grid-component/CheckboxFilter2.d.ts +0 -20
- package/es/grid-component/CheckboxFilter2.js +0 -244
- package/es/grid-component/ColumnsChoose.d.ts +0 -10
- package/es/grid-component/ColumnsChoose.js +0 -230
- package/es/grid-component/Command.d.ts +0 -8
- package/es/grid-component/Command.js +0 -80
- package/es/grid-component/ContextMenu.d.ts +0 -20
- package/es/grid-component/ContextMenu.js +0 -130
- package/es/grid-component/ConvertColumnTable.d.ts +0 -7
- package/es/grid-component/ConvertColumnTable.js +0 -144
- package/es/grid-component/EditForm/EditForm.d.ts +0 -27
- package/es/grid-component/EditForm/EditForm.js +0 -394
- package/es/grid-component/EditForm/index.d.ts +0 -1
- package/es/grid-component/EditForm/index.js +0 -1
- package/es/grid-component/EditableCell.d.ts +0 -20
- package/es/grid-component/EditableCell.js +0 -1030
- package/es/grid-component/FilterSearch.d.ts +0 -12
- package/es/grid-component/FilterSearch.js +0 -33
- package/es/grid-component/GridStyle.d.ts +0 -8
- package/es/grid-component/GridStyle.js +0 -5
- package/es/grid-component/InternalTable.js +0 -1170
- package/es/grid-component/TableGrid.d.ts +0 -21
- package/es/grid-component/TableGrid.js +0 -493
- package/es/grid-component/async-select/index.d.ts +0 -11
- package/es/grid-component/async-select/index.js +0 -38
- package/es/grid-component/async-table-select/index.d.ts +0 -11
- package/es/grid-component/async-table-select/index.js +0 -40
- package/es/grid-component/checkbox-control/index.d.ts +0 -13
- package/es/grid-component/checkbox-control/index.js +0 -40
- package/es/grid-component/hooks/columns/index.d.ts +0 -10
- package/es/grid-component/hooks/columns/index.js +0 -503
- package/es/grid-component/hooks/content/ControlCheckbox.d.ts +0 -13
- package/es/grid-component/hooks/content/ControlCheckbox.js +0 -87
- package/es/grid-component/hooks/content/HeaderContent.d.ts +0 -14
- package/es/grid-component/hooks/content/HeaderContent.js +0 -44
- package/es/grid-component/hooks/content/TooltipContent.d.ts +0 -13
- package/es/grid-component/hooks/content/TooltipContent.js +0 -74
- package/es/grid-component/hooks/useColumns.d.ts +0 -19
- package/es/grid-component/hooks/useColumns.js +0 -317
- package/es/grid-component/number/index.d.ts +0 -10
- package/es/grid-component/number/index.js +0 -39
- package/es/grid-component/number-range/index.d.ts +0 -11
- package/es/grid-component/number-range/index.js +0 -63
- package/es/grid-component/table/Grid.d.ts +0 -23
- package/es/grid-component/table/Grid.js +0 -49
- package/es/grid-component/table/GridEdit.d.ts +0 -23
- package/es/grid-component/table/GridEdit.js +0 -2726
- package/es/grid-component/table/Group.d.ts +0 -21
- package/es/grid-component/table/Group.js +0 -195
- package/es/grid-component/table/InfiniteTable.d.ts +0 -23
- package/es/grid-component/table/InfiniteTable.js +0 -101
- package/es/grid-component/useContext.d.ts +0 -34
- package/es/grid-component/useContext.js +0 -8
- package/lib/grid-component/AdvanceFilter.d.ts +0 -14
- package/lib/grid-component/AdvanceFilter.js +0 -463
- package/lib/grid-component/CheckboxFilter.d.ts +0 -20
- package/lib/grid-component/CheckboxFilter.js +0 -253
- package/lib/grid-component/CheckboxFilter2.d.ts +0 -20
- package/lib/grid-component/CheckboxFilter2.js +0 -253
- package/lib/grid-component/ColumnsChoose.d.ts +0 -10
- package/lib/grid-component/ColumnsChoose.js +0 -240
- package/lib/grid-component/Command.d.ts +0 -8
- package/lib/grid-component/Command.js +0 -88
- package/lib/grid-component/ContextMenu.d.ts +0 -20
- package/lib/grid-component/ContextMenu.js +0 -140
- package/lib/grid-component/ConvertColumnTable.d.ts +0 -7
- package/lib/grid-component/ConvertColumnTable.js +0 -153
- package/lib/grid-component/EditForm/EditForm.d.ts +0 -27
- package/lib/grid-component/EditForm/EditForm.js +0 -404
- package/lib/grid-component/EditForm/index.d.ts +0 -1
- package/lib/grid-component/EditForm/index.js +0 -16
- package/lib/grid-component/EditableCell.d.ts +0 -20
- package/lib/grid-component/EditableCell.js +0 -1032
- package/lib/grid-component/FilterSearch.d.ts +0 -12
- package/lib/grid-component/FilterSearch.js +0 -42
- package/lib/grid-component/GridStyle.d.ts +0 -8
- package/lib/grid-component/GridStyle.js +0 -12
- package/lib/grid-component/InternalTable.js +0 -1178
- package/lib/grid-component/TableGrid.d.ts +0 -21
- package/lib/grid-component/TableGrid.js +0 -493
- package/lib/grid-component/async-select/index.d.ts +0 -11
- package/lib/grid-component/async-select/index.js +0 -47
- package/lib/grid-component/async-table-select/index.d.ts +0 -11
- package/lib/grid-component/async-table-select/index.js +0 -49
- package/lib/grid-component/checkbox-control/index.d.ts +0 -13
- package/lib/grid-component/checkbox-control/index.js +0 -48
- package/lib/grid-component/hooks/columns/index.d.ts +0 -10
- package/lib/grid-component/hooks/columns/index.js +0 -518
- package/lib/grid-component/hooks/content/ControlCheckbox.d.ts +0 -13
- package/lib/grid-component/hooks/content/ControlCheckbox.js +0 -95
- package/lib/grid-component/hooks/content/HeaderContent.d.ts +0 -14
- package/lib/grid-component/hooks/content/HeaderContent.js +0 -53
- package/lib/grid-component/hooks/content/TooltipContent.d.ts +0 -13
- package/lib/grid-component/hooks/content/TooltipContent.js +0 -81
- package/lib/grid-component/hooks/useColumns.d.ts +0 -19
- package/lib/grid-component/hooks/useColumns.js +0 -328
- package/lib/grid-component/number/index.d.ts +0 -10
- package/lib/grid-component/number/index.js +0 -47
- package/lib/grid-component/number-range/index.d.ts +0 -11
- package/lib/grid-component/number-range/index.js +0 -71
- package/lib/grid-component/table/Grid.d.ts +0 -23
- package/lib/grid-component/table/Grid.js +0 -58
- package/lib/grid-component/table/GridEdit.d.ts +0 -23
- package/lib/grid-component/table/GridEdit.js +0 -2723
- package/lib/grid-component/table/Group.d.ts +0 -21
- package/lib/grid-component/table/Group.js +0 -204
- package/lib/grid-component/table/InfiniteTable.d.ts +0 -23
- package/lib/grid-component/table/InfiniteTable.js +0 -109
- package/lib/grid-component/useContext.d.ts +0 -34
- package/lib/grid-component/useContext.js +0 -13
- /package/es/{grid-component → table-virtuoso}/ColumnsGroup/ColumnsGroup.d.ts +0 -0
- /package/es/{grid-component → table-virtuoso}/ColumnsGroup/index.d.ts +0 -0
- /package/es/{grid-component → table-virtuoso}/ColumnsGroup/index.js +0 -0
- /package/lib/{grid-component → table-virtuoso}/ColumnsGroup/ColumnsGroup.d.ts +0 -0
- /package/lib/{grid-component → table-virtuoso}/ColumnsGroup/index.d.ts +0 -0
- /package/lib/{grid-component → table-virtuoso}/ColumnsGroup/index.js +0 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import type { ColumnTable, ExpandableConfig, IFormat, IGroupSetting, IWrapSettings, Locale, PaginationConfig, RangeState, RecordDoubleClickEventArgs, RowClassName, SelectionSettings } from "../table-component/type";
|
|
3
|
+
import type { SubmitHandler } from "react-hook-form";
|
|
4
|
+
import type { ExpandedState, Row, Table } from '@tanstack/react-table';
|
|
5
|
+
export type IPositionCell = {
|
|
6
|
+
rowId: string;
|
|
7
|
+
colId: string;
|
|
8
|
+
} | undefined;
|
|
9
|
+
export interface IContext<T> {
|
|
10
|
+
t?: any;
|
|
11
|
+
prefix: string;
|
|
12
|
+
id: string;
|
|
13
|
+
rowKey: string;
|
|
14
|
+
originData: any[];
|
|
15
|
+
dataSource: any[];
|
|
16
|
+
format?: IFormat;
|
|
17
|
+
expandable?: ExpandableConfig<T>;
|
|
18
|
+
wrapSettings?: IWrapSettings;
|
|
19
|
+
setExpanded: Dispatch<SetStateAction<ExpandedState>>;
|
|
20
|
+
expanded: ExpandedState;
|
|
21
|
+
recordDoubleClick?: (args: RecordDoubleClickEventArgs<T>) => void;
|
|
22
|
+
selectionSettings?: SelectionSettings;
|
|
23
|
+
isSelectionChange?: {
|
|
24
|
+
isChange: boolean;
|
|
25
|
+
type: string;
|
|
26
|
+
rowData: T;
|
|
27
|
+
rowsData: T[];
|
|
28
|
+
};
|
|
29
|
+
setIsSelectionChange: Dispatch<SetStateAction<{
|
|
30
|
+
isChange: boolean;
|
|
31
|
+
type: string;
|
|
32
|
+
rowData: T;
|
|
33
|
+
rowsData: T[];
|
|
34
|
+
}>>;
|
|
35
|
+
setSorterChange: Dispatch<SetStateAction<boolean>>;
|
|
36
|
+
setFilterChange: Dispatch<SetStateAction<boolean>>;
|
|
37
|
+
onContextMenu?: (data: T) => (event: any) => void;
|
|
38
|
+
locale?: Locale;
|
|
39
|
+
windowSize: {
|
|
40
|
+
innerHeight: number;
|
|
41
|
+
innerWidth: number;
|
|
42
|
+
};
|
|
43
|
+
control?: any;
|
|
44
|
+
errors?: any;
|
|
45
|
+
handleSubmit?: any;
|
|
46
|
+
onSubmit?: SubmitHandler<any>;
|
|
47
|
+
getValues?: any;
|
|
48
|
+
reset?: any;
|
|
49
|
+
setValue?: any;
|
|
50
|
+
handleCellChange?: (args: ContextCellChange) => void;
|
|
51
|
+
editingKey?: string;
|
|
52
|
+
setEditingKey?: Dispatch<SetStateAction<string>>;
|
|
53
|
+
rangeState?: RangeState;
|
|
54
|
+
setRangeState?: Dispatch<SetStateAction<RangeState | undefined>>;
|
|
55
|
+
rangePasteState?: RangeState;
|
|
56
|
+
setRangePasteState?: Dispatch<SetStateAction<RangeState | undefined>>;
|
|
57
|
+
startCell?: IPositionCell;
|
|
58
|
+
setStartCell?: Dispatch<SetStateAction<IPositionCell | undefined>>;
|
|
59
|
+
endCell?: IPositionCell;
|
|
60
|
+
setEndCell?: Dispatch<SetStateAction<IPositionCell | undefined>>;
|
|
61
|
+
startPasteCell?: IPositionCell;
|
|
62
|
+
setStartPasteCell?: Dispatch<SetStateAction<IPositionCell | undefined>>;
|
|
63
|
+
endPasteCell?: IPositionCell;
|
|
64
|
+
setEndPasteCell?: Dispatch<SetStateAction<IPositionCell | undefined>>;
|
|
65
|
+
isSelecting?: boolean;
|
|
66
|
+
setIsSelecting?: Dispatch<SetStateAction<boolean>>;
|
|
67
|
+
isPasting?: boolean;
|
|
68
|
+
setIsPasting?: Dispatch<SetStateAction<boolean>>;
|
|
69
|
+
focusedCell?: IPositionCell;
|
|
70
|
+
setFocusedCell?: Dispatch<SetStateAction<IPositionCell | undefined>>;
|
|
71
|
+
triggerPaste?: (pastedRows: T[], pastedColumnsArray: string[], newData: T[], copyRows: T[]) => void;
|
|
72
|
+
handleDeleteContent?: () => void;
|
|
73
|
+
handleAddMulti?: (item: any, n: number, id?: string) => void;
|
|
74
|
+
dataErrors?: any[];
|
|
75
|
+
isDataTree: boolean;
|
|
76
|
+
handleCellClick?: (rowNumber: number, record: T, column: ColumnTable, rowId: string, cellValue: any) => void;
|
|
77
|
+
pagination?: false | PaginationConfig;
|
|
78
|
+
rowClassName?: string | RowClassName<T>;
|
|
79
|
+
table?: Table<T>;
|
|
80
|
+
rowEditable?: (rowData: T) => boolean;
|
|
81
|
+
onRowStyles?: Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'> | ((data: T, row: Row<T>) => Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'>);
|
|
82
|
+
onRowHeaderStyles?: Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'> | (() => Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'>);
|
|
83
|
+
onRowFooterStyles?: Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'> | (() => Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'>);
|
|
84
|
+
groupSetting?: IGroupSetting;
|
|
85
|
+
}
|
|
86
|
+
export declare const TableContext: import("react").Context<IContext<any>>;
|
|
87
|
+
export type ContextCellChange = {
|
|
88
|
+
key: string;
|
|
89
|
+
record: any;
|
|
90
|
+
field: string | undefined;
|
|
91
|
+
option: any;
|
|
92
|
+
indexRow: number;
|
|
93
|
+
indexCol: number;
|
|
94
|
+
newState?: any;
|
|
95
|
+
prevState?: any;
|
|
96
|
+
type: 'enter' | 'blur' | 'outClick';
|
|
97
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
export const TableContext = /*#__PURE__*/createContext({
|
|
3
|
+
prefix: 'ui-rc',
|
|
4
|
+
id: '',
|
|
5
|
+
isDataTree: false,
|
|
6
|
+
rowKey: 'rowId',
|
|
7
|
+
dataSource: [],
|
|
8
|
+
originData: [],
|
|
9
|
+
expanded: {},
|
|
10
|
+
windowSize: {
|
|
11
|
+
innerHeight: 0,
|
|
12
|
+
innerWidth: 0
|
|
13
|
+
},
|
|
14
|
+
// triggerFilter: () => { },
|
|
15
|
+
|
|
16
|
+
setIsSelectionChange: () => {},
|
|
17
|
+
setSorterChange: () => {},
|
|
18
|
+
setFilterChange: () => {},
|
|
19
|
+
setExpanded: () => {},
|
|
20
|
+
handleCellClick: () => {}
|
|
21
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
declare const TempTable: <RecordType extends object>(props:
|
|
2
|
+
import type { TableProps } from "../table-component";
|
|
3
|
+
declare const TempTable: <RecordType extends object>(props: TableProps<RecordType>) => React.JSX.Element;
|
|
4
4
|
export default TempTable;
|
|
@@ -6,21 +6,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _react =
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _tableComponent = _interopRequireDefault(require("../table-component"));
|
|
11
|
-
var
|
|
12
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
+
var _tableVirtuoso = _interopRequireDefault(require("../table-virtuoso"));
|
|
14
12
|
const TempTable = props => {
|
|
15
13
|
const {
|
|
16
14
|
groupAble,
|
|
17
15
|
editAble,
|
|
18
16
|
...rest
|
|
19
17
|
} = props;
|
|
20
|
-
const TabComponent = groupAble ?
|
|
21
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
18
|
+
const TabComponent = groupAble ? _tableVirtuoso.default : _tableComponent.default;
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement(TabComponent, (0, _extends2.default)({}, rest, {
|
|
22
20
|
groupAble: groupAble,
|
|
23
21
|
editAble: editAble
|
|
24
|
-
}))
|
|
22
|
+
}));
|
|
25
23
|
};
|
|
26
24
|
var _default = exports.default = TempTable;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyObject, GetRowKey } from "../type";
|
|
2
1
|
import type { Key } from "react";
|
|
2
|
+
import type { AnyObject, GetRowKey } from '../../table-component/type';
|
|
3
3
|
declare const useLazyKVMap: <RecordType extends AnyObject = AnyObject>(data: readonly RecordType[], childrenColumnName: string, getRowKey: GetRowKey<RecordType>) => readonly [(key: Key) => RecordType];
|
|
4
4
|
export default useLazyKVMap;
|
|
@@ -9,9 +9,6 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
9
9
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
10
|
/* eslint-disable @typescript-eslint/no-non-null-asserted-optional-chain */
|
|
11
11
|
|
|
12
|
-
// import type { AnyObject } from '../../_util/type';
|
|
13
|
-
// import type { GetRowKey, Key } from '../interface';
|
|
14
|
-
|
|
15
12
|
const useLazyKVMap = (data, childrenColumnName, getRowKey) => {
|
|
16
13
|
const mapCacheRef = React.useRef({});
|
|
17
14
|
function getRecordByKey(key) {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type * as React from "react";
|
|
2
2
|
import dayjs from "dayjs";
|
|
3
3
|
import type { EditType, IColumnType, TypeFilter } from "rc-master-ui";
|
|
4
|
-
import type { ColumnTable, GetRowKey, IFormat } from "../type";
|
|
5
|
-
import type { SelectionSettings } from "../type";
|
|
6
|
-
import type { AnyObject } from "../type";
|
|
7
4
|
import type { Key } from "react";
|
|
8
5
|
import type { ColumnsTable } from "./../index";
|
|
6
|
+
import type { AnyObject, ColumnTable, GetRowKey, IFormat } from "../../table-component/type";
|
|
9
7
|
export declare const newGuid: () => any;
|
|
10
8
|
export declare const sumDataByField: (data: any[], field: string) => any;
|
|
11
9
|
export declare const checkThousandSeparator: (thousandSeparator: string | undefined, decimalSeparator: string | undefined) => string;
|
|
@@ -50,7 +48,6 @@ export declare const checkFieldKey: (key: string | undefined) => string;
|
|
|
50
48
|
export declare const convertLabelToTitle: (data: any[]) => any[];
|
|
51
49
|
export declare const convertArrayWithIndent: (inputArray: any[], parentIndent?: number) => any[];
|
|
52
50
|
export declare const getTemplate: (template: any, column?: ColumnTable) => React.ReactNode | React.ReactElement;
|
|
53
|
-
export declare const totalFixedWidth: <T>(columns: ColumnsTable<T>, type: 'left' | 'right', selectionSettings?: SelectionSettings) => number;
|
|
54
51
|
export declare const isObjEmpty: (obj: any) => boolean;
|
|
55
52
|
export declare const getColumnsVisible: <T>(columns: ColumnsTable<T>, index: number) => ColumnTable<T>[];
|
|
56
53
|
export declare const updateData: <Record = AnyObject>(initData: Record[], rows: Record[], key: keyof Record) => Record[];
|
|
@@ -103,11 +100,7 @@ export declare function addRowsUp(array: any, n: number): {
|
|
|
103
100
|
combined: any[];
|
|
104
101
|
addedRows: any[];
|
|
105
102
|
};
|
|
106
|
-
export declare const transformColumns: <RecordType>(cols: ColumnsTable<RecordType>, convertColumns: any[], t?: any) => ColumnsTable<RecordType>;
|
|
107
|
-
export declare const transformColumns1: <RecordType>(cols: ColumnsTable<RecordType>, sortMultiple?: boolean) => ColumnsTable<RecordType>;
|
|
108
|
-
export declare const removeColumns: <RecordType>(columns: ColumnTable<RecordType>[], groupColumns: string[]) => ColumnsTable<RecordType>;
|
|
109
103
|
export declare const convertFlatColumn: (array: ColumnsTable) => ColumnsTable[];
|
|
110
|
-
export declare const convertColumns: <RecordType>(cols: ColumnsTable<RecordType>) => ColumnsTable<RecordType>;
|
|
111
104
|
export declare const checkChild: (inputArray: any[]) => boolean;
|
|
112
105
|
export declare const isEditable: <RecordType>(column: ColumnTable, rowData: RecordType) => boolean | ((rowData: any) => boolean);
|
|
113
106
|
export declare const isArraysEqual: (arr1: any[], arr2: any[]) => boolean;
|
|
@@ -12,7 +12,7 @@ exports.addRowsUpWithCtrl = addRowsUpWithCtrl;
|
|
|
12
12
|
exports.checkThousandSeparator = exports.checkFieldKey = exports.checkDecimalSeparator = exports.checkChild = exports.buildConnectedRegions = void 0;
|
|
13
13
|
exports.compareDate = compareDate;
|
|
14
14
|
exports.compareDates = compareDates;
|
|
15
|
-
exports.convertFlatColumn = exports.convertFilters = exports.convertDayjsToDate = exports.convertDateToDayjs = exports.
|
|
15
|
+
exports.convertFlatColumn = exports.convertFilters = exports.convertDayjsToDate = exports.convertDateToDayjs = exports.convertArrayWithIndent = void 0;
|
|
16
16
|
exports.convertFormat = convertFormat;
|
|
17
17
|
exports.filterDataByColumns3 = exports.filterDataByColumns2 = exports.filterDataByColumns = exports.editAbleColumns = exports.detectSeparators = exports.customWeekStartEndFormat = exports.customFilterOption = exports.countItemsBeforeIndex = exports.convertLabelToTitle = void 0;
|
|
18
18
|
exports.filterDataByColumns4 = filterDataByColumns4;
|
|
@@ -40,17 +40,23 @@ exports.isRightMostInRegion = isRightMostInRegion;
|
|
|
40
40
|
exports.isTopMostInRegion = exports.isSelectedCell = void 0;
|
|
41
41
|
exports.mergeWithFilter = mergeWithFilter;
|
|
42
42
|
exports.mergeWithFilter2 = mergeWithFilter2;
|
|
43
|
-
exports.
|
|
44
|
-
exports.updateData = exports.updateColumnsByGroup = exports.updateColumns = exports.updateArrayByKey = exports.unFlattenData = exports.
|
|
43
|
+
exports.removeInvisibleColumns = exports.removeFieldRecursive = exports.removeClassCellIndexSelected = exports.removeClassBorderPasteCell = exports.removeBorderPasteClass = exports.removeBorderClass2 = exports.removeBorderClass = exports.parseCells = exports.parseBooleanToValue = exports.onRemoveBorderSelectedCell = exports.onRemoveBgSelectedCell = exports.onRemoveBgCellIndex = exports.onAddBorderSelectedCell = exports.onAddBgSelectedCell = exports.onAddBgCellIndex = exports.newGuid = exports.mergedSets = void 0;
|
|
44
|
+
exports.updateData = exports.updateColumnsByGroup = exports.updateColumns = exports.updateArrayByKey = exports.unFlattenData = exports.sumDataByField = exports.sumByField = exports.sortedSetDSC = exports.sortedSetASC = exports.showDraggingPoint = exports.shouldInclude = exports.removeVietnameseTones = void 0;
|
|
45
45
|
exports.updateDataByFilter = updateDataByFilter;
|
|
46
46
|
exports.updateOrInsert = updateOrInsert;
|
|
47
47
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
48
48
|
var _moment = _interopRequireDefault(require("moment/moment"));
|
|
49
49
|
var _uuid = require("uuid");
|
|
50
50
|
var _colors = require("@ant-design/colors");
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
// import type {ColumnTable, GetRowKey, IFormat, Presets} from "./../ type"
|
|
52
|
+
|
|
53
|
+
// import type {SelectionSettings} from "../type"
|
|
54
|
+
// import type {AnyObject} from "../type"
|
|
55
|
+
|
|
56
|
+
// import {Table} from "rc-master-ui"
|
|
57
|
+
// import {flatColumns2} from "./columns"
|
|
58
|
+
// import {SELECTION_COLUMN} from "./useColumns"
|
|
59
|
+
|
|
54
60
|
const newGuid = () => {
|
|
55
61
|
for (let i = 0; i < 20; i++) {
|
|
56
62
|
// @ts-ignore
|
|
@@ -460,17 +466,22 @@ const getTemplate = (template, column) => {
|
|
|
460
466
|
}
|
|
461
467
|
return template;
|
|
462
468
|
};
|
|
469
|
+
|
|
470
|
+
// export const totalFixedWidth = <T, >(columns: ColumnsTable<T>, type: 'left' | 'right', selectionSettings?: SelectionSettings) => {
|
|
471
|
+
// const totalFixedLeftWidth: number = columns
|
|
472
|
+
// .filter(column => column.fixed === type) // Lọc các cột có fixed
|
|
473
|
+
// .reduce((sum, column) => {
|
|
474
|
+
// const width = typeof column.width === 'number' ? column.width : parseInt(column.width as string, 10) || 0 // Chuyển từ chuỗi sang số, nếu không hợp lệ thì lấy 0
|
|
475
|
+
// return sum + width
|
|
476
|
+
// }, 0)
|
|
477
|
+
|
|
478
|
+
// const selectColumnWidth: number = !selectionSettings?.mode ? 0 : (
|
|
479
|
+
// typeof selectionSettings?.columnWidth === 'number' ? selectionSettings?.columnWidth : parseInt(selectionSettings?.columnWidth as string, 10) || 50)
|
|
480
|
+
|
|
481
|
+
// return totalFixedLeftWidth + selectColumnWidth
|
|
482
|
+
|
|
483
|
+
// }
|
|
463
484
|
exports.getTemplate = getTemplate;
|
|
464
|
-
const totalFixedWidth = (columns, type, selectionSettings) => {
|
|
465
|
-
const totalFixedLeftWidth = columns.filter(column => column.fixed === type) // Lọc các cột có fixed
|
|
466
|
-
.reduce((sum, column) => {
|
|
467
|
-
const width = typeof column.width === 'number' ? column.width : parseInt(column.width, 10) || 0; // Chuyển từ chuỗi sang số, nếu không hợp lệ thì lấy 0
|
|
468
|
-
return sum + width;
|
|
469
|
-
}, 0);
|
|
470
|
-
const selectColumnWidth = !selectionSettings?.mode ? 0 : typeof selectionSettings?.columnWidth === 'number' ? selectionSettings?.columnWidth : parseInt(selectionSettings?.columnWidth, 10) || 50;
|
|
471
|
-
return totalFixedLeftWidth + selectColumnWidth;
|
|
472
|
-
};
|
|
473
|
-
exports.totalFixedWidth = totalFixedWidth;
|
|
474
485
|
const isObjEmpty = obj => {
|
|
475
486
|
if (isNullOrUndefined(obj)) {
|
|
476
487
|
return true;
|
|
@@ -1237,96 +1248,112 @@ function addRowsUp(array, n) {
|
|
|
1237
1248
|
addedRows
|
|
1238
1249
|
};
|
|
1239
1250
|
}
|
|
1240
|
-
const transformColumns = (cols, convertColumns, t) => {
|
|
1241
|
-
// @ts-ignore
|
|
1242
|
-
return cols.map(column => {
|
|
1243
|
-
const find = convertColumns.find(it => it.key === column.field);
|
|
1244
|
-
if (!column?.field && !column?.key) {
|
|
1245
|
-
return _rcMasterUi.Table.SELECTION_COLUMN;
|
|
1246
|
-
}
|
|
1247
|
-
if (find) {
|
|
1248
|
-
return {
|
|
1249
|
-
...find
|
|
1250
|
-
};
|
|
1251
|
-
}
|
|
1252
1251
|
|
|
1253
|
-
|
|
1254
|
-
if (column.children?.length) {
|
|
1255
|
-
return {
|
|
1256
|
-
...column,
|
|
1257
|
-
key: column.field ?? column.dataIndex ?? column.key,
|
|
1258
|
-
title: t ? t(column.headerText) : column.headerText,
|
|
1259
|
-
ellipsis: column.ellipsis !== false,
|
|
1260
|
-
align: column.textAlign ?? column.align,
|
|
1261
|
-
children: transformColumns(column.children, convertColumns)
|
|
1262
|
-
};
|
|
1263
|
-
}
|
|
1264
|
-
});
|
|
1265
|
-
};
|
|
1266
|
-
exports.transformColumns = transformColumns;
|
|
1267
|
-
const transformColumns1 = (cols, sortMultiple) => {
|
|
1268
|
-
const convertColumns = (0, _columns.flatColumns2)(cols).map((column, colIndex) => {
|
|
1269
|
-
if (!column?.field && !column?.key) {
|
|
1270
|
-
return _rcMasterUi.Table.SELECTION_COLUMN;
|
|
1271
|
-
}
|
|
1272
|
-
if (column.dataIndex === '#' || column.dataIndex === '#') {
|
|
1273
|
-
return {
|
|
1274
|
-
...column
|
|
1275
|
-
};
|
|
1276
|
-
}
|
|
1277
|
-
if ((column.key || column.field) === 'command') {
|
|
1278
|
-
return {
|
|
1279
|
-
...column
|
|
1280
|
-
};
|
|
1281
|
-
}
|
|
1282
|
-
return {
|
|
1283
|
-
...column,
|
|
1284
|
-
key: column.field ?? column.dataIndex ?? column.key,
|
|
1285
|
-
sorter: column.sorter === false ? undefined : {
|
|
1286
|
-
compare: a => a,
|
|
1287
|
-
multiple: sortMultiple ? colIndex : undefined
|
|
1288
|
-
}
|
|
1289
|
-
};
|
|
1290
|
-
});
|
|
1252
|
+
// export const transformColumns = <RecordType, >(cols: ColumnsTable<RecordType>, convertColumns: any[], t?: any): ColumnsTable<RecordType> => {
|
|
1291
1253
|
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1254
|
+
// // @ts-ignore
|
|
1255
|
+
// return cols.map((column) => {
|
|
1256
|
+
|
|
1257
|
+
// const find = convertColumns.find((it) => it.key === column.field)
|
|
1258
|
+
|
|
1259
|
+
// if (!column?.field && !column?.key) {
|
|
1260
|
+
// return Table.SELECTION_COLUMN
|
|
1261
|
+
// }
|
|
1262
|
+
|
|
1263
|
+
// if (find) {
|
|
1264
|
+
// return {...find}
|
|
1265
|
+
// }
|
|
1266
|
+
|
|
1267
|
+
// // Xử lý đệ quy cho children
|
|
1268
|
+
// if (column.children?.length) {
|
|
1269
|
+
// return {
|
|
1270
|
+
// ...column,
|
|
1271
|
+
// key: column.field ?? column.dataIndex ?? column.key,
|
|
1272
|
+
// title: t ? t(column.headerText) : column.headerText,
|
|
1273
|
+
// ellipsis: column.ellipsis !== false,
|
|
1274
|
+
// align: column.textAlign ?? column.align,
|
|
1275
|
+
// children: transformColumns(column.children, convertColumns)
|
|
1276
|
+
// }
|
|
1277
|
+
// }
|
|
1278
|
+
|
|
1279
|
+
// })
|
|
1280
|
+
|
|
1281
|
+
// }
|
|
1282
|
+
|
|
1283
|
+
// export const transformColumns1 = <RecordType, >(cols: ColumnsTable<RecordType>, sortMultiple?: boolean): ColumnsTable<RecordType> => {
|
|
1284
|
+
|
|
1285
|
+
// const convertColumns = flatColumns2(cols).map((column: any, colIndex) => {
|
|
1286
|
+
|
|
1287
|
+
// if (!column?.field && !column?.key) {
|
|
1288
|
+
// return Table.SELECTION_COLUMN
|
|
1289
|
+
// }
|
|
1290
|
+
|
|
1291
|
+
// if (column.dataIndex === '#' || column.dataIndex === '#') {
|
|
1292
|
+
// return {
|
|
1293
|
+
// ...column
|
|
1294
|
+
|
|
1295
|
+
// }
|
|
1296
|
+
// }
|
|
1297
|
+
|
|
1298
|
+
// if ((column.key || column.field) === 'command') {
|
|
1299
|
+
// return {
|
|
1300
|
+
// ...column
|
|
1301
|
+
// }
|
|
1302
|
+
// }
|
|
1303
|
+
|
|
1304
|
+
// return {
|
|
1305
|
+
// ...column,
|
|
1306
|
+
// key: column.field ?? column.dataIndex ?? column.key,
|
|
1307
|
+
// sorter: (column.sorter === false ? undefined : {
|
|
1308
|
+
// compare: (a: any) => a,
|
|
1309
|
+
// multiple: sortMultiple ? colIndex : undefined
|
|
1310
|
+
// })
|
|
1311
|
+
// }
|
|
1312
|
+
|
|
1313
|
+
// })
|
|
1314
|
+
|
|
1315
|
+
// // @ts-ignore
|
|
1316
|
+
// return cols.map((column) => {
|
|
1317
|
+
|
|
1318
|
+
// const find = convertColumns.find((it) => it.key === column.field)
|
|
1319
|
+
|
|
1320
|
+
// if (!column?.field && !column?.key) {
|
|
1321
|
+
// return Table.SELECTION_COLUMN
|
|
1322
|
+
// }
|
|
1323
|
+
|
|
1324
|
+
// if (find) {
|
|
1325
|
+
// return {...find}
|
|
1326
|
+
// }
|
|
1327
|
+
|
|
1328
|
+
// // Xử lý đệ quy cho children
|
|
1329
|
+
// if (column.children?.length) {
|
|
1330
|
+
// return {
|
|
1331
|
+
// ...column,
|
|
1332
|
+
// key: column.field ?? column.dataIndex ?? column.key,
|
|
1333
|
+
// ellipsis: column.ellipsis !== false,
|
|
1334
|
+
// align: column.textAlign ?? column.align,
|
|
1335
|
+
// children: transformColumns(column.children, convertColumns)
|
|
1336
|
+
// }
|
|
1337
|
+
// }
|
|
1338
|
+
|
|
1339
|
+
// })
|
|
1340
|
+
|
|
1341
|
+
// }
|
|
1342
|
+
|
|
1343
|
+
// export const removeColumns = <RecordType, >(columns: ColumnTable<RecordType>[], groupColumns: string[]): ColumnsTable<RecordType> => {
|
|
1344
|
+
|
|
1345
|
+
// const ttt: ColumnTable<RecordType>[] = [...columns]
|
|
1346
|
+
|
|
1347
|
+
// return ttt.filter(column => !groupColumns.includes(column.field as string)).map((column) => {
|
|
1348
|
+
// const newCol = {...column}
|
|
1349
|
+
// if (newCol?.children && newCol?.children.length > 0) {
|
|
1350
|
+
// newCol.children = removeColumns(newCol.children, groupColumns) as any[]
|
|
1351
|
+
// }
|
|
1352
|
+
// return newCol
|
|
1353
|
+
// })
|
|
1354
|
+
|
|
1355
|
+
// }
|
|
1303
1356
|
|
|
1304
|
-
// Xử lý đệ quy cho children
|
|
1305
|
-
if (column.children?.length) {
|
|
1306
|
-
return {
|
|
1307
|
-
...column,
|
|
1308
|
-
key: column.field ?? column.dataIndex ?? column.key,
|
|
1309
|
-
ellipsis: column.ellipsis !== false,
|
|
1310
|
-
align: column.textAlign ?? column.align,
|
|
1311
|
-
children: transformColumns(column.children, convertColumns)
|
|
1312
|
-
};
|
|
1313
|
-
}
|
|
1314
|
-
});
|
|
1315
|
-
};
|
|
1316
|
-
exports.transformColumns1 = transformColumns1;
|
|
1317
|
-
const removeColumns = (columns, groupColumns) => {
|
|
1318
|
-
const ttt = [...columns];
|
|
1319
|
-
return ttt.filter(column => !groupColumns.includes(column.field)).map(column => {
|
|
1320
|
-
const newCol = {
|
|
1321
|
-
...column
|
|
1322
|
-
};
|
|
1323
|
-
if (newCol?.children && newCol?.children.length > 0) {
|
|
1324
|
-
newCol.children = removeColumns(newCol.children, groupColumns);
|
|
1325
|
-
}
|
|
1326
|
-
return newCol;
|
|
1327
|
-
});
|
|
1328
|
-
};
|
|
1329
|
-
exports.removeColumns = removeColumns;
|
|
1330
1357
|
const convertFlatColumn = array => {
|
|
1331
1358
|
const tmp = [...array];
|
|
1332
1359
|
let result = [];
|
|
@@ -1339,56 +1366,56 @@ const convertFlatColumn = array => {
|
|
|
1339
1366
|
});
|
|
1340
1367
|
return result;
|
|
1341
1368
|
};
|
|
1369
|
+
|
|
1370
|
+
// export const convertColumns = <RecordType, >(cols: ColumnsTable<RecordType>): ColumnsTable<RecordType> => {
|
|
1371
|
+
|
|
1372
|
+
// return cols.map((col) => {
|
|
1373
|
+
|
|
1374
|
+
// if (col === SELECTION_COLUMN) {
|
|
1375
|
+
// return SELECTION_COLUMN
|
|
1376
|
+
// }
|
|
1377
|
+
|
|
1378
|
+
// const transformedColumn = {
|
|
1379
|
+
// ...col,
|
|
1380
|
+
// dataIndex: col.field ?? col.dataIndex,
|
|
1381
|
+
// key: col.field ?? col.dataIndex ?? col.key,
|
|
1382
|
+
// // title: t ? t(col.columnGroupText ?? col.headerText ?? col.title) : col.columnGroupText ?? col.headerText ?? col.title,
|
|
1383
|
+
// // title: () => (<span>aaa</span>),
|
|
1384
|
+
// // title: () => (<HeaderContent column={{...col} as any} t={t}/>),
|
|
1385
|
+
// // title: () => (<span>{t ? t(col.columnGroupText ?? col.headerText ?? col.title) : col.columnGroupText ?? col.headerText ?? col.title}</span>),
|
|
1386
|
+
// ellipsis: col.ellipsis !== false,
|
|
1387
|
+
// align: col.textAlign ?? col.align,
|
|
1388
|
+
// fixed: col.fixedType ?? col.fixed
|
|
1389
|
+
// }
|
|
1390
|
+
|
|
1391
|
+
// if (transformedColumn.children && transformedColumn.children?.length) {
|
|
1392
|
+
// return {
|
|
1393
|
+
// ...transformedColumn,
|
|
1394
|
+
// children: convertColumns(transformedColumn.children)
|
|
1395
|
+
// }
|
|
1396
|
+
// }
|
|
1397
|
+
|
|
1398
|
+
// if (["index", "#"].includes(col.field as string)) {
|
|
1399
|
+
// return {
|
|
1400
|
+
// ...transformedColumn,
|
|
1401
|
+
// onCell: () => ({className: 'cell-number'}),
|
|
1402
|
+
// render: (_: any, __: any, rowIndex: number) => rowIndex + 1
|
|
1403
|
+
// }
|
|
1404
|
+
// }
|
|
1405
|
+
|
|
1406
|
+
// if (col.key === 'command') {
|
|
1407
|
+
// return {
|
|
1408
|
+
// ...transformedColumn,
|
|
1409
|
+
// onCell: () => ({className: 'cell-number', style: {padding: '2px 8px'}})
|
|
1410
|
+
// }
|
|
1411
|
+
// }
|
|
1412
|
+
|
|
1413
|
+
// return {
|
|
1414
|
+
// ...transformedColumn
|
|
1415
|
+
// }
|
|
1416
|
+
// })
|
|
1417
|
+
// }
|
|
1342
1418
|
exports.convertFlatColumn = convertFlatColumn;
|
|
1343
|
-
const convertColumns = cols => {
|
|
1344
|
-
return cols.map(col => {
|
|
1345
|
-
if (col === _useColumns.SELECTION_COLUMN) {
|
|
1346
|
-
return _useColumns.SELECTION_COLUMN;
|
|
1347
|
-
}
|
|
1348
|
-
const transformedColumn = {
|
|
1349
|
-
...col,
|
|
1350
|
-
dataIndex: col.field ?? col.dataIndex,
|
|
1351
|
-
key: col.field ?? col.dataIndex ?? col.key,
|
|
1352
|
-
// title: t ? t(col.columnGroupText ?? col.headerText ?? col.title) : col.columnGroupText ?? col.headerText ?? col.title,
|
|
1353
|
-
// title: () => (<span>aaa</span>),
|
|
1354
|
-
// title: () => (<HeaderContent column={{...col} as any} t={t}/>),
|
|
1355
|
-
// title: () => (<span>{t ? t(col.columnGroupText ?? col.headerText ?? col.title) : col.columnGroupText ?? col.headerText ?? col.title}</span>),
|
|
1356
|
-
ellipsis: col.ellipsis !== false,
|
|
1357
|
-
align: col.textAlign ?? col.align,
|
|
1358
|
-
fixed: col.fixedType ?? col.fixed
|
|
1359
|
-
};
|
|
1360
|
-
if (transformedColumn.children && transformedColumn.children?.length) {
|
|
1361
|
-
return {
|
|
1362
|
-
...transformedColumn,
|
|
1363
|
-
children: convertColumns(transformedColumn.children)
|
|
1364
|
-
};
|
|
1365
|
-
}
|
|
1366
|
-
if (["index", "#"].includes(col.field)) {
|
|
1367
|
-
return {
|
|
1368
|
-
...transformedColumn,
|
|
1369
|
-
onCell: () => ({
|
|
1370
|
-
className: 'cell-number'
|
|
1371
|
-
}),
|
|
1372
|
-
render: (_, __, rowIndex) => rowIndex + 1
|
|
1373
|
-
};
|
|
1374
|
-
}
|
|
1375
|
-
if (col.key === 'command') {
|
|
1376
|
-
return {
|
|
1377
|
-
...transformedColumn,
|
|
1378
|
-
onCell: () => ({
|
|
1379
|
-
className: 'cell-number',
|
|
1380
|
-
style: {
|
|
1381
|
-
padding: '2px 8px'
|
|
1382
|
-
}
|
|
1383
|
-
})
|
|
1384
|
-
};
|
|
1385
|
-
}
|
|
1386
|
-
return {
|
|
1387
|
-
...transformedColumn
|
|
1388
|
-
};
|
|
1389
|
-
});
|
|
1390
|
-
};
|
|
1391
|
-
exports.convertColumns = convertColumns;
|
|
1392
1419
|
const checkChild = inputArray => {
|
|
1393
1420
|
return inputArray.some(item => item.children && item.children.length > 0);
|
|
1394
1421
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import TempTable from './TempTable';
|
|
2
|
-
import type { ColumnsTable, TableProps, ColumnTable, CommandItem, ContextMenuItem } from '
|
|
2
|
+
import type { ColumnsTable, TableProps, ColumnTable, CommandItem, ContextMenuItem } from '../table-component/type';
|
|
3
3
|
import type { ToolbarItem } from "rc-master-ui/es/toolbar";
|
|
4
4
|
export type { ColumnsTable, TableProps, ColumnTable, ToolbarItem, CommandItem, ContextMenuItem };
|
|
5
5
|
export default TempTable;
|
|
@@ -6,7 +6,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _TempTable = _interopRequireDefault(require("./TempTable"));
|
|
9
|
-
// import InternalTable from './InternalTable'
|
|
10
|
-
//
|
|
11
|
-
// export default InternalTable
|
|
12
9
|
var _default = exports.default = _TempTable.default;
|