es-grid-template 1.8.66 → 1.8.68
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/hooks/constant.d.ts +1 -0
- package/es/grid-component/hooks/constant.js +2 -1
- package/es/grid-component/hooks/useLazyKVMap.d.ts +1 -1
- package/es/grid-component/hooks/utils.d.ts +1 -1
- package/es/grid-component/index.d.ts +1 -1
- package/es/grid-component/type.d.ts +567 -0
- package/es/grid-component/type.js +1 -490
- package/es/table-component/ColumnsChoose.d.ts +1 -1
- package/es/table-component/ColumnsChoose.js +0 -2
- package/es/table-component/ContextMenu.d.ts +1 -2
- package/es/table-component/ContextMenu.js +0 -1
- package/es/table-component/InternalTable.d.ts +1 -2
- package/es/table-component/InternalTable.js +1 -32
- package/es/table-component/TableContainer.d.ts +1 -1
- package/es/table-component/TableContainer.js +4 -2
- package/es/table-component/TableContainerEdit.d.ts +1 -1
- package/es/table-component/TableContainerEdit.js +6 -129
- package/es/table-component/body/EditableCell.d.ts +1 -1
- package/es/table-component/body/EditableCell.js +1 -18
- package/es/table-component/body/TableBody.d.ts +1 -1
- package/es/table-component/body/TableBodyCell.d.ts +1 -1
- package/es/table-component/body/TableBodyCellEdit.d.ts +1 -1
- package/es/table-component/body/TableBodyCellEdit.js +2 -9
- package/es/table-component/body/TableBodyRow.d.ts +1 -1
- package/es/table-component/components/ControlCheckbox.d.ts +1 -1
- package/es/table-component/components/EditForm/EditForm.js +0 -1
- package/es/table-component/components/InputControl/InputControl.js +0 -3
- package/es/table-component/components/async-select/index.d.ts +1 -1
- package/es/table-component/components/async-select/index.js +0 -3
- package/es/table-component/components/async-table-select/index.d.ts +1 -1
- package/es/table-component/components/async-table-select/index.js +0 -4
- package/es/table-component/components/checkbox-filter/CheckboxFilter.js +6 -2
- package/es/table-component/components/checkbox-filter/FilterSearch.d.ts +1 -1
- package/es/table-component/components/checkbox-filter/FilterSearch.js +1 -1
- package/es/table-component/components/command/Command.d.ts +1 -1
- package/es/table-component/components/number/index.d.ts +3 -2
- package/es/table-component/components/number/index.js +0 -8
- package/es/table-component/components/number-range/index.d.ts +3 -2
- package/es/table-component/components/number-range/index.js +0 -3
- package/es/table-component/footer/TableFooterRow.js +1 -22
- package/es/table-component/header/TableHead.js +0 -20
- package/es/table-component/header/TableHeadCell.js +1 -15
- package/es/table-component/header/TableHeadCell2.js +5 -3
- package/es/table-component/header/TableHeadGroupCell.js +0 -23
- package/es/table-component/header/renderFilter.d.ts +1 -1
- package/es/table-component/hook/useColumns.d.ts +1 -1
- package/es/table-component/hook/useFilterOperator.d.ts +2 -2
- package/es/table-component/hook/utils.d.ts +1 -1
- package/es/table-component/hook/utils.js +0 -3
- package/es/table-component/index.d.ts +1 -1
- package/es/table-component/index.js +0 -3
- package/es/table-component/table/Grid.d.ts +1 -1
- package/es/table-component/table/Grid.js +0 -5
- package/es/table-component/table/TableWrapper.d.ts +1 -1
- package/es/table-component/useContext.d.ts +2 -1
- package/es/table-virtuoso/InternalTable.d.ts +1 -1
- package/es/table-virtuoso/InternalTable.js +2 -1
- package/es/table-virtuoso/body/TableBodyCell.d.ts +1 -1
- package/es/table-virtuoso/body/TableBodyCell.js +1 -1
- package/es/table-virtuoso/body/TableBodyRow.d.ts +2 -2
- package/es/table-virtuoso/body/TableBodyRow.js +3 -1
- package/es/table-virtuoso/header/TableHeadCell.js +1 -3
- package/es/table-virtuoso/header/renderFilter.d.ts +1 -1
- package/es/table-virtuoso/header/renderFilter.js +0 -4
- package/es/table-virtuoso/hook/utils.d.ts +1 -1
- package/es/table-virtuoso/style.js +1 -1
- package/es/table-virtuoso/table/Grid.d.ts +1 -1
- package/es/table-virtuoso/table/Grid.js +0 -24
- package/es/table-virtuoso/table/TableContainer.d.ts +1 -1
- package/es/table-virtuoso/table/TableContainer.js +0 -2
- package/es/table-virtuoso/table/TableWrapper.d.ts +1 -1
- package/es/table-virtuoso/table/TableWrapper.js +3 -19
- package/es/table-virtuoso/useContext.d.ts +1 -1
- 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/utils.d.ts +1 -1
- package/lib/grid-component/index.d.ts +1 -1
- package/lib/grid-component/type.d.ts +567 -0
- package/lib/grid-component/type.js +4 -490
- package/lib/table-component/ColumnsChoose.d.ts +1 -1
- package/lib/table-component/ColumnsChoose.js +0 -2
- package/lib/table-component/ContextMenu.d.ts +1 -2
- package/lib/table-component/ContextMenu.js +0 -2
- package/lib/table-component/InternalTable.d.ts +1 -2
- package/lib/table-component/InternalTable.js +1 -28
- package/lib/table-component/TableContainer.d.ts +1 -1
- package/lib/table-component/TableContainer.js +4 -2
- package/lib/table-component/TableContainerEdit.d.ts +1 -1
- package/lib/table-component/TableContainerEdit.js +5 -128
- package/lib/table-component/body/EditableCell.d.ts +1 -1
- package/lib/table-component/body/EditableCell.js +0 -10
- package/lib/table-component/body/TableBody.d.ts +1 -1
- package/lib/table-component/body/TableBodyCell.d.ts +1 -1
- package/lib/table-component/body/TableBodyCellEdit.d.ts +1 -1
- package/lib/table-component/body/TableBodyCellEdit.js +5 -11
- package/lib/table-component/body/TableBodyRow.d.ts +1 -1
- package/lib/table-component/components/ControlCheckbox.d.ts +1 -1
- package/lib/table-component/components/EditForm/EditForm.js +0 -2
- package/lib/table-component/components/InputControl/InputControl.js +0 -4
- package/lib/table-component/components/async-select/index.d.ts +1 -1
- package/lib/table-component/components/async-select/index.js +0 -2
- package/lib/table-component/components/async-table-select/index.d.ts +1 -1
- package/lib/table-component/components/async-table-select/index.js +0 -4
- package/lib/table-component/components/checkbox-filter/CheckboxFilter.js +6 -2
- package/lib/table-component/components/checkbox-filter/FilterSearch.d.ts +1 -1
- package/lib/table-component/components/checkbox-filter/FilterSearch.js +1 -1
- package/lib/table-component/components/command/Command.d.ts +1 -1
- package/lib/table-component/components/number/index.d.ts +3 -2
- package/lib/table-component/components/number/index.js +0 -8
- package/lib/table-component/components/number-range/index.d.ts +3 -2
- package/lib/table-component/components/number-range/index.js +0 -3
- package/lib/table-component/footer/TableFooterRow.js +1 -23
- package/lib/table-component/header/TableHead.js +0 -21
- package/lib/table-component/header/TableHeadCell.js +4 -18
- package/lib/table-component/header/TableHeadCell2.js +8 -6
- package/lib/table-component/header/TableHeadGroupCell.js +0 -23
- package/lib/table-component/header/renderFilter.d.ts +1 -1
- package/lib/table-component/hook/useColumns.d.ts +1 -1
- package/lib/table-component/hook/useFilterOperator.d.ts +2 -2
- package/lib/table-component/hook/utils.d.ts +1 -1
- package/lib/table-component/hook/utils.js +0 -4
- package/lib/table-component/index.d.ts +1 -1
- package/lib/table-component/index.js +0 -1
- package/lib/table-component/table/Grid.d.ts +1 -1
- package/lib/table-component/table/Grid.js +0 -4
- package/lib/table-component/table/TableWrapper.d.ts +1 -1
- package/lib/table-component/useContext.d.ts +2 -1
- package/lib/table-virtuoso/InternalTable.d.ts +1 -1
- package/lib/table-virtuoso/InternalTable.js +3 -1
- package/lib/table-virtuoso/body/TableBodyCell.d.ts +1 -1
- package/lib/table-virtuoso/body/TableBodyCell.js +1 -1
- package/lib/table-virtuoso/body/TableBodyRow.d.ts +2 -2
- package/lib/table-virtuoso/body/TableBodyRow.js +3 -1
- package/lib/table-virtuoso/header/TableHeadCell.js +4 -6
- package/lib/table-virtuoso/header/renderFilter.d.ts +1 -1
- package/lib/table-virtuoso/header/renderFilter.js +0 -4
- package/lib/table-virtuoso/hook/utils.d.ts +1 -1
- package/lib/table-virtuoso/style.js +1 -1
- package/lib/table-virtuoso/table/Grid.d.ts +1 -1
- package/lib/table-virtuoso/table/Grid.js +0 -24
- package/lib/table-virtuoso/table/TableContainer.d.ts +1 -1
- package/lib/table-virtuoso/table/TableContainer.js +0 -2
- package/lib/table-virtuoso/table/TableWrapper.d.ts +1 -1
- package/lib/table-virtuoso/table/TableWrapper.js +3 -19
- package/lib/table-virtuoso/useContext.d.ts +1 -1
- package/package.json +1 -1
- package/es/table-component/hook/constant.d.ts +0 -73
- package/es/table-component/hook/constant.js +0 -240
- package/es/table-component/type.d.ts +0 -567
- package/es/table-component/type.js +0 -1
- package/es/table-virtuoso/hook/constant.d.ts +0 -73
- package/es/table-virtuoso/hook/constant.js +0 -240
- package/es/table-virtuoso/hook/convert.d.ts +0 -1
- package/es/table-virtuoso/hook/convert.js +0 -28
- package/es/table-virtuoso/hook/useColumns.d.ts +0 -28
- package/es/table-virtuoso/hook/useColumns.js +0 -302
- package/es/table-virtuoso/hook/useFilterOperator.d.ts +0 -7
- package/es/table-virtuoso/hook/useFilterOperator.js +0 -33
- package/es/table-virtuoso/style.scss +0 -1441
- package/es/table-virtuoso/type.d.ts +0 -0
- package/es/table-virtuoso/type.js +0 -785
- package/lib/table-component/hook/constant.d.ts +0 -73
- package/lib/table-component/hook/constant.js +0 -247
- package/lib/table-component/type.d.ts +0 -567
- package/lib/table-component/type.js +0 -5
- package/lib/table-virtuoso/hook/constant.d.ts +0 -73
- package/lib/table-virtuoso/hook/constant.js +0 -247
- package/lib/table-virtuoso/hook/convert.d.ts +0 -1
- package/lib/table-virtuoso/hook/convert.js +0 -34
- package/lib/table-virtuoso/hook/useColumns.d.ts +0 -28
- package/lib/table-virtuoso/hook/useColumns.js +0 -315
- package/lib/table-virtuoso/hook/useFilterOperator.d.ts +0 -7
- package/lib/table-virtuoso/hook/useFilterOperator.js +0 -40
- package/lib/table-virtuoso/style.scss +0 -1441
- package/lib/table-virtuoso/type.d.ts +0 -0
- package/lib/table-virtuoso/type.js +0 -786
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Key } from "react";
|
|
2
|
-
import type { AnyObject, GetRowKey } from '
|
|
2
|
+
import type { AnyObject, GetRowKey } from '../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;
|
|
@@ -3,7 +3,7 @@ import dayjs from "dayjs";
|
|
|
3
3
|
import type { EditType, IColumnType, TypeFilter } from "rc-master-ui";
|
|
4
4
|
import type { Key } from "react";
|
|
5
5
|
import type { ColumnsTable } from "./../index";
|
|
6
|
-
import type { AnyObject, ColumnTable, GetRowKey, IFormat } from "
|
|
6
|
+
import type { AnyObject, ColumnTable, GetRowKey, IFormat } from "../type";
|
|
7
7
|
export declare const newGuid: () => any;
|
|
8
8
|
export declare const sumDataByField: (data: any[], field: string) => any;
|
|
9
9
|
export declare const checkThousandSeparator: (thousandSeparator: string | undefined, decimalSeparator: string | undefined) => string;
|
|
@@ -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 './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;
|
|
@@ -0,0 +1,567 @@
|
|
|
1
|
+
import type { CheckboxProps, TablePaginationConfig } from 'rc-master-ui';
|
|
2
|
+
import type { ItemType } from 'rc-master-ui/es/menu/interface';
|
|
3
|
+
import type { Cell, Header, OnChangeFn, Row } from '@tanstack/react-table';
|
|
4
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
5
|
+
import type { ColorPickerProps } from 'antd';
|
|
6
|
+
import type { TableLocale } from "rc-master-ui/lib/table/interface";
|
|
7
|
+
import type { IOperator } from '../grid-component/hooks';
|
|
8
|
+
declare module "@tanstack/table-core" {
|
|
9
|
+
interface ColumnMeta<any, any> extends ColumnTable {
|
|
10
|
+
rowSpan?: number;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export type ExtendedColumnFilter = {
|
|
14
|
+
id: string;
|
|
15
|
+
value: string;
|
|
16
|
+
operator?: FilterOperator;
|
|
17
|
+
};
|
|
18
|
+
export type OpetorState = ColumnOperator[];
|
|
19
|
+
export interface OpetorTableState {
|
|
20
|
+
operator: OpetorState;
|
|
21
|
+
}
|
|
22
|
+
export interface ColumnOperator {
|
|
23
|
+
id: string;
|
|
24
|
+
operator: string;
|
|
25
|
+
}
|
|
26
|
+
export interface DensityOptions {
|
|
27
|
+
enableOperator?: boolean;
|
|
28
|
+
onOperatorChange?: OnChangeFn<OpetorState>;
|
|
29
|
+
}
|
|
30
|
+
export type Key = React.Key;
|
|
31
|
+
export type PaginationConfig = TablePaginationConfig & {
|
|
32
|
+
currentPage?: number;
|
|
33
|
+
};
|
|
34
|
+
export type AnyObject = Record<PropertyKey, any>;
|
|
35
|
+
export type IFormat = {
|
|
36
|
+
thousandSeparator?: string;
|
|
37
|
+
decimalSeparator?: string;
|
|
38
|
+
decimalScale?: number | undefined;
|
|
39
|
+
allowNegative?: boolean;
|
|
40
|
+
prefix?: string | undefined;
|
|
41
|
+
suffix?: string | undefined;
|
|
42
|
+
fixedDecimalScale?: boolean;
|
|
43
|
+
dateFormat?: string;
|
|
44
|
+
datetimeFormat?: string;
|
|
45
|
+
timeFormat?: string;
|
|
46
|
+
weekFormat?: string;
|
|
47
|
+
monthFormat?: string;
|
|
48
|
+
yearFormat?: string;
|
|
49
|
+
};
|
|
50
|
+
export type RowSelectMethod = 'all' | 'none' | 'invert' | 'single' | 'multiple';
|
|
51
|
+
export type EditType = 'text' | 'numeric' | 'asyncSelect' | 'date' | 'datetime' | 'time' | 'week' | 'month' | 'quarter' | 'year' | 'select' | 'checkbox' | 'currency' | 'image' | 'selectTable' | 'customSelect' | 'form' | 'color' | 'treeSelect' | 'file';
|
|
52
|
+
export type ITextAlign = 'center' | 'left' | 'right';
|
|
53
|
+
export type TypeFilter = 'Text' | 'Date' | 'Time' | 'Datetime' | 'DateRange' | 'Month' | 'Quarter' | 'Year' | 'Week' | 'Number' | 'NumberRange' | 'Dropdown' | 'DropTree' | 'Checkbox' | 'CheckboxTree' | 'CheckboxDropdown';
|
|
54
|
+
export type IColumnType = 'number' | 'time' | 'date' | 'week' | 'month' | 'file' | 'quarter' | 'year' | 'datetime' | 'string' | 'boolean' | 'checkbox' | 'color' | null | undefined;
|
|
55
|
+
export type FilterOperator = 'equal' | 'notEqual' | 'greaterThan' | 'greaterThanOrEqual' | 'lessThan' | 'lessThanOrEqual' | 'startsWith' | 'endsWith' | 'contains';
|
|
56
|
+
export type FixedType = 'left' | 'right' | boolean;
|
|
57
|
+
export type SelectMode = 'checkbox' | 'radio' | undefined;
|
|
58
|
+
type IGrid = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24;
|
|
59
|
+
export interface FieldNames {
|
|
60
|
+
value?: string;
|
|
61
|
+
label?: string;
|
|
62
|
+
groupLabel?: string;
|
|
63
|
+
options?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface CommandItem {
|
|
66
|
+
id: string;
|
|
67
|
+
type?: string;
|
|
68
|
+
visible?: boolean | ((record: any) => boolean);
|
|
69
|
+
title: string;
|
|
70
|
+
color?: 'blue' | 'purple' | 'cyan' | 'green' | 'magenta' | 'pink' | 'red' | 'orange' | 'yellow' | 'volcano' | 'geekblue' | 'lime' | 'gold';
|
|
71
|
+
tooltip?: string;
|
|
72
|
+
icon?: ReactNode | ReactElement | (() => ReactNode | ReactElement);
|
|
73
|
+
template?: ReactNode | ReactElement | ((record: any) => ReactNode | ReactElement);
|
|
74
|
+
client?: boolean;
|
|
75
|
+
confirmDialog?: boolean;
|
|
76
|
+
}
|
|
77
|
+
export type ColumnTemplate<RecordType> = {
|
|
78
|
+
value: any;
|
|
79
|
+
rowData: RecordType;
|
|
80
|
+
index: number;
|
|
81
|
+
field: string;
|
|
82
|
+
};
|
|
83
|
+
export type GetRowKey<RecordType> = (record: RecordType, index?: number) => Key;
|
|
84
|
+
export type ColumnTable<RecordType = AnyObject> = {
|
|
85
|
+
field: string;
|
|
86
|
+
width?: number;
|
|
87
|
+
maxWidth?: number;
|
|
88
|
+
minWidth?: number;
|
|
89
|
+
type?: IColumnType;
|
|
90
|
+
haveSum?: boolean;
|
|
91
|
+
isSummary?: boolean;
|
|
92
|
+
summaryTemplate?: (data: number, key: string) => ReactElement | ReactNode;
|
|
93
|
+
format?: IFormat | ((rowData: any) => IFormat);
|
|
94
|
+
allowFiltering?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* @deprecated Please use `allowSortering` instead.
|
|
97
|
+
* @since 1.7.25
|
|
98
|
+
*/
|
|
99
|
+
sorter?: boolean;
|
|
100
|
+
allowSortering?: boolean;
|
|
101
|
+
operator?: FilterOperator;
|
|
102
|
+
hideOperator?: boolean;
|
|
103
|
+
placeholder?: string;
|
|
104
|
+
showInColumnChoose?: boolean;
|
|
105
|
+
typeFilter?: TypeFilter;
|
|
106
|
+
source?: any[];
|
|
107
|
+
showFilterSearch?: boolean;
|
|
108
|
+
headerText?: string;
|
|
109
|
+
/**
|
|
110
|
+
* @deprecated Please use `visible` instead.
|
|
111
|
+
* @since 1.7.33
|
|
112
|
+
*/
|
|
113
|
+
hidden?: boolean;
|
|
114
|
+
visible?: boolean;
|
|
115
|
+
headerTooltip?: boolean | string | (() => ReactNode | ReactElement);
|
|
116
|
+
columnGroupText?: string;
|
|
117
|
+
/**
|
|
118
|
+
* @deprecated Please use `textAlign` instead.
|
|
119
|
+
* @since 1.7.34
|
|
120
|
+
*/
|
|
121
|
+
align?: ITextAlign;
|
|
122
|
+
textAlign?: ITextAlign;
|
|
123
|
+
headerTextAlign?: ITextAlign;
|
|
124
|
+
template?: ReactNode | ReactElement | ((args: ColumnTemplate<RecordType>) => ReactNode | ReactElement);
|
|
125
|
+
showTooltip?: boolean;
|
|
126
|
+
tooltipDescription?: string | ((args: {
|
|
127
|
+
value: any;
|
|
128
|
+
record: RecordType;
|
|
129
|
+
}) => ReactNode | ReactElement);
|
|
130
|
+
headerTemplate?: React.ReactNode | React.ReactElement | ((column: ColumnTable<RecordType>) => React.ReactNode | React.ReactElement);
|
|
131
|
+
commandItems?: CommandItem[];
|
|
132
|
+
children?: ColumnTable<RecordType>[];
|
|
133
|
+
editType?: EditType | ((rowData?: RecordType) => EditType);
|
|
134
|
+
disable?: boolean | ((rowData: any) => boolean);
|
|
135
|
+
editEnable?: boolean | ((rowData: any) => boolean);
|
|
136
|
+
isClearable?: boolean;
|
|
137
|
+
maxDate?: any;
|
|
138
|
+
minDate?: any;
|
|
139
|
+
maxTime?: any;
|
|
140
|
+
minTime?: any;
|
|
141
|
+
max?: number;
|
|
142
|
+
min?: number;
|
|
143
|
+
editSelectSettings?: IEditSelectSettings;
|
|
144
|
+
editFromSettings?: IEditFromSettings;
|
|
145
|
+
/**
|
|
146
|
+
* @deprecated Please use `fixed` instead.
|
|
147
|
+
* @since 1.7.25
|
|
148
|
+
*/
|
|
149
|
+
fixedType?: FixedType;
|
|
150
|
+
fixed?: FixedType;
|
|
151
|
+
/**
|
|
152
|
+
* @deprecated Please use `wrapSettings` instead.
|
|
153
|
+
* @since 1.7.34
|
|
154
|
+
*/
|
|
155
|
+
headerTextWrap?: boolean;
|
|
156
|
+
ellipsis?: boolean;
|
|
157
|
+
allowResizing?: boolean;
|
|
158
|
+
allowSelection?: boolean | ((rowData: RecordType) => boolean);
|
|
159
|
+
onCellStyles?: Omit<React.CSSProperties, 'display' | 'width' | 'minWidth' | 'left' | 'right' | 'position'> | ((cellValue: any, cell: Cell<RecordType, unknown>) => Omit<React.CSSProperties, 'display' | 'width' | 'minWidth' | 'left' | 'right' | 'position'>);
|
|
160
|
+
onCellHeaderStyles?: Omit<React.CSSProperties, 'display' | 'width' | 'minWidth' | 'left' | 'right' | 'position'> | ((cell: Header<RecordType, unknown>) => Omit<React.CSSProperties, 'display' | 'width' | 'minWidth' | 'left' | 'right' | 'position'>);
|
|
161
|
+
onCellFooterStyles?: Omit<React.CSSProperties, 'display' | 'width' | 'minWidth' | 'left' | 'right' | 'position'> | ((cellValue: any, cell: Header<RecordType, unknown>) => Omit<React.CSSProperties, 'display' | 'width' | 'minWidth' | 'left' | 'right' | 'position'>);
|
|
162
|
+
};
|
|
163
|
+
export type Locale = TableLocale & {
|
|
164
|
+
ok_btn?: string;
|
|
165
|
+
cancel_btn?: string;
|
|
166
|
+
add_rows?: string;
|
|
167
|
+
add_rows_before?: string;
|
|
168
|
+
add_rows_after?: string;
|
|
169
|
+
add_1?: string;
|
|
170
|
+
add_10?: string;
|
|
171
|
+
add_50?: string;
|
|
172
|
+
add_100?: string;
|
|
173
|
+
add_children?: string;
|
|
174
|
+
delete_content?: string;
|
|
175
|
+
delete_rows?: string;
|
|
176
|
+
custom?: string;
|
|
177
|
+
filterTitle: string;
|
|
178
|
+
filterConfirm: string;
|
|
179
|
+
filterEmptyText: string;
|
|
180
|
+
filterCheckall: string;
|
|
181
|
+
filterSearchPlaceholder: string;
|
|
182
|
+
emptyText: string;
|
|
183
|
+
selectAll: string;
|
|
184
|
+
selectInvert: string;
|
|
185
|
+
selectNone: string;
|
|
186
|
+
selectionAll: string;
|
|
187
|
+
sortTitle: string;
|
|
188
|
+
expand: string;
|
|
189
|
+
collapse: string;
|
|
190
|
+
triggerDesc: string;
|
|
191
|
+
triggerAsc: string;
|
|
192
|
+
cancelSort: string;
|
|
193
|
+
};
|
|
194
|
+
export type ColumnsTable<RecordType = AnyObject> = ColumnTable<RecordType>[];
|
|
195
|
+
export type TableProps<RecordType = AnyObject> = {
|
|
196
|
+
theme?: {
|
|
197
|
+
theme?: 'dark' | 'light';
|
|
198
|
+
backgroundColor?: string;
|
|
199
|
+
color?: string;
|
|
200
|
+
};
|
|
201
|
+
title?: ReactNode | ((data: RecordType) => ReactNode);
|
|
202
|
+
fullScreenTitle?: ReactNode | (() => ReactNode);
|
|
203
|
+
editAble?: boolean;
|
|
204
|
+
rowKey?: string;
|
|
205
|
+
infiniteScroll?: boolean;
|
|
206
|
+
next?: () => void;
|
|
207
|
+
locale?: Locale;
|
|
208
|
+
groupAble?: boolean;
|
|
209
|
+
groupColumns?: string[];
|
|
210
|
+
groupSetting?: IGroupSetting;
|
|
211
|
+
onChooseColumns?: (props: IOnChooseColumns) => void;
|
|
212
|
+
pagination?: false | PaginationConfig;
|
|
213
|
+
showCustomTooltip?: boolean;
|
|
214
|
+
sortMultiple?: boolean;
|
|
215
|
+
dataSource: RecordType[];
|
|
216
|
+
columns: ColumnsTable<RecordType>;
|
|
217
|
+
height?: number;
|
|
218
|
+
minHeight?: number;
|
|
219
|
+
format?: IFormat;
|
|
220
|
+
t?: any;
|
|
221
|
+
lang?: string;
|
|
222
|
+
contextMenuItems?: ContextMenuItem[];
|
|
223
|
+
showDefaultContext?: boolean;
|
|
224
|
+
contextMenuHidden?: string[] | ((args?: Omit<ContextInfo<RecordType>, 'item' | 'event'>) => string[]);
|
|
225
|
+
contextMenuOpen?: (args: Omit<ContextInfo<RecordType>, 'item'>) => void;
|
|
226
|
+
contextMenuClick?: (args: ContextInfo<RecordType>) => void;
|
|
227
|
+
recordDoubleClick?: (args: RecordDoubleClickEventArgs<RecordType>) => void;
|
|
228
|
+
toolbarItems?: ToolbarItem[];
|
|
229
|
+
showColumnChoose?: boolean;
|
|
230
|
+
showAdvanceFilter?: boolean;
|
|
231
|
+
allowFiltering?: boolean;
|
|
232
|
+
onFilter?: (query: {
|
|
233
|
+
field: string;
|
|
234
|
+
key: string;
|
|
235
|
+
operator: IOperator;
|
|
236
|
+
predicate: 'and' | 'or';
|
|
237
|
+
value: any;
|
|
238
|
+
}[]) => void;
|
|
239
|
+
allowSortering?: boolean;
|
|
240
|
+
onSorter?: (args: Sorter[]) => void;
|
|
241
|
+
selectionSettings?: SelectionSettings;
|
|
242
|
+
rowSelection?: RowSelection<RecordType>;
|
|
243
|
+
rowSelected?: (args: {
|
|
244
|
+
type: string;
|
|
245
|
+
rowData: RecordType;
|
|
246
|
+
selected: RecordType | RecordType[];
|
|
247
|
+
}) => void;
|
|
248
|
+
dataSourceFilter?: SourceFilter[];
|
|
249
|
+
onFilterClick?: (column: ColumnTable<RecordType>, callback: (key: string, data: any) => void) => void;
|
|
250
|
+
loading?: boolean;
|
|
251
|
+
allowResizing?: boolean;
|
|
252
|
+
showToolbar?: boolean;
|
|
253
|
+
onDataChange?: (data: RecordType[]) => void;
|
|
254
|
+
defaultValue?: AnyObject | (() => AnyObject);
|
|
255
|
+
summary?: boolean;
|
|
256
|
+
showEmptyText?: boolean;
|
|
257
|
+
commandSettings?: CommandSettings;
|
|
258
|
+
rowClassName?: string | RowClassName<RecordType>;
|
|
259
|
+
onCellPaste?: ICellPasteModel<RecordType>;
|
|
260
|
+
onCellChange?: (args: CellChangeArgs<RecordType>, handleCallback: (rowData: any, index: any, value?: any) => void) => void;
|
|
261
|
+
onCellClick?: (args: ICellClick, callback?: any) => void;
|
|
262
|
+
rowEditable?: (rowData: RecordType) => boolean;
|
|
263
|
+
validate?: any;
|
|
264
|
+
onBlur?: (data: RecordType[]) => void;
|
|
265
|
+
onExpandClick?: (args: {
|
|
266
|
+
expandedKeys: string[];
|
|
267
|
+
key: string;
|
|
268
|
+
rowData: any;
|
|
269
|
+
}) => void;
|
|
270
|
+
wrapSettings?: IWrapSettings;
|
|
271
|
+
actionTemplate?: ReactNode | ReactElement | (() => ReactNode | ReactElement);
|
|
272
|
+
commandClick?: (args: CommandClick<RecordType>) => void;
|
|
273
|
+
expandable?: ExpandableConfig<RecordType>;
|
|
274
|
+
fullScreen?: boolean;
|
|
275
|
+
onRowStyles?: Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'> | ((data: RecordType, row: Row<RecordType>) => Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'>);
|
|
276
|
+
onRowHeaderStyles?: Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'> | (() => Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'>);
|
|
277
|
+
onRowFooterStyles?: Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'> | (() => Omit<React.CSSProperties, 'display' | 'transform' | 'gridTemplateColumns' | 'height' | 'minHeight'>);
|
|
278
|
+
};
|
|
279
|
+
export type ExpandableConfig<RecordType> = {
|
|
280
|
+
expandedRowKeys?: readonly Key[];
|
|
281
|
+
defaultExpandedRowKeys?: readonly Key[];
|
|
282
|
+
expandedRowRender?: ExpandedRowRender<RecordType>;
|
|
283
|
+
columnTitle?: React.ReactNode;
|
|
284
|
+
expandRowByClick?: boolean;
|
|
285
|
+
expandIcon?: RenderExpandIcon<RecordType>;
|
|
286
|
+
onExpand?: (expanded: boolean, record: RecordType) => void;
|
|
287
|
+
onExpandedRowsChange?: (expandedKeys: readonly Key[]) => void;
|
|
288
|
+
defaultExpandAllRows?: boolean;
|
|
289
|
+
indentSize?: number;
|
|
290
|
+
expandIconColumnIndex?: number;
|
|
291
|
+
showExpandColumn?: boolean;
|
|
292
|
+
expandedRowClassName?: string | RowClassName<RecordType>;
|
|
293
|
+
childrenColumnName?: string;
|
|
294
|
+
rowExpandable?: (record: RecordType) => boolean;
|
|
295
|
+
columnWidth?: number | string;
|
|
296
|
+
fixed?: FixedType;
|
|
297
|
+
};
|
|
298
|
+
export type RenderExpandIcon<RecordType> = (props: RenderExpandIconProps<RecordType>) => React.ReactNode;
|
|
299
|
+
export interface RenderExpandIconProps<RecordType> {
|
|
300
|
+
prefixCls: string;
|
|
301
|
+
expanded: boolean;
|
|
302
|
+
record: RecordType;
|
|
303
|
+
expandable: boolean;
|
|
304
|
+
onExpand: TriggerEventHandler<RecordType>;
|
|
305
|
+
}
|
|
306
|
+
export type TriggerEventHandler<RecordType> = (record: RecordType, event: React.MouseEvent<HTMLElement>) => void;
|
|
307
|
+
export type RowClassName<RecordType> = (record: RecordType, index: number, indent: number) => string;
|
|
308
|
+
export type ExpandedRowRender<ValueType> = (record: ValueType, index: number, indent: number, expanded: boolean) => React.ReactNode;
|
|
309
|
+
export type CommandClick<T> = {
|
|
310
|
+
id: string;
|
|
311
|
+
rowId: string;
|
|
312
|
+
rowData: any;
|
|
313
|
+
index: number;
|
|
314
|
+
rows: T[];
|
|
315
|
+
};
|
|
316
|
+
export type IEditSelectSettings = {
|
|
317
|
+
fieldKey?: string;
|
|
318
|
+
options: any[] | ((rowData: any, field: string) => any[]);
|
|
319
|
+
/** get value form other field **/
|
|
320
|
+
fieldValue?: string;
|
|
321
|
+
/** get label form other field **/
|
|
322
|
+
fieldLabel?: string;
|
|
323
|
+
/** cho phép nhập giá trị - onBlur: giá trị search được set thành value **/
|
|
324
|
+
searchTextAsValue?: boolean;
|
|
325
|
+
/**
|
|
326
|
+
* @deprecated Please use `allowSorter` instead.
|
|
327
|
+
* @since 1.7.25
|
|
328
|
+
*/
|
|
329
|
+
inputKey?: string;
|
|
330
|
+
filterKey?: string[];
|
|
331
|
+
selectMode?: SelectMode;
|
|
332
|
+
getPasteValue?: (value: any) => Record<string, any> | null;
|
|
333
|
+
validateOption?: (rowData: any, field: string) => any[];
|
|
334
|
+
defaultOptions?: any[];
|
|
335
|
+
defaultValue?: (value: any, rowData: any) => {
|
|
336
|
+
value: any;
|
|
337
|
+
label: string;
|
|
338
|
+
[key: string]: string;
|
|
339
|
+
} | null;
|
|
340
|
+
formatOptionLabel?: (option: any) => ReactNode | ReactElement;
|
|
341
|
+
loadOptions?: (search: string, callback: (newOptions: any[]) => void, args?: LoadOptionsArgs) => void;
|
|
342
|
+
isMulti?: boolean;
|
|
343
|
+
closeMenuOnSelect?: boolean;
|
|
344
|
+
menuWidth?: number;
|
|
345
|
+
menuHeight?: number;
|
|
346
|
+
columns?: ColumnSelectTable[];
|
|
347
|
+
toolbarItems?: ToolbarItem[];
|
|
348
|
+
toolbarClick?: (props: ToolbarClick) => void;
|
|
349
|
+
toolbarHeight?: number;
|
|
350
|
+
hideSelectedOptions?: boolean;
|
|
351
|
+
showItems?: number;
|
|
352
|
+
isLengthSelected?: boolean;
|
|
353
|
+
fieldNames?: FieldNames;
|
|
354
|
+
filterOption?: boolean | FilterFunc<any>;
|
|
355
|
+
};
|
|
356
|
+
export type IEditFromSettings = {
|
|
357
|
+
fieldKey: string;
|
|
358
|
+
formOpen?: (props: IFormOpen) => void;
|
|
359
|
+
formClose?: (props: IFormOpen) => void;
|
|
360
|
+
formatLabel?: (value: any) => string;
|
|
361
|
+
menuWidth?: number;
|
|
362
|
+
menuHeight?: number;
|
|
363
|
+
labelWith?: number;
|
|
364
|
+
items: any[];
|
|
365
|
+
layout?: {
|
|
366
|
+
xl?: IGrid;
|
|
367
|
+
lg?: IGrid;
|
|
368
|
+
md?: IGrid;
|
|
369
|
+
sm?: IGrid;
|
|
370
|
+
xs?: IGrid;
|
|
371
|
+
};
|
|
372
|
+
defaultValues?: Record<string, any>;
|
|
373
|
+
schema?: any;
|
|
374
|
+
};
|
|
375
|
+
export type IFormOpen = {
|
|
376
|
+
value?: any;
|
|
377
|
+
setValue?: any;
|
|
378
|
+
getValues?: any;
|
|
379
|
+
reset?: any;
|
|
380
|
+
rowData?: any;
|
|
381
|
+
};
|
|
382
|
+
export type FilterFunc<OptionType> = (inputValue: string, option?: OptionType) => boolean;
|
|
383
|
+
export type ToolbarClick = {
|
|
384
|
+
item: any;
|
|
385
|
+
column: any;
|
|
386
|
+
};
|
|
387
|
+
export type ColumnSelectTable = {
|
|
388
|
+
field: string;
|
|
389
|
+
dataIndex?: string;
|
|
390
|
+
type?: IColumnType;
|
|
391
|
+
headerText?: string;
|
|
392
|
+
fixedType?: 'left' | 'right' | undefined;
|
|
393
|
+
width?: number | undefined;
|
|
394
|
+
minWidth?: number;
|
|
395
|
+
maxWidth?: number;
|
|
396
|
+
visible?: boolean;
|
|
397
|
+
textAlign?: ITextAlign;
|
|
398
|
+
headerTextAlign?: ITextAlign;
|
|
399
|
+
template?: (props: ITemplateColumn) => ReactNode | ReactElement;
|
|
400
|
+
headerTemplate?: any;
|
|
401
|
+
ellipsis?: boolean | undefined;
|
|
402
|
+
format?: IFormat;
|
|
403
|
+
tooltipDescription?: string | ((rowData: any) => string | ReactNode);
|
|
404
|
+
showTooltip?: boolean;
|
|
405
|
+
showTooltipHeader?: boolean;
|
|
406
|
+
};
|
|
407
|
+
export type ITemplateColumn = {
|
|
408
|
+
value: any;
|
|
409
|
+
column: any;
|
|
410
|
+
rowData: any;
|
|
411
|
+
field: number | string;
|
|
412
|
+
index: number;
|
|
413
|
+
};
|
|
414
|
+
export type RawValueType = string | number;
|
|
415
|
+
export type ToolbarItem = {
|
|
416
|
+
position?: 'Top' | 'Bottom';
|
|
417
|
+
align?: ITextAlign;
|
|
418
|
+
onClick?: (args: any) => void;
|
|
419
|
+
key?: React.Key;
|
|
420
|
+
value?: RawValueType;
|
|
421
|
+
label?: React.ReactNode;
|
|
422
|
+
template?: React.ReactNode | React.ReactElement | (() => React.ReactNode | React.ReactElement);
|
|
423
|
+
title?: React.ReactNode;
|
|
424
|
+
disabled?: boolean;
|
|
425
|
+
[key: string]: any;
|
|
426
|
+
};
|
|
427
|
+
export type LoadOptionsArgs = {
|
|
428
|
+
rowData?: any;
|
|
429
|
+
};
|
|
430
|
+
export type GroupTemplate = {
|
|
431
|
+
rowData: any;
|
|
432
|
+
value: any;
|
|
433
|
+
column: ColumnTable;
|
|
434
|
+
};
|
|
435
|
+
export type IGroupSetting = {
|
|
436
|
+
client?: boolean;
|
|
437
|
+
onGroup?: (props: IOnGroup) => void;
|
|
438
|
+
groupColumnSpan?: number;
|
|
439
|
+
hiddenColumnGroup?: boolean;
|
|
440
|
+
showHeaderColumn?: boolean;
|
|
441
|
+
showGroupIcon?: boolean;
|
|
442
|
+
unClearableLevel?: 1 | 2 | 3 | undefined;
|
|
443
|
+
sumGroup?: boolean;
|
|
444
|
+
groupTemplate?: React.ReactNode | React.ReactElement | ((args: GroupTemplate) => React.ReactNode | React.ReactElement);
|
|
445
|
+
};
|
|
446
|
+
type IOnGroup = {
|
|
447
|
+
columnGrouped: string[];
|
|
448
|
+
columns: ColumnsTable;
|
|
449
|
+
flattenColumns: ColumnsTable;
|
|
450
|
+
};
|
|
451
|
+
export type IOnChooseColumns = {
|
|
452
|
+
columns: ColumnsTable;
|
|
453
|
+
showColumns: ColumnsTable;
|
|
454
|
+
flattenColumns: ColumnsTable;
|
|
455
|
+
};
|
|
456
|
+
export type ContextMenuItem = ItemType;
|
|
457
|
+
export type CommandSettings = {
|
|
458
|
+
client?: boolean;
|
|
459
|
+
confirmDialog?: boolean;
|
|
460
|
+
};
|
|
461
|
+
export interface ICellPasteModel<RecordType = AnyObject> {
|
|
462
|
+
onPasted?: (args: IOnPastedProps, handleCallback: (callbackData: any[]) => void) => void;
|
|
463
|
+
dataChange?: (data: RecordType[]) => void;
|
|
464
|
+
getCallbackData?: (props: any) => void;
|
|
465
|
+
maxRowsPaste?: number;
|
|
466
|
+
}
|
|
467
|
+
export type IOnPastedProps = {
|
|
468
|
+
data: any[];
|
|
469
|
+
copyRows: any[];
|
|
470
|
+
pastedColumns: string[];
|
|
471
|
+
pasteData: any[];
|
|
472
|
+
type: 'onPaste' | 'onChange' | 'onCellPaste';
|
|
473
|
+
};
|
|
474
|
+
export type ICellClick = {
|
|
475
|
+
index: number;
|
|
476
|
+
indexCol?: number;
|
|
477
|
+
rowId: string | number;
|
|
478
|
+
type: 'Editing' | 'Default';
|
|
479
|
+
field: string;
|
|
480
|
+
cellValue: any;
|
|
481
|
+
rowData: any;
|
|
482
|
+
};
|
|
483
|
+
export type CellChangeArgs<T> = {
|
|
484
|
+
type: 'onPaste' | 'onChange' | 'onCellPaste';
|
|
485
|
+
value: any;
|
|
486
|
+
option: AnyObject;
|
|
487
|
+
rowData: T;
|
|
488
|
+
rowsData: T[];
|
|
489
|
+
indexRow: number;
|
|
490
|
+
rowId?: string;
|
|
491
|
+
field: string | undefined;
|
|
492
|
+
indexCol: any;
|
|
493
|
+
sumValue?: any[];
|
|
494
|
+
};
|
|
495
|
+
export type IWrapMode = 'Header' | 'Both' | 'Content';
|
|
496
|
+
export type IWrapSettings = {
|
|
497
|
+
wrapMode?: IWrapMode;
|
|
498
|
+
};
|
|
499
|
+
export type SelectionSettings<T = AnyObject> = {
|
|
500
|
+
mode?: 'checkbox' | 'radio';
|
|
501
|
+
type?: 'single' | 'multiple';
|
|
502
|
+
checkboxOnly?: boolean;
|
|
503
|
+
checkStrictly?: boolean;
|
|
504
|
+
columnWidth?: number;
|
|
505
|
+
hideSelectAll?: boolean;
|
|
506
|
+
selectedRowKeys?: Key[];
|
|
507
|
+
defaultSelectedRowKeys?: Key[];
|
|
508
|
+
getCheckboxProps?: (record: T) => Partial<Omit<CheckboxProps, 'checked' | 'defaultChecked'>>;
|
|
509
|
+
};
|
|
510
|
+
export type SelectionSelectFn<T = AnyObject> = (record: T, selected: boolean, selectedRows: T[], nativeEvent: Event) => void;
|
|
511
|
+
export type RowSelection<T> = {
|
|
512
|
+
preserveSelectedRowKeys?: boolean;
|
|
513
|
+
selectedRowKeys?: Key[];
|
|
514
|
+
defaultSelectedRowKeys?: Key[];
|
|
515
|
+
onChange?: (selectedRowKeys: Key[], selectedRows: T[], info: {
|
|
516
|
+
type: RowSelectMethod;
|
|
517
|
+
}, selectedRow: T) => void;
|
|
518
|
+
getCheckboxProps?: (record: T) => Partial<Omit<CheckboxProps, 'checked' | 'defaultChecked'>>;
|
|
519
|
+
onSelect?: SelectionSelectFn<T>;
|
|
520
|
+
/** @deprecated This function is deprecated and should use `onChange` instead */
|
|
521
|
+
onSelectMultiple?: (selected: boolean, selectedRows: T[], changeRows: T[]) => void;
|
|
522
|
+
/** @deprecated This function is deprecated and should use `onChange` instead */
|
|
523
|
+
onSelectAll?: (selected: boolean, selectedRows: T[], changeRows: T[]) => void;
|
|
524
|
+
/** @deprecated This function is deprecated and should use `onChange` instead */
|
|
525
|
+
onSelectInvert?: (selectedRowKeys: Key[]) => void;
|
|
526
|
+
/** @deprecated This function is deprecated and should use `onChange` instead */
|
|
527
|
+
onSelectNone?: () => void;
|
|
528
|
+
fixed?: FixedType;
|
|
529
|
+
columnTitle?: React.ReactNode | ((checkboxNode: React.ReactNode) => React.ReactNode);
|
|
530
|
+
checkStrictly?: boolean;
|
|
531
|
+
checkboxOnly?: boolean;
|
|
532
|
+
arrowKey?: boolean;
|
|
533
|
+
};
|
|
534
|
+
export type RecordDoubleClickEventArgs<RecordType> = {
|
|
535
|
+
rowData: RecordType;
|
|
536
|
+
rowIndex: number | undefined;
|
|
537
|
+
e: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>;
|
|
538
|
+
};
|
|
539
|
+
export type SourceFilter = {
|
|
540
|
+
key: string;
|
|
541
|
+
data: any[];
|
|
542
|
+
loadOptions?: (search: string, callback: (newOptions: any[]) => void) => void;
|
|
543
|
+
};
|
|
544
|
+
export type ContextInfo<RecordType> = {
|
|
545
|
+
rowInfo: {
|
|
546
|
+
rowData: RecordType | null;
|
|
547
|
+
};
|
|
548
|
+
event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>;
|
|
549
|
+
item: ItemType;
|
|
550
|
+
};
|
|
551
|
+
export type Presets = Required<ColorPickerProps>['presets'][number];
|
|
552
|
+
export type RangeState = {
|
|
553
|
+
rowRange: string[];
|
|
554
|
+
colRange: string[];
|
|
555
|
+
startRowIndex: number | undefined;
|
|
556
|
+
endRowIndex: number | undefined;
|
|
557
|
+
startColIndex: number | undefined;
|
|
558
|
+
endColIndex: number | undefined;
|
|
559
|
+
rowIds: string[];
|
|
560
|
+
colIds: string[];
|
|
561
|
+
};
|
|
562
|
+
export type Sorter = {
|
|
563
|
+
columnKey: string;
|
|
564
|
+
field: string;
|
|
565
|
+
order: 'ascend' | 'descend';
|
|
566
|
+
};
|
|
567
|
+
export {};
|