react-table-edit 1.4.36 → 1.4.37
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/sidebar-setting-column/index.d.ts +1 -1
- package/dist/component/table/index.d.ts +7 -0
- package/dist/component/type/index.d.ts +12 -14
- package/dist/index.d.ts +19 -14
- package/dist/index.js +329 -281
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +329 -281
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -32,6 +32,13 @@ export type IFTableEditProps = {
|
|
|
32
32
|
dataSourceChange?: (data: any[]) => void;
|
|
33
33
|
rowChange?: (row: any, indexRow: number, field: string) => void;
|
|
34
34
|
onDuplicate?: (newData: any, index: number) => void;
|
|
35
|
+
saveSettingColumn?: (data: {
|
|
36
|
+
field: string;
|
|
37
|
+
headerText?: string;
|
|
38
|
+
visible?: boolean;
|
|
39
|
+
fixedType?: "left" | "right";
|
|
40
|
+
width?: number | string;
|
|
41
|
+
}[]) => void;
|
|
35
42
|
};
|
|
36
43
|
type IFRef = {
|
|
37
44
|
refeshFocusRow: any;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Dispatch, JSX, ReactNode, SetStateAction } from "react";
|
|
2
2
|
import { UseFormGetValues, UseFormReset, UseFormSetValue } from "react-hook-form";
|
|
3
3
|
/** Căn lề văn bản trong bảng */
|
|
4
|
-
type ITextAlign =
|
|
4
|
+
type ITextAlign = "center" | "left" | "right";
|
|
5
5
|
/**
|
|
6
6
|
* Loại cột hiển thị trong hệ thống.
|
|
7
7
|
*
|
|
8
8
|
* Lưu ý:
|
|
9
9
|
* - Các loại 'text', 'numeric', 'datetime' không được dùng cho view.
|
|
10
10
|
*/
|
|
11
|
-
type IColumnType =
|
|
11
|
+
type IColumnType = "#" | "command" | "text" | "numeric" | "datetime" | "date" | "checkbox" | "select" | "form" | "formInline" | "color" | "selectTree";
|
|
12
12
|
/** Loại lọc của cột */
|
|
13
|
-
type IFilterType =
|
|
13
|
+
type IFilterType = "text" | "numeric" | "date" | "select";
|
|
14
14
|
/** Cấu hình thao tác trên cột */
|
|
15
15
|
export type ICommandItem = {
|
|
16
16
|
/** ID thao tác */
|
|
@@ -27,7 +27,7 @@ export type ICommandItem = {
|
|
|
27
27
|
/** Cấu hình thanh công cụ (toolbar) */
|
|
28
28
|
export type IFToolbarOptions = {
|
|
29
29
|
/** Vị trí hiển thị (trái, phải, giữa) */
|
|
30
|
-
align:
|
|
30
|
+
align: "left" | "right" | "center";
|
|
31
31
|
/** Template toolbar */
|
|
32
32
|
template: any;
|
|
33
33
|
};
|
|
@@ -36,7 +36,7 @@ export type ISettingFormElement = {
|
|
|
36
36
|
/** Schema định nghĩa cấu trúc form */
|
|
37
37
|
schema: any;
|
|
38
38
|
/** Kích thước nhãn */
|
|
39
|
-
labelSize?:
|
|
39
|
+
labelSize?: "label-small" | "label-medium" | "label-large";
|
|
40
40
|
/** Chiều rộng popup form */
|
|
41
41
|
menuWidth?: number;
|
|
42
42
|
/** Chiều cao popup form */
|
|
@@ -144,14 +144,12 @@ export type IColumnTable = {
|
|
|
144
144
|
editEnable?: boolean;
|
|
145
145
|
/** Có hiển thị không */
|
|
146
146
|
visible?: boolean;
|
|
147
|
-
/** Không cho phép thay đổi trạng thái ẩn/hiện */
|
|
148
|
-
invisibleDisable?: boolean;
|
|
149
147
|
/** Kiểu chỉnh sửa */
|
|
150
148
|
type?: IColumnType;
|
|
151
149
|
/** Căn lề */
|
|
152
150
|
textAlign?: ITextAlign;
|
|
153
151
|
/** Cố định trái/phải */
|
|
154
|
-
fixedType?:
|
|
152
|
+
fixedType?: "left" | "right" | undefined;
|
|
155
153
|
/** Danh sách thao tác */
|
|
156
154
|
commandItems?: ICommandItem[];
|
|
157
155
|
/** Placeholder trong ô input */
|
|
@@ -304,7 +302,7 @@ export type IHeaderColumnTable = {
|
|
|
304
302
|
/** Cho phép lọc cột */
|
|
305
303
|
allowFilter?: boolean;
|
|
306
304
|
/** Cố định trái/phải */
|
|
307
|
-
fixedType?:
|
|
305
|
+
fixedType?: "left" | "right" | undefined;
|
|
308
306
|
/** Cấu hình cho kiểu numeric */
|
|
309
307
|
numericSettings?: ISettingNumericElement;
|
|
310
308
|
/** Kiểu chỉnh sửa */
|
|
@@ -320,9 +318,9 @@ export type IFColumnSelectTable = {
|
|
|
320
318
|
/** Cờ cho phép hiển thị hoặc ẩn cột (mặc định là true) */
|
|
321
319
|
visible?: boolean;
|
|
322
320
|
/** Căn lề nội dung trong cột: trái, phải, giữa */
|
|
323
|
-
textAlign?:
|
|
321
|
+
textAlign?: "left" | "right" | "center";
|
|
324
322
|
/** Loại dữ liệu của cột: văn bản, số, ngày, ngày giờ */
|
|
325
|
-
type?:
|
|
323
|
+
type?: "text" | "numeric" | "date" | "datetime";
|
|
326
324
|
/** Template tùy chỉnh nội dung hiển thị trong ô */
|
|
327
325
|
template?: any;
|
|
328
326
|
/** Điều kiện thay đổi kiểu dữ liệu của cột */
|
|
@@ -358,7 +356,7 @@ export type FromItemsField = {
|
|
|
358
356
|
/** Nhãn hiển thị cho trường dữ liệu */
|
|
359
357
|
label: string;
|
|
360
358
|
/** Loại trường dữ liệu: văn bản, số, chọn, chọn có thể tạo mới */
|
|
361
|
-
type:
|
|
359
|
+
type: "text" | "numeric" | "select" | "selectCreatable";
|
|
362
360
|
/** Trường có bị disable hay không (không cho chỉnh sửa) */
|
|
363
361
|
disabled?: boolean;
|
|
364
362
|
/** Số chữ số sau dấu phẩy (chỉ áp dụng với loại 'numeric') */
|
|
@@ -378,11 +376,11 @@ export type IColumnsAgg = {
|
|
|
378
376
|
};
|
|
379
377
|
export type IFOrderTable = {
|
|
380
378
|
key: string;
|
|
381
|
-
direction:
|
|
379
|
+
direction: "asc" | "desc";
|
|
382
380
|
};
|
|
383
381
|
export type IFFilterTable = {
|
|
384
382
|
key: string;
|
|
385
383
|
value: any;
|
|
386
|
-
ope:
|
|
384
|
+
ope: "startswith" | "endswith" | "contains" | "equal" | "notequal" | "greaterthan" | "greaterthanorequal" | "lessthan" | "lessthanorequal";
|
|
387
385
|
};
|
|
388
386
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -5,16 +5,16 @@ import { TFunction } from 'react-i18next';
|
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
7
|
/** Căn lề văn bản trong bảng */
|
|
8
|
-
type ITextAlign =
|
|
8
|
+
type ITextAlign = "center" | "left" | "right";
|
|
9
9
|
/**
|
|
10
10
|
* Loại cột hiển thị trong hệ thống.
|
|
11
11
|
*
|
|
12
12
|
* Lưu ý:
|
|
13
13
|
* - Các loại 'text', 'numeric', 'datetime' không được dùng cho view.
|
|
14
14
|
*/
|
|
15
|
-
type IColumnType =
|
|
15
|
+
type IColumnType = "#" | "command" | "text" | "numeric" | "datetime" | "date" | "checkbox" | "select" | "form" | "formInline" | "color" | "selectTree";
|
|
16
16
|
/** Loại lọc của cột */
|
|
17
|
-
type IFilterType =
|
|
17
|
+
type IFilterType = "text" | "numeric" | "date" | "select";
|
|
18
18
|
/** Cấu hình thao tác trên cột */
|
|
19
19
|
type ICommandItem = {
|
|
20
20
|
/** ID thao tác */
|
|
@@ -31,7 +31,7 @@ type ICommandItem = {
|
|
|
31
31
|
/** Cấu hình thanh công cụ (toolbar) */
|
|
32
32
|
type IFToolbarOptions = {
|
|
33
33
|
/** Vị trí hiển thị (trái, phải, giữa) */
|
|
34
|
-
align:
|
|
34
|
+
align: "left" | "right" | "center";
|
|
35
35
|
/** Template toolbar */
|
|
36
36
|
template: any;
|
|
37
37
|
};
|
|
@@ -40,7 +40,7 @@ type ISettingFormElement = {
|
|
|
40
40
|
/** Schema định nghĩa cấu trúc form */
|
|
41
41
|
schema: any;
|
|
42
42
|
/** Kích thước nhãn */
|
|
43
|
-
labelSize?:
|
|
43
|
+
labelSize?: "label-small" | "label-medium" | "label-large";
|
|
44
44
|
/** Chiều rộng popup form */
|
|
45
45
|
menuWidth?: number;
|
|
46
46
|
/** Chiều cao popup form */
|
|
@@ -148,14 +148,12 @@ type IColumnTable = {
|
|
|
148
148
|
editEnable?: boolean;
|
|
149
149
|
/** Có hiển thị không */
|
|
150
150
|
visible?: boolean;
|
|
151
|
-
/** Không cho phép thay đổi trạng thái ẩn/hiện */
|
|
152
|
-
invisibleDisable?: boolean;
|
|
153
151
|
/** Kiểu chỉnh sửa */
|
|
154
152
|
type?: IColumnType;
|
|
155
153
|
/** Căn lề */
|
|
156
154
|
textAlign?: ITextAlign;
|
|
157
155
|
/** Cố định trái/phải */
|
|
158
|
-
fixedType?:
|
|
156
|
+
fixedType?: "left" | "right" | undefined;
|
|
159
157
|
/** Danh sách thao tác */
|
|
160
158
|
commandItems?: ICommandItem[];
|
|
161
159
|
/** Placeholder trong ô input */
|
|
@@ -308,7 +306,7 @@ type IHeaderColumnTable = {
|
|
|
308
306
|
/** Cho phép lọc cột */
|
|
309
307
|
allowFilter?: boolean;
|
|
310
308
|
/** Cố định trái/phải */
|
|
311
|
-
fixedType?:
|
|
309
|
+
fixedType?: "left" | "right" | undefined;
|
|
312
310
|
/** Cấu hình cho kiểu numeric */
|
|
313
311
|
numericSettings?: ISettingNumericElement;
|
|
314
312
|
/** Kiểu chỉnh sửa */
|
|
@@ -324,9 +322,9 @@ type IFColumnSelectTable = {
|
|
|
324
322
|
/** Cờ cho phép hiển thị hoặc ẩn cột (mặc định là true) */
|
|
325
323
|
visible?: boolean;
|
|
326
324
|
/** Căn lề nội dung trong cột: trái, phải, giữa */
|
|
327
|
-
textAlign?:
|
|
325
|
+
textAlign?: "left" | "right" | "center";
|
|
328
326
|
/** Loại dữ liệu của cột: văn bản, số, ngày, ngày giờ */
|
|
329
|
-
type?:
|
|
327
|
+
type?: "text" | "numeric" | "date" | "datetime";
|
|
330
328
|
/** Template tùy chỉnh nội dung hiển thị trong ô */
|
|
331
329
|
template?: any;
|
|
332
330
|
/** Điều kiện thay đổi kiểu dữ liệu của cột */
|
|
@@ -362,7 +360,7 @@ type FromItemsField = {
|
|
|
362
360
|
/** Nhãn hiển thị cho trường dữ liệu */
|
|
363
361
|
label: string;
|
|
364
362
|
/** Loại trường dữ liệu: văn bản, số, chọn, chọn có thể tạo mới */
|
|
365
|
-
type:
|
|
363
|
+
type: "text" | "numeric" | "select" | "selectCreatable";
|
|
366
364
|
/** Trường có bị disable hay không (không cho chỉnh sửa) */
|
|
367
365
|
disabled?: boolean;
|
|
368
366
|
/** Số chữ số sau dấu phẩy (chỉ áp dụng với loại 'numeric') */
|
|
@@ -382,12 +380,12 @@ type IColumnsAgg = {
|
|
|
382
380
|
};
|
|
383
381
|
type IFOrderTable = {
|
|
384
382
|
key: string;
|
|
385
|
-
direction:
|
|
383
|
+
direction: "asc" | "desc";
|
|
386
384
|
};
|
|
387
385
|
type IFFilterTable = {
|
|
388
386
|
key: string;
|
|
389
387
|
value: any;
|
|
390
|
-
ope:
|
|
388
|
+
ope: "startswith" | "endswith" | "contains" | "equal" | "notequal" | "greaterthan" | "greaterthanorequal" | "lessthan" | "lessthanorequal";
|
|
391
389
|
};
|
|
392
390
|
|
|
393
391
|
type IFTableEditProps = {
|
|
@@ -422,6 +420,13 @@ type IFTableEditProps = {
|
|
|
422
420
|
dataSourceChange?: (data: any[]) => void;
|
|
423
421
|
rowChange?: (row: any, indexRow: number, field: string) => void;
|
|
424
422
|
onDuplicate?: (newData: any, index: number) => void;
|
|
423
|
+
saveSettingColumn?: (data: {
|
|
424
|
+
field: string;
|
|
425
|
+
headerText?: string;
|
|
426
|
+
visible?: boolean;
|
|
427
|
+
fixedType?: "left" | "right";
|
|
428
|
+
width?: number | string;
|
|
429
|
+
}[]) => void;
|
|
425
430
|
};
|
|
426
431
|
type IFRef = {
|
|
427
432
|
refeshFocusRow: any;
|