@vectoriox/iox-ui 5.7.0 → 5.8.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/fesm2022/vectoriox-iox-ui-forms-core.mjs +6 -2
- package/fesm2022/vectoriox-iox-ui-forms-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +70 -3
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/forms-core/index.d.ts +4 -0
- package/index.d.ts +8 -1
- package/package.json +1 -1
- package/src/forms-core/form.model.ts +4 -0
- package/src/forms-core/rule-catalog.ts +2 -2
- package/styles/iox-forms.css +40 -0
package/forms-core/index.d.ts
CHANGED
|
@@ -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
|
@@ -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
|
|
package/styles/iox-forms.css
CHANGED
|
@@ -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
|
+
}
|