react-table-edit 1.4.35 → 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.
@@ -30,6 +30,7 @@ type Props = {
30
30
  onCloseMenu?: () => void;
31
31
  footerComponent?: () => JSX.Element;
32
32
  onChange: (val: any) => void;
33
+ compareFunction?: (row?: any) => boolean | undefined;
33
34
  };
34
35
  declare const SelectTable: React.ForwardRefExoticComponent<Props & React.RefAttributes<unknown>>;
35
36
  export { SelectTable };
@@ -1,4 +1,4 @@
1
- import { IColumnTable } from '../type';
1
+ import { IColumnTable } from "../type";
2
2
  export interface IFPropsDetail {
3
3
  column: IColumnTable[];
4
4
  setColumn: any;
@@ -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
- import { Dispatch, ReactNode, SetStateAction, JSX } from "react";
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 = 'center' | 'left' | 'right';
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 = '#' | 'command' | 'text' | 'numeric' | 'datetime' | 'date' | 'checkbox' | 'select' | 'form' | 'formInline' | 'color' | 'selectTree';
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 = 'text' | 'numeric' | 'date' | 'select';
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: 'left' | 'right' | 'center';
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?: 'label-small' | 'label-medium' | 'label-large';
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 */
@@ -104,6 +104,8 @@ export type ISettingSelectElement = {
104
104
  loadOptions?: (keyword: string, callback: (rs: any[]) => void) => void;
105
105
  /** Sự kiện mở menu */
106
106
  onOpenMenu?: (row: any, col: IColumnTable, indexRow: number) => void;
107
+ /** Tuỳ chỉnh xác định hàng được chọn */
108
+ compareFunction?: (rowOption?: any, rowData?: any) => boolean;
107
109
  };
108
110
  /** Cấu hình cho kiểu số */
109
111
  export type ISettingNumericElement = {
@@ -142,14 +144,12 @@ export type IColumnTable = {
142
144
  editEnable?: boolean;
143
145
  /** Có hiển thị không */
144
146
  visible?: boolean;
145
- /** Không cho phép thay đổi trạng thái ẩn/hiện */
146
- invisibleDisable?: boolean;
147
147
  /** Kiểu chỉnh sửa */
148
148
  type?: IColumnType;
149
149
  /** Căn lề */
150
150
  textAlign?: ITextAlign;
151
151
  /** Cố định trái/phải */
152
- fixedType?: 'left' | 'right' | undefined;
152
+ fixedType?: "left" | "right" | undefined;
153
153
  /** Danh sách thao tác */
154
154
  commandItems?: ICommandItem[];
155
155
  /** Placeholder trong ô input */
@@ -302,7 +302,7 @@ export type IHeaderColumnTable = {
302
302
  /** Cho phép lọc cột */
303
303
  allowFilter?: boolean;
304
304
  /** Cố định trái/phải */
305
- fixedType?: 'left' | 'right' | undefined;
305
+ fixedType?: "left" | "right" | undefined;
306
306
  /** Cấu hình cho kiểu numeric */
307
307
  numericSettings?: ISettingNumericElement;
308
308
  /** Kiểu chỉnh sửa */
@@ -318,9 +318,9 @@ export type IFColumnSelectTable = {
318
318
  /** Cờ cho phép hiển thị hoặc ẩn cột (mặc định là true) */
319
319
  visible?: boolean;
320
320
  /** Căn lề nội dung trong cột: trái, phải, giữa */
321
- textAlign?: 'left' | 'right' | 'center';
321
+ textAlign?: "left" | "right" | "center";
322
322
  /** Loại dữ liệu của cột: văn bản, số, ngày, ngày giờ */
323
- type?: 'text' | 'numeric' | 'date' | 'datetime';
323
+ type?: "text" | "numeric" | "date" | "datetime";
324
324
  /** Template tùy chỉnh nội dung hiển thị trong ô */
325
325
  template?: any;
326
326
  /** Điều kiện thay đổi kiểu dữ liệu của cột */
@@ -356,7 +356,7 @@ export type FromItemsField = {
356
356
  /** Nhãn hiển thị cho trường dữ liệu */
357
357
  label: string;
358
358
  /** Loại trường dữ liệu: văn bản, số, chọn, chọn có thể tạo mới */
359
- type: 'text' | 'numeric' | 'select' | 'selectCreatable';
359
+ type: "text" | "numeric" | "select" | "selectCreatable";
360
360
  /** Trường có bị disable hay không (không cho chỉnh sửa) */
361
361
  disabled?: boolean;
362
362
  /** Số chữ số sau dấu phẩy (chỉ áp dụng với loại 'numeric') */
@@ -376,11 +376,11 @@ export type IColumnsAgg = {
376
376
  };
377
377
  export type IFOrderTable = {
378
378
  key: string;
379
- direction: 'asc' | 'desc';
379
+ direction: "asc" | "desc";
380
380
  };
381
381
  export type IFFilterTable = {
382
382
  key: string;
383
383
  value: any;
384
- ope: 'startswith' | 'endswith' | 'contains' | 'equal' | 'notequal' | 'greaterthan' | 'greaterthanorequal' | 'lessthan' | 'lessthanorequal';
384
+ ope: "startswith" | "endswith" | "contains" | "equal" | "notequal" | "greaterthan" | "greaterthanorequal" | "lessthan" | "lessthanorequal";
385
385
  };
386
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 = 'center' | 'left' | 'right';
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 = '#' | 'command' | 'text' | 'numeric' | 'datetime' | 'date' | 'checkbox' | 'select' | 'form' | 'formInline' | 'color' | 'selectTree';
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 = 'text' | 'numeric' | 'date' | 'select';
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: 'left' | 'right' | 'center';
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?: 'label-small' | 'label-medium' | 'label-large';
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 */
@@ -108,6 +108,8 @@ type ISettingSelectElement = {
108
108
  loadOptions?: (keyword: string, callback: (rs: any[]) => void) => void;
109
109
  /** Sự kiện mở menu */
110
110
  onOpenMenu?: (row: any, col: IColumnTable, indexRow: number) => void;
111
+ /** Tuỳ chỉnh xác định hàng được chọn */
112
+ compareFunction?: (rowOption?: any, rowData?: any) => boolean;
111
113
  };
112
114
  /** Cấu hình cho kiểu số */
113
115
  type ISettingNumericElement = {
@@ -146,14 +148,12 @@ type IColumnTable = {
146
148
  editEnable?: boolean;
147
149
  /** Có hiển thị không */
148
150
  visible?: boolean;
149
- /** Không cho phép thay đổi trạng thái ẩn/hiện */
150
- invisibleDisable?: boolean;
151
151
  /** Kiểu chỉnh sửa */
152
152
  type?: IColumnType;
153
153
  /** Căn lề */
154
154
  textAlign?: ITextAlign;
155
155
  /** Cố định trái/phải */
156
- fixedType?: 'left' | 'right' | undefined;
156
+ fixedType?: "left" | "right" | undefined;
157
157
  /** Danh sách thao tác */
158
158
  commandItems?: ICommandItem[];
159
159
  /** Placeholder trong ô input */
@@ -306,7 +306,7 @@ type IHeaderColumnTable = {
306
306
  /** Cho phép lọc cột */
307
307
  allowFilter?: boolean;
308
308
  /** Cố định trái/phải */
309
- fixedType?: 'left' | 'right' | undefined;
309
+ fixedType?: "left" | "right" | undefined;
310
310
  /** Cấu hình cho kiểu numeric */
311
311
  numericSettings?: ISettingNumericElement;
312
312
  /** Kiểu chỉnh sửa */
@@ -322,9 +322,9 @@ type IFColumnSelectTable = {
322
322
  /** Cờ cho phép hiển thị hoặc ẩn cột (mặc định là true) */
323
323
  visible?: boolean;
324
324
  /** Căn lề nội dung trong cột: trái, phải, giữa */
325
- textAlign?: 'left' | 'right' | 'center';
325
+ textAlign?: "left" | "right" | "center";
326
326
  /** Loại dữ liệu của cột: văn bản, số, ngày, ngày giờ */
327
- type?: 'text' | 'numeric' | 'date' | 'datetime';
327
+ type?: "text" | "numeric" | "date" | "datetime";
328
328
  /** Template tùy chỉnh nội dung hiển thị trong ô */
329
329
  template?: any;
330
330
  /** Điều kiện thay đổi kiểu dữ liệu của cột */
@@ -360,7 +360,7 @@ type FromItemsField = {
360
360
  /** Nhãn hiển thị cho trường dữ liệu */
361
361
  label: string;
362
362
  /** Loại trường dữ liệu: văn bản, số, chọn, chọn có thể tạo mới */
363
- type: 'text' | 'numeric' | 'select' | 'selectCreatable';
363
+ type: "text" | "numeric" | "select" | "selectCreatable";
364
364
  /** Trường có bị disable hay không (không cho chỉnh sửa) */
365
365
  disabled?: boolean;
366
366
  /** Số chữ số sau dấu phẩy (chỉ áp dụng với loại 'numeric') */
@@ -380,12 +380,12 @@ type IColumnsAgg = {
380
380
  };
381
381
  type IFOrderTable = {
382
382
  key: string;
383
- direction: 'asc' | 'desc';
383
+ direction: "asc" | "desc";
384
384
  };
385
385
  type IFFilterTable = {
386
386
  key: string;
387
387
  value: any;
388
- ope: 'startswith' | 'endswith' | 'contains' | 'equal' | 'notequal' | 'greaterthan' | 'greaterthanorequal' | 'lessthan' | 'lessthanorequal';
388
+ ope: "startswith" | "endswith" | "contains" | "equal" | "notequal" | "greaterthan" | "greaterthanorequal" | "lessthan" | "lessthanorequal";
389
389
  };
390
390
 
391
391
  type IFTableEditProps = {
@@ -420,6 +420,13 @@ type IFTableEditProps = {
420
420
  dataSourceChange?: (data: any[]) => void;
421
421
  rowChange?: (row: any, indexRow: number, field: string) => void;
422
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;
423
430
  };
424
431
  type IFRef = {
425
432
  refeshFocusRow: any;
@@ -530,6 +537,7 @@ type Props$1 = {
530
537
  onCloseMenu?: () => void;
531
538
  footerComponent?: () => JSX.Element;
532
539
  onChange: (val: any) => void;
540
+ compareFunction?: (row?: any) => boolean | undefined;
533
541
  };
534
542
  declare const SelectTable: React__default.ForwardRefExoticComponent<Props$1 & React__default.RefAttributes<unknown>>;
535
543