@vectoriox/iox-builder 4.8.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.
|
@@ -16,7 +16,7 @@ import { SelectModule } from 'primeng/select';
|
|
|
16
16
|
import { TooltipModule } from 'primeng/tooltip';
|
|
17
17
|
import { DialogModule } from 'primeng/dialog';
|
|
18
18
|
import * as i17 from '@vectoriox/iox-ui';
|
|
19
|
-
import { DEFAULT_WIDTH_BY_TYPE, Breakpoint, BREAKPOINTS, countOverrides, setOverride, breakpointDef, breakpointForWidth, ContextStore, ComponentInstanceRegistryService, isActionEnabled, isContextAction, contextActionEffect, resolveContextValue, DeclarationContext, planResponsiveRules, resolveStyleProps, buildTargetedStateSelector, compileDeclarations, wrapInBreakpointQuery, BreakpointQueryKind, safeSetInput, composeVirtualTraits, stateNamesIn, collectContextSlotKeys, withContextSlots, nodeUsesContext, resolvePath, applyBindingPipes, IS_PREVIEW, planDataSource, dataSourcePlanToRequest, normalizeCollectionResult, resolveRepeaterItems, getByPath, computeRelative, IoxPageModule } from '@vectoriox/iox-ui';
|
|
19
|
+
import { DEFAULT_WIDTH_BY_TYPE, Breakpoint, BREAKPOINTS, countOverrides, setOverride, breakpointDef, breakpointForWidth, ContextStore, ComponentInstanceRegistryService, isActionEnabled, isContextAction, contextActionEffect, resolveContextValue, DeclarationContext, planResponsiveRules, resolveStyleProps, buildTargetedStateSelector, compileDeclarations, wrapInBreakpointQuery, BreakpointQueryKind, safeSetInput, composeVirtualTraits, stateNamesIn, resolveInputs, setInputOverride, collectContextSlotKeys, withContextSlots, nodeUsesContext, resolvePath, applyBindingPipes, IS_PREVIEW, planDataSource, dataSourcePlanToRequest, normalizeCollectionResult, resolveRepeaterItems, getByPath, computeRelative, IoxPageModule } from '@vectoriox/iox-ui';
|
|
20
20
|
export { ComponentInstanceRegistryService, VIRTUAL_TRAIT_KEYS, composeVirtualTraits } from '@vectoriox/iox-ui';
|
|
21
21
|
import Lenis from 'lenis';
|
|
22
22
|
import { Subject, BehaviorSubject, of, forkJoin } from 'rxjs';
|
|
@@ -1202,6 +1202,10 @@ var AuditCode;
|
|
|
1202
1202
|
AuditCode["TapTarget"] = "tap-target";
|
|
1203
1203
|
AuditCode["TinyText"] = "tiny-text";
|
|
1204
1204
|
AuditCode["UnboundedImage"] = "unbounded-image";
|
|
1205
|
+
/** A slider showing more slides than the width can carry — each one unreadably narrow. */
|
|
1206
|
+
AuditCode["SlidesOverflow"] = "slides-overflow";
|
|
1207
|
+
/** An out-of-flow node whose box lands outside the frame, so it is unreachable at this width. */
|
|
1208
|
+
AuditCode["OffscreenAbsolute"] = "offscreen-absolute";
|
|
1205
1209
|
})(AuditCode || (AuditCode = {}));
|
|
1206
1210
|
var AuditSeverity;
|
|
1207
1211
|
(function (AuditSeverity) {
|
|
@@ -1215,6 +1219,10 @@ const MIN_TAP_PX = 44;
|
|
|
1215
1219
|
const MIN_TEXT_PX = 12;
|
|
1216
1220
|
/** Types a visitor taps. */
|
|
1217
1221
|
const TAPPABLE = new Set(['Button', 'ButtonBlock', 'Link', 'LinkedContainer']);
|
|
1222
|
+
/** Narrower than this, a slide shows too little of its content to be worth showing at all. */
|
|
1223
|
+
const MIN_SLIDE_PX = 200;
|
|
1224
|
+
/** Out-of-flow positioning that can put a node outside the frame. */
|
|
1225
|
+
const OUT_OF_FLOW = new Set(['absolute', 'fixed']);
|
|
1218
1226
|
const nameOf = (node) => node.label || node.type;
|
|
1219
1227
|
const pxOf = (value) => {
|
|
1220
1228
|
const match = /^(-?\d+(?:\.\d+)?)px$/i.exec(String(value ?? ''));
|
|
@@ -1277,6 +1285,37 @@ function auditNodes(nodes, viewportWidth) {
|
|
|
1277
1285
|
fix: { height: 'auto', aspectRatio: '16 / 9' },
|
|
1278
1286
|
});
|
|
1279
1287
|
}
|
|
1288
|
+
// 6. A slider showing more slides than this width can carry. NOT a CSS problem: slide count
|
|
1289
|
+
// is a component trait, so the fix is a per-breakpoint TRAIT override (P3-G1), not a style.
|
|
1290
|
+
if (node.type === 'SliderContainer' && node.width > 0) {
|
|
1291
|
+
const perView = Number(node.inputs?.['slidesPerView']);
|
|
1292
|
+
if (Number.isFinite(perView) && perView > 1) {
|
|
1293
|
+
const slideWidth = node.width / perView;
|
|
1294
|
+
if (slideWidth < MIN_SLIDE_PX) {
|
|
1295
|
+
const fits = Math.max(1, Math.floor(node.width / MIN_SLIDE_PX));
|
|
1296
|
+
findings.push({
|
|
1297
|
+
nodeId: node.id, nodeName: name, code: AuditCode.SlidesOverflow, severity: AuditSeverity.Warning,
|
|
1298
|
+
message: `${name} shows ${perView} slides across ${Math.round(node.width)}px — ${Math.round(slideWidth)}px each. Show ${fits} at this width.`,
|
|
1299
|
+
inputFix: { slidesPerView: fits },
|
|
1300
|
+
});
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
// 7. An out-of-flow node that has left the frame. Measured, not inferred: a negative offset
|
|
1305
|
+
// is legitimate design until it actually puts the content beyond the edge.
|
|
1306
|
+
if (OUT_OF_FLOW.has(String(styles['position'] ?? '')) && node.left !== undefined && node.width > 0) {
|
|
1307
|
+
const right = node.left + node.width;
|
|
1308
|
+
const offLeft = right <= 0.5;
|
|
1309
|
+
const offRight = node.left >= viewportWidth - 0.5;
|
|
1310
|
+
if (offLeft || offRight) {
|
|
1311
|
+
findings.push({
|
|
1312
|
+
nodeId: node.id, nodeName: name, code: AuditCode.OffscreenAbsolute, severity: AuditSeverity.Error,
|
|
1313
|
+
message: `${name} is positioned ${offLeft ? 'left of' : 'beyond'} the ${viewportWidth}px viewport — it cannot be seen or tapped at this width.`,
|
|
1314
|
+
// No blind auto-fix: the author's intent (a decorative overflow vs a mistake)
|
|
1315
|
+
// is not knowable from geometry. Selecting the node is the useful action.
|
|
1316
|
+
});
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1280
1319
|
}
|
|
1281
1320
|
const rank = { [AuditSeverity.Error]: 0, [AuditSeverity.Warning]: 1, [AuditSeverity.Info]: 2 };
|
|
1282
1321
|
return findings
|
|
@@ -5607,6 +5646,9 @@ class BuilderComponent {
|
|
|
5607
5646
|
this.auditRunning = true;
|
|
5608
5647
|
const scale = this.viewportService.getScale() || 1;
|
|
5609
5648
|
const width = this.viewportService.getState().width;
|
|
5649
|
+
// Positions are reported relative to the canvas FRAME, not the editor window, so an
|
|
5650
|
+
// "off-screen" finding means off the simulated viewport rather than off the user's monitor.
|
|
5651
|
+
const frame = this.previewCanvas?.nativeElement?.getBoundingClientRect() ?? { left: 0, top: 0 };
|
|
5610
5652
|
const nodes = [];
|
|
5611
5653
|
const visit = (list) => {
|
|
5612
5654
|
for (const node of list) {
|
|
@@ -5618,8 +5660,13 @@ class BuilderComponent {
|
|
|
5618
5660
|
type: node.type,
|
|
5619
5661
|
label: node.label,
|
|
5620
5662
|
styleProps: resolveStyleProps(this.baseStyleMapOf(node), node.responsive, this.activeBreakpoint),
|
|
5663
|
+
// Traits resolved at this width too — some failures (a 4-up slider on a
|
|
5664
|
+
// phone) are invisible to a style-only audit. See P3-G1/G4.
|
|
5665
|
+
inputs: resolveInputs(this.baseInputMapOf(node), node.responsive, this.activeBreakpoint),
|
|
5621
5666
|
width: rect.width / scale,
|
|
5622
5667
|
height: rect.height / scale,
|
|
5668
|
+
left: (rect.left - frame.left) / scale,
|
|
5669
|
+
top: (rect.top - frame.top) / scale,
|
|
5623
5670
|
});
|
|
5624
5671
|
}
|
|
5625
5672
|
if (node.children?.length)
|
|
@@ -5632,10 +5679,38 @@ class BuilderComponent {
|
|
|
5632
5679
|
this.auditRunning = false;
|
|
5633
5680
|
this.cdr.detectChanges();
|
|
5634
5681
|
}
|
|
5682
|
+
/** The node's OWN trait values — the Base layer the responsive `inputs` cascade sits on top of. */
|
|
5683
|
+
baseInputMapOf(node) {
|
|
5684
|
+
const out = {};
|
|
5685
|
+
for (const trait of (node.traits ?? [])) {
|
|
5686
|
+
if (trait?.name !== undefined && trait.default !== undefined)
|
|
5687
|
+
out[trait.name] = trait.default;
|
|
5688
|
+
}
|
|
5689
|
+
return out;
|
|
5690
|
+
}
|
|
5635
5691
|
/** Apply one finding's fix into the current breakpoint's layer (or the base styles at Base). */
|
|
5636
5692
|
applyAuditFix(finding) {
|
|
5637
5693
|
const node = this.findNodeById(finding.nodeId, this.layout) ?? this.findNodeById(finding.nodeId, this.globalElements);
|
|
5638
|
-
if (!node
|
|
5694
|
+
if (!node)
|
|
5695
|
+
return;
|
|
5696
|
+
// A TRAIT fix (slide count) is not CSS — it lands in the breakpoint's `inputs` layer, or on
|
|
5697
|
+
// the node itself at Base, mirroring exactly how a style fix is applied below.
|
|
5698
|
+
if (finding.inputFix) {
|
|
5699
|
+
for (const [name, value] of Object.entries(finding.inputFix)) {
|
|
5700
|
+
if (this.activeBreakpoint === Breakpoint.Base) {
|
|
5701
|
+
const trait = (node.traits ?? []).find((t) => t.name === name);
|
|
5702
|
+
if (trait)
|
|
5703
|
+
trait.default = value;
|
|
5704
|
+
}
|
|
5705
|
+
else {
|
|
5706
|
+
node.responsive = setInputOverride(node.responsive, this.activeBreakpoint, name, value);
|
|
5707
|
+
}
|
|
5708
|
+
}
|
|
5709
|
+
this.panelEventService.emit(PanelEventTypes.LAYOUT_CHANGED, this.layout);
|
|
5710
|
+
this.runAudit();
|
|
5711
|
+
return;
|
|
5712
|
+
}
|
|
5713
|
+
if (!finding.fix)
|
|
5639
5714
|
return;
|
|
5640
5715
|
if (this.activeBreakpoint === Breakpoint.Base) {
|
|
5641
5716
|
for (const [name, value] of Object.entries(finding.fix)) {
|
|
@@ -5664,7 +5739,7 @@ class BuilderComponent {
|
|
|
5664
5739
|
}
|
|
5665
5740
|
/** Apply every fixable finding, then re-measure. */
|
|
5666
5741
|
applyAllAuditFixes() {
|
|
5667
|
-
for (const finding of this.auditFindings.filter(f => !!f.fix))
|
|
5742
|
+
for (const finding of this.auditFindings.filter(f => !!f.fix || !!f.inputFix))
|
|
5668
5743
|
this.applyAuditFix(finding);
|
|
5669
5744
|
}
|
|
5670
5745
|
/** Select the node a finding is about. */
|
|
@@ -9260,6 +9335,216 @@ class GalleryConfig extends ComponentConfig {
|
|
|
9260
9335
|
}
|
|
9261
9336
|
}
|
|
9262
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
|
+
|
|
9263
9548
|
class BuilderHeadingComponentConfig extends ComponentConfig {
|
|
9264
9549
|
constructor() {
|
|
9265
9550
|
super('Heading', 'app-builder-heading', 'ph-thin ph-text-h', 'Basic');
|
|
@@ -9672,5 +9957,5 @@ class BuilderSpacerComponentConfig extends ComponentConfig {
|
|
|
9672
9957
|
* Generated bundle index. Do not edit.
|
|
9673
9958
|
*/
|
|
9674
9959
|
|
|
9675
|
-
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 };
|
|
9676
9961
|
//# sourceMappingURL=vectoriox-iox-builder.mjs.map
|