finform-react-builder 1.8.22 → 1.8.24

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,66 @@
1
+ import { default as React } from 'react';
2
+ export type GridColumn = {
3
+ key: string;
4
+ header: string;
5
+ type?: "text" | "number" | "select" | "checkbox";
6
+ width?: number | string;
7
+ options?: {
8
+ label: string;
9
+ value: any;
10
+ }[];
11
+ placeholder?: string;
12
+ disabled?: boolean | ((row: any, index: number) => boolean);
13
+ value?: any | ((row: any, index: number) => any);
14
+ editable?: boolean;
15
+ helperText?: string;
16
+ required?: boolean;
17
+ minLength?: number;
18
+ maxLength?: number;
19
+ pattern?: string;
20
+ min?: number;
21
+ max?: number;
22
+ step?: number;
23
+ endorsementText?: string | ((row: any, index: number) => string);
24
+ endorsementBg?: string;
25
+ endorsementColor?: string;
26
+ endorsementRadius?: number | string;
27
+ endorsementHeight?: number;
28
+ endorsementPaddingX?: number;
29
+ apiConfig?: {
30
+ endpoint: string;
31
+ method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
32
+ valueField?: string;
33
+ labelField?: string;
34
+ headers?: Record<string, string>;
35
+ params?: Record<string, any>;
36
+ body?: any;
37
+ transform?: (data: any[]) => Array<{
38
+ label: string;
39
+ value: string | number;
40
+ }>;
41
+ dependsOn?: string;
42
+ conditional?: boolean;
43
+ passThroughFields?: string[];
44
+ };
45
+ sx?: any;
46
+ cellSx?: any;
47
+ };
48
+ export interface FinEditableGridProps {
49
+ name: string;
50
+ columns: GridColumn[];
51
+ initialRow: Record<string, any>;
52
+ addLabel?: string;
53
+ rowDeletable?: boolean;
54
+ control: any;
55
+ sx?: any;
56
+ addActions?: {
57
+ label: string;
58
+ template: Record<string, any>;
59
+ }[];
60
+ emptyTitle?: string;
61
+ emptySubtitle?: string;
62
+ emptyCardSx?: any;
63
+ setValue?: (name: string, value: any, options?: any) => void;
64
+ }
65
+ export declare const FinEditableGrid: React.FC<FinEditableGridProps>;
66
+ export default FinEditableGrid;
@@ -14,3 +14,4 @@ export * from './FinCustomizedVerticalStepper';
14
14
  export * from './FinChip';
15
15
  export * from './FinInfoCard';
16
16
  export * from './FinTabs';
17
+ export * from './FinEditableGrid';
@@ -29,7 +29,7 @@ export interface BaseField {
29
29
  title?: string;
30
30
  name: string;
31
31
  label: string;
32
- type: 'text' | 'email' | 'password' | 'number' | 'tel' | 'select' | 'checkbox' | 'toggle' | 'radio' | 'switch' | 'autocomplete' | 'date' | 'textarea' | 'image' | 'title' | 'section' | 'component' | 'finuiHeader' | 'tabs';
32
+ type: 'text' | 'email' | 'password' | 'number' | 'tel' | 'select' | 'checkbox' | 'toggle' | 'radio' | 'switch' | 'autocomplete' | 'date' | 'textarea' | 'image' | 'title' | 'section' | 'component' | 'finuiHeader' | 'tabs' | 'grid';
33
33
  placeholder?: string;
34
34
  labelPosition?: 'inner' | 'top' | 'none';
35
35
  labelVariant?: 'caption' | 'body2' | 'subtitle2' | 'h6';
@@ -220,7 +220,66 @@ export interface TabsField extends BaseField {
220
220
  defaultValue?: any;
221
221
  tabSx?: any;
222
222
  }
223
- export type FieldConfig = TextField | NumberField | SelectField | CheckboxField | ToggleField | RadioField | SwitchField | AutocompleteField | DateField | ImageField | TitleField | SectionField | ComponentField | FinUiHeaderField | TabsField;
223
+ export interface GridField extends BaseField {
224
+ type: 'grid';
225
+ initialRow: Record<string, any>;
226
+ columns: Array<{
227
+ key: string;
228
+ header: string;
229
+ type?: 'text' | 'number' | 'select' | 'checkbox';
230
+ width?: number | string;
231
+ options?: {
232
+ label: string;
233
+ value: any;
234
+ }[];
235
+ placeholder?: string;
236
+ disabled?: boolean | ((row: any, index: number) => boolean);
237
+ value?: any | ((row: any, index: number) => any);
238
+ editable?: boolean;
239
+ helperText?: string;
240
+ required?: boolean;
241
+ minLength?: number;
242
+ maxLength?: number;
243
+ pattern?: string;
244
+ min?: number;
245
+ max?: number;
246
+ step?: number;
247
+ endorsementText?: string | ((row: any, index: number) => string);
248
+ endorsementBg?: string;
249
+ endorsementColor?: string;
250
+ endorsementRadius?: number | string;
251
+ endorsementHeight?: number;
252
+ endorsementPaddingX?: number;
253
+ apiConfig?: {
254
+ endpoint: string;
255
+ method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
256
+ valueField?: string;
257
+ labelField?: string;
258
+ headers?: Record<string, string>;
259
+ params?: Record<string, any>;
260
+ body?: any;
261
+ transform?: (data: any[]) => Array<{
262
+ label: string;
263
+ value: string | number;
264
+ }>;
265
+ dependsOn?: string;
266
+ conditional?: boolean;
267
+ passThroughFields?: string[];
268
+ };
269
+ sx?: any;
270
+ cellSx?: any;
271
+ }>;
272
+ addLabel?: string;
273
+ rowDeletable?: boolean;
274
+ addActions?: {
275
+ label: string;
276
+ template: Record<string, any>;
277
+ }[];
278
+ emptyTitle?: string;
279
+ emptySubtitle?: string;
280
+ emptyCardSx?: any;
281
+ }
282
+ export type FieldConfig = TextField | NumberField | SelectField | CheckboxField | ToggleField | RadioField | SwitchField | AutocompleteField | DateField | ImageField | TitleField | SectionField | ComponentField | FinUiHeaderField | TabsField | GridField;
224
283
  export interface FormButton {
225
284
  text: string;
226
285
  color?: string;