@vectoriox/iox-builder 11.36.0 → 11.38.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.
|
@@ -20,7 +20,7 @@ import * as i2$1 from '@vectoriox/iox-ui';
|
|
|
20
20
|
import { nodeCssId, needsGroupName, resolveBoundValue, isBoundStyleProp, STRUCTURAL_STATES as STRUCTURAL_STATES$1, VALIDATION_STATES as VALIDATION_STATES$1, VALIDATION_STATE_CLASS as VALIDATION_STATE_CLASS$1, DEFAULT_WIDTH_BY_TYPE, TEXT_DIRECTION_KEY, TEXT_ALIGN_KEY, TextAlign, COLOR_SCHEME_TRAIT, COLOR_SCHEMES, ColorScheme, LinkType, MAX_LINES_KEY, A11yTrait, BREAKPOINTS, Breakpoint, withSchemeInk, stripSuppressedProps, DeclarationContext, planPartRule, gateHoverRule, planResponsiveRules, resolveStyleProps, planStateRule, splitOuterProps, OUTER_STYLE_PROPS, siteColumnOf, compileTokenCssBlocks, catalogFontId, fontsForTokens, GOOGLE_FONTS_FILE_ORIGIN, googleFontHref, compileDeclarations, isLastEmittedStateKey, wrapInBreakpointQuery, BreakpointQueryKind, NEW_NODE_STYLE_DEFAULTS, defaultElementStyleFor, applyElementStyle, planDataSource, dataSourcePlanToRequest, normalizeCollectionResult, resolveRepeaterItems, getByPath, computeRelative, PROGRESS_ATTRIBUTE, interactionMarkerAttributes, cascadeChain, attachScrollProgress, ContextStore, ENTRANCE_ACTION_TYPES, EXIT_ACTION_TYPES, ComponentInstanceRegistryService, syncInteractionMarkers, entranceStartsHidden, isActionEnabled, restoreCountUp, SCROLL_PROGRESS_TRIGGER, armInteractionCounts, splitPressFeedback, isHoverPointer, isContextAction, contextActionEffect, resolveContextValue, effectiveActionType, INTERACTION_HIDDEN_ATTRIBUTE, COUNT_UP_ACTION, motionAllowed, reducedEntranceRun, settleInteraction, settleModeFor, SettleMode, playInteraction, entranceDelay, repeatedRowIndex, resolveInteractionEasing, entrancePreStateStyle, buildInteractionKeyframes, showToast, declaredInputNames, emptyImagePlaceholder, syncNodeDesignClasses, nodeTraitValue, syncNodeA11yAttributes, nodeA11yAttributes, safeSetInput, colorSchemeOf, withStateTransitions, composeVirtualTraits, stateNamesIn, partClassName, applyBoundStyles, applyBoundStyle, switchElementStyle, releaseElementStyle, countOverrides, setOverride, breakpointDef, breakpointForWidth, FormRenderState, collectContextSlotKeys, withContextSlots, needsAccessibleName, resolveInputs, setInputOverride, barReserveClass, compilePageStyle, nodeUsesContext, attachTooltips, showToastDesign, TOOLTIP_ATTRIBUTE, hidingHeadersIn, HeaderRuntime, inkFollowingHeadersIn, HeaderInkRuntime, isScrolled, SCROLLED_ATTRIBUTE, syncSubmitButtons, IS_PREVIEW, buttonBlockHref, layerFrame, rectInLayer, placeFloating, FloatingAlign, popoverSide, bootSlider, IoxPageModule, PALETTE_PRESETS, elementStyleById, PART_CLASS_NAMES } from '@vectoriox/iox-ui';
|
|
21
21
|
export { ComponentInstanceRegistryService, VIRTUAL_TRAIT_KEYS, composeVirtualTraits } from '@vectoriox/iox-ui';
|
|
22
22
|
import { StructureEdit, isAccordionPart, isDisclosurePart, isSliderPart, isTabsPart, isSegmentedPart, structureRefusal, StructureRefusal, SegmentedRole, SEGMENTED_MAX_OPTIONS, AccordionRole, SEGMENTED_MIN_OPTIONS, isExclusiveItemPart, TabsRole, ITEM_OPEN_STATE, readStyle, isSegmentedRoot, segmentedDefaultOn, segmentedOptions, isTabsRoot, isTabsFromContent, tabsTriggers, isAccordionRoot, isAccordionFromContent, accordionItems, initialAccordionOpen, accordionBehaviour, exclusiveItemLabel, exclusiveRootOf, tabTriggerOf, tabLabel, removeTabPair, tabPanelOf, tabsListOf, tabsPanelsOf, nextTabKey, CompositeBehaviourTrait, ACCORDION_DEFAULT_ONS, TabsBehaviourTrait, TABS_ACTIVATE_ONS, TABS_ORIENTATIONS, MarqueeTrait, MarqueeSpeed, MarqueeDirection, PopupTrait, PopupKind, PopupForm, PopupArrive, PopupAgain, DIALOG_MODAL_TRAIT, DisclosureRole, isExclusiveTrigger, onCompositeItemState, isCompositeItemOn, runAccountAction, ShopActionType, runShopAction, runCompositeItemAction, shouldScrollToItem, rowIndexOf as rowIndexOf$1, slideIndexForRow, isMarqueeRoot, compositeScopeId, compositeRowKeys, isExclusiveRoot, ExclusiveRuntime, exclusiveDefaultOf, exclusiveLabelOf, exclusiveBehaviourOf, exclusiveKindOf, compositeKindOfRole, AccordionRuntime, isToggleKind, MarqueeRuntime, closestAccordionItem, isAnyCompositeRoot, SceneRole, isExclusiveList, buildCardRecipe, buildBadge, buildChip, buildAccordionRecipe, buildDisclosureRecipe, buildTabsRecipe, buildSegmentedRecipe, buildLightboxRecipe, buildMarqueeRecipe, buildCounterRecipe, buildReadingBarRecipe, SHOP_RECIPES, ShopRecipe, ACCOUNT_RECIPES, AccountRecipe, NO_ELEMENT_STYLE, CompositeKind, PopupRole, SliderRole, accordionItemLabel, segmentedOptionLabel, isExclusivePanels, isLockedPart, attachShop, ShopRole, attachAccount, AccountRole, accordionRootOf, accordionItemOf, addAccordionItem, addTabPair, segmentedAddRefusal, addSegmentedOption, isCompositeItem, accordionHeadingLevel, isCompositePanel, isCompositeTrigger, popupFormOf, splitSliderChildren, hasSliderParts, buildConsentRecipe, SLIDE_CAPTION_TRAIT, SLIDER_SCROLL_PLAYS_TRAIT, SLIDER_PLACEMENT_TRAIT, SliderPlacement, SliderFlag } from '@vectoriox/iox-ui/composite-core';
|
|
23
|
-
import { formContentInHost, isInteractiveHost, findFormContentInHosts, presetFormActions, FORM_CHANNEL_ROLE, channelHref, channelOpensNewTab, FORM_ACTIONS_ROLE, SUBMIT_BUTTON_NODE_TYPE, FORM_AFTER_SEND_TRAIT, FormAfterSend } from '@vectoriox/iox-ui/forms-core';
|
|
23
|
+
import { formContentInHost, isInteractiveHost, findFormContentInHosts, formPresetById, presetFormActions, busyWord, fieldKindWords, channelWords, FORM_CHANNEL_ROLE, channelHref, channelOpensNewTab, FORM_ACTIONS_ROLE, SUBMIT_BUTTON_NODE_TYPE, FORM_NODE_TYPE, FIELD_NODE_TYPE, formWordIn, DEFAULT_BUSY_WORDS, FORM_AFTER_SEND_TRAIT, FormAfterSend, baselineFormWords } from '@vectoriox/iox-ui/forms-core';
|
|
24
24
|
import { Subject, BehaviorSubject, of, forkJoin } from 'rxjs';
|
|
25
25
|
import interact from 'interactjs';
|
|
26
26
|
import { HeaderTrait, HeaderBehaviour, HeaderEdge, HeaderInk, SECTION_EDGE_TRAIT, SECTION_EDGES, SECTION_SHAPE_TRAIT, SectionShape, MenuTrait, MenuForm, MenuReveal, MenuHover, MenuPhoneForm, MenuButtonKind, pageColumn, pageOpeningScheme, menuDialogAttributes, MenuAttribute } from '@vectoriox/iox-ui/design-core';
|
|
@@ -6423,11 +6423,18 @@ function isDisplayOnlyNode(node, underSpecimen) {
|
|
|
6423
6423
|
return underSpecimen || !!node.__previewClone;
|
|
6424
6424
|
}
|
|
6425
6425
|
|
|
6426
|
+
/** The payload a drag starts with: a builder is called (once — this is the drag's own tree), a value passed through. A
|
|
6427
|
+
* builder that makes nothing passes its null through, as a null value always did. */
|
|
6428
|
+
function resolveDragData(data) {
|
|
6429
|
+
return (typeof data === 'function' ? data() : data);
|
|
6430
|
+
}
|
|
6426
6431
|
class IoxDraggableDirective {
|
|
6427
6432
|
constructor(el, dragEngine) {
|
|
6428
6433
|
this.el = el;
|
|
6429
6434
|
this.dragEngine = dragEngine;
|
|
6430
|
-
/** The node (for canvas items) or component type string (for sidebar items)
|
|
6435
|
+
/** The node (for canvas items) or component type string (for sidebar items) — or a function that builds the payload
|
|
6436
|
+
* WHEN THE DRAG STARTS (a palette preset): a fresh tree per drag, and nothing built on each change-detection pass
|
|
6437
|
+
* the way a getter bound here would (iox-ui#159). */
|
|
6431
6438
|
this.ioxDragData = '';
|
|
6432
6439
|
/** Drop-zone id the item lives in. Null for sidebar items. */
|
|
6433
6440
|
this.ioxDragSourceId = null;
|
|
@@ -6441,7 +6448,7 @@ class IoxDraggableDirective {
|
|
|
6441
6448
|
return;
|
|
6442
6449
|
this.registered = true;
|
|
6443
6450
|
this.dragEngine.registerDraggable(this.el.nativeElement, () => {
|
|
6444
|
-
const data = this.ioxDragData;
|
|
6451
|
+
const data = resolveDragData(this.ioxDragData);
|
|
6445
6452
|
const type = typeof data === 'string' ? 'external' : 'internal';
|
|
6446
6453
|
const sourceIndex = type === 'internal' && this.ioxDragSourceId
|
|
6447
6454
|
? (this.dragEngine.getData(this.ioxDragSourceId)?.indexOf(data) ?? -1)
|
|
@@ -14795,11 +14802,16 @@ function matchesControlSearch(name, label, term) {
|
|
|
14795
14802
|
* carry the default Name/Email pair as well as its own fields.
|
|
14796
14803
|
*
|
|
14797
14804
|
* Returns null when a type is missing from the registry, so a half-built tree never reaches a page.
|
|
14805
|
+
*
|
|
14806
|
+
* `lang` is the SITE's language (vectoriox/iox-cms-client#115), never the admin's: the form asks, answers, fails and
|
|
14807
|
+
* says "While sending" in it — forms-core's own words (`formPresetById`, `busyWord`), the SAME the composer stamps, so a
|
|
14808
|
+
* form dropped from the tray onto a Hebrew page reads as the generated one does. Absent: English, as before.
|
|
14798
14809
|
*/
|
|
14799
|
-
function buildFormPreset(def, createConfig) {
|
|
14810
|
+
function buildFormPreset(def, createConfig, lang) {
|
|
14800
14811
|
const form = createConfig('Form');
|
|
14801
14812
|
if (!form)
|
|
14802
14813
|
return null;
|
|
14814
|
+
def = (lang ? formPresetById(def.id, lang) : null) ?? def;
|
|
14803
14815
|
setTrait(form, 'name', def.formName);
|
|
14804
14816
|
// A fresh id per insert: two forms on one page must never share a submissions stream.
|
|
14805
14817
|
setTrait(form, 'formId', `${def.id}-${Math.random().toString(36).slice(2, 8)}`);
|
|
@@ -14839,6 +14851,7 @@ function buildFormPreset(def, createConfig) {
|
|
|
14839
14851
|
if (!submit)
|
|
14840
14852
|
return null;
|
|
14841
14853
|
setTrait(submit, 'label', def.submitLabel);
|
|
14854
|
+
setTrait(submit, 'loadingLabel', busyWord(lang));
|
|
14842
14855
|
if (def.channel) {
|
|
14843
14856
|
// Send and the second channel share ONE row (premium N2) — it stays on screen after the form has sent.
|
|
14844
14857
|
const row = buildFormActionsRow(submit, def.channel, '', createConfig);
|
|
@@ -14862,65 +14875,67 @@ function buildFormPreset(def, createConfig) {
|
|
|
14862
14875
|
return form;
|
|
14863
14876
|
}
|
|
14864
14877
|
const FIELD_KIND_PRESETS = Object.freeze([
|
|
14865
|
-
{
|
|
14878
|
+
fieldKind({
|
|
14866
14879
|
control: 'checkbox', name: 'Checkbox', icon: 'ph-thin ph-check-square',
|
|
14867
14880
|
description: 'One tick. Making it required turns it into a must-accept.',
|
|
14868
|
-
|
|
14869
|
-
|
|
14870
|
-
{
|
|
14881
|
+
}),
|
|
14882
|
+
fieldKind({
|
|
14871
14883
|
control: 'switch', name: 'Switch', icon: 'ph-thin ph-toggle-left',
|
|
14872
14884
|
description: 'An on/off toggle — records true or false.',
|
|
14873
|
-
|
|
14874
|
-
|
|
14875
|
-
{
|
|
14885
|
+
}),
|
|
14886
|
+
fieldKind({
|
|
14876
14887
|
control: 'radio', name: 'Radio group', icon: 'ph-thin ph-radio-button',
|
|
14877
14888
|
description: 'Pick exactly one of a few visible choices.',
|
|
14878
|
-
|
|
14879
|
-
|
|
14880
|
-
},
|
|
14881
|
-
{
|
|
14889
|
+
}),
|
|
14890
|
+
fieldKind({
|
|
14882
14891
|
// Premium N1: chips — one or several of a few visible choices; tap to pick, the arrow keys move a one-answer row.
|
|
14883
14892
|
control: 'choices', name: 'Choice chips', icon: 'ph-thin ph-list-checks',
|
|
14884
14893
|
description: 'Pick one or several, as chips. The answer is the words picked.',
|
|
14885
|
-
label: 'What do you need?',
|
|
14886
|
-
optionsText: 'First choice\nSecond choice\nThird choice',
|
|
14887
14894
|
multiple: true,
|
|
14888
|
-
},
|
|
14889
|
-
{
|
|
14895
|
+
}),
|
|
14896
|
+
fieldKind({
|
|
14890
14897
|
control: 'select', name: 'Dropdown', icon: 'ph-thin ph-caret-circle-down',
|
|
14891
14898
|
description: 'Pick one from a list that folds away.',
|
|
14892
|
-
|
|
14893
|
-
|
|
14894
|
-
},
|
|
14895
|
-
{
|
|
14899
|
+
}),
|
|
14900
|
+
fieldKind({
|
|
14896
14901
|
control: 'range', name: 'Slider', icon: 'ph-thin ph-sliders-horizontal',
|
|
14897
14902
|
description: 'A number by sliding between a min and a max.',
|
|
14898
|
-
|
|
14899
|
-
|
|
14900
|
-
{
|
|
14903
|
+
}),
|
|
14904
|
+
fieldKind({
|
|
14901
14905
|
control: 'date', name: 'Date', icon: 'ph-thin ph-calendar-blank',
|
|
14902
14906
|
description: 'A calendar date.',
|
|
14903
|
-
|
|
14904
|
-
|
|
14905
|
-
{
|
|
14907
|
+
}),
|
|
14908
|
+
fieldKind({
|
|
14906
14909
|
control: 'time', name: 'Time', icon: 'ph-thin ph-clock',
|
|
14907
14910
|
description: 'A time of day.',
|
|
14908
|
-
|
|
14909
|
-
},
|
|
14911
|
+
}),
|
|
14910
14912
|
]);
|
|
14911
|
-
/**
|
|
14912
|
-
function
|
|
14913
|
+
/** A tray row's words are forms-core's (iox-ui#159) — ONE table, never a second English copy here. */
|
|
14914
|
+
function fieldKind(def) {
|
|
14915
|
+
const words = fieldKindWords(def.control);
|
|
14916
|
+
return { ...def, label: words.label, ...(words.optionsText ? { optionsText: words.optionsText } : {}) };
|
|
14917
|
+
}
|
|
14918
|
+
/**
|
|
14919
|
+
* One pre-set Field. Null when the registry lacks the type — never a half-built node. `lang` is the SITE's language
|
|
14920
|
+
* (iox-ui#159): the label and starter choices are forms-core's words in it; absent or unknown, the row's own (English).
|
|
14921
|
+
*/
|
|
14922
|
+
function buildFieldKindPreset(def, createConfig, lang) {
|
|
14913
14923
|
const field = createConfig('Field');
|
|
14914
14924
|
if (!field)
|
|
14915
14925
|
return null;
|
|
14916
|
-
|
|
14926
|
+
const words = (lang ? fieldKindWords(def.control, lang) : undefined) ?? def;
|
|
14927
|
+
setTrait(field, 'label', words.label);
|
|
14917
14928
|
setTrait(field, 'control', def.control);
|
|
14918
|
-
if (
|
|
14919
|
-
setTrait(field, 'optionsText',
|
|
14929
|
+
if (words.optionsText)
|
|
14930
|
+
setTrait(field, 'optionsText', words.optionsText);
|
|
14920
14931
|
if (def.multiple)
|
|
14921
14932
|
setTrait(field, 'multiple', true);
|
|
14922
14933
|
return field;
|
|
14923
14934
|
}
|
|
14935
|
+
/** What a channel says: the author's words, else the kind's own in the SITE's language (forms-core `channelWords`). */
|
|
14936
|
+
function channelLabel(channel, lang) {
|
|
14937
|
+
return channel.label?.trim() || channelWords(channel.kind, lang);
|
|
14938
|
+
}
|
|
14924
14939
|
/** The element style a second channel wears: the quieter button beside Send. */
|
|
14925
14940
|
const CHANNEL_STYLE = 'button-secondary';
|
|
14926
14941
|
const BUTTON_LABEL_STYLE$1 = 'button-label';
|
|
@@ -14929,9 +14944,9 @@ const BUTTON_LABEL_STYLE$1 = 'button-label';
|
|
|
14929
14944
|
* `button-label`, the role `form.channel`. Its address is the OWNER's — built from what they typed by forms-core
|
|
14930
14945
|
* `channelHref`, '' when they typed nothing (the Publishable gate then blocks publishing: never a made-up number).
|
|
14931
14946
|
*/
|
|
14932
|
-
function buildFormChannel(channel, input, createConfig) {
|
|
14947
|
+
function buildFormChannel(channel, input, createConfig, lang) {
|
|
14933
14948
|
const button = createConfig('ButtonBlock');
|
|
14934
|
-
const words = textNode(channel
|
|
14949
|
+
const words = textNode(channelLabel(channel, lang), createConfig);
|
|
14935
14950
|
if (!button || !words)
|
|
14936
14951
|
return null;
|
|
14937
14952
|
button.role = FORM_CHANNEL_ROLE;
|
|
@@ -14954,9 +14969,9 @@ function setChannelAddress(button, kind, input) {
|
|
|
14954
14969
|
* The form's actions row (role `form.actions`): Send, then the channel, side by side, wrapping on a narrow screen. A
|
|
14955
14970
|
* FieldGroup — the form's own layout row — so the shared form CSS keeps it on screen after a success.
|
|
14956
14971
|
*/
|
|
14957
|
-
function buildFormActionsRow(submit, channel, input, createConfig) {
|
|
14972
|
+
function buildFormActionsRow(submit, channel, input, createConfig, lang) {
|
|
14958
14973
|
const row = createConfig('FieldGroup');
|
|
14959
|
-
const link = buildFormChannel(channel, input, createConfig);
|
|
14974
|
+
const link = buildFormChannel(channel, input, createConfig, lang);
|
|
14960
14975
|
if (!row || !link)
|
|
14961
14976
|
return null;
|
|
14962
14977
|
row.role = FORM_ACTIONS_ROLE;
|
|
@@ -14986,8 +15001,9 @@ function formChannelOf(form) {
|
|
|
14986
15001
|
* "Add a second way to reach you" on an existing form (premium N2): the channel goes beside the form's FIRST submit
|
|
14987
15002
|
* button — the submit moves into a new actions row in its place, or the channel joins the row it is already in. Null
|
|
14988
15003
|
* when the form already has one or has no submit button. Mutates the form's tree; the caller records the undo step.
|
|
15004
|
+
* Words the author left empty are the kind's own in `lang`, the SITE's language (iox-ui#159).
|
|
14989
15005
|
*/
|
|
14990
|
-
function addFormChannel(form, channel, input, createConfig) {
|
|
15006
|
+
function addFormChannel(form, channel, input, createConfig, lang) {
|
|
14991
15007
|
if (formChannelOf(form))
|
|
14992
15008
|
return null;
|
|
14993
15009
|
const found = findWithParent(form, n => n.type === SUBMIT_BUTTON_NODE_TYPE);
|
|
@@ -14996,13 +15012,13 @@ function addFormChannel(form, channel, input, createConfig) {
|
|
|
14996
15012
|
const { node: submit, parent } = found;
|
|
14997
15013
|
const siblings = parent.children;
|
|
14998
15014
|
if (parent.role === FORM_ACTIONS_ROLE) {
|
|
14999
|
-
const link = buildFormChannel(channel, input, createConfig);
|
|
15015
|
+
const link = buildFormChannel(channel, input, createConfig, lang);
|
|
15000
15016
|
if (!link)
|
|
15001
15017
|
return null;
|
|
15002
15018
|
siblings.splice(siblings.indexOf(submit) + 1, 0, link);
|
|
15003
15019
|
return link;
|
|
15004
15020
|
}
|
|
15005
|
-
const row = buildFormActionsRow(submit, channel, input, createConfig);
|
|
15021
|
+
const row = buildFormActionsRow(submit, channel, input, createConfig, lang);
|
|
15006
15022
|
if (!row)
|
|
15007
15023
|
return null;
|
|
15008
15024
|
siblings.splice(siblings.indexOf(submit), 1, row);
|
|
@@ -15020,6 +15036,33 @@ function findWithParent(root, match) {
|
|
|
15020
15036
|
}
|
|
15021
15037
|
return null;
|
|
15022
15038
|
}
|
|
15039
|
+
/** The registry types whose fresh node carries baseline words `wearFormWords` puts in the site's language — the palette
|
|
15040
|
+
* inserts these as built nodes, never as a bare type name the builder would create in English. */
|
|
15041
|
+
const FORM_WORD_TYPES = new Set([FORM_NODE_TYPE, FIELD_NODE_TYPE, SUBMIT_BUTTON_NODE_TYPE]);
|
|
15042
|
+
/**
|
|
15043
|
+
* A freshly created Form, Field or submit button in the SITE's language (iox-ui#159): every word it still holds from its
|
|
15044
|
+
* config's English baseline — a Field's 'Label' / 'Name' / 'Email', the button's 'Send' and 'Sending…' — becomes
|
|
15045
|
+
* forms-core's word in `lang`; words anyone wrote stay. Walks the whole tree (the Form's own Name/Email/Send). Mutates
|
|
15046
|
+
* and returns `node`; English or no language leaves it as it is.
|
|
15047
|
+
*/
|
|
15048
|
+
function wearFormWords(node, lang) {
|
|
15049
|
+
if (!node || !lang)
|
|
15050
|
+
return node;
|
|
15051
|
+
if (node.type === FIELD_NODE_TYPE) {
|
|
15052
|
+
setTrait(node, 'label', formWordIn(traitOf(node, 'label'), lang, ['field', 'name', 'email']));
|
|
15053
|
+
}
|
|
15054
|
+
else if (node.type === SUBMIT_BUTTON_NODE_TYPE) {
|
|
15055
|
+
setTrait(node, 'label', formWordIn(traitOf(node, 'label'), lang, ['send']));
|
|
15056
|
+
if (traitOf(node, 'loadingLabel') === DEFAULT_BUSY_WORDS)
|
|
15057
|
+
setTrait(node, 'loadingLabel', busyWord(lang));
|
|
15058
|
+
}
|
|
15059
|
+
for (const child of node.children ?? [])
|
|
15060
|
+
wearFormWords(child, lang);
|
|
15061
|
+
return node;
|
|
15062
|
+
}
|
|
15063
|
+
function traitOf(node, name) {
|
|
15064
|
+
return node.traits?.find(t => t?.name === name)?.default;
|
|
15065
|
+
}
|
|
15023
15066
|
function setStyle(node, prop, value) {
|
|
15024
15067
|
for (const group of (node.styleTraits ?? [])) {
|
|
15025
15068
|
const trait = group?.traits?.find((t) => t?.name === prop);
|
|
@@ -15868,8 +15911,9 @@ class FormComponentConfig extends ComponentConfig {
|
|
|
15868
15911
|
];
|
|
15869
15912
|
this.styleTraits = shellStyles();
|
|
15870
15913
|
this.children = [
|
|
15871
|
-
|
|
15872
|
-
makeField({ label:
|
|
15914
|
+
// The words are forms-core's English baseline (iox-ui#159) — `wearFormWords` puts them in the site's language.
|
|
15915
|
+
makeField({ label: baselineFormWords().name, control: 'text', required: true }),
|
|
15916
|
+
makeField({ label: baselineFormWords().email, control: 'email', required: true }),
|
|
15873
15917
|
new SubmitButtonComponentConfig(),
|
|
15874
15918
|
new FormSuccessComponentConfig(),
|
|
15875
15919
|
new FormErrorComponentConfig(),
|
|
@@ -15894,7 +15938,7 @@ class FieldComponentConfig extends ComponentConfig {
|
|
|
15894
15938
|
this.parts = FIELD_PARTS;
|
|
15895
15939
|
this.traits = [
|
|
15896
15940
|
new TraitConfig('__contentLabel', 'Content', TraitInputType.SectionLabel),
|
|
15897
|
-
new TraitConfig('label', 'Label', TraitInputType.Text, undefined,
|
|
15941
|
+
new TraitConfig('label', 'Label', TraitInputType.Text, undefined, baselineFormWords().field),
|
|
15898
15942
|
// Choosing the control also chooses the validation — an Email field validates email
|
|
15899
15943
|
// with nothing configured.
|
|
15900
15944
|
new TraitConfig('control', 'Kind of answer', TraitInputType.Select, [
|
|
@@ -15977,8 +16021,8 @@ class SubmitButtonComponentConfig extends ComponentConfig {
|
|
|
15977
16021
|
constructor() {
|
|
15978
16022
|
super('SubmitButton', 'iox-submit', 'ph-thin ph-paper-plane-tilt', 'Forms');
|
|
15979
16023
|
this.traits = [
|
|
15980
|
-
new TraitConfig('label', 'Label', TraitInputType.Text, undefined,
|
|
15981
|
-
new TraitConfig('loadingLabel', 'While sending', TraitInputType.Text, undefined,
|
|
16024
|
+
new TraitConfig('label', 'Label', TraitInputType.Text, undefined, baselineFormWords().send),
|
|
16025
|
+
new TraitConfig('loadingLabel', 'While sending', TraitInputType.Text, undefined, DEFAULT_BUSY_WORDS),
|
|
15982
16026
|
// Premium N2: what it says once the form has sent, beside a check drawn once. Empty: "Sent".
|
|
15983
16027
|
new TraitConfig(SENT_LABEL_TRAIT, 'Once sent', TraitInputType.Text, undefined, ''),
|
|
15984
16028
|
new TraitConfig('disableWhileSubmitting', 'Disable while sending', TraitInputType.Checkbox, undefined, true),
|
|
@@ -16494,5 +16538,5 @@ class BuilderSpacerComponentConfig extends ComponentConfig {
|
|
|
16494
16538
|
* Generated bundle index. Do not edit.
|
|
16495
16539
|
*/
|
|
16496
16540
|
|
|
16497
|
-
export { ACTION_TYPE_OPTIONS, AuditCode, AuditPanelComponent, AuditSeverity, BODY_CRUMB_LABEL, BOUND_ICON, BREAKPOINT_PRESENTATION, BUILDER_CANVAS_CONTAINER, BUILDER_CHROME_EN, BUILDER_FONT_LINK_ATTR, BUILDER_TOKEN_SCOPE_CLASS, BackgroundGroupStyleConfig, BorderGroupStyleConfig, BreadcrumbBarComponent, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderClipboardService, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDataSourceService, BuilderDialogComponent, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderHistoryService, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderListComponentConfig, BuilderListItemComponentConfig, BuilderMode, BuilderPopoverComponent, BuilderRepeaterComponent, BuilderSpacerComponentConfig, BusinessSpecimenView, ButtonBlockComponentConfig, CANVAS_EMPTY_IMAGE_LABEL_EN, CANVAS_EMPTY_IMAGE_LABEL_KEY, CANVAS_ROOT_RESET_CSS, CANVAS_TOKEN_SCOPE, COMPOSITE_PRESETS, CanvasDesignStateService, CanvasShowGroup, CanvasShowState, CardComponentConfig, ChildLayoutGroupStyleConfig, ComponentConfig, ComponentRegistryService, CompositeCanvasService, CompositePaletteGroup, CompositePresetId, DEFAULT_ESSENTIAL_TRAITS, DESCRIPTOR_MAX_LENGTH, DRAG_HANDLE_ATTR, DROP_REFUSED_CLASS, DataSourceRegistryService, DataSourceType, DialogComponentConfig, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS, EDITOR_CHROME_ATTRIBUTE, ESSENTIAL_TRAITS_BY_TYPE, EffectsGroupStyleConfig, FIELD_KIND_PRESETS, FIELD_PARTS, FOOTER_MIX_TRAIT, FORM_STATE_BLOCK_TYPES, FORM_TYPE, FieldComponentConfig, FieldGroupComponentConfig, FieldTrait, FormComponentConfig, FormErrorComponentConfig, FormStateService, FormSuccessComponentConfig, GLOBALS_AFTER_CLASS, GalleryConfig, GlobalCanvasLayer, GroupStyleConfig, HIDDEN_AT_REST_LABEL_KEY, HIDDEN_AT_REST_ROLES, HIDDEN_AT_REST_TYPES, INSERT_REFUSAL_LABEL_KEYS, INTERACTION_STATES, INVERSE_ACTION, IOX_BUILDER_CANVAS, IOX_BUILDER_LABELS, IOX_CONTENT_TYPE_LABELS, IOX_DATA_SOURCE_ENDPOINTS, IOX_RENDER_DISPLAY_ONLY, InsertRefusal, InteractionEngineService, InteractionPresetRegistryService, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LAYOUT_PRESETS, LIST_MIX_TRAIT, LayerTreeComponent, LayoutGroupStyleConfig, ListGroupStyleConfig, NodeAction, OPENING_MIX_TRAIT, OverlayComponent, OverlayService, PAGE_TRANSITION_EASING_OPTIONS, PALETTE_PRESET_DEFS, POPOVER_PLACEMENT_OPTIONS, POPOVER_SHEET_MAX_WIDTH, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PhoneMenuOpenerAction, PopoverComponentConfig, PositionGroupStyleConfig, PresetRegistryService, RELATIONAL_STATES, RELATIONAL_STATE_BASE, REPEATER_SOURCE_PROP, REPEATER_TYPE, REVEALED_WHILE_SELECTED_ROLES, ROOT_ESCAPE_PX, ROUTE_ANIMATION_OPTIONS, RenderDirective, RepeaterComponentConfig, RootZone, SCREEN_WIDTH_OPTIONS, SENT_LABEL_TRAIT, SILENT_REFUSALS, SLIDER_CREATIVE_PRESET_TRAIT, STRUCTURAL_STATES, SUPPORTED_STATES, SceneCanvasService, SectionComponent, SectionComponentConfig, SelectionReveal, SizeGroupStyleConfig, SliderContainerComponent, SliderContainerConfig, SliderSlideComponent, SliderSlideConfig, SpacingGroupStyleConfig, StructureFix, StyleCategory, StyleRegistryService, TraitConfig as StyleTraitConfig, SubmitButtonComponentConfig, SymbolRegistryService, TARGETED_STATES, TARGETED_STATE_BASE, TOGGLE_PART_ROLES, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, TypographyGroupStyleConfig, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, VALIDATION_STATES, VALIDATION_STATE_CLASS, VideoConfig, ViewportService, ZOOM_OPTIONS, addFormChannel, arrayItemSchemaFields, arraySchemaFields, auditNodes, bindingLabel, bindingLabels, buildBusinessSpecimen, buildCompositePreset, buildConsentPreset, buildElementStyleSpecimen, buildFieldKindPreset, buildFlavorSpecimen, buildFormActionsRow, buildFormChannel, buildFormPreset, buildFullStyleTraits, buildLayoutPreset, buildPalettePreset, buildPresetStyleTraits, builderCompositeFactory, canFluidise, canvasEmptyImageLabel, canvasFloatingContainer, canvasHostDisplay, collapseColumnsProps, columnCountOf, compositeStructureFindings, defaultBuilderLabels, defaultPageSettings, deleteTabPair, displayTrigger, displayTriggerOf, dropChildren, dropSectionStamps, dropTargetLabel, duplicateTabPair, escapesRoot, essentialTraitsFor, findNodeByIdInEither, findNodeLocation, findParentOf, flattenLayerTree, flattenSchemaFields, fluidiseProps, followsScroll, formChannelOf, generateNodeId, globalCanvasLayer, hiddenAtBase, hiddenUntilItemOn, inPhoneMenuContext, insertRefusal, insertRefusalLabel, interactionTargets, isDisplayOnlyNode, isHiddenAt, isHiddenAtRest, isPhoneMenuOpener, isPinnedGlobal, isReadingBar, isSpecimen, itemsOnAtRest, markSpecimen, matchesControlSearch, nearestFormNode, neverShown, nodeAncestorPath, nodeAncestorPathInEither, nodeDescriptor, nodeStyleMap, overlayGlobals, pathToNode, phoneMenuOf, phoneMenuShowsAt, refreshSubtree, regenerateNodeIds, removalRefusal, reorderProps, repeaterSourceAlias, repeaterSubLabel, resolveInsertTarget, resolveTraitControllerType, resolveTraitOptions, retypeNode, rootEscapeBand, rootZone, selectionRevealOf, setChannelAddress, setOverlayPreview, setStyleTrait, setTrait, shortDescriptor, showCanvasToast, shownBeforeControl, sourceContentType, sourceTypeLabel, stackChildrenProps, summarise, syncEmptyImagePlaceholder, syncNodeDesign, syncNodeInputs, tabPairLabel, tabsRootForPart, textNode, upsertNodeStyles, visibilityProps, walkNodes, wrapNode };
|
|
16541
|
+
export { ACTION_TYPE_OPTIONS, AuditCode, AuditPanelComponent, AuditSeverity, BODY_CRUMB_LABEL, BOUND_ICON, BREAKPOINT_PRESENTATION, BUILDER_CANVAS_CONTAINER, BUILDER_CHROME_EN, BUILDER_FONT_LINK_ATTR, BUILDER_TOKEN_SCOPE_CLASS, BackgroundGroupStyleConfig, BorderGroupStyleConfig, BreadcrumbBarComponent, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderClipboardService, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDataSourceService, BuilderDialogComponent, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderHistoryService, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderListComponentConfig, BuilderListItemComponentConfig, BuilderMode, BuilderPopoverComponent, BuilderRepeaterComponent, BuilderSpacerComponentConfig, BusinessSpecimenView, ButtonBlockComponentConfig, CANVAS_EMPTY_IMAGE_LABEL_EN, CANVAS_EMPTY_IMAGE_LABEL_KEY, CANVAS_ROOT_RESET_CSS, CANVAS_TOKEN_SCOPE, COMPOSITE_PRESETS, CanvasDesignStateService, CanvasShowGroup, CanvasShowState, CardComponentConfig, ChildLayoutGroupStyleConfig, ComponentConfig, ComponentRegistryService, CompositeCanvasService, CompositePaletteGroup, CompositePresetId, DEFAULT_ESSENTIAL_TRAITS, DESCRIPTOR_MAX_LENGTH, DRAG_HANDLE_ATTR, DROP_REFUSED_CLASS, DataSourceRegistryService, DataSourceType, DialogComponentConfig, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS, EDITOR_CHROME_ATTRIBUTE, ESSENTIAL_TRAITS_BY_TYPE, EffectsGroupStyleConfig, FIELD_KIND_PRESETS, FIELD_PARTS, FOOTER_MIX_TRAIT, FORM_STATE_BLOCK_TYPES, FORM_TYPE, FORM_WORD_TYPES, FieldComponentConfig, FieldGroupComponentConfig, FieldTrait, FormComponentConfig, FormErrorComponentConfig, FormStateService, FormSuccessComponentConfig, GLOBALS_AFTER_CLASS, GalleryConfig, GlobalCanvasLayer, GroupStyleConfig, HIDDEN_AT_REST_LABEL_KEY, HIDDEN_AT_REST_ROLES, HIDDEN_AT_REST_TYPES, INSERT_REFUSAL_LABEL_KEYS, INTERACTION_STATES, INVERSE_ACTION, IOX_BUILDER_CANVAS, IOX_BUILDER_LABELS, IOX_CONTENT_TYPE_LABELS, IOX_DATA_SOURCE_ENDPOINTS, IOX_RENDER_DISPLAY_ONLY, InsertRefusal, InteractionEngineService, InteractionPresetRegistryService, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LAYOUT_PRESETS, LIST_MIX_TRAIT, LayerTreeComponent, LayoutGroupStyleConfig, ListGroupStyleConfig, NodeAction, OPENING_MIX_TRAIT, OverlayComponent, OverlayService, PAGE_TRANSITION_EASING_OPTIONS, PALETTE_PRESET_DEFS, POPOVER_PLACEMENT_OPTIONS, POPOVER_SHEET_MAX_WIDTH, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PhoneMenuOpenerAction, PopoverComponentConfig, PositionGroupStyleConfig, PresetRegistryService, RELATIONAL_STATES, RELATIONAL_STATE_BASE, REPEATER_SOURCE_PROP, REPEATER_TYPE, REVEALED_WHILE_SELECTED_ROLES, ROOT_ESCAPE_PX, ROUTE_ANIMATION_OPTIONS, RenderDirective, RepeaterComponentConfig, RootZone, SCREEN_WIDTH_OPTIONS, SENT_LABEL_TRAIT, SILENT_REFUSALS, SLIDER_CREATIVE_PRESET_TRAIT, STRUCTURAL_STATES, SUPPORTED_STATES, SceneCanvasService, SectionComponent, SectionComponentConfig, SelectionReveal, SizeGroupStyleConfig, SliderContainerComponent, SliderContainerConfig, SliderSlideComponent, SliderSlideConfig, SpacingGroupStyleConfig, StructureFix, StyleCategory, StyleRegistryService, TraitConfig as StyleTraitConfig, SubmitButtonComponentConfig, SymbolRegistryService, TARGETED_STATES, TARGETED_STATE_BASE, TOGGLE_PART_ROLES, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, TypographyGroupStyleConfig, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, VALIDATION_STATES, VALIDATION_STATE_CLASS, VideoConfig, ViewportService, ZOOM_OPTIONS, addFormChannel, arrayItemSchemaFields, arraySchemaFields, auditNodes, bindingLabel, bindingLabels, buildBusinessSpecimen, buildCompositePreset, buildConsentPreset, buildElementStyleSpecimen, buildFieldKindPreset, buildFlavorSpecimen, buildFormActionsRow, buildFormChannel, buildFormPreset, buildFullStyleTraits, buildLayoutPreset, buildPalettePreset, buildPresetStyleTraits, builderCompositeFactory, canFluidise, canvasEmptyImageLabel, canvasFloatingContainer, canvasHostDisplay, channelLabel, collapseColumnsProps, columnCountOf, compositeStructureFindings, defaultBuilderLabels, defaultPageSettings, deleteTabPair, displayTrigger, displayTriggerOf, dropChildren, dropSectionStamps, dropTargetLabel, duplicateTabPair, escapesRoot, essentialTraitsFor, findNodeByIdInEither, findNodeLocation, findParentOf, flattenLayerTree, flattenSchemaFields, fluidiseProps, followsScroll, formChannelOf, generateNodeId, globalCanvasLayer, hiddenAtBase, hiddenUntilItemOn, inPhoneMenuContext, insertRefusal, insertRefusalLabel, interactionTargets, isDisplayOnlyNode, isHiddenAt, isHiddenAtRest, isPhoneMenuOpener, isPinnedGlobal, isReadingBar, isSpecimen, itemsOnAtRest, markSpecimen, matchesControlSearch, nearestFormNode, neverShown, nodeAncestorPath, nodeAncestorPathInEither, nodeDescriptor, nodeStyleMap, overlayGlobals, pathToNode, phoneMenuOf, phoneMenuShowsAt, refreshSubtree, regenerateNodeIds, removalRefusal, reorderProps, repeaterSourceAlias, repeaterSubLabel, resolveDragData, resolveInsertTarget, resolveTraitControllerType, resolveTraitOptions, retypeNode, rootEscapeBand, rootZone, selectionRevealOf, setChannelAddress, setOverlayPreview, setStyleTrait, setTrait, shortDescriptor, showCanvasToast, shownBeforeControl, sourceContentType, sourceTypeLabel, stackChildrenProps, summarise, syncEmptyImagePlaceholder, syncNodeDesign, syncNodeInputs, tabPairLabel, tabsRootForPart, textNode, upsertNodeStyles, visibilityProps, walkNodes, wearFormWords, wrapNode };
|
|
16498
16542
|
//# sourceMappingURL=vectoriox-iox-builder.mjs.map
|