@dmitryvim/form-builder 0.5.3 → 0.6.4

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
@@ -321,8 +321,8 @@ If you are stuck on a browser without `ResizeObserver` (very old) and cannot def
321
321
 
322
322
  - **Text**: Single-line with pattern validation, length limits
323
323
  - **Textarea**: Multi-line with configurable rows
324
- - **Number**: Numeric input with min/max/step/decimals
325
- - **Select**: Dropdown with options and default values
324
+ - **Number**: Numeric input with min/max/step/decimals (no `decimals` → value is kept as typed; set `decimals` to round on extraction)
325
+ - **Select**: Dropdown with options and default values. Renders a leading empty option (label: `placeholder` or a localized "Select…"); with no selection the field extracts as `null`, and `required` fails until an option is chosen (v0.6.0)
326
326
  - **Switcher**: Segmented button group (all options visible, ≤4) — same data model as Select
327
327
  - **Colour**: Colour picker with hex values (single or palette)
328
328
  - **Slider**: Range slider with linear/exponential scales (v0.2.7+)
@@ -389,6 +389,12 @@ const form = createFormBuilder({
389
389
  // v0.2.4: Verbose error logging
390
390
  verboseErrors?: boolean, // Default: false (memory leak warnings, validation details)
391
391
 
392
+ // v0.6.0: postMessage opt-in for submitForm()/saveDraft().
393
+ // null (default) = never post. Set the parent frame's origin — or "*" to
394
+ // knowingly broadcast — to receive {type: "formSubmit"|"formDraft", data, schema}
395
+ // messages on window.parent. (Before 0.6.0 the library always broadcast with "*".)
396
+ postMessageTarget?: string | null,
397
+
392
398
  // v0.2.0: CSS theming
393
399
  theme?: {
394
400
  primaryColor?: string,