es-grid-template 1.8.65 → 1.8.67
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 +3 -3
- package/es/grid-component/hooks/constant.d.ts +1 -0
- package/es/grid-component/hooks/constant.js +2 -1
- 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 +3 -4
- package/es/grid-component/hooks/utils.js +2 -1
- package/es/grid-component/styles.scss +1394 -1394
- package/es/grid-component/type.d.ts +0 -414
- package/es/grid-component/type.js +490 -1
- package/es/table-component/TableContainerEdit.js +2 -127
- package/es/table-component/body/TableBodyCellEdit.js +2 -9
- package/es/table-component/header/TableHeadCell.js +1 -10
- package/es/table-component/header/TableHeadCell2.js +1 -1
- package/es/table-component/type.d.ts +3 -1
- package/es/table-virtuoso/ColumnsGroup/ColumnsGroup.js +1 -3
- package/es/table-virtuoso/InternalTable.js +6 -28
- package/es/table-virtuoso/body/TableBodyCell.js +0 -9
- package/es/table-virtuoso/body/TableBodyRow.js +0 -4
- package/es/table-virtuoso/style.js +2 -1
- package/es/table-virtuoso/style.scss +2 -1
- package/es/table-virtuoso/table/Grid.js +0 -4
- package/es/table-virtuoso/table/TableContainer.js +31 -44
- package/es/table-virtuoso/table/TableWrapper.d.ts +2 -0
- package/es/table-virtuoso/table/TableWrapper.js +5 -2
- package/lib/grid-component/TempTable.d.ts +2 -2
- package/lib/grid-component/TempTable.js +3 -5
- package/lib/grid-component/hooks/constant.d.ts +1 -0
- package/lib/grid-component/hooks/constant.js +3 -2
- 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 +3 -4
- package/lib/grid-component/hooks/utils.js +3 -0
- package/lib/grid-component/styles.scss +1394 -1394
- package/lib/grid-component/type.d.ts +0 -414
- package/lib/grid-component/type.js +490 -4
- package/lib/table-component/TableContainerEdit.js +1 -126
- package/lib/table-component/body/TableBodyCellEdit.js +5 -11
- package/lib/table-component/header/TableHeadCell.js +4 -13
- package/lib/table-component/header/TableHeadCell2.js +4 -4
- package/lib/table-component/type.d.ts +3 -1
- package/lib/table-virtuoso/ColumnsGroup/ColumnsGroup.js +1 -3
- package/lib/table-virtuoso/InternalTable.js +6 -28
- package/lib/table-virtuoso/body/TableBodyCell.js +0 -9
- package/lib/table-virtuoso/body/TableBodyRow.js +0 -5
- package/lib/table-virtuoso/style.js +2 -1
- package/lib/table-virtuoso/style.scss +2 -1
- package/lib/table-virtuoso/table/Grid.js +0 -4
- package/lib/table-virtuoso/table/TableContainer.js +29 -42
- package/lib/table-virtuoso/table/TableWrapper.d.ts +2 -0
- package/lib/table-virtuoso/table/TableWrapper.js +4 -2
- package/package.json +1 -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/ColumnsGroup/ColumnsGroup.d.ts +0 -12
- package/es/grid-component/ColumnsGroup/ColumnsGroup.js +0 -232
- package/es/grid-component/ColumnsGroup/index.d.ts +0 -1
- package/es/grid-component/ColumnsGroup/index.js +0 -1
- 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/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/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/useContext.d.ts +0 -34
- package/es/grid-component/useContext.js +0 -8
- package/es/table-component/hook/constant.d.ts +0 -73
- package/es/table-component/hook/constant.js +0 -240
- package/es/table-virtuoso/body/TableBody.d.ts +0 -14
- package/es/table-virtuoso/body/TableBody.js +0 -84
- 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/ColumnsGroup/ColumnsGroup.d.ts +0 -12
- package/lib/grid-component/ColumnsGroup/ColumnsGroup.js +0 -243
- package/lib/grid-component/ColumnsGroup/index.d.ts +0 -1
- package/lib/grid-component/ColumnsGroup/index.js +0 -16
- 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/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/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/useContext.d.ts +0 -34
- package/lib/grid-component/useContext.js +0 -13
- package/lib/table-component/hook/constant.d.ts +0 -73
- package/lib/table-component/hook/constant.js +0 -247
- package/lib/table-virtuoso/body/TableBody.d.ts +0 -14
- package/lib/table-virtuoso/body/TableBody.js +0 -95
|
@@ -1,23 +1,14 @@
|
|
|
1
|
-
// import { useSortable } from "@dnd-kit/sortable"
|
|
2
|
-
|
|
3
1
|
import { flexRender } from '@tanstack/react-table';
|
|
4
2
|
import React, { useContext } from 'react';
|
|
5
|
-
// import { CSS } from '@dnd-kit/utilities'
|
|
6
|
-
// import type { Virtualizer } from '@tanstack/react-virtual'
|
|
7
3
|
import { Button, Space } from 'antd';
|
|
8
4
|
import { ArrowDown, ArrowUp, FilterFill, SortCancel } from 'becoxy-icons';
|
|
9
5
|
import classNames from 'classnames';
|
|
10
6
|
import { Checkbox, Dropdown, Select } from 'rc-master-ui';
|
|
11
|
-
import { booleanOperator, nonActionColumn, numberOperator, stringOperator, translateOption } from "
|
|
7
|
+
import { booleanOperator, nonActionColumn, numberOperator, stringOperator, translateOption } from "../../grid-component/hooks";
|
|
12
8
|
import { extendsObject, getCommonPinningStyles, getDefaultOperator, getTypeFilter } from "../hook/utils";
|
|
13
9
|
import { TableContext } from "../useContext";
|
|
14
10
|
import { renderFilter } from "./renderFilter";
|
|
15
11
|
import ReactDOMServer from 'react-dom/server';
|
|
16
|
-
|
|
17
|
-
// import { ColumnTable } from "../type";
|
|
18
|
-
|
|
19
|
-
// import { Tooltip } from 'react-tooltip'
|
|
20
|
-
|
|
21
12
|
const TableHeadCell = props => {
|
|
22
13
|
const {
|
|
23
14
|
header,
|
|
@@ -4,11 +4,11 @@ import { Button, Space } from 'antd';
|
|
|
4
4
|
import { ArrowDown, ArrowUp, FilterFill, SortCancel } from 'becoxy-icons';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { Checkbox, Dropdown, Select } from 'rc-master-ui';
|
|
7
|
-
import { booleanOperator, nonActionColumn, numberOperator, stringOperator, translateOption } from "../hook/constant";
|
|
8
7
|
import { excludeItems, extendsObject, getCommonPinningStyles, getDefaultOperator, getTypeFilter, removeDuplicatesByKey } from "../hook/utils";
|
|
9
8
|
import { TableContext } from "../useContext";
|
|
10
9
|
import { renderFilter } from "./renderFilter";
|
|
11
10
|
import ReactDOMServer from 'react-dom/server';
|
|
11
|
+
import { booleanOperator, nonActionColumn, numberOperator, stringOperator, translateOption } from "../../grid-component/hooks";
|
|
12
12
|
const TableHeadCell2 = props => {
|
|
13
13
|
const {
|
|
14
14
|
column,
|
|
@@ -2,9 +2,9 @@ import type { CheckboxProps, TablePaginationConfig } from 'rc-master-ui';
|
|
|
2
2
|
import type { ItemType } from 'rc-master-ui/es/menu/interface';
|
|
3
3
|
import type { Cell, Header, OnChangeFn, Row } from '@tanstack/react-table';
|
|
4
4
|
import type { ReactElement, ReactNode } from 'react';
|
|
5
|
-
import type { IOperator } from './hook/constant';
|
|
6
5
|
import type { ColorPickerProps } from 'antd';
|
|
7
6
|
import type { TableLocale } from "rc-master-ui/lib/table/interface";
|
|
7
|
+
import type { IOperator } from '../grid-component/hooks';
|
|
8
8
|
declare module "@tanstack/table-core" {
|
|
9
9
|
interface ColumnMeta<any, any> extends ColumnTable {
|
|
10
10
|
rowSpan?: number;
|
|
@@ -80,6 +80,7 @@ export type ColumnTemplate<RecordType> = {
|
|
|
80
80
|
index: number;
|
|
81
81
|
field: string;
|
|
82
82
|
};
|
|
83
|
+
export type GetRowKey<RecordType> = (record: RecordType, index?: number) => Key;
|
|
83
84
|
export type ColumnTable<RecordType = AnyObject> = {
|
|
84
85
|
field: string;
|
|
85
86
|
width?: number;
|
|
@@ -200,6 +201,7 @@ export type TableProps<RecordType = AnyObject> = {
|
|
|
200
201
|
title?: ReactNode | ((data: RecordType) => ReactNode);
|
|
201
202
|
fullScreenTitle?: ReactNode | (() => ReactNode);
|
|
202
203
|
editAble?: boolean;
|
|
204
|
+
rowKey?: string;
|
|
203
205
|
infiniteScroll?: boolean;
|
|
204
206
|
next?: () => void;
|
|
205
207
|
locale?: Locale;
|
|
@@ -27,12 +27,9 @@ export const ColumnsGroup = props => {
|
|
|
27
27
|
const menuRef = useRef();
|
|
28
28
|
const [tempGroup, setTempGroup] = useState([]);
|
|
29
29
|
const [clicked, setClicked] = useState(false);
|
|
30
|
-
console.log('columns', columns);
|
|
31
|
-
console.log('columnsGrouped', columnsGrouped);
|
|
32
30
|
const rsCol = React.useMemo(() => {
|
|
33
31
|
return columns.filter(it => it.visible !== false && !tempGroup.includes(it.field) && it.field !== '#' && it.field !== 'selection_column' && it.field !== 'command');
|
|
34
32
|
}, [columns, tempGroup]);
|
|
35
|
-
console.log('rsCol', rsCol);
|
|
36
33
|
const options = React.useMemo(() => {
|
|
37
34
|
return rsCol.map(it => ({
|
|
38
35
|
...it,
|
|
@@ -225,6 +222,7 @@ export const ColumnsGroup = props => {
|
|
|
225
222
|
title: 'Nhóm dữ liệu'
|
|
226
223
|
}, /*#__PURE__*/React.createElement(Group, {
|
|
227
224
|
fontSize: 18,
|
|
225
|
+
color: "#555555",
|
|
228
226
|
style: {
|
|
229
227
|
cursor: 'pointer'
|
|
230
228
|
}
|
|
@@ -5,21 +5,15 @@ import 'react-resizable/css/styles.css';
|
|
|
5
5
|
import dayjs from 'dayjs';
|
|
6
6
|
import 'dayjs/locale/es';
|
|
7
7
|
import 'dayjs/locale/vi';
|
|
8
|
-
|
|
9
|
-
// import './style.scss'
|
|
10
|
-
|
|
11
8
|
import { faker } from '@faker-js/faker';
|
|
12
9
|
import useMergedState from "rc-util/es/hooks/useMergedState";
|
|
13
10
|
import { getCoreRowModel, getExpandedRowModel, getGroupedRowModel, getPaginationRowModel, useReactTable } from '@tanstack/react-table';
|
|
14
11
|
import { addRowIdArray, convertFlatColumn1, convertToObj, convertToObjTrue, filterDataByColumns, findAllChildrenKeys2, flatColumns2, getAllRowKey, getDiffent2Array, getFixedFields, getInvisibleColumns, groupArrayByColumns, isTreeArray, removeKeys } from "./hook/utils";
|
|
15
12
|
import { convertToTanStackColumns } from "./hook/useColumns";
|
|
16
|
-
// import { convertColumns } from './hook/convert'
|
|
17
13
|
import { removeInvisibleColumns } from "../grid-component/hooks";
|
|
18
14
|
import Grid from "./table/Grid";
|
|
19
15
|
import { removeColumns } from "../table-component/hook/utils";
|
|
20
16
|
import { OperatorFeature } from "../table-component/features/operator";
|
|
21
|
-
// import { ColumnsGroup } from '../grid-component/ColumnsGroup'
|
|
22
|
-
|
|
23
17
|
dayjs.extend(customParseFormat);
|
|
24
18
|
export const SELECTION_COLUMN = {};
|
|
25
19
|
const InternalTable = props => {
|
|
@@ -126,24 +120,6 @@ const InternalTable = props => {
|
|
|
126
120
|
// setColumns(updateWidthsByOther(propsColumns, columns))
|
|
127
121
|
setColumns(propsColumns);
|
|
128
122
|
}, [propsColumns]);
|
|
129
|
-
|
|
130
|
-
// const convertData = React.useMemo(() => {
|
|
131
|
-
|
|
132
|
-
// if (groupAble && groupSetting && groupSetting.client !== false) {
|
|
133
|
-
|
|
134
|
-
// const bbc = addRowIdArray(dataSource)
|
|
135
|
-
|
|
136
|
-
// const abc = groupArrayByColumns(bbc, groupColumns)
|
|
137
|
-
|
|
138
|
-
// return abc
|
|
139
|
-
// } else {
|
|
140
|
-
|
|
141
|
-
// return addRowIdArray(dataSource)
|
|
142
|
-
|
|
143
|
-
// }
|
|
144
|
-
|
|
145
|
-
// }, [dataSource, groupAble, groupColumns, groupSetting])
|
|
146
|
-
|
|
147
123
|
const mergedColumns = React.useMemo(() => {
|
|
148
124
|
return convertToTanStackColumns({
|
|
149
125
|
t,
|
|
@@ -151,8 +127,6 @@ const InternalTable = props => {
|
|
|
151
127
|
format,
|
|
152
128
|
editAble
|
|
153
129
|
});
|
|
154
|
-
|
|
155
|
-
// return convertToTanStackColumns<RecordType>(columns)
|
|
156
130
|
}, [t, columns, format, editAble]);
|
|
157
131
|
const isDataTree = React.useMemo(() => {
|
|
158
132
|
return isTreeArray(tableData);
|
|
@@ -191,8 +165,12 @@ const InternalTable = props => {
|
|
|
191
165
|
|
|
192
166
|
React.useEffect(() => {
|
|
193
167
|
const a = getInvisibleColumns(columns);
|
|
194
|
-
|
|
195
|
-
|
|
168
|
+
const bcd = convertToObj(groupColumns);
|
|
169
|
+
setColumnVisibility({
|
|
170
|
+
...a,
|
|
171
|
+
...bcd
|
|
172
|
+
});
|
|
173
|
+
}, [columns, groupColumns]);
|
|
196
174
|
const [columnsHiddenKeys, setColumnsHiddenKeys] = useMergedState(undefined, {
|
|
197
175
|
value: undefined
|
|
198
176
|
});
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { flexRender } from "@tanstack/react-table";
|
|
2
2
|
import Space from "rc-master-ui/es/space";
|
|
3
|
-
// import Command from "../components/command/Command";
|
|
4
|
-
|
|
5
3
|
import ReactDOMServer from 'react-dom/server';
|
|
6
4
|
import { getCommonPinningStyles } from "../hook/utils";
|
|
7
5
|
import Checkbox from "rc-master-ui/es/checkbox/Checkbox";
|
|
@@ -61,7 +59,6 @@ const renderCommand = args => {
|
|
|
61
59
|
onClick: () => {
|
|
62
60
|
commandClick?.({
|
|
63
61
|
id: item.id,
|
|
64
|
-
// rowId: getRowKey(record, index) as any,
|
|
65
62
|
rowId: record.rowId,
|
|
66
63
|
rowData: record,
|
|
67
64
|
index: cell.row.index,
|
|
@@ -186,12 +183,6 @@ const TableBodyCell = props => {
|
|
|
186
183
|
const isLastLeftPinnedColumn = isPinned === "left" && cell.column.getIsLastColumn("left");
|
|
187
184
|
const isFirstRightPinnedColumn = isPinned === "right" && cell.column.getIsFirstColumn("right");
|
|
188
185
|
const enableClick = typeof columnMeta.allowSelection === 'function' ? columnMeta.allowSelection(record) : columnMeta.allowSelection;
|
|
189
|
-
|
|
190
|
-
// const firstVisibleNormalColumn = table.getVisibleLeafColumns().filter(col => col.id !== 'selection' && col.id !== '#')[0];
|
|
191
|
-
// const firstVisibleNormalColumn = table.getVisibleLeafColumns().filter(col => col.id !== 'selection' && col.id !== '#')[0];
|
|
192
|
-
|
|
193
|
-
// const parrents = cell.row.getParentRows();
|
|
194
|
-
|
|
195
186
|
if (cell.column.id === "#") {
|
|
196
187
|
return /*#__PURE__*/React.createElement("td", {
|
|
197
188
|
key: cell.id,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
// import type { VirtualItem, Virtualizer } from "@tanstack/react-virtual"
|
|
3
2
|
import TableBodyCell from "./TableBodyCell";
|
|
4
3
|
import { flexRender } from "@tanstack/react-table";
|
|
5
4
|
import React from "react";
|
|
@@ -67,9 +66,6 @@ const TableBodyRow = ({
|
|
|
67
66
|
field
|
|
68
67
|
} = row.original ?? {};
|
|
69
68
|
const cellGroup = allCells.find(it => it.column.id === field);
|
|
70
|
-
|
|
71
|
-
// const header = allColumns.find((it) => it.id === field)
|
|
72
|
-
|
|
73
69
|
const headerContext = cellGroup && groupSetting?.showHeaderColumn !== false ? {
|
|
74
70
|
table,
|
|
75
71
|
column: cellGroup.column,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
const color = "#000000de";
|
|
3
3
|
const BgColor = "#ffffff";
|
|
4
|
+
const rowSelectedBg = "#FEF2EF";
|
|
4
5
|
const tableBorderColor = "#e0e0e0";
|
|
5
6
|
const tableBorderColorDark = "#44485E";
|
|
6
7
|
const BgColorDark = "#343e59";
|
|
@@ -8,4 +9,4 @@ const colorDark = "#e6e4f3e6";
|
|
|
8
9
|
export const GridStyle = styled.div.withConfig({
|
|
9
10
|
displayName: "GridStyle",
|
|
10
11
|
componentId: "es-grid-template__sc-rs980s-0"
|
|
11
|
-
})(["&.", "-grid{color:", ";font-size:13px;background-color:", ";table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";.", "-grid-thead{&:has(.resizer.isResizing){.", "-grid-cell{touch-action:none;user-select:none;}}.", "-grid-cell{background-color:#ffffff;&:has(.resizer.isResizing){touch-action:none;user-select:none;}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;touch-action:none;user-select:none;width:5px;}}}tbody{.", "-grid-row{&.", "-grid-row-parent{.", "-grid-cell{font-weight:600;background-color:#f5f5f5;}}}}.", "-grid-tfoot{z-index:3 !important;.ui-rc-grid-footer-row{.ui-rc-grid-cell{border-top:1px solid ", ";border-bottom:1px solid ", ";}}}.", "-grid-cell{padding:7px 8px;.class-content:has(*){background:lightblue;}.class-content:not(:has(*)){background:lightgreen;}&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-righ{text-align:right;justify-content:flex-end;}}.", "-grid-cell:not(:has(*)){&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-right{text-align:right;justify-content:flex-end;}&.", "-grid-cell-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}}&.", "-grid-light{.", "-grid-container{.", "-grid-thead{z-index:3 !important;background-color:", ";font-weight:500;.", "-grid-cell{font-weight:inherit;color:", ";background-color:#ffffff;
|
|
12
|
+
})(["&.", "-grid{color:", ";font-size:13px;background-color:", ";table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";.", "-grid-thead{&:has(.resizer.isResizing){.", "-grid-cell{touch-action:none;user-select:none;}}.", "-grid-cell{background-color:#ffffff;&:has(.resizer.isResizing){touch-action:none;user-select:none;}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;touch-action:none;user-select:none;width:5px;}}}tbody{.", "-grid-row{&.", "-grid-row-parent{.", "-grid-cell{font-weight:600;background-color:#f5f5f5;}}}}.", "-grid-tfoot{z-index:3 !important;.ui-rc-grid-footer-row{.ui-rc-grid-cell{border-top:1px solid ", ";border-bottom:1px solid ", ";}}}.", "-grid-cell{padding:7px 8px;.class-content:has(*){background:lightblue;}.class-content:not(:has(*)){background:lightgreen;}&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-righ{text-align:right;justify-content:flex-end;}}.", "-grid-cell:not(:has(*)){&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-right{text-align:right;justify-content:flex-end;}&.", "-grid-cell-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}}&.", "-grid-light{.", "-grid-container{.", "-grid-thead{z-index:3 !important;background-color:", ";font-weight:500;.", "-grid-cell{font-weight:inherit;color:", ";background-color:#ffffff;outline:1px solid ", ";border:0;&.ui-rc-grid-cell-ellipsis{.ui-rc-table-column-title,.", "-grid-cell-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}&.ui-rc-grid-cell-wrap{.ui-rc-table-column-title,.", "-grid-cell-text-wrap{white-space:normal;word-break:break-word;overflow:hidden;}}&:hover{.ui-rc-header-trigger{.ui-rc-table-column-sorter-cancel{opacity:1;}}}.", "-grid-filter-column{display:flex;justify-content:space-between;width:100%;align-items:center;position:relative;}.ui-rc-header-trigger{padding-left:6px;display:flex;align-items:center;.ui-rc-table-column-sorter-cancel{opacity:0;}}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;touch-action:none;user-select:none;width:5px;}.resizer.isResizing{opacity:1;}}}.", "-grid-tbody{.", "-grid-row{background-color:", ";color:", ";}}tbody{background-color:", ";color:", ";.", "-grid-row{&.ui-rc-grid-row-selected{.", "-grid-cell{background-color:", ";}}}.", "-grid-cell{outline:none;background-color:#ffffff;outline:1px solid ", ";&.ui-rc-grid-cell-selected{background-color:#33335d !important;}&.disable{background-color:#272A2F;}}}.", "-grid-tfoot{.", "-grid-footer-row{border-bottom-width:1px;border-bottom-color:", ";border-bottom-style:solid;border-top-width:1px;border-top-color:", ";border-top-style:solid;background-color:#fafafa;}.", "-grid-cell{background-color:inherit;border:0;outline:1px solid ", ";}}}}&.", "-grid-dark{background-color:", ";color:", ";.", "-grid-container{border-color:", ";&::after{border-right-color:", ";}}}}"], props => props.$prefix, color, BgColor, props => props.$prefix, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => props.$prefix, props => `${props.$theme.color ? props.$theme.color : color}`, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, rowSelectedBg, props => props.$prefix, tableBorderColor, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, tableBorderColor, props => props.$prefix, BgColorDark, colorDark, props => props.$prefix, tableBorderColorDark, tableBorderColorDark);
|
|
@@ -115,7 +115,6 @@ const Grid = props => {
|
|
|
115
115
|
}, [isSelectionChange, rowSelection, table.getState().rowSelection]);
|
|
116
116
|
React.useEffect(() => {
|
|
117
117
|
if (sorterChange) {
|
|
118
|
-
console.log('12312312313123');
|
|
119
118
|
const aa = table.getState().sorting;
|
|
120
119
|
const rs = aa.map(it => {
|
|
121
120
|
return {
|
|
@@ -135,7 +134,6 @@ const Grid = props => {
|
|
|
135
134
|
React.useEffect(() => {
|
|
136
135
|
if (filterChange) {
|
|
137
136
|
const operatorState = table.getState().operator;
|
|
138
|
-
console.log('operatorState', operatorState);
|
|
139
137
|
const merged = columnFilters.map(filter => {
|
|
140
138
|
const match = operatorState.find(op => op.id === filter.id);
|
|
141
139
|
const col = table.getVisibleFlatColumns().find(it => it.id === filter.id)?.columnDef.meta;
|
|
@@ -147,8 +145,6 @@ const Grid = props => {
|
|
|
147
145
|
operator: match ? match.operator : undefined
|
|
148
146
|
};
|
|
149
147
|
});
|
|
150
|
-
console.log('operatorState', operatorState);
|
|
151
|
-
console.log('merged', merged);
|
|
152
148
|
if (onFilter) {
|
|
153
149
|
onFilter?.(convertFilters(merged));
|
|
154
150
|
} else {
|
|
@@ -5,11 +5,11 @@ import React from 'react';
|
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import Pagination from 'rc-master-ui/es/pagination';
|
|
7
7
|
import { Toolbar } from 'rc-master-ui';
|
|
8
|
-
import { Maximize, Minimize } from 'becoxy-icons';
|
|
8
|
+
import { Collapse2, Expand2, Maximize, Minimize } from 'becoxy-icons';
|
|
9
9
|
import { numericFormatter } from 'react-numeric-component';
|
|
10
10
|
import TableWrapper from "./TableWrapper";
|
|
11
11
|
import { ColumnsChoose } from "../../table-component/ColumnsChoose";
|
|
12
|
-
import { getTableHeight } from "../hook/utils";
|
|
12
|
+
import { convertToObjTrue, findAllChildrenKeys2, getTableHeight, isObjEmpty } from "../hook/utils";
|
|
13
13
|
import { TableContext } from "../useContext";
|
|
14
14
|
// import { ColumnsGroup } from '../../grid-component/ColumnsGroup';
|
|
15
15
|
import { flatColumns2 } from "../../table-component/hook/utils";
|
|
@@ -20,7 +20,7 @@ const TableContainer = props => {
|
|
|
20
20
|
table,
|
|
21
21
|
id,
|
|
22
22
|
prefix,
|
|
23
|
-
|
|
23
|
+
commandClick,
|
|
24
24
|
editAble,
|
|
25
25
|
rowKey,
|
|
26
26
|
format,
|
|
@@ -106,41 +106,28 @@ const TableContainer = props => {
|
|
|
106
106
|
document.removeEventListener('mousedown', handleClickOutside);
|
|
107
107
|
};
|
|
108
108
|
}, []);
|
|
109
|
+
const triggerCommandClick = args => {
|
|
110
|
+
// const { id: idCommand, rowId, rowData, index } = args
|
|
109
111
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
// if (!tableContainerRef.current) {
|
|
113
|
-
// return
|
|
114
|
-
// }
|
|
115
|
-
|
|
116
|
-
// if (columnSizingInfo.isResizingColumn === false) {
|
|
117
|
-
|
|
118
|
-
// const aa = updateColumnWidthsRecursive(propsColumns, columnSizing)
|
|
119
|
-
|
|
120
|
-
// setColumns(aa)
|
|
121
|
-
|
|
122
|
-
// }
|
|
123
|
-
|
|
124
|
-
// }, [columnSizingInfo])
|
|
125
|
-
|
|
126
|
-
// const triggerCommandClick = (args: Omit<CommandClick<RecordType>, 'rows'>) => {
|
|
127
|
-
|
|
128
|
-
// // const { id: idCommand, rowId, rowData, index } = args
|
|
129
|
-
|
|
130
|
-
// // const tmpData = [...dataSource]
|
|
131
|
-
|
|
132
|
-
// if (commandClick) {
|
|
133
|
-
// commandClick({
|
|
134
|
-
// ...args,
|
|
135
|
-
// rows: originData
|
|
136
|
-
// })
|
|
137
|
-
// }
|
|
138
|
-
|
|
139
|
-
// }
|
|
112
|
+
// const tmpData = [...dataSource]
|
|
140
113
|
|
|
114
|
+
if (commandClick) {
|
|
115
|
+
commandClick({
|
|
116
|
+
...args,
|
|
117
|
+
rows: originData
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
};
|
|
141
121
|
const handleOnGroup = value => {
|
|
142
122
|
triggerGroupColumns?.(value);
|
|
143
123
|
};
|
|
124
|
+
const handleCollapseAllGroup = () => {
|
|
125
|
+
setExpanded({});
|
|
126
|
+
};
|
|
127
|
+
const handleExpandAllGroup = () => {
|
|
128
|
+
const allKeys = findAllChildrenKeys2(dataSource, rowKey, 'children');
|
|
129
|
+
setExpanded(convertToObjTrue(allKeys));
|
|
130
|
+
};
|
|
144
131
|
const groupToolbar = () => {
|
|
145
132
|
return /*#__PURE__*/React.createElement("div", {
|
|
146
133
|
style: {
|
|
@@ -158,7 +145,15 @@ const TableContainer = props => {
|
|
|
158
145
|
columns: propsColumns ? flatColumns2(propsColumns) : [],
|
|
159
146
|
columnsGrouped: groupColumns,
|
|
160
147
|
onSubmit: handleOnGroup
|
|
161
|
-
}), /*#__PURE__*/React.createElement(React.Fragment, null)
|
|
148
|
+
}), /*#__PURE__*/React.createElement(React.Fragment, null, !isObjEmpty(expanded) ? /*#__PURE__*/React.createElement(Collapse2, {
|
|
149
|
+
fontSize: 16,
|
|
150
|
+
color: '#555555',
|
|
151
|
+
onClick: handleCollapseAllGroup
|
|
152
|
+
}) : /*#__PURE__*/React.createElement(Expand2, {
|
|
153
|
+
fontSize: 16,
|
|
154
|
+
color: '#555555',
|
|
155
|
+
onClick: handleExpandAllGroup
|
|
156
|
+
})));
|
|
162
157
|
};
|
|
163
158
|
return /*#__PURE__*/React.createElement("div", {
|
|
164
159
|
ref: containerRef,
|
|
@@ -234,7 +229,6 @@ const TableContainer = props => {
|
|
|
234
229
|
setExpanded,
|
|
235
230
|
dataSource,
|
|
236
231
|
originData,
|
|
237
|
-
// triggerFilter,
|
|
238
232
|
wrapSettings,
|
|
239
233
|
recordDoubleClick,
|
|
240
234
|
selectionSettings,
|
|
@@ -245,8 +239,6 @@ const TableContainer = props => {
|
|
|
245
239
|
setFilterChange,
|
|
246
240
|
windowSize,
|
|
247
241
|
isDataTree,
|
|
248
|
-
// focusedCell,
|
|
249
|
-
// setFocusedCell,
|
|
250
242
|
rowClassName,
|
|
251
243
|
onRowStyles,
|
|
252
244
|
onRowFooterStyles,
|
|
@@ -254,12 +246,6 @@ const TableContainer = props => {
|
|
|
254
246
|
table,
|
|
255
247
|
pagination,
|
|
256
248
|
groupSetting
|
|
257
|
-
// visible,
|
|
258
|
-
// setVisible,
|
|
259
|
-
// selectedKeys,
|
|
260
|
-
// setSelectedKeys,
|
|
261
|
-
// currentFilter,
|
|
262
|
-
// setCurrentFilter
|
|
263
249
|
}
|
|
264
250
|
}, /*#__PURE__*/React.createElement(TableWrapper, {
|
|
265
251
|
tableContainerRef: tableContainerRef,
|
|
@@ -269,7 +255,8 @@ const TableContainer = props => {
|
|
|
269
255
|
minHeight: minHeight,
|
|
270
256
|
dataSource: dataSource,
|
|
271
257
|
table: table,
|
|
272
|
-
columns: columns
|
|
258
|
+
columns: columns,
|
|
259
|
+
commandClick: triggerCommandClick
|
|
273
260
|
})), /*#__PURE__*/React.createElement("div", {
|
|
274
261
|
ref: bottomToolbarRef
|
|
275
262
|
}, pagination && !infiniteScroll && /*#__PURE__*/React.createElement(Pagination
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ColumnDef, Table } from "@tanstack/react-table";
|
|
3
|
+
import type { CommandClick } from '../../table-component/type';
|
|
3
4
|
type Props<T> = {
|
|
4
5
|
tableContainerRef: React.RefObject<HTMLDivElement>;
|
|
5
6
|
table: Table<T>;
|
|
@@ -11,6 +12,7 @@ type Props<T> = {
|
|
|
11
12
|
dataSource: T[];
|
|
12
13
|
summary?: boolean;
|
|
13
14
|
loading?: boolean;
|
|
15
|
+
commandClick?: (args: Omit<CommandClick<T>, 'rows'>) => void;
|
|
14
16
|
editAble?: boolean;
|
|
15
17
|
showEmptyText?: boolean;
|
|
16
18
|
contextMenuClick?: any;
|
|
@@ -14,6 +14,7 @@ import { TableContext } from "../useContext";
|
|
|
14
14
|
import classNames from 'classnames';
|
|
15
15
|
import TableBodyRow from "../body/TableBodyRow";
|
|
16
16
|
import TableFooterCell from "../footer/TableFooterCell";
|
|
17
|
+
|
|
17
18
|
// import type { ColumnsTable, TableProps } from '../type';
|
|
18
19
|
|
|
19
20
|
// type TableContainerProps<T> = Omit<TableProps<T>, 'columns'> & {
|
|
@@ -23,7 +24,8 @@ const TableWrapper = props => {
|
|
|
23
24
|
table,
|
|
24
25
|
// columns,
|
|
25
26
|
height,
|
|
26
|
-
id
|
|
27
|
+
id,
|
|
28
|
+
commandClick
|
|
27
29
|
} = props;
|
|
28
30
|
const {
|
|
29
31
|
prefix
|
|
@@ -83,7 +85,8 @@ const TableWrapper = props => {
|
|
|
83
85
|
return /*#__PURE__*/React.createElement(TableBodyRow, _extends({
|
|
84
86
|
tableId: id,
|
|
85
87
|
row: row,
|
|
86
|
-
table: table
|
|
88
|
+
table: table,
|
|
89
|
+
commandClick: commandClick
|
|
87
90
|
}, props));
|
|
88
91
|
}
|
|
89
92
|
}
|
|
@@ -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,11 +6,9 @@ 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
11
|
var _tableVirtuoso = _interopRequireDefault(require("../table-virtuoso"));
|
|
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; }
|
|
14
12
|
const TempTable = props => {
|
|
15
13
|
const {
|
|
16
14
|
groupAble,
|
|
@@ -18,9 +16,9 @@ const TempTable = props => {
|
|
|
18
16
|
...rest
|
|
19
17
|
} = props;
|
|
20
18
|
const TabComponent = groupAble ? _tableVirtuoso.default : _tableComponent.default;
|
|
21
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
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;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.valueToBoolean = exports.translateOption = exports.transferFontSize = exports.stringOperator = exports.paperSize = exports.optionsSize = exports.optionsPaperOrientation = exports.optionFontSize = exports.optionFont = exports.numberOperator = exports.defaultWidth = exports.defaultTimeFormat = exports.defaultRowHeight = exports.defaultPageSizes = exports.defaultDateTimeFormat = exports.defaultDateFormat = exports.default = exports.dateTimeOperator = exports.dateOperator = exports.booleanToValue = exports.booleanOperator = exports.alignToFlex = void 0;
|
|
6
|
+
exports.valueToBoolean = exports.translateOption = exports.transferFontSize = exports.stringOperator = exports.paperSize = exports.optionsSize = exports.optionsPaperOrientation = exports.optionFontSize = exports.optionFont = exports.numberOperator = exports.nonActionColumn = exports.defaultWidth = exports.defaultTimeFormat = exports.defaultRowHeight = exports.defaultPageSizes = exports.defaultDateTimeFormat = exports.defaultDateFormat = exports.default = exports.dateTimeOperator = exports.dateOperator = exports.booleanToValue = exports.booleanOperator = exports.alignToFlex = void 0;
|
|
7
7
|
const defaultWidth = exports.defaultWidth = 100;
|
|
8
8
|
const defaultRowHeight = exports.defaultRowHeight = 35;
|
|
9
9
|
const numberOperator = exports.numberOperator = [{
|
|
@@ -243,4 +243,5 @@ const valueToBoolean = exports.valueToBoolean = {
|
|
|
243
243
|
const booleanToValue = exports.booleanToValue = {
|
|
244
244
|
true: 1,
|
|
245
245
|
false: 0
|
|
246
|
-
};
|
|
246
|
+
};
|
|
247
|
+
const nonActionColumn = exports.nonActionColumn = ['#', 'command', 'selection_column'];
|
|
@@ -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,10 +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 { AnyObject } from "../type";
|
|
6
4
|
import type { Key } from "react";
|
|
7
5
|
import type { ColumnsTable } from "./../index";
|
|
6
|
+
import type { AnyObject, ColumnTable, GetRowKey, IFormat } from "../../table-component/type";
|
|
8
7
|
export declare const newGuid: () => any;
|
|
9
8
|
export declare const sumDataByField: (data: any[], field: string) => any;
|
|
10
9
|
export declare const checkThousandSeparator: (thousandSeparator: string | undefined, decimalSeparator: string | undefined) => string;
|
|
@@ -50,7 +49,7 @@ export declare const convertLabelToTitle: (data: any[]) => any[];
|
|
|
50
49
|
export declare const convertArrayWithIndent: (inputArray: any[], parentIndent?: number) => any[];
|
|
51
50
|
export declare const getTemplate: (template: any, column?: ColumnTable) => React.ReactNode | React.ReactElement;
|
|
52
51
|
export declare const isObjEmpty: (obj: any) => boolean;
|
|
53
|
-
export declare const getColumnsVisible: <T>(columns: ColumnsTable<T>, index: number) =>
|
|
52
|
+
export declare const getColumnsVisible: <T>(columns: ColumnsTable<T>, index: number) => ColumnTable<T>[];
|
|
54
53
|
export declare const updateData: <Record = AnyObject>(initData: Record[], rows: Record[], key: keyof Record) => Record[];
|
|
55
54
|
export declare const parseBooleanToValue: (value: boolean, type: 'boolean' | 'number') => number | boolean;
|
|
56
55
|
export declare const genPresets: (presets?: import("@ant-design/colors").PalettesProps) => import("antd/es/color-picker/interface").PresetsItem[];
|
|
@@ -105,7 +104,7 @@ export declare const convertFlatColumn: (array: ColumnsTable) => ColumnsTable[];
|
|
|
105
104
|
export declare const checkChild: (inputArray: any[]) => boolean;
|
|
106
105
|
export declare const isEditable: <RecordType>(column: ColumnTable, rowData: RecordType) => boolean | ((rowData: any) => boolean);
|
|
107
106
|
export declare const isArraysEqual: (arr1: any[], arr2: any[]) => boolean;
|
|
108
|
-
export declare const editAbleColumns: <T>(columns: ColumnsTable<T>) =>
|
|
107
|
+
export declare const editAbleColumns: <T>(columns: ColumnsTable<T>) => ColumnTable<T>[];
|
|
109
108
|
export declare const findItemPath: (tree: any[], targetItem: any, rowKey: any, currentPage?: number, pageSize?: number) => any;
|
|
110
109
|
export declare const filterDataByColumns: (data: any[], queries: any) => any[];
|
|
111
110
|
export declare const filterDataByColumns2: (data: any[], queries: any) => any[];
|
|
@@ -48,7 +48,10 @@ 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
|
+
// import type {ColumnTable, GetRowKey, IFormat, Presets} from "./../ type"
|
|
52
|
+
|
|
51
53
|
// import type {SelectionSettings} from "../type"
|
|
54
|
+
// import type {AnyObject} from "../type"
|
|
52
55
|
|
|
53
56
|
// import {Table} from "rc-master-ui"
|
|
54
57
|
// import {flatColumns2} from "./columns"
|