@vonage/vivid 4.15.0 → 4.16.1

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.
@@ -22061,6 +22061,14 @@
22061
22061
  }
22062
22062
  ],
22063
22063
  "description": "Rounds a value to the nearest step value. Handles decimal rounding."
22064
+ },
22065
+ {
22066
+ "kind": "variable",
22067
+ "name": "defaultToOneConverter",
22068
+ "type": {
22069
+ "text": "object"
22070
+ },
22071
+ "default": "{\n\tfromView(value: string | number): number {\n\t\tconst num = Number(value);\n\t\treturn handleStepValue(num);\n\t},\n\ttoView(value: number): string {\n\t\treturn value.toString();\n\t},\n}"
22064
22072
  }
22065
22073
  ],
22066
22074
  "exports": [
@@ -22071,6 +22079,14 @@
22071
22079
  "name": "roundToStepValue",
22072
22080
  "module": "libs/components/src/lib/range-slider/utils/roundToStepValue.ts"
22073
22081
  }
22082
+ },
22083
+ {
22084
+ "kind": "js",
22085
+ "name": "defaultToOneConverter",
22086
+ "declaration": {
22087
+ "name": "defaultToOneConverter",
22088
+ "module": "libs/components/src/lib/range-slider/utils/roundToStepValue.ts"
22089
+ }
22074
22090
  }
22075
22091
  ]
22076
22092
  },
@@ -1 +1,5 @@
1
1
  export declare const roundToStepValue: (value: number, step: number) => number;
2
+ export declare const defaultToOneConverter: {
3
+ fromView(value: string | number): number;
4
+ toView(value: number): string;
5
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vonage/vivid",
3
- "version": "4.15.0",
3
+ "version": "4.16.1",
4
4
  "type": "module",
5
5
  "module": "./index.js",
6
6
  "main": "./index.cjs",
@@ -2466,7 +2466,7 @@ const FilePickerTemplate = (context) => {
2466
2466
  x.setButtonTag(context.tagFor(definition.Button));
2467
2467
  x.setIconTag(context.tagFor(definition$1.Icon));
2468
2468
  }}
2469
- <div class="base" aria-label="${(x) => x.label}">
2469
+ <div class="base">
2470
2470
  ${when.when(
2471
2471
  (x) => x.label,
2472
2472
  vividElement.html`<label>${(x) => x.label}</label>`
@@ -2464,7 +2464,7 @@ const FilePickerTemplate = (context) => {
2464
2464
  x.setButtonTag(context.tagFor(Button));
2465
2465
  x.setIconTag(context.tagFor(Icon));
2466
2466
  }}
2467
- <div class="base" aria-label="${(x) => x.label}">
2467
+ <div class="base">
2468
2468
  ${when(
2469
2469
  (x) => x.label,
2470
2470
  html`<label>${(x) => x.label}</label>`
@@ -483,7 +483,7 @@ __decorateClass([
483
483
  vividElement.attr({ converter: vividElement.nullableNumberConverter })
484
484
  ], RangeSlider.prototype, "max", 2);
485
485
  __decorateClass([
486
- vividElement.attr({ converter: vividElement.nullableNumberConverter })
486
+ vividElement.attr({ converter: slider_template.defaultToOneConverter })
487
487
  ], RangeSlider.prototype, "step", 2);
488
488
  __decorateClass([
489
489
  vividElement.attr
@@ -3,7 +3,7 @@ import { V as VividElement, o as observable, a as attr, n as nullableNumberConve
3
3
  import { g as keyHome, d as keyEnd, e as keyArrowUp, h as keyArrowLeft, f as keyArrowDown, i as keyArrowRight } from './key-codes.js';
4
4
  import { a as applyMixins } from './apply-mixins.js';
5
5
  import { F as FormAssociated } from './form-associated.js';
6
- import { i as inverseLerp, l as lerp, r as roundToStepValue, g as getMarkersTemplate } from './slider.template.js';
6
+ import { i as inverseLerp, l as lerp, r as roundToStepValue, d as defaultToOneConverter, g as getMarkersTemplate } from './slider.template.js';
7
7
  import { O as Orientation } from './aria.js';
8
8
  import { l as limit } from './numbers.js';
9
9
  import { f as formElements } from './form-elements.js';
@@ -481,7 +481,7 @@ __decorateClass([
481
481
  attr({ converter: nullableNumberConverter })
482
482
  ], RangeSlider.prototype, "max", 2);
483
483
  __decorateClass([
484
- attr({ converter: nullableNumberConverter })
484
+ attr({ converter: defaultToOneConverter })
485
485
  ], RangeSlider.prototype, "step", 2);
486
486
  __decorateClass([
487
487
  attr
@@ -150,12 +150,12 @@ let Select = class extends FormAssociatedSelect {
150
150
  this.rangeStartIndex = this.activeIndex;
151
151
  }
152
152
  this.options.forEach((o, i) => {
153
- o.checked = numbers.inRange(i, this.rangeStartIndex, this.options.length);
153
+ o.checked = numbers.inRange(i, this.rangeStartIndex, this.length);
154
154
  });
155
155
  } else {
156
156
  this.uncheckAllOptions();
157
157
  }
158
- this.activeIndex = this.options.length - 1;
158
+ this.activeIndex = this.length - 1;
159
159
  this.checkActiveIndex();
160
160
  }
161
161
  /**
@@ -179,7 +179,7 @@ let Select = class extends FormAssociatedSelect {
179
179
  } else {
180
180
  this.uncheckAllOptions();
181
181
  }
182
- this.activeIndex += this.activeIndex < this.options.length - 1 ? 1 : 0;
182
+ this.activeIndex += this.activeIndex < this.length - 1 ? 1 : 0;
183
183
  this.checkActiveIndex();
184
184
  }
185
185
  /**
@@ -346,7 +346,7 @@ let Select = class extends FormAssociatedSelect {
346
346
  }
347
347
  set value(next) {
348
348
  const prev = `${this._value}`;
349
- if (this._options.length) {
349
+ if (this.length) {
350
350
  const selectedIndex = this._options.findIndex((el) => el.value === next);
351
351
  const prevSelectedValue = this._options[this.selectedIndex]?.value ?? null;
352
352
  const nextSelectedValue = this._options[selectedIndex]?.value ?? null;
@@ -523,7 +523,7 @@ let Select = class extends FormAssociatedSelect {
523
523
  */
524
524
  setProxyOptions() {
525
525
  if (this.proxy instanceof HTMLSelectElement && this.options) {
526
- this.proxy.options.length = 0;
526
+ this.proxy.length = 0;
527
527
  this.options.forEach((option) => {
528
528
  const proxyOption = option.proxy || (option instanceof HTMLOptionElement ? option.cloneNode() : null);
529
529
  if (proxyOption) {
@@ -148,12 +148,12 @@ let Select = class extends FormAssociatedSelect {
148
148
  this.rangeStartIndex = this.activeIndex;
149
149
  }
150
150
  this.options.forEach((o, i) => {
151
- o.checked = inRange(i, this.rangeStartIndex, this.options.length);
151
+ o.checked = inRange(i, this.rangeStartIndex, this.length);
152
152
  });
153
153
  } else {
154
154
  this.uncheckAllOptions();
155
155
  }
156
- this.activeIndex = this.options.length - 1;
156
+ this.activeIndex = this.length - 1;
157
157
  this.checkActiveIndex();
158
158
  }
159
159
  /**
@@ -177,7 +177,7 @@ let Select = class extends FormAssociatedSelect {
177
177
  } else {
178
178
  this.uncheckAllOptions();
179
179
  }
180
- this.activeIndex += this.activeIndex < this.options.length - 1 ? 1 : 0;
180
+ this.activeIndex += this.activeIndex < this.length - 1 ? 1 : 0;
181
181
  this.checkActiveIndex();
182
182
  }
183
183
  /**
@@ -344,7 +344,7 @@ let Select = class extends FormAssociatedSelect {
344
344
  }
345
345
  set value(next) {
346
346
  const prev = `${this._value}`;
347
- if (this._options.length) {
347
+ if (this.length) {
348
348
  const selectedIndex = this._options.findIndex((el) => el.value === next);
349
349
  const prevSelectedValue = this._options[this.selectedIndex]?.value ?? null;
350
350
  const nextSelectedValue = this._options[selectedIndex]?.value ?? null;
@@ -521,7 +521,7 @@ let Select = class extends FormAssociatedSelect {
521
521
  */
522
522
  setProxyOptions() {
523
523
  if (this.proxy instanceof HTMLSelectElement && this.options) {
524
- this.proxy.options.length = 0;
524
+ this.proxy.length = 0;
525
525
  this.options.forEach((option) => {
526
526
  const proxyOption = option.proxy || (option instanceof HTMLOptionElement ? option.cloneNode() : null);
527
527
  if (proxyOption) {
@@ -449,7 +449,7 @@ __decorateClass([
449
449
  vividElement.attr({ converter: vividElement.nullableNumberConverter })
450
450
  ], Slider.prototype, "max", 2);
451
451
  __decorateClass([
452
- vividElement.attr({ converter: vividElement.nullableNumberConverter })
452
+ vividElement.attr({ converter: slider_template.defaultToOneConverter })
453
453
  ], Slider.prototype, "step", 2);
454
454
  __decorateClass([
455
455
  vividElement.attr
@@ -3,7 +3,7 @@ import { V as VividElement, a as attr, o as observable, v as volatile, n as null
3
3
  import { g as keyHome, d as keyEnd, f as keyArrowDown, h as keyArrowLeft, e as keyArrowUp, i as keyArrowRight } from './key-codes.js';
4
4
  import { D as Direction, g as getDirection } from './direction.js';
5
5
  import { a as applyMixins } from './apply-mixins.js';
6
- import { i as inverseLerp, l as lerp, r as roundToStepValue, S as SliderTemplate } from './slider.template.js';
6
+ import { i as inverseLerp, l as lerp, r as roundToStepValue, d as defaultToOneConverter, S as SliderTemplate } from './slider.template.js';
7
7
  import { F as FormAssociated } from './form-associated.js';
8
8
  import { O as Orientation } from './aria.js';
9
9
  import { l as limit } from './numbers.js';
@@ -447,7 +447,7 @@ __decorateClass([
447
447
  attr({ converter: nullableNumberConverter })
448
448
  ], Slider.prototype, "max", 2);
449
449
  __decorateClass([
450
- attr({ converter: nullableNumberConverter })
450
+ attr({ converter: defaultToOneConverter })
451
451
  ], Slider.prototype, "step", 2);
452
452
  __decorateClass([
453
453
  attr