react-table-edit 1.3.9 → 1.4.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.
@@ -0,0 +1,10 @@
1
+ type IFDataProps = {
2
+ onChangePage?: any;
3
+ onChangePageSize?: any;
4
+ pageOptions: number[];
5
+ currentPage: number;
6
+ pageSize: number;
7
+ totalItem: number;
8
+ };
9
+ declare const PagingComponent: ({ totalItem, pageSize, currentPage, onChangePage, pageOptions, onChangePageSize }: IFDataProps) => import("react/jsx-runtime").JSX.Element;
10
+ export { PagingComponent };
@@ -1,4 +1,4 @@
1
- import { IColumnTable } from '../table';
1
+ import { IColumnTable } from '../type';
2
2
  export interface IFPropsDetail {
3
3
  column: IColumnTable[];
4
4
  setColumn: any;
@@ -1,9 +1,10 @@
1
- import { IFTableEditButton, IFTableEditPaging, IFTableEditToolbar } from ".";
1
+ import { IFTableEditButton, IFTableEditPaging, IFTableEditToolbar } from "../type";
2
2
  export declare const handleAdd: (dataSource: any[], tableElement: any, columnFistEdit: any, changeDataSource: (data: any[], haveNew?: boolean) => void, pagingSetting: {
3
3
  setCurrentPage?: (page: number) => void;
4
4
  pageSize?: number;
5
- } | undefined, setItemFocus: (item: string) => void, focusNewElement: (column: any, value: string, index: number, onLoad: boolean) => void) => void;
6
- export declare const handleDuplicate: (dataSource: any[], itemFocus: string, 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) => Promise<void>;
7
- export declare const handleInsertAfter: (dataSource: any[], itemFocus: string, defaultValue: any, changeDataSource: (data: any[]) => void, tableElement: any, totalCount: number, pagingClient?: boolean, pagingSetting?: IFTableEditPaging, toolbarSetting?: IFTableEditToolbar, buttonSetting?: IFTableEditButton, editDisable?: boolean, addDisable?: boolean) => void;
8
- export declare const handleInsertBefore: (dataSource: any[], itemFocus: string, defaultValue: any, changeDataSource: (data: any[]) => void, pagingClient?: boolean, pagingSetting?: IFTableEditPaging, toolbarSetting?: IFTableEditToolbar, buttonSetting?: IFTableEditButton, editDisable?: boolean, addDisable?: boolean) => void;
9
- export declare const handleDeleteAll: (t: any, messageBoxConfirmDelete: (t: any, callback: () => void, message: string) => void, setItemFocus: (item: string) => void, changeDataSource: (data: any[], haveNew?: boolean) => void, editDisable?: boolean, addDisable?: boolean, toolbarSetting?: IFTableEditToolbar, buttonSetting?: IFTableEditButton) => void;
5
+ } | undefined, setIndexFocus: (item: number) => void, focusNewElement: (col: number, row: number, onLoad?: boolean) => void) => void;
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;
10
+ export declare const handleDeleteAll: (t: any, messageBoxConfirmDelete: (t: any, callback: () => void, message: string) => void, setIndexFocus: (item: number) => void, changeDataSource: (data: any[], haveNew?: boolean) => void, editDisable?: boolean, addDisable?: boolean, toolbarSetting?: IFTableEditToolbar, buttonSetting?: IFTableEditButton) => void;
@@ -1,12 +1,11 @@
1
1
  import { Dispatch, SetStateAction } from 'react';
2
- import { ICommandItem } from '.';
2
+ import { ICommandItem } from '../type';
3
3
  type IFDataProps = {
4
4
  commandItems: ICommandItem[];
5
5
  rowData: any;
6
6
  indexRow: number;
7
- currentItem: string;
8
- itemFocus?: string;
9
- setItemFocus: Dispatch<SetStateAction<string>>;
7
+ indexFocus?: number;
8
+ setIndexFocus: Dispatch<SetStateAction<number>>;
10
9
  handleCommandClick: any;
11
10
  };
12
11
  declare const CommandElement: (props: IFDataProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { IColumnTable, IFTableEditFormat } from ".";
2
+ import { IColumnTable, IFTableEditFormat } from "../type";
3
3
  interface FooterColProps {
4
4
  col: IColumnTable;
5
5
  indexCol: number;
@@ -1,5 +1,5 @@
1
1
  import { Dispatch, SetStateAction } from 'react';
2
- import { IHeaderColumnTable } from '../table';
2
+ import { IHeaderColumnTable } from "../type";
3
3
  import 'react-resizable/css/styles.css';
4
4
  type IFDataProps = {
5
5
  selectEnable: boolean;
@@ -1,133 +1,5 @@
1
- import { Dispatch, JSX, ReactNode, SetStateAction } from "react";
2
- import { FromItemsField } from "../edit-form";
3
- import { IFColumnSelectTable } from "../select-table";
4
- import { UseFormGetValues, UseFormReset, UseFormSetValue } from "react-hook-form";
5
- type ITextAlign = 'center' | 'left' | 'right';
6
- type IEditType = 'text' | 'numeric' | 'datetime' | 'selectTree' | 'date' | 'select' | 'checkbox' | 'form' | 'color';
7
- export type ICommandItem = {
8
- id: string;
9
- color?: string;
10
- tooltip?: string;
11
- icon?: string;
12
- commandTemplate?: ReactNode;
13
- };
14
- export type IFToolbarOptions = {
15
- align: 'left' | 'right' | 'center';
16
- template: any;
17
- };
18
- export type ISettingFormElement = {
19
- schema: any;
20
- labelSize?: 'label-small' | 'label-medium' | 'label-large';
21
- menuWidth?: number;
22
- menuHeight?: number;
23
- displayValue?: any;
24
- openOnFocus?: boolean;
25
- isClearable?: boolean;
26
- onFormOpen?: (rowData: any, itemsField: FromItemsField[], setItemsField: Dispatch<SetStateAction<FromItemsField[]>>) => void;
27
- onFormSubmit?: (rowData: any, setValue: UseFormSetValue<any>, getValues: UseFormGetValues<any>, reset: UseFormReset<any>) => void;
28
- footerTemplate?: (rowData: any) => JSX.Element;
29
- onChangeField?: (rowData: any, field: string, setValue: UseFormSetValue<any>, getValues: UseFormGetValues<any>) => void;
30
- onChange?: (rowData: any) => void;
31
- };
32
- export type ISettingSelectElement = {
33
- isClearable?: boolean;
34
- isMulti?: boolean;
35
- noHeader?: boolean;
36
- showFooter?: boolean;
37
- selectChilds?: boolean;
38
- allowCreate?: boolean;
39
- defaultValue?: any;
40
- fieldValue?: string;
41
- fieldLabel?: string;
42
- fieldChild?: string;
43
- options?: any[];
44
- widthPopup?: string | number;
45
- heightPopup?: string | number;
46
- iconGroup?: string;
47
- handAddNew?: any;
48
- validateOption?: any;
49
- optionsField?: string;
50
- columns?: IFColumnSelectTable[];
51
- formatOptionLabel?: (ele: any) => JSX.Element;
52
- footerComponent?: () => JSX.Element;
53
- loadOptions?: (keyword: string, callback: (rs: any[]) => void) => void;
54
- onOpenMenu?: (row: any, col: IColumnTable, indexRow: number) => void;
55
- };
56
- export type ISettingNumericElement = {
57
- min?: number;
58
- max?: number;
59
- fraction?: number;
60
- allowNegative?: boolean;
61
- };
62
- export type IColumnTable = {
63
- field: string;
64
- headerText?: string;
65
- isPrimarykey?: boolean;
66
- isUnikey?: boolean;
67
- haveSum?: boolean;
68
- haveToolTip?: boolean;
69
- width?: number | string;
70
- minWidth?: number | string;
71
- maxWidth?: number | string;
72
- editEnable?: boolean;
73
- visible?: boolean;
74
- invisibleDisable?: boolean;
75
- editType?: IEditType;
76
- textAlign?: ITextAlign;
77
- fixedType?: 'left' | 'right' | undefined;
78
- commandItems?: ICommandItem[];
79
- placeholder?: string;
80
- numericSettings?: ISettingNumericElement;
81
- selectSettings?: ISettingSelectElement;
82
- formSettings?: ISettingFormElement;
83
- columns?: IColumnTable[];
84
- disablePaste?: boolean;
85
- validate?: (value: any, row: any) => string | undefined;
86
- disabledCondition?: (row: any) => boolean;
87
- callback?: (value: any, indexRow: number, item: any) => void;
88
- template?: (row: any, indexRow: number) => JSX.Element | string | number | undefined;
89
- editTypeCondition?: (row: any) => string;
90
- onPaste?: (dataRow: any, dataPaste: any) => void;
91
- onPasteValidate?: (dataPaste: string, dataRow: any, rowIndex: number) => Promise<any>;
92
- };
93
- export type IFTableEditPaging = {
94
- allowPaging?: boolean;
95
- pagingClient?: boolean;
96
- currentPage?: number;
97
- setCurrentPage?: Dispatch<SetStateAction<number>>;
98
- setPageSize?: Dispatch<SetStateAction<number>>;
99
- pageSize?: number;
100
- totalItem?: number;
101
- pageOptions?: number[];
102
- };
103
- export type IFTableEditButton = {
104
- deleteAllDisable?: boolean;
105
- insertAfterDisable?: boolean;
106
- insertBeforeDisable?: boolean;
107
- duplicateDisable?: boolean;
108
- };
109
- export type IFTableEditToolbar = {
110
- showTopToolbar?: boolean;
111
- toolbarOptions?: IFToolbarOptions[];
112
- toolbarBottomOptions?: IFToolbarOptions[];
113
- showBottomToolbar?: boolean;
114
- };
115
- export type IFTableEditSearchSetting = {
116
- searchEnable?: boolean;
117
- searchClient?: boolean;
118
- searchTerm?: string;
119
- keyField?: string[];
120
- setSearchTerm?: Dispatch<SetStateAction<string>>;
121
- };
122
- export type IFTableEditFormat = {
123
- dateFormat?: string;
124
- datetimeFormat?: string;
125
- decimalSeparator?: string;
126
- thousandSeparator?: string;
127
- colorNegative?: string;
128
- prefixNegative?: string;
129
- suffixNegative?: string;
130
- };
1
+ import { Dispatch, SetStateAction } from "react";
2
+ import { IFTableEditButton, IFTableEditFormat, IFTableEditPaging, IFTableEditSearchSetting, IFTableEditToolbar, IColumnTable } from "../type";
131
3
  export type IFTableEditProps = {
132
4
  idTable?: string;
133
5
  dataSource: any[];
@@ -158,31 +30,8 @@ export type IFTableEditProps = {
158
30
  rowChange?: (row: any, indexRow: number, field: string) => void;
159
31
  onDuplicate?: (newData: any, index: number) => void;
160
32
  };
161
- export type IFPageSize = {
162
- pageSize: number;
163
- };
164
- export type IFCurrentPage = {
165
- currentPage: number;
166
- };
167
- export type IFCurrentPageConfig = {
168
- currentPage: number;
169
- oldPage: number;
170
- };
171
33
  type IFRef = {
172
34
  refeshFocusRow: any;
173
35
  };
174
- export type IHeaderColumnTable = {
175
- field: string;
176
- headerText?: string;
177
- width?: number | string;
178
- minWidth?: number | string;
179
- maxWidth?: number | string;
180
- visible?: boolean;
181
- rowspan?: number;
182
- columns?: IColumnTable[];
183
- textAlign?: ITextAlign;
184
- fixedType?: 'left' | 'right' | undefined;
185
- index?: number;
186
- };
187
36
  declare const TableEdit: import("react").ForwardRefExoticComponent<IFTableEditProps & import("react").RefAttributes<IFRef>>;
188
37
  export default TableEdit;
@@ -1,10 +1,8 @@
1
1
  import { KeyboardEvent } from "react";
2
- import { IFTableEditPaging } from ".";
2
+ import { IFTableEditPaging } from "../type";
3
3
  export interface KeyHandlerParams {
4
4
  row: any;
5
5
  dataSource: any[];
6
- itemFocus: string;
7
- parents: string;
8
6
  indexRow: number;
9
7
  indexCol: number;
10
8
  contentColumns: any[];
@@ -17,10 +15,8 @@ export interface KeyHandlerParams {
17
15
  addDisable?: boolean;
18
16
  handleDuplicate: () => void;
19
17
  pagingSetting?: IFTableEditPaging;
20
- focusNewElement: (col: number, parent: string, row?: number, forceFocus?: boolean) => void;
21
- setItemFocus: (newParents: string) => void;
22
- getNewParents: (parent: string, index: number) => string;
23
- fieldChildren?: string;
18
+ focusNewElement: (col: number, row: number, onLoad?: boolean) => void;
19
+ setIndexFocus: (index: number) => void;
24
20
  }
25
21
  export declare const handleArrowRight: (e: KeyboardEvent<any>, params: KeyHandlerParams) => string | undefined;
26
22
  export declare const handleArrowLeft: (e: KeyboardEvent<any>, params: KeyHandlerParams) => string | undefined;
@@ -2,5 +2,5 @@ export type IFToolbarOptions = {
2
2
  align: 'left' | 'right' | 'center';
3
3
  template: any;
4
4
  };
5
- declare const ToolbarBottom: ({ handleAdd, handleDuplicate, handleInsertBefore, handleInsertAfter, handleDeleteAll, setOpenPopupSetupColumn, itemFocus, editDisable, addDisable, buttonSetting, toolbarSetting, headerColumns, t }: any) => import("react/jsx-runtime").JSX.Element;
5
+ declare const ToolbarBottom: ({ handleAdd, handleDuplicate, handleInsertBefore, handleInsertAfter, handleDeleteAll, setOpenPopupSetupColumn, indexFocus, editDisable, addDisable, buttonSetting, toolbarSetting, headerColumns, t }: any) => import("react/jsx-runtime").JSX.Element;
6
6
  export default ToolbarBottom;
@@ -0,0 +1,9 @@
1
+ import { IFTableEditButton, IFTableEditPaging, IFTableEditToolbar } from "../type";
2
+ export declare const handleAdd: (dataSource: any[], tableElement: any, columnFistEdit: any, changeDataSource: (data: any[], haveNew?: boolean) => void, pagingSetting: {
3
+ setCurrentPage?: (page: number) => void;
4
+ pageSize?: number;
5
+ } | undefined, setItemFocus: (item: string) => void, focusNewElement: (column: any, value: string, index: number, onLoad: boolean) => void) => void;
6
+ export declare const handleDuplicate: (dataSource: any[], itemFocus: string, 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) => Promise<void>;
7
+ export declare const handleInsertAfter: (dataSource: any[], itemFocus: string, defaultValue: any, changeDataSource: (data: any[]) => void, tableElement: any, totalCount: number, pagingClient?: boolean, pagingSetting?: IFTableEditPaging, toolbarSetting?: IFTableEditToolbar, buttonSetting?: IFTableEditButton, editDisable?: boolean, addDisable?: boolean) => void;
8
+ export declare const handleInsertBefore: (dataSource: any[], itemFocus: string, defaultValue: any, changeDataSource: (data: any[]) => void, pagingClient?: boolean, pagingSetting?: IFTableEditPaging, toolbarSetting?: IFTableEditToolbar, buttonSetting?: IFTableEditButton, editDisable?: boolean, addDisable?: boolean) => void;
9
+ export declare const handleDeleteAll: (t: any, messageBoxConfirmDelete: (t: any, callback: () => void, message: string) => void, setItemFocus: (item: string) => void, changeDataSource: (data: any[], haveNew?: boolean) => void, editDisable?: boolean, addDisable?: boolean, toolbarSetting?: IFTableEditToolbar, buttonSetting?: IFTableEditButton) => void;
@@ -0,0 +1,13 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ import { ICommandItem } from "../type";
3
+ type IFDataProps = {
4
+ commandItems: ICommandItem[];
5
+ rowData: any;
6
+ indexRow: number;
7
+ currentItem: string;
8
+ itemFocus?: string;
9
+ setItemFocus: Dispatch<SetStateAction<string>>;
10
+ handleCommandClick: any;
11
+ };
12
+ declare const CommandElement: (props: IFDataProps) => import("react/jsx-runtime").JSX.Element;
13
+ export default CommandElement;
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { IColumnTable, IFTableEditFormat } from "../type";
3
+ interface FooterColProps {
4
+ col: IColumnTable;
5
+ indexCol: number;
6
+ dataSource: any[];
7
+ objWidthFix: {
8
+ [key: number]: number;
9
+ };
10
+ formatSetting?: IFTableEditFormat;
11
+ }
12
+ declare const FooterCol: React.FC<FooterColProps>;
13
+ export default FooterCol;
@@ -0,0 +1,19 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ import { IHeaderColumnTable } from "../type";
3
+ import 'react-resizable/css/styles.css';
4
+ type IFDataProps = {
5
+ selectEnable: boolean;
6
+ dataSource: any[];
7
+ setSelectedRows: Dispatch<SetStateAction<any[]>>;
8
+ col: IHeaderColumnTable;
9
+ column: IHeaderColumnTable[];
10
+ setColumn: Dispatch<SetStateAction<IHeaderColumnTable[]>>;
11
+ indexCol: number;
12
+ indexParent: number;
13
+ objWidthFix: any;
14
+ totalCount: number;
15
+ selectedRows: any[];
16
+ isMulti: boolean;
17
+ };
18
+ declare const HeaderTableCol: (props: IFDataProps) => import("react/jsx-runtime").JSX.Element;
19
+ export default HeaderTableCol;
@@ -0,0 +1,37 @@
1
+ import { Dispatch, SetStateAction } from "react";
2
+ import { IFTableEditButton, IFTableEditFormat, IFTableEditPaging, IFTableEditSearchSetting, IFTableEditToolbar, IColumnTable } from "../type";
3
+ export type IFTableEditProps = {
4
+ idTable?: string;
5
+ dataSource: any[];
6
+ selectEnable?: boolean;
7
+ defaultValue?: any;
8
+ columns: IColumnTable[];
9
+ height?: number;
10
+ maxHeight?: number;
11
+ minHeight?: number;
12
+ isMulti?: boolean;
13
+ editDisable?: boolean;
14
+ addDisable?: boolean;
15
+ haveSum?: boolean;
16
+ disableAutoKey?: boolean;
17
+ isTree?: boolean;
18
+ fieldChildren?: string;
19
+ formatSetting?: IFTableEditFormat;
20
+ pagingSetting?: IFTableEditPaging;
21
+ buttonSetting?: IFTableEditButton;
22
+ toolbarSetting?: IFTableEditToolbar;
23
+ searchSetting?: IFTableEditSearchSetting;
24
+ selectedItem?: any;
25
+ setDataSource?: any;
26
+ setSelectedItem?: Dispatch<SetStateAction<any>>;
27
+ commandClick?: (data: any) => void;
28
+ handleSelect?: (data: any) => void;
29
+ dataSourceChange?: (data: any[]) => void;
30
+ rowChange?: (row: any, indexRow: number, field: string) => void;
31
+ onDuplicate?: (newData: any, index: number) => void;
32
+ };
33
+ type IFRef = {
34
+ refeshFocusRow: any;
35
+ };
36
+ declare const TableEdit: import("react").ForwardRefExoticComponent<IFTableEditProps & import("react").RefAttributes<IFRef>>;
37
+ export default TableEdit;
@@ -0,0 +1,31 @@
1
+ import { KeyboardEvent } from "react";
2
+ import { IFTableEditPaging } from "../type";
3
+ export interface KeyHandlerParams {
4
+ row: any;
5
+ dataSource: any[];
6
+ itemFocus: string;
7
+ parents: string;
8
+ indexRow: number;
9
+ indexCol: number;
10
+ contentColumns: any[];
11
+ idElement: string;
12
+ pagingClient?: boolean;
13
+ totalCount: number;
14
+ columnLastEdit: number;
15
+ moveIndexRowToNewPage: () => void;
16
+ editDisable?: boolean;
17
+ addDisable?: boolean;
18
+ handleDuplicate: () => void;
19
+ pagingSetting?: IFTableEditPaging;
20
+ focusNewElement: (col: number, parent: string, row?: number, forceFocus?: boolean) => void;
21
+ setItemFocus: (newParents: string) => void;
22
+ getNewParents: (parent: string, index: number) => string;
23
+ fieldChildren?: string;
24
+ }
25
+ export declare const handleArrowRight: (e: KeyboardEvent<any>, params: KeyHandlerParams) => string | undefined;
26
+ export declare const handleArrowLeft: (e: KeyboardEvent<any>, params: KeyHandlerParams) => string | undefined;
27
+ export declare const handleArrowUp: (e: KeyboardEvent<any>, params: KeyHandlerParams) => string | undefined;
28
+ export declare const handleArrowDown: (e: KeyboardEvent<any>, params: KeyHandlerParams) => string | undefined;
29
+ export declare const handleTab: (e: KeyboardEvent<any>, params: KeyHandlerParams) => string | undefined;
30
+ export declare const handleEnter: (e: KeyboardEvent<any>, params: KeyHandlerParams) => string | undefined;
31
+ export declare const handleCtrlD: (e: KeyboardEvent<any>, params: KeyHandlerParams) => string | undefined;
@@ -0,0 +1,2 @@
1
+ declare const ToolbarBottom: ({ handleAdd, handleDuplicate, handleInsertBefore, handleInsertAfter, handleDeleteAll, setOpenPopupSetupColumn, itemFocus, editDisable, addDisable, buttonSetting, toolbarSetting, headerColumns, t }: any) => import("react/jsx-runtime").JSX.Element;
2
+ export default ToolbarBottom;
@@ -0,0 +1,9 @@
1
+ export type IFToolbarOptions = {
2
+ align: 'left' | 'right' | 'center';
3
+ template: any;
4
+ };
5
+ type IFDataProps = {
6
+ toolbarTopOption?: IFToolbarOptions[];
7
+ };
8
+ declare const RenderToolbarTop: ({ toolbarTopOption }: IFDataProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default RenderToolbarTop;
@@ -0,0 +1,154 @@
1
+ import { Dispatch, ReactNode, SetStateAction, JSX } from "react";
2
+ import { IFColumnSelectTable } from "../select-table";
3
+ import { FromItemsField } from "../edit-form";
4
+ import { UseFormGetValues, UseFormReset, UseFormSetValue } from "react-hook-form";
5
+ type ITextAlign = 'center' | 'left' | 'right';
6
+ type IEditType = 'text' | 'numeric' | 'datetime' | 'selectTree' | 'date' | 'select' | 'checkbox' | 'form' | 'color';
7
+ export type ICommandItem = {
8
+ id: string;
9
+ color?: string;
10
+ tooltip?: string;
11
+ icon?: string;
12
+ commandTemplate?: ReactNode;
13
+ };
14
+ export type IFToolbarOptions = {
15
+ align: 'left' | 'right' | 'center';
16
+ template: any;
17
+ };
18
+ export type ISettingFormElement = {
19
+ schema: any;
20
+ labelSize?: 'label-small' | 'label-medium' | 'label-large';
21
+ menuWidth?: number;
22
+ menuHeight?: number;
23
+ displayValue?: any;
24
+ openOnFocus?: boolean;
25
+ isClearable?: boolean;
26
+ onFormOpen?: (rowData: any, itemsField: FromItemsField[], setItemsField: Dispatch<SetStateAction<FromItemsField[]>>) => void;
27
+ onFormSubmit?: (rowData: any, setValue: UseFormSetValue<any>, getValues: UseFormGetValues<any>, reset: UseFormReset<any>) => void;
28
+ footerTemplate?: (rowData: any) => JSX.Element;
29
+ onChangeField?: (rowData: any, field: string, setValue: UseFormSetValue<any>, getValues: UseFormGetValues<any>) => void;
30
+ onChange?: (rowData: any) => void;
31
+ };
32
+ export type ISettingSelectElement = {
33
+ isClearable?: boolean;
34
+ isMulti?: boolean;
35
+ noHeader?: boolean;
36
+ showFooter?: boolean;
37
+ selectChilds?: boolean;
38
+ allowCreate?: boolean;
39
+ defaultValue?: any;
40
+ fieldValue?: string;
41
+ fieldLabel?: string;
42
+ fieldChild?: string;
43
+ options?: any[];
44
+ widthPopup?: string | number;
45
+ heightPopup?: string | number;
46
+ iconGroup?: string;
47
+ handAddNew?: any;
48
+ validateOption?: any;
49
+ optionsField?: string;
50
+ columns?: IFColumnSelectTable[];
51
+ formatOptionLabel?: (ele: any) => JSX.Element;
52
+ footerComponent?: () => JSX.Element;
53
+ loadOptions?: (keyword: string, callback: (rs: any[]) => void) => void;
54
+ onOpenMenu?: (row: any, col: IColumnTable, indexRow: number) => void;
55
+ };
56
+ export type ISettingNumericElement = {
57
+ min?: number;
58
+ max?: number;
59
+ fraction?: number;
60
+ allowNegative?: boolean;
61
+ };
62
+ export type IColumnTable = {
63
+ field: string;
64
+ headerText?: string;
65
+ isPrimarykey?: boolean;
66
+ isUnikey?: boolean;
67
+ haveSum?: boolean;
68
+ haveToolTip?: boolean;
69
+ width?: number | string;
70
+ minWidth?: number | string;
71
+ maxWidth?: number | string;
72
+ editEnable?: boolean;
73
+ visible?: boolean;
74
+ invisibleDisable?: boolean;
75
+ editType?: IEditType;
76
+ textAlign?: ITextAlign;
77
+ fixedType?: 'left' | 'right' | undefined;
78
+ commandItems?: ICommandItem[];
79
+ placeholder?: string;
80
+ numericSettings?: ISettingNumericElement;
81
+ selectSettings?: ISettingSelectElement;
82
+ formSettings?: ISettingFormElement;
83
+ columns?: IColumnTable[];
84
+ disablePaste?: boolean;
85
+ validate?: (value: any, row: any) => string | undefined;
86
+ disabledCondition?: (row: any) => boolean;
87
+ callback?: (value: any, indexRow: number, item: any) => void;
88
+ template?: (row: any, indexRow: number) => JSX.Element | string | number | undefined;
89
+ editTypeCondition?: (row: any) => string;
90
+ onPaste?: (dataRow: any, dataPaste: any) => void;
91
+ onPasteValidate?: (dataPaste: string, dataRow: any, rowIndex: number) => Promise<any>;
92
+ };
93
+ export type IFTableEditPaging = {
94
+ allowPaging?: boolean;
95
+ pagingClient?: boolean;
96
+ currentPage?: number;
97
+ setCurrentPage?: Dispatch<SetStateAction<number>>;
98
+ setPageSize?: Dispatch<SetStateAction<number>>;
99
+ pageSize?: number;
100
+ totalItem?: number;
101
+ pageOptions?: number[];
102
+ };
103
+ export type IFTableEditButton = {
104
+ deleteAllDisable?: boolean;
105
+ insertAfterDisable?: boolean;
106
+ insertBeforeDisable?: boolean;
107
+ duplicateDisable?: boolean;
108
+ };
109
+ export type IFTableEditToolbar = {
110
+ showTopToolbar?: boolean;
111
+ toolbarOptions?: IFToolbarOptions[];
112
+ toolbarBottomOptions?: IFToolbarOptions[];
113
+ showBottomToolbar?: boolean;
114
+ };
115
+ export type IFTableEditSearchSetting = {
116
+ searchEnable?: boolean;
117
+ searchClient?: boolean;
118
+ searchTerm?: string;
119
+ keyField?: string[];
120
+ setSearchTerm?: Dispatch<SetStateAction<string>>;
121
+ };
122
+ export type IFTableEditFormat = {
123
+ dateFormat?: string;
124
+ datetimeFormat?: string;
125
+ decimalSeparator?: string;
126
+ thousandSeparator?: string;
127
+ colorNegative?: string;
128
+ prefixNegative?: string;
129
+ suffixNegative?: string;
130
+ };
131
+ export type IFPageSize = {
132
+ pageSize: number;
133
+ };
134
+ export type IFCurrentPage = {
135
+ currentPage: number;
136
+ };
137
+ export type IFCurrentPageConfig = {
138
+ currentPage: number;
139
+ oldPage: number;
140
+ };
141
+ export type IHeaderColumnTable = {
142
+ field: string;
143
+ headerText?: string;
144
+ width?: number | string;
145
+ minWidth?: number | string;
146
+ maxWidth?: number | string;
147
+ visible?: boolean;
148
+ rowspan?: number;
149
+ columns?: IColumnTable[];
150
+ textAlign?: ITextAlign;
151
+ fixedType?: 'left' | 'right' | undefined;
152
+ index?: number;
153
+ };
154
+ export {};