@dmitryvim/form-builder 0.5.4 → 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 +7 -1
- package/dist/browser/formbuilder.min.js +136 -154
- package/dist/browser/formbuilder.v0.6.4.min.js +1472 -0
- package/dist/cjs/index.cjs +423 -445
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +368 -394
- package/dist/esm/index.js.map +1 -1
- package/dist/form-builder.js +136 -154
- package/dist/types/components/container.d.ts +0 -7
- package/dist/types/components/index.d.ts +1 -2
- package/dist/types/instance/FormBuilderInstance.d.ts +17 -4
- package/dist/types/instance/state.d.ts +8 -0
- package/dist/types/types/component-operations.d.ts +15 -0
- package/dist/types/types/config.d.ts +2 -0
- package/dist/types/types/state.d.ts +8 -0
- package/dist/types/utils/helpers.d.ts +18 -1
- package/dist/types/utils/styles.d.ts +13 -7
- package/package.json +1 -1
- package/dist/browser/formbuilder.v0.5.4.min.js +0 -1490
package/README.md
CHANGED
|
@@ -322,7 +322,7 @@ If you are stuck on a browser without `ResizeObserver` (very old) and cannot def
|
|
|
322
322
|
- **Text**: Single-line with pattern validation, length limits
|
|
323
323
|
- **Textarea**: Multi-line with configurable rows
|
|
324
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
|
|
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,
|