@tech-diefra/fluig-ui 1.0.6 → 1.1.0

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,17 @@
1
+ import { default as React } from 'react';
2
+
3
+ export interface TableColumn {
4
+ key: string;
5
+ label: string;
6
+ width?: string;
7
+ render?: (row: any, index: number, updateCellValue: (key: string, value: any) => void, isLocked: boolean, isView: boolean) => React.ReactNode;
8
+ }
9
+ export interface SimpleTableProps {
10
+ name: string;
11
+ title?: string;
12
+ columns: TableColumn[];
13
+ defaultRowValue?: object;
14
+ forceReadOnly?: boolean;
15
+ }
16
+ declare const SimpleTable: React.FC<SimpleTableProps>;
17
+ export default SimpleTable;
@@ -0,0 +1,31 @@
1
+ import { Control } from 'react-hook-form';
2
+
3
+ export interface TableRow {
4
+ _uid: number;
5
+ [key: string]: any;
6
+ }
7
+ interface UseSimpleTableProps {
8
+ name: string;
9
+ control: Control<any>;
10
+ defaultRowValue: object;
11
+ isView: boolean;
12
+ isReadOnly: boolean;
13
+ }
14
+ /**
15
+ * Hook responsável pela lógica de manipulação de dados da tabela
16
+ * e integração com o React Hook Form.
17
+ */
18
+ export declare function useSimpleTable({ name, control, defaultRowValue, isView, isReadOnly, }: UseSimpleTableProps): {
19
+ field: import('react-hook-form').ControllerRenderProps<any, string>;
20
+ tableRows: TableRow[];
21
+ selectedRowIds: number[];
22
+ isAllSelected: boolean;
23
+ actions: {
24
+ addRow: () => void;
25
+ removeRows: () => void;
26
+ updateCellValue: (uid: number, key: string, value: any) => void;
27
+ toggleSelection: (uid: number) => void;
28
+ toggleSelectAll: (isChecked: boolean) => void;
29
+ };
30
+ };
31
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tech-diefra/fluig-ui",
3
- "version": "1.0.6",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -24,7 +24,7 @@
24
24
  "react-dom": "^18.0.0 || ^19.0.0",
25
25
  "react-hook-form": "^7.0.0",
26
26
  "@fluig-kit/core": "^1.0.5",
27
- "@fluig-kit/ecm": "^1.0.7",
27
+ "@fluig-kit/ecm": "^1.0.8",
28
28
  "date-fns": "^2.0.0 || ^3.0.0 || ^4.0.0",
29
29
  "react-datepicker": "^4.0.0 || ^6.0.0 || ^7.0.0",
30
30
  "react-imask": "^7.0.0"