es-grid-template 1.7.22 → 1.7.24
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/GridStyle.js +1 -1
- package/es/grid-component/InternalTable.js +5 -1
- package/es/grid-component/TableGrid.js +2 -2
- package/es/index.d.ts +1 -0
- package/es/index.js +3 -1
- package/es/table-component/ColumnsChoose.d.ts +10 -0
- package/es/table-component/ColumnsChoose.js +557 -0
- package/es/table-component/ContextMenu.d.ts +20 -0
- package/es/table-component/ContextMenu.js +75 -0
- package/es/table-component/InternalTable.d.ts +9 -0
- package/es/table-component/InternalTable.js +295 -0
- package/es/table-component/TableContainer.d.ts +22 -0
- package/es/table-component/TableContainer.js +130 -0
- package/es/table-component/TableContainerEdit.d.ts +28 -0
- package/es/table-component/TableContainerEdit.js +1211 -0
- package/es/table-component/body/EditableCell.d.ts +16 -0
- package/es/table-component/body/EditableCell.js +1036 -0
- package/es/table-component/body/TableBody.d.ts +19 -0
- package/es/table-component/body/TableBody.js +64 -0
- package/es/table-component/body/TableBodyCell.d.ts +10 -0
- package/es/table-component/body/TableBodyCell.js +139 -0
- package/es/table-component/body/TableBodyCellEdit.d.ts +15 -0
- package/es/table-component/body/TableBodyCellEdit.js +814 -0
- package/es/table-component/body/TableBodyRow.d.ts +21 -0
- package/es/table-component/body/TableBodyRow.js +146 -0
- package/es/table-component/components/ControlCheckbox.d.ts +13 -0
- package/es/table-component/components/ControlCheckbox.js +87 -0
- package/es/table-component/components/EditForm/EditForm.d.ts +27 -0
- package/es/table-component/components/EditForm/EditForm.js +395 -0
- package/es/table-component/components/EditForm/index.d.ts +1 -0
- package/es/table-component/components/EditForm/index.js +1 -0
- package/es/table-component/components/InputControl/InputControl.d.ts +27 -0
- package/es/table-component/components/InputControl/InputControl.js +121 -0
- package/es/table-component/components/InputControl/index.d.ts +1 -0
- package/es/table-component/components/InputControl/index.js +1 -0
- package/es/table-component/components/async-select/index.d.ts +11 -0
- package/es/table-component/components/async-select/index.js +41 -0
- package/es/table-component/components/async-table-select/index.d.ts +11 -0
- package/es/table-component/components/async-table-select/index.js +43 -0
- package/es/table-component/components/checkbox-control/index.d.ts +13 -0
- package/es/table-component/components/checkbox-control/index.js +40 -0
- package/es/table-component/components/checkbox-filter/CheckboxFilter.d.ts +18 -0
- package/es/table-component/components/checkbox-filter/CheckboxFilter.js +240 -0
- package/es/table-component/components/checkbox-filter/FilterSearch.d.ts +12 -0
- package/es/table-component/components/checkbox-filter/FilterSearch.js +36 -0
- package/es/table-component/components/command/Command.d.ts +9 -0
- package/es/table-component/components/command/Command.js +28 -0
- package/es/table-component/components/number/index.d.ts +10 -0
- package/es/table-component/components/number/index.js +42 -0
- package/es/table-component/components/number-range/index.d.ts +11 -0
- package/es/table-component/components/number-range/index.js +66 -0
- package/es/table-component/features/operator.d.ts +24 -0
- package/es/table-component/features/operator.js +62 -0
- package/es/table-component/footer/TableFooter.d.ts +13 -0
- package/es/table-component/footer/TableFooter.js +33 -0
- package/es/table-component/footer/TableFooterCell.d.ts +10 -0
- package/es/table-component/footer/TableFooterCell.js +24 -0
- package/es/table-component/footer/TableFooterRow.d.ts +14 -0
- package/es/table-component/footer/TableFooterRow.js +71 -0
- package/es/table-component/header/TableHead.d.ts +14 -0
- package/es/table-component/header/TableHead.js +60 -0
- package/es/table-component/header/TableHeadCell.d.ts +14 -0
- package/es/table-component/header/TableHeadCell.js +324 -0
- package/es/table-component/header/TableHeadRow.d.ts +16 -0
- package/es/table-component/header/TableHeadRow.js +86 -0
- package/es/table-component/header/renderFilter.d.ts +20 -0
- package/es/table-component/header/renderFilter.js +281 -0
- package/es/table-component/hook/constant.d.ts +73 -0
- package/es/table-component/hook/constant.js +240 -0
- package/es/table-component/hook/useColumns.d.ts +11 -0
- package/es/table-component/hook/useColumns.js +209 -0
- package/es/table-component/hook/useFilterOperator.d.ts +7 -0
- package/es/table-component/hook/useFilterOperator.js +33 -0
- package/es/table-component/hook/utils.d.ts +121 -0
- package/es/table-component/hook/utils.js +1727 -0
- package/es/table-component/index.d.ts +5 -0
- package/es/table-component/index.js +2 -0
- package/es/table-component/style.scss +1083 -0
- package/es/table-component/table/Grid.d.ts +23 -0
- package/es/table-component/table/Grid.js +310 -0
- package/es/table-component/table/GridEdit.d.ts +23 -0
- package/es/table-component/table/GridEdit.js +282 -0
- package/es/table-component/type.d.ts +482 -0
- package/es/table-component/type.js +1 -0
- package/es/table-component/useContext.d.ts +119 -0
- package/es/table-component/useContext.js +61 -0
- package/lib/grid-component/GridStyle.js +1 -1
- package/lib/grid-component/InternalTable.js +5 -1
- package/lib/grid-component/TableGrid.js +2 -2
- package/lib/index.d.ts +1 -0
- package/lib/index.js +8 -1
- package/lib/table-component/ColumnsChoose.d.ts +10 -0
- package/lib/table-component/ColumnsChoose.js +568 -0
- package/lib/table-component/ContextMenu.d.ts +20 -0
- package/lib/table-component/ContextMenu.js +85 -0
- package/lib/table-component/InternalTable.d.ts +9 -0
- package/lib/table-component/InternalTable.js +299 -0
- package/lib/table-component/TableContainer.d.ts +22 -0
- package/lib/table-component/TableContainer.js +137 -0
- package/lib/table-component/TableContainerEdit.d.ts +28 -0
- package/lib/table-component/TableContainerEdit.js +1220 -0
- package/lib/table-component/body/EditableCell.d.ts +16 -0
- package/lib/table-component/body/EditableCell.js +1038 -0
- package/lib/table-component/body/TableBody.d.ts +19 -0
- package/lib/table-component/body/TableBody.js +72 -0
- package/lib/table-component/body/TableBodyCell.d.ts +10 -0
- package/lib/table-component/body/TableBodyCell.js +148 -0
- package/lib/table-component/body/TableBodyCellEdit.d.ts +15 -0
- package/lib/table-component/body/TableBodyCellEdit.js +821 -0
- package/lib/table-component/body/TableBodyRow.d.ts +21 -0
- package/lib/table-component/body/TableBodyRow.js +153 -0
- package/lib/table-component/components/ControlCheckbox.d.ts +13 -0
- package/lib/table-component/components/ControlCheckbox.js +95 -0
- package/lib/table-component/components/EditForm/EditForm.d.ts +27 -0
- package/lib/table-component/components/EditForm/EditForm.js +406 -0
- package/lib/table-component/components/EditForm/index.d.ts +1 -0
- package/lib/table-component/components/EditForm/index.js +16 -0
- package/lib/table-component/components/InputControl/InputControl.d.ts +27 -0
- package/lib/table-component/components/InputControl/InputControl.js +131 -0
- package/lib/table-component/components/InputControl/index.d.ts +1 -0
- package/lib/table-component/components/InputControl/index.js +16 -0
- package/lib/table-component/components/async-select/index.d.ts +11 -0
- package/lib/table-component/components/async-select/index.js +49 -0
- package/lib/table-component/components/async-table-select/index.d.ts +11 -0
- package/lib/table-component/components/async-table-select/index.js +51 -0
- package/lib/table-component/components/checkbox-control/index.d.ts +13 -0
- package/lib/table-component/components/checkbox-control/index.js +48 -0
- package/lib/table-component/components/checkbox-filter/CheckboxFilter.d.ts +18 -0
- package/lib/table-component/components/checkbox-filter/CheckboxFilter.js +249 -0
- package/lib/table-component/components/checkbox-filter/FilterSearch.d.ts +12 -0
- package/lib/table-component/components/checkbox-filter/FilterSearch.js +44 -0
- package/lib/table-component/components/command/Command.d.ts +9 -0
- package/lib/table-component/components/command/Command.js +37 -0
- package/lib/table-component/components/number/index.d.ts +10 -0
- package/lib/table-component/components/number/index.js +50 -0
- package/lib/table-component/components/number-range/index.d.ts +11 -0
- package/lib/table-component/components/number-range/index.js +74 -0
- package/lib/table-component/features/operator.d.ts +24 -0
- package/lib/table-component/features/operator.js +67 -0
- package/lib/table-component/footer/TableFooter.d.ts +13 -0
- package/lib/table-component/footer/TableFooter.js +42 -0
- package/lib/table-component/footer/TableFooterCell.d.ts +10 -0
- package/lib/table-component/footer/TableFooterCell.js +32 -0
- package/lib/table-component/footer/TableFooterRow.d.ts +14 -0
- package/lib/table-component/footer/TableFooterRow.js +79 -0
- package/lib/table-component/header/TableHead.d.ts +14 -0
- package/lib/table-component/header/TableHead.js +69 -0
- package/lib/table-component/header/TableHeadCell.d.ts +14 -0
- package/lib/table-component/header/TableHeadCell.js +333 -0
- package/lib/table-component/header/TableHeadRow.d.ts +16 -0
- package/lib/table-component/header/TableHeadRow.js +94 -0
- package/lib/table-component/header/renderFilter.d.ts +20 -0
- package/lib/table-component/header/renderFilter.js +291 -0
- package/lib/table-component/hook/constant.d.ts +73 -0
- package/lib/table-component/hook/constant.js +247 -0
- package/lib/table-component/hook/useColumns.d.ts +11 -0
- package/lib/table-component/hook/useColumns.js +220 -0
- package/lib/table-component/hook/useFilterOperator.d.ts +7 -0
- package/lib/table-component/hook/useFilterOperator.js +40 -0
- package/lib/table-component/hook/utils.d.ts +121 -0
- package/lib/table-component/hook/utils.js +1817 -0
- package/lib/table-component/index.d.ts +5 -0
- package/lib/table-component/index.js +9 -0
- package/lib/table-component/style.scss +1083 -0
- package/lib/table-component/table/Grid.d.ts +23 -0
- package/lib/table-component/table/Grid.js +313 -0
- package/lib/table-component/table/GridEdit.d.ts +23 -0
- package/lib/table-component/table/GridEdit.js +284 -0
- package/lib/table-component/type.d.ts +482 -0
- package/lib/table-component/type.js +5 -0
- package/lib/table-component/useContext.d.ts +119 -0
- package/lib/table-component/useContext.js +67 -0
- package/package.json +3 -1
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
/// <reference types="date-fns" />
|
|
2
|
+
import type { CheckboxProps, TablePaginationConfig } from 'rc-master-ui';
|
|
3
|
+
import type { ItemType } from 'rc-master-ui/es/menu/interface';
|
|
4
|
+
import type { OnChangeFn } from '@tanstack/react-table';
|
|
5
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
6
|
+
import type { IOperator } from './hook/constant';
|
|
7
|
+
import type { ColorPickerProps } from 'antd';
|
|
8
|
+
export type ExtendedColumnFilter = {
|
|
9
|
+
id: string;
|
|
10
|
+
value: string;
|
|
11
|
+
operator?: FilterOperator;
|
|
12
|
+
};
|
|
13
|
+
export type OpetorState = ColumnOperator[];
|
|
14
|
+
export interface OpetorTableState {
|
|
15
|
+
operator: OpetorState;
|
|
16
|
+
}
|
|
17
|
+
export interface ColumnOperator {
|
|
18
|
+
id: string;
|
|
19
|
+
operator: string;
|
|
20
|
+
}
|
|
21
|
+
export interface DensityOptions {
|
|
22
|
+
enableOperator?: boolean;
|
|
23
|
+
onOperatorChange?: OnChangeFn<OpetorState>;
|
|
24
|
+
}
|
|
25
|
+
export type Key = React.Key;
|
|
26
|
+
export type PaginationConfig = TablePaginationConfig & {
|
|
27
|
+
currentPage?: number;
|
|
28
|
+
};
|
|
29
|
+
export type AnyObject = Record<PropertyKey, any>;
|
|
30
|
+
export type IFormat = {
|
|
31
|
+
thousandSeparator?: string;
|
|
32
|
+
decimalSeparator?: string;
|
|
33
|
+
decimalScale?: number | undefined;
|
|
34
|
+
allowNegative?: boolean;
|
|
35
|
+
prefix?: string | undefined;
|
|
36
|
+
suffix?: string | undefined;
|
|
37
|
+
fixedDecimalScale?: boolean;
|
|
38
|
+
dateFormat?: string;
|
|
39
|
+
datetimeFormat?: string;
|
|
40
|
+
timeFormat?: string;
|
|
41
|
+
weekFormat?: string;
|
|
42
|
+
monthFormat?: string;
|
|
43
|
+
yearFormat?: string;
|
|
44
|
+
};
|
|
45
|
+
export type RowSelectMethod = 'all' | 'none' | 'invert' | 'single' | 'multiple';
|
|
46
|
+
export type EditType = 'text' | 'numeric' | 'asyncSelect' | 'date' | 'datetime' | 'time' | 'week' | 'month' | 'quarter' | 'year' | 'select' | 'checkbox' | 'currency' | 'image' | 'selectTable' | 'customSelect' | 'form' | 'color' | 'treeSelect' | 'file';
|
|
47
|
+
export type ITextAlign = 'center' | 'left' | 'right';
|
|
48
|
+
export type TypeFilter = 'Text' | 'Date' | 'Time' | 'Datetime' | 'DateRange' | 'Month' | 'Quarter' | 'Year' | 'Week' | 'Number' | 'NumberRange' | 'Dropdown' | 'DropTree' | 'Checkbox' | 'CheckboxTree' | 'CheckboxDropdown';
|
|
49
|
+
export type IColumnType = 'number' | 'time' | 'date' | 'week' | 'month' | 'file' | 'quarter' | 'year' | 'datetime' | 'string' | 'boolean' | 'checkbox' | 'color' | null | undefined;
|
|
50
|
+
export type FilterOperator = 'equal' | 'notEqual' | 'greaterThan' | 'greaterThanOrEqual' | 'lessThan' | 'lessThanOrEqual' | 'startsWith' | 'endsWith' | 'contains';
|
|
51
|
+
export type FixedType = 'left' | 'right' | boolean;
|
|
52
|
+
export type SelectMode = 'checkbox' | 'radio' | undefined;
|
|
53
|
+
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;
|
|
54
|
+
export interface FieldNames {
|
|
55
|
+
value?: string;
|
|
56
|
+
label?: string;
|
|
57
|
+
groupLabel?: string;
|
|
58
|
+
options?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface CommandItem {
|
|
61
|
+
id: string;
|
|
62
|
+
type?: string;
|
|
63
|
+
visible?: boolean | ((record: any) => boolean);
|
|
64
|
+
title: string;
|
|
65
|
+
color?: 'blue' | 'purple' | 'cyan' | 'green' | 'magenta' | 'pink' | 'red' | 'orange' | 'yellow' | 'volcano' | 'geekblue' | 'lime' | 'gold';
|
|
66
|
+
tooltip?: string;
|
|
67
|
+
icon?: ReactNode | ReactElement | (() => ReactNode | ReactElement);
|
|
68
|
+
template?: ReactNode | ReactElement | ((record: any) => ReactNode | ReactElement);
|
|
69
|
+
client?: boolean;
|
|
70
|
+
confirmDialog?: boolean;
|
|
71
|
+
}
|
|
72
|
+
export type ColumnTemplate<RecordType> = {
|
|
73
|
+
value: any;
|
|
74
|
+
rowData: RecordType;
|
|
75
|
+
index: number;
|
|
76
|
+
field: string;
|
|
77
|
+
};
|
|
78
|
+
export type ColumnTable<RecordType = AnyObject> = {
|
|
79
|
+
field?: string;
|
|
80
|
+
width?: number;
|
|
81
|
+
maxWidth?: number;
|
|
82
|
+
minWidth?: number;
|
|
83
|
+
align?: ITextAlign;
|
|
84
|
+
type?: IColumnType;
|
|
85
|
+
haveSum?: boolean;
|
|
86
|
+
isSummary?: boolean;
|
|
87
|
+
summaryTemplate?: (data: number, key: string) => ReactElement | ReactNode;
|
|
88
|
+
format?: IFormat | ((rowData: any) => IFormat);
|
|
89
|
+
allowFiltering?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* @deprecated Please use `allowSorter` instead.
|
|
92
|
+
* @since 1.0.0
|
|
93
|
+
*/
|
|
94
|
+
sorter?: boolean;
|
|
95
|
+
allowSorter?: boolean;
|
|
96
|
+
operator?: FilterOperator;
|
|
97
|
+
hideOperator?: boolean;
|
|
98
|
+
placeholder?: string;
|
|
99
|
+
showInColumnChoose?: boolean;
|
|
100
|
+
typeFilter?: TypeFilter;
|
|
101
|
+
source?: any[];
|
|
102
|
+
showFilterSearch?: boolean;
|
|
103
|
+
headerText?: string;
|
|
104
|
+
visible?: boolean;
|
|
105
|
+
headerTooltip?: boolean | string | (() => ReactNode | ReactElement);
|
|
106
|
+
columnGroupText?: string;
|
|
107
|
+
textAlign?: ITextAlign;
|
|
108
|
+
headerTextAlign?: ITextAlign;
|
|
109
|
+
template?: ReactNode | ReactElement | ((args: ColumnTemplate<RecordType>) => ReactNode | ReactElement);
|
|
110
|
+
showTooltip?: boolean;
|
|
111
|
+
tooltipDescription?: ReactNode | ReactElement | ((value: any, record: RecordType, index: number) => ReactNode | ReactElement);
|
|
112
|
+
headerTemplate?: React.ReactNode | React.ReactElement | ((column: ColumnTable<RecordType>) => React.ReactNode | React.ReactElement);
|
|
113
|
+
commandItems?: CommandItem[];
|
|
114
|
+
children?: ColumnTable<RecordType>[];
|
|
115
|
+
editType?: EditType | ((rowData?: RecordType) => EditType);
|
|
116
|
+
disable?: boolean | ((rowData: any) => boolean);
|
|
117
|
+
editEnable?: boolean | ((rowData: any) => boolean);
|
|
118
|
+
isClearable?: boolean;
|
|
119
|
+
maxDate?: any;
|
|
120
|
+
minDate?: any;
|
|
121
|
+
maxTime?: any;
|
|
122
|
+
minTime?: any;
|
|
123
|
+
max?: number;
|
|
124
|
+
min?: number;
|
|
125
|
+
editSelectSettings?: IEditSelectSettings;
|
|
126
|
+
editFromSettings?: IEditFromSettings;
|
|
127
|
+
/**
|
|
128
|
+
* @deprecated Please use `fixed` instead.
|
|
129
|
+
* @since 1.6.5
|
|
130
|
+
*/
|
|
131
|
+
fixedType?: FixedType;
|
|
132
|
+
fixed?: FixedType;
|
|
133
|
+
headerTextWrap?: boolean;
|
|
134
|
+
ellipsis?: boolean;
|
|
135
|
+
allowResizing?: boolean;
|
|
136
|
+
};
|
|
137
|
+
export type ColumnsTable<RecordType = AnyObject> = ColumnTable<RecordType>[];
|
|
138
|
+
export type TableProps<RecordType = AnyObject> = {
|
|
139
|
+
editAble?: boolean;
|
|
140
|
+
infiniteScroll?: boolean;
|
|
141
|
+
next?: () => void;
|
|
142
|
+
locale?: Locale;
|
|
143
|
+
groupAble?: boolean;
|
|
144
|
+
groupColumns?: string[];
|
|
145
|
+
groupSetting?: IGroupSetting;
|
|
146
|
+
onChooseColumns?: (props: IOnChooseColumns) => void;
|
|
147
|
+
pagination?: false | PaginationConfig;
|
|
148
|
+
showCustomTooltip?: boolean;
|
|
149
|
+
sortMultiple?: boolean;
|
|
150
|
+
dataSource: RecordType[];
|
|
151
|
+
columns: ColumnsTable<RecordType>;
|
|
152
|
+
height?: number;
|
|
153
|
+
format?: IFormat;
|
|
154
|
+
t?: any;
|
|
155
|
+
lang?: string;
|
|
156
|
+
contextMenuItems?: ContextMenuItem[];
|
|
157
|
+
showDefaultContext?: boolean;
|
|
158
|
+
contextMenuHidden?: string[] | ((args?: Omit<ContextInfo<RecordType>, 'item' | 'event'>) => string[]);
|
|
159
|
+
contextMenuOpen?: (args: Omit<ContextInfo<RecordType>, 'item'>) => void;
|
|
160
|
+
contextMenuClick?: (args: ContextInfo<RecordType>) => void;
|
|
161
|
+
recordDoubleClick?: (args: RecordDoubleClickEventArgs<RecordType>) => void;
|
|
162
|
+
toolbarItems?: ToolbarItem[];
|
|
163
|
+
showColumnChoose?: boolean;
|
|
164
|
+
showAdvanceFilter?: boolean;
|
|
165
|
+
onFilter?: (query: {
|
|
166
|
+
field: string;
|
|
167
|
+
key: string;
|
|
168
|
+
operator: IOperator;
|
|
169
|
+
predicate: 'and' | 'or';
|
|
170
|
+
value: any;
|
|
171
|
+
}[]) => void;
|
|
172
|
+
onSorter?: (args: Sorter[]) => void;
|
|
173
|
+
selectionSettings?: SelectionSettings;
|
|
174
|
+
rowSelection?: RowSelection<RecordType>;
|
|
175
|
+
rowSelected?: (args: {
|
|
176
|
+
type: string;
|
|
177
|
+
rowData: RecordType;
|
|
178
|
+
selected: RecordType | RecordType[];
|
|
179
|
+
}) => void;
|
|
180
|
+
dataSourceFilter?: SourceFilter[];
|
|
181
|
+
onFilterClick?: (column: ColumnTable<RecordType>, callback: (key: string, data: any) => void) => void;
|
|
182
|
+
loading?: boolean;
|
|
183
|
+
allowResizing?: boolean;
|
|
184
|
+
showToolbar?: boolean;
|
|
185
|
+
onDataChange?: (data: RecordType[]) => void;
|
|
186
|
+
defaultValue?: AnyObject | (() => AnyObject);
|
|
187
|
+
summary?: boolean | ((data: readonly RecordType[]) => React.ReactNode);
|
|
188
|
+
showEmptyText?: boolean;
|
|
189
|
+
commandSettings?: CommandSettings;
|
|
190
|
+
onCellPaste?: ICellPasteModel<RecordType>;
|
|
191
|
+
onCellChange?: (args: CellChangeArgs<RecordType>, handleCallback: (rowData: any, index: any, value?: any) => void) => void;
|
|
192
|
+
onCellClick?: (args: ICellClick, callback?: any) => void;
|
|
193
|
+
rowEditable?: (rowData: RecordType) => boolean;
|
|
194
|
+
validate?: any;
|
|
195
|
+
onBlur?: (data: RecordType[]) => void;
|
|
196
|
+
onExpandClick?: (args: {
|
|
197
|
+
expandedKeys: string[];
|
|
198
|
+
key: string;
|
|
199
|
+
rowData: any;
|
|
200
|
+
}) => void;
|
|
201
|
+
wrapSettings?: IWrapSettings;
|
|
202
|
+
actionTemplate?: ReactNode | ReactElement | (() => ReactNode | ReactElement);
|
|
203
|
+
commandClick?: (args: CommandClick) => void;
|
|
204
|
+
expandable?: ExpandableConfig<RecordType>;
|
|
205
|
+
fullScreen?: boolean;
|
|
206
|
+
};
|
|
207
|
+
export type ExpandableConfig<RecordType> = {
|
|
208
|
+
expandedRowKeys?: readonly Key[];
|
|
209
|
+
defaultExpandedRowKeys?: readonly Key[];
|
|
210
|
+
expandedRowRender?: ExpandedRowRender<RecordType>;
|
|
211
|
+
columnTitle?: React.ReactNode;
|
|
212
|
+
expandRowByClick?: boolean;
|
|
213
|
+
expandIcon?: RenderExpandIcon<RecordType>;
|
|
214
|
+
onExpand?: (expanded: boolean, record: RecordType) => void;
|
|
215
|
+
onExpandedRowsChange?: (expandedKeys: readonly Key[]) => void;
|
|
216
|
+
defaultExpandAllRows?: boolean;
|
|
217
|
+
indentSize?: number;
|
|
218
|
+
expandIconColumnIndex?: number;
|
|
219
|
+
showExpandColumn?: boolean;
|
|
220
|
+
expandedRowClassName?: string | RowClassName<RecordType>;
|
|
221
|
+
childrenColumnName?: string;
|
|
222
|
+
rowExpandable?: (record: RecordType) => boolean;
|
|
223
|
+
columnWidth?: number | string;
|
|
224
|
+
fixed?: FixedType;
|
|
225
|
+
};
|
|
226
|
+
export type RenderExpandIcon<RecordType> = (props: RenderExpandIconProps<RecordType>) => React.ReactNode;
|
|
227
|
+
export interface RenderExpandIconProps<RecordType> {
|
|
228
|
+
prefixCls: string;
|
|
229
|
+
expanded: boolean;
|
|
230
|
+
record: RecordType;
|
|
231
|
+
expandable: boolean;
|
|
232
|
+
onExpand: TriggerEventHandler<RecordType>;
|
|
233
|
+
}
|
|
234
|
+
export type TriggerEventHandler<RecordType> = (record: RecordType, event: React.MouseEvent<HTMLElement>) => void;
|
|
235
|
+
export type RowClassName<RecordType> = (record: RecordType, index: number, indent: number) => string;
|
|
236
|
+
export type ExpandedRowRender<ValueType> = (record: ValueType, index: number, indent: number, expanded: boolean) => React.ReactNode;
|
|
237
|
+
export type CommandClick = {
|
|
238
|
+
id: string;
|
|
239
|
+
rowId: string;
|
|
240
|
+
rowData: any;
|
|
241
|
+
index: number;
|
|
242
|
+
rows?: any[];
|
|
243
|
+
};
|
|
244
|
+
export type IEditSelectSettings = {
|
|
245
|
+
fieldKey?: string;
|
|
246
|
+
options: any[] | ((rowData: any, field: string) => any[]);
|
|
247
|
+
/** get value form other field **/
|
|
248
|
+
fieldValue?: string;
|
|
249
|
+
/** get label form other field **/
|
|
250
|
+
fieldLabel?: string;
|
|
251
|
+
/** cho phép nhập giá trị - onBlur: giá trị search được set thành value **/
|
|
252
|
+
searchTextAsValue?: boolean;
|
|
253
|
+
inputKey?: string;
|
|
254
|
+
filterKey?: string[];
|
|
255
|
+
selectMode?: SelectMode;
|
|
256
|
+
getPasteValue?: (value: any) => Record<string, any> | null;
|
|
257
|
+
validateOption?: (rowData: any, field: string) => any[];
|
|
258
|
+
defaultOptions?: any[];
|
|
259
|
+
defaultValue?: (value: any, rowData: any) => {
|
|
260
|
+
value: any;
|
|
261
|
+
label: string;
|
|
262
|
+
[key: string]: string;
|
|
263
|
+
} | null;
|
|
264
|
+
formatOptionLabel?: (option: any) => ReactNode | ReactElement;
|
|
265
|
+
loadOptions?: (search: string, callback: (newOptions: any[]) => void, args?: LoadOptionsArgs) => void;
|
|
266
|
+
isMulti?: boolean;
|
|
267
|
+
closeMenuOnSelect?: boolean;
|
|
268
|
+
menuWidth?: number;
|
|
269
|
+
menuHeight?: number;
|
|
270
|
+
columns?: ColumnSelectTable[];
|
|
271
|
+
toolbarItems?: ToolbarItem[];
|
|
272
|
+
toolbarClick?: (props: ToolbarClick) => void;
|
|
273
|
+
toolbarHeight?: number;
|
|
274
|
+
hideSelectedOptions?: boolean;
|
|
275
|
+
showItems?: number;
|
|
276
|
+
isLengthSelected?: boolean;
|
|
277
|
+
fieldNames?: FieldNames;
|
|
278
|
+
filterOption?: boolean | FilterFunc<any>;
|
|
279
|
+
};
|
|
280
|
+
export type IEditFromSettings = {
|
|
281
|
+
fieldKey: string;
|
|
282
|
+
formOpen?: (props: IFormOpen) => void;
|
|
283
|
+
formClose?: (props: IFormOpen) => void;
|
|
284
|
+
formatLabel?: (value: any) => string;
|
|
285
|
+
menuWidth?: number;
|
|
286
|
+
menuHeight?: number;
|
|
287
|
+
labelWith?: number;
|
|
288
|
+
items: any[];
|
|
289
|
+
layout?: {
|
|
290
|
+
xl?: IGrid;
|
|
291
|
+
lg?: IGrid;
|
|
292
|
+
md?: IGrid;
|
|
293
|
+
sm?: IGrid;
|
|
294
|
+
xs?: IGrid;
|
|
295
|
+
};
|
|
296
|
+
defaultValues?: Record<string, any>;
|
|
297
|
+
schema?: any;
|
|
298
|
+
};
|
|
299
|
+
export type IFormOpen = {
|
|
300
|
+
value?: any;
|
|
301
|
+
setValue?: any;
|
|
302
|
+
getValues?: any;
|
|
303
|
+
reset?: any;
|
|
304
|
+
rowData?: any;
|
|
305
|
+
};
|
|
306
|
+
export type FilterFunc<OptionType> = (inputValue: string, option?: OptionType) => boolean;
|
|
307
|
+
export type ToolbarClick = {
|
|
308
|
+
item: any;
|
|
309
|
+
column: any;
|
|
310
|
+
};
|
|
311
|
+
export type ColumnSelectTable = {
|
|
312
|
+
field: string;
|
|
313
|
+
dataIndex?: string;
|
|
314
|
+
type?: IColumnType;
|
|
315
|
+
headerText?: string;
|
|
316
|
+
fixedType?: 'left' | 'right' | undefined;
|
|
317
|
+
width?: number | undefined;
|
|
318
|
+
minWidth?: number;
|
|
319
|
+
maxWidth?: number;
|
|
320
|
+
visible?: boolean;
|
|
321
|
+
textAlign?: ITextAlign;
|
|
322
|
+
headerTextAlign?: ITextAlign;
|
|
323
|
+
template?: (props: ITemplateColumn) => ReactNode | ReactElement;
|
|
324
|
+
headerTemplate?: any;
|
|
325
|
+
ellipsis?: boolean | undefined;
|
|
326
|
+
format?: IFormat;
|
|
327
|
+
tooltipDescription?: string | ((rowData: any) => string | ReactNode);
|
|
328
|
+
showTooltip?: boolean;
|
|
329
|
+
showTooltipHeader?: boolean;
|
|
330
|
+
};
|
|
331
|
+
export type ITemplateColumn = {
|
|
332
|
+
value: any;
|
|
333
|
+
column: any;
|
|
334
|
+
rowData: any;
|
|
335
|
+
field: number | string;
|
|
336
|
+
index: number;
|
|
337
|
+
};
|
|
338
|
+
export type RawValueType = string | number;
|
|
339
|
+
export type ToolbarItem = {
|
|
340
|
+
position?: 'Top' | 'Bottom';
|
|
341
|
+
align?: ITextAlign;
|
|
342
|
+
onClick?: (args: any) => void;
|
|
343
|
+
key?: React.Key;
|
|
344
|
+
value?: RawValueType;
|
|
345
|
+
label?: React.ReactNode;
|
|
346
|
+
template?: React.ReactNode | React.ReactElement | (() => React.ReactNode | React.ReactElement);
|
|
347
|
+
title?: React.ReactNode;
|
|
348
|
+
disabled?: boolean;
|
|
349
|
+
[key: string]: any;
|
|
350
|
+
};
|
|
351
|
+
export type LoadOptionsArgs = {
|
|
352
|
+
rowData?: any;
|
|
353
|
+
};
|
|
354
|
+
export type IGroupSetting = {
|
|
355
|
+
client?: boolean;
|
|
356
|
+
onGroup?: (props: IOnGroup) => void;
|
|
357
|
+
hiddenColumnGroup?: boolean;
|
|
358
|
+
showGroupIcon?: boolean;
|
|
359
|
+
unClearableLevel?: 1 | 2 | 3 | undefined;
|
|
360
|
+
sumGroup?: boolean;
|
|
361
|
+
};
|
|
362
|
+
type IOnGroup = {
|
|
363
|
+
columnGrouped: string[];
|
|
364
|
+
columns: ColumnsTable;
|
|
365
|
+
flattenColumns: ColumnsTable;
|
|
366
|
+
};
|
|
367
|
+
export type IOnChooseColumns = {
|
|
368
|
+
columns: ColumnsTable;
|
|
369
|
+
showColumns: ColumnsTable;
|
|
370
|
+
flattenColumns: ColumnsTable;
|
|
371
|
+
};
|
|
372
|
+
export type ContextMenuItem = ItemType;
|
|
373
|
+
export type CommandSettings = {
|
|
374
|
+
client?: boolean;
|
|
375
|
+
confirmDialog?: boolean;
|
|
376
|
+
};
|
|
377
|
+
export interface ICellPasteModel<RecordType = AnyObject> {
|
|
378
|
+
onPasted?: (args: IOnPastedProps, handleCallback: (callbackData: any[]) => void) => void;
|
|
379
|
+
dataChange?: (data: RecordType[]) => void;
|
|
380
|
+
getCallbackData?: (props: any) => void;
|
|
381
|
+
maxRowsPaste?: number;
|
|
382
|
+
}
|
|
383
|
+
export type IOnPastedProps = {
|
|
384
|
+
data: any[];
|
|
385
|
+
copyRows: any[];
|
|
386
|
+
pastedColumns: string[];
|
|
387
|
+
pasteData: any[];
|
|
388
|
+
type: 'onPaste' | 'onChange' | 'onCellPaste';
|
|
389
|
+
};
|
|
390
|
+
export type ICellClick = {
|
|
391
|
+
index: number;
|
|
392
|
+
indexCol?: number;
|
|
393
|
+
rowId: string | number;
|
|
394
|
+
type: 'Editing' | 'Default';
|
|
395
|
+
field: string;
|
|
396
|
+
cellValue: any;
|
|
397
|
+
rowData: any;
|
|
398
|
+
};
|
|
399
|
+
export type CellChangeArgs<T> = {
|
|
400
|
+
type: 'onPaste' | 'onChange' | 'onCellPaste';
|
|
401
|
+
value: any;
|
|
402
|
+
option: AnyObject;
|
|
403
|
+
rowData: T;
|
|
404
|
+
rowsData: T[];
|
|
405
|
+
indexRow: number;
|
|
406
|
+
rowId?: string;
|
|
407
|
+
field: string | undefined;
|
|
408
|
+
indexCol: any;
|
|
409
|
+
sumValue?: any[];
|
|
410
|
+
};
|
|
411
|
+
export type IWrapMode = 'Header' | 'Both' | 'Content';
|
|
412
|
+
export type IWrapSettings = {
|
|
413
|
+
wrapMode?: IWrapMode;
|
|
414
|
+
};
|
|
415
|
+
export type SelectionSettings<T = AnyObject> = {
|
|
416
|
+
mode?: 'checkbox' | 'radio';
|
|
417
|
+
type?: 'single' | 'multiple';
|
|
418
|
+
checkboxOnly?: boolean;
|
|
419
|
+
columnWidth?: number;
|
|
420
|
+
hideSelectAll?: boolean;
|
|
421
|
+
selectedRowKeys?: Key[];
|
|
422
|
+
defaultSelectedRowKeys?: Key[];
|
|
423
|
+
getCheckboxProps?: (record: T) => Partial<Omit<CheckboxProps, 'checked' | 'defaultChecked'>>;
|
|
424
|
+
};
|
|
425
|
+
export type SelectionSelectFn<T = AnyObject> = (record: T, selected: boolean, selectedRows: T[], nativeEvent: Event) => void;
|
|
426
|
+
export type RowSelection<T> = {
|
|
427
|
+
preserveSelectedRowKeys?: boolean;
|
|
428
|
+
selectedRowKeys?: Key[];
|
|
429
|
+
defaultSelectedRowKeys?: Key[];
|
|
430
|
+
onChange?: (selectedRowKeys: Key[], selectedRows: T[], info: {
|
|
431
|
+
type: RowSelectMethod;
|
|
432
|
+
}, selectedRow: T) => void;
|
|
433
|
+
getCheckboxProps?: (record: T) => Partial<Omit<CheckboxProps, 'checked' | 'defaultChecked'>>;
|
|
434
|
+
onSelect?: SelectionSelectFn<T>;
|
|
435
|
+
/** @deprecated This function is deprecated and should use `onChange` instead */
|
|
436
|
+
onSelectMultiple?: (selected: boolean, selectedRows: T[], changeRows: T[]) => void;
|
|
437
|
+
/** @deprecated This function is deprecated and should use `onChange` instead */
|
|
438
|
+
onSelectAll?: (selected: boolean, selectedRows: T[], changeRows: T[]) => void;
|
|
439
|
+
/** @deprecated This function is deprecated and should use `onChange` instead */
|
|
440
|
+
onSelectInvert?: (selectedRowKeys: Key[]) => void;
|
|
441
|
+
/** @deprecated This function is deprecated and should use `onChange` instead */
|
|
442
|
+
onSelectNone?: () => void;
|
|
443
|
+
fixed?: FixedType;
|
|
444
|
+
columnTitle?: React.ReactNode | ((checkboxNode: React.ReactNode) => React.ReactNode);
|
|
445
|
+
checkStrictly?: boolean;
|
|
446
|
+
checkboxOnly?: boolean;
|
|
447
|
+
arrowKey?: boolean;
|
|
448
|
+
};
|
|
449
|
+
export type RecordDoubleClickEventArgs<RecordType> = {
|
|
450
|
+
rowData: RecordType;
|
|
451
|
+
rowIndex: number | undefined;
|
|
452
|
+
e: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>;
|
|
453
|
+
};
|
|
454
|
+
export type SourceFilter = {
|
|
455
|
+
key: string;
|
|
456
|
+
data: any[];
|
|
457
|
+
loadOptions?: (search: string, callback: (newOptions: any[]) => void) => void;
|
|
458
|
+
};
|
|
459
|
+
export type ContextInfo<RecordType> = {
|
|
460
|
+
rowInfo: {
|
|
461
|
+
rowData: RecordType | null;
|
|
462
|
+
};
|
|
463
|
+
event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>;
|
|
464
|
+
item: ItemType;
|
|
465
|
+
};
|
|
466
|
+
export type Presets = Required<ColorPickerProps>['presets'][number];
|
|
467
|
+
export type RangeState = {
|
|
468
|
+
rowRange: string[];
|
|
469
|
+
colRange: string[];
|
|
470
|
+
startRowIndex: number | undefined;
|
|
471
|
+
endRowIndex: number | undefined;
|
|
472
|
+
startColIndex: number | undefined;
|
|
473
|
+
endColIndex: number | undefined;
|
|
474
|
+
rowIds: string[];
|
|
475
|
+
colIds: string[];
|
|
476
|
+
};
|
|
477
|
+
export type Sorter = {
|
|
478
|
+
columnKey: string;
|
|
479
|
+
field: string;
|
|
480
|
+
order: 'ascend' | 'descend';
|
|
481
|
+
};
|
|
482
|
+
export {};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import type { ExpandableConfig, IFormat, IWrapSettings, RangeState, RecordDoubleClickEventArgs, SelectionSettings } from "./type";
|
|
3
|
+
import type { SubmitHandler } from "react-hook-form";
|
|
4
|
+
export type IPositionCell = {
|
|
5
|
+
rowId: string;
|
|
6
|
+
colId: string;
|
|
7
|
+
} | undefined;
|
|
8
|
+
export interface IContext<T> {
|
|
9
|
+
prefix: string;
|
|
10
|
+
id: string;
|
|
11
|
+
rowKey: string;
|
|
12
|
+
originData: any[];
|
|
13
|
+
dataSource: any[];
|
|
14
|
+
format?: IFormat;
|
|
15
|
+
expandable?: ExpandableConfig<T>;
|
|
16
|
+
wrapSettings?: IWrapSettings;
|
|
17
|
+
recordDoubleClick?: (args: RecordDoubleClickEventArgs<T>) => void;
|
|
18
|
+
selectionSettings?: SelectionSettings;
|
|
19
|
+
setIsSelectionChange: Dispatch<SetStateAction<{
|
|
20
|
+
isChange: boolean;
|
|
21
|
+
type: string;
|
|
22
|
+
rowData: T;
|
|
23
|
+
}>>;
|
|
24
|
+
setSorterChange: Dispatch<SetStateAction<boolean>>;
|
|
25
|
+
setFilterChange: Dispatch<SetStateAction<boolean>>;
|
|
26
|
+
onContextMenu?: (data: T) => (event: any) => void;
|
|
27
|
+
control?: any;
|
|
28
|
+
errors?: any;
|
|
29
|
+
handleSubmit?: any;
|
|
30
|
+
onSubmit?: SubmitHandler<any>;
|
|
31
|
+
getValues?: any;
|
|
32
|
+
reset?: any;
|
|
33
|
+
setValue?: any;
|
|
34
|
+
handleCellChange?: (args: ContextCellChange) => void;
|
|
35
|
+
editingKey?: string;
|
|
36
|
+
setEditingKey?: Dispatch<SetStateAction<string>>;
|
|
37
|
+
rangeState?: RangeState;
|
|
38
|
+
setRangeState?: Dispatch<SetStateAction<RangeState | undefined>>;
|
|
39
|
+
rangePasteState?: RangeState;
|
|
40
|
+
setRangePasteState?: Dispatch<SetStateAction<RangeState | undefined>>;
|
|
41
|
+
startCell?: IPositionCell;
|
|
42
|
+
setStartCell?: Dispatch<SetStateAction<IPositionCell | undefined>>;
|
|
43
|
+
endCell?: IPositionCell;
|
|
44
|
+
setEndCell?: Dispatch<SetStateAction<IPositionCell | undefined>>;
|
|
45
|
+
startPasteCell?: IPositionCell;
|
|
46
|
+
setStartPasteCell?: Dispatch<SetStateAction<IPositionCell | undefined>>;
|
|
47
|
+
endPasteCell?: IPositionCell;
|
|
48
|
+
setEndPasteCell?: Dispatch<SetStateAction<IPositionCell | undefined>>;
|
|
49
|
+
isSelecting?: boolean;
|
|
50
|
+
setIsSelecting?: Dispatch<SetStateAction<boolean>>;
|
|
51
|
+
isPasting?: boolean;
|
|
52
|
+
setIsPasting?: Dispatch<SetStateAction<boolean>>;
|
|
53
|
+
focusedCell?: IPositionCell;
|
|
54
|
+
setFocusedCell?: Dispatch<SetStateAction<IPositionCell | undefined>>;
|
|
55
|
+
triggerPaste?: (pastedRows: T[], pastedColumnsArray: string[], newData: T[], copyRows: T[]) => void;
|
|
56
|
+
handleDeleteContent?: () => void;
|
|
57
|
+
handleAddMulti?: (item: any, n: number, id?: string) => void;
|
|
58
|
+
}
|
|
59
|
+
export interface IContextEdit<T> {
|
|
60
|
+
prefix: string;
|
|
61
|
+
searchValue?: any;
|
|
62
|
+
setSearchValue?: any;
|
|
63
|
+
open?: boolean;
|
|
64
|
+
setOpen?: any;
|
|
65
|
+
rowKey: string;
|
|
66
|
+
onSave?: any;
|
|
67
|
+
format?: IFormat;
|
|
68
|
+
control?: any;
|
|
69
|
+
errors?: any;
|
|
70
|
+
trigger?: any;
|
|
71
|
+
handleSubmit?: any;
|
|
72
|
+
onSubmit?: SubmitHandler<any>;
|
|
73
|
+
getValues?: any;
|
|
74
|
+
reset?: any;
|
|
75
|
+
setValue?: any;
|
|
76
|
+
handleCellChange?: (args: ContextCellChange) => void;
|
|
77
|
+
id: string;
|
|
78
|
+
startCell: IPositionCell;
|
|
79
|
+
setStartCell: Dispatch<SetStateAction<IPositionCell>>;
|
|
80
|
+
endCell: IPositionCell;
|
|
81
|
+
setEndCell: Dispatch<SetStateAction<IPositionCell>>;
|
|
82
|
+
startPasteCell: IPositionCell;
|
|
83
|
+
setStartPasteCell: Dispatch<SetStateAction<IPositionCell>>;
|
|
84
|
+
endPasteCell: IPositionCell;
|
|
85
|
+
setEndPasteCell: Dispatch<SetStateAction<IPositionCell>>;
|
|
86
|
+
isSelecting: boolean;
|
|
87
|
+
setIsSelecting: Dispatch<SetStateAction<boolean>>;
|
|
88
|
+
isPasting: boolean;
|
|
89
|
+
setIsPasting: Dispatch<SetStateAction<boolean>>;
|
|
90
|
+
editingKey: string;
|
|
91
|
+
setEditingKey: Dispatch<SetStateAction<string>>;
|
|
92
|
+
focusedCell: IPositionCell;
|
|
93
|
+
setFocusedCell: Dispatch<SetStateAction<IPositionCell>>;
|
|
94
|
+
rangeState: RangeState;
|
|
95
|
+
setRangeState: Dispatch<SetStateAction<RangeState>>;
|
|
96
|
+
rangePasteState: RangeState;
|
|
97
|
+
setRangePasteState: Dispatch<SetStateAction<RangeState>>;
|
|
98
|
+
originData: any[];
|
|
99
|
+
dataSource: any[];
|
|
100
|
+
triggerPaste?: (pastedRows: T[], pastedColumnsArray: string[], newData: T[], copyRows: T[]) => void;
|
|
101
|
+
expandable?: ExpandableConfig<T>;
|
|
102
|
+
handleDeleteContent: () => void;
|
|
103
|
+
wrapSettings?: IWrapSettings;
|
|
104
|
+
handleAddMulti: (item: any, n: number, id?: string) => void;
|
|
105
|
+
recordDoubleClick?: (args: RecordDoubleClickEventArgs<T>) => void;
|
|
106
|
+
}
|
|
107
|
+
export declare const TableContext: import("react").Context<IContext<any>>;
|
|
108
|
+
export declare const TableContextEdit: import("react").Context<IContextEdit<any>>;
|
|
109
|
+
export type ContextCellChange = {
|
|
110
|
+
key: string;
|
|
111
|
+
record: any;
|
|
112
|
+
field: string | undefined;
|
|
113
|
+
option: any;
|
|
114
|
+
indexRow: number;
|
|
115
|
+
indexCol: number;
|
|
116
|
+
newState?: any;
|
|
117
|
+
prevState?: any;
|
|
118
|
+
type: 'enter' | 'blur' | 'outClick';
|
|
119
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TableContextEdit = exports.TableContext = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
const TableContext = exports.TableContext = /*#__PURE__*/(0, _react.createContext)({
|
|
9
|
+
prefix: 'ui-rc',
|
|
10
|
+
id: '',
|
|
11
|
+
rowKey: 'rowId',
|
|
12
|
+
dataSource: [],
|
|
13
|
+
originData: [],
|
|
14
|
+
// triggerFilter: () => { },
|
|
15
|
+
|
|
16
|
+
setIsSelectionChange: () => {},
|
|
17
|
+
setSorterChange: () => {},
|
|
18
|
+
setFilterChange: () => {}
|
|
19
|
+
});
|
|
20
|
+
const TableContextEdit = exports.TableContextEdit = /*#__PURE__*/(0, _react.createContext)({
|
|
21
|
+
prefix: 'ui-rc',
|
|
22
|
+
rowKey: 'rowId',
|
|
23
|
+
id: '',
|
|
24
|
+
dataSource: [],
|
|
25
|
+
originData: [],
|
|
26
|
+
focusedCell: undefined,
|
|
27
|
+
startCell: undefined,
|
|
28
|
+
endCell: undefined,
|
|
29
|
+
isSelecting: false,
|
|
30
|
+
isPasting: false,
|
|
31
|
+
startPasteCell: undefined,
|
|
32
|
+
endPasteCell: undefined,
|
|
33
|
+
editingKey: '',
|
|
34
|
+
rangeState: {
|
|
35
|
+
startRowIndex: undefined,
|
|
36
|
+
endRowIndex: undefined,
|
|
37
|
+
startColIndex: undefined,
|
|
38
|
+
endColIndex: undefined,
|
|
39
|
+
rowIds: [],
|
|
40
|
+
colIds: [],
|
|
41
|
+
colRange: [],
|
|
42
|
+
rowRange: []
|
|
43
|
+
},
|
|
44
|
+
rangePasteState: {
|
|
45
|
+
startRowIndex: undefined,
|
|
46
|
+
endRowIndex: undefined,
|
|
47
|
+
startColIndex: undefined,
|
|
48
|
+
endColIndex: undefined,
|
|
49
|
+
rowIds: [],
|
|
50
|
+
colIds: [],
|
|
51
|
+
colRange: [],
|
|
52
|
+
rowRange: []
|
|
53
|
+
},
|
|
54
|
+
setEditingKey: () => {},
|
|
55
|
+
setStartCell: () => {},
|
|
56
|
+
setIsSelecting: () => {},
|
|
57
|
+
setEndCell: () => {},
|
|
58
|
+
setFocusedCell: () => {},
|
|
59
|
+
setRangeState: () => {},
|
|
60
|
+
setRangePasteState: () => {},
|
|
61
|
+
setIsPasting: () => {},
|
|
62
|
+
setEndPasteCell: () => {},
|
|
63
|
+
setStartPasteCell: () => {},
|
|
64
|
+
handleDeleteContent: () => {},
|
|
65
|
+
// triggerFilter: () => { },
|
|
66
|
+
handleAddMulti: () => {}
|
|
67
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "es-grid-template",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.24",
|
|
4
4
|
"description": "es-grid-template",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -48,6 +48,8 @@
|
|
|
48
48
|
"@rc-component/father-plugin": "^2.0.1",
|
|
49
49
|
"@rc-component/trigger": "^2.0.0",
|
|
50
50
|
"@rc-component/util": "^1.0.1",
|
|
51
|
+
"@tanstack/react-table": "^8.21.3",
|
|
52
|
+
"@tanstack/react-virtual": "^3.13.12",
|
|
51
53
|
"@types/react-resizable": "^3.0.8",
|
|
52
54
|
"@types/styled-components": "^5.1.34",
|
|
53
55
|
"@vitest/coverage-v8": "^2.0.5",
|