@form-engine-ts/mui 2.9.3 → 2.9.5

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 CHANGED
@@ -9,7 +9,27 @@ import { MuiFormBuilder } from "@form-engine-ts/mui";
9
9
  <MuiFormBuilder
10
10
  schema={schema}
11
11
  onChange={setSchema}
12
- muiOptions={{ size: "small", variant: "outlined", buttonVariant: "contained", dense: true }}
12
+ translator={translator}
13
+ translationAdapter={translationAdapter}
14
+ muiOptions={{
15
+ size: "small",
16
+ variant: "outlined",
17
+ dense: true,
18
+ inputFullWidth: true,
19
+ buttonFullWidth: false,
20
+ fieldEditorOptions: { description: "hidden" },
21
+ getLocaleLabel: (locale) => localeNames[locale] ?? locale,
22
+ buttonVariants: { primary: "contained", secondary: "outlined", danger: "outlined" }
23
+ }}
24
+ layoutOptions={{
25
+ sectionOrder: ["basicSettings", "completionMessage", "questions", "addQuestion", "localization"]
26
+ }}
27
+ localizationOptions={{
28
+ collapsible: true,
29
+ defaultExpanded: "when-configured",
30
+ defaultLocaleControl: "readOnly"
31
+ }}
32
+ muiSlotProps={{ card: { sx: { p: 2 } }, accordion: { elevation: 0 } }}
13
33
  />;
14
34
  ```
15
35
 
@@ -21,5 +41,22 @@ For low-level composition, `createMuiBuilderProps(options, overrides)` returns `
21
41
  factories such as `createMuiTextInputAdapter`, `createMuiIconButtonAdapter`, `createMuiFieldEditorSlot`, and
22
42
  `createMuiLocalizationSlot`.
23
43
 
24
- `MuiAdapterOptions` defaults to `size: "medium"`, `variant: "outlined"`, `buttonVariant: "contained"`, and
25
- `fullWidth: true`. Set `dense` to reduce section, editor, option, and toolbar spacing.
44
+ All MUI builder slots use the `FormBuilder` translator for labels, actions, tooltips, and accessible names. Use
45
+ `getLocaleLabel` for application-specific locale names. The localization UI excludes `schema.defaultLocale` from its
46
+ translation tabs and follows `allowedLocales` and `maxLocales` from the builder policy.
47
+
48
+ Manual edits from the form, field, and option translation controls use the React builder's `setManualTranslation`
49
+ action. Consequently, `createManualTranslationMetadata` receives the same source text and existing metadata for the MUI
50
+ slots as it does for the standard builder.
51
+
52
+ `MuiAdapterOptions` defaults to `size: "medium"`, `variant: "outlined"`, `buttonVariant: "contained"`,
53
+ `inputFullWidth: true`, and `buttonFullWidth: false`. The legacy `fullWidth` option remains the fallback for both new
54
+ width options. `fieldEditorOptions.description` and `localizationOptions.defaultLocaleControl` independently make those
55
+ controls editable, read-only, or hidden. Set `dense` to reduce section, editor, option, and toolbar spacing.
56
+ `buttonVariants` can override the MUI variant for `primary`, `secondary`, and `danger` actions independently.
57
+ `layoutOptions`, `localizationOptions`, and `muiSlotProps` are also accepted in `muiOptions` for low-level factories such
58
+ as `createMuiBuilderSlots`; the dedicated `MuiFormBuilder` props take precedence.
59
+
60
+ `MuiFormBuilder` supplies options through `MuiFormBuilderContext` to module-stable adapter and slot component types.
61
+ Controlled schema updates therefore preserve input focus and uncontrolled MUI state such as an open localization
62
+ accordion even when the parent passes inline option objects.