es-grid-template 0.1.3-0 → 1.1.4
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/CheckboxFilter.js +0 -2
- package/es/grid-component/ColumnsChoose.d.ts +1 -1
- package/es/grid-component/ColumnsChoose.js +1 -4
- package/es/grid-component/Command.js +1 -2
- package/es/grid-component/InternalTable.js +3 -4
- package/es/grid-component/TableGrid.d.ts +2 -2
- package/es/grid-component/TableGrid.js +57 -52
- package/es/grid-component/styles.scss +12 -3
- package/es/grid-component/table/Grid.d.ts +2 -0
- package/es/grid-component/table/Grid.js +18 -17
- package/es/grid-component/table/GridEdit.d.ts +2 -1
- package/es/grid-component/table/GridEdit.js +0 -10
- package/es/grid-component/type.d.ts +3 -1
- package/lib/grid-component/CheckboxFilter.js +0 -2
- package/lib/grid-component/ColumnsChoose.d.ts +1 -1
- package/lib/grid-component/ColumnsChoose.js +1 -4
- package/lib/grid-component/Command.js +1 -3
- package/lib/grid-component/InternalTable.js +3 -4
- package/lib/grid-component/TableGrid.d.ts +2 -2
- package/lib/grid-component/TableGrid.js +59 -52
- package/lib/grid-component/styles.scss +12 -3
- package/lib/grid-component/table/Grid.d.ts +2 -0
- package/lib/grid-component/table/Grid.js +18 -17
- package/lib/grid-component/table/GridEdit.d.ts +2 -1
- package/lib/grid-component/table/GridEdit.js +0 -10
- package/lib/grid-component/type.d.ts +3 -1
- package/package.json +102 -102
|
@@ -149,11 +149,9 @@ const CheckboxFilter = props => {
|
|
|
149
149
|
children: node.children?.map(item => getFilterData(item)) || []
|
|
150
150
|
});
|
|
151
151
|
const onCheckAll = e => {
|
|
152
|
-
// console.log('e.target.checked', e.target.checked)
|
|
153
152
|
if (e.target.checked) {
|
|
154
153
|
const allFilterKeys = flattenKeys(options).map(key => String(key));
|
|
155
154
|
|
|
156
|
-
// console.log('allFilterKeys', allFilterKeys)
|
|
157
155
|
// setFilteredKeysSync(allFilterKeys);
|
|
158
156
|
onSelect?.(allFilterKeys);
|
|
159
157
|
} else {
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import type { ColumnsTable } from "./type";
|
|
3
3
|
export type IColumnsChoose<RecordType> = {
|
|
4
4
|
columns: ColumnsTable<RecordType>;
|
|
5
|
-
triggerChangeColumns?: (columns: ColumnsTable<RecordType
|
|
5
|
+
triggerChangeColumns?: (columns: ColumnsTable<RecordType>, type: string) => void;
|
|
6
6
|
t?: any;
|
|
7
7
|
};
|
|
8
8
|
export declare const ColumnsChoose: <RecordType extends object>(props: IColumnsChoose<RecordType>) => React.JSX.Element;
|
|
@@ -137,7 +137,7 @@ export const ColumnsChoose = props => {
|
|
|
137
137
|
};
|
|
138
138
|
const handleAccept = () => {
|
|
139
139
|
const rs1 = updateColumns(propsColumns, selectedKeys);
|
|
140
|
-
triggerChangeColumns?.(rs1);
|
|
140
|
+
triggerChangeColumns?.(rs1, 'columnChoose');
|
|
141
141
|
hide();
|
|
142
142
|
};
|
|
143
143
|
const handleCancel = () => {
|
|
@@ -169,8 +169,6 @@ export const ColumnsChoose = props => {
|
|
|
169
169
|
checkable: true
|
|
170
170
|
// onSelect={(keys, info) => {
|
|
171
171
|
// const key = info.node.key
|
|
172
|
-
// console.log('selectedKeys', keys)
|
|
173
|
-
// console.log('info', info)
|
|
174
172
|
//
|
|
175
173
|
// const find = findItemByKey(columns, 'key', key)
|
|
176
174
|
//
|
|
@@ -185,7 +183,6 @@ export const ColumnsChoose = props => {
|
|
|
185
183
|
//
|
|
186
184
|
// // const rs = [...selectedKeys, keys[0]]
|
|
187
185
|
//
|
|
188
|
-
// // console.log('rs', rs)
|
|
189
186
|
// // setSelectedKeys(keys)
|
|
190
187
|
// // }
|
|
191
188
|
// }}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import React, { Fragment, useState } from "react";
|
|
3
|
-
// import {getTemplate} from "../../hooks"
|
|
4
3
|
import classnames from "classnames";
|
|
5
4
|
import { useFloating, autoUpdate, offset, flip, shift, useHover, useFocus, useDismiss, useRole, useInteractions, FloatingPortal
|
|
6
5
|
// useClick
|
|
@@ -74,7 +73,7 @@ const Command = props => {
|
|
|
74
73
|
ref: refs.setFloating,
|
|
75
74
|
style: {
|
|
76
75
|
...floatingStyles,
|
|
77
|
-
zIndex:
|
|
76
|
+
zIndex: 1999
|
|
78
77
|
}
|
|
79
78
|
}, getFloatingProps()), item.tooltip)));
|
|
80
79
|
};
|
|
@@ -282,10 +282,9 @@ const InternalTable = props => {
|
|
|
282
282
|
const mergedColumns = React.useMemo(() => {
|
|
283
283
|
return transformColumns(columns);
|
|
284
284
|
}, [transformColumns, columns]);
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
const triggerChangeColumns = () => {};
|
|
285
|
+
const triggerChangeColumns = newColumns => {
|
|
286
|
+
setColumns(newColumns);
|
|
287
|
+
};
|
|
289
288
|
const triggerChangeData = newData => {
|
|
290
289
|
setIsManualUpdate(true);
|
|
291
290
|
setData(newData);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import 'dayjs/locale/es';
|
|
3
3
|
import 'dayjs/locale/vi';
|
|
4
|
-
import type { GridTableProps } from "./type";
|
|
4
|
+
import type { ColumnsTable, GridTableProps } from "./type";
|
|
5
5
|
type GridProps<T> = GridTableProps<T> & {
|
|
6
|
-
triggerChangeColumns?: () => void;
|
|
6
|
+
triggerChangeColumns?: (columns: ColumnsTable<T>, type: string) => void;
|
|
7
7
|
triggerChangeData?: () => void;
|
|
8
8
|
tableRef: any;
|
|
9
9
|
getRowKey: any;
|
|
@@ -2,7 +2,12 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import React, { Fragment, useLayoutEffect, useRef } from 'react';
|
|
3
3
|
import { createStyles } from 'antd-style';
|
|
4
4
|
import { numericFormatter } from "react-numeric-component";
|
|
5
|
+
// import type {CheckboxProps} from "rc-master-ui";
|
|
5
6
|
import { Table, Toolbar } from "rc-master-ui";
|
|
7
|
+
// import { conductCheck } from 'rc-tree/lib/utils/conductUtil';
|
|
8
|
+
// import { devUseWarning } from '../../_util/warning';
|
|
9
|
+
// import { arrAdd, arrDel } from 'rc-tree/lib/util';
|
|
10
|
+
|
|
6
11
|
import 'dayjs/locale/es';
|
|
7
12
|
import 'dayjs/locale/vi';
|
|
8
13
|
import ContextMenu from "./ContextMenu";
|
|
@@ -16,7 +21,13 @@ import Pagination from "rc-master-ui/es/pagination";
|
|
|
16
21
|
import ComponentSpinner from "./LoadingSpinner";
|
|
17
22
|
import { ColumnsChoose } from "./ColumnsChoose";
|
|
18
23
|
// import {useMergedState} from "rc-util";
|
|
19
|
-
|
|
24
|
+
import useMergedState from "rc-util/es/hooks/useMergedState";
|
|
25
|
+
// import {convertDataToEntities} from "rc-tree/lib/utils/treeUtil";
|
|
26
|
+
// import type {DataNode} from "rc-tree/lib/interface";
|
|
27
|
+
// import {devUseWarning} from "antd/es/_util/warning";
|
|
28
|
+
// import type {GetCheckDisabled} from "rc-tree/es/interface";
|
|
29
|
+
// import useLazyKVMap from "antd/es/table/hooks/useLazyKVMap";
|
|
30
|
+
// import useMultipleSelect from "rc-master-ui/es/_util/hooks/useMultipleSelect";
|
|
20
31
|
|
|
21
32
|
const convertFilters = filters => {
|
|
22
33
|
const result = [];
|
|
@@ -84,7 +95,21 @@ const useStyle = createStyles(({
|
|
|
84
95
|
});
|
|
85
96
|
// type OnChange = NonNullable<TableProps<any>['onChange']>;
|
|
86
97
|
|
|
87
|
-
|
|
98
|
+
const EMPTY_LIST = [];
|
|
99
|
+
|
|
100
|
+
// const flattenData = <RecordType extends AnyObject = AnyObject>(
|
|
101
|
+
// childrenColumnName: keyof RecordType,
|
|
102
|
+
// data?: RecordType[],
|
|
103
|
+
// ): RecordType[] => {
|
|
104
|
+
// let list: RecordType[] = [];
|
|
105
|
+
// (data || []).forEach((record) => {
|
|
106
|
+
// list.push(record);
|
|
107
|
+
// if (record && typeof record === 'object' && childrenColumnName in record) {
|
|
108
|
+
// list = [...list, ...flattenData<RecordType>(childrenColumnName, record[childrenColumnName])];
|
|
109
|
+
// }
|
|
110
|
+
// });
|
|
111
|
+
// return list;
|
|
112
|
+
// };
|
|
88
113
|
|
|
89
114
|
const TableGrid = props => {
|
|
90
115
|
const {
|
|
@@ -126,11 +151,13 @@ const TableGrid = props => {
|
|
|
126
151
|
const {
|
|
127
152
|
mode,
|
|
128
153
|
type,
|
|
129
|
-
checkboxOnly,
|
|
154
|
+
// checkboxOnly,
|
|
130
155
|
hideSelectAll,
|
|
131
156
|
columnWidth,
|
|
132
|
-
selectedRowKeys
|
|
133
|
-
|
|
157
|
+
selectedRowKeys,
|
|
158
|
+
defaultSelectedRowKeys
|
|
159
|
+
// getCheckboxProps,
|
|
160
|
+
// checkStrictly = true
|
|
134
161
|
} = selectionSettings || {};
|
|
135
162
|
const clickRef = useRef(null);
|
|
136
163
|
const menuRef = useRef(null);
|
|
@@ -145,26 +172,15 @@ const TableGrid = props => {
|
|
|
145
172
|
viewportHeight
|
|
146
173
|
});
|
|
147
174
|
|
|
148
|
-
// const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>(defaultSelected);
|
|
149
|
-
|
|
150
175
|
// ========================= Keys =========================
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
// Reset if rowSelection reset
|
|
161
|
-
|
|
162
|
-
// React.useEffect(() => {
|
|
163
|
-
// if (!selectionSettings) {
|
|
164
|
-
// setMergedSelectedKeys(EMPTY_LIST);
|
|
165
|
-
// }
|
|
166
|
-
// }, [!!selectionSettings]);
|
|
167
|
-
|
|
176
|
+
const [mergedSelectedKeys, setMergedSelectedKeys] = useMergedState(selectedRowKeys || defaultSelectedRowKeys || EMPTY_LIST, {
|
|
177
|
+
value: selectedRowKeys
|
|
178
|
+
});
|
|
179
|
+
React.useEffect(() => {
|
|
180
|
+
if (!selectionSettings) {
|
|
181
|
+
setMergedSelectedKeys(EMPTY_LIST);
|
|
182
|
+
}
|
|
183
|
+
}, [!!selectionSettings]);
|
|
168
184
|
const contextMenuItems = React.useMemo(() => {
|
|
169
185
|
if (typeof contextMenuHidden === "function" && propContextMenuItems && selectedRowData) {
|
|
170
186
|
const hiddenItems = contextMenuHidden({
|
|
@@ -232,24 +248,6 @@ const TableGrid = props => {
|
|
|
232
248
|
});
|
|
233
249
|
}
|
|
234
250
|
};
|
|
235
|
-
const handleRowClick = () => () => {
|
|
236
|
-
// const key = getRowKey(record, index);
|
|
237
|
-
|
|
238
|
-
// const keySet = new Set(derivedSelectedKeySet);
|
|
239
|
-
|
|
240
|
-
// console.log('key', key)
|
|
241
|
-
|
|
242
|
-
if (checkboxOnly !== true) {
|
|
243
|
-
if (type === 'single') {}
|
|
244
|
-
}
|
|
245
|
-
if (clickRef.current) return;
|
|
246
|
-
|
|
247
|
-
// @ts-ignore
|
|
248
|
-
clickRef.current = setTimeout(() => {
|
|
249
|
-
// console.log("Single Click:", record);
|
|
250
|
-
clickRef.current = null;
|
|
251
|
-
}, 250);
|
|
252
|
-
};
|
|
253
251
|
const handleRowDoubleClick = (record, index) => e => {
|
|
254
252
|
if (clickRef.current) {
|
|
255
253
|
clearTimeout(clickRef.current);
|
|
@@ -263,7 +261,7 @@ const TableGrid = props => {
|
|
|
263
261
|
};
|
|
264
262
|
const onSelectChange = (keys, selectedRows, info, selectedRow) => {
|
|
265
263
|
if (info.type === 'all') {
|
|
266
|
-
|
|
264
|
+
setMergedSelectedKeys(keys);
|
|
267
265
|
rowSelected?.({
|
|
268
266
|
selected: selectedRows,
|
|
269
267
|
type: 'rowSelected',
|
|
@@ -271,7 +269,7 @@ const TableGrid = props => {
|
|
|
271
269
|
});
|
|
272
270
|
} else {
|
|
273
271
|
if (selectionSettings?.type === 'multiple') {
|
|
274
|
-
|
|
272
|
+
setMergedSelectedKeys(keys);
|
|
275
273
|
rowSelected?.({
|
|
276
274
|
selected: selectedRows,
|
|
277
275
|
type: 'rowSelected',
|
|
@@ -279,8 +277,7 @@ const TableGrid = props => {
|
|
|
279
277
|
});
|
|
280
278
|
} else {
|
|
281
279
|
// @ts-ignore
|
|
282
|
-
|
|
283
|
-
|
|
280
|
+
setMergedSelectedKeys(keys);
|
|
284
281
|
rowSelected?.({
|
|
285
282
|
selected: [selectedRow],
|
|
286
283
|
type: 'rowSelected',
|
|
@@ -322,7 +319,7 @@ const TableGrid = props => {
|
|
|
322
319
|
// className={styles.customTable}
|
|
323
320
|
,
|
|
324
321
|
className: classNames(className, {
|
|
325
|
-
'table-none-column-select':
|
|
322
|
+
'table-none-column-select': mode === undefined && type !== 'multiple'
|
|
326
323
|
}, styles.customTable),
|
|
327
324
|
bordered: true,
|
|
328
325
|
virtual: virtual,
|
|
@@ -336,17 +333,19 @@ const TableGrid = props => {
|
|
|
336
333
|
onRow: (data, index) => {
|
|
337
334
|
return {
|
|
338
335
|
onDoubleClick: handleRowDoubleClick(data, index),
|
|
339
|
-
// onClick: handleRowClick,
|
|
340
|
-
onClick: handleRowClick(),
|
|
336
|
+
// onClick: handleRowClick(data, index),
|
|
341
337
|
onContextMenu: onContextMenu(data)
|
|
342
338
|
};
|
|
343
339
|
},
|
|
344
340
|
rowSelection: {
|
|
345
341
|
...selectionSettings,
|
|
346
|
-
type:
|
|
342
|
+
type: mode === 'checkbox' || type === 'multiple' ? 'checkbox' : "radio",
|
|
347
343
|
columnWidth: !mode ? 0.0000001 : columnWidth ?? 50,
|
|
348
344
|
onChange: onSelectChange,
|
|
349
|
-
selectedRowKeys: mode === 'checkbox' && type === 'single' ? selectedRowKeys : undefined,
|
|
345
|
+
// selectedRowKeys: mode === 'checkbox' && type === 'single' ? selectedRowKeys : undefined,
|
|
346
|
+
// selectedRowKeys: mode === 'checkbox' && type === 'single' ? mergedSelectedKeys : undefined,
|
|
347
|
+
|
|
348
|
+
selectedRowKeys: mergedSelectedKeys,
|
|
350
349
|
defaultSelectedRowKeys: selectionSettings?.defaultSelectedRowKeys,
|
|
351
350
|
preserveSelectedRowKeys: true,
|
|
352
351
|
...rowSelection,
|
|
@@ -408,7 +407,6 @@ const TableGrid = props => {
|
|
|
408
407
|
mode: 'responsive'
|
|
409
408
|
// mode={'scroll'}
|
|
410
409
|
// onClick={(val: any) => {
|
|
411
|
-
// console.log(val)
|
|
412
410
|
// }}
|
|
413
411
|
}), showColumnChoose && /*#__PURE__*/React.createElement(ColumnsChoose, {
|
|
414
412
|
columns: columns,
|
|
@@ -416,6 +414,13 @@ const TableGrid = props => {
|
|
|
416
414
|
triggerChangeColumns: triggerChangeColumns
|
|
417
415
|
}), /*#__PURE__*/React.createElement("div", null)));
|
|
418
416
|
}
|
|
417
|
+
|
|
418
|
+
// rowClassName={(record) => (selectionSettings?.getCheckboxProps(record).disabled ? "row-disabled" : "")}
|
|
419
|
+
,
|
|
420
|
+
rowClassName: record => {
|
|
421
|
+
const originalOnCell = selectionSettings?.getCheckboxProps?.(record) || {};
|
|
422
|
+
return originalOnCell.disabled ? 'row-disabled' : '';
|
|
423
|
+
}
|
|
419
424
|
}, rest)), pagination && pagination.onChange && /*#__PURE__*/React.createElement(Pagination
|
|
420
425
|
// style={{padding: '0.75rem 1rem'}}
|
|
421
426
|
, _extends({
|
|
@@ -12,6 +12,7 @@ $cell-selected-bg: #E6EFFD !default;
|
|
|
12
12
|
$cell-index-selected-bg: #0550C5 !default;
|
|
13
13
|
$cell-index-focus-bg: #CEDBEF !default;
|
|
14
14
|
$rowSelectedHoverBg: 'ui-rc' !default;
|
|
15
|
+
$boxShadowColor: rgba(5, 5, 5, 0.09) !default;
|
|
15
16
|
|
|
16
17
|
.react-hot-toast {
|
|
17
18
|
font-size: 1rem;
|
|
@@ -58,6 +59,7 @@ $rowSelectedHoverBg: 'ui-rc' !default;
|
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
.#{$prefix}-table-tbody {
|
|
62
|
+
|
|
61
63
|
.#{$prefix}-table-row {
|
|
62
64
|
&.#{$prefix}-table-row-selected {
|
|
63
65
|
> .#{$prefix}-table-cell {
|
|
@@ -65,6 +67,12 @@ $rowSelectedHoverBg: 'ui-rc' !default;
|
|
|
65
67
|
}
|
|
66
68
|
}
|
|
67
69
|
|
|
70
|
+
&.row-disabled {
|
|
71
|
+
.ui-rc-table-cell {
|
|
72
|
+
//background-color: #f5f5f5;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
68
76
|
> .#{$prefix}-table-cell {
|
|
69
77
|
&.#{$prefix}-table-cell-row-hover {
|
|
70
78
|
background: #FBDED6;
|
|
@@ -83,6 +91,7 @@ $rowSelectedHoverBg: 'ui-rc' !default;
|
|
|
83
91
|
|
|
84
92
|
}
|
|
85
93
|
}
|
|
94
|
+
|
|
86
95
|
.ui-rc-table-placeholder {
|
|
87
96
|
.ui-rc-table-cell {
|
|
88
97
|
padding-top: 0 !important;
|
|
@@ -178,7 +187,7 @@ $rowSelectedHoverBg: 'ui-rc' !default;
|
|
|
178
187
|
}
|
|
179
188
|
|
|
180
189
|
&.#{$prefix}-table-ping-right:not(.#{$prefix}-table-has-fix-right) .#{$prefix}-table-container::after {
|
|
181
|
-
box-shadow: inset -10px 0 8px -8px
|
|
190
|
+
box-shadow: inset -10px 0 8px -8px $boxShadowColor;
|
|
182
191
|
}
|
|
183
192
|
|
|
184
193
|
}
|
|
@@ -186,14 +195,14 @@ $rowSelectedHoverBg: 'ui-rc' !default;
|
|
|
186
195
|
.#{$prefix}-table-ping-left {
|
|
187
196
|
.#{$prefix}-table-cell-fix-left-first::after,
|
|
188
197
|
.#{$prefix}-table-cell-fix-left-last::after {
|
|
189
|
-
box-shadow: inset 10px 0 8px -8px
|
|
198
|
+
box-shadow: inset 10px 0 8px -8px $boxShadowColor;
|
|
190
199
|
}
|
|
191
200
|
}
|
|
192
201
|
|
|
193
202
|
.#{$prefix}-table-ping-right {
|
|
194
203
|
.#{$prefix}-table-cell-fix-right-first::after,
|
|
195
204
|
.#{$prefix}-table-cell-fix-right-last::after {
|
|
196
|
-
box-shadow: inset -10px 0 8px -8px
|
|
205
|
+
box-shadow: inset -10px 0 8px -8px $boxShadowColor;
|
|
197
206
|
}
|
|
198
207
|
}
|
|
199
208
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { ColumnsTable } from "../type";
|
|
2
3
|
import type { GridTableProps } from "../type";
|
|
3
4
|
type Props<T> = GridTableProps<T> & {
|
|
4
5
|
setColumns?: any;
|
|
5
6
|
tableRef: any;
|
|
6
7
|
getRowKey: any;
|
|
8
|
+
triggerChangeColumns?: (columns: ColumnsTable<T>, type: string) => void;
|
|
7
9
|
};
|
|
8
10
|
declare const Grid: <RecordType extends object>(props: Props<RecordType>) => React.JSX.Element;
|
|
9
11
|
export default Grid;
|
|
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import React, { Fragment, useMemo } from 'react';
|
|
3
3
|
import { GridStyle } from "../GridStyle";
|
|
4
4
|
import TableGrid from "../TableGrid";
|
|
5
|
-
import Command from "../Command";
|
|
6
5
|
import { renderContent } from "../hooks/useColumns";
|
|
7
6
|
const Grid = props => {
|
|
8
7
|
const {
|
|
@@ -14,6 +13,7 @@ const Grid = props => {
|
|
|
14
13
|
style,
|
|
15
14
|
format,
|
|
16
15
|
getRowKey,
|
|
16
|
+
triggerChangeColumns,
|
|
17
17
|
...rest
|
|
18
18
|
} = props;
|
|
19
19
|
const transformColumns = React.useCallback(cols => {
|
|
@@ -45,21 +45,21 @@ const Grid = props => {
|
|
|
45
45
|
render: (_, __, rowIndex) => rowIndex + 1
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
48
|
+
|
|
49
|
+
// if (transformedColumn.dataIndex === "command") {
|
|
50
|
+
// return {
|
|
51
|
+
// ...transformedColumn,
|
|
52
|
+
// onCell: () => ({ className: "ui-rc-cell-command" }),
|
|
53
|
+
// render: () => (
|
|
54
|
+
// <div className="ui-rc-cell-command__content">
|
|
55
|
+
// {column.commandItems?.map((item, index) =>
|
|
56
|
+
// item.visible !== false ? <Command key={`command-${index}`} item={item} onClick={(e) => e.preventDefault()} /> : null
|
|
57
|
+
// )}
|
|
58
|
+
// </div>
|
|
59
|
+
// ),
|
|
60
|
+
// };
|
|
61
|
+
// }
|
|
62
|
+
|
|
63
63
|
return {
|
|
64
64
|
...transformedColumn,
|
|
65
65
|
render: (value, record, rowIndex) => renderContent(column, value, record, rowIndex, format)
|
|
@@ -83,7 +83,8 @@ const Grid = props => {
|
|
|
83
83
|
...style,
|
|
84
84
|
minHeight: height
|
|
85
85
|
},
|
|
86
|
-
getRowKey: getRowKey
|
|
86
|
+
getRowKey: getRowKey,
|
|
87
|
+
triggerChangeColumns: triggerChangeColumns
|
|
87
88
|
}))));
|
|
88
89
|
};
|
|
89
90
|
export default Grid;
|
|
@@ -2,10 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import 'dayjs/locale/es';
|
|
3
3
|
import 'dayjs/locale/vi';
|
|
4
4
|
import type { TableEditProps } from "../type";
|
|
5
|
+
import type { ColumnsTable } from "../type";
|
|
5
6
|
import type { GetRowKey } from "../type";
|
|
6
7
|
type Props<RecordType> = TableEditProps<RecordType> & {
|
|
7
8
|
tableRef: any;
|
|
8
|
-
triggerChangeColumns?: () => void;
|
|
9
|
+
triggerChangeColumns?: (columns: ColumnsTable<RecordType>, type: string) => void;
|
|
9
10
|
triggerChangeData?: (newData: RecordType[], type: string) => void;
|
|
10
11
|
getRowKey: GetRowKey<RecordType>;
|
|
11
12
|
};
|
|
@@ -140,10 +140,6 @@ const GridEdit = props => {
|
|
|
140
140
|
newSelectedCells.add(`${r}-${c}`);
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
|
|
144
|
-
// console.log('newSelectedCells', newSelectedCells)
|
|
145
|
-
// setSelectedCells(newSelectedCells)
|
|
146
|
-
|
|
147
143
|
setSelectedCells(new Set(newSelectedCells));
|
|
148
144
|
// forceUpdate();
|
|
149
145
|
setUpdateKey(prev => prev + 1); // Cập nhật key để trigger re-render
|
|
@@ -321,7 +317,6 @@ const GridEdit = props => {
|
|
|
321
317
|
// }
|
|
322
318
|
};
|
|
323
319
|
const onSubmit = formData => {
|
|
324
|
-
console.log('onSubmit', formData);
|
|
325
320
|
try {
|
|
326
321
|
// const record = (await form.validateFields()) as RecordType;
|
|
327
322
|
const row = {
|
|
@@ -375,8 +370,6 @@ const GridEdit = props => {
|
|
|
375
370
|
option,
|
|
376
371
|
field
|
|
377
372
|
} = args;
|
|
378
|
-
|
|
379
|
-
// console.log('newState', newState)
|
|
380
373
|
//
|
|
381
374
|
// console.log('getValues()', getValues())
|
|
382
375
|
|
|
@@ -400,7 +393,6 @@ const GridEdit = props => {
|
|
|
400
393
|
};
|
|
401
394
|
if (onCellChange) {
|
|
402
395
|
if (onCellChange.length > 1) {
|
|
403
|
-
console.log('onCellChange Callback');
|
|
404
396
|
onCellChange({
|
|
405
397
|
field,
|
|
406
398
|
indexCol: 1,
|
|
@@ -414,7 +406,6 @@ const GridEdit = props => {
|
|
|
414
406
|
sumValue: []
|
|
415
407
|
}, handleChangeCallback);
|
|
416
408
|
} else {
|
|
417
|
-
console.log('onCellChange');
|
|
418
409
|
onCellChange({
|
|
419
410
|
field,
|
|
420
411
|
indexCol: 1,
|
|
@@ -433,7 +424,6 @@ const GridEdit = props => {
|
|
|
433
424
|
console.log('aaaaaa blur');
|
|
434
425
|
}
|
|
435
426
|
if (prevState && newState && prevState !== newState && type === 'enter') {
|
|
436
|
-
console.log('enter');
|
|
437
427
|
onSubmit(record);
|
|
438
428
|
}
|
|
439
429
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReactElement, ReactNode } from "react";
|
|
2
2
|
import type React from "react";
|
|
3
3
|
import type { IOperator } from "./hooks";
|
|
4
4
|
import type { TypeFilter, TableProps as RcTableProps, TableColumnType as RcColumnType, EditType } from "rc-master-ui";
|
|
@@ -9,6 +9,7 @@ import type { FieldNames, FilterFunc } from "rc-select/es/Select";
|
|
|
9
9
|
import type { ColorPickerProps } from "antd";
|
|
10
10
|
export type IColumnType = "number" | "time" | "date" | "week" | "month" | "file" | "quarter" | "year" | "datetime" | "string" | "boolean" | "checkbox" | "color" | null | undefined;
|
|
11
11
|
export type AnyObject = Record<PropertyKey, any>;
|
|
12
|
+
export type Key = React.Key;
|
|
12
13
|
export type SelectMode = 'checkbox' | 'radio' | undefined;
|
|
13
14
|
export type ITextAlign = 'center' | 'left' | 'right';
|
|
14
15
|
export type Frozen = 'left' | 'right' | 'Left' | 'Right';
|
|
@@ -210,6 +211,7 @@ export type SourceFilter = {
|
|
|
210
211
|
loadOptions?: (search: string, callback: (newOptions: any[]) => void) => void;
|
|
211
212
|
};
|
|
212
213
|
export type RowSelection<RecordType> = Omit<TableRowSelection<RecordType>, 'type' | 'columnWidth' | 'hideSelectAll' | 'defaultSelectedRowKeys'>;
|
|
214
|
+
export type RowSelectMethod = 'all' | 'none' | 'invert' | 'single' | 'multiple';
|
|
213
215
|
export type SelectionSettings = Omit<TableRowSelection, 'type' | 'onChange' | 'onSelect' | 'onSelectAll' | 'onSelectNone' | 'onSelectMultiple'> & {
|
|
214
216
|
mode?: 'checkbox' | 'radio';
|
|
215
217
|
type?: 'single' | 'multiple';
|
|
@@ -158,11 +158,9 @@ const CheckboxFilter = props => {
|
|
|
158
158
|
children: node.children?.map(item => getFilterData(item)) || []
|
|
159
159
|
});
|
|
160
160
|
const onCheckAll = e => {
|
|
161
|
-
// console.log('e.target.checked', e.target.checked)
|
|
162
161
|
if (e.target.checked) {
|
|
163
162
|
const allFilterKeys = (0, _useFilter.flattenKeys)(options).map(key => String(key));
|
|
164
163
|
|
|
165
|
-
// console.log('allFilterKeys', allFilterKeys)
|
|
166
164
|
// setFilteredKeysSync(allFilterKeys);
|
|
167
165
|
onSelect?.(allFilterKeys);
|
|
168
166
|
} else {
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import type { ColumnsTable } from "./type";
|
|
3
3
|
export type IColumnsChoose<RecordType> = {
|
|
4
4
|
columns: ColumnsTable<RecordType>;
|
|
5
|
-
triggerChangeColumns?: (columns: ColumnsTable<RecordType
|
|
5
|
+
triggerChangeColumns?: (columns: ColumnsTable<RecordType>, type: string) => void;
|
|
6
6
|
t?: any;
|
|
7
7
|
};
|
|
8
8
|
export declare const ColumnsChoose: <RecordType extends object>(props: IColumnsChoose<RecordType>) => React.JSX.Element;
|
|
@@ -146,7 +146,7 @@ const ColumnsChoose = props => {
|
|
|
146
146
|
};
|
|
147
147
|
const handleAccept = () => {
|
|
148
148
|
const rs1 = (0, _hooks.updateColumns)(propsColumns, selectedKeys);
|
|
149
|
-
triggerChangeColumns?.(rs1);
|
|
149
|
+
triggerChangeColumns?.(rs1, 'columnChoose');
|
|
150
150
|
hide();
|
|
151
151
|
};
|
|
152
152
|
const handleCancel = () => {
|
|
@@ -178,8 +178,6 @@ const ColumnsChoose = props => {
|
|
|
178
178
|
checkable: true
|
|
179
179
|
// onSelect={(keys, info) => {
|
|
180
180
|
// const key = info.node.key
|
|
181
|
-
// console.log('selectedKeys', keys)
|
|
182
|
-
// console.log('info', info)
|
|
183
181
|
//
|
|
184
182
|
// const find = findItemByKey(columns, 'key', key)
|
|
185
183
|
//
|
|
@@ -194,7 +192,6 @@ const ColumnsChoose = props => {
|
|
|
194
192
|
//
|
|
195
193
|
// // const rs = [...selectedKeys, keys[0]]
|
|
196
194
|
//
|
|
197
|
-
// // console.log('rs', rs)
|
|
198
195
|
// // setSelectedKeys(keys)
|
|
199
196
|
// // }
|
|
200
197
|
// }}
|
|
@@ -13,8 +13,6 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
13
13
|
var _hooks = require("./hooks");
|
|
14
14
|
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); }
|
|
15
15
|
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; }
|
|
16
|
-
// import {getTemplate} from "../../hooks"
|
|
17
|
-
|
|
18
16
|
// import {Button} from "antd";
|
|
19
17
|
|
|
20
18
|
const TooltipStyle = _styledComponents.default.div.withConfig({
|
|
@@ -83,7 +81,7 @@ const Command = props => {
|
|
|
83
81
|
ref: refs.setFloating,
|
|
84
82
|
style: {
|
|
85
83
|
...floatingStyles,
|
|
86
|
-
zIndex:
|
|
84
|
+
zIndex: 1999
|
|
87
85
|
}
|
|
88
86
|
}, getFloatingProps()), item.tooltip)));
|
|
89
87
|
};
|
|
@@ -291,10 +291,9 @@ const InternalTable = props => {
|
|
|
291
291
|
const mergedColumns = _react.default.useMemo(() => {
|
|
292
292
|
return transformColumns(columns);
|
|
293
293
|
}, [transformColumns, columns]);
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
const triggerChangeColumns = () => {};
|
|
294
|
+
const triggerChangeColumns = newColumns => {
|
|
295
|
+
setColumns(newColumns);
|
|
296
|
+
};
|
|
298
297
|
const triggerChangeData = newData => {
|
|
299
298
|
setIsManualUpdate(true);
|
|
300
299
|
setData(newData);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import 'dayjs/locale/es';
|
|
3
3
|
import 'dayjs/locale/vi';
|
|
4
|
-
import type { GridTableProps } from "./type";
|
|
4
|
+
import type { ColumnsTable, GridTableProps } from "./type";
|
|
5
5
|
type GridProps<T> = GridTableProps<T> & {
|
|
6
|
-
triggerChangeColumns?: () => void;
|
|
6
|
+
triggerChangeColumns?: (columns: ColumnsTable<T>, type: string) => void;
|
|
7
7
|
triggerChangeData?: () => void;
|
|
8
8
|
tableRef: any;
|
|
9
9
|
getRowKey: any;
|
|
@@ -20,10 +20,23 @@ var _useColumns = require("./hooks/useColumns");
|
|
|
20
20
|
var _pagination = _interopRequireDefault(require("rc-master-ui/es/pagination"));
|
|
21
21
|
var _LoadingSpinner = _interopRequireDefault(require("./LoadingSpinner"));
|
|
22
22
|
var _ColumnsChoose = require("./ColumnsChoose");
|
|
23
|
+
var _useMergedState = _interopRequireDefault(require("rc-util/lib/hooks/useMergedState"));
|
|
23
24
|
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); }
|
|
24
25
|
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; }
|
|
26
|
+
// import type {CheckboxProps} from "rc-master-ui";
|
|
27
|
+
|
|
28
|
+
// import { conductCheck } from 'rc-tree/lib/utils/conductUtil';
|
|
29
|
+
// import { devUseWarning } from '../../_util/warning';
|
|
30
|
+
// import { arrAdd, arrDel } from 'rc-tree/lib/util';
|
|
31
|
+
|
|
25
32
|
// import {useMergedState} from "rc-util";
|
|
26
|
-
|
|
33
|
+
|
|
34
|
+
// import {convertDataToEntities} from "rc-tree/lib/utils/treeUtil";
|
|
35
|
+
// import type {DataNode} from "rc-tree/lib/interface";
|
|
36
|
+
// import {devUseWarning} from "antd/es/_util/warning";
|
|
37
|
+
// import type {GetCheckDisabled} from "rc-tree/es/interface";
|
|
38
|
+
// import useLazyKVMap from "antd/es/table/hooks/useLazyKVMap";
|
|
39
|
+
// import useMultipleSelect from "rc-master-ui/es/_util/hooks/useMultipleSelect";
|
|
27
40
|
|
|
28
41
|
const convertFilters = filters => {
|
|
29
42
|
const result = [];
|
|
@@ -91,7 +104,21 @@ const useStyle = (0, _antdStyle.createStyles)(({
|
|
|
91
104
|
});
|
|
92
105
|
// type OnChange = NonNullable<TableProps<any>['onChange']>;
|
|
93
106
|
|
|
94
|
-
|
|
107
|
+
const EMPTY_LIST = [];
|
|
108
|
+
|
|
109
|
+
// const flattenData = <RecordType extends AnyObject = AnyObject>(
|
|
110
|
+
// childrenColumnName: keyof RecordType,
|
|
111
|
+
// data?: RecordType[],
|
|
112
|
+
// ): RecordType[] => {
|
|
113
|
+
// let list: RecordType[] = [];
|
|
114
|
+
// (data || []).forEach((record) => {
|
|
115
|
+
// list.push(record);
|
|
116
|
+
// if (record && typeof record === 'object' && childrenColumnName in record) {
|
|
117
|
+
// list = [...list, ...flattenData<RecordType>(childrenColumnName, record[childrenColumnName])];
|
|
118
|
+
// }
|
|
119
|
+
// });
|
|
120
|
+
// return list;
|
|
121
|
+
// };
|
|
95
122
|
|
|
96
123
|
const TableGrid = props => {
|
|
97
124
|
const {
|
|
@@ -133,11 +160,13 @@ const TableGrid = props => {
|
|
|
133
160
|
const {
|
|
134
161
|
mode,
|
|
135
162
|
type,
|
|
136
|
-
checkboxOnly,
|
|
163
|
+
// checkboxOnly,
|
|
137
164
|
hideSelectAll,
|
|
138
165
|
columnWidth,
|
|
139
|
-
selectedRowKeys
|
|
140
|
-
|
|
166
|
+
selectedRowKeys,
|
|
167
|
+
defaultSelectedRowKeys
|
|
168
|
+
// getCheckboxProps,
|
|
169
|
+
// checkStrictly = true
|
|
141
170
|
} = selectionSettings || {};
|
|
142
171
|
const clickRef = (0, _react.useRef)(null);
|
|
143
172
|
const menuRef = (0, _react.useRef)(null);
|
|
@@ -152,26 +181,15 @@ const TableGrid = props => {
|
|
|
152
181
|
viewportHeight
|
|
153
182
|
});
|
|
154
183
|
|
|
155
|
-
// const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>(defaultSelected);
|
|
156
|
-
|
|
157
184
|
// ========================= Keys =========================
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
// Reset if rowSelection reset
|
|
168
|
-
|
|
169
|
-
// React.useEffect(() => {
|
|
170
|
-
// if (!selectionSettings) {
|
|
171
|
-
// setMergedSelectedKeys(EMPTY_LIST);
|
|
172
|
-
// }
|
|
173
|
-
// }, [!!selectionSettings]);
|
|
174
|
-
|
|
185
|
+
const [mergedSelectedKeys, setMergedSelectedKeys] = (0, _useMergedState.default)(selectedRowKeys || defaultSelectedRowKeys || EMPTY_LIST, {
|
|
186
|
+
value: selectedRowKeys
|
|
187
|
+
});
|
|
188
|
+
_react.default.useEffect(() => {
|
|
189
|
+
if (!selectionSettings) {
|
|
190
|
+
setMergedSelectedKeys(EMPTY_LIST);
|
|
191
|
+
}
|
|
192
|
+
}, [!!selectionSettings]);
|
|
175
193
|
const contextMenuItems = _react.default.useMemo(() => {
|
|
176
194
|
if (typeof contextMenuHidden === "function" && propContextMenuItems && selectedRowData) {
|
|
177
195
|
const hiddenItems = contextMenuHidden({
|
|
@@ -239,24 +257,6 @@ const TableGrid = props => {
|
|
|
239
257
|
});
|
|
240
258
|
}
|
|
241
259
|
};
|
|
242
|
-
const handleRowClick = () => () => {
|
|
243
|
-
// const key = getRowKey(record, index);
|
|
244
|
-
|
|
245
|
-
// const keySet = new Set(derivedSelectedKeySet);
|
|
246
|
-
|
|
247
|
-
// console.log('key', key)
|
|
248
|
-
|
|
249
|
-
if (checkboxOnly !== true) {
|
|
250
|
-
if (type === 'single') {}
|
|
251
|
-
}
|
|
252
|
-
if (clickRef.current) return;
|
|
253
|
-
|
|
254
|
-
// @ts-ignore
|
|
255
|
-
clickRef.current = setTimeout(() => {
|
|
256
|
-
// console.log("Single Click:", record);
|
|
257
|
-
clickRef.current = null;
|
|
258
|
-
}, 250);
|
|
259
|
-
};
|
|
260
260
|
const handleRowDoubleClick = (record, index) => e => {
|
|
261
261
|
if (clickRef.current) {
|
|
262
262
|
clearTimeout(clickRef.current);
|
|
@@ -270,7 +270,7 @@ const TableGrid = props => {
|
|
|
270
270
|
};
|
|
271
271
|
const onSelectChange = (keys, selectedRows, info, selectedRow) => {
|
|
272
272
|
if (info.type === 'all') {
|
|
273
|
-
|
|
273
|
+
setMergedSelectedKeys(keys);
|
|
274
274
|
rowSelected?.({
|
|
275
275
|
selected: selectedRows,
|
|
276
276
|
type: 'rowSelected',
|
|
@@ -278,7 +278,7 @@ const TableGrid = props => {
|
|
|
278
278
|
});
|
|
279
279
|
} else {
|
|
280
280
|
if (selectionSettings?.type === 'multiple') {
|
|
281
|
-
|
|
281
|
+
setMergedSelectedKeys(keys);
|
|
282
282
|
rowSelected?.({
|
|
283
283
|
selected: selectedRows,
|
|
284
284
|
type: 'rowSelected',
|
|
@@ -286,8 +286,7 @@ const TableGrid = props => {
|
|
|
286
286
|
});
|
|
287
287
|
} else {
|
|
288
288
|
// @ts-ignore
|
|
289
|
-
|
|
290
|
-
|
|
289
|
+
setMergedSelectedKeys(keys);
|
|
291
290
|
rowSelected?.({
|
|
292
291
|
selected: [selectedRow],
|
|
293
292
|
type: 'rowSelected',
|
|
@@ -329,7 +328,7 @@ const TableGrid = props => {
|
|
|
329
328
|
// className={styles.customTable}
|
|
330
329
|
,
|
|
331
330
|
className: (0, _classnames.default)(className, {
|
|
332
|
-
'table-none-column-select':
|
|
331
|
+
'table-none-column-select': mode === undefined && type !== 'multiple'
|
|
333
332
|
}, styles.customTable),
|
|
334
333
|
bordered: true,
|
|
335
334
|
virtual: virtual,
|
|
@@ -343,17 +342,19 @@ const TableGrid = props => {
|
|
|
343
342
|
onRow: (data, index) => {
|
|
344
343
|
return {
|
|
345
344
|
onDoubleClick: handleRowDoubleClick(data, index),
|
|
346
|
-
// onClick: handleRowClick,
|
|
347
|
-
onClick: handleRowClick(),
|
|
345
|
+
// onClick: handleRowClick(data, index),
|
|
348
346
|
onContextMenu: onContextMenu(data)
|
|
349
347
|
};
|
|
350
348
|
},
|
|
351
349
|
rowSelection: {
|
|
352
350
|
...selectionSettings,
|
|
353
|
-
type:
|
|
351
|
+
type: mode === 'checkbox' || type === 'multiple' ? 'checkbox' : "radio",
|
|
354
352
|
columnWidth: !mode ? 0.0000001 : columnWidth ?? 50,
|
|
355
353
|
onChange: onSelectChange,
|
|
356
|
-
selectedRowKeys: mode === 'checkbox' && type === 'single' ? selectedRowKeys : undefined,
|
|
354
|
+
// selectedRowKeys: mode === 'checkbox' && type === 'single' ? selectedRowKeys : undefined,
|
|
355
|
+
// selectedRowKeys: mode === 'checkbox' && type === 'single' ? mergedSelectedKeys : undefined,
|
|
356
|
+
|
|
357
|
+
selectedRowKeys: mergedSelectedKeys,
|
|
357
358
|
defaultSelectedRowKeys: selectionSettings?.defaultSelectedRowKeys,
|
|
358
359
|
preserveSelectedRowKeys: true,
|
|
359
360
|
...rowSelection,
|
|
@@ -415,7 +416,6 @@ const TableGrid = props => {
|
|
|
415
416
|
mode: 'responsive'
|
|
416
417
|
// mode={'scroll'}
|
|
417
418
|
// onClick={(val: any) => {
|
|
418
|
-
// console.log(val)
|
|
419
419
|
// }}
|
|
420
420
|
}), showColumnChoose && /*#__PURE__*/_react.default.createElement(_ColumnsChoose.ColumnsChoose, {
|
|
421
421
|
columns: columns,
|
|
@@ -423,6 +423,13 @@ const TableGrid = props => {
|
|
|
423
423
|
triggerChangeColumns: triggerChangeColumns
|
|
424
424
|
}), /*#__PURE__*/_react.default.createElement("div", null)));
|
|
425
425
|
}
|
|
426
|
+
|
|
427
|
+
// rowClassName={(record) => (selectionSettings?.getCheckboxProps(record).disabled ? "row-disabled" : "")}
|
|
428
|
+
,
|
|
429
|
+
rowClassName: record => {
|
|
430
|
+
const originalOnCell = selectionSettings?.getCheckboxProps?.(record) || {};
|
|
431
|
+
return originalOnCell.disabled ? 'row-disabled' : '';
|
|
432
|
+
}
|
|
426
433
|
}, rest)), pagination && pagination.onChange && /*#__PURE__*/_react.default.createElement(_pagination.default
|
|
427
434
|
// style={{padding: '0.75rem 1rem'}}
|
|
428
435
|
, (0, _extends2.default)({
|
|
@@ -12,6 +12,7 @@ $cell-selected-bg: #E6EFFD !default;
|
|
|
12
12
|
$cell-index-selected-bg: #0550C5 !default;
|
|
13
13
|
$cell-index-focus-bg: #CEDBEF !default;
|
|
14
14
|
$rowSelectedHoverBg: 'ui-rc' !default;
|
|
15
|
+
$boxShadowColor: rgba(5, 5, 5, 0.09) !default;
|
|
15
16
|
|
|
16
17
|
.react-hot-toast {
|
|
17
18
|
font-size: 1rem;
|
|
@@ -58,6 +59,7 @@ $rowSelectedHoverBg: 'ui-rc' !default;
|
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
.#{$prefix}-table-tbody {
|
|
62
|
+
|
|
61
63
|
.#{$prefix}-table-row {
|
|
62
64
|
&.#{$prefix}-table-row-selected {
|
|
63
65
|
> .#{$prefix}-table-cell {
|
|
@@ -65,6 +67,12 @@ $rowSelectedHoverBg: 'ui-rc' !default;
|
|
|
65
67
|
}
|
|
66
68
|
}
|
|
67
69
|
|
|
70
|
+
&.row-disabled {
|
|
71
|
+
.ui-rc-table-cell {
|
|
72
|
+
//background-color: #f5f5f5;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
68
76
|
> .#{$prefix}-table-cell {
|
|
69
77
|
&.#{$prefix}-table-cell-row-hover {
|
|
70
78
|
background: #FBDED6;
|
|
@@ -83,6 +91,7 @@ $rowSelectedHoverBg: 'ui-rc' !default;
|
|
|
83
91
|
|
|
84
92
|
}
|
|
85
93
|
}
|
|
94
|
+
|
|
86
95
|
.ui-rc-table-placeholder {
|
|
87
96
|
.ui-rc-table-cell {
|
|
88
97
|
padding-top: 0 !important;
|
|
@@ -178,7 +187,7 @@ $rowSelectedHoverBg: 'ui-rc' !default;
|
|
|
178
187
|
}
|
|
179
188
|
|
|
180
189
|
&.#{$prefix}-table-ping-right:not(.#{$prefix}-table-has-fix-right) .#{$prefix}-table-container::after {
|
|
181
|
-
box-shadow: inset -10px 0 8px -8px
|
|
190
|
+
box-shadow: inset -10px 0 8px -8px $boxShadowColor;
|
|
182
191
|
}
|
|
183
192
|
|
|
184
193
|
}
|
|
@@ -186,14 +195,14 @@ $rowSelectedHoverBg: 'ui-rc' !default;
|
|
|
186
195
|
.#{$prefix}-table-ping-left {
|
|
187
196
|
.#{$prefix}-table-cell-fix-left-first::after,
|
|
188
197
|
.#{$prefix}-table-cell-fix-left-last::after {
|
|
189
|
-
box-shadow: inset 10px 0 8px -8px
|
|
198
|
+
box-shadow: inset 10px 0 8px -8px $boxShadowColor;
|
|
190
199
|
}
|
|
191
200
|
}
|
|
192
201
|
|
|
193
202
|
.#{$prefix}-table-ping-right {
|
|
194
203
|
.#{$prefix}-table-cell-fix-right-first::after,
|
|
195
204
|
.#{$prefix}-table-cell-fix-right-last::after {
|
|
196
|
-
box-shadow: inset -10px 0 8px -8px
|
|
205
|
+
box-shadow: inset -10px 0 8px -8px $boxShadowColor;
|
|
197
206
|
}
|
|
198
207
|
}
|
|
199
208
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { ColumnsTable } from "../type";
|
|
2
3
|
import type { GridTableProps } from "../type";
|
|
3
4
|
type Props<T> = GridTableProps<T> & {
|
|
4
5
|
setColumns?: any;
|
|
5
6
|
tableRef: any;
|
|
6
7
|
getRowKey: any;
|
|
8
|
+
triggerChangeColumns?: (columns: ColumnsTable<T>, type: string) => void;
|
|
7
9
|
};
|
|
8
10
|
declare const Grid: <RecordType extends object>(props: Props<RecordType>) => React.JSX.Element;
|
|
9
11
|
export default Grid;
|
|
@@ -9,7 +9,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _GridStyle = require("../GridStyle");
|
|
11
11
|
var _TableGrid = _interopRequireDefault(require("../TableGrid"));
|
|
12
|
-
var _Command = _interopRequireDefault(require("../Command"));
|
|
13
12
|
var _useColumns = require("../hooks/useColumns");
|
|
14
13
|
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); }
|
|
15
14
|
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; }
|
|
@@ -23,6 +22,7 @@ const Grid = props => {
|
|
|
23
22
|
style,
|
|
24
23
|
format,
|
|
25
24
|
getRowKey,
|
|
25
|
+
triggerChangeColumns,
|
|
26
26
|
...rest
|
|
27
27
|
} = props;
|
|
28
28
|
const transformColumns = _react.default.useCallback(cols => {
|
|
@@ -54,21 +54,21 @@ const Grid = props => {
|
|
|
54
54
|
render: (_, __, rowIndex) => rowIndex + 1
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
57
|
+
|
|
58
|
+
// if (transformedColumn.dataIndex === "command") {
|
|
59
|
+
// return {
|
|
60
|
+
// ...transformedColumn,
|
|
61
|
+
// onCell: () => ({ className: "ui-rc-cell-command" }),
|
|
62
|
+
// render: () => (
|
|
63
|
+
// <div className="ui-rc-cell-command__content">
|
|
64
|
+
// {column.commandItems?.map((item, index) =>
|
|
65
|
+
// item.visible !== false ? <Command key={`command-${index}`} item={item} onClick={(e) => e.preventDefault()} /> : null
|
|
66
|
+
// )}
|
|
67
|
+
// </div>
|
|
68
|
+
// ),
|
|
69
|
+
// };
|
|
70
|
+
// }
|
|
71
|
+
|
|
72
72
|
return {
|
|
73
73
|
...transformedColumn,
|
|
74
74
|
render: (value, record, rowIndex) => (0, _useColumns.renderContent)(column, value, record, rowIndex, format)
|
|
@@ -92,7 +92,8 @@ const Grid = props => {
|
|
|
92
92
|
...style,
|
|
93
93
|
minHeight: height
|
|
94
94
|
},
|
|
95
|
-
getRowKey: getRowKey
|
|
95
|
+
getRowKey: getRowKey,
|
|
96
|
+
triggerChangeColumns: triggerChangeColumns
|
|
96
97
|
}))));
|
|
97
98
|
};
|
|
98
99
|
var _default = exports.default = Grid;
|
|
@@ -2,10 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import 'dayjs/locale/es';
|
|
3
3
|
import 'dayjs/locale/vi';
|
|
4
4
|
import type { TableEditProps } from "../type";
|
|
5
|
+
import type { ColumnsTable } from "../type";
|
|
5
6
|
import type { GetRowKey } from "../type";
|
|
6
7
|
type Props<RecordType> = TableEditProps<RecordType> & {
|
|
7
8
|
tableRef: any;
|
|
8
|
-
triggerChangeColumns?: () => void;
|
|
9
|
+
triggerChangeColumns?: (columns: ColumnsTable<RecordType>, type: string) => void;
|
|
9
10
|
triggerChangeData?: (newData: RecordType[], type: string) => void;
|
|
10
11
|
getRowKey: GetRowKey<RecordType>;
|
|
11
12
|
};
|
|
@@ -149,10 +149,6 @@ const GridEdit = props => {
|
|
|
149
149
|
newSelectedCells.add(`${r}-${c}`);
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
|
|
153
|
-
// console.log('newSelectedCells', newSelectedCells)
|
|
154
|
-
// setSelectedCells(newSelectedCells)
|
|
155
|
-
|
|
156
152
|
setSelectedCells(new Set(newSelectedCells));
|
|
157
153
|
// forceUpdate();
|
|
158
154
|
setUpdateKey(prev => prev + 1); // Cập nhật key để trigger re-render
|
|
@@ -330,7 +326,6 @@ const GridEdit = props => {
|
|
|
330
326
|
// }
|
|
331
327
|
};
|
|
332
328
|
const onSubmit = formData => {
|
|
333
|
-
console.log('onSubmit', formData);
|
|
334
329
|
try {
|
|
335
330
|
// const record = (await form.validateFields()) as RecordType;
|
|
336
331
|
const row = {
|
|
@@ -384,8 +379,6 @@ const GridEdit = props => {
|
|
|
384
379
|
option,
|
|
385
380
|
field
|
|
386
381
|
} = args;
|
|
387
|
-
|
|
388
|
-
// console.log('newState', newState)
|
|
389
382
|
//
|
|
390
383
|
// console.log('getValues()', getValues())
|
|
391
384
|
|
|
@@ -409,7 +402,6 @@ const GridEdit = props => {
|
|
|
409
402
|
};
|
|
410
403
|
if (onCellChange) {
|
|
411
404
|
if (onCellChange.length > 1) {
|
|
412
|
-
console.log('onCellChange Callback');
|
|
413
405
|
onCellChange({
|
|
414
406
|
field,
|
|
415
407
|
indexCol: 1,
|
|
@@ -423,7 +415,6 @@ const GridEdit = props => {
|
|
|
423
415
|
sumValue: []
|
|
424
416
|
}, handleChangeCallback);
|
|
425
417
|
} else {
|
|
426
|
-
console.log('onCellChange');
|
|
427
418
|
onCellChange({
|
|
428
419
|
field,
|
|
429
420
|
indexCol: 1,
|
|
@@ -442,7 +433,6 @@ const GridEdit = props => {
|
|
|
442
433
|
console.log('aaaaaa blur');
|
|
443
434
|
}
|
|
444
435
|
if (prevState && newState && prevState !== newState && type === 'enter') {
|
|
445
|
-
console.log('enter');
|
|
446
436
|
onSubmit(record);
|
|
447
437
|
}
|
|
448
438
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReactElement, ReactNode } from "react";
|
|
2
2
|
import type React from "react";
|
|
3
3
|
import type { IOperator } from "./hooks";
|
|
4
4
|
import type { TypeFilter, TableProps as RcTableProps, TableColumnType as RcColumnType, EditType } from "rc-master-ui";
|
|
@@ -9,6 +9,7 @@ import type { FieldNames, FilterFunc } from "rc-select/es/Select";
|
|
|
9
9
|
import type { ColorPickerProps } from "antd";
|
|
10
10
|
export type IColumnType = "number" | "time" | "date" | "week" | "month" | "file" | "quarter" | "year" | "datetime" | "string" | "boolean" | "checkbox" | "color" | null | undefined;
|
|
11
11
|
export type AnyObject = Record<PropertyKey, any>;
|
|
12
|
+
export type Key = React.Key;
|
|
12
13
|
export type SelectMode = 'checkbox' | 'radio' | undefined;
|
|
13
14
|
export type ITextAlign = 'center' | 'left' | 'right';
|
|
14
15
|
export type Frozen = 'left' | 'right' | 'Left' | 'Right';
|
|
@@ -210,6 +211,7 @@ export type SourceFilter = {
|
|
|
210
211
|
loadOptions?: (search: string, callback: (newOptions: any[]) => void) => void;
|
|
211
212
|
};
|
|
212
213
|
export type RowSelection<RecordType> = Omit<TableRowSelection<RecordType>, 'type' | 'columnWidth' | 'hideSelectAll' | 'defaultSelectedRowKeys'>;
|
|
214
|
+
export type RowSelectMethod = 'all' | 'none' | 'invert' | 'single' | 'multiple';
|
|
213
215
|
export type SelectionSettings = Omit<TableRowSelection, 'type' | 'onChange' | 'onSelect' | 'onSelectAll' | 'onSelectNone' | 'onSelectMultiple'> & {
|
|
214
216
|
mode?: 'checkbox' | 'radio';
|
|
215
217
|
type?: 'single' | 'multiple';
|
package/package.json
CHANGED
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "es-grid-template",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "es-grid-template",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"react",
|
|
7
|
-
"react-component",
|
|
8
|
-
"grid",
|
|
9
|
-
"table"
|
|
10
|
-
],
|
|
11
|
-
"license": "MIT",
|
|
12
|
-
"main": "lib/index",
|
|
13
|
-
"module": "es/index",
|
|
14
|
-
"files": [
|
|
15
|
-
"lib",
|
|
16
|
-
"es",
|
|
17
|
-
"assets/*.css",
|
|
18
|
-
"assets/*.less"
|
|
19
|
-
],
|
|
20
|
-
"scripts": {
|
|
21
|
-
"compile": "father build",
|
|
22
|
-
"docs:build": "dumi build",
|
|
23
|
-
"__docs:deploy": "gh-pages -d dist",
|
|
24
|
-
"lint": "eslint src/ --ext .tsx,.ts,.jsx,.js",
|
|
25
|
-
"now-build": "npm run docs:build",
|
|
26
|
-
"prepare": "dumi setup",
|
|
27
|
-
"prepublishOnly": "npm run compile",
|
|
28
|
-
"postpublish": "npm run docs:build",
|
|
29
|
-
"__postpublish": "npm run docs:build && npm run docs:deploy",
|
|
30
|
-
"start": "dumi dev",
|
|
31
|
-
"test": "vitest --watch false",
|
|
32
|
-
"coverage": "vitest run --coverage"
|
|
33
|
-
},
|
|
34
|
-
"dependencies": {
|
|
35
|
-
"@ant-design/colors": "^8.0.0",
|
|
36
|
-
"@ant-design/cssinjs": "^1.22.0",
|
|
37
|
-
"@ant-design/cssinjs-utils": "^1.1.1",
|
|
38
|
-
"@ant-design/icons": "^5.5.2",
|
|
39
|
-
"@babel/runtime": "^7.11.2",
|
|
40
|
-
"@core-rc/rc-select": "^0.0.8",
|
|
41
|
-
"@ctrl/tinycolor": "^3.6.1",
|
|
42
|
-
"@faker-js/faker": "^9.5.0",
|
|
43
|
-
"@floating-ui/react": "^0.27.5",
|
|
44
|
-
"@rc-component/color-picker": "^2.0.1",
|
|
45
|
-
"@rc-component/father-plugin": "^2.0.1",
|
|
46
|
-
"@rc-component/trigger": "^2.0.0",
|
|
47
|
-
"@rc-component/util": "^1.0.1",
|
|
48
|
-
"@types/react-resizable": "^3.0.8",
|
|
49
|
-
"@types/styled-components": "^5.1.34",
|
|
50
|
-
"@vitest/coverage-v8": "^2.0.5",
|
|
51
|
-
"antd": "^5.24.1",
|
|
52
|
-
"antd-style": "^3.7.1",
|
|
53
|
-
"becoxy-icons": "^1.9.9",
|
|
54
|
-
"classnames": "^2.3.1",
|
|
55
|
-
"dayjs": "^1.11.13",
|
|
56
|
-
"lodash": "^4.17.21",
|
|
57
|
-
"moment": "^2.30.1",
|
|
58
|
-
"postcss": "^8.4.35",
|
|
59
|
-
"rc-checkbox": "^3.5.0",
|
|
60
|
-
"rc-dropdown": "^4.2.1",
|
|
61
|
-
"rc-field-form": "^2.6.0",
|
|
62
|
-
"rc-master-ui": "^1.1.
|
|
63
|
-
"rc-select": "^14.16.3",
|
|
64
|
-
"rc-tooltip": "^6.3.0",
|
|
65
|
-
"rc-tree": "^5.10.1",
|
|
66
|
-
"rc-tree-select": "^5.24.5",
|
|
67
|
-
"react-hook-form": "^7.54.2",
|
|
68
|
-
"react-hot-toast": "^2.5.2",
|
|
69
|
-
"react-numeric-component": "^1.0.7",
|
|
70
|
-
"react-resizable": "^3.0.5",
|
|
71
|
-
"sass": "^1.81.0",
|
|
72
|
-
"styled-components": "^6.1.15",
|
|
73
|
-
"throttle-debounce": "^5.0.2",
|
|
74
|
-
"vitest": "^2.0.5"
|
|
75
|
-
},
|
|
76
|
-
"devDependencies": {
|
|
77
|
-
"@babel/cli": "^7.26.4",
|
|
78
|
-
"@babel/preset-env": "^7.26.9",
|
|
79
|
-
"@rc-component/np": "^1.0.3",
|
|
80
|
-
"@testing-library/react": "^14.0.0",
|
|
81
|
-
"@types/jest": "^29.4.0",
|
|
82
|
-
"@types/react": "^18.0.26",
|
|
83
|
-
"@types/react-dom": "^18.0.10",
|
|
84
|
-
"@types/warning": "^3.0.0",
|
|
85
|
-
"cross-env": "^7.0.0",
|
|
86
|
-
"dumi": "^2.2.13",
|
|
87
|
-
"eslint": "^8.56.0",
|
|
88
|
-
"eslint-plugin-unicorn": "^55.0.0",
|
|
89
|
-
"father": "^4.0.0",
|
|
90
|
-
"gh-pages": "^3.1.0",
|
|
91
|
-
"less": "^4.1.1",
|
|
92
|
-
"np": "^7.1.0",
|
|
93
|
-
"rc-test": "^7.0.9",
|
|
94
|
-
"react": "^18.2.0",
|
|
95
|
-
"react-dom": "^18.2.0",
|
|
96
|
-
"typescript": "^4.0.5"
|
|
97
|
-
},
|
|
98
|
-
"peerDependencies": {
|
|
99
|
-
"react": ">=16.9.0",
|
|
100
|
-
"react-dom": ">=16.9.0"
|
|
101
|
-
}
|
|
102
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "es-grid-template",
|
|
3
|
+
"version": "1.1.4",
|
|
4
|
+
"description": "es-grid-template",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"react-component",
|
|
8
|
+
"grid",
|
|
9
|
+
"table"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"main": "lib/index",
|
|
13
|
+
"module": "es/index",
|
|
14
|
+
"files": [
|
|
15
|
+
"lib",
|
|
16
|
+
"es",
|
|
17
|
+
"assets/*.css",
|
|
18
|
+
"assets/*.less"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"compile": "father build",
|
|
22
|
+
"docs:build": "dumi build",
|
|
23
|
+
"__docs:deploy": "gh-pages -d dist",
|
|
24
|
+
"lint": "eslint src/ --ext .tsx,.ts,.jsx,.js",
|
|
25
|
+
"now-build": "npm run docs:build",
|
|
26
|
+
"prepare": "dumi setup",
|
|
27
|
+
"prepublishOnly": "npm run compile",
|
|
28
|
+
"postpublish": "npm run docs:build",
|
|
29
|
+
"__postpublish": "npm run docs:build && npm run docs:deploy",
|
|
30
|
+
"start": "dumi dev",
|
|
31
|
+
"test": "vitest --watch false",
|
|
32
|
+
"coverage": "vitest run --coverage"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@ant-design/colors": "^8.0.0",
|
|
36
|
+
"@ant-design/cssinjs": "^1.22.0",
|
|
37
|
+
"@ant-design/cssinjs-utils": "^1.1.1",
|
|
38
|
+
"@ant-design/icons": "^5.5.2",
|
|
39
|
+
"@babel/runtime": "^7.11.2",
|
|
40
|
+
"@core-rc/rc-select": "^0.0.8",
|
|
41
|
+
"@ctrl/tinycolor": "^3.6.1",
|
|
42
|
+
"@faker-js/faker": "^9.5.0",
|
|
43
|
+
"@floating-ui/react": "^0.27.5",
|
|
44
|
+
"@rc-component/color-picker": "^2.0.1",
|
|
45
|
+
"@rc-component/father-plugin": "^2.0.1",
|
|
46
|
+
"@rc-component/trigger": "^2.0.0",
|
|
47
|
+
"@rc-component/util": "^1.0.1",
|
|
48
|
+
"@types/react-resizable": "^3.0.8",
|
|
49
|
+
"@types/styled-components": "^5.1.34",
|
|
50
|
+
"@vitest/coverage-v8": "^2.0.5",
|
|
51
|
+
"antd": "^5.24.1",
|
|
52
|
+
"antd-style": "^3.7.1",
|
|
53
|
+
"becoxy-icons": "^1.9.9",
|
|
54
|
+
"classnames": "^2.3.1",
|
|
55
|
+
"dayjs": "^1.11.13",
|
|
56
|
+
"lodash": "^4.17.21",
|
|
57
|
+
"moment": "^2.30.1",
|
|
58
|
+
"postcss": "^8.4.35",
|
|
59
|
+
"rc-checkbox": "^3.5.0",
|
|
60
|
+
"rc-dropdown": "^4.2.1",
|
|
61
|
+
"rc-field-form": "^2.6.0",
|
|
62
|
+
"rc-master-ui": "^1.1.1",
|
|
63
|
+
"rc-select": "^14.16.3",
|
|
64
|
+
"rc-tooltip": "^6.3.0",
|
|
65
|
+
"rc-tree": "^5.10.1",
|
|
66
|
+
"rc-tree-select": "^5.24.5",
|
|
67
|
+
"react-hook-form": "^7.54.2",
|
|
68
|
+
"react-hot-toast": "^2.5.2",
|
|
69
|
+
"react-numeric-component": "^1.0.7",
|
|
70
|
+
"react-resizable": "^3.0.5",
|
|
71
|
+
"sass": "^1.81.0",
|
|
72
|
+
"styled-components": "^6.1.15",
|
|
73
|
+
"throttle-debounce": "^5.0.2",
|
|
74
|
+
"vitest": "^2.0.5"
|
|
75
|
+
},
|
|
76
|
+
"devDependencies": {
|
|
77
|
+
"@babel/cli": "^7.26.4",
|
|
78
|
+
"@babel/preset-env": "^7.26.9",
|
|
79
|
+
"@rc-component/np": "^1.0.3",
|
|
80
|
+
"@testing-library/react": "^14.0.0",
|
|
81
|
+
"@types/jest": "^29.4.0",
|
|
82
|
+
"@types/react": "^18.0.26",
|
|
83
|
+
"@types/react-dom": "^18.0.10",
|
|
84
|
+
"@types/warning": "^3.0.0",
|
|
85
|
+
"cross-env": "^7.0.0",
|
|
86
|
+
"dumi": "^2.2.13",
|
|
87
|
+
"eslint": "^8.56.0",
|
|
88
|
+
"eslint-plugin-unicorn": "^55.0.0",
|
|
89
|
+
"father": "^4.0.0",
|
|
90
|
+
"gh-pages": "^3.1.0",
|
|
91
|
+
"less": "^4.1.1",
|
|
92
|
+
"np": "^7.1.0",
|
|
93
|
+
"rc-test": "^7.0.9",
|
|
94
|
+
"react": "^18.2.0",
|
|
95
|
+
"react-dom": "^18.2.0",
|
|
96
|
+
"typescript": "^4.0.5"
|
|
97
|
+
},
|
|
98
|
+
"peerDependencies": {
|
|
99
|
+
"react": ">=16.9.0",
|
|
100
|
+
"react-dom": ">=16.9.0"
|
|
101
|
+
}
|
|
102
|
+
}
|