@vonage/vivid 5.1.0 → 5.2.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/audio-player/definition.cjs +37 -4
- package/audio-player/definition.js +37 -4
- package/audio-player/index.cjs +25 -25
- package/audio-player/index.js +86 -62
- package/bundled/definition13.cjs +2 -2
- package/bundled/definition13.js +4 -4
- package/bundled/definition19.cjs +18 -15
- package/bundled/definition19.js +85 -77
- package/bundled/definition6.cjs +6 -6
- package/bundled/definition6.js +34 -31
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +2 -1
- package/bundled/picker-field.template.cjs +18 -13
- package/bundled/picker-field.template.js +44 -36
- package/bundled/text-field.cjs +1 -1
- package/bundled/text-field.js +1 -1
- package/bundled/vivid-element.cjs +1 -1
- package/bundled/vivid-element.js +1 -1
- package/bundled/with-contextual-help.cjs +1 -1
- package/bundled/with-contextual-help.js +17 -7
- package/combobox/definition.cjs +12 -5
- package/combobox/definition.js +12 -5
- package/combobox/index.cjs +15 -11
- package/combobox/index.js +83 -76
- package/custom-elements.json +95 -3
- package/dial-pad/definition.cjs +51 -1
- package/dial-pad/definition.js +52 -2
- package/dial-pad/index.cjs +21 -18
- package/dial-pad/index.js +123 -92
- package/file-picker/definition.cjs +14 -5
- package/file-picker/definition.js +15 -6
- package/file-picker/index.cjs +12 -9
- package/file-picker/index.js +102 -92
- package/lib/audio-player/audio-player.d.ts +4 -0
- package/lib/combobox/combobox.d.ts +483 -66
- package/lib/date-picker/date-picker.d.ts +839 -827
- package/lib/date-range-picker/date-range-picker.d.ts +580 -574
- package/lib/date-time-picker/date-time-picker.d.ts +863 -851
- package/lib/dial-pad/dial-pad.template.d.ts +1 -1
- package/lib/dial-pad/locale.d.ts +1 -0
- package/lib/file-picker/file-picker.d.ts +483 -66
- package/lib/menu/menu.d.ts +1 -0
- package/lib/number-field/number-field.d.ts +1 -0
- package/lib/searchable-select/searchable-select.d.ts +505 -88
- package/lib/select/select.d.ts +470 -53
- package/lib/text-area/text-area.d.ts +1 -0
- package/lib/text-field/text-field.d.ts +1 -0
- package/lib/time-picker/time-picker.d.ts +551 -545
- package/locales/de-DE.cjs +2 -1
- package/locales/de-DE.js +2 -1
- package/locales/en-GB.cjs +2 -1
- package/locales/en-GB.js +2 -1
- package/locales/en-US.cjs +2 -1
- package/locales/en-US.js +2 -1
- package/locales/ja-JP.cjs +2 -1
- package/locales/ja-JP.js +2 -1
- package/locales/zh-CN.cjs +2 -1
- package/locales/zh-CN.js +2 -1
- package/menu/definition.cjs +6 -2
- package/menu/definition.js +7 -3
- package/number-field/definition.cjs +2 -2
- package/number-field/definition.js +3 -3
- package/number-field/index.cjs +9 -9
- package/number-field/index.js +28 -27
- package/package.json +1 -1
- package/searchable-select/definition.cjs +27 -18
- package/searchable-select/definition.js +28 -19
- package/searchable-select/index.cjs +28 -25
- package/searchable-select/index.js +150 -141
- package/select/definition.cjs +14 -6
- package/select/definition.js +14 -6
- package/shared/patterns/form-elements/index.d.ts +1 -0
- package/shared/patterns/form-elements/with-contextual-help.d.ts +1 -0
- package/shared/picker-field/mixins/calendar-picker.d.ts +442 -439
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +442 -439
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +584 -578
- package/shared/picker-field/mixins/single-date-picker.d.ts +696 -687
- package/shared/picker-field/mixins/single-value-picker.d.ts +441 -438
- package/shared/picker-field/mixins/time-selection-picker.d.ts +562 -556
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +551 -545
- package/shared/picker-field/picker-field.d.ts +483 -66
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/text-area/definition.cjs +1 -1
- package/text-area/definition.js +1 -1
- package/text-area/index.cjs +1 -1
- package/text-area/index.js +1 -1
- package/text-field/definition.cjs +1 -1
- package/text-field/definition.js +1 -1
- package/unbundled/picker-field.template.cjs +11 -3
- package/unbundled/picker-field.template.js +11 -3
- package/unbundled/text-field.cjs +1 -1
- package/unbundled/text-field.js +1 -1
- package/unbundled/vivid-element.cjs +1 -1
- package/unbundled/vivid-element.js +1 -1
- package/unbundled/with-contextual-help.cjs +11 -0
- package/unbundled/with-contextual-help.js +11 -0
- package/vivid.api.json +30 -0
package/combobox/index.js
CHANGED
|
@@ -1,41 +1,44 @@
|
|
|
1
1
|
import { i as k } from "../bundled/definition2.js";
|
|
2
|
-
import { P as
|
|
3
|
-
import { l as
|
|
4
|
-
import { s as
|
|
5
|
-
import { D as S, O as
|
|
6
|
-
import { W as D, f as
|
|
7
|
-
import { L as
|
|
8
|
-
import { F } from "../bundled/form-associated.js";
|
|
9
|
-
import { W as
|
|
10
|
-
import { W as B } from "../bundled/with-
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
2
|
+
import { P as $, p as I } from "../bundled/definition9.js";
|
|
3
|
+
import { l as C } from "../bundled/definition10.js";
|
|
4
|
+
import { s as O } from "../bundled/text-field.js";
|
|
5
|
+
import { D as S, O as v, a as l, o as b, h as u, c as A, d as V } from "../bundled/vivid-element.js";
|
|
6
|
+
import { W as D, f as H } from "../bundled/mixins.js";
|
|
7
|
+
import { L as m } from "../bundled/listbox.js";
|
|
8
|
+
import { F as T } from "../bundled/form-associated.js";
|
|
9
|
+
import { W as F } from "../bundled/with-contextual-help.js";
|
|
10
|
+
import { W as B } from "../bundled/with-error-text.js";
|
|
11
|
+
import { W as L } from "../bundled/with-success-text.js";
|
|
12
|
+
import { F as E } from "../bundled/form-element.js";
|
|
13
|
+
import { b as W, a as R, I as P } from "../bundled/affix.js";
|
|
14
|
+
import { u as z } from "../bundled/strings.js";
|
|
15
|
+
import { l as M } from "../bundled/numbers.js";
|
|
16
|
+
import { h as q } from "../bundled/index.js";
|
|
17
|
+
import { c as K } from "../bundled/definition3.js";
|
|
17
18
|
import { r as d } from "../bundled/ref.js";
|
|
18
|
-
import { s as
|
|
19
|
-
import { c as
|
|
20
|
-
import { w as
|
|
21
|
-
const
|
|
19
|
+
import { s as h } from "../bundled/slotted.js";
|
|
20
|
+
import { c as N } from "../bundled/class-names.js";
|
|
21
|
+
import { w as U } from "../bundled/when.js";
|
|
22
|
+
const j = '.chevron{display:flex;flex-shrink:0;font:var(--vvd-typography-base-extended);transform:rotate(0);transition:transform .2s}:host([data-expanded=true]) .chevron,:host([open]) .chevron{transform:rotate(180deg)}:not(.disabled) .chevron{cursor:pointer}.disabled .chevron{color:var(--_low-ink-color);cursor:not-allowed}:host{position:relative;display:inline-flex;flex-direction:column;gap:4px;--_low-ink-color: var(--vvd-color-neutral-600)}:host([disabled]){--_low-ink-color: var(--vvd-color-neutral-400);cursor:not-allowed}.base{--_text-field-gutter-end: 8px}.base{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--vvd-color-neutral-500)}.base.appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}@media (hover: hover){.base:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--vvd-color-neutral-700)}.base:hover:where(:not(.disabled,:disabled,.readonly)).appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}}.base.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--vvd-color-neutral-700)}.base.hover:where(:not(.disabled,:disabled,.readonly)).appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.base:disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.base:disabled.appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base.disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.base.disabled.appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base.readonly:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: var(--vvd-color-neutral-400)}.base.readonly:where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-600);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base.error:where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: var(--vvd-color-alert-500)}.base.error:where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: transparent}.base.success:where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: var(--vvd-color-success-500)}.base.success:where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: transparent}.base:not(.shape-pill) .base{border-radius:var(--_text-field-border-radius)}.base.shape-pill .base{border-radius:var(--_text-field-pill-border-radius)}.base slot[name=icon]{position:absolute;z-index:1;display:inline-block;color:var(--_low-ink-color);font-size:var(--_text-field-icon-size);inset-block-start:50%;inset-inline-start:var(--_text-field-gutter-start);line-height:1;pointer-events:none;transform:translateY(-50%)}.base.has-meta{padding-inline-end:16px}.control{text-overflow:ellipsis;white-space:nowrap}.fieldset .leading-items-wrapper{position:relative;display:flex;flex-shrink:0;align-items:center;gap:8px;padding-inline-end:16px}.listbox{display:flex;max-height:var(--combobox-height, 408px);flex-direction:column;padding:4px;border-radius:8px;contain:paint;gap:2px;overflow-y:auto}::part(popup-base){inline-size:max-content;min-inline-size:var(--_combobox-fixed-width, 100%)}@supports selector(:has(*)){.base:not(.has-activedescendant) .fieldset:has(.control:focus-within):after{--focus-stroke-gap-color: transparent;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}}@supports not selector(:has(*)){.base:not(.has-activedescendant) .fieldset:focus-within:after{box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent;position:absolute;z-index:1;display:block;border-radius:inherit;content:"";inset:0;pointer-events:none}}::slotted([data-vvd-component=option][current-selected]){border-radius:8px;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent}.label-suffix{display:flex;align-items:center;gap:var(--label-suffix-gap, 8px);grid-column-end:-1;grid-row:1}.label-suffix[hidden]{display:none}slot[name=contextual-help]::slotted([data-vvd-component=contextual-help]){grid-column-end:-1;grid-row:1}', p = {
|
|
22
23
|
inline: "inline",
|
|
23
24
|
list: "list",
|
|
24
25
|
both: "both",
|
|
25
26
|
none: "none"
|
|
26
27
|
};
|
|
27
|
-
var
|
|
28
|
-
for (var r = void 0,
|
|
29
|
-
(c = a[
|
|
30
|
-
return r &&
|
|
28
|
+
var Y = Object.defineProperty, n = (a, t, e, o) => {
|
|
29
|
+
for (var r = void 0, s = a.length - 1, c; s >= 0; s--)
|
|
30
|
+
(c = a[s]) && (r = c(t, e, r) || r);
|
|
31
|
+
return r && Y(t, e, r), r;
|
|
31
32
|
};
|
|
32
|
-
class i extends
|
|
33
|
-
|
|
34
|
-
B(
|
|
33
|
+
class i extends F(
|
|
34
|
+
D(
|
|
35
|
+
B(
|
|
36
|
+
L(E(W(T(m))))
|
|
37
|
+
)
|
|
35
38
|
)
|
|
36
39
|
) {
|
|
37
40
|
constructor() {
|
|
38
|
-
super(...arguments), this.filteredOptions = [], this.filter = "", this.fixedDropdown = !1, this.listboxId =
|
|
41
|
+
super(...arguments), this.filteredOptions = [], this.filter = "", this.fixedDropdown = !1, this.listboxId = z("listbox-"), this.maxHeight = 0, this.open = !1, this.proxy = document.createElement("input");
|
|
39
42
|
}
|
|
40
43
|
/**
|
|
41
44
|
* Reset the element to its first selectable option when its parent form is reset.
|
|
@@ -80,10 +83,10 @@ class i extends D(
|
|
|
80
83
|
* Overrides `Listbox.options`.
|
|
81
84
|
*/
|
|
82
85
|
get options() {
|
|
83
|
-
return
|
|
86
|
+
return v.track(this, "options"), this.filteredOptions.length ? this.filteredOptions : this._options;
|
|
84
87
|
}
|
|
85
88
|
set options(t) {
|
|
86
|
-
this._options = t,
|
|
89
|
+
this._options = t, v.notify(this, "options");
|
|
87
90
|
}
|
|
88
91
|
/**
|
|
89
92
|
* Updates the placeholder on the proxy element.
|
|
@@ -99,8 +102,8 @@ class i extends D(
|
|
|
99
102
|
if (this.$fastController.isConnected && this.options) {
|
|
100
103
|
const o = this.options.findIndex(
|
|
101
104
|
(c) => c.text.toLowerCase() === e.toLowerCase()
|
|
102
|
-
), r = this.options[this.selectedIndex]?.text,
|
|
103
|
-
this.selectedIndex = r !==
|
|
105
|
+
), r = this.options[this.selectedIndex]?.text, s = this.options[o]?.text;
|
|
106
|
+
this.selectedIndex = r !== s ? o : this.selectedIndex;
|
|
104
107
|
}
|
|
105
108
|
super.valueChanged(t, e);
|
|
106
109
|
}
|
|
@@ -111,7 +114,7 @@ class i extends D(
|
|
|
111
114
|
* @internal
|
|
112
115
|
*/
|
|
113
116
|
clickHandler(t) {
|
|
114
|
-
if (!this.disabled) {
|
|
117
|
+
if (!(this.disabled || this._isFromContextualHelp(t))) {
|
|
115
118
|
if (this.open) {
|
|
116
119
|
const e = t.target.closest(
|
|
117
120
|
"option,[role=option],[data-vvd-component=option]"
|
|
@@ -242,7 +245,7 @@ class i extends D(
|
|
|
242
245
|
*/
|
|
243
246
|
selectedIndexChanged(t, e) {
|
|
244
247
|
if (this.$fastController.isConnected) {
|
|
245
|
-
if (e =
|
|
248
|
+
if (e = M(-1, this.options.length - 1, e), e !== this.selectedIndex) {
|
|
246
249
|
this.selectedIndex = e;
|
|
247
250
|
return;
|
|
248
251
|
}
|
|
@@ -351,57 +354,57 @@ class i extends D(
|
|
|
351
354
|
this.control.setSelectionRange(t, t);
|
|
352
355
|
}
|
|
353
356
|
}
|
|
354
|
-
|
|
357
|
+
n([
|
|
355
358
|
l({ attribute: "autocomplete", mode: "fromView" })
|
|
356
359
|
], i.prototype, "autocomplete");
|
|
357
|
-
|
|
360
|
+
n([
|
|
358
361
|
l
|
|
359
362
|
], i.prototype, "appearance");
|
|
360
|
-
|
|
363
|
+
n([
|
|
361
364
|
l
|
|
362
365
|
], i.prototype, "shape");
|
|
363
|
-
|
|
366
|
+
n([
|
|
364
367
|
l()
|
|
365
368
|
], i.prototype, "scale");
|
|
366
|
-
|
|
369
|
+
n([
|
|
367
370
|
l
|
|
368
371
|
], i.prototype, "placement");
|
|
369
|
-
|
|
372
|
+
n([
|
|
370
373
|
l({ mode: "boolean", attribute: "fixed-dropdown" })
|
|
371
374
|
], i.prototype, "fixedDropdown");
|
|
372
|
-
|
|
373
|
-
|
|
375
|
+
n([
|
|
376
|
+
b
|
|
374
377
|
], i.prototype, "metaSlottedContent");
|
|
375
|
-
|
|
376
|
-
|
|
378
|
+
n([
|
|
379
|
+
b
|
|
377
380
|
], i.prototype, "maxHeight");
|
|
378
|
-
|
|
381
|
+
n([
|
|
379
382
|
l({ attribute: "open", mode: "boolean" })
|
|
380
383
|
], i.prototype, "open");
|
|
381
|
-
|
|
384
|
+
n([
|
|
382
385
|
l
|
|
383
386
|
], i.prototype, "placeholder");
|
|
384
|
-
const
|
|
387
|
+
const G = ({
|
|
385
388
|
icon: a,
|
|
386
389
|
iconSlottedContent: t,
|
|
387
390
|
metaSlottedContent: e,
|
|
388
391
|
errorValidationMessage: o,
|
|
389
392
|
successText: r,
|
|
390
|
-
shape:
|
|
393
|
+
shape: s,
|
|
391
394
|
scale: c,
|
|
392
395
|
disabled: x,
|
|
393
396
|
placeholder: g,
|
|
394
397
|
label: _,
|
|
395
|
-
appearance:
|
|
398
|
+
appearance: f,
|
|
396
399
|
open: w,
|
|
397
400
|
_activeDescendant: y
|
|
398
|
-
}) =>
|
|
401
|
+
}) => N(
|
|
399
402
|
"base",
|
|
400
403
|
["disabled", x],
|
|
401
|
-
[`shape-${
|
|
404
|
+
[`shape-${s}`, !!s],
|
|
402
405
|
[`size-${c}`, !!c],
|
|
403
406
|
["placeholder", !!g],
|
|
404
|
-
[`appearance-${
|
|
407
|
+
[`appearance-${f}`, !!f],
|
|
405
408
|
["no-label", !_],
|
|
406
409
|
["has-icon", !!a || !!t?.length],
|
|
407
410
|
["has-meta", !!e?.length],
|
|
@@ -409,22 +412,26 @@ const Y = ({
|
|
|
409
412
|
["error", !!o],
|
|
410
413
|
["success", !!r]
|
|
411
414
|
);
|
|
412
|
-
function
|
|
413
|
-
return
|
|
415
|
+
function J() {
|
|
416
|
+
return u` <label for="control" class="label">
|
|
414
417
|
${(a) => a.label}
|
|
415
418
|
</label>`;
|
|
416
419
|
}
|
|
417
|
-
function
|
|
420
|
+
function Q(a) {
|
|
418
421
|
return a.open && a.fixedDropdown ? `--_combobox-fixed-width: ${Math.round(
|
|
419
422
|
a.getBoundingClientRect().width
|
|
420
423
|
)}px` : null;
|
|
421
424
|
}
|
|
422
|
-
function
|
|
423
|
-
const t = R(a), e =
|
|
424
|
-
return
|
|
425
|
-
${
|
|
425
|
+
function X(a) {
|
|
426
|
+
const t = R(a), e = K(a);
|
|
427
|
+
return u` <div class="${G}" ${d("_anchor")}>
|
|
428
|
+
${U((o) => o.label, J())}
|
|
429
|
+
<slot
|
|
430
|
+
name="contextual-help"
|
|
431
|
+
${h("_contextualHelpSlottedContent")}
|
|
432
|
+
></slot>
|
|
426
433
|
<div class="fieldset">
|
|
427
|
-
${(o) => t(o.icon,
|
|
434
|
+
${(o) => t(o.icon, P.Slot)}
|
|
428
435
|
<div class="wrapper">
|
|
429
436
|
<input
|
|
430
437
|
id="control"
|
|
@@ -446,7 +453,7 @@ function Q(a) {
|
|
|
446
453
|
/>
|
|
447
454
|
</div>
|
|
448
455
|
<div class="leading-items-wrapper">
|
|
449
|
-
<slot name="meta" ${
|
|
456
|
+
<slot name="meta" ${h("metaSlottedContent")}></slot>
|
|
450
457
|
<div
|
|
451
458
|
@click="${(o, r) => o._chevronIconClickHandler(r.event)}"
|
|
452
459
|
>
|
|
@@ -456,19 +463,19 @@ function Q(a) {
|
|
|
456
463
|
</div>
|
|
457
464
|
</div>`;
|
|
458
465
|
}
|
|
459
|
-
const
|
|
460
|
-
const t = a.tagFor(
|
|
461
|
-
return
|
|
466
|
+
const Z = (a) => {
|
|
467
|
+
const t = a.tagFor($);
|
|
468
|
+
return u`
|
|
462
469
|
<template
|
|
463
470
|
tabindex="${(e) => e.disabled ? null : "0"}"
|
|
464
471
|
@click="${(e, o) => e.clickHandler(o.event)}"
|
|
465
472
|
@focusout="${(e, o) => e.focusoutHandler(o.event)}"
|
|
466
|
-
@keydown="${(e, { event: o }) => (e.open &&
|
|
473
|
+
@keydown="${(e, { event: o }) => (e.open && q(o), e.keydownHandler(o))}"
|
|
467
474
|
>
|
|
468
475
|
<div class="control-wrapper">
|
|
469
|
-
${() =>
|
|
476
|
+
${() => X(a)}
|
|
470
477
|
<${t} class="popup"
|
|
471
|
-
style="${
|
|
478
|
+
style="${Q}"
|
|
472
479
|
?open="${(e) => e.open}"
|
|
473
480
|
placement="${(e) => e.placement ?? "bottom-start"}"
|
|
474
481
|
strategy="${(e) => e.fixedDropdown ? "fixed" : "absolute"}"
|
|
@@ -478,8 +485,8 @@ const X = (a) => {
|
|
|
478
485
|
role="listbox"
|
|
479
486
|
?disabled="${(e) => e.disabled}"
|
|
480
487
|
${d("listbox")}>
|
|
481
|
-
<slot ${
|
|
482
|
-
filter:
|
|
488
|
+
<slot ${h({
|
|
489
|
+
filter: m.slottedOptionFilter,
|
|
483
490
|
flatten: !0,
|
|
484
491
|
property: "slottedOptions"
|
|
485
492
|
})}>
|
|
@@ -492,21 +499,21 @@ const X = (a) => {
|
|
|
492
499
|
</div>
|
|
493
500
|
</template>
|
|
494
501
|
`;
|
|
495
|
-
},
|
|
502
|
+
}, ee = V(
|
|
496
503
|
"combobox",
|
|
497
504
|
i,
|
|
498
|
-
|
|
505
|
+
Z,
|
|
499
506
|
[
|
|
500
507
|
k,
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
508
|
+
I,
|
|
509
|
+
C,
|
|
510
|
+
H
|
|
504
511
|
],
|
|
505
512
|
{
|
|
506
|
-
styles: [
|
|
513
|
+
styles: [O, j],
|
|
507
514
|
shadowOptions: {
|
|
508
515
|
delegatesFocus: !0
|
|
509
516
|
}
|
|
510
517
|
}
|
|
511
|
-
),
|
|
512
|
-
|
|
518
|
+
), te = A(ee);
|
|
519
|
+
te();
|
package/custom-elements.json
CHANGED
|
@@ -1487,6 +1487,59 @@
|
|
|
1487
1487
|
"kind": "method",
|
|
1488
1488
|
"name": "srcChanged"
|
|
1489
1489
|
},
|
|
1490
|
+
{
|
|
1491
|
+
"kind": "method",
|
|
1492
|
+
"name": "revokeSrc",
|
|
1493
|
+
"privacy": "private"
|
|
1494
|
+
},
|
|
1495
|
+
{
|
|
1496
|
+
"kind": "method",
|
|
1497
|
+
"name": "getCurrentSrc",
|
|
1498
|
+
"privacy": "private",
|
|
1499
|
+
"return": {
|
|
1500
|
+
"type": {
|
|
1501
|
+
"text": "string"
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
},
|
|
1505
|
+
{
|
|
1506
|
+
"kind": "method",
|
|
1507
|
+
"name": "canPlayType",
|
|
1508
|
+
"privacy": "private",
|
|
1509
|
+
"return": {
|
|
1510
|
+
"type": {
|
|
1511
|
+
"text": "boolean"
|
|
1512
|
+
}
|
|
1513
|
+
},
|
|
1514
|
+
"parameters": [
|
|
1515
|
+
{
|
|
1516
|
+
"name": "type",
|
|
1517
|
+
"type": {
|
|
1518
|
+
"text": "string"
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
]
|
|
1522
|
+
},
|
|
1523
|
+
{
|
|
1524
|
+
"kind": "method",
|
|
1525
|
+
"name": "setSrc",
|
|
1526
|
+
"privacy": "private",
|
|
1527
|
+
"parameters": [
|
|
1528
|
+
{
|
|
1529
|
+
"name": "url",
|
|
1530
|
+
"type": {
|
|
1531
|
+
"text": "string"
|
|
1532
|
+
}
|
|
1533
|
+
},
|
|
1534
|
+
{
|
|
1535
|
+
"name": "blob",
|
|
1536
|
+
"optional": true,
|
|
1537
|
+
"type": {
|
|
1538
|
+
"text": "Blob"
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
]
|
|
1542
|
+
},
|
|
1490
1543
|
{
|
|
1491
1544
|
"kind": "field",
|
|
1492
1545
|
"name": "playbackRate"
|
|
@@ -8045,6 +8098,10 @@
|
|
|
8045
8098
|
}
|
|
8046
8099
|
],
|
|
8047
8100
|
"mixins": [
|
|
8101
|
+
{
|
|
8102
|
+
"name": "WithContextualHelp",
|
|
8103
|
+
"module": "/src/shared/patterns"
|
|
8104
|
+
},
|
|
8048
8105
|
{
|
|
8049
8106
|
"name": "WithFeedback",
|
|
8050
8107
|
"module": "/src/shared/feedback/mixins"
|
|
@@ -15562,6 +15619,10 @@
|
|
|
15562
15619
|
}
|
|
15563
15620
|
],
|
|
15564
15621
|
"mixins": [
|
|
15622
|
+
{
|
|
15623
|
+
"name": "WithContextualHelp",
|
|
15624
|
+
"module": "/src/shared/patterns/form-elements/with-contextual-help"
|
|
15625
|
+
},
|
|
15565
15626
|
{
|
|
15566
15627
|
"name": "WithFeedback",
|
|
15567
15628
|
"module": "/src/shared/feedback/mixins"
|
|
@@ -16340,6 +16401,16 @@
|
|
|
16340
16401
|
}
|
|
16341
16402
|
],
|
|
16342
16403
|
"members": [
|
|
16404
|
+
{
|
|
16405
|
+
"kind": "field",
|
|
16406
|
+
"name": "offset",
|
|
16407
|
+
"type": {
|
|
16408
|
+
"text": "number | null"
|
|
16409
|
+
},
|
|
16410
|
+
"default": "null",
|
|
16411
|
+
"description": "Adds offset to the popup",
|
|
16412
|
+
"privacy": "public"
|
|
16413
|
+
},
|
|
16343
16414
|
{
|
|
16344
16415
|
"kind": "field",
|
|
16345
16416
|
"name": "menuItems",
|
|
@@ -16680,6 +16751,15 @@
|
|
|
16680
16751
|
}
|
|
16681
16752
|
],
|
|
16682
16753
|
"attributes": [
|
|
16754
|
+
{
|
|
16755
|
+
"name": "offset",
|
|
16756
|
+
"type": {
|
|
16757
|
+
"text": "number | null"
|
|
16758
|
+
},
|
|
16759
|
+
"default": "null",
|
|
16760
|
+
"description": "Adds offset to the popup",
|
|
16761
|
+
"fieldName": "offset"
|
|
16762
|
+
},
|
|
16683
16763
|
{
|
|
16684
16764
|
"name": "placement",
|
|
16685
16765
|
"type": {
|
|
@@ -19618,7 +19698,7 @@
|
|
|
19618
19698
|
"mixins": [
|
|
19619
19699
|
{
|
|
19620
19700
|
"name": "WithContextualHelp",
|
|
19621
|
-
"module": "/src/shared/patterns
|
|
19701
|
+
"module": "/src/shared/patterns"
|
|
19622
19702
|
},
|
|
19623
19703
|
{
|
|
19624
19704
|
"name": "WithFeedback",
|
|
@@ -25312,6 +25392,10 @@
|
|
|
25312
25392
|
}
|
|
25313
25393
|
],
|
|
25314
25394
|
"mixins": [
|
|
25395
|
+
{
|
|
25396
|
+
"name": "WithContextualHelp",
|
|
25397
|
+
"module": "/src/shared/patterns"
|
|
25398
|
+
},
|
|
25315
25399
|
{
|
|
25316
25400
|
"name": "WithFeedback",
|
|
25317
25401
|
"module": "/src/shared/feedback/mixins"
|
|
@@ -26293,6 +26377,10 @@
|
|
|
26293
26377
|
"name": "WithLightDOMFeedback",
|
|
26294
26378
|
"module": "/src/shared/feedback/mixins"
|
|
26295
26379
|
},
|
|
26380
|
+
{
|
|
26381
|
+
"name": "WithContextualHelp",
|
|
26382
|
+
"module": "/src/shared/patterns"
|
|
26383
|
+
},
|
|
26296
26384
|
{
|
|
26297
26385
|
"name": "WithErrorText",
|
|
26298
26386
|
"module": "/src/shared/patterns"
|
|
@@ -32127,7 +32215,7 @@
|
|
|
32127
32215
|
"mixins": [
|
|
32128
32216
|
{
|
|
32129
32217
|
"name": "WithContextualHelp",
|
|
32130
|
-
"module": "/src/shared/patterns
|
|
32218
|
+
"module": "/src/shared/patterns"
|
|
32131
32219
|
},
|
|
32132
32220
|
{
|
|
32133
32221
|
"name": "WithFeedback",
|
|
@@ -33113,7 +33201,7 @@
|
|
|
33113
33201
|
"mixins": [
|
|
33114
33202
|
{
|
|
33115
33203
|
"name": "WithContextualHelp",
|
|
33116
|
-
"module": "/src/shared/patterns
|
|
33204
|
+
"module": "/src/shared/patterns"
|
|
33117
33205
|
},
|
|
33118
33206
|
{
|
|
33119
33207
|
"name": "WithLightDOMFeedback",
|
|
@@ -40606,6 +40694,10 @@
|
|
|
40606
40694
|
}
|
|
40607
40695
|
],
|
|
40608
40696
|
"mixins": [
|
|
40697
|
+
{
|
|
40698
|
+
"name": "WithContextualHelp",
|
|
40699
|
+
"module": "/src/shared/patterns"
|
|
40700
|
+
},
|
|
40609
40701
|
{
|
|
40610
40702
|
"name": "WithFeedback",
|
|
40611
40703
|
"module": "/src/shared/feedback/mixins"
|
package/dial-pad/definition.cjs
CHANGED
|
@@ -6,6 +6,7 @@ const button_definition = require('../unbundled/definition.cjs');
|
|
|
6
6
|
const textField_definition = require('../text-field/definition.cjs');
|
|
7
7
|
const vividElement = require('../unbundled/vivid-element.cjs');
|
|
8
8
|
const icon_definition = require('../icon/definition.cjs');
|
|
9
|
+
const visuallyHidden_definition = require('../visually-hidden/definition.cjs');
|
|
9
10
|
const fastElement = require('@microsoft/fast-element');
|
|
10
11
|
const localized = require('../unbundled/localized.cjs');
|
|
11
12
|
const fastWebUtilities = require('@microsoft/fast-web-utilities');
|
|
@@ -40,9 +41,22 @@ class DialPad extends localized.Localized(vividElement.VividElement) {
|
|
|
40
41
|
* @internal
|
|
41
42
|
*/
|
|
42
43
|
this._onDial = () => {
|
|
44
|
+
const invalid = !this._textFieldEl.checkValidity();
|
|
45
|
+
if (invalid) {
|
|
46
|
+
this._announceValidationError(
|
|
47
|
+
this._textFieldEl.errorValidationMessage ?? ""
|
|
48
|
+
);
|
|
49
|
+
} else {
|
|
50
|
+
this._clearErrorAnnouncement();
|
|
51
|
+
}
|
|
43
52
|
this.callActive ? this.$emit("end-call") : this.$emit("dial");
|
|
44
53
|
};
|
|
45
54
|
this.autofocus = false;
|
|
55
|
+
this._errorAnnouncement = "";
|
|
56
|
+
/**
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
this._forceAnnouncementToggle = false;
|
|
46
60
|
}
|
|
47
61
|
valueChanged(_oldValue, newValue) {
|
|
48
62
|
if (newValue !== void 0 && newValue !== null && this._textFieldEl && newValue !== this._textFieldEl.value) {
|
|
@@ -60,6 +74,27 @@ class DialPad extends localized.Localized(vividElement.VividElement) {
|
|
|
60
74
|
const firstFocusableEl = this._textFieldEl || digitBtns?.[0];
|
|
61
75
|
firstFocusableEl?.focus();
|
|
62
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* @internal
|
|
79
|
+
*/
|
|
80
|
+
_announceValidationError(message) {
|
|
81
|
+
this._errorAnnouncement = "";
|
|
82
|
+
window.queueMicrotask(() => {
|
|
83
|
+
if (message) {
|
|
84
|
+
this._forceAnnouncementToggle = !this._forceAnnouncementToggle;
|
|
85
|
+
this._errorAnnouncement = `${message}${this._forceAnnouncementToggle ? "" : ""}`;
|
|
86
|
+
} else {
|
|
87
|
+
this._clearErrorAnnouncement();
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* @internal
|
|
93
|
+
*/
|
|
94
|
+
_clearErrorAnnouncement() {
|
|
95
|
+
this._errorAnnouncement = "";
|
|
96
|
+
this._forceAnnouncementToggle = false;
|
|
97
|
+
}
|
|
63
98
|
}
|
|
64
99
|
__decorateClass([
|
|
65
100
|
fastElement.attr({ attribute: "helper-text" })
|
|
@@ -97,6 +132,9 @@ __decorateClass([
|
|
|
97
132
|
__decorateClass([
|
|
98
133
|
fastElement.attr({ mode: "boolean" })
|
|
99
134
|
], DialPad.prototype, "autofocus");
|
|
135
|
+
__decorateClass([
|
|
136
|
+
fastElement.observable
|
|
137
|
+
], DialPad.prototype, "_errorAnnouncement");
|
|
100
138
|
|
|
101
139
|
class DialPadButton {
|
|
102
140
|
constructor(value, label, ariaLabel, icon, id) {
|
|
@@ -240,14 +278,21 @@ function renderDialButton(buttonTag) {
|
|
|
240
278
|
label="${(x) => x.callActive ? x.endCallButtonLabel || x.locale.dialPad.endCallButtonLabel : x.callButtonLabel || x.locale.dialPad.callButtonLabel}">
|
|
241
279
|
</${buttonTag}>`;
|
|
242
280
|
}
|
|
281
|
+
function renderErrorAnnouncement(visuallyHiddenTag) {
|
|
282
|
+
return fastElement.html`<${visuallyHiddenTag} role="alert" aria-atomic="true">
|
|
283
|
+
${(x) => `${x.locale.dialPad.errorLabel} ${x._errorAnnouncement}`}
|
|
284
|
+
</${visuallyHiddenTag}>`;
|
|
285
|
+
}
|
|
243
286
|
const DialPadTemplate = (context) => {
|
|
244
287
|
const buttonTag = context.tagFor(button_definition.Button);
|
|
245
288
|
const iconTag = context.tagFor(icon_definition.VwcIconElement);
|
|
246
289
|
const textFieldTag = context.tagFor(textField_definition.VwcTextFieldElement);
|
|
290
|
+
const visuallyHiddenTag = context.tagFor(visuallyHidden_definition.VwcVisuallyHiddenElement);
|
|
247
291
|
return fastElement.html` <div class="${getClasses}">
|
|
248
292
|
${fastElement.when((x) => !x.noInput, renderTextField(textFieldTag, buttonTag))}
|
|
249
293
|
<div class="digits">${renderDigits(buttonTag, iconTag)}</div>
|
|
250
294
|
${fastElement.when((x) => !x.noCall, renderDialButton(buttonTag))}
|
|
295
|
+
${renderErrorAnnouncement(visuallyHiddenTag)}
|
|
251
296
|
</div>`;
|
|
252
297
|
};
|
|
253
298
|
|
|
@@ -255,7 +300,12 @@ const dialPadDefinition = vividElement.defineVividComponent(
|
|
|
255
300
|
"dial-pad",
|
|
256
301
|
DialPad,
|
|
257
302
|
DialPadTemplate,
|
|
258
|
-
[
|
|
303
|
+
[
|
|
304
|
+
button_definition.buttonDefinition,
|
|
305
|
+
textField_definition.textFieldDefinition,
|
|
306
|
+
icon_definition.iconDefinition,
|
|
307
|
+
visuallyHidden_definition.visuallyHiddenDefinition
|
|
308
|
+
],
|
|
259
309
|
{
|
|
260
310
|
styles
|
|
261
311
|
}
|