@vonage/vivid 5.3.0 → 5.4.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/accordion-item/definition.js +1 -1
- package/alert/definition.cjs +1 -1
- package/alert/definition.js +2 -2
- package/badge/definition.js +1 -1
- package/banner/definition.js +1 -1
- package/bundled/calendar-picker.template.cjs +7 -7
- package/bundled/calendar-picker.template.js +101 -101
- package/bundled/definition11.cjs +13 -13
- package/bundled/definition11.js +202 -50
- package/bundled/definition19.cjs +24 -25
- package/bundled/definition19.js +152 -164
- package/bundled/definition6.cjs +3 -3
- package/bundled/definition6.js +19 -19
- package/bundled/definition9.cjs +5 -5
- package/bundled/definition9.js +394 -392
- package/bundled/listbox.cjs +1 -1
- package/bundled/listbox.js +82 -102
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +18 -14
- package/bundled/vivid-element.cjs +5 -1
- package/bundled/vivid-element.js +401 -358
- package/calendar/index.cjs +1 -1
- package/calendar/index.js +14 -14
- package/card/definition.cjs +1 -1
- package/card/definition.js +1 -1
- package/color-picker/definition.cjs +1 -1
- package/color-picker/definition.js +1 -1
- package/combobox/definition.cjs +7 -27
- package/combobox/definition.js +8 -28
- package/combobox/index.cjs +6 -6
- package/combobox/index.js +57 -71
- package/custom-elements.json +305 -2
- package/date-picker/definition.cjs +1 -1
- package/date-picker/definition.js +1 -1
- package/date-range-picker/definition.cjs +1 -1
- package/date-range-picker/definition.js +1 -1
- package/date-time-picker/definition.cjs +1 -1
- package/date-time-picker/definition.js +1 -1
- package/dialog/definition.cjs +2 -2
- package/dialog/definition.js +2 -2
- package/dialog/index.cjs +7 -7
- package/dialog/index.js +6 -6
- package/elevation/definition.cjs +1 -1
- package/elevation/definition.js +1 -1
- package/fab/definition.js +1 -1
- package/header/definition.cjs +1 -1
- package/header/definition.js +1 -1
- package/index.cjs +3 -4
- package/index.js +2 -3
- package/lib/accordion/accordion.d.ts +1 -1
- package/lib/accordion/definition.d.ts +1 -1
- package/lib/audio-player/audio-player.d.ts +1 -1
- package/lib/combobox/combobox.d.ts +1 -0
- package/lib/combobox/combobox.options.d.ts +1 -1
- package/lib/divider/divider.d.ts +1 -1
- package/lib/menu-item/menu-item-role.d.ts +1 -1
- package/lib/popup/popup.d.ts +1 -1
- package/lib/searchable-select/locale.d.ts +4 -0
- package/lib/searchable-select/searchable-select.d.ts +3 -0
- package/lib/select/select.d.ts +3 -1
- package/lib/slider/slider.d.ts +1 -1
- package/lib/tabs/tabs.d.ts +2 -2
- package/lib/text-area/text-area.d.ts +1 -1
- package/lib/text-field/text-field.d.ts +1 -1
- package/locales/de-DE.cjs +4 -0
- package/locales/de-DE.js +4 -0
- package/locales/en-GB.cjs +4 -0
- package/locales/en-GB.js +4 -0
- package/locales/en-US.cjs +4 -0
- package/locales/en-US.js +4 -0
- package/locales/ja-JP.cjs +4 -0
- package/locales/ja-JP.js +4 -0
- package/locales/zh-CN.cjs +4 -0
- package/locales/zh-CN.js +4 -0
- package/menu/definition.cjs +4 -4
- package/menu/definition.js +4 -4
- package/nav-disclosure/definition.js +1 -1
- package/nav-item/definition.js +1 -1
- package/note/definition.js +1 -1
- package/number-field/definition.js +1 -1
- package/option/definition.cjs +6 -77
- package/option/definition.js +3 -78
- package/package.json +31 -5
- package/popup/definition.cjs +2 -2
- package/popup/definition.js +2 -2
- package/range-slider/definition.cjs +1 -1
- package/range-slider/definition.js +1 -1
- package/rich-text-editor/definition.cjs +2 -3
- package/rich-text-editor/definition.js +1 -2
- package/rich-text-editor/index.cjs +27 -27
- package/rich-text-editor/index.js +1208 -1198
- package/searchable-select/definition.cjs +103 -11
- package/searchable-select/definition.js +103 -11
- package/searchable-select/index.cjs +81 -69
- package/searchable-select/index.js +359 -273
- package/select/definition.cjs +24 -41
- package/select/definition.js +24 -41
- package/selectable-box/definition.cjs +1 -1
- package/selectable-box/definition.js +1 -1
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +1 -1
- package/shared/aria/aria-mixin.d.ts +1 -1
- package/shared/foundation/listbox/listbox.d.ts +4 -0
- package/simple-color-picker/definition.cjs +1 -1
- package/simple-color-picker/definition.js +1 -1
- package/slider/definition.cjs +1 -1
- package/slider/definition.js +1 -1
- package/split-button/definition.js +1 -1
- 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/tab/definition.js +1 -1
- package/tag/definition.js +1 -1
- package/text-field/definition.js +1 -1
- package/time-picker/definition.cjs +1 -1
- package/time-picker/definition.js +1 -1
- package/toggletip/definition.cjs +1 -1
- package/toggletip/definition.js +1 -1
- package/tooltip/definition.cjs +1 -1
- package/tooltip/definition.js +1 -1
- package/tree-item/definition.cjs +1 -1
- package/tree-item/definition.js +1 -1
- package/tree-view/definition.cjs +1 -1
- package/tree-view/definition.js +1 -1
- package/unbundled/affix.js +1 -1
- package/unbundled/calendar-picker.template.cjs +1 -1
- package/unbundled/calendar-picker.template.js +1 -1
- package/unbundled/definition.js +1 -1
- package/unbundled/definition2.js +1 -1
- package/unbundled/definition3.cjs +222 -141
- package/unbundled/definition3.js +220 -139
- package/unbundled/definition4.cjs +145 -235
- package/unbundled/definition4.js +143 -233
- package/unbundled/definition5.cjs +269 -27
- package/unbundled/definition5.js +267 -26
- package/unbundled/definition6.cjs +56 -0
- package/unbundled/definition6.js +52 -0
- package/unbundled/listbox.cjs +41 -63
- package/unbundled/listbox.js +39 -61
- package/unbundled/picker-field.template.cjs +1 -1
- package/unbundled/picker-field.template.js +1 -1
- package/unbundled/slider.template.cjs +1 -1
- package/unbundled/slider.template.js +1 -1
- package/unbundled/vivid-element.cjs +1 -1
- package/unbundled/vivid-element.js +1 -1
- package/video-player/definition.cjs +56 -16
- package/video-player/definition.js +56 -16
- package/video-player/index.cjs +36 -36
- package/video-player/index.js +2461 -2445
- package/vivid.api.json +285 -38
- package/bundled/option.cjs +0 -1
- package/bundled/option.js +0 -158
- package/unbundled/option.cjs +0 -217
- package/unbundled/option.js +0 -214
|
@@ -1,38 +1,40 @@
|
|
|
1
|
-
import { B as
|
|
2
|
-
import { P as L, p as
|
|
1
|
+
import { B as R, c as z, b as E } from "../bundled/definition3.js";
|
|
2
|
+
import { P as L, p as P } from "../bundled/definition9.js";
|
|
3
3
|
import { I as M, i as I } from "../bundled/definition2.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { W as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
4
|
+
import { i as B, L as W, l as N } from "../bundled/definition11.js";
|
|
5
|
+
import { P as H, p as K } from "../bundled/definition15.js";
|
|
6
|
+
import { V as F, O, U as j, a as u, n as A, o as p, h as d, c as q, d as D } from "../bundled/vivid-element.js";
|
|
7
|
+
import { W as U, f as G } from "../bundled/mixins.js";
|
|
8
|
+
import { d as J } from "../bundled/definition14.js";
|
|
9
|
+
import { s as Q } from "../bundled/scrollIntoView.js";
|
|
10
|
+
import { D as X, d as Y } from "../bundled/delegates-aria.js";
|
|
11
|
+
import { F as Z } from "../bundled/form-associated.js";
|
|
12
|
+
import { W as ee } from "../bundled/with-contextual-help.js";
|
|
13
|
+
import { W as te } from "../bundled/with-error-text.js";
|
|
14
|
+
import { W as ae } from "../bundled/with-success-text.js";
|
|
15
|
+
import { F as oe } from "../bundled/form-element.js";
|
|
16
|
+
import { A as le, a as se, I as ie } from "../bundled/affix.js";
|
|
15
17
|
import { L as V } from "../bundled/localized.js";
|
|
16
|
-
import {
|
|
18
|
+
import { D as ne } from "../bundled/divider.js";
|
|
17
19
|
import { w as v } from "../bundled/when.js";
|
|
18
|
-
import { s as
|
|
20
|
+
import { s as T } from "../bundled/slotted.js";
|
|
19
21
|
import { r as x } from "../bundled/ref.js";
|
|
20
|
-
import { r as
|
|
21
|
-
import { c as
|
|
22
|
-
const ie = ".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(: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)}.selection-count{color:var(--_low-ink-color);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(--vvd-color-neutral-500)}.fieldset.appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}@media (hover: hover){.fieldset: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)}.fieldset: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.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)}.fieldset.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: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:disabled.appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset.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.disabled.appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset.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.readonly:where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-600);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset.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.error:where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: transparent}.fieldset.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.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}@supports selector(:has(*)){.fieldset:not(.has-highlighted-option):has(input:focus){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}}@supports not selector(:has(*)){.fieldset:not(.has-highlighted-option):focus-within{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}}: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:min(100px,40%);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);font:var(--vvd-typography-base);min-block-size:40px;text-align:center}::part(popup-base){inline-size:max-content;min-inline-size:var(--_searchable-select-fixed-width, 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}::slotted([data-vvd-component=option][data-highlighted]){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-wrapper{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:var(--label-wrapper-gap, 8px)}.label-wrapper[hidden]{display:none}.label-wrapper .label{flex:1 1 auto}.label-wrapper slot[name=contextual-help]::slotted([data-vvd-component=contextual-help]){margin-inline-start:auto}", se = '.base.connotation-cta{--_connotation-color-contrast: var(--vvd-option-tag-cta-contrast, var(--vvd-color-cta-800))}.base:not(.connotation-cta){--_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: var(--_connotation-color-soft);--outline-color: transparent}@supports (background-color: color-mix(in srgb,black 50%,white)){.base:not(.disabled){--fill-color: color-mix( in srgb, var(--_connotation-color-contrast), transparent 87.5% )}}.base.disabled{--text-color: var(--vvd-color-neutral-300);--fill-color: var(--vvd-color-neutral-200);--outline-color: transparent}@supports (background-color: color-mix(in srgb,black 50%,white)){.base.disabled{--fill-color: color-mix( in srgb, var(--vvd-color-neutral-800), transparent 87.5% )}}.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: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));position:absolute;z-index:1;display:block;border-radius:inherit;content:"";inset:0;pointer-events:none}';
|
|
23
|
-
var
|
|
24
|
-
for (var
|
|
25
|
-
(g = s[
|
|
26
|
-
return
|
|
22
|
+
import { r as y } from "../bundled/repeat.js";
|
|
23
|
+
import { c as w } from "../bundled/class-names.js";
|
|
24
|
+
const re = ".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(: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)}.selection-count{color:var(--_low-ink-color);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(--vvd-color-neutral-500)}.fieldset.appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}@media (hover: hover){.fieldset: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)}.fieldset: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.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)}.fieldset.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: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:disabled.appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset.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.disabled.appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset.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.readonly:where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-600);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset.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.error:where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: transparent}.fieldset.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.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}@supports selector(:has(*)){.fieldset:not(.has-highlighted-option):has(input:focus){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}}@supports not selector(:has(*)){.fieldset:not(.has-highlighted-option):focus-within{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}}: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:min(100px,40%);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);font:var(--vvd-typography-base);min-block-size:40px;text-align:center}::part(popup-base){inline-size:max-content;min-inline-size:var(--_searchable-select-fixed-width, 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}::slotted([data-vvd-component=option][data-highlighted]),[data-select-all][data-highlighted]{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}.divider{margin-block:10px;margin-inline:12px}.label-wrapper{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:var(--label-wrapper-gap, 8px)}.label-wrapper[hidden]{display:none}.label-wrapper .label{flex:1 1 auto}.label-wrapper slot[name=contextual-help]::slotted([data-vvd-component=contextual-help]){margin-inline-start:auto}", ce = '.base.connotation-cta{--_connotation-color-contrast: var(--vvd-option-tag-cta-contrast, var(--vvd-color-cta-800))}.base:not(.connotation-cta){--_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: var(--_connotation-color-soft);--outline-color: transparent}@supports (background-color: color-mix(in srgb,black 50%,white)){.base:not(.disabled){--fill-color: color-mix( in srgb, var(--_connotation-color-contrast), transparent 87.5% )}}.base.disabled{--text-color: var(--vvd-color-neutral-300);--fill-color: var(--vvd-color-neutral-200);--outline-color: transparent}@supports (background-color: color-mix(in srgb,black 50%,white)){.base.disabled{--fill-color: color-mix( in srgb, var(--vvd-color-neutral-800), transparent 87.5% )}}.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: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));position:absolute;z-index:1;display:block;border-radius:inherit;content:"";inset:0;pointer-events:none}';
|
|
25
|
+
var de = Object.defineProperty, r = (s, t, e, o) => {
|
|
26
|
+
for (var a = void 0, i = s.length - 1, g; i >= 0; i--)
|
|
27
|
+
(g = s[i]) && (a = g(t, e, a) || a);
|
|
28
|
+
return a && de(t, e, a), a;
|
|
27
29
|
};
|
|
28
|
-
const
|
|
29
|
-
class n extends
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
const _ = 8, pe = 100, S = 10, he = (s) => typeof s == "string";
|
|
31
|
+
class n extends ee(
|
|
32
|
+
U(
|
|
33
|
+
te(
|
|
34
|
+
ae(
|
|
35
|
+
oe(
|
|
36
|
+
X(
|
|
37
|
+
le(V(Z(F)))
|
|
36
38
|
)
|
|
37
39
|
)
|
|
38
40
|
)
|
|
@@ -42,11 +44,11 @@ class n extends Q(
|
|
|
42
44
|
constructor() {
|
|
43
45
|
super(...arguments), this.fixedDropdown = !1, this.open = !1, this.multiple = !1, this.externalTags = !1, this.maxLines = null, this.values = [], this.initialValues = [], this._currentSearchText = null, this._areOptionsInitialized = !1, this.#s = {
|
|
44
46
|
handleChange: (t, e) => {
|
|
45
|
-
t.selected && !this.values.includes(t.value) ? this.values = [...this.values, t.value] : !t.selected && this.values.includes(t.value) && (this.values = this.values.filter((
|
|
47
|
+
t.selected && !this.values.includes(t.value) ? this.values = [...this.values, t.value] : !t.selected && this.values.includes(t.value) && (this.values = this.values.filter((o) => o !== t.value));
|
|
46
48
|
}
|
|
47
|
-
}, this.#
|
|
48
|
-
|
|
49
|
-
}, this._changeDescription = "", this.#
|
|
49
|
+
}, this.#a = /* @__PURE__ */ new Map(), this._filteredOptions = [], this._filteredEnabledOptions = [], this.loading = !1, this._highlightedOptionIndex = null, this._numElidedTags = 0, this._tagRows = [], this._lastTagRow = [], this.clearable = !1, this.maxSelected = null, this._slottedDisabledOptions = [], this.enableSelectAll = !1, this.proxy = document.createElement("input"), this.setFormValue = (t, e) => {
|
|
50
|
+
he(t) || super.setFormValue(t, e);
|
|
51
|
+
}, this._changeDescription = "", this.#d = new ResizeObserver(() => {
|
|
50
52
|
this.#u();
|
|
51
53
|
});
|
|
52
54
|
}
|
|
@@ -65,14 +67,14 @@ class n extends Q(
|
|
|
65
67
|
this.values = [this.values[0]];
|
|
66
68
|
return;
|
|
67
69
|
}
|
|
68
|
-
if (this.values.some((t) => !this.#
|
|
69
|
-
this.values = this.values.filter((t) => this.#
|
|
70
|
+
if (this.values.some((t) => !this.#p(t))) {
|
|
71
|
+
this.values = this.values.filter((t) => this.#p(t));
|
|
70
72
|
return;
|
|
71
73
|
}
|
|
72
|
-
this.value = this.values.length ? this.values[0] : "", this.#c(), this.#
|
|
74
|
+
this.value = this.values.length ? this.values[0] : "", this.#c(), this.#_(), this.$fastController.isConnected && this.#u(), this.#g();
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
|
-
#
|
|
77
|
+
#t(t) {
|
|
76
78
|
this.values = t, this.$emit("change", void 0, {
|
|
77
79
|
bubbles: !1
|
|
78
80
|
}), this.$emit("input", void 0, {
|
|
@@ -80,8 +82,8 @@ class n extends Q(
|
|
|
80
82
|
});
|
|
81
83
|
}
|
|
82
84
|
#b(t) {
|
|
83
|
-
const e = new Set(this.values),
|
|
84
|
-
this.values = [...this.values].filter((
|
|
85
|
+
const e = new Set(this.values), o = new Set(t);
|
|
86
|
+
this.values = [...this.values].filter((a) => o.has(a)).concat([...t].filter((a) => !e.has(a)));
|
|
85
87
|
}
|
|
86
88
|
/**
|
|
87
89
|
* @internal
|
|
@@ -89,7 +91,7 @@ class n extends Q(
|
|
|
89
91
|
initialValuesChanged() {
|
|
90
92
|
this.dirtyValue || (this.values = this.initialValues, this.dirtyValue = !1);
|
|
91
93
|
}
|
|
92
|
-
#
|
|
94
|
+
#p(t) {
|
|
93
95
|
return this._slottedOptions.some((e) => e.value === t);
|
|
94
96
|
}
|
|
95
97
|
/**
|
|
@@ -98,10 +100,10 @@ class n extends Q(
|
|
|
98
100
|
valueChanged(t, e) {
|
|
99
101
|
if (super.valueChanged(t, e), !this._areOptionsInitialized)
|
|
100
102
|
return;
|
|
101
|
-
const
|
|
102
|
-
(
|
|
103
|
+
const o = this._slottedOptions.some(
|
|
104
|
+
(a) => a.value === e
|
|
103
105
|
);
|
|
104
|
-
this.values[0] !== e && (this.values =
|
|
106
|
+
this.values[0] !== e && (this.values = o ? [e] : []);
|
|
105
107
|
}
|
|
106
108
|
get selectedIndex() {
|
|
107
109
|
return this.values.length ? this._slottedOptions.findIndex(
|
|
@@ -175,13 +177,13 @@ class n extends Q(
|
|
|
175
177
|
this.open = !0;
|
|
176
178
|
break;
|
|
177
179
|
}
|
|
178
|
-
return this.#
|
|
180
|
+
return this.#y(), !1;
|
|
179
181
|
case "End":
|
|
180
182
|
if (!this.open) {
|
|
181
183
|
this.open = !0;
|
|
182
184
|
break;
|
|
183
185
|
}
|
|
184
|
-
return this.#
|
|
186
|
+
return this.#w(), !1;
|
|
185
187
|
case "PageUp":
|
|
186
188
|
if (!this.open) {
|
|
187
189
|
this.open = !0;
|
|
@@ -193,13 +195,13 @@ class n extends Q(
|
|
|
193
195
|
this.open = !0;
|
|
194
196
|
break;
|
|
195
197
|
}
|
|
196
|
-
return this.#
|
|
198
|
+
return this.#O(), !1;
|
|
197
199
|
case "ArrowUp":
|
|
198
200
|
if (!this.open) {
|
|
199
201
|
this.open = !0;
|
|
200
202
|
break;
|
|
201
203
|
}
|
|
202
|
-
return this.#
|
|
204
|
+
return this.#T(), !1;
|
|
203
205
|
case "ArrowDown":
|
|
204
206
|
if (!this.open) {
|
|
205
207
|
this.open = !0;
|
|
@@ -207,7 +209,7 @@ class n extends Q(
|
|
|
207
209
|
}
|
|
208
210
|
return this.#S(), !1;
|
|
209
211
|
case "ArrowLeft":
|
|
210
|
-
return this.multiple && this._inputValue === "" && this.values.length && !this.externalTags ? (this.#
|
|
212
|
+
return this.multiple && this._inputValue === "" && this.values.length && !this.externalTags ? (this.#l(this.#r(this.values.length)), !1) : !0;
|
|
211
213
|
case "Backspace":
|
|
212
214
|
return this.multiple && this._inputValue === "" && this.values.length ? (this._onTagRemoved(this.values[this.values.length - 1]), !1) : !0;
|
|
213
215
|
default:
|
|
@@ -219,33 +221,33 @@ class n extends Q(
|
|
|
219
221
|
* @internal
|
|
220
222
|
*/
|
|
221
223
|
_slottedOptionsChanged(t, e) {
|
|
222
|
-
const
|
|
223
|
-
if (!e.length &&
|
|
224
|
+
const o = !!this.querySelectorAll(":not([slot])").length;
|
|
225
|
+
if (!e.length && o)
|
|
224
226
|
return;
|
|
225
227
|
if (this._areOptionsInitialized = !0, t) {
|
|
226
228
|
this._slottedDisabledOptions = [];
|
|
227
|
-
for (const
|
|
228
|
-
|
|
229
|
+
for (const i of t)
|
|
230
|
+
O.getNotifier(i).unsubscribe(this.#s, "selected");
|
|
229
231
|
}
|
|
230
232
|
if (e)
|
|
231
|
-
for (const
|
|
232
|
-
|
|
233
|
-
const
|
|
234
|
-
for (const
|
|
235
|
-
(
|
|
236
|
-
this.#b(
|
|
233
|
+
for (const i of e)
|
|
234
|
+
i._displayCheckmark = !0, O.getNotifier(i).subscribe(this.#s, "selected");
|
|
235
|
+
const a = [];
|
|
236
|
+
for (const i of this._slottedOptions)
|
|
237
|
+
(i.selected || i.value === this.value || this.values.includes(i.value)) && a.push(i.value), i.disabled && this._slottedDisabledOptions.push(i);
|
|
238
|
+
this.#b(a), this.#o(), this.#c();
|
|
237
239
|
}
|
|
238
240
|
#s;
|
|
239
|
-
#
|
|
241
|
+
#_() {
|
|
240
242
|
for (const t of this._slottedOptions)
|
|
241
|
-
t.selected = this.values.includes(t.value), this.#
|
|
243
|
+
t.selected = this.values.includes(t.value), this.#m(t);
|
|
242
244
|
}
|
|
243
245
|
#h(t) {
|
|
244
246
|
const e = t.value;
|
|
245
|
-
let
|
|
246
|
-
const
|
|
247
|
-
this.multiple ? (
|
|
248
|
-
const g =
|
|
247
|
+
let o, a = !1;
|
|
248
|
+
const i = !this.values.includes(e);
|
|
249
|
+
this.multiple ? (i ? o = [...this.values, e] : o = this.values.filter((f) => f !== e), a = !0) : (i ? (o = [e], a = !0) : o = [], this.open = !1), this.#t(o);
|
|
250
|
+
const g = i ? this.locale.searchableSelect.optionSelectedMessage(
|
|
249
251
|
t._getAccessibleName()
|
|
250
252
|
) : this.locale.searchableSelect.optionDeselectedMessage(
|
|
251
253
|
t._getAccessibleName()
|
|
@@ -253,10 +255,10 @@ class n extends Q(
|
|
|
253
255
|
this.values.length,
|
|
254
256
|
this.maxSelected
|
|
255
257
|
) : "";
|
|
256
|
-
this._changeDescription = `${g} ${h}`,
|
|
258
|
+
this._changeDescription = `${g} ${h}`, a && (this._currentSearchText = null);
|
|
257
259
|
}
|
|
258
|
-
#
|
|
259
|
-
#
|
|
260
|
+
#a;
|
|
261
|
+
#i(t) {
|
|
260
262
|
return t.querySelector('[slot="tag-icon"]');
|
|
261
263
|
}
|
|
262
264
|
/**
|
|
@@ -265,13 +267,13 @@ class n extends Q(
|
|
|
265
267
|
_tagIconSlotName(t) {
|
|
266
268
|
return `_tag-icon-${this.values.indexOf(t)}`;
|
|
267
269
|
}
|
|
268
|
-
#
|
|
269
|
-
if (t.selected && this.#
|
|
270
|
-
let e = this.#
|
|
271
|
-
e || (e = this.#
|
|
270
|
+
#m(t) {
|
|
271
|
+
if (t.selected && this.#i(t)) {
|
|
272
|
+
let e = this.#a.get(t);
|
|
273
|
+
e || (e = this.#i(t).cloneNode(!0), this.#a.set(t, e)), e.slot = this._tagIconSlotName(t.value), this.appendChild(e);
|
|
272
274
|
} else {
|
|
273
|
-
const e = this.#
|
|
274
|
-
e && (e.remove(), this.#
|
|
275
|
+
const e = this.#a.get(t);
|
|
276
|
+
e && (e.remove(), this.#a.delete(t));
|
|
275
277
|
}
|
|
276
278
|
}
|
|
277
279
|
/**
|
|
@@ -293,9 +295,9 @@ class n extends Q(
|
|
|
293
295
|
const i = !this.searchText || e(a, this.searchText);
|
|
294
296
|
a._isNotMatching = !i, !a.hidden && i && t.push(a);
|
|
295
297
|
}
|
|
296
|
-
this.#e(null), this._filteredOptions = t
|
|
297
|
-
|
|
298
|
-
|
|
298
|
+
this.#e(null), this._filteredOptions = t;
|
|
299
|
+
const o = t.filter((a) => !a.disabled);
|
|
300
|
+
this._selectAllOption ? this._filteredEnabledOptions = [this._selectAllOption, ...o] : this._filteredEnabledOptions = o;
|
|
299
301
|
}
|
|
300
302
|
#e(t) {
|
|
301
303
|
if (typeof this._highlightedOptionIndex == "number") {
|
|
@@ -307,7 +309,7 @@ class n extends Q(
|
|
|
307
309
|
Math.min(this._filteredEnabledOptions.length - 1, t)
|
|
308
310
|
) : t = null), this._highlightedOptionIndex = t, typeof this._highlightedOptionIndex == "number") {
|
|
309
311
|
const e = this._filteredEnabledOptions[this._highlightedOptionIndex];
|
|
310
|
-
e._highlighted = !0, e.setAttribute("data-highlighted", ""),
|
|
312
|
+
e._highlighted = !0, e.setAttribute("data-highlighted", ""), Q(e, this._listbox, "nearest"), this._changeDescription = this.locale.searchableSelect.optionFocusedMessage(
|
|
311
313
|
e._getAccessibleName(),
|
|
312
314
|
this._highlightedOptionIndex + 1,
|
|
313
315
|
this._filteredEnabledOptions.length,
|
|
@@ -316,14 +318,19 @@ class n extends Q(
|
|
|
316
318
|
}
|
|
317
319
|
}
|
|
318
320
|
#x() {
|
|
319
|
-
this._highlightedOptionIndex
|
|
320
|
-
|
|
321
|
-
|
|
321
|
+
if (this._highlightedOptionIndex === null)
|
|
322
|
+
return;
|
|
323
|
+
const t = this._filteredEnabledOptions[this._highlightedOptionIndex];
|
|
324
|
+
if (t.getAttribute("data-select-all") !== null) {
|
|
325
|
+
this._toggleSelectAll();
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
this.#h(t);
|
|
322
329
|
}
|
|
323
|
-
#
|
|
330
|
+
#y() {
|
|
324
331
|
this.#e(0);
|
|
325
332
|
}
|
|
326
|
-
#
|
|
333
|
+
#w() {
|
|
327
334
|
this.#e(
|
|
328
335
|
this._filteredEnabledOptions.length - 1
|
|
329
336
|
);
|
|
@@ -333,12 +340,12 @@ class n extends Q(
|
|
|
333
340
|
(this._highlightedOptionIndex ?? this._filteredEnabledOptions.length) - S
|
|
334
341
|
);
|
|
335
342
|
}
|
|
336
|
-
#
|
|
343
|
+
#O() {
|
|
337
344
|
this.#e(
|
|
338
345
|
(this._highlightedOptionIndex ?? -1) + S
|
|
339
346
|
);
|
|
340
347
|
}
|
|
341
|
-
#
|
|
348
|
+
#T() {
|
|
342
349
|
this.#e(
|
|
343
350
|
(this._highlightedOptionIndex ?? this._filteredEnabledOptions.length) - 1
|
|
344
351
|
);
|
|
@@ -354,7 +361,7 @@ class n extends Q(
|
|
|
354
361
|
*/
|
|
355
362
|
_tagLabelForValue(t) {
|
|
356
363
|
return this._slottedOptions.find(
|
|
357
|
-
(
|
|
364
|
+
(o) => o.value === t
|
|
358
365
|
).label;
|
|
359
366
|
}
|
|
360
367
|
/**
|
|
@@ -362,7 +369,7 @@ class n extends Q(
|
|
|
362
369
|
*/
|
|
363
370
|
_tagConnotationForValue(t) {
|
|
364
371
|
return this._slottedOptions.find(
|
|
365
|
-
(
|
|
372
|
+
(o) => o.value === t
|
|
366
373
|
).tagConnotation;
|
|
367
374
|
}
|
|
368
375
|
/**
|
|
@@ -370,23 +377,23 @@ class n extends Q(
|
|
|
370
377
|
*/
|
|
371
378
|
_isTagDisabled(t) {
|
|
372
379
|
const e = this._slottedOptions.find(
|
|
373
|
-
(
|
|
380
|
+
(o) => o.value === t
|
|
374
381
|
);
|
|
375
382
|
return this.disabled || e.disabled;
|
|
376
383
|
}
|
|
377
384
|
#k(t) {
|
|
378
385
|
return this._slottedOptions?.find(
|
|
379
|
-
(
|
|
386
|
+
(o) => o.value === t
|
|
380
387
|
)?.label;
|
|
381
388
|
}
|
|
382
389
|
/**
|
|
383
390
|
* @internal
|
|
384
391
|
*/
|
|
385
|
-
#n(t, e,
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
-
const
|
|
389
|
-
return
|
|
392
|
+
#n(t, e, o) {
|
|
393
|
+
const a = document.createElement(this._optionTagTagName);
|
|
394
|
+
a.label = t, a.removable = e, a.style.cssText = "position: absolute; visibility: hidden;", a.hasIconPlaceholder = o, this.shadowRoot.appendChild(a);
|
|
395
|
+
const i = a.getBoundingClientRect().width;
|
|
396
|
+
return a.remove(), i;
|
|
390
397
|
}
|
|
391
398
|
#u() {
|
|
392
399
|
if (!this.multiple) {
|
|
@@ -398,49 +405,49 @@ class n extends Q(
|
|
|
398
405
|
return;
|
|
399
406
|
}
|
|
400
407
|
const t = this._contentArea.getBoundingClientRect().width, e = [[]];
|
|
401
|
-
let
|
|
402
|
-
for (
|
|
403
|
-
const h = this.maxLines &&
|
|
404
|
-
this._tagLabelForValue(this.values[
|
|
408
|
+
let o = 0, a = pe, i;
|
|
409
|
+
for (i = this.values.length - 1; i >= 0; i--) {
|
|
410
|
+
const h = this.maxLines && o === this.maxLines - 1, f = this.#n(
|
|
411
|
+
this._tagLabelForValue(this.values[i]),
|
|
405
412
|
!0,
|
|
406
|
-
this.#
|
|
407
|
-
),
|
|
408
|
-
value: this.values[
|
|
409
|
-
width:
|
|
413
|
+
this.#i(this.selectedOptions[i]) !== null
|
|
414
|
+
), l = {
|
|
415
|
+
value: this.values[i],
|
|
416
|
+
width: f
|
|
410
417
|
};
|
|
411
418
|
let c = 0;
|
|
412
419
|
if (h) {
|
|
413
|
-
const $ =
|
|
414
|
-
$ && (c =
|
|
420
|
+
const $ = i;
|
|
421
|
+
$ && (c = _ + this.#n($.toString(), !1, !1));
|
|
415
422
|
}
|
|
416
|
-
if (
|
|
423
|
+
if (a + _ + f + c > t) {
|
|
417
424
|
if (h)
|
|
418
|
-
if (
|
|
419
|
-
e[
|
|
425
|
+
if (i === this.values.length - 1)
|
|
426
|
+
e[o].unshift(l), a += _ + f;
|
|
420
427
|
else
|
|
421
428
|
break;
|
|
422
429
|
else
|
|
423
|
-
e.push([]),
|
|
430
|
+
e.push([]), o++, e[o].unshift(l), a = f;
|
|
424
431
|
continue;
|
|
425
432
|
}
|
|
426
|
-
e[
|
|
433
|
+
e[o].unshift(l), a += _ + f;
|
|
427
434
|
}
|
|
428
|
-
this._numElidedTags =
|
|
435
|
+
this._numElidedTags = i + 1, e.reverse();
|
|
429
436
|
for (let h = 0; h < e.length - 1; h++) {
|
|
430
|
-
let
|
|
431
|
-
for (h === 0 && this._numElidedTags && (
|
|
432
|
-
const
|
|
433
|
-
e[h].push(
|
|
437
|
+
let f = e[h].map((l) => l.width).reduce((l, c) => l + c, 0) + (e[h].length - 1) * _;
|
|
438
|
+
for (h === 0 && this._numElidedTags && (f += _ + this.#n(this._numElidedTags.toString(), !1, !1)); e[h + 1].length && f + _ + e[h + 1][0].width <= t; ) {
|
|
439
|
+
const l = e[h + 1].shift();
|
|
440
|
+
e[h].push(l), f += _ + l.width;
|
|
434
441
|
}
|
|
435
442
|
}
|
|
436
|
-
const g = e.map((h) => h.map((
|
|
443
|
+
const g = e.map((h) => h.map((f) => f.value));
|
|
437
444
|
this._tagRows = g.slice(0, -1), this._lastTagRow = g.slice(-1)[0];
|
|
438
445
|
}
|
|
439
446
|
/**
|
|
440
447
|
* @internal
|
|
441
448
|
*/
|
|
442
449
|
_onTagRemoved(t) {
|
|
443
|
-
this.#
|
|
450
|
+
this.#t(
|
|
444
451
|
this.values.filter((e) => e !== t)
|
|
445
452
|
), this.#o();
|
|
446
453
|
}
|
|
@@ -454,19 +461,19 @@ class n extends Q(
|
|
|
454
461
|
case "Delete":
|
|
455
462
|
case "Enter":
|
|
456
463
|
case " ": {
|
|
457
|
-
this._onTagRemoved(this.values[e]),
|
|
464
|
+
this._onTagRemoved(this.values[e]), j.process(), this.#l(this.#C(e));
|
|
458
465
|
break;
|
|
459
466
|
}
|
|
460
467
|
case "ArrowLeft":
|
|
461
|
-
this.#
|
|
468
|
+
this.#l(this.#r(e) ?? e);
|
|
462
469
|
break;
|
|
463
470
|
case "ArrowRight":
|
|
464
|
-
this.#
|
|
471
|
+
this.#l(this.#v(e));
|
|
465
472
|
break;
|
|
466
473
|
}
|
|
467
474
|
return !0;
|
|
468
475
|
}
|
|
469
|
-
#
|
|
476
|
+
#l(t) {
|
|
470
477
|
t === null ? this._input.focus() : this.shadowRoot.querySelector(`[data-index="${t}"]`)?.focus();
|
|
471
478
|
}
|
|
472
479
|
#r(t) {
|
|
@@ -497,6 +504,10 @@ class n extends Q(
|
|
|
497
504
|
const e = t.target.closest(
|
|
498
505
|
"option,[role=option],[data-vvd-component=option]"
|
|
499
506
|
);
|
|
507
|
+
if (e?.getAttribute("data-select-all") !== null) {
|
|
508
|
+
this._toggleSelectAll();
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
500
511
|
e && !e.disabled && this.#h(e);
|
|
501
512
|
}
|
|
502
513
|
/**
|
|
@@ -509,7 +520,7 @@ class n extends Q(
|
|
|
509
520
|
* @internal
|
|
510
521
|
*/
|
|
511
522
|
_onClearButtonClick() {
|
|
512
|
-
this.#
|
|
523
|
+
this.#t(
|
|
513
524
|
this.selectedOptions.filter((t) => t.disabled).map((t) => t.value)
|
|
514
525
|
);
|
|
515
526
|
}
|
|
@@ -527,10 +538,10 @@ class n extends Q(
|
|
|
527
538
|
);
|
|
528
539
|
if (this.values.length >= this.maxSelected) {
|
|
529
540
|
const e = t.filter(
|
|
530
|
-
(
|
|
541
|
+
(o) => !this.selectedOptions.includes(o)
|
|
531
542
|
);
|
|
532
|
-
for (const
|
|
533
|
-
|
|
543
|
+
for (const o of e)
|
|
544
|
+
o.disabled = !0;
|
|
534
545
|
} else
|
|
535
546
|
for (const e of t)
|
|
536
547
|
e.disabled = !1;
|
|
@@ -541,6 +552,48 @@ class n extends Q(
|
|
|
541
552
|
get _hasSelectionCount() {
|
|
542
553
|
return this.multiple && this.maxSelected && this.maxSelected >= 1;
|
|
543
554
|
}
|
|
555
|
+
/**
|
|
556
|
+
* @internal
|
|
557
|
+
*/
|
|
558
|
+
get _selectableOptions() {
|
|
559
|
+
return this._slottedOptions?.filter(
|
|
560
|
+
(t) => !this._slottedDisabledOptions.includes(t) && !t.disabled
|
|
561
|
+
) ?? [];
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* @internal
|
|
565
|
+
*/
|
|
566
|
+
get _selectAllLabel() {
|
|
567
|
+
return this._isAllSelected ? this.deselectAllText ?? this.locale.searchableSelect.deselectAllLabel : this.selectAllText ?? this.locale.searchableSelect.selectAllLabel;
|
|
568
|
+
}
|
|
569
|
+
/**
|
|
570
|
+
* @internal
|
|
571
|
+
*/
|
|
572
|
+
get _isAllSelected() {
|
|
573
|
+
const t = this.values;
|
|
574
|
+
if (!this.multiple || !this._slottedOptions) return !1;
|
|
575
|
+
const e = this._selectableOptions;
|
|
576
|
+
if (e.length === 0) return !1;
|
|
577
|
+
const o = new Set(t);
|
|
578
|
+
return e.every((a) => o.has(a.value));
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* @internal
|
|
582
|
+
*/
|
|
583
|
+
_toggleSelectAll() {
|
|
584
|
+
const t = this._selectableOptions.map((a) => a.value);
|
|
585
|
+
if (this._isAllSelected) {
|
|
586
|
+
const a = this.values.filter(
|
|
587
|
+
(i) => !t.includes(i)
|
|
588
|
+
);
|
|
589
|
+
this.#t(a), this._changeDescription = this.locale.searchableSelect.deselectedAllMessage;
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
592
|
+
const e = t.filter(
|
|
593
|
+
(a) => !this.values.includes(a)
|
|
594
|
+
), o = [...this.values, ...e];
|
|
595
|
+
this.#t(o), this._changeDescription = this.locale.searchableSelect.selectedAllMessage;
|
|
596
|
+
}
|
|
544
597
|
#f() {
|
|
545
598
|
return this.initialValues.length ? this.initialValues : this.initialValue ? [this.initialValue] : [];
|
|
546
599
|
}
|
|
@@ -564,9 +617,9 @@ class n extends Q(
|
|
|
564
617
|
* @internal
|
|
565
618
|
*/
|
|
566
619
|
formResetCallback() {
|
|
567
|
-
super.formResetCallback(), this.#
|
|
620
|
+
super.formResetCallback(), this.#t(this.#f());
|
|
568
621
|
}
|
|
569
|
-
#
|
|
622
|
+
#d;
|
|
570
623
|
/**
|
|
571
624
|
* @internal
|
|
572
625
|
*/
|
|
@@ -580,10 +633,10 @@ class n extends Q(
|
|
|
580
633
|
return this.open ? (this.open = !1, !1) : !0;
|
|
581
634
|
}
|
|
582
635
|
connectedCallback() {
|
|
583
|
-
super.connectedCallback(), this.values.length || (this.values = this.#f()), this.#
|
|
636
|
+
super.connectedCallback(), this.values.length || (this.values = this.#f()), this.#d.observe(this._contentArea);
|
|
584
637
|
}
|
|
585
638
|
disconnectedCallback() {
|
|
586
|
-
super.disconnectedCallback(), this.#
|
|
639
|
+
super.disconnectedCallback(), this.#d.disconnect();
|
|
587
640
|
}
|
|
588
641
|
/**
|
|
589
642
|
* @internal
|
|
@@ -606,95 +659,107 @@ class n extends Q(
|
|
|
606
659
|
}
|
|
607
660
|
}
|
|
608
661
|
r([
|
|
609
|
-
|
|
662
|
+
u
|
|
610
663
|
], n.prototype, "appearance");
|
|
611
664
|
r([
|
|
612
|
-
|
|
665
|
+
u
|
|
613
666
|
], n.prototype, "shape");
|
|
614
667
|
r([
|
|
615
|
-
|
|
668
|
+
u({ mode: "boolean", attribute: "fixed-dropdown" })
|
|
616
669
|
], n.prototype, "fixedDropdown");
|
|
617
670
|
r([
|
|
618
|
-
|
|
671
|
+
u
|
|
619
672
|
], n.prototype, "placeholder");
|
|
620
673
|
r([
|
|
621
|
-
|
|
674
|
+
u({ mode: "boolean" })
|
|
622
675
|
], n.prototype, "open");
|
|
623
676
|
r([
|
|
624
|
-
|
|
677
|
+
u({ mode: "boolean" })
|
|
625
678
|
], n.prototype, "multiple");
|
|
626
679
|
r([
|
|
627
|
-
|
|
680
|
+
u({ attribute: "external-tags", mode: "boolean" })
|
|
628
681
|
], n.prototype, "externalTags");
|
|
629
682
|
r([
|
|
630
|
-
|
|
683
|
+
u({ attribute: "max-lines", converter: A })
|
|
631
684
|
], n.prototype, "maxLines");
|
|
632
685
|
r([
|
|
633
|
-
|
|
686
|
+
p
|
|
634
687
|
], n.prototype, "values");
|
|
635
688
|
r([
|
|
636
|
-
|
|
689
|
+
p
|
|
637
690
|
], n.prototype, "initialValues");
|
|
638
691
|
r([
|
|
639
|
-
|
|
692
|
+
p
|
|
640
693
|
], n.prototype, "_input");
|
|
641
694
|
r([
|
|
642
|
-
|
|
695
|
+
p
|
|
643
696
|
], n.prototype, "_currentSearchText");
|
|
644
697
|
r([
|
|
645
|
-
|
|
698
|
+
p
|
|
646
699
|
], n.prototype, "_slottedOptions");
|
|
647
700
|
r([
|
|
648
|
-
|
|
701
|
+
p
|
|
649
702
|
], n.prototype, "optionFilter");
|
|
650
703
|
r([
|
|
651
|
-
|
|
704
|
+
p
|
|
652
705
|
], n.prototype, "_filteredOptions");
|
|
653
706
|
r([
|
|
654
|
-
|
|
707
|
+
p
|
|
655
708
|
], n.prototype, "_filteredEnabledOptions");
|
|
656
709
|
r([
|
|
657
|
-
|
|
710
|
+
u({
|
|
658
711
|
mode: "boolean"
|
|
659
712
|
})
|
|
660
713
|
], n.prototype, "loading");
|
|
661
714
|
r([
|
|
662
|
-
|
|
715
|
+
p
|
|
663
716
|
], n.prototype, "_highlightedOptionIndex");
|
|
664
717
|
r([
|
|
665
|
-
|
|
718
|
+
p
|
|
666
719
|
], n.prototype, "_contentArea");
|
|
667
720
|
r([
|
|
668
|
-
|
|
721
|
+
p
|
|
669
722
|
], n.prototype, "_numElidedTags");
|
|
670
723
|
r([
|
|
671
|
-
|
|
724
|
+
p
|
|
672
725
|
], n.prototype, "_tagRows");
|
|
673
726
|
r([
|
|
674
|
-
|
|
727
|
+
p
|
|
675
728
|
], n.prototype, "_lastTagRow");
|
|
676
729
|
r([
|
|
677
|
-
|
|
730
|
+
p
|
|
678
731
|
], n.prototype, "_listbox");
|
|
679
732
|
r([
|
|
680
|
-
|
|
733
|
+
u({ mode: "boolean" })
|
|
681
734
|
], n.prototype, "clearable");
|
|
682
735
|
r([
|
|
683
|
-
|
|
736
|
+
u({ attribute: "max-selected", converter: A })
|
|
684
737
|
], n.prototype, "maxSelected");
|
|
685
738
|
r([
|
|
686
|
-
|
|
739
|
+
p
|
|
687
740
|
], n.prototype, "_slottedDisabledOptions");
|
|
688
741
|
r([
|
|
689
|
-
|
|
742
|
+
u({ attribute: "enable-select-all", mode: "boolean" })
|
|
743
|
+
], n.prototype, "enableSelectAll");
|
|
744
|
+
r([
|
|
745
|
+
u({ attribute: "select-all-text" })
|
|
746
|
+
], n.prototype, "selectAllText");
|
|
747
|
+
r([
|
|
748
|
+
u({ attribute: "deselect-all-text" })
|
|
749
|
+
], n.prototype, "deselectAllText");
|
|
750
|
+
r([
|
|
751
|
+
p
|
|
752
|
+
], n.prototype, "_selectAllOption");
|
|
753
|
+
r([
|
|
754
|
+
p
|
|
690
755
|
], n.prototype, "_changeDescription");
|
|
691
756
|
r([
|
|
692
|
-
|
|
757
|
+
p
|
|
693
758
|
], n.prototype, "_anchor");
|
|
694
|
-
var
|
|
695
|
-
for (var
|
|
696
|
-
(g = s[
|
|
697
|
-
return
|
|
759
|
+
var ue = Object.defineProperty, m = (s, t, e, o) => {
|
|
760
|
+
for (var a = void 0, i = s.length - 1, g; i >= 0; i--)
|
|
761
|
+
(g = s[i]) && (a = g(t, e, a) || a);
|
|
762
|
+
return a && ue(t, e, a), a;
|
|
698
763
|
};
|
|
699
764
|
class b extends V(F) {
|
|
700
765
|
constructor() {
|
|
@@ -706,25 +771,25 @@ class b extends V(F) {
|
|
|
706
771
|
});
|
|
707
772
|
}
|
|
708
773
|
}
|
|
709
|
-
|
|
710
|
-
|
|
774
|
+
m([
|
|
775
|
+
u
|
|
711
776
|
], b.prototype, "shape");
|
|
712
|
-
|
|
713
|
-
|
|
777
|
+
m([
|
|
778
|
+
p
|
|
714
779
|
], b.prototype, "connotation");
|
|
715
|
-
|
|
716
|
-
|
|
780
|
+
m([
|
|
781
|
+
u
|
|
717
782
|
], b.prototype, "label");
|
|
718
|
-
|
|
719
|
-
|
|
783
|
+
m([
|
|
784
|
+
u({ mode: "boolean" })
|
|
720
785
|
], b.prototype, "removable");
|
|
721
|
-
|
|
722
|
-
|
|
786
|
+
m([
|
|
787
|
+
u({ mode: "boolean" })
|
|
723
788
|
], b.prototype, "disabled");
|
|
724
|
-
|
|
725
|
-
|
|
789
|
+
m([
|
|
790
|
+
p
|
|
726
791
|
], b.prototype, "hasIconPlaceholder");
|
|
727
|
-
const
|
|
792
|
+
const ve = (s) => w(
|
|
728
793
|
["disabled", s.disabled],
|
|
729
794
|
[`appearance-${s.appearance}`, !!s.appearance],
|
|
730
795
|
[`shape-${s.shape}`, !!s.shape],
|
|
@@ -732,13 +797,13 @@ const pe = (s) => y(
|
|
|
732
797
|
["success", !!s.successText],
|
|
733
798
|
["has-highlighted-option", s._highlightedOptionIndex !== null]
|
|
734
799
|
);
|
|
735
|
-
function
|
|
736
|
-
return
|
|
800
|
+
function fe() {
|
|
801
|
+
return d`
|
|
737
802
|
<label for="control" class="label" id="label"> ${(s) => s.label} </label>
|
|
738
803
|
`;
|
|
739
804
|
}
|
|
740
|
-
function
|
|
741
|
-
return
|
|
805
|
+
function ge() {
|
|
806
|
+
return d`
|
|
742
807
|
<span
|
|
743
808
|
id="selection-count"
|
|
744
809
|
class="selection-count"
|
|
@@ -752,163 +817,178 @@ function he() {
|
|
|
752
817
|
}
|
|
753
818
|
const k = (s, t) => {
|
|
754
819
|
const e = s.tagFor(b);
|
|
755
|
-
return
|
|
820
|
+
return d`
|
|
756
821
|
<div class="tag-wrapper">
|
|
757
822
|
<${e}
|
|
758
823
|
class="tag"
|
|
759
824
|
tabindex="-1"
|
|
760
|
-
data-index="${(
|
|
825
|
+
data-index="${(o, a) => t(a).values.indexOf(o)}"
|
|
761
826
|
removable
|
|
762
|
-
:label="${(
|
|
763
|
-
:shape="${(
|
|
764
|
-
:connotation="${(
|
|
765
|
-
?disabled="${(
|
|
766
|
-
@remove="${(
|
|
767
|
-
@keydown="${(
|
|
827
|
+
:label="${(o, a) => t(a)._tagLabelForValue(o)}"
|
|
828
|
+
:shape="${(o, a) => t(a).shape}"
|
|
829
|
+
:connotation="${(o, a) => t(a)._tagConnotationForValue(o)}"
|
|
830
|
+
?disabled="${(o, a) => t(a)._isTagDisabled(o)}"
|
|
831
|
+
@remove="${(o, a) => t(a)._onTagRemoved(o)}"
|
|
832
|
+
@keydown="${(o, a) => t(a)._onTagKeydown(a.event)}"
|
|
768
833
|
@mousedown="${() => !1}">
|
|
769
|
-
<slot slot="icon" name="${(
|
|
834
|
+
<slot slot="icon" name="${(o, a) => t(a)._tagIconSlotName(o)}"></slot>
|
|
770
835
|
</${e}>
|
|
771
836
|
</div>
|
|
772
837
|
`;
|
|
773
838
|
}, C = (s, t) => {
|
|
774
839
|
const e = s.tagFor(b);
|
|
775
|
-
return
|
|
840
|
+
return d`
|
|
776
841
|
<${e}
|
|
777
842
|
class="tag"
|
|
778
843
|
tabindex="-1"
|
|
779
|
-
:label="${(
|
|
780
|
-
:shape="${(
|
|
781
|
-
?disabled="${(
|
|
844
|
+
:label="${(o, a) => t(o, a)._numElidedTags.toString()}"
|
|
845
|
+
:shape="${(o, a) => t(o, a).shape}"
|
|
846
|
+
?disabled="${(o, a) => t(o, a).disabled}"
|
|
782
847
|
@mousedown="${() => !1}">
|
|
783
848
|
</${e}>
|
|
784
849
|
`;
|
|
785
850
|
};
|
|
786
|
-
function
|
|
787
|
-
const t = s.tagFor(
|
|
851
|
+
function be(s) {
|
|
852
|
+
const t = s.tagFor(R), e = s.tagFor(H), o = se(s), a = z(s), i = k(s, (l) => l.parent), g = k(
|
|
788
853
|
s,
|
|
789
|
-
(
|
|
790
|
-
), h = C(s, (
|
|
854
|
+
(l) => l.parentContext.parent
|
|
855
|
+
), h = C(s, (l, c) => l), f = C(
|
|
791
856
|
s,
|
|
792
|
-
(
|
|
857
|
+
(l, c) => c.parent
|
|
793
858
|
);
|
|
794
|
-
return
|
|
859
|
+
return d`
|
|
795
860
|
<div
|
|
796
|
-
class="fieldset ${
|
|
797
|
-
@click="${(
|
|
861
|
+
class="fieldset ${ve}"
|
|
862
|
+
@click="${(l, c) => l._onFieldsetClick(c.event)}"
|
|
798
863
|
${x("_anchor")}
|
|
799
864
|
>
|
|
800
|
-
${(
|
|
865
|
+
${(l) => o(l.icon, ie.Slot)}
|
|
801
866
|
<div class="content-area" ${x("_contentArea")}>
|
|
802
|
-
${
|
|
803
|
-
(
|
|
804
|
-
|
|
867
|
+
${y(
|
|
868
|
+
(l) => l._tagRows,
|
|
869
|
+
d`
|
|
805
870
|
<div class="tag-row">
|
|
806
871
|
${v(
|
|
807
|
-
(
|
|
808
|
-
|
|
872
|
+
(l, c) => c.isFirst && c.parent._numElidedTags,
|
|
873
|
+
f
|
|
809
874
|
)}
|
|
810
|
-
${
|
|
875
|
+
${y((l) => l, g)}
|
|
811
876
|
</div>
|
|
812
877
|
`,
|
|
813
878
|
{ positioning: !0 }
|
|
814
879
|
)}
|
|
815
880
|
<div
|
|
816
|
-
class="tag-row ${(
|
|
881
|
+
class="tag-row ${(l) => w([
|
|
817
882
|
"contains-only-input",
|
|
818
|
-
|
|
883
|
+
l._tagRows.length > 0 && l._lastTagRow.length === 0
|
|
819
884
|
])}"
|
|
820
885
|
>
|
|
821
886
|
${v(
|
|
822
|
-
(
|
|
887
|
+
(l) => l._tagRows.length === 0 && l._numElidedTags,
|
|
823
888
|
h
|
|
824
889
|
)}
|
|
825
|
-
${
|
|
890
|
+
${y((l) => l._lastTagRow, i)}
|
|
826
891
|
<input
|
|
827
892
|
id="control"
|
|
828
893
|
class="control"
|
|
829
894
|
autocomplete="off"
|
|
830
895
|
aria-controls="listbox"
|
|
831
|
-
aria-describedby="${(
|
|
832
|
-
${
|
|
896
|
+
aria-describedby="${(l) => l._feedbackDescribedBy} ${(l) => l.multiple && l.maxSelected && l.maxSelected >= 1 ? "selection-count" : null}"
|
|
897
|
+
${Y({
|
|
833
898
|
role: "combobox",
|
|
834
899
|
ariaAutoComplete: "list",
|
|
835
900
|
ariaHasPopup: "listbox",
|
|
836
|
-
ariaExpanded: (
|
|
901
|
+
ariaExpanded: (l) => l.open
|
|
837
902
|
})}
|
|
838
|
-
placeholder="${(
|
|
903
|
+
placeholder="${(l) => l.multiple && l.values.length ? "" : l.placeholder}"
|
|
839
904
|
type="text"
|
|
840
|
-
?disabled="${(
|
|
841
|
-
:value="${(
|
|
842
|
-
@input="${(
|
|
843
|
-
|
|
905
|
+
?disabled="${(l) => l.disabled}"
|
|
906
|
+
:value="${(l) => l._inputValue}"
|
|
907
|
+
@input="${(l, c) => {
|
|
908
|
+
l._onInputInput(c.event), c.event.stopPropagation();
|
|
844
909
|
}}"
|
|
845
|
-
@change="${(
|
|
910
|
+
@change="${(l, c) => {
|
|
846
911
|
c.event.stopPropagation();
|
|
847
912
|
}}"
|
|
848
|
-
@focus="${(
|
|
849
|
-
@blur="${(
|
|
850
|
-
@keydown="${(
|
|
913
|
+
@focus="${(l, c) => l._onInputFocus(c.event)}"
|
|
914
|
+
@blur="${(l, c) => l._onInputBlur(c.event)}"
|
|
915
|
+
@keydown="${(l, c) => l._onInputKeydown(c.event)}"
|
|
851
916
|
${x("_input")}
|
|
852
917
|
/>
|
|
853
918
|
</div>
|
|
854
919
|
</div>
|
|
855
920
|
<slot name="meta"></slot>
|
|
856
921
|
${v(
|
|
857
|
-
(
|
|
858
|
-
|
|
859
|
-
aria-label="${(
|
|
860
|
-
@click="${(
|
|
922
|
+
(l) => l._shouldShowClearButton,
|
|
923
|
+
d`<${t}
|
|
924
|
+
aria-label="${(l) => l.locale.searchableSelect.clearButtonLabel}"
|
|
925
|
+
@click="${(l) => l._onClearButtonClick()}"
|
|
861
926
|
@mousedown="${() => !1}"
|
|
862
|
-
?disabled="${(
|
|
863
|
-
:shape="${(
|
|
927
|
+
?disabled="${(l) => l.disabled}"
|
|
928
|
+
:shape="${(l) => l.shape}"
|
|
864
929
|
size="super-condensed"
|
|
865
930
|
icon="close-line"
|
|
866
931
|
appearance="ghost-light"
|
|
867
932
|
tabindex="0"
|
|
868
933
|
></${t}>`
|
|
869
934
|
)}
|
|
870
|
-
<div @mousedown="${() => !1}" @click="${(
|
|
935
|
+
<div @mousedown="${() => !1}" @click="${(l) => l._onChevronClick()}">
|
|
871
936
|
${v(
|
|
872
|
-
(
|
|
873
|
-
|
|
937
|
+
(l) => l.loading,
|
|
938
|
+
d`<${e} indeterminate size="-6" aria-hidden="true"></${e}>`
|
|
874
939
|
)}
|
|
875
|
-
${v((
|
|
940
|
+
${v((l) => !l.loading, a)}
|
|
876
941
|
</div>
|
|
877
942
|
</div>
|
|
878
943
|
`;
|
|
879
944
|
}
|
|
880
|
-
function
|
|
945
|
+
function _e(s) {
|
|
881
946
|
return s.open && s.fixedDropdown ? `--_searchable-select-fixed-width: ${Math.round(
|
|
882
947
|
s.getBoundingClientRect().width
|
|
883
948
|
)}px` : null;
|
|
884
949
|
}
|
|
885
|
-
function
|
|
950
|
+
function me(s) {
|
|
951
|
+
const t = s.tagFor(W), e = s.tagFor(ne);
|
|
952
|
+
return d`
|
|
953
|
+
<${t}
|
|
954
|
+
data-select-all
|
|
955
|
+
tabindex="-1"
|
|
956
|
+
:text="${(o) => o._selectAllLabel}"
|
|
957
|
+
:selected="${(o) => o._isAllSelected}"
|
|
958
|
+
:_displayCheckmark="${() => !0}"
|
|
959
|
+
?disabled="${(o) => o._selectableOptions.length === 0}"
|
|
960
|
+
${x("_selectAllOption")}>
|
|
961
|
+
</${t}>
|
|
962
|
+
<${e} class="divider"></${e}>
|
|
963
|
+
`;
|
|
964
|
+
}
|
|
965
|
+
function xe(s) {
|
|
886
966
|
const t = s.tagFor(L);
|
|
887
|
-
return
|
|
967
|
+
return d`
|
|
888
968
|
<div class="label-wrapper" ?hidden=${(e) => !e.label && !e._hasContextualHelp && !e._hasSelectionCount}>
|
|
889
969
|
${v(
|
|
890
970
|
(e) => e.label || e._hasSelectionCount,
|
|
891
|
-
|
|
971
|
+
d`
|
|
892
972
|
<div>
|
|
893
|
-
${v((e) => e.label,
|
|
894
|
-
${v((e) => e._hasSelectionCount,
|
|
973
|
+
${v((e) => e.label, fe())}
|
|
974
|
+
${v((e) => e._hasSelectionCount, ge())}
|
|
895
975
|
</div>
|
|
896
976
|
`
|
|
897
977
|
)}
|
|
898
|
-
<slot name="contextual-help" ${
|
|
978
|
+
<slot name="contextual-help" ${T("_contextualHelpSlottedContent")}></slot>
|
|
899
979
|
</div>
|
|
900
980
|
<span aria-live="assertive" aria-relevant="text" class="visually-hidden">
|
|
901
981
|
${(e) => e._changeDescription}
|
|
902
982
|
</span>
|
|
903
983
|
<div>
|
|
904
|
-
${
|
|
984
|
+
${be(s)}
|
|
905
985
|
<div class="popup-wrapper">
|
|
906
986
|
<${t}
|
|
907
987
|
:anchor="${(e) => e._anchor}"
|
|
908
988
|
:open="${(e) => e.open}"
|
|
909
989
|
class="popup"
|
|
910
990
|
placement="bottom-start"
|
|
911
|
-
style="${
|
|
991
|
+
style="${_e}"
|
|
912
992
|
strategy="${(e) => e.fixedDropdown ? "fixed" : "absolute"}">
|
|
913
993
|
<div
|
|
914
994
|
class="listbox"
|
|
@@ -916,34 +996,38 @@ function fe(s) {
|
|
|
916
996
|
aria-multiselectable="${(e) => e.multiple}"
|
|
917
997
|
aria-required="${(e) => e.required}"
|
|
918
998
|
${x("_listbox")}
|
|
919
|
-
@click="${(e,
|
|
999
|
+
@click="${(e, o) => e._onListboxClick(o.event)}"
|
|
920
1000
|
@mousedown="${() => !1}"
|
|
921
1001
|
>
|
|
1002
|
+
${v(
|
|
1003
|
+
(e) => e.enableSelectAll && e.multiple && !e.maxSelected,
|
|
1004
|
+
me(s)
|
|
1005
|
+
)}
|
|
922
1006
|
<slot
|
|
923
|
-
${
|
|
924
|
-
filter:
|
|
1007
|
+
${T({
|
|
1008
|
+
filter: B,
|
|
925
1009
|
flatten: !0,
|
|
926
1010
|
property: "_slottedOptions"
|
|
927
1011
|
})}>
|
|
928
1012
|
</slot>
|
|
929
1013
|
${v(
|
|
930
1014
|
(e) => e._filteredOptions.length === 0,
|
|
931
|
-
|
|
1015
|
+
d`<div class="empty-message">
|
|
932
1016
|
${v(
|
|
933
1017
|
(e) => e.loading,
|
|
934
|
-
|
|
1018
|
+
d`<slot name="loading-options">
|
|
935
1019
|
${(e) => e.locale.searchableSelect.loadingOptionsMessage}
|
|
936
1020
|
</slot>`
|
|
937
1021
|
)}
|
|
938
1022
|
${v(
|
|
939
1023
|
(e) => !e.loading && e.searchText === "",
|
|
940
|
-
|
|
1024
|
+
d`<slot name="no-options">
|
|
941
1025
|
${(e) => e.locale.searchableSelect.noOptionsMessage}
|
|
942
1026
|
</slot>`
|
|
943
1027
|
)}
|
|
944
1028
|
${v(
|
|
945
1029
|
(e) => !e.loading && e.searchText !== "",
|
|
946
|
-
|
|
1030
|
+
d`<slot name="no-matches">
|
|
947
1031
|
${(e) => e.locale.searchableSelect.noMatchesMessage}
|
|
948
1032
|
</slot>`
|
|
949
1033
|
)}
|
|
@@ -955,27 +1039,27 @@ function fe(s) {
|
|
|
955
1039
|
</div>
|
|
956
1040
|
`;
|
|
957
1041
|
}
|
|
958
|
-
const
|
|
1042
|
+
const ye = (s) => {
|
|
959
1043
|
const t = s.tagFor(b, !0);
|
|
960
|
-
return
|
|
1044
|
+
return d`
|
|
961
1045
|
<template
|
|
962
1046
|
:_optionTagTagName="${() => t}"
|
|
963
|
-
@mousedown="${(e,
|
|
1047
|
+
@mousedown="${(e, o) => e._onMouseDown(o.event)}"
|
|
964
1048
|
>
|
|
965
1049
|
<div class="control-wrapper">
|
|
966
|
-
${
|
|
1050
|
+
${xe(s)} ${(e) => e._getFeedbackTemplate(s)}
|
|
967
1051
|
</div>
|
|
968
1052
|
</template>
|
|
969
1053
|
`;
|
|
970
|
-
},
|
|
1054
|
+
}, we = ({ shape: s, connotation: t, disabled: e, removable: o }) => w(
|
|
971
1055
|
"base",
|
|
972
1056
|
["disabled", e],
|
|
973
|
-
["removable",
|
|
1057
|
+
["removable", o],
|
|
974
1058
|
[`shape-${s}`, !!s],
|
|
975
1059
|
[`connotation-${t}`, !!t]
|
|
976
1060
|
);
|
|
977
|
-
function
|
|
978
|
-
return
|
|
1061
|
+
function $e(s) {
|
|
1062
|
+
return d`
|
|
979
1063
|
<span
|
|
980
1064
|
class="remove-button"
|
|
981
1065
|
aria-label="${(t) => t.locale.searchableSelect.removeTagButtonLabel(t.label)}"
|
|
@@ -987,48 +1071,50 @@ function me(s) {
|
|
|
987
1071
|
</span>
|
|
988
1072
|
`;
|
|
989
1073
|
}
|
|
990
|
-
const
|
|
1074
|
+
const Oe = (s) => {
|
|
991
1075
|
const t = s.tagFor(M);
|
|
992
|
-
return
|
|
1076
|
+
return d`<span class="${we}" aria-disabled="${(e) => e.disabled}">
|
|
993
1077
|
<slot name="icon" aria-hidden="true">
|
|
994
1078
|
${v(
|
|
995
1079
|
(e) => e.hasIconPlaceholder,
|
|
996
|
-
|
|
1080
|
+
d`<div class="icon-placeholder"></div>`
|
|
997
1081
|
)}
|
|
998
1082
|
</slot>
|
|
999
1083
|
${v(
|
|
1000
1084
|
(e) => e.label,
|
|
1001
|
-
(e) =>
|
|
1085
|
+
(e) => d`<span class="label">${e.label}</span>`
|
|
1002
1086
|
)}
|
|
1003
|
-
${v((e) => e.removable,
|
|
1087
|
+
${v((e) => e.removable, $e(t))}
|
|
1004
1088
|
</span>`;
|
|
1005
|
-
},
|
|
1089
|
+
}, Te = D(
|
|
1006
1090
|
"option-tag",
|
|
1007
1091
|
b,
|
|
1008
|
-
|
|
1092
|
+
Oe,
|
|
1009
1093
|
[I],
|
|
1010
1094
|
{
|
|
1011
|
-
styles: [
|
|
1095
|
+
styles: [ce],
|
|
1012
1096
|
shadowOptions: {
|
|
1013
1097
|
delegatesFocus: !0
|
|
1014
1098
|
}
|
|
1015
1099
|
}
|
|
1016
|
-
),
|
|
1100
|
+
), Se = D(
|
|
1017
1101
|
"searchable-select",
|
|
1018
1102
|
n,
|
|
1019
|
-
|
|
1103
|
+
ye,
|
|
1020
1104
|
[
|
|
1105
|
+
E,
|
|
1021
1106
|
P,
|
|
1022
|
-
B,
|
|
1023
1107
|
I,
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1108
|
+
Te,
|
|
1109
|
+
K,
|
|
1110
|
+
G,
|
|
1111
|
+
N,
|
|
1112
|
+
J
|
|
1027
1113
|
],
|
|
1028
1114
|
{
|
|
1029
|
-
styles:
|
|
1115
|
+
styles: re
|
|
1030
1116
|
}
|
|
1031
|
-
),
|
|
1032
|
-
|
|
1117
|
+
), ke = q(
|
|
1118
|
+
Se
|
|
1033
1119
|
);
|
|
1034
|
-
|
|
1120
|
+
ke();
|