react-table-edit 1.5.0 → 1.5.1
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/dist/component/modal-import-excel/index.d.ts +0 -4
- package/dist/component/modal-import-excel/tab-handle-error.d.ts +0 -2
- package/dist/component/modal-import-excel/tab-validate.d.ts +0 -2
- package/dist/component/table/button-handle.d.ts +5 -9
- package/dist/component/table/cell.d.ts +1 -1
- package/dist/component/table/data-table.d.ts +12 -7
- package/dist/component/table/index.d.ts +2 -3
- package/dist/component/table/key-handlers.d.ts +1 -3
- package/dist/component/table-view/content.d.ts +1 -1
- package/dist/component/type/index.d.ts +0 -2
- package/dist/component/utils.d.ts +5 -1
- package/dist/index.d.ts +7 -10
- package/dist/index.js +253 -291
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +253 -292
- package/dist/index.mjs.map +1 -1
- package/dist/styles/index.css +11 -2
- package/dist/styles/index.css.map +1 -1
- package/package.json +2 -2
|
@@ -9,12 +9,8 @@ type IFProps = {
|
|
|
9
9
|
handleModal: () => void;
|
|
10
10
|
/** Hàm format số (tuỳ chọn) */
|
|
11
11
|
formatNumber?: IFNumberFormat;
|
|
12
|
-
/** Danh sách các lựa chọn số trang (ví dụ [10, 20, 50]) */
|
|
13
|
-
pageOptions: number[];
|
|
14
12
|
/** Số hàng tiêu đề mặc định */
|
|
15
13
|
defaultHeaderRow?: number;
|
|
16
|
-
/** Số bản ghi mặc định trên một trang */
|
|
17
|
-
pageSizeDefault: number;
|
|
18
14
|
/** Cấu hình mapping cột giữa file Excel và dữ liệu trong hệ thống */
|
|
19
15
|
mapColumn: IFDataMapExcel[];
|
|
20
16
|
/** Cấu hình header bảng validate (tuỳ chọn) */
|
|
@@ -6,8 +6,6 @@ export interface IFPropsDetail {
|
|
|
6
6
|
windowSize: any;
|
|
7
7
|
headerValidateExcelColumns: any[];
|
|
8
8
|
formatNumber?: IFNumberFormat;
|
|
9
|
-
pageOptions?: number[];
|
|
10
|
-
pageSizeDefault?: number;
|
|
11
9
|
}
|
|
12
10
|
declare const TabValidateImportExcel: (props: IFPropsDetail) => import("react/jsx-runtime").JSX.Element;
|
|
13
11
|
export default TabValidateImportExcel;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { IFTableEditButton,
|
|
2
|
-
export declare const handleAdd: (dataSource: any[],
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare const handleDuplicate: (dataSource: any[], indexFocus: number, fieldKey: string | undefined, defaultValue: any, fieldUniKey: string[], changeDataSource: (data: any[]) => void, tableElement: any, totalCount: number, toolbarSetting?: IFTableEditToolbar, buttonSetting?: IFTableEditButton, editDisable?: boolean, addDisable?: boolean, onDuplicate?: (newData: any, index: number) => void, // sự kiện khi duplicate
|
|
7
|
-
pagingClient?: boolean, pagingSetting?: IFTableEditPaging) => Promise<void>;
|
|
8
|
-
export declare const handleInsertAfter: (dataSource: any[], indexFocus: number, defaultValue: any, changeDataSource: (data: any[]) => void, tableElement: any, totalCount: number, pagingClient?: boolean, pagingSetting?: IFTableEditPaging, toolbarSetting?: IFTableEditToolbar, buttonSetting?: IFTableEditButton, editDisable?: boolean, addDisable?: boolean) => void;
|
|
9
|
-
export declare const handleInsertBefore: (dataSource: any[], indexFocus: number, defaultValue: any, changeDataSource: (data: any[]) => void, pagingClient?: boolean, pagingSetting?: IFTableEditPaging, toolbarSetting?: IFTableEditToolbar, buttonSetting?: IFTableEditButton, editDisable?: boolean, addDisable?: boolean) => void;
|
|
1
|
+
import { IFTableEditButton, IFTableEditToolbar } from "../type";
|
|
2
|
+
export declare const handleAdd: (dataSource: any[], containerRef: any, indexFirstEdit: number, changeDataSource: (data: any[], numberOfRows?: number) => void, handleFocusCell: (row?: number, col?: number) => void, numberOfRows?: number) => void;
|
|
3
|
+
export declare const handleDuplicate: (dataSource: any[], indexFocus: number, fieldKey: string | undefined, defaultValue: any, fieldUniKey: string[], changeDataSource: (data: any[]) => void, containerRef: any, totalCount: number, toolbarSetting?: IFTableEditToolbar, buttonSetting?: IFTableEditButton, editDisable?: boolean, addDisable?: boolean, onDuplicate?: (newData: any, index: number) => void) => Promise<void>;
|
|
4
|
+
export declare const handleInsertAfter: (dataSource: any[], indexFocus: number, defaultValue: any, changeDataSource: (data: any[]) => void, containerRef: any, totalCount: number, toolbarSetting?: IFTableEditToolbar, buttonSetting?: IFTableEditButton, editDisable?: boolean, addDisable?: boolean) => void;
|
|
5
|
+
export declare const handleInsertBefore: (dataSource: any[], indexFocus: number, defaultValue: any, changeDataSource: (data: any[]) => void, toolbarSetting?: IFTableEditToolbar, buttonSetting?: IFTableEditButton, editDisable?: boolean, addDisable?: boolean) => void;
|
|
10
6
|
export declare const handleDeleteAll: (t: any, messageBoxConfirmDelete: (t: any, callback: () => void, message: string) => void, handleFocusCell: (row?: number, col?: number) => void, changeDataSource: (data: any[]) => void, editDisable?: boolean, addDisable?: boolean, toolbarSetting?: IFTableEditToolbar, buttonSetting?: IFTableEditButton) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { Dispatch, MutableRefObject, SetStateAction } from "react";
|
|
2
|
-
import { ICellInfo, IColumnTable, IFFilterTable, IFOrderTable, IFTableEditButton, IFTableEditFormat,
|
|
2
|
+
import { ICellInfo, IColumnTable, IFFilterTable, IFOrderTable, IFTableEditButton, IFTableEditFormat, IFTableEditToolbar, IHeaderColumnTable } from "../type";
|
|
3
3
|
interface TableComponentProps {
|
|
4
4
|
idTable?: string;
|
|
5
5
|
dataSource: any[];
|
|
@@ -33,7 +33,7 @@ interface TableComponentProps {
|
|
|
33
33
|
formatSetting?: IFTableEditFormat;
|
|
34
34
|
toolbarSetting?: IFTableEditToolbar;
|
|
35
35
|
buttonSetting?: IFTableEditButton;
|
|
36
|
-
|
|
36
|
+
containerRef: any;
|
|
37
37
|
isCopying: MutableRefObject<boolean>;
|
|
38
38
|
typeDragging: MutableRefObject<number>;
|
|
39
39
|
visibleContentColumns: IColumnTable[];
|
|
@@ -44,9 +44,10 @@ interface TableComponentProps {
|
|
|
44
44
|
allowOrder?: boolean;
|
|
45
45
|
searchSetting?: any;
|
|
46
46
|
searchTerm?: string;
|
|
47
|
-
pagingClient?: boolean;
|
|
48
|
-
pagingSetting?: IFTableEditPaging;
|
|
49
47
|
haveSum?: boolean;
|
|
48
|
+
height: number;
|
|
49
|
+
rowHeight: number;
|
|
50
|
+
searchClient?: boolean;
|
|
50
51
|
rowChange?: (row: any, indexRow: number, field: string) => void;
|
|
51
52
|
setSelectedRows: Dispatch<SetStateAction<any[]>>;
|
|
52
53
|
setContentColumns: (col: any[]) => void;
|
|
@@ -56,12 +57,16 @@ interface TableComponentProps {
|
|
|
56
57
|
handleDuplicate: () => void;
|
|
57
58
|
handleKeyDown: (e: React.KeyboardEvent<HTMLDivElement>, row: any) => void;
|
|
58
59
|
onDuplicate?: ((newData: any, index: number) => void);
|
|
59
|
-
setSelectedCell:
|
|
60
|
-
|
|
60
|
+
setSelectedCell: Dispatch<SetStateAction<{
|
|
61
|
+
minRow: number;
|
|
62
|
+
maxRow: number;
|
|
63
|
+
minCol: number;
|
|
64
|
+
maxCol: number;
|
|
65
|
+
} | undefined>>;
|
|
66
|
+
setStartCell: Dispatch<SetStateAction<ICellInfo>>;
|
|
61
67
|
focusEditElementCell: (e: any, row: number, col: number) => void;
|
|
62
68
|
setFilterBy: (val: any[]) => void;
|
|
63
69
|
setOrderBy: (val: any[]) => void;
|
|
64
|
-
checkRowMatch: (row: any, filterBy: any[], searchTerm: string, keyField: string[]) => boolean;
|
|
65
70
|
handeCopyCell: (indexColCopy: number, indexRowCopy: number, maxRowPaste: number) => Promise<void>;
|
|
66
71
|
}
|
|
67
72
|
declare const TableComponent: React.FC<TableComponentProps>;
|
|
@@ -7,15 +7,13 @@ export type IFTableEditProps = {
|
|
|
7
7
|
defaultValue?: any;
|
|
8
8
|
columns: IColumnTable[];
|
|
9
9
|
height?: number;
|
|
10
|
-
|
|
11
|
-
minHeight?: number;
|
|
10
|
+
rowHeight?: number;
|
|
12
11
|
isMulti?: boolean;
|
|
13
12
|
editDisable?: boolean;
|
|
14
13
|
addDisable?: boolean;
|
|
15
14
|
haveSum?: boolean;
|
|
16
15
|
disableAutoKey?: boolean;
|
|
17
16
|
formatSetting?: IFTableEditFormat;
|
|
18
|
-
pagingSetting?: IFTableEditPaging;
|
|
19
17
|
buttonSetting?: IFTableEditButton;
|
|
20
18
|
toolbarSetting?: IFTableEditToolbar;
|
|
21
19
|
searchSetting?: IFTableEditSearchSetting;
|
|
@@ -30,6 +28,7 @@ export type IFTableEditProps = {
|
|
|
30
28
|
updatedByName?: string;
|
|
31
29
|
value: IFSettingColumns[];
|
|
32
30
|
};
|
|
31
|
+
pagingSetting?: IFTableEditPaging;
|
|
33
32
|
setSelectedItem?: Dispatch<SetStateAction<any>>;
|
|
34
33
|
commandClick?: (data: any) => void;
|
|
35
34
|
handleSelect?: (data: any) => void;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { KeyboardEvent } from "react";
|
|
2
|
-
import { ICellInfo, IColumnTable
|
|
2
|
+
import { ICellInfo, IColumnTable } from "../type";
|
|
3
3
|
export interface KeyHandlerParams {
|
|
4
4
|
row: any;
|
|
5
5
|
startCell: ICellInfo;
|
|
6
6
|
contentColumns: IColumnTable[];
|
|
7
|
-
pagingClient?: boolean;
|
|
8
7
|
totalCount: number;
|
|
9
8
|
indexLastEdit: number;
|
|
10
9
|
editDisable?: boolean;
|
|
11
10
|
addDisable?: boolean;
|
|
12
|
-
pagingSetting?: IFTableEditPaging;
|
|
13
11
|
handleDuplicate: () => void;
|
|
14
12
|
handleAdd: () => void;
|
|
15
13
|
addMoveNewCell: () => void;
|
|
@@ -18,5 +18,5 @@ type IContentColProps = {
|
|
|
18
18
|
setSelectedRows: (value: any[]) => void;
|
|
19
19
|
handleCommandClick: (id: string, rowData: any, index: number) => void;
|
|
20
20
|
};
|
|
21
|
-
export declare const RenderContentCol: (props: IContentColProps) =>
|
|
21
|
+
export declare const RenderContentCol: (props: IContentColProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
export {};
|
|
@@ -214,8 +214,6 @@ export type IColumnTable = {
|
|
|
214
214
|
export type IFTableEditPaging = {
|
|
215
215
|
/** Bật phân trang */
|
|
216
216
|
allowPaging?: boolean;
|
|
217
|
-
/** Phân trang phía client */
|
|
218
|
-
pagingClient?: boolean;
|
|
219
217
|
/** Trang hiện tại */
|
|
220
218
|
currentPage?: number;
|
|
221
219
|
/** Hàm cập nhật trang hiện tại */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IFSettingColumns } from "./type";
|
|
1
|
+
import { IFFilterTable, IFSettingColumns } from "./type";
|
|
2
2
|
export declare const useOnClickOutside: (ref: any, handler: any) => void;
|
|
3
3
|
export declare const checkThousandSeparator: (thousandSeparator: any, decimalSeparator: any) => any;
|
|
4
4
|
export declare const checkDecimalSeparator: (thousandSeparator: any, decimalSeparator: any) => any;
|
|
@@ -52,3 +52,7 @@ export declare const calculateTableStructure: (columns: any[], settingColumns?:
|
|
|
52
52
|
indexFirstEdit: number;
|
|
53
53
|
indexLastEdit: number;
|
|
54
54
|
};
|
|
55
|
+
/**
|
|
56
|
+
* Kiểm tra row có thỏa mãn tất cả filter và chứa từ khóa tìm kiếm hay không
|
|
57
|
+
*/
|
|
58
|
+
export declare const CheckRowMatch: (row: Record<string, any>, filters: IFFilterTable[], keyword: string, searchKeys: string[]) => boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -218,8 +218,6 @@ type IColumnTable = {
|
|
|
218
218
|
type IFTableEditPaging = {
|
|
219
219
|
/** Bật phân trang */
|
|
220
220
|
allowPaging?: boolean;
|
|
221
|
-
/** Phân trang phía client */
|
|
222
|
-
pagingClient?: boolean;
|
|
223
221
|
/** Trang hiện tại */
|
|
224
222
|
currentPage?: number;
|
|
225
223
|
/** Hàm cập nhật trang hiện tại */
|
|
@@ -420,15 +418,13 @@ type IFTableEditProps = {
|
|
|
420
418
|
defaultValue?: any;
|
|
421
419
|
columns: IColumnTable[];
|
|
422
420
|
height?: number;
|
|
423
|
-
|
|
424
|
-
minHeight?: number;
|
|
421
|
+
rowHeight?: number;
|
|
425
422
|
isMulti?: boolean;
|
|
426
423
|
editDisable?: boolean;
|
|
427
424
|
addDisable?: boolean;
|
|
428
425
|
haveSum?: boolean;
|
|
429
426
|
disableAutoKey?: boolean;
|
|
430
427
|
formatSetting?: IFTableEditFormat;
|
|
431
|
-
pagingSetting?: IFTableEditPaging;
|
|
432
428
|
buttonSetting?: IFTableEditButton;
|
|
433
429
|
toolbarSetting?: IFTableEditToolbar;
|
|
434
430
|
searchSetting?: IFTableEditSearchSetting;
|
|
@@ -443,6 +439,7 @@ type IFTableEditProps = {
|
|
|
443
439
|
updatedByName?: string;
|
|
444
440
|
value: IFSettingColumns[];
|
|
445
441
|
};
|
|
442
|
+
pagingSetting?: IFTableEditPaging;
|
|
446
443
|
setSelectedItem?: Dispatch<SetStateAction<any>>;
|
|
447
444
|
commandClick?: (data: any) => void;
|
|
448
445
|
handleSelect?: (data: any) => void;
|
|
@@ -530,12 +527,8 @@ type IFProps$1 = {
|
|
|
530
527
|
handleModal: () => void;
|
|
531
528
|
/** Hàm format số (tuỳ chọn) */
|
|
532
529
|
formatNumber?: IFNumberFormat;
|
|
533
|
-
/** Danh sách các lựa chọn số trang (ví dụ [10, 20, 50]) */
|
|
534
|
-
pageOptions: number[];
|
|
535
530
|
/** Số hàng tiêu đề mặc định */
|
|
536
531
|
defaultHeaderRow?: number;
|
|
537
|
-
/** Số bản ghi mặc định trên một trang */
|
|
538
|
-
pageSizeDefault: number;
|
|
539
532
|
/** Cấu hình mapping cột giữa file Excel và dữ liệu trong hệ thống */
|
|
540
533
|
mapColumn: IFDataMapExcel[];
|
|
541
534
|
/** Cấu hình header bảng validate (tuỳ chọn) */
|
|
@@ -771,6 +764,10 @@ declare const calculateTableStructure: (columns: any[], settingColumns?: IFSetti
|
|
|
771
764
|
indexFirstEdit: number;
|
|
772
765
|
indexLastEdit: number;
|
|
773
766
|
};
|
|
767
|
+
/**
|
|
768
|
+
* Kiểm tra row có thỏa mãn tất cả filter và chứa từ khóa tìm kiếm hay không
|
|
769
|
+
*/
|
|
770
|
+
declare const CheckRowMatch: (row: Record<string, any>, filters: IFFilterTable[], keyword: string, searchKeys: string[]) => boolean;
|
|
774
771
|
|
|
775
772
|
type IFSteps = {
|
|
776
773
|
id: string;
|
|
@@ -798,5 +795,5 @@ type IFProps = {
|
|
|
798
795
|
};
|
|
799
796
|
declare const Wizard: React.ForwardRefExoticComponent<IFProps & React.RefAttributes<unknown>>;
|
|
800
797
|
|
|
801
|
-
export { ExportExcelComponent, FindNodeByPath, InputStyleComponent, ModalImportComponent, SelectTable, SelectTableTree, TableView, TabsMenuComponent, Wizard, calculateTableStructure, checkDecimalSeparator, checkThousandSeparator, TableEdit as default, formartNumberic, formatDateTime, generateUUID, isNullOrUndefined, messageBoxConfirm, messageBoxConfirmAsync, messageBoxConfirmDelete, messageBoxError, messageHtmlBoxConfirm, messageHtmlBoxConfirmAsync, messageHtmlBoxError, notificationError, notificationSuccess, roundNumber, useOnClickOutside };
|
|
798
|
+
export { CheckRowMatch, ExportExcelComponent, FindNodeByPath, InputStyleComponent, ModalImportComponent, SelectTable, SelectTableTree, TableView, TabsMenuComponent, Wizard, calculateTableStructure, checkDecimalSeparator, checkThousandSeparator, TableEdit as default, formartNumberic, formatDateTime, generateUUID, isNullOrUndefined, messageBoxConfirm, messageBoxConfirmAsync, messageBoxConfirmDelete, messageBoxError, messageHtmlBoxConfirm, messageHtmlBoxConfirmAsync, messageHtmlBoxError, notificationError, notificationSuccess, roundNumber, useOnClickOutside };
|
|
802
799
|
export type { FromItemsField, ICellInfo, IColumnTable, IColumnType, IColumnsAgg, ICommandItem, IFColumnSelectTable, IFColumnSelectTableTree, IFCurrentPage, IFCurrentPageConfig, IFFilterTable, IFOrderTable, IFPageSize, IFSettingColumns, IFTableEditButton, IFTableEditFormat, IFTableEditPaging, IFTableEditSearchSetting, IFTableEditToolbar, IFTableSelectFormat, IFTableTreeSelectFormat, IFToolbarOptions, IHeaderColumnTable, ISettingFormElement, ISettingNumericElement, ISettingSelectElement };
|