finform-react-builder 1.8.28 → 1.8.30
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.
- package/dist/components/FinForm/inputs/FinCheckboxGroup.d.ts +34 -0
- package/dist/components/FinForm/inputs/FinRadioGroup.d.ts +1 -0
- package/dist/components/FinForm/inputs/index.d.ts +1 -0
- package/dist/components/FinForm/types.d.ts +25 -2
- package/dist/index.es.js +3342 -3063
- package/dist/index.js +36 -36
- package/package.json +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface FinCheckboxOption {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string | number;
|
|
5
|
+
}
|
|
6
|
+
export interface FinCheckboxGroupProps {
|
|
7
|
+
/** Optional section heading above the group */
|
|
8
|
+
labelText?: string;
|
|
9
|
+
/** The inner label for the checkbox group itself (accessible) */
|
|
10
|
+
label?: string;
|
|
11
|
+
/** The currently selected values (array) */
|
|
12
|
+
value: (string | number)[];
|
|
13
|
+
/** The list of options */
|
|
14
|
+
options: FinCheckboxOption[];
|
|
15
|
+
/** Layout: 'row' | 'column' | number (for grid columns, e.g., 2, 3, 4) */
|
|
16
|
+
row?: boolean | number;
|
|
17
|
+
/** Handles change */
|
|
18
|
+
onChange: (values: (string | number)[]) => void;
|
|
19
|
+
/** Top heading or none */
|
|
20
|
+
labelPosition?: 'top' | 'none';
|
|
21
|
+
/** Typography variant for the heading */
|
|
22
|
+
labelVariant?: 'caption' | 'body2' | 'subtitle2' | 'h6';
|
|
23
|
+
/** Optional helper text under the group */
|
|
24
|
+
helperText?: string;
|
|
25
|
+
/** Optional error state */
|
|
26
|
+
error?: boolean;
|
|
27
|
+
/** Group padding multiplier */
|
|
28
|
+
groupPadding?: number;
|
|
29
|
+
/** Gap between checkbox options */
|
|
30
|
+
itemGap?: number;
|
|
31
|
+
/** Disabled state */
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare const FinCheckboxGroup: React.FC<FinCheckboxGroupProps>;
|
|
@@ -2,6 +2,7 @@ export * from './FinTextField';
|
|
|
2
2
|
export * from './FinSelect';
|
|
3
3
|
export * from './FinAutocomplete';
|
|
4
4
|
export * from './FinCheckbox';
|
|
5
|
+
export * from './FinCheckboxGroup';
|
|
5
6
|
export * from './FinSwitch';
|
|
6
7
|
export * from './FinRadioGroup';
|
|
7
8
|
export * from './FinDateField';
|
|
@@ -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' | 'grid' | 'listcards';
|
|
32
|
+
type: 'text' | 'email' | 'password' | 'number' | 'tel' | 'select' | 'checkbox' | 'checkboxGroup' | 'toggle' | 'radio' | 'switch' | 'autocomplete' | 'date' | 'textarea' | 'image' | 'title' | 'section' | 'component' | 'finuiHeader' | 'tabs' | 'grid' | 'listcards';
|
|
33
33
|
placeholder?: string;
|
|
34
34
|
labelPosition?: 'inner' | 'top' | 'none';
|
|
35
35
|
labelVariant?: 'caption' | 'body2' | 'subtitle2' | 'h6';
|
|
@@ -55,6 +55,13 @@ export interface BaseField {
|
|
|
55
55
|
depends_on?: string;
|
|
56
56
|
conditional?: boolean;
|
|
57
57
|
apiConfig?: ApiConfig;
|
|
58
|
+
showWhen?: ((formData: any) => boolean) | {
|
|
59
|
+
field: string;
|
|
60
|
+
equals: any;
|
|
61
|
+
} | {
|
|
62
|
+
field: string;
|
|
63
|
+
in: any[];
|
|
64
|
+
};
|
|
58
65
|
}
|
|
59
66
|
export interface TextField extends BaseField {
|
|
60
67
|
type: 'text' | 'email' | 'password' | 'tel' | 'textarea';
|
|
@@ -94,10 +101,26 @@ export interface ToggleField extends BaseField {
|
|
|
94
101
|
}
|
|
95
102
|
export interface RadioField extends BaseField {
|
|
96
103
|
type: 'radio';
|
|
104
|
+
options: Array<{
|
|
105
|
+
label: string;
|
|
106
|
+
value: string | number;
|
|
107
|
+
description?: string;
|
|
108
|
+
}>;
|
|
109
|
+
row?: boolean;
|
|
110
|
+
groupPadding?: number;
|
|
111
|
+
itemGap?: number;
|
|
112
|
+
helperText?: string;
|
|
113
|
+
}
|
|
114
|
+
export interface CheckboxGroupField extends BaseField {
|
|
115
|
+
type: 'checkboxGroup';
|
|
97
116
|
options: Array<{
|
|
98
117
|
label: string;
|
|
99
118
|
value: string | number;
|
|
100
119
|
}>;
|
|
120
|
+
row?: boolean | number;
|
|
121
|
+
groupPadding?: number;
|
|
122
|
+
itemGap?: number;
|
|
123
|
+
helperText?: string;
|
|
101
124
|
}
|
|
102
125
|
export interface SwitchField extends BaseField {
|
|
103
126
|
type: 'switch';
|
|
@@ -298,7 +321,7 @@ export interface ListCardsField extends BaseField {
|
|
|
298
321
|
sx?: any;
|
|
299
322
|
cardSx?: any;
|
|
300
323
|
}
|
|
301
|
-
export type FieldConfig = TextField | NumberField | SelectField | CheckboxField | ToggleField | RadioField | SwitchField | AutocompleteField | DateField | ImageField | TitleField | SectionField | ComponentField | FinUiHeaderField | TabsField | GridField | ListCardsField;
|
|
324
|
+
export type FieldConfig = TextField | NumberField | SelectField | CheckboxField | CheckboxGroupField | ToggleField | RadioField | SwitchField | AutocompleteField | DateField | ImageField | TitleField | SectionField | ComponentField | FinUiHeaderField | TabsField | GridField | ListCardsField;
|
|
302
325
|
export interface FormButton {
|
|
303
326
|
text: string;
|
|
304
327
|
color?: string;
|