@form-engine-ts/react 4.3.2 → 4.5.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/README.md +19 -2
- package/dist/index.cjs +559 -139
- package/dist/index.d.cts +97 -8
- package/dist/index.d.ts +97 -8
- package/dist/index.js +559 -136
- package/dist/styles.css +20 -9
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -41,13 +41,24 @@ Use any compatible `TranslationAdapter` in place of the mock translator.
|
|
|
41
41
|
|
|
42
42
|
## Choice field layout
|
|
43
43
|
|
|
44
|
-
Radio and
|
|
45
|
-
them as bordered, accessible `<fieldset>` groups with `<legend>` titles:
|
|
44
|
+
Radio, checkbox, and multi-select questions use the flat layout by default. Set `appearance.choiceField` to `"grouped"`
|
|
45
|
+
to render them as bordered, accessible `<fieldset>` groups with `<legend>` titles:
|
|
46
46
|
|
|
47
47
|
```tsx
|
|
48
48
|
<FormRenderer appearance={{ choiceField: "grouped" }} />
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
+
Use an object to configure each choice type independently. Unspecified types remain flat:
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
<FormRenderer appearance={{ choiceField: { radio: "grouped", checkbox: "default" } }} />
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Grouped wrappers can be replaced with `slots.renderChoiceGroup`; `slotProps.choiceGroup` accepts a class name and
|
|
58
|
+
inline style for the default wrapper. The exported `ChoiceGroupSlotProps` includes the field, translated error, and
|
|
59
|
+
option-list children. Group styling is controlled by the public `--fe-choice-group-*`, `--fe-choice-legend-*`, and
|
|
60
|
+
`--fe-choice-options-gap` CSS custom properties.
|
|
61
|
+
|
|
51
62
|
`groupedChoiceFields={true}` remains available as a deprecated compatibility alias.
|
|
52
63
|
|
|
53
64
|
Define `schema.pages` to enable Back/Next navigation, page validation, conditional page skipping, and an accessible
|
|
@@ -62,6 +73,12 @@ on the next mount:
|
|
|
62
73
|
membership controls and localization editors; pass an `AsyncTranslationAdapter` as `translationAdapter` to enable its
|
|
63
74
|
batch-translation action.
|
|
64
75
|
|
|
76
|
+
`useTranslationWorkspace` exposes locale management, translation slots, completion summaries, manual editing, and
|
|
77
|
+
single-slot or batch translation with stale/manual status handling. The MUI package exports a ready-made
|
|
78
|
+
`TranslationWorkspace` surface. For large forms, set `fieldEditorMode="single"` and use `activeFieldId` or the hook's
|
|
79
|
+
`setActiveFieldId` to keep one field editor open at a time. Set `submissionSettingsOptions={{ enabled: true }}` to expose
|
|
80
|
+
schema-driven pre-submit confirmation controls in the builder.
|
|
81
|
+
|
|
65
82
|
## Headless builder and renderer lifecycle
|
|
66
83
|
|
|
67
84
|
`useFormBuilder({ schema, onChange, policy, idFactory, factories })` exposes controlled field, option, page, condition,
|