@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.
@@ -2871,6 +2871,10 @@ var ControlType;
2871
2871
  ControlType["Textarea"] = "textarea";
2872
2872
  ControlType["Select"] = "select";
2873
2873
  ControlType["Checkbox"] = "checkbox";
2874
+ /** A checkbox in switch clothing (role="switch") — consent toggles, settings-style forms. */
2875
+ ControlType["Switch"] = "switch";
2876
+ /** A slider over a numeric range — min/max/step ride the field. */
2877
+ ControlType["Range"] = "range";
2874
2878
  ControlType["Radio"] = "radio";
2875
2879
  ControlType["Date"] = "date";
2876
2880
  ControlType["Time"] = "time";
@@ -3425,7 +3429,7 @@ const TEXTUAL = [
3425
3429
  ControlType.Password, ControlType.Textarea,
3426
3430
  ];
3427
3431
  /** Controls with a comparable magnitude. */
3428
- const NUMERIC = [ControlType.Number, ControlType.Date, ControlType.Time];
3432
+ const NUMERIC = [ControlType.Number, ControlType.Date, ControlType.Time, ControlType.Range];
3429
3433
  const RULE_DESCRIPTORS = Object.freeze([
3430
3434
  {
3431
3435
  name: RuleName.MinLength, labelKey: 'forms.rules.minLength',
@@ -3457,7 +3461,7 @@ const RULE_DESCRIPTORS = Object.freeze([
3457
3461
  // A checkbox's `required` already becomes `accepted`, so offering it again would be a
3458
3462
  // duplicate — it is here for a checkbox the author wants ticked WITHOUT marking it required.
3459
3463
  name: RuleName.Accepted, labelKey: 'forms.rules.accepted',
3460
- param: RuleParamKind.None, controls: [ControlType.Checkbox],
3464
+ param: RuleParamKind.None, controls: [ControlType.Checkbox, ControlType.Switch],
3461
3465
  },
3462
3466
  ]);
3463
3467
  /** The rules that can be added to a field of this control type. */
@@ -3986,6 +3990,9 @@ class IoxFieldComponent {
3986
3990
  this.labelHidden = false;
3987
3991
  this.requiredMark = '*';
3988
3992
  this.rows = 4;
3993
+ this.rangeMin = 0;
3994
+ this.rangeMax = 100;
3995
+ this.rangeStep = 1;
3989
3996
  this.accept = '';
3990
3997
  this.options = [];
3991
3998
  this.value = '';
@@ -4071,7 +4078,7 @@ class IoxFieldComponent {
4071
4078
  this.touched.emit();
4072
4079
  }
4073
4080
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.31", ngImport: i0, type: IoxFieldComponent, deps: [{ token: FormRuntimeService, optional: true }, { token: IOX_FORM_MESSAGES }], target: i0.ɵɵFactoryTarget.Component }); }
4074
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.31", type: IoxFieldComponent, isStandalone: false, selector: "div[iox-field]", inputs: { nodeId: "nodeId", name: "name", label: "label", control: "control", placeholder: "placeholder", help: "help", required: "required", disabled: "disabled", labelHidden: "labelHidden", requiredMark: "requiredMark", rows: "rows", accept: "accept", options: "options", value: "value", rules: "rules", forceInvalid: "forceInvalid", designErrorText: "designErrorText", showValid: "showValid" }, outputs: { valueChange: "valueChange", touched: "touched" }, host: { properties: { "class": "'iox-field iox-node-' + nodeId", "class.iox-invalid": "invalid", "class.iox-valid": "showValid", "attr.data-iox-field": "fieldName || null", "hidden": "control === 'hidden' ? true : null" } }, ngImport: i0, template: `
4081
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.31", type: IoxFieldComponent, isStandalone: false, selector: "div[iox-field]", inputs: { nodeId: "nodeId", name: "name", label: "label", control: "control", placeholder: "placeholder", help: "help", required: "required", disabled: "disabled", labelHidden: "labelHidden", requiredMark: "requiredMark", rows: "rows", rangeMin: "rangeMin", rangeMax: "rangeMax", rangeStep: "rangeStep", accept: "accept", options: "options", value: "value", rules: "rules", forceInvalid: "forceInvalid", designErrorText: "designErrorText", showValid: "showValid" }, outputs: { valueChange: "valueChange", touched: "touched" }, host: { properties: { "class": "'iox-field iox-node-' + nodeId", "class.iox-invalid": "invalid", "class.iox-valid": "showValid", "attr.data-iox-field": "fieldName || null", "hidden": "control === 'hidden' ? true : null" } }, ngImport: i0, template: `
4075
4082
  <label class="iox-field__label"
4076
4083
  [class.iox-field__label--hidden]="labelHidden"
4077
4084
  [attr.for]="controlId">
@@ -4112,6 +4119,33 @@ class IoxFieldComponent {
4112
4119
  }
4113
4120
  </select>
4114
4121
  }
4122
+ @case ('switch') {
4123
+ <input class="iox-field__control iox-field__control--switch"
4124
+ type="checkbox"
4125
+ role="switch"
4126
+ [id]="controlId"
4127
+ [name]="fieldName"
4128
+ [attr.aria-invalid]="invalid ? 'true' : null"
4129
+ [attr.aria-describedby]="describedBy"
4130
+ [attr.disabled]="disabled ? '' : null"
4131
+ [checked]="value === true"
4132
+ (change)="emit($any($event.target).checked)"
4133
+ (blur)="touch()">
4134
+ }
4135
+ @case ('range') {
4136
+ <input class="iox-field__control iox-field__control--range"
4137
+ type="range"
4138
+ [id]="controlId"
4139
+ [name]="fieldName"
4140
+ [attr.min]="rangeMin"
4141
+ [attr.max]="rangeMax"
4142
+ [attr.step]="rangeStep"
4143
+ [attr.aria-describedby]="describedBy"
4144
+ [attr.disabled]="disabled ? '' : null"
4145
+ [value]="value ?? rangeMin"
4146
+ (input)="emit(+$any($event.target).value)"
4147
+ (blur)="touch()">
4148
+ }
4115
4149
  @case ('checkbox') {
4116
4150
  <input class="iox-field__control iox-field__control--checkbox"
4117
4151
  type="checkbox"
@@ -4209,6 +4243,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.31", ngImpo
4209
4243
  }
4210
4244
  </select>
4211
4245
  }
4246
+ @case ('switch') {
4247
+ <input class="iox-field__control iox-field__control--switch"
4248
+ type="checkbox"
4249
+ role="switch"
4250
+ [id]="controlId"
4251
+ [name]="fieldName"
4252
+ [attr.aria-invalid]="invalid ? 'true' : null"
4253
+ [attr.aria-describedby]="describedBy"
4254
+ [attr.disabled]="disabled ? '' : null"
4255
+ [checked]="value === true"
4256
+ (change)="emit($any($event.target).checked)"
4257
+ (blur)="touch()">
4258
+ }
4259
+ @case ('range') {
4260
+ <input class="iox-field__control iox-field__control--range"
4261
+ type="range"
4262
+ [id]="controlId"
4263
+ [name]="fieldName"
4264
+ [attr.min]="rangeMin"
4265
+ [attr.max]="rangeMax"
4266
+ [attr.step]="rangeStep"
4267
+ [attr.aria-describedby]="describedBy"
4268
+ [attr.disabled]="disabled ? '' : null"
4269
+ [value]="value ?? rangeMin"
4270
+ (input)="emit(+$any($event.target).value)"
4271
+ (blur)="touch()">
4272
+ }
4212
4273
  @case ('checkbox') {
4213
4274
  <input class="iox-field__control iox-field__control--checkbox"
4214
4275
  type="checkbox"
@@ -4295,6 +4356,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.31", ngImpo
4295
4356
  type: Input
4296
4357
  }], rows: [{
4297
4358
  type: Input
4359
+ }], rangeMin: [{
4360
+ type: Input
4361
+ }], rangeMax: [{
4362
+ type: Input
4363
+ }], rangeStep: [{
4364
+ type: Input
4298
4365
  }], accept: [{
4299
4366
  type: Input
4300
4367
  }], options: [{