@vonage/vivid 4.6.0 → 4.7.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/custom-elements.json +0 -36
- package/lib/dialog/dialog.d.ts +0 -1
- package/lib/searchable-select/locale.d.ts +3 -0
- package/locales/de-DE.cjs +12 -0
- package/locales/de-DE.js +12 -0
- package/locales/en-GB.cjs +12 -0
- package/locales/en-GB.js +12 -0
- package/locales/en-US.cjs +12 -0
- package/locales/en-US.js +12 -0
- package/locales/ja-JP.cjs +12 -0
- package/locales/ja-JP.js +12 -0
- package/locales/zh-CN.cjs +12 -0
- package/locales/zh-CN.js +12 -0
- package/package.json +1 -1
- package/shared/definition21.cjs +1 -18
- package/shared/definition21.js +1 -18
- package/shared/definition43.cjs +54 -31
- package/shared/definition43.js +54 -31
- 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/shared/dialog-polyfill.esm.cjs +0 -862
- package/shared/dialog-polyfill.esm.js +0 -858
package/shared/definition43.js
CHANGED
|
@@ -18,9 +18,9 @@ import { r as repeat } from './repeat.js';
|
|
|
18
18
|
import { c as classNames } from './class-names.js';
|
|
19
19
|
import { I as Icon } from './icon.js';
|
|
20
20
|
|
|
21
|
-
const styles = ".chevron{display:flex;flex-shrink:0;font:var(--vvd-typography-base-extended);transform:rotate(0);transition:transform .2s}:host([aria-expanded=true]) .chevron,:host([open]) .chevron{transform:rotate(180deg)}:host(:focus-visible){outline:none}:host{display:inline-block;inline-size:300px;--_low-ink-color: var(--vvd-color-neutral-600)}:host([disabled]){--_low-ink-color: var(--vvd-color-neutral-400);cursor:not-allowed}.control-wrapper{display:flex;flex-direction:column;gap:4px}.label{color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base)}.fieldset{--_connotation-color-primary: var(--vvd-searchable-select-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-searchable-select-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-searchable-select-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-intermediate: var(--vvd-searchable-select-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-faint: var(--vvd-searchable-select-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-searchable-select-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-firm: var(--vvd-searchable-select-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-fierce: var(--vvd-searchable-select-accent-fierce, var(--vvd-color-neutral-700))}.fieldset{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.fieldset.appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset:where(.hover,: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(--_connotation-color-fierce)}.fieldset:where(.hover,: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}.fieldset:where(.disabled,: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)}.fieldset:where(.disabled,:disabled).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset:where(.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)}.fieldset:where(.readonly):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-600);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset:where(.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)}.fieldset:where(.error):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: transparent}.fieldset:where(.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)}.fieldset:where(.success):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: transparent}.fieldset{display:flex;align-items:center;justify-content:space-between;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--_appearance-color-text);font:var(--vvd-typography-base);gap:8px;padding-block:8px;padding-inline:16px;transition:box-shadow .2s,background-color .2s}.fieldset:focus-within{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent}:host(:not([shape=pill])) .fieldset{border-radius:8px}:host([shape=pill]) .fieldset{border-radius:24px}.popup-wrapper{position:relative}.content-area{display:flex;overflow:hidden;flex:1;flex-direction:column;gap:8px;min-block-size:24px}.tag-row{display:flex;gap:8px;inline-size:100%}.tag-row.contains-only-input:not(:focus-within){display:contents}.tag-wrapper{overflow:hidden}.tag{max-inline-size:100%}input{box-sizing:border-box;flex:1;border:none;background:none;block-size:24px;font:var(--vvd-typography-base);max-inline-size:100%;min-inline-size:100px;outline:none}.contains-only-input input:not(:focus){position:absolute;block-size:0;inline-size:0;min-inline-size:0;opacity:0;pointer-events:none}.listbox{display:flex;flex-direction:column;padding:4px;gap:2px;max-block-size:var(--searchable-select-height, 408px);overflow-y:auto}.empty-message{display:flex;align-items:center;justify-content:center;color:var(--vvd-color-neutral-300);min-block-size:40px;text-align:center}::part(popup-base){inline-size:max-content;min-inline-size:100%}slot[name=icon]{font-size:20px}";
|
|
21
|
+
const styles = ".chevron{display:flex;flex-shrink:0;font:var(--vvd-typography-base-extended);transform:rotate(0);transition:transform .2s}:host([aria-expanded=true]) .chevron,:host([open]) .chevron{transform:rotate(180deg)}:host(:focus-visible){outline:none}:host{display:inline-block;inline-size:300px;--_low-ink-color: var(--vvd-color-neutral-600)}:host([disabled]){--_low-ink-color: var(--vvd-color-neutral-400);cursor:not-allowed}.control-wrapper{display:flex;flex-direction:column;gap:4px}.label{color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base)}.fieldset{--_connotation-color-primary: var(--vvd-searchable-select-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-searchable-select-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-searchable-select-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-intermediate: var(--vvd-searchable-select-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-faint: var(--vvd-searchable-select-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-searchable-select-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-firm: var(--vvd-searchable-select-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-fierce: var(--vvd-searchable-select-accent-fierce, var(--vvd-color-neutral-700))}.fieldset{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.fieldset.appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset:where(.hover,: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(--_connotation-color-fierce)}.fieldset:where(.hover,: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}.fieldset:where(.disabled,: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)}.fieldset:where(.disabled,:disabled).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset:where(.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)}.fieldset:where(.readonly):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-600);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset:where(.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)}.fieldset:where(.error):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: transparent}.fieldset:where(.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)}.fieldset:where(.success):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: transparent}.fieldset{display:flex;align-items:center;justify-content:space-between;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--_appearance-color-text);font:var(--vvd-typography-base);gap:8px;padding-block:8px;padding-inline:16px;transition:box-shadow .2s,background-color .2s}.fieldset:focus-within{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent}:host(:not([shape=pill])) .fieldset{border-radius:8px}:host([shape=pill]) .fieldset{border-radius:24px}.popup-wrapper{position:relative}.content-area{display:flex;overflow:hidden;flex:1;flex-direction:column;gap:8px;min-block-size:24px}.tag-row{display:flex;gap:8px;inline-size:100%}.tag-row.contains-only-input:not(:focus-within){display:contents}.tag-wrapper{overflow:hidden}.tag{max-inline-size:100%}input{box-sizing:border-box;flex:1;border:none;background:none;block-size:24px;font:var(--vvd-typography-base);max-inline-size:100%;min-inline-size:100px;outline:none}.contains-only-input input:not(:focus){position:absolute;block-size:0;inline-size:0;min-inline-size:0;opacity:0;pointer-events:none}.listbox{display:flex;flex-direction:column;padding:4px;gap:2px;max-block-size:var(--searchable-select-height, 408px);overflow-y:auto}.empty-message{display:flex;align-items:center;justify-content:center;color:var(--vvd-color-neutral-300);min-block-size:40px;text-align:center}::part(popup-base){inline-size:max-content;min-inline-size:100%}slot[name=icon]{font-size:20px}.visually-hidden{position:absolute;overflow:hidden;width:1px;height:1px;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}";
|
|
22
22
|
|
|
23
|
-
const optionTagStyles = ".base{--_connotation-color-contrast: var(--vvd-option-tag-accent-contrast, var(--vvd-color-neutral-800))
|
|
23
|
+
const optionTagStyles = ".base{--_connotation-color-contrast: var(--vvd-option-tag-accent-contrast, var(--vvd-color-neutral-800))}.base{position:relative;display:inline-flex;box-sizing:border-box;align-items:center;background-color:var(--fill-color);block-size:calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)));box-shadow:inset 0 0 0 1px var(--outline-color);color:var(--text-color);column-gap:8px;font:var(--vvd-typography-base-bold);max-inline-size:100%;padding-inline:8px;user-select:none;vertical-align:middle}.base:not(.disabled){--text-color: var(--_connotation-color-contrast);--fill-color: color-mix( in srgb, var(--_connotation-color-contrast), transparent 87.5% );--outline-color: transparent}.base.disabled{--text-color: var(--vvd-color-neutral-300);--fill-color: color-mix( in srgb, var(--vvd-color-neutral-800), transparent 87.5% );--outline-color: transparent}.base:not(.shape-pill){border-radius:4px}.base.shape-pill{border-radius:16px}.label{overflow:hidden;max-inline-size:100%;text-overflow:ellipsis;white-space:nowrap}slot[name=icon]{font-size:calc(calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2))) / 1.5);line-height:1}.icon-placeholder{inline-size:calc(calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2))) / 1.5)}.remove-button{display:flex;align-items:center;border-radius:inherit;cursor:pointer;outline:none}.disabled .remove-button{pointer-events:none}.remove-button:focus-visible:before{--focus-stroke-gap-color: transparent;box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));position:absolute;z-index:1;display:block;border-radius:inherit;content:\"\";inset:0;pointer-events:none}";
|
|
24
24
|
|
|
25
25
|
class _SearchableSelect extends FoundationElement {
|
|
26
26
|
}
|
|
@@ -87,13 +87,8 @@ let SearchableSelect = class extends FormAssociatedSearchableSelect {
|
|
|
87
87
|
this._filteredOptions = [];
|
|
88
88
|
this._filteredEnabledOptions = [];
|
|
89
89
|
__privateAdd(this, _suppressFilter, false);
|
|
90
|
-
// --- Highlighted option (visual focus) ---
|
|
91
|
-
/**
|
|
92
|
-
* Currently visually highlighted option as an index into _filteredEnabledOptions
|
|
93
|
-
* @internal
|
|
94
|
-
*/
|
|
95
90
|
this._highlightedOptionIndex = null;
|
|
96
|
-
this.
|
|
91
|
+
this._numElidedTags = 0;
|
|
97
92
|
this._tagRows = [];
|
|
98
93
|
this._lastTagRow = [];
|
|
99
94
|
this.clearable = false;
|
|
@@ -103,11 +98,20 @@ let SearchableSelect = class extends FormAssociatedSearchableSelect {
|
|
|
103
98
|
}
|
|
104
99
|
super.setFormValue(value, state);
|
|
105
100
|
};
|
|
101
|
+
this._changeDescription = "";
|
|
106
102
|
// --- Core ---
|
|
107
103
|
__privateAdd(this, _resizeObserver, new ResizeObserver(() => {
|
|
108
104
|
__privateMethod(this, _SearchableSelect_instances, updateTagLayout_fn).call(this);
|
|
109
105
|
}));
|
|
110
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* @internal
|
|
109
|
+
*/
|
|
110
|
+
openChanged() {
|
|
111
|
+
if (!this.open) {
|
|
112
|
+
__privateMethod(this, _SearchableSelect_instances, transitionHighlightedOptionTo_fn).call(this, null);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
111
115
|
/**
|
|
112
116
|
* @internal
|
|
113
117
|
*/
|
|
@@ -217,6 +221,7 @@ let SearchableSelect = class extends FormAssociatedSearchableSelect {
|
|
|
217
221
|
this._inputValue = __privateMethod(this, _SearchableSelect_instances, textForValue_fn).call(this, this.values[0]);
|
|
218
222
|
}
|
|
219
223
|
}
|
|
224
|
+
this._changeDescription = "";
|
|
220
225
|
}
|
|
221
226
|
/**
|
|
222
227
|
* @internal
|
|
@@ -480,22 +485,24 @@ updateSelectedOnSlottedOptions_fn = function() {
|
|
|
480
485
|
handleOptionInteraction_fn = function(option) {
|
|
481
486
|
const value = option.value;
|
|
482
487
|
let newValues;
|
|
488
|
+
const isSelection = !this.values.includes(value);
|
|
483
489
|
if (this.multiple) {
|
|
484
|
-
if (
|
|
490
|
+
if (isSelection) {
|
|
485
491
|
newValues = [...this.values, value];
|
|
486
492
|
} else {
|
|
487
493
|
newValues = this.values.filter((option2) => option2 !== value);
|
|
488
494
|
}
|
|
489
495
|
this._inputValue = "";
|
|
490
496
|
} else {
|
|
491
|
-
if (
|
|
492
|
-
newValues = [];
|
|
493
|
-
} else {
|
|
497
|
+
if (isSelection) {
|
|
494
498
|
newValues = [value];
|
|
495
499
|
this._inputValue = option.text;
|
|
500
|
+
} else {
|
|
501
|
+
newValues = [];
|
|
496
502
|
}
|
|
497
503
|
this.open = false;
|
|
498
504
|
}
|
|
505
|
+
this._changeDescription = isSelection ? this.locale.searchableSelect.optionSelectedMessage(option.text) : this.locale.searchableSelect.optionDeselectedMessage(option.text);
|
|
499
506
|
__privateMethod(this, _SearchableSelect_instances, updateValuesThroughUserInteraction_fn).call(this, newValues);
|
|
500
507
|
};
|
|
501
508
|
_clonedTagIcons = new WeakMap();
|
|
@@ -561,6 +568,11 @@ transitionHighlightedOptionTo_fn = function(index) {
|
|
|
561
568
|
const highlightedOption = this._filteredEnabledOptions[this._highlightedOptionIndex];
|
|
562
569
|
highlightedOption._highlighted = true;
|
|
563
570
|
scrollIntoView(highlightedOption, this._listbox, "nearest");
|
|
571
|
+
this._changeDescription = this.locale.searchableSelect.optionFocusedMessage(
|
|
572
|
+
highlightedOption.text,
|
|
573
|
+
this._highlightedOptionIndex + 1,
|
|
574
|
+
this._filteredEnabledOptions.length
|
|
575
|
+
);
|
|
564
576
|
}
|
|
565
577
|
};
|
|
566
578
|
selectHighlightedOption_fn = function() {
|
|
@@ -609,13 +621,13 @@ measureTagWidth_fn = function(label, removable, hasIcon) {
|
|
|
609
621
|
};
|
|
610
622
|
updateTagLayout_fn = function() {
|
|
611
623
|
if (!this.multiple) {
|
|
612
|
-
this.
|
|
624
|
+
this._numElidedTags = 0;
|
|
613
625
|
this._tagRows = [];
|
|
614
626
|
this._lastTagRow = [];
|
|
615
627
|
return;
|
|
616
628
|
}
|
|
617
629
|
if (this.externalTags) {
|
|
618
|
-
this.
|
|
630
|
+
this._numElidedTags = this.values.length;
|
|
619
631
|
this._tagRows = [];
|
|
620
632
|
this._lastTagRow = [];
|
|
621
633
|
return;
|
|
@@ -659,12 +671,12 @@ updateTagLayout_fn = function() {
|
|
|
659
671
|
rows[currentRowIndex].unshift(entry);
|
|
660
672
|
currentRowWidth += TagGapPx + tagWidth;
|
|
661
673
|
}
|
|
662
|
-
this.
|
|
674
|
+
this._numElidedTags = i + 1;
|
|
663
675
|
rows.reverse();
|
|
664
676
|
for (let i2 = 0; i2 < rows.length - 1; i2++) {
|
|
665
677
|
let lineWidth = rows[i2].map((e) => e.width).reduce((a, b) => a + b, 0) + (rows[i2].length - 1) * TagGapPx;
|
|
666
|
-
if (i2 === 0 && this.
|
|
667
|
-
lineWidth += TagGapPx + __privateMethod(this, _SearchableSelect_instances, measureTagWidth_fn).call(this, this.
|
|
678
|
+
if (i2 === 0 && this._numElidedTags) {
|
|
679
|
+
lineWidth += TagGapPx + __privateMethod(this, _SearchableSelect_instances, measureTagWidth_fn).call(this, this._numElidedTags.toString(), false, false);
|
|
668
680
|
}
|
|
669
681
|
while (rows[i2 + 1].length && lineWidth + TagGapPx + rows[i2 + 1][0].width <= rowWidth) {
|
|
670
682
|
const nextTag = rows[i2 + 1].shift();
|
|
@@ -680,7 +692,7 @@ moveTagFocusTo_fn = function(index) {
|
|
|
680
692
|
if (index === null) {
|
|
681
693
|
this._input.focus();
|
|
682
694
|
} else {
|
|
683
|
-
this.shadowRoot.querySelector(`[data-index="${index}"]`)
|
|
695
|
+
this.shadowRoot.querySelector(`[data-index="${index}"]`)?.focus();
|
|
684
696
|
}
|
|
685
697
|
};
|
|
686
698
|
nextTagIndexLeft_fn = function(index) {
|
|
@@ -769,12 +781,15 @@ __decorateClass$1([
|
|
|
769
781
|
__decorateClass$1([
|
|
770
782
|
observable
|
|
771
783
|
], SearchableSelect.prototype, "_filteredEnabledOptions", 2);
|
|
784
|
+
__decorateClass$1([
|
|
785
|
+
observable
|
|
786
|
+
], SearchableSelect.prototype, "_highlightedOptionIndex", 2);
|
|
772
787
|
__decorateClass$1([
|
|
773
788
|
observable
|
|
774
789
|
], SearchableSelect.prototype, "_contentArea", 2);
|
|
775
790
|
__decorateClass$1([
|
|
776
791
|
observable
|
|
777
|
-
], SearchableSelect.prototype, "
|
|
792
|
+
], SearchableSelect.prototype, "_numElidedTags", 2);
|
|
778
793
|
__decorateClass$1([
|
|
779
794
|
observable
|
|
780
795
|
], SearchableSelect.prototype, "_tagRows", 2);
|
|
@@ -787,6 +802,9 @@ __decorateClass$1([
|
|
|
787
802
|
__decorateClass$1([
|
|
788
803
|
attr({ mode: "boolean" })
|
|
789
804
|
], SearchableSelect.prototype, "clearable", 2);
|
|
805
|
+
__decorateClass$1([
|
|
806
|
+
observable
|
|
807
|
+
], SearchableSelect.prototype, "_changeDescription", 2);
|
|
790
808
|
__decorateClass$1([
|
|
791
809
|
observable
|
|
792
810
|
], SearchableSelect.prototype, "_anchor", 2);
|
|
@@ -873,13 +891,13 @@ const tagTemplateFactory = (context, getComponent) => {
|
|
|
873
891
|
</div>
|
|
874
892
|
`;
|
|
875
893
|
};
|
|
876
|
-
const
|
|
894
|
+
const elidedTagTemplateFactory = (context, getComponent) => {
|
|
877
895
|
const optionTagTag = context.tagFor(OptionTag);
|
|
878
896
|
return html`
|
|
879
897
|
<${optionTagTag}
|
|
880
898
|
class="tag"
|
|
881
899
|
tabindex="-1"
|
|
882
|
-
:label="${(x, c) => getComponent(x, c).
|
|
900
|
+
:label="${(x, c) => getComponent(x, c)._numElidedTags.toString()}"
|
|
883
901
|
:shape="${(x, c) => getComponent(x, c).shape}"
|
|
884
902
|
?disabled="${(x, c) => getComponent(x, c).disabled}"
|
|
885
903
|
@mousedown="${() => false}">
|
|
@@ -895,8 +913,8 @@ function renderFieldset(context) {
|
|
|
895
913
|
context,
|
|
896
914
|
(c) => c.parentContext.parent
|
|
897
915
|
);
|
|
898
|
-
const
|
|
899
|
-
const
|
|
916
|
+
const elidedTagTemplate = elidedTagTemplateFactory(context, (x, _) => x);
|
|
917
|
+
const nestedElidedTagTemplate = elidedTagTemplateFactory(
|
|
900
918
|
context,
|
|
901
919
|
(_, c) => c.parent
|
|
902
920
|
);
|
|
@@ -913,8 +931,8 @@ function renderFieldset(context) {
|
|
|
913
931
|
html`
|
|
914
932
|
<div class="tag-row">
|
|
915
933
|
${when(
|
|
916
|
-
(_, c) => c.isFirst && c.parent.
|
|
917
|
-
|
|
934
|
+
(_, c) => c.isFirst && c.parent._numElidedTags,
|
|
935
|
+
nestedElidedTagTemplate
|
|
918
936
|
)}
|
|
919
937
|
${repeat((x) => x, nestedTagTemplate)}
|
|
920
938
|
</div>
|
|
@@ -928,8 +946,8 @@ function renderFieldset(context) {
|
|
|
928
946
|
])}"
|
|
929
947
|
>
|
|
930
948
|
${when(
|
|
931
|
-
(x) => x._tagRows.length === 0 && x.
|
|
932
|
-
|
|
949
|
+
(x) => x._tagRows.length === 0 && x._numElidedTags,
|
|
950
|
+
elidedTagTemplate
|
|
933
951
|
)}
|
|
934
952
|
${repeat((x) => x._lastTagRow, tagTemplate)}
|
|
935
953
|
<input
|
|
@@ -937,10 +955,10 @@ function renderFieldset(context) {
|
|
|
937
955
|
class="control"
|
|
938
956
|
autofocus
|
|
939
957
|
autocomplete="off"
|
|
940
|
-
aria-autocomplete="
|
|
941
|
-
aria-
|
|
942
|
-
aria-expanded="${(x) => x.ariaExpanded}"
|
|
958
|
+
aria-autocomplete="list"
|
|
959
|
+
aria-expanded="${(x) => x.open}"
|
|
943
960
|
aria-haspopup="listbox"
|
|
961
|
+
aria-controls="listbox"
|
|
944
962
|
placeholder="${(x) => x.multiple && x.values.length ? "" : x.placeholder}"
|
|
945
963
|
role="combobox"
|
|
946
964
|
type="text"
|
|
@@ -965,7 +983,7 @@ function renderFieldset(context) {
|
|
|
965
983
|
:shape="${(x) => x.shape}"
|
|
966
984
|
size="super-condensed"
|
|
967
985
|
icon="close-line"
|
|
968
|
-
|
|
986
|
+
appearance="ghost-light"
|
|
969
987
|
tabindex="-1"
|
|
970
988
|
></${buttonTag}>`
|
|
971
989
|
)}
|
|
@@ -977,6 +995,9 @@ function renderControl(context) {
|
|
|
977
995
|
const popupTag = context.tagFor(Popup);
|
|
978
996
|
return html`
|
|
979
997
|
${when((x) => x.label, renderLabel())}
|
|
998
|
+
<span aria-live="assertive" aria-relevant="text" class="visually-hidden">
|
|
999
|
+
${(x) => x._changeDescription}
|
|
1000
|
+
</span>
|
|
980
1001
|
<div>
|
|
981
1002
|
${renderFieldset(context)}
|
|
982
1003
|
<div class="popup-wrapper">
|
|
@@ -989,6 +1010,8 @@ function renderControl(context) {
|
|
|
989
1010
|
<div
|
|
990
1011
|
class="listbox"
|
|
991
1012
|
role="listbox"
|
|
1013
|
+
aria-multiselectable="${(x) => x.multiple}"
|
|
1014
|
+
aria-required="${(x) => x.required}"
|
|
992
1015
|
${ref("_listbox")}
|
|
993
1016
|
@click="${(x, c) => x._onListboxClick(c.event)}"
|
|
994
1017
|
@mousedown="${() => false}"
|
package/styles/core/all.css
CHANGED
package/styles/core/theme.css
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on
|
|
3
|
+
* Generated on Mon, 07 Oct 2024 13:48:37 GMT
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Do not edit directly
|
|
7
|
-
* Generated on
|
|
7
|
+
* Generated on Mon, 07 Oct 2024 13:48:37 GMT
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
10
|
* Do not edit directly
|
|
11
|
-
* Generated on
|
|
11
|
+
* Generated on Mon, 07 Oct 2024 13:48:37 GMT
|
|
12
12
|
*/
|
|
13
13
|
/**
|
|
14
14
|
* Do not edit directly
|
|
15
|
-
* Generated on
|
|
15
|
+
* Generated on Mon, 07 Oct 2024 13:48:37 GMT
|
|
16
16
|
*/
|
|
17
17
|
@property --vvd-size-density {
|
|
18
18
|
syntax: "<integer>";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on
|
|
3
|
+
* Generated on Mon, 07 Oct 2024 13:48:37 GMT
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Do not edit directly
|
|
7
|
-
* Generated on
|
|
7
|
+
* Generated on Mon, 07 Oct 2024 13:48:37 GMT
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
10
|
* Do not edit directly
|
|
11
|
-
* Generated on
|
|
11
|
+
* Generated on Mon, 07 Oct 2024 13:48:37 GMT
|
|
12
12
|
*/
|
|
13
13
|
/**
|
|
14
14
|
* Do not edit directly
|
|
15
|
-
* Generated on
|
|
15
|
+
* Generated on Mon, 07 Oct 2024 13:48:37 GMT
|
|
16
16
|
*/
|
|
17
17
|
@property --vvd-size-density {
|
|
18
18
|
syntax: "<integer>";
|