@vectoriox/iox-ui 5.7.0 → 5.9.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.
@@ -11,6 +11,10 @@ declare enum ControlType {
11
11
  Textarea = "textarea",
12
12
  Select = "select",
13
13
  Checkbox = "checkbox",
14
+ /** A checkbox in switch clothing (role="switch") — consent toggles, settings-style forms. */
15
+ Switch = "switch",
16
+ /** A slider over a numeric range — min/max/step ride the field. */
17
+ Range = "range",
14
18
  Radio = "radio",
15
19
  Date = "date",
16
20
  Time = "time",
package/index.d.ts CHANGED
@@ -809,6 +809,10 @@ declare enum ControlType {
809
809
  Textarea = "textarea",
810
810
  Select = "select",
811
811
  Checkbox = "checkbox",
812
+ /** A checkbox in switch clothing (role="switch") — consent toggles, settings-style forms. */
813
+ Switch = "switch",
814
+ /** A slider over a numeric range — min/max/step ride the field. */
815
+ Range = "range",
812
816
  Radio = "radio",
813
817
  Date = "date",
814
818
  Time = "time",
@@ -1148,6 +1152,9 @@ declare class IoxFieldComponent implements OnInit, OnDestroy {
1148
1152
  labelHidden: boolean;
1149
1153
  requiredMark: string;
1150
1154
  rows: number;
1155
+ rangeMin: number | string;
1156
+ rangeMax: number | string;
1157
+ rangeStep: number | string;
1151
1158
  accept: string;
1152
1159
  options: FieldOption[];
1153
1160
  value: any;
@@ -1192,7 +1199,7 @@ declare class IoxFieldComponent implements OnInit, OnDestroy {
1192
1199
  emit(value: any): void;
1193
1200
  touch(): void;
1194
1201
  static ɵfac: i0.ɵɵFactoryDeclaration<IoxFieldComponent, [{ optional: true; }, null]>;
1195
- static ɵcmp: i0.ɵɵComponentDeclaration<IoxFieldComponent, "div[iox-field]", never, { "nodeId": { "alias": "nodeId"; "required": false; }; "name": { "alias": "name"; "required": false; }; "label": { "alias": "label"; "required": false; }; "control": { "alias": "control"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "help": { "alias": "help"; "required": false; }; "required": { "alias": "required"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "labelHidden": { "alias": "labelHidden"; "required": false; }; "requiredMark": { "alias": "requiredMark"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "accept": { "alias": "accept"; "required": false; }; "options": { "alias": "options"; "required": false; }; "value": { "alias": "value"; "required": false; }; "rules": { "alias": "rules"; "required": false; }; "forceInvalid": { "alias": "forceInvalid"; "required": false; }; "designErrorText": { "alias": "designErrorText"; "required": false; }; "showValid": { "alias": "showValid"; "required": false; }; }, { "valueChange": "valueChange"; "touched": "touched"; }, never, never, false, never>;
1202
+ static ɵcmp: i0.ɵɵComponentDeclaration<IoxFieldComponent, "div[iox-field]", never, { "nodeId": { "alias": "nodeId"; "required": false; }; "name": { "alias": "name"; "required": false; }; "label": { "alias": "label"; "required": false; }; "control": { "alias": "control"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "help": { "alias": "help"; "required": false; }; "required": { "alias": "required"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "labelHidden": { "alias": "labelHidden"; "required": false; }; "requiredMark": { "alias": "requiredMark"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "rangeMin": { "alias": "rangeMin"; "required": false; }; "rangeMax": { "alias": "rangeMax"; "required": false; }; "rangeStep": { "alias": "rangeStep"; "required": false; }; "accept": { "alias": "accept"; "required": false; }; "options": { "alias": "options"; "required": false; }; "value": { "alias": "value"; "required": false; }; "rules": { "alias": "rules"; "required": false; }; "forceInvalid": { "alias": "forceInvalid"; "required": false; }; "designErrorText": { "alias": "designErrorText"; "required": false; }; "showValid": { "alias": "showValid"; "required": false; }; }, { "valueChange": "valueChange"; "touched": "touched"; }, never, never, false, never>;
1196
1203
  }
1197
1204
 
1198
1205
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectoriox/iox-ui",
3
- "version": "5.7.0",
3
+ "version": "5.9.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=20.0.0",
6
6
  "@angular/core": ">=20.0.0",
@@ -75,6 +75,26 @@ export const ELEMENT_ACTION_DESCRIPTORS: readonly ActionDescriptor[] = Object.fr
75
75
  { type: 'openConsentPreferences', labelKey: 'builder.actions.openConsentPreferences', kind: 'instant', group: 'consent', builderBehaviour: 'run',
76
76
  target: { required: true, types: ['Dialog'] } },
77
77
 
78
+ // ── Server actions (A2 — Tier B): the canvas SIMULATES, the LIVE site POSTs the node's
79
+ // identity to ONE public route and the server re-derives the spec from the SAVED page.
80
+ // The author's saved params are the whole spec — a visitor contributes only the click.
81
+ { type: 'sendEmail', labelKey: 'builder.actions.sendEmail', kind: 'server', group: 'service', builderBehaviour: 'simulate',
82
+ connector: 'mailer',
83
+ params: [
84
+ { name: 'to', type: 'string', label: 'To' },
85
+ { name: 'subject', type: 'string', label: 'Subject' },
86
+ { name: 'message', type: 'string', label: 'Message' },
87
+ ] },
88
+ { type: 'callWebhook', labelKey: 'builder.actions.callWebhook', kind: 'server', group: 'service', builderBehaviour: 'simulate',
89
+ params: [
90
+ { name: 'url', type: 'string', label: 'URL' }, // non-secret config (K2); the server SSRF-guards it
91
+ ] },
92
+ { type: 'createItem', labelKey: 'builder.actions.createItem', kind: 'server', group: 'data', builderBehaviour: 'simulate',
93
+ params: [
94
+ { name: 'contentType', type: 'string', label: 'Content type' },
95
+ { name: 'values', type: 'string', label: 'Field values (JSON)' },
96
+ ] },
97
+
78
98
  // ── Services (D-A5: visible, greyed, with the reason — never hidden, never live) ──
79
99
  { type: 'signIn', labelKey: 'builder.actions.signIn', kind: 'server', group: 'service', builderBehaviour: 'inert',
80
100
  planned: true, entitlement: 'visitorIdentity' },
@@ -82,6 +102,11 @@ export const ELEMENT_ACTION_DESCRIPTORS: readonly ActionDescriptor[] = Object.fr
82
102
  planned: true, connector: 'payment', entitlement: 'commerce' },
83
103
  ]);
84
104
 
105
+ /** The A2 server executors' dispatch set — the live engine POSTs these to the public actions
106
+ * route; the canvas simulates them (a server action never runs from the ADMIN's browser). */
107
+ export const SERVER_ELEMENT_ACTION_TYPES: ReadonlySet<string> =
108
+ new Set(['sendEmail', 'callWebhook', 'createItem']);
109
+
85
110
  /** The Tier-A behaviour executors' dispatch set (A1c) — the engines branch on it beside
86
111
  * DIALOG/SWIPER. Dialog actions have their own set; context/visibility stay in the legacy path. */
87
112
  export const BEHAVIOUR_ACTION_TYPES: ReadonlySet<string> =
@@ -16,6 +16,10 @@ export enum ControlType {
16
16
  Textarea = 'textarea',
17
17
  Select = 'select',
18
18
  Checkbox = 'checkbox',
19
+ /** A checkbox in switch clothing (role="switch") — consent toggles, settings-style forms. */
20
+ Switch = 'switch',
21
+ /** A slider over a numeric range — min/max/step ride the field. */
22
+ Range = 'range',
19
23
  Radio = 'radio',
20
24
  Date = 'date',
21
25
  Time = 'time',
@@ -40,7 +40,7 @@ const TEXTUAL: readonly ControlType[] = [
40
40
  ];
41
41
 
42
42
  /** Controls with a comparable magnitude. */
43
- const NUMERIC: readonly ControlType[] = [ControlType.Number, ControlType.Date, ControlType.Time];
43
+ const NUMERIC: readonly ControlType[] = [ControlType.Number, ControlType.Date, ControlType.Time, ControlType.Range];
44
44
 
45
45
  export const RULE_DESCRIPTORS: readonly RuleDescriptor[] = Object.freeze([
46
46
  {
@@ -73,7 +73,7 @@ export const RULE_DESCRIPTORS: readonly RuleDescriptor[] = Object.freeze([
73
73
  // A checkbox's `required` already becomes `accepted`, so offering it again would be a
74
74
  // duplicate — it is here for a checkbox the author wants ticked WITHOUT marking it required.
75
75
  name: RuleName.Accepted, labelKey: 'forms.rules.accepted',
76
- param: RuleParamKind.None, controls: [ControlType.Checkbox],
76
+ param: RuleParamKind.None, controls: [ControlType.Checkbox, ControlType.Switch],
77
77
  },
78
78
  ]);
79
79
 
@@ -54,3 +54,43 @@
54
54
  position: absolute; width: 1px; height: 1px; margin: -1px;
55
55
  padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
56
56
  }
57
+
58
+ /* ── switch (control='switch') — a checkbox in switch clothing; brand-aware via tokens ── */
59
+ .iox-field__control--switch {
60
+ appearance: none;
61
+ -webkit-appearance: none;
62
+ width: 38px;
63
+ height: 22px;
64
+ border-radius: 999px;
65
+ background: var(--iox-line, #d8d4d1);
66
+ position: relative;
67
+ cursor: pointer;
68
+ transition: background 150ms ease-out;
69
+ flex-shrink: 0;
70
+ }
71
+ .iox-field__control--switch::before {
72
+ content: '';
73
+ position: absolute;
74
+ top: 3px;
75
+ inset-inline-start: 3px;
76
+ width: 16px;
77
+ height: 16px;
78
+ border-radius: 999px;
79
+ background: #ffffff;
80
+ transition: transform 150ms ease-out;
81
+ }
82
+ .iox-field__control--switch:checked {
83
+ background: var(--iox-brand-500, #1f1d1b);
84
+ }
85
+ .iox-field__control--switch:checked::before {
86
+ transform: translateX(16px);
87
+ }
88
+ [dir='rtl'] .iox-field__control--switch:checked::before {
89
+ transform: translateX(-16px);
90
+ }
91
+
92
+ /* ── range (control='range') ── */
93
+ .iox-field__control--range {
94
+ width: 100%;
95
+ accent-color: var(--iox-brand-500, #1f1d1b);
96
+ }