@vectoriox/iox-builder 4.9.0 → 4.10.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.
|
@@ -9335,6 +9335,216 @@ class GalleryConfig extends ComponentConfig {
|
|
|
9335
9335
|
}
|
|
9336
9336
|
}
|
|
9337
9337
|
|
|
9338
|
+
/** Every style group — the state blocks and field group are ordinary containers to style. */
|
|
9339
|
+
const fullStyles = () => buildFullStyleTraits();
|
|
9340
|
+
/** Layout-ish groups for a form shell: it arranges fields, it is not text. */
|
|
9341
|
+
const shellStyles = () => [
|
|
9342
|
+
new PositionGroupStyleConfig(),
|
|
9343
|
+
new LayoutGroupStyleConfig(),
|
|
9344
|
+
new SizeGroupStyleConfig(),
|
|
9345
|
+
new SpacingGroupStyleConfig(),
|
|
9346
|
+
new BorderGroupStyleConfig(),
|
|
9347
|
+
new BackgroundGroupStyleConfig(),
|
|
9348
|
+
new TypographyGroupStyleConfig(),
|
|
9349
|
+
new EffectsGroupStyleConfig(),
|
|
9350
|
+
];
|
|
9351
|
+
/**
|
|
9352
|
+
* Form — the container that scopes its fields by ANCESTRY (decision D1).
|
|
9353
|
+
*
|
|
9354
|
+
* The destination config ("After submit") is an ordered action list edited in the Bindings panel as
|
|
9355
|
+
* a property group, not here as flat traits — see forms-and-inputs-plan.md §4b. What lives here is
|
|
9356
|
+
* the handful of settings that ARE single values.
|
|
9357
|
+
*
|
|
9358
|
+
* Auto-creates a working contact form: two fields, a submit button, and the two non-deletable state
|
|
9359
|
+
* blocks. Dropping a Form therefore gives a form that already validates and already stores.
|
|
9360
|
+
*/
|
|
9361
|
+
class FormComponentConfig extends ComponentConfig {
|
|
9362
|
+
constructor() {
|
|
9363
|
+
super('Form', 'iox-form', 'ph-thin ph-textbox', 'Forms');
|
|
9364
|
+
this.traits = [
|
|
9365
|
+
new TraitConfig('__formLabel', 'Form', TraitInputType.SectionLabel),
|
|
9366
|
+
new TraitConfig('name', 'Form name', TraitInputType.Text, undefined, 'Contact form'),
|
|
9367
|
+
// Stable identity the submit endpoint resolves the saved spec by. Generated on create;
|
|
9368
|
+
// shown read-only-ish so an author can copy it into a webhook consumer.
|
|
9369
|
+
new TraitConfig('formId', 'Form ID', TraitInputType.Text, undefined, ''),
|
|
9370
|
+
new TraitConfig('feedback', 'Validation feedback', TraitInputType.Select, [
|
|
9371
|
+
{ label: 'Smart — on submit, then live once touched', value: 'smart' },
|
|
9372
|
+
{ label: 'On submit only', value: 'submit' },
|
|
9373
|
+
{ label: 'As you type', value: 'live' },
|
|
9374
|
+
], 'smart'),
|
|
9375
|
+
new TraitConfig('resetAfterSubmit', 'Clear the form after submit', TraitInputType.Checkbox, undefined, false),
|
|
9376
|
+
new TraitConfig('__spamLabel', 'Spam protection', TraitInputType.SectionLabel),
|
|
9377
|
+
// On by default and invisible to the visitor (decision D12).
|
|
9378
|
+
new TraitConfig('honeypot', 'Honeypot field', TraitInputType.Checkbox, undefined, true),
|
|
9379
|
+
new TraitConfig('minFillMs', 'Minimum fill time (ms)', TraitInputType.Number, undefined, 1200),
|
|
9380
|
+
new TraitConfig('__dataLabel', 'Data', TraitInputType.SectionLabel),
|
|
9381
|
+
// Absent means keep forever — the confirmed default. A number opts into purging.
|
|
9382
|
+
new TraitConfig('retentionDays', 'Delete submissions after (days)', TraitInputType.Number, undefined, ''),
|
|
9383
|
+
];
|
|
9384
|
+
this.styleTraits = shellStyles();
|
|
9385
|
+
this.children = [
|
|
9386
|
+
makeField({ label: 'Name', control: 'text', required: true }),
|
|
9387
|
+
makeField({ label: 'Email', control: 'email', required: true }),
|
|
9388
|
+
new SubmitButtonComponentConfig(),
|
|
9389
|
+
new FormSuccessComponentConfig(),
|
|
9390
|
+
new FormErrorComponentConfig(),
|
|
9391
|
+
];
|
|
9392
|
+
this.applyStyleDefaults({
|
|
9393
|
+
display: 'flex',
|
|
9394
|
+
flexDirection: 'column',
|
|
9395
|
+
gap: '16px',
|
|
9396
|
+
width: '100%',
|
|
9397
|
+
});
|
|
9398
|
+
}
|
|
9399
|
+
}
|
|
9400
|
+
/**
|
|
9401
|
+
* Field — ONE component for every control type (decision D4).
|
|
9402
|
+
*
|
|
9403
|
+
* `Required` is its own switch because it is the rule every form needs; the rest are added from a
|
|
9404
|
+
* menu, so an unused rule is invisible rather than an empty control (the Effects-group pattern).
|
|
9405
|
+
*/
|
|
9406
|
+
class FieldComponentConfig extends ComponentConfig {
|
|
9407
|
+
constructor() {
|
|
9408
|
+
super('Field', 'iox-field', 'ph-thin ph-text-box', 'Forms');
|
|
9409
|
+
this.traits = [
|
|
9410
|
+
new TraitConfig('__contentLabel', 'Content', TraitInputType.SectionLabel),
|
|
9411
|
+
new TraitConfig('label', 'Label', TraitInputType.Text, undefined, 'Label'),
|
|
9412
|
+
// Choosing the control also chooses the validation — an Email field validates email
|
|
9413
|
+
// with nothing configured.
|
|
9414
|
+
new TraitConfig('control', 'Type', TraitInputType.Select, [
|
|
9415
|
+
{ label: 'Text', value: 'text' },
|
|
9416
|
+
{ label: 'Email', value: 'email' },
|
|
9417
|
+
{ label: 'Phone', value: 'tel' },
|
|
9418
|
+
{ label: 'Website', value: 'url' },
|
|
9419
|
+
{ label: 'Number', value: 'number' },
|
|
9420
|
+
{ label: 'Password', value: 'password' },
|
|
9421
|
+
{ label: 'Long text', value: 'textarea' },
|
|
9422
|
+
{ label: 'Dropdown', value: 'select' },
|
|
9423
|
+
{ label: 'Checkbox', value: 'checkbox' },
|
|
9424
|
+
{ label: 'Radio group', value: 'radio' },
|
|
9425
|
+
{ label: 'Date', value: 'date' },
|
|
9426
|
+
{ label: 'Time', value: 'time' },
|
|
9427
|
+
{ label: 'File upload', value: 'file' },
|
|
9428
|
+
{ label: 'Hidden', value: 'hidden' },
|
|
9429
|
+
], 'text'),
|
|
9430
|
+
new TraitConfig('placeholder', 'Placeholder', TraitInputType.Text, undefined, '', false, { trait: 'control', values: ['text', 'email', 'tel', 'url', 'number', 'password', 'textarea', 'select'] }),
|
|
9431
|
+
new TraitConfig('help', 'Help text', TraitInputType.Text, undefined, ''),
|
|
9432
|
+
new TraitConfig('rows', 'Rows', TraitInputType.Number, undefined, 4, false, { trait: 'control', values: 'textarea' }),
|
|
9433
|
+
new TraitConfig('accept', 'Accepted file types', TraitInputType.Text, undefined, '', false, { trait: 'control', values: 'file' }),
|
|
9434
|
+
new TraitConfig('labelHidden', 'Hide label (screen readers still read it)', TraitInputType.Checkbox, undefined, false),
|
|
9435
|
+
// The submitted key. Derived from the label; editable for external integrations.
|
|
9436
|
+
new TraitConfig('name', 'Submitted key', TraitInputType.Text, undefined, ''),
|
|
9437
|
+
new TraitConfig('defaultValue', 'Default value', TraitInputType.Text, undefined, ''),
|
|
9438
|
+
new TraitConfig('__optionsLabel', 'Options', TraitInputType.SectionLabel),
|
|
9439
|
+
// One per line, `value|Label` or just the label. A richer editor arrives with bound
|
|
9440
|
+
// options in Phase 2; this keeps v1 to one control instead of a new trait type.
|
|
9441
|
+
new TraitConfig('optionsText', 'Choices (one per line)', TraitInputType.Textarea, undefined, '', false, { trait: 'control', values: ['select', 'radio'] }),
|
|
9442
|
+
new TraitConfig('__validationLabel', 'Validation', TraitInputType.SectionLabel),
|
|
9443
|
+
new TraitConfig('required', 'Required', TraitInputType.Checkbox, undefined, false),
|
|
9444
|
+
// `rules` is the additive list (minLength, pattern, matches, …). Its editor is a panel
|
|
9445
|
+
// concern; the node just carries the array.
|
|
9446
|
+
new TraitConfig('rules', 'Rules', TraitInputType.Textarea, undefined, ''),
|
|
9447
|
+
];
|
|
9448
|
+
this.styleTraits = fullStyles();
|
|
9449
|
+
this.applyStyleDefaults({
|
|
9450
|
+
display: 'block',
|
|
9451
|
+
width: '100%',
|
|
9452
|
+
});
|
|
9453
|
+
}
|
|
9454
|
+
}
|
|
9455
|
+
/** A plain layout row so two fields can sit side by side. Config-only, like List/ListItem. */
|
|
9456
|
+
class FieldGroupComponentConfig extends ComponentConfig {
|
|
9457
|
+
constructor() {
|
|
9458
|
+
super('FieldGroup', 'app-builder-container', 'ph-thin ph-columns', 'Forms');
|
|
9459
|
+
this.traits = [];
|
|
9460
|
+
this.styleTraits = fullStyles();
|
|
9461
|
+
this.children = [];
|
|
9462
|
+
this.applyStyleDefaults({
|
|
9463
|
+
display: 'flex',
|
|
9464
|
+
flexDirection: 'row',
|
|
9465
|
+
gap: '16px',
|
|
9466
|
+
width: '100%',
|
|
9467
|
+
});
|
|
9468
|
+
}
|
|
9469
|
+
}
|
|
9470
|
+
/** The submit button. Carries no destination — that lives on the Form (decision D9). */
|
|
9471
|
+
class SubmitButtonComponentConfig extends ComponentConfig {
|
|
9472
|
+
constructor() {
|
|
9473
|
+
super('SubmitButton', 'iox-submit', 'ph-thin ph-paper-plane-tilt', 'Forms');
|
|
9474
|
+
this.traits = [
|
|
9475
|
+
new TraitConfig('label', 'Label', TraitInputType.Text, undefined, 'Send'),
|
|
9476
|
+
new TraitConfig('loadingLabel', 'While sending', TraitInputType.Text, undefined, 'Sending…'),
|
|
9477
|
+
new TraitConfig('disableWhileSubmitting', 'Disable while sending', TraitInputType.Checkbox, undefined, true),
|
|
9478
|
+
];
|
|
9479
|
+
this.styleTraits = fullStyles();
|
|
9480
|
+
this.applyStyleDefaults({
|
|
9481
|
+
display: 'inline-flex',
|
|
9482
|
+
alignItems: 'center',
|
|
9483
|
+
justifyContent: 'center',
|
|
9484
|
+
width: 'auto',
|
|
9485
|
+
// Meets the 44px tap-target minimum the responsive audit checks for.
|
|
9486
|
+
minHeight: '44px',
|
|
9487
|
+
padding: '12px 24px',
|
|
9488
|
+
borderRadius: '6px',
|
|
9489
|
+
backgroundColor: '#a05c5c',
|
|
9490
|
+
color: '#ffffff',
|
|
9491
|
+
cursor: 'pointer',
|
|
9492
|
+
});
|
|
9493
|
+
}
|
|
9494
|
+
}
|
|
9495
|
+
/**
|
|
9496
|
+
* The Success block. `hidden` keeps it out of the Components panel: it is auto-created by the Form
|
|
9497
|
+
* and reached through the canvas state switcher, never dropped on its own.
|
|
9498
|
+
*/
|
|
9499
|
+
class FormSuccessComponentConfig extends ComponentConfig {
|
|
9500
|
+
constructor() {
|
|
9501
|
+
super('FormSuccess', 'iox-form-success', 'ph-thin ph-check-circle', 'Forms');
|
|
9502
|
+
this.hidden = true;
|
|
9503
|
+
this.traits = [];
|
|
9504
|
+
this.styleTraits = fullStyles();
|
|
9505
|
+
this.children = [];
|
|
9506
|
+
this.applyStyleDefaults({
|
|
9507
|
+
display: 'block',
|
|
9508
|
+
width: '100%',
|
|
9509
|
+
padding: '16px',
|
|
9510
|
+
borderRadius: '6px',
|
|
9511
|
+
backgroundColor: '#e4efe8',
|
|
9512
|
+
color: '#3f7355',
|
|
9513
|
+
});
|
|
9514
|
+
}
|
|
9515
|
+
}
|
|
9516
|
+
/** The Error block. One design, five reasons — the renderer writes the resolved reason in. */
|
|
9517
|
+
class FormErrorComponentConfig extends ComponentConfig {
|
|
9518
|
+
constructor() {
|
|
9519
|
+
super('FormError', 'iox-form-error', 'ph-thin ph-warning-circle', 'Forms');
|
|
9520
|
+
this.hidden = true;
|
|
9521
|
+
this.traits = [];
|
|
9522
|
+
this.styleTraits = fullStyles();
|
|
9523
|
+
this.children = [];
|
|
9524
|
+
this.applyStyleDefaults({
|
|
9525
|
+
display: 'block',
|
|
9526
|
+
width: '100%',
|
|
9527
|
+
padding: '16px',
|
|
9528
|
+
borderRadius: '6px',
|
|
9529
|
+
backgroundColor: '#f6e3e1',
|
|
9530
|
+
color: '#a8413a',
|
|
9531
|
+
});
|
|
9532
|
+
}
|
|
9533
|
+
}
|
|
9534
|
+
/** A Field pre-filled for the default contact form. */
|
|
9535
|
+
function makeField(props) {
|
|
9536
|
+
const config = new FieldComponentConfig();
|
|
9537
|
+
for (const trait of config.traits) {
|
|
9538
|
+
if (trait.name === 'label')
|
|
9539
|
+
trait.default = props.label;
|
|
9540
|
+
if (trait.name === 'control')
|
|
9541
|
+
trait.default = props.control;
|
|
9542
|
+
if (trait.name === 'required')
|
|
9543
|
+
trait.default = !!props.required;
|
|
9544
|
+
}
|
|
9545
|
+
return config;
|
|
9546
|
+
}
|
|
9547
|
+
|
|
9338
9548
|
class BuilderHeadingComponentConfig extends ComponentConfig {
|
|
9339
9549
|
constructor() {
|
|
9340
9550
|
super('Heading', 'app-builder-heading', 'ph-thin ph-text-h', 'Basic');
|
|
@@ -9747,5 +9957,5 @@ class BuilderSpacerComponentConfig extends ComponentConfig {
|
|
|
9747
9957
|
* Generated bundle index. Do not edit.
|
|
9748
9958
|
*/
|
|
9749
9959
|
|
|
9750
|
-
export { ACTION_TYPE_OPTIONS, AuditCode, AuditPanelComponent, AuditSeverity, BREAKPOINT_PRESENTATION, BUILDER_CANVAS_CONTAINER, BackgroundGroupStyleConfig, BorderGroupStyleConfig, BreadcrumbBarComponent, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderClipboardService, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDataSourceService, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderHistoryService, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderListComponentConfig, BuilderListItemComponentConfig, BuilderMode, BuilderRepeaterComponent, BuilderSpacerComponentConfig, ButtonBlockComponentConfig, CardComponentConfig, ChildLayoutGroupStyleConfig, ComponentConfig, ComponentRegistryService, DEFAULT_ESSENTIAL_TRAITS, DRAG_HANDLE_ATTR, DataSourceRegistryService, DataSourceType, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS$1 as EASING_OPTIONS, ESSENTIAL_TRAITS_BY_TYPE, EffectsGroupStyleConfig, GalleryConfig, GroupStyleConfig, INTERACTION_STATES, INVERSE_ACTION, IOX_DATA_SOURCE_ENDPOINTS, IOX_FONT_MANAGER, InteractionEngineService, InteractionPresetRegistryService, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LAYOUT_PRESETS, LayerTreeComponent, LayoutGroupStyleConfig, ListGroupStyleConfig, NodeAction, OverlayComponent, OverlayService, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PositionGroupStyleConfig, PresetRegistryService, RELATIONAL_STATES, RELATIONAL_STATE_BASE, ROUTE_ANIMATION_OPTIONS, RenderDirective, RepeaterComponentConfig, SCREEN_WIDTH_OPTIONS, STRUCTURAL_STATES, SUPPORTED_STATES, SectionComponent, SectionComponentConfig, SizeGroupStyleConfig, SliderContainerComponent, SliderContainerConfig, SliderSlideComponent, SliderSlideConfig, SpacingGroupStyleConfig, StyleCategory, StyleRegistryService, TraitConfig as StyleTraitConfig, SymbolRegistryService, TARGETED_STATES, TARGETED_STATE_BASE, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, TypographyGroupStyleConfig, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, ViewportService, ZOOM_OPTIONS, arrayItemSchemaFields, arraySchemaFields, auditNodes, buildFullStyleTraits, buildLayoutPreset, buildPresetStyleTraits, canFluidise, collapseColumnsProps, columnCountOf, defaultPageSettings, dropTargetLabel, essentialTraitsFor, findNodeLocation, findParentOf, flattenSchemaFields, fluidiseProps, generateNodeId, isHiddenAt, matchesControlSearch, nodeAncestorPath, nodeAncestorPathInEither, reorderProps, resolveInsertTarget, resolveTraitControllerType, resolveTraitOptions, setStyleTrait, stackChildrenProps, summarise, visibilityProps, wrapNode };
|
|
9960
|
+
export { ACTION_TYPE_OPTIONS, AuditCode, AuditPanelComponent, AuditSeverity, BREAKPOINT_PRESENTATION, BUILDER_CANVAS_CONTAINER, BackgroundGroupStyleConfig, BorderGroupStyleConfig, BreadcrumbBarComponent, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderClipboardService, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDataSourceService, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderHistoryService, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderListComponentConfig, BuilderListItemComponentConfig, BuilderMode, BuilderRepeaterComponent, BuilderSpacerComponentConfig, ButtonBlockComponentConfig, CardComponentConfig, ChildLayoutGroupStyleConfig, ComponentConfig, ComponentRegistryService, DEFAULT_ESSENTIAL_TRAITS, DRAG_HANDLE_ATTR, DataSourceRegistryService, DataSourceType, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS$1 as EASING_OPTIONS, ESSENTIAL_TRAITS_BY_TYPE, EffectsGroupStyleConfig, FieldComponentConfig, FieldGroupComponentConfig, FormComponentConfig, FormErrorComponentConfig, FormSuccessComponentConfig, GalleryConfig, GroupStyleConfig, INTERACTION_STATES, INVERSE_ACTION, IOX_DATA_SOURCE_ENDPOINTS, IOX_FONT_MANAGER, InteractionEngineService, InteractionPresetRegistryService, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LAYOUT_PRESETS, LayerTreeComponent, LayoutGroupStyleConfig, ListGroupStyleConfig, NodeAction, OverlayComponent, OverlayService, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PositionGroupStyleConfig, PresetRegistryService, RELATIONAL_STATES, RELATIONAL_STATE_BASE, ROUTE_ANIMATION_OPTIONS, RenderDirective, RepeaterComponentConfig, SCREEN_WIDTH_OPTIONS, STRUCTURAL_STATES, SUPPORTED_STATES, SectionComponent, SectionComponentConfig, SizeGroupStyleConfig, SliderContainerComponent, SliderContainerConfig, SliderSlideComponent, SliderSlideConfig, SpacingGroupStyleConfig, StyleCategory, StyleRegistryService, TraitConfig as StyleTraitConfig, SubmitButtonComponentConfig, SymbolRegistryService, TARGETED_STATES, TARGETED_STATE_BASE, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, TypographyGroupStyleConfig, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, ViewportService, ZOOM_OPTIONS, arrayItemSchemaFields, arraySchemaFields, auditNodes, buildFullStyleTraits, buildLayoutPreset, buildPresetStyleTraits, canFluidise, collapseColumnsProps, columnCountOf, defaultPageSettings, dropTargetLabel, essentialTraitsFor, findNodeLocation, findParentOf, flattenSchemaFields, fluidiseProps, generateNodeId, isHiddenAt, matchesControlSearch, nodeAncestorPath, nodeAncestorPathInEither, reorderProps, resolveInsertTarget, resolveTraitControllerType, resolveTraitOptions, setStyleTrait, stackChildrenProps, summarise, visibilityProps, wrapNode };
|
|
9751
9961
|
//# sourceMappingURL=vectoriox-iox-builder.mjs.map
|