@esvndev/es-react-table-interface 1.9.67 → 1.9.68

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.
@@ -1,10 +1,57 @@
1
1
  import React from "react";
2
- interface Props {
2
+ interface ColumnInterfaceOptions {
3
3
  column: any[];
4
- t: any;
4
+ t?: any;
5
5
  storageKey?: string;
6
6
  isGetData?: boolean;
7
+ }
8
+ interface ColumnInterfaceGridProps {
9
+ columns?: any[];
10
+ toolbarItems?: any[];
11
+ t?: any;
12
+ }
13
+ interface Props extends Omit<ColumnInterfaceOptions, "column"> {
14
+ column?: any[];
15
+ children?: React.ReactElement<ColumnInterfaceGridProps>;
7
16
  onConfirm?: (column: any[]) => void;
8
17
  }
18
+ type ColumnSetting = {
19
+ field: string;
20
+ headerTextOrigin: string;
21
+ headerText: string;
22
+ visible: boolean;
23
+ fixedType?: "left" | "right" | "";
24
+ width?: number;
25
+ sortOrder?: number;
26
+ };
27
+ interface ColumnInterfaceController {
28
+ t: any;
29
+ t_over: any;
30
+ openModal: boolean;
31
+ thisColumn: ColumnSetting[];
32
+ dragIndex: number | undefined;
33
+ loading: boolean;
34
+ saving: boolean;
35
+ handleModal: () => void;
36
+ handleReset: () => void;
37
+ handleSave: () => Promise<void>;
38
+ handleChange: (index: number, field: keyof ColumnSetting, value: any) => void;
39
+ handleDrop: (index: number) => void;
40
+ setDragIndex: React.Dispatch<React.SetStateAction<number | undefined>>;
41
+ }
42
+ /**
43
+ * Shared configuration for a grid. Pass `columns` to the grid and append
44
+ * `toolbarItem` to its toolbar; source options/templates stay current without refetching.
45
+ */
46
+ export declare const useColumnInterface: (options: ColumnInterfaceOptions) => {
47
+ columns: any[];
48
+ toolbarItem: {
49
+ template: React.JSX.Element;
50
+ align: "right";
51
+ position: "Top";
52
+ fixedRight: boolean;
53
+ };
54
+ controller: ColumnInterfaceController;
55
+ };
9
56
  export declare const ColumnInterface: React.MemoExoticComponent<(props: Props) => React.JSX.Element>;
10
57
  export {};
@@ -1,5 +1,5 @@
1
1
  export { ExternalInterface } from './ExternalInterface';
2
- export { ColumnInterface } from './ColumnInterface';
2
+ export { ColumnInterface, useColumnInterface } from './ColumnInterface';
3
3
  export { renderColumnTableGrid } from './../../ultility/Export/functionExport';
4
4
  export { ExternalInterfaceExtend } from './ExternalInterfaceExtend';
5
5
  export { default as ModalComponentSetView } from './modalSetView';