react-table-edit 1.4.57 → 1.5.0
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 +2 -1
- package/dist/component/modal-import-excel/type.d.ts +3 -0
- package/dist/component/table/cell-content.d.ts +1 -1
- package/dist/component/table/cell.d.ts +1 -1
- package/dist/component/table/index.d.ts +6 -1
- package/dist/component/table/setting-column.d.ts +8 -1
- package/dist/component/type/index.d.ts +2 -0
- package/dist/index.d.ts +12 -2
- package/dist/index.js +1097 -200
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1096 -200
- package/dist/index.mjs.map +1 -1
- package/dist/styles/index.css +107 -48
- package/dist/styles/index.css.map +1 -1
- package/dist/styles/sidebar.css +14 -0
- package/dist/styles/sidebar.css.map +1 -1
- package/package.json +7 -4
|
@@ -30,8 +30,9 @@ type IFProps = {
|
|
|
30
30
|
* @param item Dòng dữ liệu hiện tại
|
|
31
31
|
* @param ele Cấu hình mapping của cột
|
|
32
32
|
* @param value Giá trị trong cell
|
|
33
|
+
* @returns boolean: nếu trả ra true thì giá trị cho trường thì sẽ không được thiết lập lại
|
|
33
34
|
*/
|
|
34
|
-
handleValidate?: (item: any, ele: IFDataMapExcel, value: string) =>
|
|
35
|
+
handleValidate?: (item: any, ele: IFDataMapExcel, value: string) => boolean | undefined;
|
|
35
36
|
/**
|
|
36
37
|
* API import Excel
|
|
37
38
|
* @param params Tham số gửi lên server
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
1
2
|
export interface IFDataExcel {
|
|
2
3
|
step: number;
|
|
3
4
|
file?: any;
|
|
@@ -22,6 +23,8 @@ export interface IFDataMapExcel {
|
|
|
22
23
|
isRequired?: boolean;
|
|
23
24
|
/** Độ rộng cột (pixel hoặc đơn vị tùy theo UI) */
|
|
24
25
|
width?: number;
|
|
26
|
+
/** Template hiển thị */
|
|
27
|
+
template?: (row: any, indexRow: number) => JSX.Element | string | number | undefined;
|
|
25
28
|
}
|
|
26
29
|
export type IFNumberFormat = {
|
|
27
30
|
dateFormat?: string;
|
|
@@ -12,7 +12,7 @@ interface CellContentComponentProps {
|
|
|
12
12
|
typeDis: "edit" | "template" | "data";
|
|
13
13
|
displayValue: string | number | boolean | null | undefined;
|
|
14
14
|
content: any;
|
|
15
|
-
focusEditElementCell: (e: KeyboardEvent<any> | React.MouseEvent<HTMLDivElement, MouseEvent>, row: number, rol: number) => void;
|
|
15
|
+
focusEditElementCell: (e: KeyboardEvent<any> | React.MouseEvent<HTMLDivElement, MouseEvent>, row: number, rol: number, isOpenDropDown?: boolean) => void;
|
|
16
16
|
handleKeyDown: (e: React.KeyboardEvent<HTMLDivElement>, row: any) => void;
|
|
17
17
|
handleDataChange: (row: any, col: IColumnTable, indexRow: number) => void;
|
|
18
18
|
handleMouseDown: (e: React.MouseEvent, type: 1 | 2, isDragHandler?: boolean) => void;
|
|
@@ -46,7 +46,7 @@ interface CellComponentProps {
|
|
|
46
46
|
} | undefined>>;
|
|
47
47
|
setStartCell: Dispatch<SetStateAction<ICellInfo>>;
|
|
48
48
|
handeCopyCell: (indexColCopy: number, indexRowCopy: number, maxRowPaste: number) => Promise<void>;
|
|
49
|
-
focusEditElementCell: (e: KeyboardEvent<any> | React.MouseEvent<HTMLDivElement, MouseEvent>, row: number, rol: number) => void;
|
|
49
|
+
focusEditElementCell: (e: KeyboardEvent<any> | React.MouseEvent<HTMLDivElement, MouseEvent>, row: number, rol: number, isOpenDropDown?: boolean) => void;
|
|
50
50
|
rowChange?: (row: any, indexRow: number, field: string) => void;
|
|
51
51
|
handleDataChange: (row: any, col: IColumnTable, indexRow: number) => void;
|
|
52
52
|
changeDataSource: (data: any[]) => void;
|
|
@@ -24,7 +24,12 @@ export type IFTableEditProps = {
|
|
|
24
24
|
allowFilter?: boolean;
|
|
25
25
|
allowOrder?: boolean;
|
|
26
26
|
optionsFilter?: any;
|
|
27
|
-
settingColumns?:
|
|
27
|
+
settingColumns?: {
|
|
28
|
+
id?: string;
|
|
29
|
+
updatedDate?: Date;
|
|
30
|
+
updatedByName?: string;
|
|
31
|
+
value: IFSettingColumns[];
|
|
32
|
+
};
|
|
28
33
|
setSelectedItem?: Dispatch<SetStateAction<any>>;
|
|
29
34
|
commandClick?: (data: any) => void;
|
|
30
35
|
handleSelect?: (data: any) => void;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import { IColumnTable } from "../type";
|
|
1
|
+
import { IColumnTable, IFSettingColumns } from "../type";
|
|
2
2
|
export interface IFPropsDetail {
|
|
3
|
+
gridRef: any;
|
|
3
4
|
column: IColumnTable[];
|
|
4
5
|
setColumn: any;
|
|
5
6
|
openSidebar: boolean;
|
|
7
|
+
settingColumns?: {
|
|
8
|
+
id?: string;
|
|
9
|
+
updatedDate?: Date;
|
|
10
|
+
updatedByName?: string;
|
|
11
|
+
value: IFSettingColumns[];
|
|
12
|
+
};
|
|
6
13
|
handleSidebar: any;
|
|
7
14
|
resetDefaultColumns?: () => void;
|
|
8
15
|
formatSetting?: any;
|
|
@@ -49,6 +49,8 @@ export type IFSettingColumns = {
|
|
|
49
49
|
fixedType?: "left" | "right";
|
|
50
50
|
/** Chiều rộng cột */
|
|
51
51
|
width?: number | string;
|
|
52
|
+
/** Sắp xếp */
|
|
53
|
+
sortOrder: number;
|
|
52
54
|
};
|
|
53
55
|
/** Cấu hình phần tử form khi dùng loại cột `form` */
|
|
54
56
|
export type ISettingFormElement = {
|
package/dist/index.d.ts
CHANGED
|
@@ -53,6 +53,8 @@ type IFSettingColumns = {
|
|
|
53
53
|
fixedType?: "left" | "right";
|
|
54
54
|
/** Chiều rộng cột */
|
|
55
55
|
width?: number | string;
|
|
56
|
+
/** Sắp xếp */
|
|
57
|
+
sortOrder: number;
|
|
56
58
|
};
|
|
57
59
|
/** Cấu hình phần tử form khi dùng loại cột `form` */
|
|
58
60
|
type ISettingFormElement = {
|
|
@@ -435,7 +437,12 @@ type IFTableEditProps = {
|
|
|
435
437
|
allowFilter?: boolean;
|
|
436
438
|
allowOrder?: boolean;
|
|
437
439
|
optionsFilter?: any;
|
|
438
|
-
settingColumns?:
|
|
440
|
+
settingColumns?: {
|
|
441
|
+
id?: string;
|
|
442
|
+
updatedDate?: Date;
|
|
443
|
+
updatedByName?: string;
|
|
444
|
+
value: IFSettingColumns[];
|
|
445
|
+
};
|
|
439
446
|
setSelectedItem?: Dispatch<SetStateAction<any>>;
|
|
440
447
|
commandClick?: (data: any) => void;
|
|
441
448
|
handleSelect?: (data: any) => void;
|
|
@@ -502,6 +509,8 @@ interface IFDataMapExcel {
|
|
|
502
509
|
isRequired?: boolean;
|
|
503
510
|
/** Độ rộng cột (pixel hoặc đơn vị tùy theo UI) */
|
|
504
511
|
width?: number;
|
|
512
|
+
/** Template hiển thị */
|
|
513
|
+
template?: (row: any, indexRow: number) => JSX.Element | string | number | undefined;
|
|
505
514
|
}
|
|
506
515
|
type IFNumberFormat = {
|
|
507
516
|
dateFormat?: string;
|
|
@@ -542,8 +551,9 @@ type IFProps$1 = {
|
|
|
542
551
|
* @param item Dòng dữ liệu hiện tại
|
|
543
552
|
* @param ele Cấu hình mapping của cột
|
|
544
553
|
* @param value Giá trị trong cell
|
|
554
|
+
* @returns boolean: nếu trả ra true thì giá trị cho trường thì sẽ không được thiết lập lại
|
|
545
555
|
*/
|
|
546
|
-
handleValidate?: (item: any, ele: IFDataMapExcel, value: string) =>
|
|
556
|
+
handleValidate?: (item: any, ele: IFDataMapExcel, value: string) => boolean | undefined;
|
|
547
557
|
/**
|
|
548
558
|
* API import Excel
|
|
549
559
|
* @param params Tham số gửi lên server
|