@vonage/vivid 3.26.0 → 3.28.2
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/README.md +4 -1
- package/accordion/index.js +0 -2
- package/accordion-item/index.js +0 -2
- package/alert/index.js +0 -2
- package/avatar/index.js +0 -2
- package/badge/index.js +0 -2
- package/banner/index.js +0 -2
- package/breadcrumb-item/index.js +0 -2
- package/button/index.js +0 -2
- package/calendar/index.js +0 -1
- package/calendar-event/index.js +0 -2
- package/card/index.js +0 -2
- package/checkbox/index.js +0 -2
- package/combobox/index.js +0 -3
- package/custom-elements.json +440 -51
- package/data-grid/index.js +1 -5
- package/dialog/index.js +0 -2
- package/empty-state/index.js +0 -2
- package/fab/index.js +0 -2
- package/file-picker/index.js +24 -0
- package/header/index.js +1 -1
- package/icon/index.js +0 -2
- package/index.d.ts +3 -3
- package/index.js +31 -35
- package/layout/index.js +1 -1
- package/lib/accordion/accordion.d.ts +5 -5
- package/lib/accordion/accordion.template.d.ts +3 -3
- package/lib/accordion/definition.d.ts +2 -2
- package/lib/accordion/index.d.ts +1 -1
- package/lib/accordion-item/accordion-item.d.ts +12 -12
- package/lib/accordion-item/accordion-item.template.d.ts +4 -4
- package/lib/accordion-item/definition.d.ts +1 -1
- package/lib/accordion-item/index.d.ts +1 -1
- package/lib/action-group/action-group.d.ts +11 -11
- package/lib/action-group/action-group.template.d.ts +4 -4
- package/lib/action-group/definition.d.ts +2 -2
- package/lib/action-group/index.d.ts +1 -1
- package/lib/alert/alert.d.ts +22 -22
- package/lib/alert/alert.template.d.ts +4 -4
- package/lib/alert/definition.d.ts +2 -2
- package/lib/alert/index.d.ts +1 -1
- package/lib/avatar/avatar.d.ts +14 -14
- package/lib/avatar/avatar.template.d.ts +4 -4
- package/lib/avatar/definition.d.ts +2 -2
- package/lib/avatar/index.d.ts +1 -1
- package/lib/badge/badge.d.ts +14 -14
- package/lib/badge/badge.template.d.ts +4 -4
- package/lib/badge/definition.d.ts +4 -4
- package/lib/badge/index.d.ts +1 -1
- package/lib/banner/banner.d.ts +20 -20
- package/lib/banner/banner.template.d.ts +4 -4
- package/lib/banner/definition.d.ts +2 -2
- package/lib/banner/index.d.ts +1 -1
- package/lib/breadcrumb/breadcrumb.d.ts +3 -3
- package/lib/breadcrumb/breadcrumb.template.d.ts +4 -4
- package/lib/breadcrumb/definition.d.ts +1 -1
- package/lib/breadcrumb/index.d.ts +1 -1
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +5 -5
- package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +4 -4
- package/lib/breadcrumb-item/definition.d.ts +1 -1
- package/lib/breadcrumb-item/index.d.ts +1 -1
- package/lib/button/button.d.ts +18 -18
- package/lib/button/button.template.d.ts +4 -4
- package/lib/button/definition.d.ts +2 -2
- package/lib/button/index.d.ts +1 -1
- package/lib/calendar/calendar.d.ts +13 -13
- package/lib/calendar/calendar.template.d.ts +4 -4
- package/lib/calendar/definition.d.ts +1 -1
- package/lib/calendar/helpers/calendar.date-functions.d.ts +2 -2
- package/lib/calendar/helpers/calendar.event-context.d.ts +6 -6
- package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +9 -9
- package/lib/calendar/index.d.ts +1 -1
- package/lib/calendar-event/calendar-event.d.ts +13 -13
- package/lib/calendar-event/calendar-event.template.d.ts +4 -4
- package/lib/calendar-event/definition.d.ts +2 -2
- package/lib/calendar-event/index.d.ts +1 -1
- package/lib/card/card.d.ts +10 -10
- package/lib/card/card.template.d.ts +4 -4
- package/lib/card/definition.d.ts +1 -1
- package/lib/card/index.d.ts +1 -1
- package/lib/checkbox/checkbox.d.ts +10 -11
- package/lib/checkbox/checkbox.template.d.ts +4 -4
- package/lib/checkbox/definition.d.ts +1 -1
- package/lib/checkbox/index.d.ts +1 -1
- package/lib/combobox/combobox.d.ts +12 -13
- package/lib/combobox/combobox.template.d.ts +4 -4
- package/lib/combobox/definition.d.ts +3 -4
- package/lib/combobox/index.d.ts +1 -1
- package/lib/components.d.ts +52 -52
- package/lib/data-grid/data-grid-cell.d.ts +22 -22
- package/lib/data-grid/data-grid-cell.template.d.ts +4 -4
- package/lib/data-grid/data-grid-row.d.ts +4 -4
- package/lib/data-grid/data-grid-row.template.d.ts +3 -3
- package/lib/data-grid/data-grid.d.ts +20 -20
- package/lib/data-grid/data-grid.options.d.ts +38 -38
- package/lib/data-grid/data-grid.template.d.ts +3 -3
- package/lib/data-grid/definition.d.ts +6 -6
- package/lib/data-grid/index.d.ts +1 -1
- package/lib/dialog/definition.d.ts +2 -2
- package/lib/dialog/dialog.d.ts +26 -26
- package/lib/dialog/dialog.template.d.ts +4 -4
- package/lib/dialog/index.d.ts +1 -1
- package/lib/divider/definition.d.ts +1 -1
- package/lib/divider/divider.d.ts +3 -3
- package/lib/divider/divider.template.d.ts +4 -4
- package/lib/divider/index.d.ts +1 -1
- package/lib/elevation/definition.d.ts +1 -1
- package/lib/elevation/elevation.d.ts +5 -5
- package/lib/elevation/elevation.template.d.ts +4 -4
- package/lib/elevation/index.d.ts +1 -1
- package/lib/empty-state/definition.d.ts +3 -3
- package/lib/empty-state/empty-state.d.ts +5 -5
- package/lib/empty-state/empty-state.template.d.ts +4 -4
- package/lib/empty-state/index.d.ts +1 -1
- package/lib/enums.d.ts +60 -60
- package/lib/fab/definition.d.ts +4 -4
- package/lib/fab/fab.d.ts +12 -12
- package/lib/fab/fab.template.d.ts +4 -4
- package/lib/fab/index.d.ts +1 -1
- package/lib/file-picker/definition.d.ts +3 -0
- package/lib/file-picker/file-picker.d.ts +22 -0
- package/lib/file-picker/file-picker.template.d.ts +4 -0
- package/lib/file-picker/index.d.ts +1 -0
- package/lib/focus/definition.d.ts +3 -3
- package/lib/focus/focus.d.ts +3 -3
- package/lib/focus/focus.template.d.ts +4 -4
- package/lib/focus/index.d.ts +1 -1
- package/lib/header/definition.d.ts +3 -3
- package/lib/header/header.d.ts +5 -5
- package/lib/header/header.template.d.ts +4 -4
- package/lib/header/index.d.ts +1 -1
- package/lib/icon/definition.d.ts +4 -4
- package/lib/icon/icon.d.ts +12 -12
- package/lib/icon/icon.placeholder.d.ts +1 -1
- package/lib/icon/icon.template.d.ts +4 -4
- package/lib/icon/index.d.ts +1 -1
- package/lib/layout/definition.d.ts +4 -4
- package/lib/layout/index.d.ts +1 -1
- package/lib/layout/layout.d.ts +17 -17
- package/lib/layout/layout.template.d.ts +4 -4
- package/lib/listbox/definition.d.ts +4 -4
- package/lib/listbox/index.d.ts +1 -1
- package/lib/listbox/listbox.d.ts +6 -6
- package/lib/listbox/listbox.template.d.ts +4 -4
- package/lib/menu/definition.d.ts +12 -12
- package/lib/menu/index.d.ts +1 -1
- package/lib/menu/menu.d.ts +16 -14
- package/lib/menu/menu.template.d.ts +3 -3
- package/lib/menu-item/definition.d.ts +3 -3
- package/lib/menu-item/index.d.ts +1 -1
- package/lib/menu-item/menu-item.d.ts +14 -14
- package/lib/menu-item/menu-item.template.d.ts +4 -4
- package/lib/nav/definition.d.ts +3 -3
- package/lib/nav/index.d.ts +1 -1
- package/lib/nav/nav.d.ts +3 -3
- package/lib/nav/nav.template.d.ts +4 -4
- package/lib/nav-disclosure/definition.d.ts +3 -3
- package/lib/nav-disclosure/index.d.ts +1 -1
- package/lib/nav-disclosure/nav-disclosure.d.ts +10 -10
- package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -4
- package/lib/nav-item/definition.d.ts +3 -3
- package/lib/nav-item/index.d.ts +1 -1
- package/lib/nav-item/nav-item.d.ts +7 -7
- package/lib/nav-item/nav-item.template.d.ts +4 -4
- package/lib/note/definition.d.ts +4 -4
- package/lib/note/index.d.ts +1 -1
- package/lib/note/note.d.ts +10 -10
- package/lib/note/note.template.d.ts +4 -4
- package/lib/number-field/definition.d.ts +5 -5
- package/lib/number-field/index.d.ts +1 -1
- package/lib/number-field/number-field.d.ts +13 -13
- package/lib/number-field/number-field.template.d.ts +4 -4
- package/lib/option/definition.d.ts +3 -3
- package/lib/option/index.d.ts +1 -1
- package/lib/option/option.d.ts +12 -12
- package/lib/option/option.template.d.ts +4 -4
- package/lib/pagination/definition.d.ts +3 -3
- package/lib/pagination/index.d.ts +1 -1
- package/lib/pagination/pagination.d.ts +18 -18
- package/lib/pagination/pagination.template.d.ts +4 -4
- package/lib/popup/definition.d.ts +5 -5
- package/lib/popup/index.d.ts +1 -1
- package/lib/popup/popup.d.ts +21 -21
- package/lib/popup/popup.template.d.ts +4 -4
- package/lib/progress/definition.d.ts +4 -4
- package/lib/progress/index.d.ts +1 -1
- package/lib/progress/progress.d.ts +9 -9
- package/lib/progress/progress.template.d.ts +5 -5
- package/lib/progress-ring/definition.d.ts +4 -4
- package/lib/progress-ring/index.d.ts +1 -1
- package/lib/progress-ring/progress-ring.d.ts +7 -7
- package/lib/progress-ring/progress-ring.template.d.ts +4 -4
- package/lib/radio/definition.d.ts +3 -3
- package/lib/radio/index.d.ts +1 -1
- package/lib/radio/radio.d.ts +7 -7
- package/lib/radio/radio.template.d.ts +4 -4
- package/lib/radio-group/definition.d.ts +11 -11
- package/lib/radio-group/index.d.ts +1 -1
- package/lib/radio-group/radio-group.d.ts +4 -4
- package/lib/radio-group/radio-group.template.d.ts +4 -4
- package/lib/select/definition.d.ts +4 -4
- package/lib/select/index.d.ts +1 -1
- package/lib/select/select.d.ts +17 -18
- package/lib/select/select.template.d.ts +4 -4
- package/lib/side-drawer/definition.d.ts +3 -3
- package/lib/side-drawer/index.d.ts +1 -1
- package/lib/side-drawer/side-drawer.d.ts +9 -9
- package/lib/side-drawer/side-drawer.template.d.ts +4 -4
- package/lib/slider/definition.d.ts +3 -3
- package/lib/slider/index.d.ts +1 -1
- package/lib/slider/slider.d.ts +4 -4
- package/lib/slider/slider.template.d.ts +4 -4
- package/lib/switch/definition.d.ts +4 -4
- package/lib/switch/index.d.ts +1 -1
- package/lib/switch/switch.d.ts +7 -7
- package/lib/switch/switch.template.d.ts +4 -4
- package/lib/tab/definition.d.ts +4 -4
- package/lib/tab/index.d.ts +1 -1
- package/lib/tab/tab.d.ts +14 -14
- package/lib/tab/tab.template.d.ts +3 -3
- package/lib/tab-panel/definition.d.ts +3 -3
- package/lib/tab-panel/index.d.ts +1 -1
- package/lib/tab-panel/tab-panel.d.ts +3 -3
- package/lib/tab-panel/tab-panel.template.d.ts +2 -2
- package/lib/tabs/definition.d.ts +3 -3
- package/lib/tabs/index.d.ts +1 -1
- package/lib/tabs/tabs.d.ts +15 -15
- package/lib/tabs/tabs.template.d.ts +2 -2
- package/lib/tag/definition.d.ts +4 -4
- package/lib/tag/index.d.ts +1 -1
- package/lib/tag/tag.d.ts +22 -22
- package/lib/tag/tag.template.d.ts +4 -4
- package/lib/tag-group/definition.d.ts +3 -3
- package/lib/tag-group/index.d.ts +1 -1
- package/lib/tag-group/tag-group.d.ts +3 -3
- package/lib/tag-group/tag-group.template.d.ts +4 -4
- package/lib/text-anchor/definition.d.ts +3 -3
- package/lib/text-anchor/index.d.ts +1 -1
- package/lib/text-anchor/text-anchor.d.ts +7 -7
- package/lib/text-anchor/text-anchor.template.d.ts +4 -4
- package/lib/text-area/definition.d.ts +4 -4
- package/lib/text-area/index.d.ts +1 -1
- package/lib/text-area/text-area.d.ts +8 -9
- package/lib/text-area/text-area.template.d.ts +4 -4
- package/lib/text-field/definition.d.ts +4 -4
- package/lib/text-field/index.d.ts +1 -1
- package/lib/text-field/text-field.d.ts +13 -14
- package/lib/text-field/text-field.template.d.ts +4 -4
- package/lib/toggletip/definition.d.ts +3 -3
- package/lib/toggletip/index.d.ts +1 -1
- package/lib/toggletip/toggletip.d.ts +15 -15
- package/lib/toggletip/toggletip.template.d.ts +4 -4
- package/lib/tooltip/definition.d.ts +3 -3
- package/lib/tooltip/index.d.ts +1 -1
- package/lib/tooltip/tooltip.d.ts +14 -14
- package/lib/tooltip/tooltip.template.d.ts +4 -4
- package/lib/tree-item/definition.d.ts +3 -3
- package/lib/tree-item/index.d.ts +1 -1
- package/lib/tree-item/tree-item.d.ts +7 -7
- package/lib/tree-item/tree-item.template.d.ts +4 -4
- package/lib/tree-view/definition.d.ts +3 -3
- package/lib/tree-view/index.d.ts +1 -1
- package/lib/tree-view/tree-view.d.ts +3 -3
- package/lib/tree-view/tree-view.template.d.ts +2 -2
- package/listbox/index.js +17 -21
- package/menu/index.js +2 -5
- package/menu-item/index.js +1 -4
- package/nav/index.js +1 -1
- package/nav-disclosure/index.js +1 -3
- package/nav-item/index.js +1 -3
- package/note/index.js +1 -3
- package/number-field/index.js +1 -4
- package/option/index.js +0 -2
- package/package.json +10 -8
- package/pagination/index.js +2 -6
- package/popup/index.js +0 -3
- package/progress/index.js +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.js +3 -3
- package/select/index.js +1 -4
- package/shared/affix.js +2 -5
- package/shared/anchor.js +2 -1
- package/shared/apply-mixins.js +1 -1
- package/shared/definition.js +7 -9
- package/shared/definition10.js +13 -17
- package/shared/definition11.js +6 -9
- package/shared/definition12.js +16 -18
- package/shared/definition13.js +6 -8
- package/shared/definition14.js +7 -12
- package/shared/definition15.js +43 -52
- package/shared/definition16.js +8 -71
- package/shared/definition17.js +36 -45
- package/shared/definition18.js +19 -24
- package/shared/definition19.js +45 -49
- package/shared/definition2.js +24 -28
- package/shared/definition20.js +390 -281
- package/shared/definition21.js +12 -16
- package/shared/definition22.js +82 -168
- package/shared/definition23.js +35 -41
- package/shared/definition24.js +6 -8
- package/shared/definition25.js +10 -14
- package/shared/definition26.js +40 -42
- package/shared/definition27.js +2285 -48
- package/shared/definition28.js +46 -38
- package/shared/definition29.js +38 -370
- package/shared/definition3.js +5 -9
- package/shared/definition30.js +348 -302
- package/shared/definition31.js +365 -14
- package/shared/definition32.js +12 -71
- package/shared/definition33.js +63 -26
- package/shared/definition34.js +24 -40
- package/shared/definition35.js +32 -436
- package/shared/definition36.js +428 -217
- package/shared/definition37.js +175 -77
- package/shared/definition38.js +50 -34
- package/shared/definition39.js +36 -430
- package/shared/definition4.js +3 -5
- package/shared/definition40.js +358 -589
- package/shared/definition41.js +644 -75
- package/shared/definition42.js +70 -587
- package/shared/definition43.js +503 -84
- package/shared/definition44.js +124 -52
- package/shared/definition45.js +57 -19
- package/shared/definition46.js +17 -487
- package/shared/definition47.js +477 -102
- package/shared/definition48.js +109 -19
- package/shared/definition49.js +17 -276
- package/shared/definition5.js +7 -8
- package/shared/definition50.js +253 -101
- package/shared/definition51.js +114 -629
- package/shared/definition52.js +92 -85
- package/shared/definition53.js +112 -70
- package/shared/definition54.js +65 -294
- package/shared/definition55.js +303 -0
- package/shared/definition6.js +17 -23
- package/shared/definition7.js +44 -47
- package/shared/definition8.js +3 -5
- package/shared/definition9.js +13 -17
- package/shared/design-system/index.d.ts +3 -3
- package/shared/focus2.js +1 -3
- package/shared/form-associated.js +1 -1
- package/shared/form-elements.js +16 -20
- package/shared/icon.js +2 -1171
- package/shared/index.js +41 -1549
- package/shared/listbox.js +1 -1
- package/shared/patterns/affix.d.ts +9 -9
- package/shared/patterns/focus.d.ts +3 -3
- package/shared/patterns/form-elements/form-elements.d.ts +57 -57
- package/shared/patterns/form-elements/index.d.ts +1 -1
- package/shared/patterns/index.d.ts +3 -3
- package/shared/repeat.js +1 -1
- package/shared/text-anchor.template.js +38 -40
- package/shared/text-field.js +1 -1
- package/shared/text-field2.js +1 -1
- package/shared/when.js +19 -5
- package/side-drawer/index.js +1 -1
- package/slider/index.js +1 -4
- 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 +17 -17
- package/styles/tokens/theme-light.css +17 -17
- package/switch/index.js +1 -3
- package/tab/index.js +1 -3
- package/tab-panel/index.js +1 -1
- package/tabs/index.js +3 -5
- package/tag/index.js +1 -3
- package/tag-group/index.js +1 -1
- package/text-anchor/index.js +0 -2
- package/text-area/index.js +1 -3
- package/text-field/index.js +1 -3
- package/toggletip/index.js +1 -5
- package/tooltip/index.js +1 -4
- package/tree-item/index.js +2 -4
- package/tree-view/index.js +1 -1
- package/vivid.api.json +210 -848
- package/shared/es.object.assign.js +0 -68
- package/shared/es.regexp.to-string.js +0 -61
- package/shared/es.string.includes.js +0 -83
- package/shared/string-trim.js +0 -40
- package/shared/to-string.js +0 -51
package/shared/definition41.js
CHANGED
|
@@ -1,90 +1,659 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as DOM, O as Observable, _ as __decorate, a as attr, v as volatile, o as observable, b as __metadata, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { f as focusRegistries } from './definition4.js';
|
|
3
|
+
import { P as Popup, p as popupRegistries } from './definition20.js';
|
|
4
|
+
import { i as iconRegistries } from './definition3.js';
|
|
5
|
+
import { l as listboxOptionRegistries } from './definition21.js';
|
|
6
|
+
import { A as AffixIconWithTrailing, a as affixIconTemplateFactory } from './affix.js';
|
|
7
|
+
import './focus.js';
|
|
8
|
+
import { e as errorText, f as formElements, F as FormElementSuccessText, a as FormElementHelperText, g as getFeedbackTemplate } from './form-elements.js';
|
|
9
|
+
import { b as ListboxElement, L as Listbox, D as DelegatesARIAListbox, a as Listbox$1 } from './listbox.js';
|
|
10
|
+
import { S as StartEnd } from './start-end.js';
|
|
11
|
+
import { a as applyMixins } from './apply-mixins.js';
|
|
12
|
+
import { F as FormAssociated } from './form-associated.js';
|
|
13
|
+
import { S as SelectPosition } from './select.options.js';
|
|
14
|
+
import { u as uniqueId } from './strings.js';
|
|
15
|
+
import { g as keyTab, f as keyEscape, d as keyEnter, k as keyEnd, a as keyHome, e as keySpace, b as keyArrowDown, c as keyArrowUp } from './key-codes.js';
|
|
16
|
+
import { f as focusTemplateFactory } from './focus2.js';
|
|
2
17
|
import { w as when } from './when.js';
|
|
18
|
+
import { r as ref } from './ref.js';
|
|
19
|
+
import { s as slotted } from './slotted.js';
|
|
3
20
|
import { c as classNames } from './class-names.js';
|
|
4
21
|
|
|
5
|
-
|
|
6
|
-
|
|
22
|
+
class _Select extends ListboxElement {
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A form-associated base class for the {@link @microsoft/fast-foundation#(Select:class)} component.
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
class FormAssociatedSelect extends FormAssociated(_Select) {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
this.proxy = document.createElement("select");
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A Select Custom HTML Element.
|
|
38
|
+
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#select | ARIA select }.
|
|
39
|
+
*
|
|
40
|
+
* @slot start - Content which can be provided before the button content
|
|
41
|
+
* @slot end - Content which can be provided after the button content
|
|
42
|
+
* @slot button-container - The element representing the select button
|
|
43
|
+
* @slot selected-value - The selected value
|
|
44
|
+
* @slot indicator - The visual indicator for the expand/collapse state of the button
|
|
45
|
+
* @slot - The default slot for slotted options
|
|
46
|
+
* @csspart control - The element representing the select invoking element
|
|
47
|
+
* @csspart selected-value - The element wrapping the selected value
|
|
48
|
+
* @csspart indicator - The element wrapping the visual indicator
|
|
49
|
+
* @csspart listbox - The listbox element
|
|
50
|
+
* @fires input - Fires a custom 'input' event when the value updates
|
|
51
|
+
* @fires change - Fires a custom 'change' event when the value updates
|
|
52
|
+
*
|
|
53
|
+
* @public
|
|
54
|
+
*/
|
|
55
|
+
class Select$1 extends FormAssociatedSelect {
|
|
56
|
+
constructor() {
|
|
57
|
+
super(...arguments);
|
|
58
|
+
/**
|
|
59
|
+
* The open attribute.
|
|
60
|
+
*
|
|
61
|
+
* @public
|
|
62
|
+
* @remarks
|
|
63
|
+
* HTML Attribute: open
|
|
64
|
+
*/
|
|
65
|
+
this.open = false;
|
|
66
|
+
/**
|
|
67
|
+
* Indicates the initial state of the position attribute.
|
|
68
|
+
*
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
this.forcedPosition = false;
|
|
72
|
+
/**
|
|
73
|
+
* The unique id for the internal listbox element.
|
|
74
|
+
*
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
|
+
this.listboxId = uniqueId("listbox-");
|
|
78
|
+
/**
|
|
79
|
+
* The max height for the listbox when opened.
|
|
80
|
+
*
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
this.maxHeight = 0;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Sets focus and synchronizes ARIA attributes when the open property changes.
|
|
87
|
+
*
|
|
88
|
+
* @param prev - the previous open value
|
|
89
|
+
* @param next - the current open value
|
|
90
|
+
*
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
93
|
+
openChanged(prev, next) {
|
|
94
|
+
if (!this.collapsible) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (this.open) {
|
|
98
|
+
this.ariaControls = this.listboxId;
|
|
99
|
+
this.ariaExpanded = "true";
|
|
100
|
+
this.setPositioning();
|
|
101
|
+
this.focusAndScrollOptionIntoView();
|
|
102
|
+
this.indexWhenOpened = this.selectedIndex;
|
|
103
|
+
// focus is directed to the element when `open` is changed programmatically
|
|
104
|
+
DOM.queueUpdate(() => this.focus());
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
this.ariaControls = "";
|
|
108
|
+
this.ariaExpanded = "false";
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The component is collapsible when in single-selection mode with no size attribute.
|
|
112
|
+
*
|
|
113
|
+
* @internal
|
|
114
|
+
*/
|
|
115
|
+
get collapsible() {
|
|
116
|
+
return !(this.multiple || typeof this.size === "number");
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The value property.
|
|
120
|
+
*
|
|
121
|
+
* @public
|
|
122
|
+
*/
|
|
123
|
+
get value() {
|
|
124
|
+
Observable.track(this, "value");
|
|
125
|
+
return this._value;
|
|
126
|
+
}
|
|
127
|
+
set value(next) {
|
|
128
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
129
|
+
const prev = `${this._value}`;
|
|
130
|
+
if ((_a = this._options) === null || _a === void 0 ? void 0 : _a.length) {
|
|
131
|
+
const selectedIndex = this._options.findIndex(el => el.value === next);
|
|
132
|
+
const prevSelectedValue = (_c = (_b = this._options[this.selectedIndex]) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : null;
|
|
133
|
+
const nextSelectedValue = (_e = (_d = this._options[selectedIndex]) === null || _d === void 0 ? void 0 : _d.value) !== null && _e !== void 0 ? _e : null;
|
|
134
|
+
if (selectedIndex === -1 || prevSelectedValue !== nextSelectedValue) {
|
|
135
|
+
next = "";
|
|
136
|
+
this.selectedIndex = selectedIndex;
|
|
137
|
+
}
|
|
138
|
+
next = (_g = (_f = this.firstSelectedOption) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : next;
|
|
139
|
+
}
|
|
140
|
+
if (prev !== next) {
|
|
141
|
+
this._value = next;
|
|
142
|
+
super.valueChanged(prev, next);
|
|
143
|
+
Observable.notify(this, "value");
|
|
144
|
+
this.updateDisplayValue();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Sets the value and display value to match the first selected option.
|
|
149
|
+
*
|
|
150
|
+
* @param shouldEmit - if true, the input and change events will be emitted
|
|
151
|
+
*
|
|
152
|
+
* @internal
|
|
153
|
+
*/
|
|
154
|
+
updateValue(shouldEmit) {
|
|
155
|
+
var _a, _b;
|
|
156
|
+
if (this.$fastController.isConnected) {
|
|
157
|
+
this.value = (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : "";
|
|
158
|
+
}
|
|
159
|
+
if (shouldEmit) {
|
|
160
|
+
this.$emit("input");
|
|
161
|
+
this.$emit("change", this, {
|
|
162
|
+
bubbles: true,
|
|
163
|
+
composed: undefined,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Updates the proxy value when the selected index changes.
|
|
169
|
+
*
|
|
170
|
+
* @param prev - the previous selected index
|
|
171
|
+
* @param next - the next selected index
|
|
172
|
+
*
|
|
173
|
+
* @internal
|
|
174
|
+
*/
|
|
175
|
+
selectedIndexChanged(prev, next) {
|
|
176
|
+
super.selectedIndexChanged(prev, next);
|
|
177
|
+
this.updateValue();
|
|
178
|
+
}
|
|
179
|
+
positionChanged(prev, next) {
|
|
180
|
+
this.positionAttribute = next;
|
|
181
|
+
this.setPositioning();
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Calculate and apply listbox positioning based on available viewport space.
|
|
185
|
+
*
|
|
186
|
+
* @public
|
|
187
|
+
*/
|
|
188
|
+
setPositioning() {
|
|
189
|
+
const currentBox = this.getBoundingClientRect();
|
|
190
|
+
const viewportHeight = window.innerHeight;
|
|
191
|
+
const availableBottom = viewportHeight - currentBox.bottom;
|
|
192
|
+
this.position = this.forcedPosition
|
|
193
|
+
? this.positionAttribute
|
|
194
|
+
: currentBox.top > availableBottom
|
|
195
|
+
? SelectPosition.above
|
|
196
|
+
: SelectPosition.below;
|
|
197
|
+
this.positionAttribute = this.forcedPosition
|
|
198
|
+
? this.positionAttribute
|
|
199
|
+
: this.position;
|
|
200
|
+
this.maxHeight =
|
|
201
|
+
this.position === SelectPosition.above ? ~~currentBox.top : ~~availableBottom;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* The value displayed on the button.
|
|
205
|
+
*
|
|
206
|
+
* @public
|
|
207
|
+
*/
|
|
208
|
+
get displayValue() {
|
|
209
|
+
var _a, _b;
|
|
210
|
+
Observable.track(this, "displayValue");
|
|
211
|
+
return (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : "";
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Synchronize the `aria-disabled` property when the `disabled` property changes.
|
|
215
|
+
*
|
|
216
|
+
* @param prev - The previous disabled value
|
|
217
|
+
* @param next - The next disabled value
|
|
218
|
+
*
|
|
219
|
+
* @internal
|
|
220
|
+
*/
|
|
221
|
+
disabledChanged(prev, next) {
|
|
222
|
+
if (super.disabledChanged) {
|
|
223
|
+
super.disabledChanged(prev, next);
|
|
224
|
+
}
|
|
225
|
+
this.ariaDisabled = this.disabled ? "true" : "false";
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Reset the element to its first selectable option when its parent form is reset.
|
|
229
|
+
*
|
|
230
|
+
* @internal
|
|
231
|
+
*/
|
|
232
|
+
formResetCallback() {
|
|
233
|
+
this.setProxyOptions();
|
|
234
|
+
// Call the base class's implementation setDefaultSelectedOption instead of the select's
|
|
235
|
+
// override, in order to reset the selectedIndex without using the value property.
|
|
236
|
+
super.setDefaultSelectedOption();
|
|
237
|
+
if (this.selectedIndex === -1) {
|
|
238
|
+
this.selectedIndex = 0;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Handle opening and closing the listbox when the select is clicked.
|
|
243
|
+
*
|
|
244
|
+
* @param e - the mouse event
|
|
245
|
+
* @internal
|
|
246
|
+
*/
|
|
247
|
+
clickHandler(e) {
|
|
248
|
+
// do nothing if the select is disabled
|
|
249
|
+
if (this.disabled) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
if (this.open) {
|
|
253
|
+
const captured = e.target.closest(`option,[role=option]`);
|
|
254
|
+
if (captured && captured.disabled) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
super.clickHandler(e);
|
|
259
|
+
this.open = this.collapsible && !this.open;
|
|
260
|
+
if (!this.open && this.indexWhenOpened !== this.selectedIndex) {
|
|
261
|
+
this.updateValue(true);
|
|
262
|
+
}
|
|
263
|
+
return true;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Handles focus state when the element or its children lose focus.
|
|
267
|
+
*
|
|
268
|
+
* @param e - The focus event
|
|
269
|
+
* @internal
|
|
270
|
+
*/
|
|
271
|
+
focusoutHandler(e) {
|
|
272
|
+
var _a;
|
|
273
|
+
super.focusoutHandler(e);
|
|
274
|
+
if (!this.open) {
|
|
275
|
+
return true;
|
|
276
|
+
}
|
|
277
|
+
const focusTarget = e.relatedTarget;
|
|
278
|
+
if (this.isSameNode(focusTarget)) {
|
|
279
|
+
this.focus();
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
if (!((_a = this.options) === null || _a === void 0 ? void 0 : _a.includes(focusTarget))) {
|
|
283
|
+
this.open = false;
|
|
284
|
+
if (this.indexWhenOpened !== this.selectedIndex) {
|
|
285
|
+
this.updateValue(true);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Updates the value when an option's value changes.
|
|
291
|
+
*
|
|
292
|
+
* @param source - the source object
|
|
293
|
+
* @param propertyName - the property to evaluate
|
|
294
|
+
*
|
|
295
|
+
* @internal
|
|
296
|
+
* @override
|
|
297
|
+
*/
|
|
298
|
+
handleChange(source, propertyName) {
|
|
299
|
+
super.handleChange(source, propertyName);
|
|
300
|
+
if (propertyName === "value") {
|
|
301
|
+
this.updateValue();
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Synchronize the form-associated proxy and updates the value property of the element.
|
|
306
|
+
*
|
|
307
|
+
* @param prev - the previous collection of slotted option elements
|
|
308
|
+
* @param next - the next collection of slotted option elements
|
|
309
|
+
*
|
|
310
|
+
* @internal
|
|
311
|
+
*/
|
|
312
|
+
slottedOptionsChanged(prev, next) {
|
|
313
|
+
this.options.forEach(o => {
|
|
314
|
+
const notifier = Observable.getNotifier(o);
|
|
315
|
+
notifier.unsubscribe(this, "value");
|
|
316
|
+
});
|
|
317
|
+
super.slottedOptionsChanged(prev, next);
|
|
318
|
+
this.options.forEach(o => {
|
|
319
|
+
const notifier = Observable.getNotifier(o);
|
|
320
|
+
notifier.subscribe(this, "value");
|
|
321
|
+
});
|
|
322
|
+
this.setProxyOptions();
|
|
323
|
+
this.updateValue();
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Prevents focus when size is set and a scrollbar is clicked.
|
|
327
|
+
*
|
|
328
|
+
* @param e - the mouse event object
|
|
329
|
+
*
|
|
330
|
+
* @override
|
|
331
|
+
* @internal
|
|
332
|
+
*/
|
|
333
|
+
mousedownHandler(e) {
|
|
334
|
+
var _a;
|
|
335
|
+
if (e.offsetX >= 0 && e.offsetX <= ((_a = this.listbox) === null || _a === void 0 ? void 0 : _a.scrollWidth)) {
|
|
336
|
+
return super.mousedownHandler(e);
|
|
337
|
+
}
|
|
338
|
+
return this.collapsible;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Sets the multiple property on the proxy element.
|
|
342
|
+
*
|
|
343
|
+
* @param prev - the previous multiple value
|
|
344
|
+
* @param next - the current multiple value
|
|
345
|
+
*/
|
|
346
|
+
multipleChanged(prev, next) {
|
|
347
|
+
super.multipleChanged(prev, next);
|
|
348
|
+
if (this.proxy) {
|
|
349
|
+
this.proxy.multiple = next;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Updates the selectedness of each option when the list of selected options changes.
|
|
354
|
+
*
|
|
355
|
+
* @param prev - the previous list of selected options
|
|
356
|
+
* @param next - the current list of selected options
|
|
357
|
+
*
|
|
358
|
+
* @override
|
|
359
|
+
* @internal
|
|
360
|
+
*/
|
|
361
|
+
selectedOptionsChanged(prev, next) {
|
|
362
|
+
var _a;
|
|
363
|
+
super.selectedOptionsChanged(prev, next);
|
|
364
|
+
(_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o, i) => {
|
|
365
|
+
var _a;
|
|
366
|
+
const proxyOption = (_a = this.proxy) === null || _a === void 0 ? void 0 : _a.options.item(i);
|
|
367
|
+
if (proxyOption) {
|
|
368
|
+
proxyOption.selected = o.selected;
|
|
369
|
+
}
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Sets the selected index to match the first option with the selected attribute, or
|
|
374
|
+
* the first selectable option.
|
|
375
|
+
*
|
|
376
|
+
* @override
|
|
377
|
+
* @internal
|
|
378
|
+
*/
|
|
379
|
+
setDefaultSelectedOption() {
|
|
380
|
+
var _a;
|
|
381
|
+
const options = (_a = this.options) !== null && _a !== void 0 ? _a : Array.from(this.children).filter(Listbox.slottedOptionFilter);
|
|
382
|
+
const selectedIndex = options === null || options === void 0 ? void 0 : options.findIndex(el => el.hasAttribute("selected") || el.selected || el.value === this.value);
|
|
383
|
+
if (selectedIndex !== -1) {
|
|
384
|
+
this.selectedIndex = selectedIndex;
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
this.selectedIndex = 0;
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Resets and fills the proxy to match the component's options.
|
|
391
|
+
*
|
|
392
|
+
* @internal
|
|
393
|
+
*/
|
|
394
|
+
setProxyOptions() {
|
|
395
|
+
if (this.proxy instanceof HTMLSelectElement && this.options) {
|
|
396
|
+
this.proxy.options.length = 0;
|
|
397
|
+
this.options.forEach(option => {
|
|
398
|
+
const proxyOption = option.proxy ||
|
|
399
|
+
(option instanceof HTMLOptionElement ? option.cloneNode() : null);
|
|
400
|
+
if (proxyOption) {
|
|
401
|
+
this.proxy.options.add(proxyOption);
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Handle keyboard interaction for the select.
|
|
408
|
+
*
|
|
409
|
+
* @param e - the keyboard event
|
|
410
|
+
* @internal
|
|
411
|
+
*/
|
|
412
|
+
keydownHandler(e) {
|
|
413
|
+
super.keydownHandler(e);
|
|
414
|
+
const key = e.key || e.key.charCodeAt(0);
|
|
415
|
+
switch (key) {
|
|
416
|
+
case keySpace: {
|
|
417
|
+
e.preventDefault();
|
|
418
|
+
if (this.collapsible && this.typeAheadExpired) {
|
|
419
|
+
this.open = !this.open;
|
|
420
|
+
}
|
|
421
|
+
break;
|
|
422
|
+
}
|
|
423
|
+
case keyHome:
|
|
424
|
+
case keyEnd: {
|
|
425
|
+
e.preventDefault();
|
|
426
|
+
break;
|
|
427
|
+
}
|
|
428
|
+
case keyEnter: {
|
|
429
|
+
e.preventDefault();
|
|
430
|
+
this.open = !this.open;
|
|
431
|
+
break;
|
|
432
|
+
}
|
|
433
|
+
case keyEscape: {
|
|
434
|
+
if (this.collapsible && this.open) {
|
|
435
|
+
e.preventDefault();
|
|
436
|
+
this.open = false;
|
|
437
|
+
}
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
case keyTab: {
|
|
441
|
+
if (this.collapsible && this.open) {
|
|
442
|
+
e.preventDefault();
|
|
443
|
+
this.open = false;
|
|
444
|
+
}
|
|
445
|
+
return true;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
if (!this.open && this.indexWhenOpened !== this.selectedIndex) {
|
|
449
|
+
this.updateValue(true);
|
|
450
|
+
this.indexWhenOpened = this.selectedIndex;
|
|
451
|
+
}
|
|
452
|
+
return !(key === keyArrowDown || key === keyArrowUp);
|
|
453
|
+
}
|
|
454
|
+
connectedCallback() {
|
|
455
|
+
super.connectedCallback();
|
|
456
|
+
this.forcedPosition = !!this.positionAttribute;
|
|
457
|
+
this.addEventListener("contentchange", this.updateDisplayValue);
|
|
458
|
+
}
|
|
459
|
+
disconnectedCallback() {
|
|
460
|
+
this.removeEventListener("contentchange", this.updateDisplayValue);
|
|
461
|
+
super.disconnectedCallback();
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Updates the proxy's size property when the size attribute changes.
|
|
465
|
+
*
|
|
466
|
+
* @param prev - the previous size
|
|
467
|
+
* @param next - the current size
|
|
468
|
+
*
|
|
469
|
+
* @override
|
|
470
|
+
* @internal
|
|
471
|
+
*/
|
|
472
|
+
sizeChanged(prev, next) {
|
|
473
|
+
super.sizeChanged(prev, next);
|
|
474
|
+
if (this.proxy) {
|
|
475
|
+
this.proxy.size = next;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
*
|
|
480
|
+
* @internal
|
|
481
|
+
*/
|
|
482
|
+
updateDisplayValue() {
|
|
483
|
+
if (this.collapsible) {
|
|
484
|
+
Observable.notify(this, "displayValue");
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
__decorate([
|
|
489
|
+
attr({ attribute: "open", mode: "boolean" })
|
|
490
|
+
], Select$1.prototype, "open", void 0);
|
|
491
|
+
__decorate([
|
|
492
|
+
volatile
|
|
493
|
+
], Select$1.prototype, "collapsible", null);
|
|
494
|
+
__decorate([
|
|
495
|
+
observable
|
|
496
|
+
], Select$1.prototype, "control", void 0);
|
|
497
|
+
__decorate([
|
|
498
|
+
attr({ attribute: "position" })
|
|
499
|
+
], Select$1.prototype, "positionAttribute", void 0);
|
|
500
|
+
__decorate([
|
|
501
|
+
observable
|
|
502
|
+
], Select$1.prototype, "position", void 0);
|
|
503
|
+
__decorate([
|
|
504
|
+
observable
|
|
505
|
+
], Select$1.prototype, "maxHeight", void 0);
|
|
506
|
+
/**
|
|
507
|
+
* Includes ARIA states and properties relating to the ARIA select role.
|
|
508
|
+
*
|
|
509
|
+
* @public
|
|
510
|
+
*/
|
|
511
|
+
class DelegatesARIASelect {
|
|
512
|
+
}
|
|
513
|
+
__decorate([
|
|
514
|
+
observable
|
|
515
|
+
], DelegatesARIASelect.prototype, "ariaControls", void 0);
|
|
516
|
+
applyMixins(DelegatesARIASelect, DelegatesARIAListbox);
|
|
517
|
+
applyMixins(Select$1, StartEnd, DelegatesARIASelect);
|
|
518
|
+
|
|
519
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 07 Aug 2023 18:00:27 GMT\n */\n@supports selector(:focus-visible) {\n :host(:focus) {\n outline: none;\n }\n}\n:host {\n display: inline-flex;\n flex-direction: column;\n gap: 4px;\n --_low-ink-color: var(--vvd-color-neutral-600);\n}\n\n:host([disabled]) {\n --_low-ink-color: var(--vvd-color-neutral-400);\n}\n\n.label {\n color: var(--vvd-color-canvas-text);\n contain: inline-size;\n font: var(--vvd-typography-base);\n}\n\n.control {\n display: flex;\n align-items: center;\n justify-content: space-between;\n background-color: var(--_appearance-color-fill);\n block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n border-radius: var(--_select-control-border-radius);\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n font: var(--vvd-typography-base);\n gap: 8px;\n padding-inline: 16px;\n transition: box-shadow 0.2s, background-color 0.2s;\n}\n.control {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-intermediate);\n}\n.control.appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)).appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transparent;\n}\n.control:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: var(--vvd-color-neutral-100);\n --_appearance-color-outline: var(--vvd-color-neutral-300);\n}\n.control:where(:disabled, .disabled).appearance-ghost {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.control:where(.readonly):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.control:where(.readonly):where(:not(:disabled, .disabled)).appearance-ghost {\n --_appearance-color-text: var(--vvd-color-neutral-600);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.control.connotation-success {\n /* @cssprop [--vvd-select-success-primary=var(--vvd-color-success-500)] */\n --_connotation-color-primary: var(--vvd-select-success-primary, var(--vvd-color-success-500));\n /* @cssprop [--vvd-select-success-backdrop=var(--vvd-color-success-50)] */\n --_connotation-color-backdrop: var(--vvd-select-success-backdrop, var(--vvd-color-success-50));\n /* @cssprop [--vvd-select-success-intermediate=var(--vvd-color-success-500)] */\n --_connotation-color-intermediate: var(--vvd-select-success-intermediate, var(--vvd-color-success-500));\n /* @cssprop [--vvd-select-success-firm=var(--vvd-color-success-600)] */\n --_connotation-color-firm: var(--vvd-select-success-firm, var(--vvd-color-success-600));\n}\n.control.connotation-alert {\n /* @cssprop [--vvd-select-alert-primary=var(--vvd-color-alert-500)] */\n --_connotation-color-primary: var(--vvd-select-alert-primary, var(--vvd-color-alert-500));\n /* @cssprop [--vvd-select-alert-backdrop=var(--vvd-color-alert-50)] */\n --_connotation-color-backdrop: var(--vvd-select-alert-backdrop, var(--vvd-color-alert-50));\n /* @cssprop [--vvd-select-alert-intermediate=var(--vvd-color-alert-500)] */\n --_connotation-color-intermediate: var(--vvd-select-alert-intermediate, var(--vvd-color-alert-500));\n /* @cssprop [--vvd-select-alert-firm=var(--vvd-color-alert-600)] */\n --_connotation-color-firm: var(--vvd-select-alert-firm, var(--vvd-color-alert-600));\n}\n.control:not(.connotation-success, .connotation-alert) {\n /* @cssprop [--vvd-select-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-select-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-select-accent-backdrop=var(--vvd-color-canvas)] */\n --_connotation-color-backdrop: var(--vvd-select-accent-backdrop, var(--vvd-color-canvas));\n /* @cssprop [--vvd-select-accent-intermediate=var(--vvd-color-neutral-500)] */\n --_connotation-color-intermediate: var(--vvd-select-accent-intermediate, var(--vvd-color-neutral-500));\n /* @cssprop [--vvd-select-accent-firm=var(--vvd-color-canvas-text)] */\n --_connotation-color-firm: var(--vvd-select-accent-firm, var(--vvd-color-canvas-text));\n}\n.control-wrapper {\n position: relative;\n}\n.control:not(.disabled) {\n cursor: pointer;\n}\n.control.disabled {\n cursor: not-allowed;\n pointer-events: none;\n}\n.control:not(.shape-pill) {\n --_select-control-border-radius: 6px;\n}\n.control.shape-pill {\n --_select-control-border-radius: 24px;\n}\n\n.list-box {\n display: flex;\n max-height: var(--select-height, 408px);\n flex-direction: column;\n padding: 4px;\n gap: 2px;\n overflow-y: auto;\n}\n\n.icon {\n display: flex;\n flex-shrink: 0;\n}\n\n.selected-value {\n display: flex;\n overflow: hidden;\n flex-grow: 1;\n align-items: center;\n column-gap: 12px;\n white-space: nowrap;\n}\n.selected-value .text {\n overflow: hidden;\n max-inline-size: 100%;\n text-overflow: ellipsis;\n}\n.selected-value slot[name=icon] {\n flex: 0 0 20px;\n font-size: 20px;\n line-height: 1;\n}\n.control.has-meta .selected-value {\n padding-inline-end: 8px;\n}\n\n::part(popup-base) {\n inline-size: max-content;\n min-inline-size: var(--_select-fixed-width, 100%);\n}\n:host([multiple]) ::part(popup-base) {\n position: static;\n}\n\n.focus-indicator {\n border-radius: var(--_select-control-border-radius);\n pointer-events: none;\n}\n:host(:not(:focus-visible)) .focus-indicator {\n display: none;\n}\n:host([multiple]) .focus-indicator {\n --_select-control-border-radius: 6px;\n}";
|
|
520
|
+
|
|
521
|
+
let Select = class Select extends Select$1 {
|
|
7
522
|
constructor() {
|
|
8
523
|
super(...arguments);
|
|
9
|
-
|
|
10
|
-
this.alternate = false;
|
|
11
|
-
this.modal = false;
|
|
12
|
-
this.open = false;
|
|
13
|
-
this.trailing = false;
|
|
524
|
+
this.fixedDropdown = false;
|
|
14
525
|
}
|
|
15
|
-
|
|
16
|
-
super.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
526
|
+
connectedCallback() {
|
|
527
|
+
super.connectedCallback();
|
|
528
|
+
this._popup.anchor = this._anchor;
|
|
529
|
+
}
|
|
530
|
+
get displayValue() {
|
|
531
|
+
var _a, _b, _c, _d;
|
|
532
|
+
Observable.track(this, 'displayValue');
|
|
533
|
+
return (_d = (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.getAttribute('label')) !== null && _b !== void 0 ? _b : (_c = this.firstSelectedOption) === null || _c === void 0 ? void 0 : _c.text) !== null && _d !== void 0 ? _d : '';
|
|
23
534
|
}
|
|
24
|
-
}
|
|
25
|
-
_SideDrawer_instances = new WeakSet(), _SideDrawer_close = function _SideDrawer_close() {
|
|
26
|
-
this.$emit('close', undefined, {
|
|
27
|
-
bubbles: false
|
|
28
|
-
});
|
|
29
|
-
}, _SideDrawer_open = function _SideDrawer_open() {
|
|
30
|
-
this.$emit('open', undefined, {
|
|
31
|
-
bubbles: false
|
|
32
|
-
});
|
|
33
535
|
};
|
|
536
|
+
__decorate([attr, __metadata("design:type", String)], Select.prototype, "appearance", void 0);
|
|
537
|
+
__decorate([attr, __metadata("design:type", String)], Select.prototype, "shape", void 0);
|
|
538
|
+
__decorate([observable, __metadata("design:type", Array)], Select.prototype, "metaSlottedContent", void 0);
|
|
34
539
|
__decorate([attr({
|
|
35
|
-
mode: 'boolean'
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
__decorate([attr({
|
|
41
|
-
mode: 'boolean'
|
|
42
|
-
}), __metadata("design:type", Object)], SideDrawer.prototype, "open", void 0);
|
|
43
|
-
__decorate([attr({
|
|
44
|
-
mode: 'boolean'
|
|
45
|
-
}), __metadata("design:type", Object)], SideDrawer.prototype, "trailing", void 0);
|
|
46
|
-
|
|
47
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on Tue, 25 Jul 2023 07:38:24 GMT\n */\n.control {\n position: fixed;\n z-index: 1;\n background-color: var(--vvd-color-canvas);\n color: var(--vvd-color-canvas-text);\n inline-size: 280px;\n inset-block: 0;\n overflow-y: auto;\n}\n.control[part~=vvd-theme-alternate] {\n background-color: var(--vvd-color-canvas);\n color: var(--vvd-color-canvas-text);\n color-scheme: var(--vvd-color-scheme);\n}\n.control.trailing {\n inset-inline-end: 0;\n}\n.control:not(.open).trailing {\n transform: translateX(100%);\n}\n.control:not(.open):not(.trailing) {\n transform: translateX(-100%);\n}\n.control.open:not(.modal).trailing + .side-drawer-app-content {\n margin-inline-end: var(--side-drawer-app-content-offset, 280px);\n}\n.control.open:not(.modal):not(.trailing) + .side-drawer-app-content {\n margin-inline-start: var(--side-drawer-app-content-offset, 280px);\n}\n@media (prefers-reduced-motion: no-preference) {\n .control {\n transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n }\n}\n\n.scrim {\n background-color: var(--vvd-color-canvas-text, currentColor);\n opacity: 0.5;\n position: fixed;\n inset: 0;\n}\n.scrim:not(.open) {\n display: none;\n}";
|
|
48
|
-
|
|
49
|
-
let _ = t => t,
|
|
50
|
-
_t,
|
|
51
|
-
_t2;
|
|
52
|
-
const getClasses = ({
|
|
53
|
-
modal,
|
|
54
|
-
open,
|
|
55
|
-
trailing
|
|
56
|
-
}) => classNames('control', ['modal', modal], ['open', open], ['trailing', trailing]);
|
|
57
|
-
const getScrimClasses = ({
|
|
58
|
-
open
|
|
59
|
-
}) => classNames('scrim', ['open', open]);
|
|
60
|
-
const sideDrawerTemplate = () => html(_t || (_t = _`
|
|
61
|
-
<aside class="${0}" part="base ${0}"
|
|
62
|
-
@keydown="${0}">
|
|
63
|
-
<slot></slot>
|
|
64
|
-
</aside>
|
|
540
|
+
mode: 'boolean',
|
|
541
|
+
attribute: 'fixed-dropdown'
|
|
542
|
+
}), __metadata("design:type", Object)], Select.prototype, "fixedDropdown", void 0);
|
|
543
|
+
Select = __decorate([errorText, formElements], Select);
|
|
544
|
+
applyMixins(Select, AffixIconWithTrailing, FormElementHelperText, FormElementSuccessText);
|
|
65
545
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
546
|
+
const getStateClasses = ({
|
|
547
|
+
shape,
|
|
548
|
+
disabled,
|
|
549
|
+
appearance,
|
|
550
|
+
metaSlottedContent,
|
|
551
|
+
errorValidationMessage,
|
|
552
|
+
successText
|
|
553
|
+
}) => classNames(['disabled', disabled], [`appearance-${appearance}`, Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], ['has-meta', Boolean(metaSlottedContent === null || metaSlottedContent === void 0 ? void 0 : metaSlottedContent.length)], ['error connotation-alert', Boolean(errorValidationMessage)], ['success connotation-success', !!successText], ['has-meta', Boolean(metaSlottedContent === null || metaSlottedContent === void 0 ? void 0 : metaSlottedContent.length)]);
|
|
554
|
+
function renderLabel() {
|
|
555
|
+
return html`
|
|
556
|
+
<label for="control" class="label">
|
|
557
|
+
${x => x.label}
|
|
558
|
+
</label>`;
|
|
559
|
+
}
|
|
560
|
+
function selectValue(context) {
|
|
561
|
+
const affixIconTemplate = affixIconTemplateFactory(context, false);
|
|
562
|
+
const focusTemplate = focusTemplateFactory(context);
|
|
563
|
+
return html`
|
|
564
|
+
<div
|
|
565
|
+
class="control ${getStateClasses}"
|
|
566
|
+
?disabled="${x => x.disabled}"
|
|
567
|
+
id="control"
|
|
568
|
+
${ref('_anchor')}
|
|
569
|
+
>
|
|
570
|
+
<div class="selected-value">
|
|
571
|
+
<slot name="icon">
|
|
572
|
+
${when(x => x.icon, html`${x => affixIconTemplate(x.icon)}`)}
|
|
573
|
+
</slot>
|
|
574
|
+
<span class="text">${x => x.displayValue}</span>
|
|
575
|
+
<slot name="meta" ${slotted('metaSlottedContent')}></slot>
|
|
576
|
+
</div>
|
|
577
|
+
${() => affixIconTemplate('chevron-down-line')}
|
|
578
|
+
${() => focusTemplate}
|
|
579
|
+
</div>
|
|
580
|
+
`;
|
|
581
|
+
}
|
|
582
|
+
function setFixedDropdownVarWidth(x) {
|
|
583
|
+
return x.open && x.fixedDropdown ? `--_select-fixed-width: ${Math.round(x.getBoundingClientRect().width)}px` : null;
|
|
584
|
+
}
|
|
585
|
+
function renderControl(context) {
|
|
586
|
+
const focusTemplate = focusTemplateFactory(context);
|
|
587
|
+
const popupTag = context.tagFor(Popup);
|
|
588
|
+
return html`
|
|
589
|
+
${when(x => x.label, renderLabel())}
|
|
590
|
+
<div class="control-wrapper">
|
|
591
|
+
${when(x => !x.multiple, selectValue(context))}
|
|
592
|
+
<${popupTag}
|
|
593
|
+
?open="${x => x.collapsible ? x.open : true}"
|
|
594
|
+
anchor="control"
|
|
595
|
+
placement="bottom-start"
|
|
596
|
+
strategy="${x => x.fixedDropdown ? null : 'absolute'}"
|
|
597
|
+
${ref('_popup')}
|
|
598
|
+
class="popup"
|
|
599
|
+
style="${setFixedDropdownVarWidth}"
|
|
600
|
+
>
|
|
601
|
+
<div
|
|
602
|
+
id="${x => x.listboxId}"
|
|
603
|
+
role="listbox"
|
|
604
|
+
?disabled="${x => x.disabled}"
|
|
605
|
+
${ref('listbox')}
|
|
606
|
+
class="list-box"
|
|
607
|
+
>
|
|
608
|
+
${when(x => x.multiple, focusTemplate)}
|
|
609
|
+
<slot
|
|
610
|
+
${slotted({
|
|
611
|
+
filter: Listbox$1.slottedOptionFilter,
|
|
612
|
+
flatten: true,
|
|
613
|
+
property: 'slottedOptions'
|
|
614
|
+
})}
|
|
615
|
+
></slot>
|
|
616
|
+
</div>
|
|
617
|
+
</${popupTag}>
|
|
618
|
+
</div>
|
|
619
|
+
${when(x => {
|
|
620
|
+
var _a;
|
|
621
|
+
return (_a = x.helperText) === null || _a === void 0 ? void 0 : _a.length;
|
|
622
|
+
}, getFeedbackTemplate('helper', context))}
|
|
623
|
+
${when(x => !x.successText && x.errorValidationMessage, getFeedbackTemplate('error', context))}
|
|
624
|
+
${when(x => x.successText, getFeedbackTemplate('success', context))}
|
|
625
|
+
`;
|
|
626
|
+
}
|
|
627
|
+
const SelectTemplate = context => {
|
|
628
|
+
return html`
|
|
629
|
+
<template class="base"
|
|
630
|
+
aria-label="${x => x.ariaLabel ? x.ariaLabel : x.label}"
|
|
631
|
+
aria-activedescendant="${x => x.ariaActiveDescendant}"
|
|
632
|
+
aria-controls="${x => x.ariaControls}"
|
|
633
|
+
aria-disabled="${x => x.ariaDisabled}"
|
|
634
|
+
aria-expanded="${x => x.ariaExpanded}"
|
|
635
|
+
aria-haspopup="${x => x.collapsible ? 'listbox' : null}"
|
|
636
|
+
aria-multiselectable="${x => x.ariaMultiSelectable}"
|
|
637
|
+
?open="${x => x.open}"
|
|
638
|
+
role="combobox"
|
|
639
|
+
tabindex="${x => !x.disabled ? '0' : null}"
|
|
640
|
+
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
641
|
+
@focusin="${(x, c) => x.focusinHandler(c.event)}"
|
|
642
|
+
@focusout="${(x, c) => x.focusoutHandler(c.event)}"
|
|
643
|
+
@keydown="${(x, c) => x.keydownHandler(c.event)}"
|
|
644
|
+
@mousedown="${(x, c) => x.mousedownHandler(c.event)}"
|
|
645
|
+
>
|
|
646
|
+
${renderControl(context)}
|
|
647
|
+
</template>
|
|
648
|
+
`;
|
|
80
649
|
};
|
|
81
650
|
|
|
82
|
-
const
|
|
83
|
-
baseName: '
|
|
84
|
-
template:
|
|
651
|
+
const selectDefinition = Select.compose({
|
|
652
|
+
baseName: 'select',
|
|
653
|
+
template: SelectTemplate,
|
|
85
654
|
styles: css_248z
|
|
86
655
|
});
|
|
87
|
-
const
|
|
88
|
-
const
|
|
656
|
+
const selectRegistries = [selectDefinition(), ...focusRegistries, ...popupRegistries, ...iconRegistries, ...listboxOptionRegistries];
|
|
657
|
+
const registerSelect = registerFactory(selectRegistries);
|
|
89
658
|
|
|
90
|
-
export {
|
|
659
|
+
export { selectRegistries as a, registerSelect as r, selectDefinition as s };
|