react-table-edit 1.4.9 → 1.4.11

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.
@@ -22,13 +22,13 @@ type Props = {
22
22
  menuWidth?: number;
23
23
  rowData: any;
24
24
  indexRow: any;
25
- template?: any;
26
25
  onKeyDown?: any;
27
26
  defaultValues?: any;
28
27
  schema?: InferType<any>;
29
28
  onFormOpen?: (rowData: any, itemsField: FromItemsField[], setItemsField: Dispatch<SetStateAction<FromItemsField[]>>) => void;
30
29
  onFormSubmit?: (rowData: any, setValue: UseFormSetValue<any>, getValues: UseFormGetValues<any>, reset: UseFormReset<any>) => void;
31
30
  footerTemplate?: (rowData: any) => JSX.Element;
31
+ template?: (row: any, indexRow: number) => JSX.Element | string | number | undefined;
32
32
  onChangeField?: (rowData: any, field: string, setValue: UseFormSetValue<any>, getValues: UseFormGetValues<any>) => void;
33
33
  onChange: (rowData: any) => void;
34
34
  onPaste?: (e: ClipboardEvent<HTMLInputElement>) => void;
@@ -0,0 +1,36 @@
1
+ import { ClipboardEvent, Dispatch, JSX, SetStateAction } from "react";
2
+ import { UseFormGetValues, UseFormSetValue } from "react-hook-form";
3
+ import { InferType } from "yup";
4
+ export type FromItemsField = {
5
+ name: string;
6
+ label: string;
7
+ type: 'text' | 'numeric' | 'select' | 'selectCreatable';
8
+ disabled?: boolean;
9
+ fraction?: number;
10
+ min?: number;
11
+ max?: number;
12
+ options?: any[];
13
+ };
14
+ type Props = {
15
+ id?: string;
16
+ field?: string;
17
+ displayValue: string;
18
+ textAlign?: 'left' | 'right' | 'center';
19
+ placeholder?: string;
20
+ invalid?: any;
21
+ rowData: any;
22
+ indexRow: any;
23
+ onKeyDown?: any;
24
+ defaultValues?: any;
25
+ schema?: InferType<any>;
26
+ onFormOpen?: (rowData: any, itemsField: FromItemsField[], setItemsField: Dispatch<SetStateAction<FromItemsField[]>>) => void;
27
+ footerTemplate?: (rowData: any) => JSX.Element;
28
+ template?: (row: any, indexRow: number) => any;
29
+ onChangeField?: (rowData: any, field: string, setValue: UseFormSetValue<any>, getValues: UseFormGetValues<any>) => void;
30
+ onChange: (rowData: any) => void;
31
+ onPaste?: (e: ClipboardEvent<HTMLInputElement>) => void;
32
+ isClearable?: boolean;
33
+ labelSize?: 'label-small' | 'label-medium' | 'label-large';
34
+ };
35
+ declare const EditFormInline: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<unknown>>;
36
+ export default EditFormInline;
@@ -0,0 +1,32 @@
1
+ import { IFColumnSelectTable } from "../../select-table";
2
+ interface ISelectTableBox {
3
+ id?: string;
4
+ name: string;
5
+ control: any;
6
+ defaultValue?: any;
7
+ isMulti?: boolean;
8
+ isLabel?: boolean;
9
+ inLine?: boolean;
10
+ labelComponent?: any;
11
+ options: any[];
12
+ loadOptions?: any;
13
+ placeholder?: string;
14
+ disabled?: boolean;
15
+ label?: any;
16
+ labelSize?: any;
17
+ required?: boolean;
18
+ errors?: any;
19
+ cssClass?: string;
20
+ callback?: any;
21
+ confirmHandle?: any;
22
+ columns?: IFColumnSelectTable[];
23
+ handleAddNew?: any;
24
+ fieldLabel?: string;
25
+ fieldValue?: string;
26
+ isClearable?: boolean;
27
+ noHeader?: boolean;
28
+ desciptionLabel?: string;
29
+ classLabel?: string;
30
+ }
31
+ declare const SelectTableBox: (props: ISelectTableBox) => import("react/jsx-runtime").JSX.Element;
32
+ export default SelectTableBox;
@@ -1,10 +1,10 @@
1
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: {
2
+ export declare const handleAdd: (dataSource: any[], tableElement: any, columnFistEdit: any, changeDataSource: (data: any[], numberOfRows?: number) => void, pagingSetting: {
3
3
  setCurrentPage?: (page: number) => void;
4
4
  pageSize?: number;
5
- } | undefined, setIndexFocus: (item: number) => void, focusNewElement: (col: number, row: number, onLoad?: boolean) => void) => void;
5
+ } | undefined, setIndexFocus: (item: number) => void, focusNewElement: (col: number, row: number, onLoad?: boolean) => void, numberOfRows?: number) => void;
6
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
7
  pagingClient?: boolean, pagingSetting?: IFTableEditPaging) => Promise<void>;
8
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
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;
10
+ export declare const handleDeleteAll: (t: any, messageBoxConfirmDelete: (t: any, callback: () => void, message: string) => void, setIndexFocus: (item: number) => void, changeDataSource: (data: any[]) => void, editDisable?: boolean, addDisable?: boolean, toolbarSetting?: IFTableEditToolbar, buttonSetting?: IFTableEditButton) => void;
@@ -3,7 +3,7 @@ import { IFColumnSelectTable } from "../select-table";
3
3
  import { FromItemsField } from "../edit-form";
4
4
  import { UseFormGetValues, UseFormReset, UseFormSetValue } from "react-hook-form";
5
5
  type ITextAlign = 'center' | 'left' | 'right';
6
- type IEditType = 'text' | 'numeric' | 'datetime' | 'selectTree' | 'date' | 'select' | 'checkbox' | 'form' | 'color';
6
+ type IEditType = 'text' | 'numeric' | 'datetime' | 'selectTree' | 'date' | 'select' | 'checkbox' | 'form' | 'formInline' | 'color';
7
7
  export type ICommandItem = {
8
8
  id: string;
9
9
  color?: string;
package/dist/index.d.ts CHANGED
@@ -71,7 +71,7 @@ type FromItemsField = {
71
71
  };
72
72
 
73
73
  type ITextAlign = 'center' | 'left' | 'right';
74
- type IEditType = 'text' | 'numeric' | 'datetime' | 'selectTree' | 'date' | 'select' | 'checkbox' | 'form' | 'color';
74
+ type IEditType = 'text' | 'numeric' | 'datetime' | 'selectTree' | 'date' | 'select' | 'checkbox' | 'form' | 'formInline' | 'color';
75
75
  type ICommandItem = {
76
76
  id: string;
77
77
  color?: string;