finform-react-builder 1.13.1 → 1.14.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.
- package/dist/components/FinForm/CustomButtons.d.ts +1 -0
- package/dist/components/FinForm/index.d.ts +2 -1
- package/dist/components/FinForm/inputs/FinAutocomplete.d.ts +4 -0
- package/dist/components/FinForm/inputs/FinCheckbox.d.ts +2 -0
- package/dist/components/FinForm/inputs/FinDateField.d.ts +3 -0
- package/dist/components/FinForm/inputs/FinSelect.d.ts +4 -0
- package/dist/components/FinForm/inputs/FinTextField.d.ts +3 -0
- package/dist/components/FinForm/inputs/FinTextarea.d.ts +3 -0
- package/dist/components/FinForm/testIds.d.ts +24 -0
- package/dist/components/FinForm/types.d.ts +21 -0
- package/dist/index.es.js +6076 -5907
- package/dist/index.js +51 -51
- package/package.json +1 -1
|
@@ -6,4 +6,5 @@ export { CustomButtons } from './CustomButtons';
|
|
|
6
6
|
export { generateSchema } from './generateSchema';
|
|
7
7
|
export { fetchApiData, hasApiConfig, getApiConfig, shouldShowField, useApiData } from './apiUtils';
|
|
8
8
|
export * from './inputs';
|
|
9
|
-
export type { FieldConfig, ValidationRule, FormButton, ButtonGroup, FormTitle, FormTheme, FinFormProps, ApiConfig, } from './types';
|
|
9
|
+
export type { FieldConfig, AutomationFieldConfig, ValidationRule, FormButton, ButtonGroup, FormTitle, FormTheme, FinFormProps, ApiConfig, } from './types';
|
|
10
|
+
export { buildFinformTestIds, resolveFieldTestIds } from './testIds';
|
|
@@ -21,5 +21,9 @@ export interface FinAutocompleteProps {
|
|
|
21
21
|
onOpen?: () => void;
|
|
22
22
|
noOptionsText?: string;
|
|
23
23
|
sx?: any;
|
|
24
|
+
inputTestId?: string;
|
|
25
|
+
labelTestId?: string;
|
|
26
|
+
errorTestId?: string;
|
|
27
|
+
optionTestId?: (optionValue: string | number) => string;
|
|
24
28
|
}
|
|
25
29
|
export declare const FinAutocomplete: React.FC<FinAutocompleteProps>;
|
|
@@ -4,6 +4,9 @@ export type FinDateFieldProps = TextFieldProps & {
|
|
|
4
4
|
label?: React.ReactNode;
|
|
5
5
|
labelPosition?: 'inner' | 'top' | 'none';
|
|
6
6
|
labelVariant?: 'caption' | 'body2' | 'subtitle2' | 'h6';
|
|
7
|
+
inputTestId?: string;
|
|
8
|
+
labelTestId?: string;
|
|
9
|
+
errorTestId?: string;
|
|
7
10
|
[key: string]: any;
|
|
8
11
|
};
|
|
9
12
|
export declare const FinDateField: React.FC<FinDateFieldProps>;
|
|
@@ -12,5 +12,9 @@ export interface FinSelectProps extends Omit<SelectProps, 'onChange'> {
|
|
|
12
12
|
onChange?: SelectProps['onChange'];
|
|
13
13
|
labelVariant?: 'caption' | 'body2' | 'subtitle2' | 'h6';
|
|
14
14
|
placeholder?: string;
|
|
15
|
+
inputTestId?: string;
|
|
16
|
+
labelTestId?: string;
|
|
17
|
+
errorTestId?: string;
|
|
18
|
+
optionTestId?: (optionValue: string | number) => string;
|
|
15
19
|
}
|
|
16
20
|
export declare const FinSelect: React.FC<FinSelectProps>;
|
|
@@ -11,5 +11,8 @@ export type FinTextFieldProps = TextFieldProps & {
|
|
|
11
11
|
endorsementRadius?: number | string;
|
|
12
12
|
endorsementHeight?: number;
|
|
13
13
|
endorsementPaddingX?: number;
|
|
14
|
+
inputTestId?: string;
|
|
15
|
+
labelTestId?: string;
|
|
16
|
+
errorTestId?: string;
|
|
14
17
|
};
|
|
15
18
|
export declare const FinTextField: React.FC<FinTextFieldProps>;
|
|
@@ -4,5 +4,8 @@ export type FinTextareaProps = TextFieldProps & {
|
|
|
4
4
|
labelText?: string;
|
|
5
5
|
labelVariant?: 'caption' | 'body2' | 'subtitle2' | 'h6';
|
|
6
6
|
hasError?: boolean;
|
|
7
|
+
inputTestId?: string;
|
|
8
|
+
labelTestId?: string;
|
|
9
|
+
errorTestId?: string;
|
|
7
10
|
};
|
|
8
11
|
export declare const FinTextarea: React.FC<FinTextareaProps>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FieldConfig } from './types';
|
|
2
|
+
export interface FinformFieldTestIds {
|
|
3
|
+
field: string;
|
|
4
|
+
label: string;
|
|
5
|
+
input: string;
|
|
6
|
+
error: string;
|
|
7
|
+
section: string;
|
|
8
|
+
upload: string;
|
|
9
|
+
preview: string;
|
|
10
|
+
remove: string;
|
|
11
|
+
replace: string;
|
|
12
|
+
option: (optionValue: string | number) => string;
|
|
13
|
+
submit: string;
|
|
14
|
+
cancel: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function buildFinformTestIds(prefix: string, fieldName: string): FinformFieldTestIds;
|
|
17
|
+
export type ResolvedFieldTestIds = Omit<FinformFieldTestIds, 'submit' | 'cancel' | 'option'> & {
|
|
18
|
+
option: (optionValue: string | number) => string;
|
|
19
|
+
};
|
|
20
|
+
export declare function resolveFieldTestIds(prefix: string | undefined, field: FieldConfig): ResolvedFieldTestIds | null;
|
|
21
|
+
export declare function resolveFormButtonTestIds(prefix: string | undefined): {
|
|
22
|
+
submit: string;
|
|
23
|
+
cancel: string;
|
|
24
|
+
} | null;
|
|
@@ -341,6 +341,18 @@ export interface DragDropListField extends Omit<BaseField, 'helperText'> {
|
|
|
341
341
|
sx?: any;
|
|
342
342
|
}
|
|
343
343
|
export type FieldConfig = TextField | NumberField | SelectField | CheckboxField | CheckboxGroupField | ToggleField | RadioField | SwitchField | AutocompleteField | DateField | ImageField | TitleField | SectionField | ComponentField | FinUiHeaderField | TabsField | GridField | ListCardsField | DragDropListField;
|
|
344
|
+
export type AutomationFieldConfig = FieldConfig & {
|
|
345
|
+
testId?: string;
|
|
346
|
+
automation?: {
|
|
347
|
+
skip?: boolean;
|
|
348
|
+
fieldTestId?: string;
|
|
349
|
+
inputTestId?: string;
|
|
350
|
+
labelTestId?: string;
|
|
351
|
+
errorTestId?: string;
|
|
352
|
+
sampleValue?: unknown;
|
|
353
|
+
invalidValue?: unknown;
|
|
354
|
+
};
|
|
355
|
+
};
|
|
344
356
|
export interface FormButton {
|
|
345
357
|
text: string;
|
|
346
358
|
color?: string;
|
|
@@ -408,6 +420,8 @@ export interface FinFormProps {
|
|
|
408
420
|
showStepTitles?: boolean;
|
|
409
421
|
stepTitles?: string[];
|
|
410
422
|
};
|
|
423
|
+
/** Prefix for stable data-testid attributes on generated form controls (e.g. "client-profile"). */
|
|
424
|
+
testIdPrefix?: string;
|
|
411
425
|
}
|
|
412
426
|
export interface FieldRendererProps {
|
|
413
427
|
field: FieldConfig;
|
|
@@ -417,6 +431,13 @@ export interface FieldRendererProps {
|
|
|
417
431
|
apiHeaders?: Record<string, string>;
|
|
418
432
|
formData?: Record<string, any>;
|
|
419
433
|
setValue?: (name: string, value: any, options?: any) => void;
|
|
434
|
+
testIdPrefix?: string;
|
|
435
|
+
}
|
|
436
|
+
export interface FinInputTestIdProps {
|
|
437
|
+
inputTestId?: string;
|
|
438
|
+
labelTestId?: string;
|
|
439
|
+
errorTestId?: string;
|
|
440
|
+
optionTestId?: (optionValue: string | number) => string;
|
|
420
441
|
}
|
|
421
442
|
export interface StepNavigationProps {
|
|
422
443
|
currentStep: number;
|