finform-react-builder 1.8.21 → 1.8.23

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,31 @@
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
+ };
14
+ export interface FinEditableGridProps {
15
+ name: string;
16
+ columns: GridColumn[];
17
+ initialRow: Record<string, any>;
18
+ addLabel?: string;
19
+ rowDeletable?: boolean;
20
+ control: any;
21
+ sx?: any;
22
+ addActions?: {
23
+ label: string;
24
+ template: Record<string, any>;
25
+ }[];
26
+ emptyTitle?: string;
27
+ emptySubtitle?: string;
28
+ emptyCardSx?: any;
29
+ }
30
+ export declare const FinEditableGrid: React.FC<FinEditableGridProps>;
31
+ 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';
@@ -40,7 +40,8 @@ export interface BaseField {
40
40
  helperText?: string;
41
41
  validation?: ValidationRule;
42
42
  step?: number;
43
- value?: any;
43
+ value?: any | ((form: any) => any);
44
+ valueDeps?: string[];
44
45
  col?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
45
46
  xs?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
46
47
  sm?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
@@ -219,7 +220,32 @@ export interface TabsField extends BaseField {
219
220
  defaultValue?: any;
220
221
  tabSx?: any;
221
222
  }
222
- 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
+ }>;
238
+ addLabel?: string;
239
+ rowDeletable?: boolean;
240
+ addActions?: {
241
+ label: string;
242
+ template: Record<string, any>;
243
+ }[];
244
+ emptyTitle?: string;
245
+ emptySubtitle?: string;
246
+ emptyCardSx?: any;
247
+ }
248
+ export type FieldConfig = TextField | NumberField | SelectField | CheckboxField | ToggleField | RadioField | SwitchField | AutocompleteField | DateField | ImageField | TitleField | SectionField | ComponentField | FinUiHeaderField | TabsField | GridField;
223
249
  export interface FormButton {
224
250
  text: string;
225
251
  color?: string;