@vef-framework-react/form-editor 2.4.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/cjs/_internal/_rolldown/runtime.cjs +1 -0
- package/dist/cjs/components/button/index.cjs +1 -0
- package/dist/cjs/components/checkbox-group-field/index.cjs +1 -0
- package/dist/cjs/components/code-editor/code-editor-input.cjs +1 -0
- package/dist/cjs/components/code-editor/index.cjs +1 -0
- package/dist/cjs/components/containers/index.cjs +1 -0
- package/dist/cjs/components/date-field/index.cjs +1 -0
- package/dist/cjs/components/display/index.cjs +1 -0
- package/dist/cjs/components/field-entries.cjs +1 -0
- package/dist/cjs/components/mobile/alert-block.cjs +1 -0
- package/dist/cjs/components/mobile/button.cjs +1 -0
- package/dist/cjs/components/mobile/checkbox-group.cjs +1 -0
- package/dist/cjs/components/mobile/date-adapters.cjs +1 -0
- package/dist/cjs/components/mobile/date.cjs +1 -0
- package/dist/cjs/components/mobile/daterange.cjs +1 -0
- package/dist/cjs/components/mobile/datetime.cjs +1 -0
- package/dist/cjs/components/mobile/definitions.cjs +1 -0
- package/dist/cjs/components/mobile/divider.cjs +1 -0
- package/dist/cjs/components/mobile/input-cell.cjs +1 -0
- package/dist/cjs/components/mobile/number.cjs +1 -0
- package/dist/cjs/components/mobile/option-group.cjs +1 -0
- package/dist/cjs/components/mobile/paragraph.cjs +1 -0
- package/dist/cjs/components/mobile/picker-trigger.cjs +1 -0
- package/dist/cjs/components/mobile/radio.cjs +1 -0
- package/dist/cjs/components/mobile/scope.cjs +1 -0
- package/dist/cjs/components/mobile/select.cjs +1 -0
- package/dist/cjs/components/mobile/switch.cjs +1 -0
- package/dist/cjs/components/mobile/textarea.cjs +1 -0
- package/dist/cjs/components/mobile/textfield.cjs +1 -0
- package/dist/cjs/components/mobile/theme.cjs +1 -0
- package/dist/cjs/components/number-field/index.cjs +1 -0
- package/dist/cjs/components/radio-field/index.cjs +1 -0
- package/dist/cjs/components/select-field/index.cjs +1 -0
- package/dist/cjs/components/switch-field/index.cjs +1 -0
- package/dist/cjs/components/textarea-field/index.cjs +1 -0
- package/dist/cjs/components/textfield/index.cjs +1 -0
- package/dist/cjs/editor/canvas/canvas-field.cjs +1 -0
- package/dist/cjs/editor/canvas/canvas.cjs +1 -0
- package/dist/cjs/editor/canvas/drop-indicator.cjs +1 -0
- package/dist/cjs/editor/canvas/drop-zones.cjs +1 -0
- package/dist/cjs/editor/canvas/json-split-view.cjs +1 -0
- package/dist/cjs/editor/canvas/mobile-seed-state.cjs +2 -0
- package/dist/cjs/editor/canvas/phone-frame.cjs +1 -0
- package/dist/cjs/editor/dnd.cjs +1 -0
- package/dist/cjs/editor/editor-layout-context.cjs +1 -0
- package/dist/cjs/editor/footer/footer.cjs +1 -0
- package/dist/cjs/editor/form-config/form-basics-tab.cjs +1 -0
- package/dist/cjs/editor/form-config/form-config-drawer.cjs +1 -0
- package/dist/cjs/editor/form-config/outline-tab.cjs +1 -0
- package/dist/cjs/editor/form-editor.cjs +1 -0
- package/dist/cjs/editor/palette/field-groups.cjs +1 -0
- package/dist/cjs/editor/palette/palette-group.cjs +1 -0
- package/dist/cjs/editor/palette/palette-item.cjs +1 -0
- package/dist/cjs/editor/palette/palette-panel.cjs +1 -0
- package/dist/cjs/editor/preview-effects.cjs +1 -0
- package/dist/cjs/editor/preview-runtime-context.cjs +1 -0
- package/dist/cjs/editor/properties/block-layout-section.cjs +1 -0
- package/dist/cjs/editor/properties/container-properties.cjs +1 -0
- package/dist/cjs/editor/properties/entries/built-ins.cjs +1 -0
- package/dist/cjs/editor/properties/entries/checkbox-entry.cjs +1 -0
- package/dist/cjs/editor/properties/entries/coerce.cjs +1 -0
- package/dist/cjs/editor/properties/entries/entry-field.cjs +1 -0
- package/dist/cjs/editor/properties/entries/icon-entry.cjs +1 -0
- package/dist/cjs/editor/properties/entries/index.cjs +1 -0
- package/dist/cjs/editor/properties/entries/key-entry.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/action-editor.cjs +2 -0
- package/dist/cjs/editor/properties/entries/linkage/actions-editor.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/condition-editor.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/container-linkage-section.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/expression-assist.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/index.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/linkage-rules-entry.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/mutators.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/options.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/rule-diagnostics.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/rule-list-editor.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/styles.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/trigger-editor.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/use-linkage-editor-model.cjs +1 -0
- package/dist/cjs/editor/properties/entries/linkage/use-stable-options.cjs +1 -0
- package/dist/cjs/editor/properties/entries/number-entry.cjs +1 -0
- package/dist/cjs/editor/properties/entries/options-source/index.cjs +1 -0
- package/dist/cjs/editor/properties/entries/options-source/source-mutators.cjs +1 -0
- package/dist/cjs/editor/properties/entries/select-entry.cjs +1 -0
- package/dist/cjs/editor/properties/entries/text-entry.cjs +1 -0
- package/dist/cjs/editor/properties/form-data-sources-panel.cjs +1 -0
- package/dist/cjs/editor/properties/form-linkage-panel.cjs +1 -0
- package/dist/cjs/editor/properties/form-variables-panel.cjs +1 -0
- package/dist/cjs/editor/properties/option-editors.cjs +1 -0
- package/dist/cjs/editor/properties/panel-header.cjs +1 -0
- package/dist/cjs/editor/properties/properties-empty.cjs +1 -0
- package/dist/cjs/editor/properties/properties-header.cjs +1 -0
- package/dist/cjs/editor/properties/properties-panel.cjs +1 -0
- package/dist/cjs/editor/properties/properties-provider.cjs +1 -0
- package/dist/cjs/editor/properties/properties-tabs.cjs +1 -0
- package/dist/cjs/editor/properties/use-confirmable-kind-switch.cjs +1 -0
- package/dist/cjs/editor/remove-node-confirm.cjs +1 -0
- package/dist/cjs/editor/schema-apply.cjs +2 -0
- package/dist/cjs/editor/styles.cjs +1 -0
- package/dist/cjs/editor/toolbar/notify.cjs +1 -0
- package/dist/cjs/editor/toolbar/schema-io.cjs +1 -0
- package/dist/cjs/editor/toolbar/toolbar.cjs +1 -0
- package/dist/cjs/editor/use-editor-shortcuts.cjs +1 -0
- package/dist/cjs/editor/validation-summary.cjs +1 -0
- package/dist/cjs/engine/assert-never.cjs +1 -0
- package/dist/cjs/engine/conversion/index.cjs +1 -0
- package/dist/cjs/engine/ids.cjs +1 -0
- package/dist/cjs/engine/keys.cjs +1 -0
- package/dist/cjs/engine/linkage/cycle.cjs +1 -0
- package/dist/cjs/engine/linkage/default-evaluator.cjs +1 -0
- package/dist/cjs/engine/linkage/effects.cjs +1 -0
- package/dist/cjs/engine/linkage/evaluator.cjs +1 -0
- package/dist/cjs/engine/linkage/index.cjs +1 -0
- package/dist/cjs/engine/linkage/operators.cjs +1 -0
- package/dist/cjs/engine/linkage/source-tracking.cjs +1 -0
- package/dist/cjs/engine/linkage/taxonomy.cjs +1 -0
- package/dist/cjs/engine/linkage/validator.cjs +1 -0
- package/dist/cjs/engine/registry/defaults-mobile.cjs +1 -0
- package/dist/cjs/engine/registry/defaults.cjs +1 -0
- package/dist/cjs/engine/registry/form-field-registry.cjs +1 -0
- package/dist/cjs/engine/schema/edit-ops.cjs +1 -0
- package/dist/cjs/engine/schema/mutate.cjs +1 -0
- package/dist/cjs/engine/schema/nodes.cjs +1 -0
- package/dist/cjs/engine/schema/permission-bridge.cjs +1 -0
- package/dist/cjs/engine/schema/presentation.cjs +1 -0
- package/dist/cjs/engine/schema/reconcile.cjs +1 -0
- package/dist/cjs/engine/schema/removal-impact.cjs +1 -0
- package/dist/cjs/engine/schema/rewrite.cjs +1 -0
- package/dist/cjs/engine/schema/validate.cjs +1 -0
- package/dist/cjs/engine/schema/walk.cjs +1 -0
- package/dist/cjs/engine/validation.cjs +1 -0
- package/dist/cjs/icons.cjs +1 -0
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/render/chrome/mobile-chrome.cjs +1 -0
- package/dist/cjs/render/chrome/pc-chrome.cjs +1 -0
- package/dist/cjs/render/chrome/subform-shell.cjs +1 -0
- package/dist/cjs/render/data-source-context.cjs +0 -0
- package/dist/cjs/render/flex-style.cjs +1 -0
- package/dist/cjs/render/form-field.cjs +1 -0
- package/dist/cjs/render/form-renderer.cjs +1 -0
- package/dist/cjs/render/grid-style.cjs +1 -0
- package/dist/cjs/render/parts/field-shell.cjs +1 -0
- package/dist/cjs/render/parts/label.cjs +1 -0
- package/dist/cjs/render/parts/options-status.cjs +1 -0
- package/dist/cjs/render/stack-style.cjs +1 -0
- package/dist/cjs/render/subform-columns.cjs +1 -0
- package/dist/cjs/render/submit.cjs +1 -0
- package/dist/cjs/runtime/effects.cjs +1 -0
- package/dist/cjs/runtime/resolve-scope-values.cjs +1 -0
- package/dist/cjs/runtime/runtime-context.cjs +1 -0
- package/dist/cjs/runtime/runtime-state-controller.cjs +1 -0
- package/dist/cjs/runtime/stabilize-state-map.cjs +1 -0
- package/dist/cjs/store/engine-provider.cjs +1 -0
- package/dist/cjs/store/form-store.cjs +1 -0
- package/dist/cjs/types/chrome.cjs +0 -0
- package/dist/cjs/types/component.cjs +1 -0
- package/dist/cjs/types/data-source.cjs +1 -0
- package/dist/cjs/types/index.cjs +1 -0
- package/dist/cjs/types/linkage.cjs +0 -0
- package/dist/cjs/types/properties.cjs +1 -0
- package/dist/cjs/types/schema.cjs +1 -0
- package/dist/es/components/button/index.js +183 -0
- package/dist/es/components/checkbox-group-field/index.js +103 -0
- package/dist/es/components/code-editor/code-editor-input.js +3 -0
- package/dist/es/components/code-editor/index.js +212 -0
- package/dist/es/components/containers/index.js +72 -0
- package/dist/es/components/date-field/index.js +197 -0
- package/dist/es/components/display/index.js +276 -0
- package/dist/es/components/field-entries.js +184 -0
- package/dist/es/components/mobile/alert-block.js +40 -0
- package/dist/es/components/mobile/button.js +41 -0
- package/dist/es/components/mobile/checkbox-group.js +35 -0
- package/dist/es/components/mobile/date-adapters.js +16 -0
- package/dist/es/components/mobile/date.js +42 -0
- package/dist/es/components/mobile/daterange.js +48 -0
- package/dist/es/components/mobile/datetime.js +42 -0
- package/dist/es/components/mobile/definitions.js +58 -0
- package/dist/es/components/mobile/divider.js +10 -0
- package/dist/es/components/mobile/input-cell.js +56 -0
- package/dist/es/components/mobile/number.js +73 -0
- package/dist/es/components/mobile/option-group.js +34 -0
- package/dist/es/components/mobile/paragraph.js +30 -0
- package/dist/es/components/mobile/picker-trigger.js +94 -0
- package/dist/es/components/mobile/radio.js +35 -0
- package/dist/es/components/mobile/scope.js +61 -0
- package/dist/es/components/mobile/select.js +45 -0
- package/dist/es/components/mobile/switch.js +22 -0
- package/dist/es/components/mobile/textarea.js +32 -0
- package/dist/es/components/mobile/textfield.js +30 -0
- package/dist/es/components/mobile/theme.js +8 -0
- package/dist/es/components/number-field/index.js +186 -0
- package/dist/es/components/radio-field/index.js +139 -0
- package/dist/es/components/select-field/index.js +128 -0
- package/dist/es/components/switch-field/index.js +133 -0
- package/dist/es/components/textarea-field/index.js +137 -0
- package/dist/es/components/textfield/index.js +138 -0
- package/dist/es/editor/canvas/canvas-field.js +202 -0
- package/dist/es/editor/canvas/canvas.js +415 -0
- package/dist/es/editor/canvas/drop-indicator.js +42 -0
- package/dist/es/editor/canvas/drop-zones.js +42 -0
- package/dist/es/editor/canvas/json-split-view.js +148 -0
- package/dist/es/editor/canvas/mobile-seed-state.js +103 -0
- package/dist/es/editor/canvas/phone-frame.js +109 -0
- package/dist/es/editor/dnd.js +75 -0
- package/dist/es/editor/editor-layout-context.js +34 -0
- package/dist/es/editor/footer/footer.js +154 -0
- package/dist/es/editor/form-config/form-basics-tab.js +184 -0
- package/dist/es/editor/form-config/form-config-drawer.js +224 -0
- package/dist/es/editor/form-config/outline-tab.js +132 -0
- package/dist/es/editor/form-editor.js +179 -0
- package/dist/es/editor/palette/field-groups.js +19 -0
- package/dist/es/editor/palette/palette-group.js +147 -0
- package/dist/es/editor/palette/palette-item.js +153 -0
- package/dist/es/editor/palette/palette-panel.js +109 -0
- package/dist/es/editor/preview-effects.js +22 -0
- package/dist/es/editor/preview-runtime-context.js +24 -0
- package/dist/es/editor/properties/block-layout-section.js +161 -0
- package/dist/es/editor/properties/container-properties.js +575 -0
- package/dist/es/editor/properties/entries/built-ins.js +21 -0
- package/dist/es/editor/properties/entries/checkbox-entry.js +31 -0
- package/dist/es/editor/properties/entries/coerce.js +8 -0
- package/dist/es/editor/properties/entries/entry-field.js +43 -0
- package/dist/es/editor/properties/entries/icon-entry.js +21 -0
- package/dist/es/editor/properties/entries/index.js +9 -0
- package/dist/es/editor/properties/entries/key-entry.js +29 -0
- package/dist/es/editor/properties/entries/linkage/action-editor.js +260 -0
- package/dist/es/editor/properties/entries/linkage/actions-editor.js +64 -0
- package/dist/es/editor/properties/entries/linkage/condition-editor.js +265 -0
- package/dist/es/editor/properties/entries/linkage/container-linkage-section.js +71 -0
- package/dist/es/editor/properties/entries/linkage/expression-assist.js +87 -0
- package/dist/es/editor/properties/entries/linkage/index.js +3 -0
- package/dist/es/editor/properties/entries/linkage/linkage-rules-entry.js +110 -0
- package/dist/es/editor/properties/entries/linkage/mutators.js +209 -0
- package/dist/es/editor/properties/entries/linkage/options.js +155 -0
- package/dist/es/editor/properties/entries/linkage/rule-diagnostics.js +58 -0
- package/dist/es/editor/properties/entries/linkage/rule-list-editor.js +126 -0
- package/dist/es/editor/properties/entries/linkage/styles.js +276 -0
- package/dist/es/editor/properties/entries/linkage/trigger-editor.js +64 -0
- package/dist/es/editor/properties/entries/linkage/use-linkage-editor-model.js +20 -0
- package/dist/es/editor/properties/entries/linkage/use-stable-options.js +12 -0
- package/dist/es/editor/properties/entries/number-entry.js +25 -0
- package/dist/es/editor/properties/entries/options-source/index.js +122 -0
- package/dist/es/editor/properties/entries/options-source/source-mutators.js +31 -0
- package/dist/es/editor/properties/entries/select-entry.js +23 -0
- package/dist/es/editor/properties/entries/text-entry.js +23 -0
- package/dist/es/editor/properties/form-data-sources-panel.js +170 -0
- package/dist/es/editor/properties/form-linkage-panel.js +36 -0
- package/dist/es/editor/properties/form-variables-panel.js +184 -0
- package/dist/es/editor/properties/option-editors.js +170 -0
- package/dist/es/editor/properties/panel-header.js +93 -0
- package/dist/es/editor/properties/properties-empty.js +62 -0
- package/dist/es/editor/properties/properties-header.js +31 -0
- package/dist/es/editor/properties/properties-panel.js +195 -0
- package/dist/es/editor/properties/properties-provider.js +95 -0
- package/dist/es/editor/properties/properties-tabs.js +91 -0
- package/dist/es/editor/properties/use-confirmable-kind-switch.js +26 -0
- package/dist/es/editor/remove-node-confirm.js +60 -0
- package/dist/es/editor/schema-apply.js +36 -0
- package/dist/es/editor/styles.js +74 -0
- package/dist/es/editor/toolbar/notify.js +59 -0
- package/dist/es/editor/toolbar/schema-io.js +107 -0
- package/dist/es/editor/toolbar/toolbar.js +394 -0
- package/dist/es/editor/use-editor-shortcuts.js +43 -0
- package/dist/es/editor/validation-summary.js +66 -0
- package/dist/es/engine/assert-never.js +8 -0
- package/dist/es/engine/conversion/index.js +127 -0
- package/dist/es/engine/ids.js +18 -0
- package/dist/es/engine/keys.js +48 -0
- package/dist/es/engine/linkage/cycle.js +25 -0
- package/dist/es/engine/linkage/default-evaluator.js +79 -0
- package/dist/es/engine/linkage/effects.js +41 -0
- package/dist/es/engine/linkage/evaluator.js +119 -0
- package/dist/es/engine/linkage/index.js +9 -0
- package/dist/es/engine/linkage/operators.js +44 -0
- package/dist/es/engine/linkage/source-tracking.js +17 -0
- package/dist/es/engine/linkage/taxonomy.js +51 -0
- package/dist/es/engine/linkage/validator.js +360 -0
- package/dist/es/engine/registry/defaults-mobile.js +12 -0
- package/dist/es/engine/registry/defaults.js +25 -0
- package/dist/es/engine/registry/form-field-registry.js +52 -0
- package/dist/es/engine/schema/edit-ops.js +264 -0
- package/dist/es/engine/schema/mutate.js +39 -0
- package/dist/es/engine/schema/nodes.js +61 -0
- package/dist/es/engine/schema/permission-bridge.js +46 -0
- package/dist/es/engine/schema/presentation.js +37 -0
- package/dist/es/engine/schema/reconcile.js +258 -0
- package/dist/es/engine/schema/removal-impact.js +59 -0
- package/dist/es/engine/schema/rewrite.js +11 -0
- package/dist/es/engine/schema/validate.js +320 -0
- package/dist/es/engine/schema/walk.js +103 -0
- package/dist/es/engine/validation.js +122 -0
- package/dist/es/icons.js +74 -0
- package/dist/es/index.js +54 -0
- package/dist/es/render/chrome/mobile-chrome.js +119 -0
- package/dist/es/render/chrome/pc-chrome.js +76 -0
- package/dist/es/render/chrome/subform-shell.js +38 -0
- package/dist/es/render/data-source-context.js +0 -0
- package/dist/es/render/flex-style.js +24 -0
- package/dist/es/render/form-field.js +37 -0
- package/dist/es/render/form-renderer.js +516 -0
- package/dist/es/render/grid-style.js +23 -0
- package/dist/es/render/parts/field-shell.js +119 -0
- package/dist/es/render/parts/label.js +44 -0
- package/dist/es/render/parts/options-status.js +19 -0
- package/dist/es/render/stack-style.js +13 -0
- package/dist/es/render/subform-columns.js +118 -0
- package/dist/es/render/submit.js +112 -0
- package/dist/es/runtime/effects.js +109 -0
- package/dist/es/runtime/resolve-scope-values.js +14 -0
- package/dist/es/runtime/runtime-context.js +10 -0
- package/dist/es/runtime/runtime-state-controller.js +99 -0
- package/dist/es/runtime/stabilize-state-map.js +14 -0
- package/dist/es/store/engine-provider.js +37 -0
- package/dist/es/store/form-store.js +306 -0
- package/dist/es/types/chrome.js +1 -0
- package/dist/es/types/component.js +13 -0
- package/dist/es/types/data-source.js +5 -0
- package/dist/es/types/index.js +5 -0
- package/dist/es/types/linkage.js +1 -0
- package/dist/es/types/properties.js +7 -0
- package/dist/es/types/schema.js +15 -0
- package/dist/types/src/components/button/index.d.ts +8 -0
- package/dist/types/src/components/checkbox-group-field/index.d.ts +2 -0
- package/dist/types/src/components/code-editor/code-editor-input.d.ts +1 -0
- package/dist/types/src/components/code-editor/index.d.ts +4 -0
- package/dist/types/src/components/containers/index.d.ts +12 -0
- package/dist/types/src/components/date-field/index.d.ts +4 -0
- package/dist/types/src/components/display/index.d.ts +4 -0
- package/dist/types/src/components/field-entries.d.ts +103 -0
- package/dist/types/src/components/mobile/alert-block.d.ts +12 -0
- package/dist/types/src/components/mobile/button.d.ts +9 -0
- package/dist/types/src/components/mobile/checkbox-group.d.ts +11 -0
- package/dist/types/src/components/mobile/date-adapters.d.ts +28 -0
- package/dist/types/src/components/mobile/date.d.ts +10 -0
- package/dist/types/src/components/mobile/daterange.d.ts +11 -0
- package/dist/types/src/components/mobile/datetime.d.ts +10 -0
- package/dist/types/src/components/mobile/definitions.d.ts +9 -0
- package/dist/types/src/components/mobile/divider.d.ts +10 -0
- package/dist/types/src/components/mobile/input-cell.d.ts +30 -0
- package/dist/types/src/components/mobile/number.d.ts +25 -0
- package/dist/types/src/components/mobile/option-group.d.ts +17 -0
- package/dist/types/src/components/mobile/paragraph.d.ts +10 -0
- package/dist/types/src/components/mobile/picker-trigger.d.ts +31 -0
- package/dist/types/src/components/mobile/radio.d.ts +12 -0
- package/dist/types/src/components/mobile/scope.d.ts +42 -0
- package/dist/types/src/components/mobile/select.d.ts +12 -0
- package/dist/types/src/components/mobile/switch.d.ts +14 -0
- package/dist/types/src/components/mobile/textarea.d.ts +3 -0
- package/dist/types/src/components/mobile/textfield.d.ts +11 -0
- package/dist/types/src/components/mobile/theme.d.ts +16 -0
- package/dist/types/src/components/number-field/index.d.ts +2 -0
- package/dist/types/src/components/radio-field/index.d.ts +2 -0
- package/dist/types/src/components/select-field/index.d.ts +2 -0
- package/dist/types/src/components/switch-field/index.d.ts +2 -0
- package/dist/types/src/components/textarea-field/index.d.ts +2 -0
- package/dist/types/src/components/textfield/index.d.ts +11 -0
- package/dist/types/src/editor/canvas/canvas-field.d.ts +24 -0
- package/dist/types/src/editor/canvas/canvas.d.ts +11 -0
- package/dist/types/src/editor/canvas/drop-indicator.d.ts +14 -0
- package/dist/types/src/editor/canvas/drop-zones.d.ts +48 -0
- package/dist/types/src/editor/canvas/json-split-view.d.ts +15 -0
- package/dist/types/src/editor/canvas/mobile-seed-state.d.ts +9 -0
- package/dist/types/src/editor/canvas/phone-frame.d.ts +15 -0
- package/dist/types/src/editor/dnd.d.ts +88 -0
- package/dist/types/src/editor/editor-layout-context.d.ts +53 -0
- package/dist/types/src/editor/footer/footer.d.ts +7 -0
- package/dist/types/src/editor/form-config/form-basics-tab.d.ts +34 -0
- package/dist/types/src/editor/form-config/form-config-drawer.d.ts +8 -0
- package/dist/types/src/editor/form-config/outline-tab.d.ts +2 -0
- package/dist/types/src/editor/form-editor.d.ts +142 -0
- package/dist/types/src/editor/palette/field-groups.d.ts +12 -0
- package/dist/types/src/editor/palette/palette-group.d.ts +31 -0
- package/dist/types/src/editor/palette/palette-item.d.ts +34 -0
- package/dist/types/src/editor/palette/palette-panel.d.ts +17 -0
- package/dist/types/src/editor/preview-effects.d.ts +14 -0
- package/dist/types/src/editor/preview-runtime-context.d.ts +23 -0
- package/dist/types/src/editor/properties/block-layout-section.d.ts +19 -0
- package/dist/types/src/editor/properties/container-properties.d.ts +19 -0
- package/dist/types/src/editor/properties/entries/built-ins.d.ts +19 -0
- package/dist/types/src/editor/properties/entries/checkbox-entry.d.ts +3 -0
- package/dist/types/src/editor/properties/entries/coerce.d.ts +6 -0
- package/dist/types/src/editor/properties/entries/entry-field.d.ts +29 -0
- package/dist/types/src/editor/properties/entries/icon-entry.d.ts +8 -0
- package/dist/types/src/editor/properties/entries/index.d.ts +8 -0
- package/dist/types/src/editor/properties/entries/key-entry.d.ts +14 -0
- package/dist/types/src/editor/properties/entries/linkage/action-editor.d.ts +42 -0
- package/dist/types/src/editor/properties/entries/linkage/actions-editor.d.ts +43 -0
- package/dist/types/src/editor/properties/entries/linkage/condition-editor.d.ts +28 -0
- package/dist/types/src/editor/properties/entries/linkage/container-linkage-section.d.ts +14 -0
- package/dist/types/src/editor/properties/entries/linkage/expression-assist.d.ts +33 -0
- package/dist/types/src/editor/properties/entries/linkage/index.d.ts +1 -0
- package/dist/types/src/editor/properties/entries/linkage/linkage-rules-entry.d.ts +17 -0
- package/dist/types/src/editor/properties/entries/linkage/mutators.d.ts +73 -0
- package/dist/types/src/editor/properties/entries/linkage/options.d.ts +72 -0
- package/dist/types/src/editor/properties/entries/linkage/rule-diagnostics.d.ts +20 -0
- package/dist/types/src/editor/properties/entries/linkage/rule-list-editor.d.ts +75 -0
- package/dist/types/src/editor/properties/entries/linkage/styles.d.ts +46 -0
- package/dist/types/src/editor/properties/entries/linkage/trigger-editor.d.ts +35 -0
- package/dist/types/src/editor/properties/entries/linkage/use-linkage-editor-model.d.ts +46 -0
- package/dist/types/src/editor/properties/entries/linkage/use-stable-options.d.ts +17 -0
- package/dist/types/src/editor/properties/entries/number-entry.d.ts +3 -0
- package/dist/types/src/editor/properties/entries/options-source/index.d.ts +9 -0
- package/dist/types/src/editor/properties/entries/options-source/source-mutators.d.ts +14 -0
- package/dist/types/src/editor/properties/entries/select-entry.d.ts +3 -0
- package/dist/types/src/editor/properties/entries/text-entry.d.ts +3 -0
- package/dist/types/src/editor/properties/form-data-sources-panel.d.ts +16 -0
- package/dist/types/src/editor/properties/form-linkage-panel.d.ts +13 -0
- package/dist/types/src/editor/properties/form-variables-panel.d.ts +17 -0
- package/dist/types/src/editor/properties/option-editors.d.ts +33 -0
- package/dist/types/src/editor/properties/panel-header.d.ts +21 -0
- package/dist/types/src/editor/properties/properties-empty.d.ts +13 -0
- package/dist/types/src/editor/properties/properties-header.d.ts +13 -0
- package/dist/types/src/editor/properties/properties-panel.d.ts +18 -0
- package/dist/types/src/editor/properties/properties-provider.d.ts +42 -0
- package/dist/types/src/editor/properties/properties-tabs.d.ts +24 -0
- package/dist/types/src/editor/properties/use-confirmable-kind-switch.d.ts +38 -0
- package/dist/types/src/editor/remove-node-confirm.d.ts +8 -0
- package/dist/types/src/editor/schema-apply.d.ts +25 -0
- package/dist/types/src/editor/styles.d.ts +37 -0
- package/dist/types/src/editor/toolbar/notify.d.ts +13 -0
- package/dist/types/src/editor/toolbar/schema-io.d.ts +12 -0
- package/dist/types/src/editor/toolbar/toolbar.d.ts +42 -0
- package/dist/types/src/editor/use-editor-shortcuts.d.ts +23 -0
- package/dist/types/src/editor/validation-summary.d.ts +19 -0
- package/dist/types/src/engine/assert-never.d.ts +18 -0
- package/dist/types/src/engine/conversion/index.d.ts +87 -0
- package/dist/types/src/engine/ids.d.ts +14 -0
- package/dist/types/src/engine/keys.d.ts +70 -0
- package/dist/types/src/engine/linkage/cycle.d.ts +28 -0
- package/dist/types/src/engine/linkage/default-evaluator.d.ts +10 -0
- package/dist/types/src/engine/linkage/effects.d.ts +76 -0
- package/dist/types/src/engine/linkage/evaluator.d.ts +72 -0
- package/dist/types/src/engine/linkage/index.d.ts +8 -0
- package/dist/types/src/engine/linkage/operators.d.ts +23 -0
- package/dist/types/src/engine/linkage/source-tracking.d.ts +25 -0
- package/dist/types/src/engine/linkage/taxonomy.d.ts +49 -0
- package/dist/types/src/engine/linkage/validator.d.ts +23 -0
- package/dist/types/src/engine/registry/defaults-mobile.d.ts +17 -0
- package/dist/types/src/engine/registry/defaults.d.ts +22 -0
- package/dist/types/src/engine/registry/form-field-registry.d.ts +79 -0
- package/dist/types/src/engine/schema/edit-ops.d.ts +101 -0
- package/dist/types/src/engine/schema/mutate.d.ts +41 -0
- package/dist/types/src/engine/schema/nodes.d.ts +34 -0
- package/dist/types/src/engine/schema/permission-bridge.d.ts +37 -0
- package/dist/types/src/engine/schema/presentation.d.ts +30 -0
- package/dist/types/src/engine/schema/reconcile.d.ts +80 -0
- package/dist/types/src/engine/schema/removal-impact.d.ts +39 -0
- package/dist/types/src/engine/schema/rewrite.d.ts +15 -0
- package/dist/types/src/engine/schema/validate.d.ts +36 -0
- package/dist/types/src/engine/schema/walk.d.ts +90 -0
- package/dist/types/src/engine/validation.d.ts +139 -0
- package/dist/types/src/icons.d.ts +8 -0
- package/dist/types/src/index.d.ts +39 -0
- package/dist/types/src/render/chrome/mobile-chrome.d.ts +9 -0
- package/dist/types/src/render/chrome/pc-chrome.d.ts +7 -0
- package/dist/types/src/render/chrome/subform-shell.d.ts +17 -0
- package/dist/types/src/render/data-source-context.d.ts +42 -0
- package/dist/types/src/render/flex-style.d.ts +26 -0
- package/dist/types/src/render/form-field.d.ts +32 -0
- package/dist/types/src/render/form-renderer.d.ts +65 -0
- package/dist/types/src/render/grid-style.d.ts +24 -0
- package/dist/types/src/render/parts/field-shell.d.ts +33 -0
- package/dist/types/src/render/parts/label.d.ts +20 -0
- package/dist/types/src/render/parts/options-status.d.ts +14 -0
- package/dist/types/src/render/stack-style.d.ts +19 -0
- package/dist/types/src/render/subform-columns.d.ts +16 -0
- package/dist/types/src/render/submit.d.ts +91 -0
- package/dist/types/src/runtime/effects.d.ts +77 -0
- package/dist/types/src/runtime/resolve-scope-values.d.ts +8 -0
- package/dist/types/src/runtime/runtime-context.d.ts +21 -0
- package/dist/types/src/runtime/runtime-state-controller.d.ts +33 -0
- package/dist/types/src/runtime/stabilize-state-map.d.ts +12 -0
- package/dist/types/src/runtime/types.d.ts +13 -0
- package/dist/types/src/store/engine-provider.d.ts +50 -0
- package/dist/types/src/store/form-store.d.ts +234 -0
- package/dist/types/src/types/chrome.d.ts +51 -0
- package/dist/types/src/types/component.d.ts +116 -0
- package/dist/types/src/types/data-source.d.ts +70 -0
- package/dist/types/src/types/index.d.ts +6 -0
- package/dist/types/src/types/linkage.d.ts +350 -0
- package/dist/types/src/types/properties.d.ts +122 -0
- package/dist/types/src/types/schema.d.ts +839 -0
- package/package.json +77 -0
|
@@ -0,0 +1,839 @@
|
|
|
1
|
+
import { CodeEditorLanguage, DynamicIconName } from '@vef-framework-react/components';
|
|
2
|
+
import { FormDataSource, FormVariable, RemoteDataSourceRequest, RemoteOptionMapping } from './data-source';
|
|
3
|
+
import { FieldLinkage } from './linkage';
|
|
4
|
+
/**
|
|
5
|
+
* Document-flow form schema.
|
|
6
|
+
*
|
|
7
|
+
* The layout is a **block tree**: a {@link PresentationLayer} (and every
|
|
8
|
+
* container body) owns an ordered list of blocks (leaf fields or containers),
|
|
9
|
+
* which stack vertically in document order. Side-by-side placement is an
|
|
10
|
+
* explicit {@link GridNode} / {@link FlexNode} the author drags in, never an
|
|
11
|
+
* implicit multi-block row. The grammar is enforced by the types — a leaf field
|
|
12
|
+
* cannot own children. Arithmetic, cross-reference, and per-scope-uniqueness
|
|
13
|
+
* invariants (span range, duplicate ids/keys, linkage source resolution) are
|
|
14
|
+
* not expressible in TypeScript and live in `validateSchema` instead.
|
|
15
|
+
*
|
|
16
|
+
* Everything in this file is **persisted**. Editor-only UI concerns (width
|
|
17
|
+
* presets, drag state) live in the editor layer, not here.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Column basis for grid spans. A {@link GridNode} cell's `span` is an integer in
|
|
21
|
+
* `1..ROW_COLS`, and its `columns` count caps here too. Matches antd's native
|
|
22
|
+
* 24-column unit, so the schema column basis and the renderer agree with no
|
|
23
|
+
* conversion layer.
|
|
24
|
+
*/
|
|
25
|
+
export declare const ROW_COLS = 24;
|
|
26
|
+
/**
|
|
27
|
+
* Named vertical-rhythm presets for a {@link Stack}-style container body — the
|
|
28
|
+
* gap a container (or the root document) puts between its stacked child blocks.
|
|
29
|
+
* The schema stores the named scale, not a pixel value; the renderer realizes it
|
|
30
|
+
* to pixels (`render/stack-style.ts`), so a theme can re-tune the rhythm without
|
|
31
|
+
* a schema migration. Distinct from a {@link FlexNode} / {@link GridNode} `gap`,
|
|
32
|
+
* which is an explicit pixel number for inline (side-by-side) layout.
|
|
33
|
+
*/
|
|
34
|
+
export type GapScale = "small" | "medium" | "large";
|
|
35
|
+
/**
|
|
36
|
+
* The valid {@link GapScale} values, for runtime validation of imported schemas.
|
|
37
|
+
*/
|
|
38
|
+
export declare const GAP_SCALES: readonly GapScale[];
|
|
39
|
+
/**
|
|
40
|
+
* The gap a stack uses when neither the container nor the form sets one.
|
|
41
|
+
*/
|
|
42
|
+
export declare const DEFAULT_GAP_SCALE: GapScale;
|
|
43
|
+
/**
|
|
44
|
+
* Label placement for input-like leaf fields.
|
|
45
|
+
*/
|
|
46
|
+
export type LabelPosition = "top" | "left" | "right";
|
|
47
|
+
/**
|
|
48
|
+
* Stable identity carried by every node in the tree.
|
|
49
|
+
*/
|
|
50
|
+
interface NodeBase {
|
|
51
|
+
id: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Data-binding marker. A node that contributes a value to form state carries
|
|
55
|
+
* a `key`. Leaf fields bind a scalar; a {@link SubformNode} binds an array of
|
|
56
|
+
* records scoped under its `key`. Derived structurally so consumer-augmented
|
|
57
|
+
* field types and the subform participate without enumeration — use
|
|
58
|
+
* `isKeyedNode` to narrow.
|
|
59
|
+
*/
|
|
60
|
+
export interface KeyedNode {
|
|
61
|
+
key: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Per-slot flex sizing for a block that is a direct child of a {@link FlexNode}.
|
|
65
|
+
* Maps to the slot's CSS `flex-grow` / `flex-shrink` / `flex-basis`. Ignored
|
|
66
|
+
* when the block lives in a grid row (where `span` drives width instead) — a
|
|
67
|
+
* block carries at most one meaningful layout prop, selected by its parent.
|
|
68
|
+
*/
|
|
69
|
+
export interface FlexSlot {
|
|
70
|
+
grow?: number;
|
|
71
|
+
shrink?: number;
|
|
72
|
+
basis?: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* A "block" is any node in the layout tree — a leaf field or a container.
|
|
76
|
+
* Blocks stack vertically in their parent's order.
|
|
77
|
+
*
|
|
78
|
+
* - `span` is an integer column count (`1..ROW_COLS`) honored when the block is
|
|
79
|
+
* a cell of a {@link GridNode}; omitted means a single column, and it is ignored
|
|
80
|
+
* outside a grid. Range is validated at runtime, not in the type.
|
|
81
|
+
* - `flex` sizes the block when it is a direct child of a {@link FlexNode};
|
|
82
|
+
* it is ignored elsewhere, where `span` (in a grid) or full width applies.
|
|
83
|
+
* - `linkage` is honored on any block: `show` / `hide` / `enable` / `disable`
|
|
84
|
+
* apply to leaves and containers alike (a container's `disable` propagates to
|
|
85
|
+
* its descendants at runtime). The value-bearing actions (`require` /
|
|
86
|
+
* `optional` / `assign`) are rejected on non-keyed-leaf nodes by the linkage
|
|
87
|
+
* validator, which walks the full tree.
|
|
88
|
+
*/
|
|
89
|
+
interface BlockBase extends NodeBase {
|
|
90
|
+
span?: number;
|
|
91
|
+
flex?: FlexSlot;
|
|
92
|
+
linkage?: FieldLinkage;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Common attributes shared by every leaf field. Concrete field types extend
|
|
96
|
+
* this with the discriminator `type` and any type-specific properties; keyed
|
|
97
|
+
* fields additionally extend {@link KeyedNode}.
|
|
98
|
+
*/
|
|
99
|
+
interface FormFieldBase extends BlockBase {
|
|
100
|
+
type: string;
|
|
101
|
+
label?: string;
|
|
102
|
+
labelPosition?: LabelPosition;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Mixin for leaf fields that expose static validation rules. Kept as a shared
|
|
106
|
+
* shape (rather than re-declared per field) so the renderer and property
|
|
107
|
+
* entries read `validate` through one typed contract — narrow a field to it
|
|
108
|
+
* with `isValidatableField` instead of casting. The shape mirrors the Go
|
|
109
|
+
* backend's `ValidationRule` (`approval/form_definition.go`): `minLength` /
|
|
110
|
+
* `maxLength` constrain string length, `min` / `max` constrain numeric range,
|
|
111
|
+
* `pattern` is a regular-expression source, and `message` overrides the default
|
|
112
|
+
* constraint-failure text. All but `required` apply only to a present value.
|
|
113
|
+
*/
|
|
114
|
+
export interface Validatable {
|
|
115
|
+
validate?: {
|
|
116
|
+
required?: boolean;
|
|
117
|
+
minLength?: number;
|
|
118
|
+
maxLength?: number;
|
|
119
|
+
min?: number;
|
|
120
|
+
max?: number;
|
|
121
|
+
pattern?: string;
|
|
122
|
+
message?: string;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* A selectable option for a selection field. `value` is the data-binding value
|
|
127
|
+
* submitted for the field; `label` is the display text. Mirrors the Go
|
|
128
|
+
* backend's `FieldOption` (`approval/form_definition.go`).
|
|
129
|
+
*/
|
|
130
|
+
export interface FieldOption {
|
|
131
|
+
label: string;
|
|
132
|
+
value: string | number;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Inline, statically-authored option list.
|
|
136
|
+
*/
|
|
137
|
+
export interface StaticOptionSource {
|
|
138
|
+
kind: "static";
|
|
139
|
+
options: FieldOption[];
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Reference to a form-global data source (`FormSchema.dataSources`) by id.
|
|
143
|
+
*/
|
|
144
|
+
export interface RefOptionSource {
|
|
145
|
+
kind: "ref";
|
|
146
|
+
dataSourceId: string;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* A remote source defined inline on the field (not shared form-globally).
|
|
150
|
+
*/
|
|
151
|
+
export interface RemoteOptionSource {
|
|
152
|
+
kind: "remote";
|
|
153
|
+
request: RemoteDataSourceRequest;
|
|
154
|
+
mapping?: RemoteOptionMapping;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Where a selection field's options come from: an inline static list, a
|
|
158
|
+
* reference to a form-global data source, or an inline remote request. Static
|
|
159
|
+
* and `ref`-to-static resolve synchronously from the schema; `remote` (and
|
|
160
|
+
* `ref`-to-remote) resolve through the host-injected {@link DataSourceResolver}.
|
|
161
|
+
*/
|
|
162
|
+
export type FieldOptionSource = StaticOptionSource | RefOptionSource | RemoteOptionSource;
|
|
163
|
+
/**
|
|
164
|
+
* Single-line text input. Keyed: contributes a scalar value via `key`.
|
|
165
|
+
*/
|
|
166
|
+
export interface TextfieldField extends FormFieldBase, KeyedNode, Validatable {
|
|
167
|
+
type: "textfield";
|
|
168
|
+
placeholder?: string;
|
|
169
|
+
helperText?: string;
|
|
170
|
+
/**
|
|
171
|
+
* Optional leading icon shown inside the input, stored as a kebab-case lucide
|
|
172
|
+
* name and rendered through `DynamicIcon`.
|
|
173
|
+
*/
|
|
174
|
+
prefixIcon?: DynamicIconName;
|
|
175
|
+
/**
|
|
176
|
+
* Control size. Maps to antd `Input` `size`; antd-mobile's input has no size
|
|
177
|
+
* token, so the mobile renderer ignores it (PC-only visual scale).
|
|
178
|
+
*/
|
|
179
|
+
size?: "small" | "middle" | "large";
|
|
180
|
+
/**
|
|
181
|
+
* Show a one-click clear affordance (antd `allowClear` / antd-mobile
|
|
182
|
+
* `clearable`). Defaults to off.
|
|
183
|
+
*/
|
|
184
|
+
allowClear?: boolean;
|
|
185
|
+
/**
|
|
186
|
+
* Hard input cap — the native `maxLength` that stops typing past N characters.
|
|
187
|
+
* Deliberately distinct from `validate.maxLength`, which is a submit-time rule
|
|
188
|
+
* that surfaces a message: this mirrors the dual-axis precedent NumberField
|
|
189
|
+
* documents (input clamp vs validate rule).
|
|
190
|
+
*/
|
|
191
|
+
maxLength?: number;
|
|
192
|
+
/**
|
|
193
|
+
* Input mode. `"password"` masks the value (antd `Input.Password` on PC,
|
|
194
|
+
* native `type="password"` on mobile). Defaults to `"text"`.
|
|
195
|
+
*/
|
|
196
|
+
inputType?: "text" | "password";
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Multi-line code editor. Keyed: contributes a string value via `key`.
|
|
200
|
+
*/
|
|
201
|
+
export interface CodeEditorField extends FormFieldBase, KeyedNode, Validatable {
|
|
202
|
+
type: "code-editor";
|
|
203
|
+
placeholder?: string;
|
|
204
|
+
helperText?: string;
|
|
205
|
+
/**
|
|
206
|
+
* Built-in language id from the components package (JSON-serializable).
|
|
207
|
+
*/
|
|
208
|
+
language?: CodeEditorLanguage;
|
|
209
|
+
minHeight?: number;
|
|
210
|
+
/**
|
|
211
|
+
* Maximum editor height in px before the content scrolls. Pairs with
|
|
212
|
+
* `minHeight`; unbounded when omitted.
|
|
213
|
+
*/
|
|
214
|
+
maxHeight?: number;
|
|
215
|
+
showLineNumbers?: boolean;
|
|
216
|
+
/**
|
|
217
|
+
* Show the code-folding gutter (the collapse arrows beside the line numbers).
|
|
218
|
+
*/
|
|
219
|
+
showFoldGutter?: boolean;
|
|
220
|
+
/**
|
|
221
|
+
* Indentation width in spaces. Defaults to the editor's own default when omitted.
|
|
222
|
+
*/
|
|
223
|
+
tabSize?: number;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Action button. Non-keyed: does not contribute a value.
|
|
227
|
+
*/
|
|
228
|
+
export interface ButtonField extends FormFieldBase {
|
|
229
|
+
type: "button";
|
|
230
|
+
/**
|
|
231
|
+
* Native button behaviour (the html `type`). Defaults to `"submit"` when
|
|
232
|
+
* omitted. Orthogonal to {@link ButtonField.buttonType}, which is appearance.
|
|
233
|
+
*/
|
|
234
|
+
action?: "submit" | "reset" | "button";
|
|
235
|
+
/**
|
|
236
|
+
* Visual style (antd `type`). Defaults to `"primary"`. On mobile this maps to
|
|
237
|
+
* the antd-mobile `color` / `fill` pair.
|
|
238
|
+
*/
|
|
239
|
+
buttonType?: "primary" | "default" | "dashed" | "text" | "link";
|
|
240
|
+
/**
|
|
241
|
+
* Render in the danger palette (antd `danger`). On mobile maps to
|
|
242
|
+
* `color="danger"`.
|
|
243
|
+
*/
|
|
244
|
+
danger?: boolean;
|
|
245
|
+
/**
|
|
246
|
+
* Control size. Maps to antd `Button` `size` on PC and antd-mobile `Button`
|
|
247
|
+
* `size` on mobile.
|
|
248
|
+
*/
|
|
249
|
+
size?: "small" | "middle" | "large";
|
|
250
|
+
/**
|
|
251
|
+
* Stretch to fill the available width (antd / antd-mobile `block`). Mobile
|
|
252
|
+
* buttons are full-width by default, so only a stored `false` makes them inline
|
|
253
|
+
* there.
|
|
254
|
+
*/
|
|
255
|
+
block?: boolean;
|
|
256
|
+
/**
|
|
257
|
+
* Transparent background for placement on a colored surface (antd `ghost`).
|
|
258
|
+
* PC-only — antd-mobile has no ghost fill.
|
|
259
|
+
*/
|
|
260
|
+
ghost?: boolean;
|
|
261
|
+
/**
|
|
262
|
+
* Corner shape. `"round"` gives fully-rounded ends (antd `shape="round"` /
|
|
263
|
+
* antd-mobile `shape="rounded"`). Defaults to the standard rectangle.
|
|
264
|
+
*/
|
|
265
|
+
shape?: "default" | "round";
|
|
266
|
+
/**
|
|
267
|
+
* Optional leading icon, stored as a kebab-case lucide name and rendered
|
|
268
|
+
* through `DynamicIcon`.
|
|
269
|
+
*/
|
|
270
|
+
icon?: DynamicIconName;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Numeric input. Keyed: contributes a number value via `key`.
|
|
274
|
+
*
|
|
275
|
+
* Two distinct min/max axes, deliberately not merged: the top-level `min` / `max`
|
|
276
|
+
* here are the INPUT BOUNDS — both renderers clamp the committed value into this
|
|
277
|
+
* range (antd on blur, mobile per keystroke), so a value outside it never reaches
|
|
278
|
+
* form state — whereas `validate.min` / `validate.max` (from {@link Validatable})
|
|
279
|
+
* are SUBMIT-TIME constraint rules that surface a validation message. Use the
|
|
280
|
+
* bounds to stop out-of-range input; use the validate rules to explain why a
|
|
281
|
+
* value is rejected at submit.
|
|
282
|
+
*/
|
|
283
|
+
export interface NumberField extends FormFieldBase, KeyedNode, Validatable {
|
|
284
|
+
type: "number";
|
|
285
|
+
placeholder?: string;
|
|
286
|
+
helperText?: string;
|
|
287
|
+
min?: number;
|
|
288
|
+
max?: number;
|
|
289
|
+
step?: number;
|
|
290
|
+
/**
|
|
291
|
+
* Control size. Maps to antd `InputNumber` `size`; the mobile control has no
|
|
292
|
+
* size token and ignores it.
|
|
293
|
+
*/
|
|
294
|
+
size?: "small" | "middle" | "large";
|
|
295
|
+
/**
|
|
296
|
+
* Inline leading text inside the control (e.g. a currency symbol "¥"). antd
|
|
297
|
+
* `InputNumber.prefix` on PC; rendered before the control on mobile.
|
|
298
|
+
*/
|
|
299
|
+
prefix?: string;
|
|
300
|
+
/**
|
|
301
|
+
* Inline trailing text inside the control (e.g. a unit "kg" / "%"). antd
|
|
302
|
+
* `InputNumber.suffix` on PC; rendered after the control on mobile.
|
|
303
|
+
*/
|
|
304
|
+
suffix?: string;
|
|
305
|
+
/**
|
|
306
|
+
* Number of decimal places to keep. Rounds the committed value to this
|
|
307
|
+
* precision on both presentations.
|
|
308
|
+
*/
|
|
309
|
+
precision?: number;
|
|
310
|
+
/**
|
|
311
|
+
* Show the up/down stepper handles (antd `controls`). PC-only — the mobile
|
|
312
|
+
* numeric input has no steppers. Defaults to shown.
|
|
313
|
+
*/
|
|
314
|
+
controls?: boolean;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Boolean toggle. Keyed: contributes a boolean value via `key`.
|
|
318
|
+
*
|
|
319
|
+
* Intentionally not `Validatable`: a switch always holds a value (on / off) with
|
|
320
|
+
* no empty state, so a static `required` rule has no meaningful "must be
|
|
321
|
+
* provided" semantics. Dynamic requiring via a `require` linkage rule is still
|
|
322
|
+
* supported, and those validation errors render like any other field.
|
|
323
|
+
*/
|
|
324
|
+
export interface SwitchField extends FormFieldBase, KeyedNode {
|
|
325
|
+
type: "switch";
|
|
326
|
+
helperText?: string;
|
|
327
|
+
/**
|
|
328
|
+
* Text shown inside the track when on (antd `checkedChildren` / antd-mobile
|
|
329
|
+
* `checkedText`).
|
|
330
|
+
*/
|
|
331
|
+
onText?: string;
|
|
332
|
+
/**
|
|
333
|
+
* Text shown inside the track when off (antd `unCheckedChildren` / antd-mobile
|
|
334
|
+
* `uncheckedText`).
|
|
335
|
+
*/
|
|
336
|
+
offText?: string;
|
|
337
|
+
/**
|
|
338
|
+
* Control size. antd `Switch` only offers `default` / `small`; PC-only (the
|
|
339
|
+
* mobile switch has no size token).
|
|
340
|
+
*/
|
|
341
|
+
size?: "default" | "small";
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Single-select dropdown. Keyed: contributes the chosen option value via `key`.
|
|
345
|
+
*/
|
|
346
|
+
export interface SelectField extends FormFieldBase, KeyedNode, Validatable {
|
|
347
|
+
type: "select";
|
|
348
|
+
placeholder?: string;
|
|
349
|
+
helperText?: string;
|
|
350
|
+
allowClear?: boolean;
|
|
351
|
+
/**
|
|
352
|
+
* Control size. Maps to antd `Select` `size`; the mobile picker has no size
|
|
353
|
+
* token and ignores it.
|
|
354
|
+
*/
|
|
355
|
+
size?: "small" | "middle" | "large";
|
|
356
|
+
/**
|
|
357
|
+
* Enable type-to-filter on the PC dropdown (antd `showSearch`). PC-only — the
|
|
358
|
+
* mobile picker wheel has no search surface.
|
|
359
|
+
*/
|
|
360
|
+
showSearch?: boolean;
|
|
361
|
+
/**
|
|
362
|
+
* Option source. Defaults to an empty static list when omitted.
|
|
363
|
+
*/
|
|
364
|
+
dataSource?: FieldOptionSource;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Single-select radio group. Keyed: contributes the chosen option value.
|
|
368
|
+
*/
|
|
369
|
+
export interface RadioField extends FormFieldBase, KeyedNode, Validatable {
|
|
370
|
+
type: "radio";
|
|
371
|
+
helperText?: string;
|
|
372
|
+
dataSource?: FieldOptionSource;
|
|
373
|
+
/**
|
|
374
|
+
* Render style. `"button"` lays the options out as a segmented button group
|
|
375
|
+
* (antd `optionType="button"`); `"default"` is the classic radio dots. PC-only
|
|
376
|
+
* — the mobile control stays a stacked radio list.
|
|
377
|
+
*/
|
|
378
|
+
optionType?: "default" | "button";
|
|
379
|
+
/**
|
|
380
|
+
* Button-group fill when `optionType` is `"button"` (antd `buttonStyle`).
|
|
381
|
+
*/
|
|
382
|
+
buttonStyle?: "outline" | "solid";
|
|
383
|
+
/**
|
|
384
|
+
* Option layout direction. Maps to antd `Radio.Group` `orientation` on PC and
|
|
385
|
+
* drives the flex direction on mobile. Defaults to vertical.
|
|
386
|
+
*/
|
|
387
|
+
direction?: "horizontal" | "vertical";
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Multi-select checkbox group. Keyed: contributes an array of chosen values.
|
|
391
|
+
*/
|
|
392
|
+
export interface CheckboxGroupField extends FormFieldBase, KeyedNode, Validatable {
|
|
393
|
+
type: "checkbox-group";
|
|
394
|
+
helperText?: string;
|
|
395
|
+
dataSource?: FieldOptionSource;
|
|
396
|
+
/**
|
|
397
|
+
* Option layout direction. antd `Checkbox.Group` has no orientation prop, so
|
|
398
|
+
* the PC renderer realizes vertical layout via flex; the mobile renderer drives
|
|
399
|
+
* its flex direction the same way. Defaults to vertical.
|
|
400
|
+
*/
|
|
401
|
+
direction?: "horizontal" | "vertical";
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Multi-line text input. Keyed: contributes a string value via `key`.
|
|
405
|
+
*/
|
|
406
|
+
export interface TextareaField extends FormFieldBase, KeyedNode, Validatable {
|
|
407
|
+
type: "textarea";
|
|
408
|
+
placeholder?: string;
|
|
409
|
+
helperText?: string;
|
|
410
|
+
rows?: number;
|
|
411
|
+
/**
|
|
412
|
+
* Grow the control to fit its content instead of staying at a fixed `rows`
|
|
413
|
+
* height (antd / antd-mobile `autoSize`).
|
|
414
|
+
*/
|
|
415
|
+
autoSize?: boolean;
|
|
416
|
+
/**
|
|
417
|
+
* Hard input cap — the native `maxLength`. Distinct from `validate.maxLength`
|
|
418
|
+
* (a submit-time rule); see {@link TextfieldField.maxLength}.
|
|
419
|
+
*/
|
|
420
|
+
maxLength?: number;
|
|
421
|
+
/**
|
|
422
|
+
* Show a live character counter (antd / antd-mobile `showCount`); most useful
|
|
423
|
+
* paired with `maxLength`.
|
|
424
|
+
*/
|
|
425
|
+
showCount?: boolean;
|
|
426
|
+
/**
|
|
427
|
+
* Control size. Maps to antd `Input.TextArea` `size`; PC-only.
|
|
428
|
+
*/
|
|
429
|
+
size?: "small" | "middle" | "large";
|
|
430
|
+
/**
|
|
431
|
+
* Show a one-click clear affordance (antd `allowClear`). PC-only — antd-mobile
|
|
432
|
+
* `TextArea` has no clearable surface.
|
|
433
|
+
*/
|
|
434
|
+
allowClear?: boolean;
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Date picker. Keyed: contributes a `YYYY-MM-DD` string value via `key`.
|
|
438
|
+
*/
|
|
439
|
+
export interface DateField extends FormFieldBase, KeyedNode, Validatable {
|
|
440
|
+
type: "date";
|
|
441
|
+
placeholder?: string;
|
|
442
|
+
helperText?: string;
|
|
443
|
+
/**
|
|
444
|
+
* Whether the picker shows a clear affordance. Mirrors antd `DatePicker`'s
|
|
445
|
+
* `allowClear`, which is enabled by default — so the renderers treat an absent
|
|
446
|
+
* value as `true` and only a stored `false` disables clearing.
|
|
447
|
+
*/
|
|
448
|
+
allowClear?: boolean;
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Date + time picker. Keyed: contributes a `YYYY-MM-DD HH:mm:ss` string value.
|
|
452
|
+
*/
|
|
453
|
+
export interface DatetimeField extends FormFieldBase, KeyedNode, Validatable {
|
|
454
|
+
type: "datetime";
|
|
455
|
+
placeholder?: string;
|
|
456
|
+
helperText?: string;
|
|
457
|
+
/**
|
|
458
|
+
* Whether the picker shows a clear affordance. See {@link DateField.allowClear}
|
|
459
|
+
* — default-on, only a stored `false` disables it.
|
|
460
|
+
*/
|
|
461
|
+
allowClear?: boolean;
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Date range picker. Keyed: contributes a `[start, end]` pair of date strings.
|
|
465
|
+
*/
|
|
466
|
+
export interface DateRangeField extends FormFieldBase, KeyedNode, Validatable {
|
|
467
|
+
type: "daterange";
|
|
468
|
+
helperText?: string;
|
|
469
|
+
/**
|
|
470
|
+
* Whether the range picker shows a clear affordance. See
|
|
471
|
+
* {@link DateField.allowClear} — default-on, only a stored `false` disables it.
|
|
472
|
+
*/
|
|
473
|
+
allowClear?: boolean;
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* Section divider. Non-keyed presentation — an optional inline title.
|
|
477
|
+
*/
|
|
478
|
+
export interface DividerField extends FormFieldBase {
|
|
479
|
+
type: "divider";
|
|
480
|
+
title?: string;
|
|
481
|
+
/**
|
|
482
|
+
* Where the inline title sits along the rule (antd `titlePlacement` /
|
|
483
|
+
* antd-mobile `contentPosition`). Defaults to centered. Only meaningful with a
|
|
484
|
+
* `title`.
|
|
485
|
+
*/
|
|
486
|
+
titlePlacement?: "left" | "center" | "right";
|
|
487
|
+
/**
|
|
488
|
+
* Draw the rule dashed instead of solid (antd `dashed`). PC-only — the mobile
|
|
489
|
+
* divider stays solid.
|
|
490
|
+
*/
|
|
491
|
+
dashed?: boolean;
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* Inline alert banner. Non-keyed presentation.
|
|
495
|
+
*/
|
|
496
|
+
export interface AlertBlockField extends FormFieldBase {
|
|
497
|
+
type: "alert-block";
|
|
498
|
+
message?: string;
|
|
499
|
+
description?: string;
|
|
500
|
+
alertType?: "info" | "success" | "warning" | "error";
|
|
501
|
+
/**
|
|
502
|
+
* Show the leading status icon (antd `showIcon`). Defaults to on — the
|
|
503
|
+
* renderers treat an absent value as `true`.
|
|
504
|
+
*/
|
|
505
|
+
showIcon?: boolean;
|
|
506
|
+
/**
|
|
507
|
+
* Show a close button that dismisses the alert (antd `closable` / antd-mobile
|
|
508
|
+
* NoticeBar `closeable`).
|
|
509
|
+
*/
|
|
510
|
+
closable?: boolean;
|
|
511
|
+
/**
|
|
512
|
+
* Banner presentation — full-width, no rounded corners (antd `banner`).
|
|
513
|
+
* PC-only.
|
|
514
|
+
*/
|
|
515
|
+
banner?: boolean;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Static paragraph of explanatory text. Non-keyed presentation.
|
|
519
|
+
*/
|
|
520
|
+
export interface ParagraphField extends FormFieldBase {
|
|
521
|
+
type: "paragraph";
|
|
522
|
+
text?: string;
|
|
523
|
+
/**
|
|
524
|
+
* Semantic text tone (antd `Typography` `type`). On mobile the renderer maps
|
|
525
|
+
* it to the matching theme color. Omitted means the default body color.
|
|
526
|
+
*/
|
|
527
|
+
textType?: "secondary" | "success" | "warning" | "danger";
|
|
528
|
+
/**
|
|
529
|
+
* Bold weight (antd `strong`).
|
|
530
|
+
*/
|
|
531
|
+
strong?: boolean;
|
|
532
|
+
/**
|
|
533
|
+
* Italic style (antd `italic`).
|
|
534
|
+
*/
|
|
535
|
+
italic?: boolean;
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Open registry of leaf field types, keyed by their `type` discriminator.
|
|
539
|
+
* Consumers add field types by augmenting this interface from their own
|
|
540
|
+
* module:
|
|
541
|
+
*
|
|
542
|
+
* ```ts
|
|
543
|
+
* declare module "@vef-framework-react/form-editor" {
|
|
544
|
+
* interface FormFieldTypeMap {
|
|
545
|
+
* datepicker: DatePickerField;
|
|
546
|
+
* }
|
|
547
|
+
* }
|
|
548
|
+
* ```
|
|
549
|
+
*
|
|
550
|
+
* Containers are deliberately **not** extensible this way — see
|
|
551
|
+
* {@link ContainerNode}.
|
|
552
|
+
*/
|
|
553
|
+
export interface FormFieldTypeMap {
|
|
554
|
+
textfield: TextfieldField;
|
|
555
|
+
"code-editor": CodeEditorField;
|
|
556
|
+
number: NumberField;
|
|
557
|
+
switch: SwitchField;
|
|
558
|
+
button: ButtonField;
|
|
559
|
+
select: SelectField;
|
|
560
|
+
radio: RadioField;
|
|
561
|
+
"checkbox-group": CheckboxGroupField;
|
|
562
|
+
textarea: TextareaField;
|
|
563
|
+
date: DateField;
|
|
564
|
+
datetime: DatetimeField;
|
|
565
|
+
daterange: DateRangeField;
|
|
566
|
+
divider: DividerField;
|
|
567
|
+
"alert-block": AlertBlockField;
|
|
568
|
+
paragraph: ParagraphField;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Discriminated union of every registered leaf field type.
|
|
572
|
+
*/
|
|
573
|
+
export type FormField = FormFieldTypeMap[keyof FormFieldTypeMap];
|
|
574
|
+
/**
|
|
575
|
+
* The container node type discriminants, derived from {@link ContainerNode}.
|
|
576
|
+
*/
|
|
577
|
+
export declare const CONTAINER_TYPES: Array<ContainerNode["type"]>;
|
|
578
|
+
/**
|
|
579
|
+
* Leaf fields that bind a value. Field-only; for engine-wide keyed checks
|
|
580
|
+
* (which must also catch a {@link SubformNode}) use `isKeyedNode`.
|
|
581
|
+
*/
|
|
582
|
+
export type KeyedFormField = Extract<FormField, KeyedNode>;
|
|
583
|
+
/**
|
|
584
|
+
* Containers are a **closed set**: each one defines distinct tree-walk and
|
|
585
|
+
* value-scope semantics (a subform opens a new value scope; tabs render
|
|
586
|
+
* conditionally; a section and a flex container are pure layout). New layout
|
|
587
|
+
* needs go through a PR, not module augmentation — extending the walker/scoper
|
|
588
|
+
* is an engine change, not a renderer change. This asymmetry (open fields /
|
|
589
|
+
* closed containers) is intentional: fields share a uniform render contract,
|
|
590
|
+
* containers don't.
|
|
591
|
+
*/
|
|
592
|
+
export type ContainerNode = SectionNode | TabsNode | SubformNode | FlexNode | GridNode;
|
|
593
|
+
interface SectionBase extends BlockBase {
|
|
594
|
+
type: "section";
|
|
595
|
+
title?: string;
|
|
596
|
+
/**
|
|
597
|
+
* Vertical gap between this section's stacked child blocks. Omitted means
|
|
598
|
+
* inherit the form-level {@link PresentationLayer.gap}.
|
|
599
|
+
*/
|
|
600
|
+
gap?: GapScale;
|
|
601
|
+
children: Block[];
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* antd Card. Never collapses.
|
|
605
|
+
*/
|
|
606
|
+
export interface CardSection extends SectionBase {
|
|
607
|
+
variant: "card";
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* antd Collapse panel. Collapsibility is implied by the variant.
|
|
611
|
+
*/
|
|
612
|
+
export interface CollapseSection extends SectionBase {
|
|
613
|
+
variant: "collapse";
|
|
614
|
+
defaultCollapsed?: boolean;
|
|
615
|
+
}
|
|
616
|
+
export type SectionNode = CardSection | CollapseSection;
|
|
617
|
+
/**
|
|
618
|
+
* One tab. `id` is its stable identity (drives antd `Tabs` keying and
|
|
619
|
+
* active-tab persistence). Distinct from a data-binding `key`.
|
|
620
|
+
*/
|
|
621
|
+
export interface TabItem extends NodeBase {
|
|
622
|
+
label: string;
|
|
623
|
+
children: Block[];
|
|
624
|
+
}
|
|
625
|
+
export interface TabsNode extends BlockBase {
|
|
626
|
+
type: "tabs";
|
|
627
|
+
/**
|
|
628
|
+
* Vertical gap between the stacked blocks inside each tab. Omitted means
|
|
629
|
+
* inherit the form-level {@link PresentationLayer.gap}.
|
|
630
|
+
*/
|
|
631
|
+
gap?: GapScale;
|
|
632
|
+
tabs: TabItem[];
|
|
633
|
+
}
|
|
634
|
+
/**
|
|
635
|
+
* Common attributes shared by every subform variant. A subform is a repeating
|
|
636
|
+
* record group: it binds `Array<Record<string, unknown>>` under `key`, and its
|
|
637
|
+
* `template` opens a **new value scope** (child field keys are unique within the
|
|
638
|
+
* subform, not the global namespace). The walker emits this scope and
|
|
639
|
+
* `validateSchema` enforces per-scope key uniqueness — both independent of the
|
|
640
|
+
* presentation `variant`.
|
|
641
|
+
*/
|
|
642
|
+
interface SubformBase extends BlockBase, KeyedNode {
|
|
643
|
+
type: "subform";
|
|
644
|
+
label?: string;
|
|
645
|
+
template: Block[];
|
|
646
|
+
/**
|
|
647
|
+
* Minimum number of rows the form keeps present. The runtime seeds this many
|
|
648
|
+
* blank rows and blocks removal below it. Defaults to `0`.
|
|
649
|
+
*/
|
|
650
|
+
minRows?: number;
|
|
651
|
+
/**
|
|
652
|
+
* Maximum number of rows the user may add. The runtime disables the add
|
|
653
|
+
* control at this count. Unbounded when omitted.
|
|
654
|
+
*/
|
|
655
|
+
maxRows?: number;
|
|
656
|
+
addLabel?: string;
|
|
657
|
+
}
|
|
658
|
+
/**
|
|
659
|
+
* Free-layout subform: each row renders the `template` as a stack of fully
|
|
660
|
+
* editable, individually-laid-out fields — supporting nesting and per-row
|
|
661
|
+
* linkage / expression scope. The default variant.
|
|
662
|
+
*/
|
|
663
|
+
export interface StackSubform extends SubformBase {
|
|
664
|
+
variant: "stack";
|
|
665
|
+
/**
|
|
666
|
+
* Vertical gap between the stacked template blocks within each row. Omitted
|
|
667
|
+
* means inherit the form-level {@link PresentationLayer.gap}.
|
|
668
|
+
*/
|
|
669
|
+
gap?: GapScale;
|
|
670
|
+
}
|
|
671
|
+
/**
|
|
672
|
+
* Table-layout subform: rows render through the components `EditableTable`
|
|
673
|
+
* (view + per-row inline edit), each template leaf field becoming a column.
|
|
674
|
+
* Targets straightforward tabular data entry, so `validateSchema` requires the
|
|
675
|
+
* template to be flat keyed leaf fields. Desktop-only — the mobile presentation
|
|
676
|
+
* renders it as a {@link StackSubform}.
|
|
677
|
+
*/
|
|
678
|
+
export interface TableSubform extends SubformBase {
|
|
679
|
+
variant: "table";
|
|
680
|
+
/**
|
|
681
|
+
* Table density forwarded to the runtime `EditableTable`. Omitted uses the
|
|
682
|
+
* table's own default.
|
|
683
|
+
*/
|
|
684
|
+
size?: "small" | "middle" | "large";
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* Repeating record group — a closed two-variant union: {@link StackSubform}
|
|
688
|
+
* (free layout) and {@link TableSubform} (EditableTable). Both share the data
|
|
689
|
+
* contract (array-of-records, value scope, key uniqueness, min/max rows); only
|
|
690
|
+
* the presentation differs, so the engine treats them uniformly by `type` and
|
|
691
|
+
* only the renderer branches on `variant`.
|
|
692
|
+
*/
|
|
693
|
+
export type SubformNode = StackSubform | TableSubform;
|
|
694
|
+
/**
|
|
695
|
+
* Main-axis distribution of a {@link FlexNode}'s slots (maps to CSS
|
|
696
|
+
* `justify-content`).
|
|
697
|
+
*/
|
|
698
|
+
export type FlexJustify = "start" | "center" | "end" | "between" | "around";
|
|
699
|
+
/**
|
|
700
|
+
* Cross-axis alignment of a {@link FlexNode}'s slots (maps to CSS `align-items`).
|
|
701
|
+
*/
|
|
702
|
+
export type FlexAlign = "start" | "center" | "end" | "stretch";
|
|
703
|
+
/**
|
|
704
|
+
* Flex layout container. Pure layout — no value scope, no key — that lays its
|
|
705
|
+
* child blocks along one axis via CSS flexbox, each slot sized by its own
|
|
706
|
+
* {@link FlexSlot} rather than a grid span. Its body is a block list like a
|
|
707
|
+
* section's, but it renders the blocks inline (a flex line). Use it for
|
|
708
|
+
* "arrange these elements in a line, sized by content" layouts the grid's fixed
|
|
709
|
+
* columns cannot express.
|
|
710
|
+
*/
|
|
711
|
+
export interface FlexNode extends BlockBase {
|
|
712
|
+
type: "flex";
|
|
713
|
+
children: Block[];
|
|
714
|
+
/**
|
|
715
|
+
* Main axis. Defaults to `"row"` (horizontal).
|
|
716
|
+
*/
|
|
717
|
+
direction?: "row" | "column";
|
|
718
|
+
justify?: FlexJustify;
|
|
719
|
+
align?: FlexAlign;
|
|
720
|
+
/**
|
|
721
|
+
* Whether slots wrap onto multiple lines when they overflow. Defaults to
|
|
722
|
+
* `false` (single line).
|
|
723
|
+
*/
|
|
724
|
+
wrap?: boolean;
|
|
725
|
+
/**
|
|
726
|
+
* Gap between slots, in pixels. Defaults to the form-level stack gap.
|
|
727
|
+
*/
|
|
728
|
+
gap?: number;
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* Grid layout container. Pure layout — no value scope, no key — that lays its
|
|
732
|
+
* child blocks (cells) across a fixed number of equal-width columns via real
|
|
733
|
+
* CSS grid. Each cell occupies one column by default; a cell's `span` widens it
|
|
734
|
+
* to cover several columns, and cells wrap onto new rows once they fill the
|
|
735
|
+
* track count. Its body is a block list like a flex container's, flowed into
|
|
736
|
+
* the grid (each block is one cell).
|
|
737
|
+
*
|
|
738
|
+
* This is the **explicit** way to place fields side by side — multi-column
|
|
739
|
+
* layout is always an explicit Grid (or {@link FlexNode}) the author drags in,
|
|
740
|
+
* never an implicit multi-block row.
|
|
741
|
+
*/
|
|
742
|
+
export interface GridNode extends BlockBase {
|
|
743
|
+
type: "grid";
|
|
744
|
+
children: Block[];
|
|
745
|
+
/**
|
|
746
|
+
* Number of equal-width columns the cells flow across. Defaults to `2`.
|
|
747
|
+
*/
|
|
748
|
+
columns?: number;
|
|
749
|
+
/**
|
|
750
|
+
* Gap between columns, in pixels. Defaults to the form-level stack gap.
|
|
751
|
+
*/
|
|
752
|
+
gap?: number;
|
|
753
|
+
/**
|
|
754
|
+
* Gap between wrapped rows, in pixels. Defaults to `gap`.
|
|
755
|
+
*/
|
|
756
|
+
rowGap?: number;
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* A block: a leaf field or a container. Every node in the layout tree is a
|
|
760
|
+
* block — blocks stack vertically in their parent's order, and a container's
|
|
761
|
+
* body is itself a block list.
|
|
762
|
+
*/
|
|
763
|
+
export type Block = FormField | ContainerNode;
|
|
764
|
+
/**
|
|
765
|
+
* Any node that binds a value (a keyed leaf field or a subform).
|
|
766
|
+
*/
|
|
767
|
+
export type KeyedNodeUnion = Extract<Block, KeyedNode>;
|
|
768
|
+
/**
|
|
769
|
+
* Which device a {@link PresentationLayer} targets. PC and mobile each carry an
|
|
770
|
+
* independent field tree and layout; the data layer (variables / data sources /
|
|
771
|
+
* keys) is shared, so the same key binds the same value on both.
|
|
772
|
+
*/
|
|
773
|
+
export type PresentationDevice = "pc" | "mobile";
|
|
774
|
+
/**
|
|
775
|
+
* One device's design: its own block tree plus the layout defaults that apply
|
|
776
|
+
* to it. A flat, vertically-stacked list of blocks; side-by-side placement is
|
|
777
|
+
* an explicit grid / flex container within.
|
|
778
|
+
*/
|
|
779
|
+
export interface PresentationLayer {
|
|
780
|
+
/**
|
|
781
|
+
* Vertical gap between the root document's stacked blocks, and the default
|
|
782
|
+
* every container stack inherits when it sets no `gap` of its own. Defaults to
|
|
783
|
+
* {@link DEFAULT_GAP_SCALE}.
|
|
784
|
+
*/
|
|
785
|
+
gap?: GapScale;
|
|
786
|
+
children: Block[];
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* The form schema (generation 2). The form-global data layer lives at the top;
|
|
790
|
+
* each device's field tree and layout live under {@link FormSchema.presentations}.
|
|
791
|
+
* `pc` is always present; `mobile` is optional — absent means that device has no
|
|
792
|
+
* design yet (the renderer shows an empty state rather than falling back).
|
|
793
|
+
*/
|
|
794
|
+
export interface FormSchema extends NodeBase {
|
|
795
|
+
/**
|
|
796
|
+
* Schema generation. Bumped (with a real migration) on a breaking change.
|
|
797
|
+
*/
|
|
798
|
+
version: 2;
|
|
799
|
+
/**
|
|
800
|
+
* Form-global variables, surfaced to expressions as `$vars.<name>`. Shared
|
|
801
|
+
* across devices.
|
|
802
|
+
*/
|
|
803
|
+
variables?: FormVariable[];
|
|
804
|
+
/**
|
|
805
|
+
* Reusable, form-global option sources referenced by selection fields. Shared
|
|
806
|
+
* across devices.
|
|
807
|
+
*/
|
|
808
|
+
dataSources?: FormDataSource[];
|
|
809
|
+
/**
|
|
810
|
+
* Form-scope linkage — the global "events" layer. Its rules carry lifecycle
|
|
811
|
+
* triggers (`load` / `beforeSubmit` / `afterSubmit`) or a form-wide
|
|
812
|
+
* `condition`, and **effect actions only** (the form has no self field whose
|
|
813
|
+
* state could be derived). Shared across devices; validated under the
|
|
814
|
+
* form-scope policy.
|
|
815
|
+
*/
|
|
816
|
+
linkage?: FieldLinkage;
|
|
817
|
+
/**
|
|
818
|
+
* Per-device designs. `pc` is the primary / required tree; `mobile` is added
|
|
819
|
+
* when the user designs (or converts to) a mobile layout.
|
|
820
|
+
*/
|
|
821
|
+
presentations: {
|
|
822
|
+
pc: PresentationLayer;
|
|
823
|
+
mobile?: PresentationLayer;
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* A single device's design flattened with the shared data layer — the shape the
|
|
828
|
+
* runtime renderer and linkage engine evaluate. Produced by `toRuntimeSchema`
|
|
829
|
+
* from a {@link FormSchema} + a {@link PresentationDevice}. A subform template is
|
|
830
|
+
* also expressed as one (its own `children`, no shared data layer), so the
|
|
831
|
+
* runtime treats the root form and a repeating-group row uniformly.
|
|
832
|
+
*/
|
|
833
|
+
export interface RuntimeSchema extends PresentationLayer {
|
|
834
|
+
id: string;
|
|
835
|
+
variables?: FormVariable[];
|
|
836
|
+
dataSources?: FormDataSource[];
|
|
837
|
+
linkage?: FieldLinkage;
|
|
838
|
+
}
|
|
839
|
+
export {};
|