@vonage/vivid 5.24.0 → 5.25.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/README.md +1 -1
- package/avatar/index.cjs +10 -10
- package/avatar/index.js +4 -3
- package/breadcrumb-item/index.cjs +9 -5
- package/breadcrumb-item/index.js +11 -6
- package/bundled/affix.cjs +1 -1
- package/bundled/affix.js +1 -1
- package/bundled/definition10.cjs +2 -1
- package/bundled/definition10.js +3 -2
- package/bundled/definition11.cjs +4 -4
- package/bundled/definition11.js +4 -3
- package/bundled/definition12.cjs +1 -1
- package/bundled/definition12.js +1 -0
- package/bundled/definition15.cjs +5 -5
- package/bundled/definition15.js +4 -3
- package/bundled/definition17.cjs +7 -7
- package/bundled/definition17.js +22 -109
- package/bundled/definition18.cjs +3 -3
- package/bundled/definition18.js +9 -31
- package/bundled/definition19.cjs +19 -19
- package/bundled/definition19.js +3 -2
- package/bundled/definition21.cjs +8 -8
- package/bundled/definition21.js +5 -4
- package/bundled/definition22.cjs +2 -2
- package/bundled/definition22.js +2 -2
- package/bundled/definition24.cjs +4 -4
- package/bundled/definition24.js +4 -3
- package/bundled/definition25.cjs +3 -3
- package/bundled/definition25.js +32 -28
- package/bundled/definition3.cjs +5 -5
- package/bundled/definition3.js +10 -40
- package/bundled/definition4.cjs +6 -6
- package/bundled/definition4.js +4 -3
- package/bundled/definition6.cjs +11 -11
- package/bundled/definition6.js +4 -3
- package/bundled/definition9.cjs +12 -6
- package/bundled/definition9.js +66 -43
- package/bundled/extractOptions.cjs +1 -1
- package/bundled/extractOptions.js +2 -2
- package/bundled/icon.cjs +1 -0
- package/bundled/icon.js +34 -0
- package/bundled/listbox.cjs +1 -1
- package/bundled/listbox.js +5 -2
- package/bundled/mixins.cjs +8 -8
- package/bundled/mixins.js +4 -3
- package/bundled/optgroup.cjs +1 -0
- package/bundled/optgroup.js +27 -0
- package/bundled/option.cjs +1 -0
- package/bundled/option.js +93 -0
- package/bundled/vivid-element.cjs +1 -1
- package/bundled/vivid-element.js +1 -1
- package/card/index.cjs +22 -22
- package/card/index.js +4 -3
- package/color-picker/index.cjs +18 -18
- package/color-picker/index.js +4 -3
- package/combobox/index.cjs +7 -7
- package/combobox/index.js +4 -2
- package/custom-elements.json +4159 -3847
- package/data-grid/index.cjs +24 -24
- package/data-grid/index.js +4 -3
- package/dial-pad/index.cjs +21 -21
- package/dial-pad/index.js +4 -3
- package/dialog/index.cjs +14 -14
- package/dialog/index.js +4 -3
- package/empty-state/index.cjs +3 -3
- package/empty-state/index.js +4 -3
- package/file-picker/index.cjs +7 -7
- package/file-picker/index.js +4 -3
- package/icon/definition.cjs +2 -1
- package/icon/definition.js +2 -1
- package/index.cjs +148 -141
- package/index.js +41 -37
- package/lib/accordion-item/accordion-item.d.ts +1 -0
- package/lib/combobox/combobox.d.ts +1 -1
- package/lib/components.d.ts +1 -0
- package/lib/dial-pad/dial-pad.d.ts +0 -1
- package/lib/listbox/definition.d.ts +3 -0
- package/lib/listbox/index.d.ts +1 -0
- package/lib/listbox/listbox.d.ts +1302 -0
- package/lib/listbox/listbox.template.d.ts +3 -0
- package/lib/listbox/variations.browser-spec.d.ts +1 -0
- package/lib/menu/menu.d.ts +0 -1
- package/lib/number-field/number-field.d.ts +0 -1
- package/lib/rich-text-editor/rte/features/base.d.ts +1 -0
- package/lib/rich-text-editor/rte/utils/default-textblock.d.ts +2 -2
- package/lib/tag-name-map.d.ts +2 -1
- package/lib/text-field/text-field.d.ts +1 -0
- package/lib/toggletip/toggletip.d.ts +1 -0
- package/lib/tooltip/tooltip.d.ts +1 -0
- package/listbox/definition.cjs +5 -0
- package/listbox/definition.js +2 -0
- package/listbox/index.cjs +11 -0
- package/listbox/index.js +540 -0
- package/nav/definition.cjs +1 -1
- package/nav/definition.js +1 -1
- package/nav-disclosure/definition.cjs +1 -1
- package/nav-disclosure/definition.js +1 -1
- package/nav-disclosure/index.cjs +4 -4
- package/nav-disclosure/index.js +4 -3
- package/nav-item/definition.cjs +1 -1
- package/nav-item/definition.js +1 -1
- package/note/definition.cjs +1 -1
- package/note/definition.js +1 -1
- package/number-field/definition.cjs +1 -1
- package/number-field/definition.js +1 -1
- package/optgroup/definition.cjs +2 -1
- package/optgroup/definition.js +2 -1
- package/option/definition.cjs +2 -1
- package/option/definition.js +2 -1
- package/package.json +8 -7
- package/pagination/definition.cjs +1 -1
- package/pagination/definition.js +1 -1
- package/platform-switch/definition.cjs +1 -1
- package/platform-switch/definition.js +1 -1
- package/popover/definition.cjs +1 -1
- package/popover/definition.js +1 -1
- package/popover/index.cjs +5 -5
- package/popover/index.js +4 -3
- package/progress/definition.cjs +1 -1
- package/progress/definition.js +1 -1
- package/radio/definition.cjs +1 -1
- package/radio/definition.js +1 -1
- package/radio-group/definition.cjs +1 -1
- package/radio-group/definition.js +1 -1
- package/range-slider/definition.cjs +1 -1
- package/range-slider/definition.js +1 -1
- package/rich-text-editor/definition.cjs +1 -1
- package/rich-text-editor/definition.js +1 -1
- package/rich-text-editor/index.cjs +13 -13
- package/rich-text-editor/index.js +22 -19
- package/rich-text-view/definition.cjs +1 -1
- package/rich-text-view/definition.js +1 -1
- package/searchable-select/definition.cjs +1 -1
- package/searchable-select/definition.js +1 -1
- package/searchable-select/index.cjs +23 -23
- package/searchable-select/index.js +10 -7
- package/select/definition.cjs +1 -1
- package/select/definition.js +1 -1
- package/selectable-box/definition.cjs +1 -1
- package/selectable-box/definition.js +1 -1
- package/shared/listbox/commands.d.ts +17 -0
- package/shared/listbox/move.d.ts +6 -0
- package/shared/listbox/options.d.ts +12 -0
- package/shared/listbox/selection.d.ts +28 -0
- package/shared/listbox/state.d.ts +26 -0
- package/shared/listbox/typeahead.d.ts +8 -0
- package/shared/listbox/with-options-filter.d.ts +440 -0
- package/shared/listbox/with-options.d.ts +862 -0
- package/side-drawer/definition.cjs +1 -1
- package/side-drawer/definition.js +1 -1
- package/simple-color-picker/definition.cjs +1 -1
- package/simple-color-picker/definition.js +1 -1
- package/simple-color-picker/index.cjs +6 -6
- package/simple-color-picker/index.js +4 -3
- package/split-button/definition.cjs +1 -1
- package/split-button/definition.js +1 -1
- package/status/definition.cjs +1 -1
- package/status/definition.js +1 -1
- package/switch/definition.cjs +1 -1
- package/switch/definition.js +1 -1
- package/tab/definition.cjs +1 -1
- package/tab/definition.js +1 -1
- package/tab-panel/definition.cjs +1 -1
- package/tab-panel/definition.js +1 -1
- package/table/definition.cjs +1 -1
- package/table/definition.js +1 -1
- package/table/index.cjs +13 -13
- package/table/index.js +4 -3
- package/tabs/definition.cjs +1 -1
- package/tabs/definition.js +1 -1
- package/tag/definition.cjs +1 -1
- package/tag/definition.js +1 -1
- package/tag/index.cjs +11 -11
- package/tag/index.js +4 -3
- package/tag-group/definition.cjs +1 -1
- package/tag-group/definition.js +1 -1
- package/text-area/definition.cjs +1 -1
- package/text-area/definition.js +1 -1
- package/time-picker/definition.cjs +1 -1
- package/time-picker/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.cjs +2 -2
- package/unbundled/affix.js +1 -1
- package/unbundled/base-progress.cjs +1 -1
- package/unbundled/base-progress.js +1 -1
- package/unbundled/button.cjs +2 -2
- package/unbundled/button.js +2 -2
- package/unbundled/definition.cjs +2 -65
- package/unbundled/definition.js +4 -61
- package/unbundled/definition11.cjs +4 -3
- package/unbundled/definition11.js +3 -2
- package/unbundled/definition12.cjs +3 -2
- package/unbundled/definition12.js +3 -2
- package/unbundled/definition14.cjs +2 -1
- package/unbundled/definition14.js +2 -1
- package/unbundled/definition17.cjs +9 -4
- package/unbundled/definition17.js +9 -4
- package/unbundled/definition2.cjs +7 -2
- package/unbundled/definition2.js +8 -3
- package/unbundled/definition21.cjs +2 -1
- package/unbundled/definition21.js +2 -1
- package/unbundled/definition23.cjs +2 -1
- package/unbundled/definition23.js +2 -1
- package/unbundled/definition24.cjs +6 -4
- package/unbundled/definition24.js +6 -4
- package/unbundled/definition25.cjs +2 -1
- package/unbundled/definition25.js +2 -1
- package/unbundled/definition26.cjs +7 -4
- package/unbundled/definition26.js +7 -4
- package/unbundled/definition27.cjs +39 -5
- package/unbundled/definition27.js +40 -6
- package/unbundled/definition28.cjs +4 -3
- package/unbundled/definition28.js +4 -3
- package/unbundled/definition29.cjs +5 -168
- package/unbundled/definition29.js +11 -162
- package/unbundled/definition30.cjs +2 -63
- package/unbundled/definition30.js +5 -54
- package/unbundled/definition31.cjs +5 -3
- package/unbundled/definition31.js +5 -3
- package/unbundled/definition32.cjs +2 -1
- package/unbundled/definition32.js +2 -1
- package/unbundled/definition35.cjs +2 -1
- package/unbundled/definition35.js +2 -1
- package/unbundled/definition37.cjs +1 -1
- package/unbundled/definition37.js +1 -1
- package/unbundled/definition39.cjs +1 -1
- package/unbundled/definition39.js +1 -1
- package/unbundled/definition40.cjs +4 -2
- package/unbundled/definition40.js +4 -2
- package/unbundled/definition41.cjs +11 -6
- package/unbundled/definition41.js +11 -6
- package/unbundled/definition42.cjs +5 -4
- package/unbundled/definition42.js +5 -4
- package/unbundled/definition44.cjs +3 -2
- package/unbundled/definition44.js +3 -2
- package/unbundled/definition45.cjs +2 -2
- package/unbundled/definition45.js +2 -2
- package/unbundled/definition49.cjs +583 -79
- package/unbundled/definition49.js +579 -76
- package/unbundled/definition50.cjs +71 -33
- package/unbundled/definition50.js +67 -29
- package/unbundled/definition51.cjs +54 -23
- package/unbundled/definition51.js +52 -18
- package/unbundled/definition52.cjs +23 -39
- package/unbundled/definition52.js +17 -36
- package/unbundled/definition53.cjs +29 -314
- package/unbundled/definition53.js +27 -312
- package/unbundled/definition54.cjs +302 -195
- package/unbundled/definition54.js +298 -191
- package/unbundled/definition55.cjs +210 -40
- package/unbundled/definition55.js +206 -36
- package/unbundled/definition56.cjs +42 -266
- package/unbundled/definition56.js +38 -262
- package/unbundled/definition57.cjs +270 -50
- package/unbundled/definition57.js +267 -46
- package/unbundled/definition58.cjs +48 -146
- package/unbundled/definition58.js +47 -143
- package/unbundled/definition59.cjs +127 -225
- package/unbundled/definition59.js +122 -223
- package/unbundled/definition6.cjs +2 -1
- package/unbundled/definition6.js +2 -1
- package/unbundled/definition60.cjs +199 -418
- package/unbundled/definition60.js +196 -415
- package/unbundled/definition61.cjs +442 -3738
- package/unbundled/definition61.js +432 -3565
- package/unbundled/definition62.cjs +3717 -730
- package/unbundled/definition62.js +3544 -720
- package/unbundled/definition63.cjs +770 -97
- package/unbundled/definition63.js +767 -94
- package/unbundled/definition64.cjs +100 -999
- package/unbundled/definition64.js +98 -994
- package/unbundled/definition65.cjs +991 -93
- package/unbundled/definition65.js +985 -90
- package/unbundled/definition66.cjs +109 -73
- package/unbundled/definition66.js +105 -63
- package/unbundled/definition67.cjs +69 -155
- package/unbundled/definition67.js +60 -152
- package/unbundled/definition68.cjs +155 -119
- package/unbundled/definition68.js +151 -115
- package/unbundled/definition69.cjs +124 -49
- package/unbundled/definition69.js +120 -45
- package/unbundled/definition70.cjs +51 -85
- package/unbundled/definition70.js +50 -81
- package/unbundled/definition71.cjs +91 -19
- package/unbundled/definition71.js +86 -14
- package/unbundled/definition72.cjs +20 -87
- package/unbundled/definition72.js +14 -84
- package/unbundled/definition73.cjs +77 -294
- package/unbundled/definition73.js +72 -217
- package/unbundled/definition74.cjs +289 -311
- package/unbundled/definition74.js +219 -306
- package/unbundled/definition75.cjs +326 -26
- package/unbundled/definition75.js +317 -23
- package/unbundled/definition76.cjs +27 -122
- package/unbundled/definition76.js +22 -118
- package/unbundled/definition77.cjs +105 -232
- package/unbundled/definition77.js +101 -228
- package/unbundled/definition78.cjs +259 -26
- package/unbundled/definition78.js +249 -23
- package/unbundled/definition79.cjs +29 -148
- package/unbundled/definition79.js +27 -133
- package/unbundled/definition80.cjs +118 -173
- package/unbundled/definition80.js +109 -169
- package/unbundled/definition81.cjs +181 -477
- package/unbundled/definition81.js +176 -471
- package/unbundled/definition82.cjs +517 -0
- package/unbundled/definition82.js +497 -0
- package/unbundled/extractOptions.cjs +5 -5
- package/unbundled/extractOptions.js +2 -2
- package/unbundled/icon.cjs +67 -0
- package/unbundled/icon.js +61 -0
- package/unbundled/linkable.cjs +1 -1
- package/unbundled/linkable.js +1 -1
- package/unbundled/listbox.cjs +8 -3
- package/unbundled/listbox.js +7 -2
- package/unbundled/mixins.cjs +2 -1
- package/unbundled/mixins.js +2 -1
- package/unbundled/optgroup.cjs +66 -0
- package/unbundled/optgroup.js +54 -0
- package/unbundled/option.cjs +176 -0
- package/unbundled/option.js +164 -0
- package/unbundled/time-selection-picker.template.cjs +1 -1
- package/unbundled/time-selection-picker.template.js +1 -1
- package/unbundled/vivid-element.cjs +1 -1
- package/unbundled/vivid-element.js +1 -1
- package/video-player/definition.cjs +1 -1
- package/video-player/definition.js +1 -1
- package/vivid.api.json +336 -193
|
@@ -1,162 +1,11 @@
|
|
|
1
|
-
import { d as createRegisterFunction,
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import { a as affixIconTemplateFactory, i as IconWrapper
|
|
5
|
-
import { n as applyHostSemantics
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Determines if the element is a {@link (ListboxOption:class)}
|
|
11
|
-
*
|
|
12
|
-
* @param element - the element to test.
|
|
13
|
-
*/
|
|
14
|
-
function isListboxOption(el) {
|
|
15
|
-
return isHTMLElement(el) && (el.getAttribute("role") === "option" || el instanceof HTMLOptionElement || el instanceof ListboxOption);
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Implements {@link https://www.w3.org/TR/wai-aria-1.1/#option | ARIA option }.
|
|
19
|
-
*
|
|
20
|
-
* @public
|
|
21
|
-
* @component option
|
|
22
|
-
* @slot icon - The preferred way to add an icon to the component.
|
|
23
|
-
* @slot tag-icon - Icon to be displayed in the tag when selected inside of Searchable Select.
|
|
24
|
-
* @slot trailing-meta - For additional elements at the end of the Option.
|
|
25
|
-
* @testAction click click #locator
|
|
26
|
-
*/
|
|
27
|
-
var ListboxOption = class extends HostSemantics(AffixIconWithTrailing(VividElement)) {
|
|
28
|
-
defaultSelectedChanged() {
|
|
29
|
-
if (!this.dirtySelected) {
|
|
30
|
-
this.selected = this.defaultSelected;
|
|
31
|
-
if (this.proxy instanceof HTMLOptionElement) this.proxy.selected = this.defaultSelected;
|
|
32
|
-
}
|
|
33
|
-
if (this.proxy instanceof HTMLOptionElement) this.proxy.defaultSelected = this.defaultSelected;
|
|
34
|
-
}
|
|
35
|
-
disabledChanged() {
|
|
36
|
-
/* v8 ignore if -- @preserve */
|
|
37
|
-
if (this.proxy instanceof HTMLOptionElement) this.proxy.disabled = this.disabled;
|
|
38
|
-
}
|
|
39
|
-
/** @deprecated Use `defaultSelected` instead. */
|
|
40
|
-
get selectedAttribute() {
|
|
41
|
-
return this.defaultSelected;
|
|
42
|
-
}
|
|
43
|
-
set selectedAttribute(value) {
|
|
44
|
-
this.defaultSelected = value;
|
|
45
|
-
}
|
|
46
|
-
selectedChanged() {
|
|
47
|
-
if (!this.dirtySelected) this.dirtySelected = true;
|
|
48
|
-
if (this.proxy instanceof HTMLOptionElement) this.proxy.selected = this.selected;
|
|
49
|
-
}
|
|
50
|
-
valueChanged() {
|
|
51
|
-
if (typeof this.value !== "string") {
|
|
52
|
-
this.value = "";
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
if (this.proxy instanceof HTMLOptionElement) this.proxy.value = this.value;
|
|
56
|
-
}
|
|
57
|
-
get label() {
|
|
58
|
-
return this._label ?? this.text;
|
|
59
|
-
}
|
|
60
|
-
set label(value) {
|
|
61
|
-
this._label = value;
|
|
62
|
-
}
|
|
63
|
-
set text(value) {
|
|
64
|
-
this._text = value;
|
|
65
|
-
}
|
|
66
|
-
get text() {
|
|
67
|
-
return this._text ?? "";
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Provides an accessible name for use by parent components.
|
|
71
|
-
* Note: Does not implement full accessible name computation, e.g. slotted content is missed.
|
|
72
|
-
* @internal
|
|
73
|
-
*/
|
|
74
|
-
_getAccessibleName() {
|
|
75
|
-
return this.ariaLabel || `${this.text}${this.textSecondary ? ` ${this.textSecondary}` : ""}`;
|
|
76
|
-
}
|
|
77
|
-
get form() {
|
|
78
|
-
return null;
|
|
79
|
-
}
|
|
80
|
-
/** @internal */
|
|
81
|
-
get _hasMatchedText() {
|
|
82
|
-
return Boolean(this.matchedText ?? this._vvdSearchText);
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* From is inclusive, to is exclusive.
|
|
86
|
-
* @internal
|
|
87
|
-
*/
|
|
88
|
-
get _matchedRange() {
|
|
89
|
-
const matchedText = this.matchedText ?? this._vvdSearchText;
|
|
90
|
-
if (matchedText) {
|
|
91
|
-
const matchIndex = this.text.toLowerCase().indexOf(matchedText.toLowerCase());
|
|
92
|
-
return matchIndex === -1 ? {
|
|
93
|
-
from: 0,
|
|
94
|
-
to: 0
|
|
95
|
-
} : {
|
|
96
|
-
from: matchIndex,
|
|
97
|
-
to: matchIndex + matchedText.length
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
return {
|
|
101
|
-
from: 0,
|
|
102
|
-
to: 0
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
constructor(text, value, defaultSelected, selected) {
|
|
106
|
-
super();
|
|
107
|
-
this.defaultSelected = false;
|
|
108
|
-
this.dirtySelected = false;
|
|
109
|
-
this.value = "";
|
|
110
|
-
this._highlighted = false;
|
|
111
|
-
this._displayCheckmark = false;
|
|
112
|
-
this._vvdSearchText = "";
|
|
113
|
-
this._isNotMatching = false;
|
|
114
|
-
if (text) this.text = text;
|
|
115
|
-
if (value) this.value = value;
|
|
116
|
-
if (defaultSelected) this.defaultSelected = defaultSelected;
|
|
117
|
-
if (selected) this.selected = selected;
|
|
118
|
-
this.proxy = new Option(this.text, this.value, this.defaultSelected, this.selected);
|
|
119
|
-
this.proxy.disabled = this.disabled;
|
|
120
|
-
}
|
|
121
|
-
/** @internal */
|
|
122
|
-
connectedCallback() {
|
|
123
|
-
super.connectedCallback();
|
|
124
|
-
if (!this.dirtySelected) {
|
|
125
|
-
this.selected = this.defaultSelected;
|
|
126
|
-
this.dirtySelected = false;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
__decorate([attr({ converter: {
|
|
131
|
-
fromView: (value) => {
|
|
132
|
-
if (value === true || value === "true") return true;
|
|
133
|
-
if (value === false || value === "false") return false;
|
|
134
|
-
},
|
|
135
|
-
toView: (value) => value
|
|
136
|
-
} })], ListboxOption.prototype, "checked", void 0);
|
|
137
|
-
__decorate([attr({
|
|
138
|
-
attribute: "selected",
|
|
139
|
-
mode: "boolean"
|
|
140
|
-
})], ListboxOption.prototype, "defaultSelected", void 0);
|
|
141
|
-
__decorate([attr({ mode: "boolean" })], ListboxOption.prototype, "disabled", void 0);
|
|
142
|
-
__decorate([attr({
|
|
143
|
-
attribute: "current-selected",
|
|
144
|
-
mode: "boolean"
|
|
145
|
-
})], ListboxOption.prototype, "selected", void 0);
|
|
146
|
-
__decorate([attr({ attribute: "value" })], ListboxOption.prototype, "value", void 0);
|
|
147
|
-
__decorate([attr({ attribute: "label" })], ListboxOption.prototype, "_label", void 0);
|
|
148
|
-
__decorate([attr({ attribute: "text" })], ListboxOption.prototype, "_text", void 0);
|
|
149
|
-
__decorate([attr({ attribute: "text-secondary" })], ListboxOption.prototype, "textSecondary", void 0);
|
|
150
|
-
__decorate([observable], ListboxOption.prototype, "_highlighted", void 0);
|
|
151
|
-
__decorate([observable], ListboxOption.prototype, "_displayCheckmark", void 0);
|
|
152
|
-
__decorate([attr({ attribute: "matched-text" })], ListboxOption.prototype, "matchedText", void 0);
|
|
153
|
-
__decorate([observable], ListboxOption.prototype, "_vvdSearchText", void 0);
|
|
154
|
-
__decorate([volatile], ListboxOption.prototype, "_hasMatchedText", null);
|
|
155
|
-
__decorate([observable], ListboxOption.prototype, "_isNotMatching", void 0);
|
|
156
|
-
__decorate([volatile], ListboxOption.prototype, "_matchedRange", null);
|
|
157
|
-
__decorate([attr], ListboxOption.prototype, "connotation", void 0);
|
|
158
|
-
__decorate([attr({ attribute: "tag-connotation" })], ListboxOption.prototype, "tagConnotation", void 0);
|
|
159
|
-
//#endregion
|
|
1
|
+
import { d as createRegisterFunction, u as defineVividComponent } from "./vivid-element.js";
|
|
2
|
+
import { t as iconDefinition } from "./definition.js";
|
|
3
|
+
import { t as Icon } from "./icon.js";
|
|
4
|
+
import { a as affixIconTemplateFactory, i as IconWrapper } from "./affix.js";
|
|
5
|
+
import { n as applyHostSemantics } from "./host-semantics.js";
|
|
6
|
+
import { t as ListboxOption } from "./option.js";
|
|
7
|
+
import { html, when } from "@microsoft/fast-element";
|
|
8
|
+
import { classNames } from "@microsoft/fast-web-utilities";
|
|
160
9
|
//#region src/lib/option/option.template.ts
|
|
161
10
|
function text() {
|
|
162
11
|
return html`${when((x) => x.text || x.textSecondary, html`<span class="text">
|
|
@@ -182,7 +31,7 @@ var ListboxOptionTemplate = (context) => {
|
|
|
182
31
|
style="${(x) => x._isNotMatching ? "display: none" : ""}"
|
|
183
32
|
>
|
|
184
33
|
<div
|
|
185
|
-
class="${(x) => classNames("base", [`connotation-${x.connotation}`, Boolean(x.connotation)], ["disabled", x.disabled], ["selected", x.selected], ["
|
|
34
|
+
class="${(x) => classNames("base", [`connotation-${x.connotation}`, Boolean(x.connotation)], ["disabled", x.disabled], ["selected", x.selected], ["highlighted", x._highlighted], ["active", Boolean(x.checked)], ["icon", Boolean(x.icon)], ["two-lines", Boolean(x.text?.length) && Boolean(x.textSecondary?.length)])}"
|
|
186
35
|
>
|
|
187
36
|
${(x) => affixIconTemplate(x.icon, IconWrapper.Slot)} ${text()}
|
|
188
37
|
<slot name="trailing-meta"></slot>
|
|
@@ -194,7 +43,7 @@ var ListboxOptionTemplate = (context) => {
|
|
|
194
43
|
//#endregion
|
|
195
44
|
//#region src/lib/option/definition.ts
|
|
196
45
|
/** @internal */
|
|
197
|
-
var listboxOptionDefinition = defineVividComponent("option", ListboxOption, ListboxOptionTemplate, [iconDefinition], { styles: ":host([disabled]){cursor:not-allowed}.base.connotation-cta{--_connotation-color-primary:var(--vvd-option-cta-primary,var(--vvd-color-cta-500));--_connotation-color-primary-text:var(--vvd-option-cta-primary-text,var(--vvd-color-canvas));--_connotation-color-primary-increment:var(--vvd-option-cta-primary-increment,var(--vvd-color-cta-600));--_connotation-color-firm:var(--vvd-option-cta-firm,var(--vvd-color-cta-600));--_connotation-color-faint:var(--vvd-option-cta-faint,var(--vvd-color-cta-50));--_connotation-color-soft:var(--vvd-option-cta-soft,var(--vvd-color-cta-100));--_connotation-color-pale:var(--vvd-option-cta-pale,var(--vvd-color-cta-300));--_connotation-color-dim:var(--vvd-option-cta-dim,var(--vvd-color-cta-200))}.base:not(.connotation-cta){--_connotation-color-primary:var(--vvd-option-accent-primary,var(--vvd-color-canvas-text));--_connotation-color-primary-text:var(--vvd-option-accent-primary-text,var(--vvd-color-canvas));--_connotation-color-primary-increment:var(--vvd-option-accent-primary-increment,var(--vvd-color-neutral-800));--_connotation-color-firm:var(--vvd-option-accent-firm,var(--vvd-color-canvas-text));--_connotation-color-faint:var(--vvd-option-accent-faint,var(--vvd-color-neutral-50));--_connotation-color-soft:var(--vvd-option-accent-soft,var(--vvd-color-neutral-100));--_connotation-color-pale:var(--vvd-option-accent-pale,var(--vvd-color-neutral-300));--_connotation-color-dim:var(--vvd-option-accent-dim,var(--vvd-color-neutral-200))}.base{--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}@media (hover:hover){.base:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}}.base.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}.base:disabled,.base.disabled{--_appearance-color-text:var(--vvd-color-neutral-300);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}.base:active:where(:not(.disabled,:disabled)),.base.active:where(:not(.disabled,:disabled)),.base.selected:where(:not(.disabled,:disabled)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-soft);--_appearance-color-outline:transparent}@media (hover:hover){.base.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-dim);--_appearance-color-outline:transparent}}.base.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-dim);--_appearance-color-outline:transparent}.base{box-sizing:border-box;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--_option-appearance-color-text,var(--_appearance-color-text));font:var(--vvd-typography-base);align-items:center;gap:var(--_option-gap);hyphens:auto;inline-size:100%;min-block-size:var(--_option-min-block-size);padding-inline:var(--_option-padding-inline);vertical-align:middle;word-break:break-word;--_option-min-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2)));--_option-padding-inline:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2.5);--_option-icon-size:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2);border-radius:8px;display:flex}.base:not(.two-lines){--_option-gap:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 4)) / 3);padding-block:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 4)}.base.two-lines{gap:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2.5);padding-block:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16)) / 2)}.base{user-select:none}.base:not(.disabled){cursor:pointer}.base.disabled{pointer-events:none}:host([scale=condensed]) .base{--_option-min-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 8));--_option-padding-inline:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16)) / 2);--_option-icon-size:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2.5)}:host([scale=condensed]) .base:not(.two-lines){--_option-gap:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 5);padding-block:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 4)) / 6)}:host([scale=condensed]) .base.two-lines{gap:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 4)) / 3);padding-block:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 8)) / 4)}.base.
|
|
46
|
+
var listboxOptionDefinition = defineVividComponent("option", ListboxOption, ListboxOptionTemplate, [iconDefinition], { styles: ":host([disabled]){cursor:not-allowed}.base.connotation-cta{--_connotation-color-primary:var(--vvd-option-cta-primary,var(--vvd-color-cta-500));--_connotation-color-primary-text:var(--vvd-option-cta-primary-text,var(--vvd-color-canvas));--_connotation-color-primary-increment:var(--vvd-option-cta-primary-increment,var(--vvd-color-cta-600));--_connotation-color-firm:var(--vvd-option-cta-firm,var(--vvd-color-cta-600));--_connotation-color-faint:var(--vvd-option-cta-faint,var(--vvd-color-cta-50));--_connotation-color-soft:var(--vvd-option-cta-soft,var(--vvd-color-cta-100));--_connotation-color-pale:var(--vvd-option-cta-pale,var(--vvd-color-cta-300));--_connotation-color-dim:var(--vvd-option-cta-dim,var(--vvd-color-cta-200))}.base:not(.connotation-cta){--_connotation-color-primary:var(--vvd-option-accent-primary,var(--vvd-color-canvas-text));--_connotation-color-primary-text:var(--vvd-option-accent-primary-text,var(--vvd-color-canvas));--_connotation-color-primary-increment:var(--vvd-option-accent-primary-increment,var(--vvd-color-neutral-800));--_connotation-color-firm:var(--vvd-option-accent-firm,var(--vvd-color-canvas-text));--_connotation-color-faint:var(--vvd-option-accent-faint,var(--vvd-color-neutral-50));--_connotation-color-soft:var(--vvd-option-accent-soft,var(--vvd-color-neutral-100));--_connotation-color-pale:var(--vvd-option-accent-pale,var(--vvd-color-neutral-300));--_connotation-color-dim:var(--vvd-option-accent-dim,var(--vvd-color-neutral-200))}.base{--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}@media (hover:hover){.base:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}}.base.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}.base:disabled,.base.disabled{--_appearance-color-text:var(--vvd-color-neutral-300);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}.base:active:where(:not(.disabled,:disabled)),.base.active:where(:not(.disabled,:disabled)),.base.selected:where(:not(.disabled,:disabled)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-soft);--_appearance-color-outline:transparent}@media (hover:hover){.base.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-dim);--_appearance-color-outline:transparent}}.base.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-dim);--_appearance-color-outline:transparent}.base{box-sizing:border-box;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--_option-appearance-color-text,var(--_appearance-color-text));font:var(--vvd-typography-base);align-items:center;gap:var(--_option-gap);hyphens:auto;inline-size:100%;min-block-size:var(--_option-min-block-size);padding-inline:var(--_option-padding-inline);vertical-align:middle;word-break:break-word;--_option-min-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2)));--_option-padding-inline:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2.5);--_option-icon-size:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2);border-radius:8px;display:flex}.base:not(.two-lines){--_option-gap:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 4)) / 3);padding-block:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 4)}.base.two-lines{gap:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2.5);padding-block:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16)) / 2)}.base{user-select:none}.base:not(.disabled){cursor:pointer}.base.disabled{pointer-events:none}:host([scale=condensed]) .base{--_option-min-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 8));--_option-padding-inline:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16)) / 2);--_option-icon-size:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2.5)}:host([scale=condensed]) .base:not(.two-lines){--_option-gap:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 5);padding-block:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 4)) / 6)}:host([scale=condensed]) .base.two-lines{gap:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 4)) / 3);padding-block:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 8)) / 4)}.base.highlighted{--focus-stroke-gap-color:transparent;box-shadow:var(--_suppressable-focus-shadow,0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor));outline:var(--_suppressable-focus-outline,1px solid var(--focus-stroke-color,var(--vvd-color-cta-500)));outline-offset:var(--_suppressable-focus-outline-offset,calc(-1px - var(--focus-inset,0px)))}.base.hidden{display:none}.text{font:var(--vvd-typography-base);flex-direction:column;gap:4px;margin-inline-end:auto;display:flex}.text-primary,.text-secondary{font:var(--vvd-typography-base);display:block}.text-primary{font:var(--vvd-typography-base)}.base:not(.disabled) .text-primary{color:var(--vvd-color-canvas-text)}.base.disabled .text-primary{color:var(--_appearance-color-text)}.base.two-lines .text-primary{font:var(--vvd-typography-base-bold)}.text-secondary{color:var(--vvd-color-neutral-800);font:var(--vvd-typography-base-condensed)}.base.two-lines .text-secondary{color:var(--vvd-color-neutral-600)}.base.disabled .text-secondary{color:var(--_appearance-color-text)}.base.selected:not(.disabled) .text-secondary{color:var(--vvd-color-neutral-800)}.match{color:var(--vvd-color-cta-600);font:var(--vvd-typography-base-bold)}slot[name=icon]{font-size:var(--_option-icon-size);line-height:1}.base:not(.disabled,.selected) slot[name=icon]{color:var(--vvd-color-neutral-600)}.checkmark{font-size:var(--_option-icon-size)}" });
|
|
198
47
|
/**
|
|
199
48
|
* Registers the listbox-option elements with the design system.
|
|
200
49
|
*
|
|
@@ -202,4 +51,4 @@ var listboxOptionDefinition = defineVividComponent("option", ListboxOption, List
|
|
|
202
51
|
*/
|
|
203
52
|
var registerOption = createRegisterFunction(listboxOptionDefinition);
|
|
204
53
|
//#endregion
|
|
205
|
-
export {
|
|
54
|
+
export { registerOption as n, listboxOptionDefinition as t };
|
|
@@ -1,57 +1,8 @@
|
|
|
1
1
|
require("./chunk.cjs");
|
|
2
2
|
const require_vivid_element = require("./vivid-element.cjs");
|
|
3
|
-
const require_decorate = require("./decorate.cjs");
|
|
4
3
|
const require_host_semantics = require("./host-semantics.cjs");
|
|
4
|
+
const require_optgroup = require("./optgroup.cjs");
|
|
5
5
|
let _microsoft_fast_element = require("@microsoft/fast-element");
|
|
6
|
-
let _microsoft_fast_web_utilities = require("@microsoft/fast-web-utilities");
|
|
7
|
-
//#region src/lib/optgroup/optgroup.ts
|
|
8
|
-
/**
|
|
9
|
-
* Determines if the element is an {@link Optgroup}
|
|
10
|
-
*
|
|
11
|
-
* @param element - the element to test.
|
|
12
|
-
*/
|
|
13
|
-
function isOptgroup(el) {
|
|
14
|
-
return el instanceof Optgroup;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Groups options within Select, Searchable Select, or Combobox components
|
|
18
|
-
*
|
|
19
|
-
* @public
|
|
20
|
-
* @component optgroup
|
|
21
|
-
* @slot - Default slot for options.
|
|
22
|
-
* @slot label - Label for the option group.
|
|
23
|
-
*/
|
|
24
|
-
var Optgroup = class extends require_host_semantics.HostSemantics(require_vivid_element.VividElement) {
|
|
25
|
-
constructor(..._args) {
|
|
26
|
-
super(..._args);
|
|
27
|
-
this._computedLabelledBy = null;
|
|
28
|
-
}
|
|
29
|
-
/** @internal */
|
|
30
|
-
_labelSlottedContentChanged() {
|
|
31
|
-
const elements = this._labelSlottedContent.filter((node) => node instanceof Element);
|
|
32
|
-
const ids = [];
|
|
33
|
-
for (const el of elements) {
|
|
34
|
-
if (!el.id) el.id = (0, _microsoft_fast_web_utilities.uniqueId)("vvd-optgroup-label-");
|
|
35
|
-
ids.push(el.id);
|
|
36
|
-
}
|
|
37
|
-
this._computedLabelledBy = ids.join(" ");
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Handles changes to the default slot.
|
|
41
|
-
* Dispatches a bubbling, composed event so that parent components
|
|
42
|
-
* (Select, Combobox, Searchable Select) can re-process their options.
|
|
43
|
-
* @internal
|
|
44
|
-
*/
|
|
45
|
-
_onSlotChange() {
|
|
46
|
-
this.$emit("optgroup-change", void 0, {
|
|
47
|
-
bubbles: true,
|
|
48
|
-
composed: true
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
require_decorate.__decorate([_microsoft_fast_element.observable], Optgroup.prototype, "_labelSlottedContent", void 0);
|
|
53
|
-
require_decorate.__decorate([_microsoft_fast_element.observable], Optgroup.prototype, "_computedLabelledBy", void 0);
|
|
54
|
-
//#endregion
|
|
55
6
|
//#region src/lib/optgroup/optgroup.template.ts
|
|
56
7
|
var OptgroupTemplate = () => {
|
|
57
8
|
return _microsoft_fast_element.html`
|
|
@@ -77,7 +28,7 @@ var OptgroupTemplate = () => {
|
|
|
77
28
|
//#endregion
|
|
78
29
|
//#region src/lib/optgroup/definition.ts
|
|
79
30
|
/** @internal */
|
|
80
|
-
var optgroupDefinition = require_vivid_element.defineVividComponent("optgroup", Optgroup, OptgroupTemplate, [], { styles: ":host{display:block}.base{flex-direction:column;display:flex}slot[name=label]{color:var(--vvd-color-neutral-600);font:var(--vvd-typography-base-condensed-bold);user-select:none;padding-block:8px 4px;padding-inline:8px;display:flex}.options{flex-direction:column;gap:2px;display:flex}" });
|
|
31
|
+
var optgroupDefinition = require_vivid_element.defineVividComponent("optgroup", require_optgroup.Optgroup, OptgroupTemplate, [], { styles: ":host{display:block}.base{flex-direction:column;display:flex}slot[name=label]{color:var(--vvd-color-neutral-600);font:var(--vvd-typography-base-condensed-bold);user-select:none;padding-block:8px 4px;padding-inline:8px;display:flex}.options{flex-direction:column;gap:2px;display:flex}" });
|
|
81
32
|
/**
|
|
82
33
|
* Registers the optgroup element with the design system.
|
|
83
34
|
*
|
|
@@ -85,18 +36,6 @@ var optgroupDefinition = require_vivid_element.defineVividComponent("optgroup",
|
|
|
85
36
|
*/
|
|
86
37
|
var registerOptgroup = require_vivid_element.createRegisterFunction(optgroupDefinition);
|
|
87
38
|
//#endregion
|
|
88
|
-
Object.defineProperty(exports, "Optgroup", {
|
|
89
|
-
enumerable: true,
|
|
90
|
-
get: function() {
|
|
91
|
-
return Optgroup;
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
Object.defineProperty(exports, "isOptgroup", {
|
|
95
|
-
enumerable: true,
|
|
96
|
-
get: function() {
|
|
97
|
-
return isOptgroup;
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
39
|
Object.defineProperty(exports, "optgroupDefinition", {
|
|
101
40
|
enumerable: true,
|
|
102
41
|
get: function() {
|
|
@@ -1,56 +1,7 @@
|
|
|
1
|
-
import { d as createRegisterFunction,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { html,
|
|
5
|
-
import { uniqueId } from "@microsoft/fast-web-utilities";
|
|
6
|
-
//#region src/lib/optgroup/optgroup.ts
|
|
7
|
-
/**
|
|
8
|
-
* Determines if the element is an {@link Optgroup}
|
|
9
|
-
*
|
|
10
|
-
* @param element - the element to test.
|
|
11
|
-
*/
|
|
12
|
-
function isOptgroup(el) {
|
|
13
|
-
return el instanceof Optgroup;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Groups options within Select, Searchable Select, or Combobox components
|
|
17
|
-
*
|
|
18
|
-
* @public
|
|
19
|
-
* @component optgroup
|
|
20
|
-
* @slot - Default slot for options.
|
|
21
|
-
* @slot label - Label for the option group.
|
|
22
|
-
*/
|
|
23
|
-
var Optgroup = class extends HostSemantics(VividElement) {
|
|
24
|
-
constructor(..._args) {
|
|
25
|
-
super(..._args);
|
|
26
|
-
this._computedLabelledBy = null;
|
|
27
|
-
}
|
|
28
|
-
/** @internal */
|
|
29
|
-
_labelSlottedContentChanged() {
|
|
30
|
-
const elements = this._labelSlottedContent.filter((node) => node instanceof Element);
|
|
31
|
-
const ids = [];
|
|
32
|
-
for (const el of elements) {
|
|
33
|
-
if (!el.id) el.id = uniqueId("vvd-optgroup-label-");
|
|
34
|
-
ids.push(el.id);
|
|
35
|
-
}
|
|
36
|
-
this._computedLabelledBy = ids.join(" ");
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Handles changes to the default slot.
|
|
40
|
-
* Dispatches a bubbling, composed event so that parent components
|
|
41
|
-
* (Select, Combobox, Searchable Select) can re-process their options.
|
|
42
|
-
* @internal
|
|
43
|
-
*/
|
|
44
|
-
_onSlotChange() {
|
|
45
|
-
this.$emit("optgroup-change", void 0, {
|
|
46
|
-
bubbles: true,
|
|
47
|
-
composed: true
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
__decorate([observable], Optgroup.prototype, "_labelSlottedContent", void 0);
|
|
52
|
-
__decorate([observable], Optgroup.prototype, "_computedLabelledBy", void 0);
|
|
53
|
-
//#endregion
|
|
1
|
+
import { d as createRegisterFunction, u as defineVividComponent } from "./vivid-element.js";
|
|
2
|
+
import { n as applyHostSemantics } from "./host-semantics.js";
|
|
3
|
+
import { t as Optgroup } from "./optgroup.js";
|
|
4
|
+
import { html, slotted } from "@microsoft/fast-element";
|
|
54
5
|
//#region src/lib/optgroup/optgroup.template.ts
|
|
55
6
|
var OptgroupTemplate = () => {
|
|
56
7
|
return html`
|
|
@@ -84,4 +35,4 @@ var optgroupDefinition = defineVividComponent("optgroup", Optgroup, OptgroupTemp
|
|
|
84
35
|
*/
|
|
85
36
|
var registerOptgroup = createRegisterFunction(optgroupDefinition);
|
|
86
37
|
//#endregion
|
|
87
|
-
export {
|
|
38
|
+
export { registerOptgroup as n, optgroupDefinition as t };
|
|
@@ -13,7 +13,9 @@ const require_with_error_text = require("./with-error-text.cjs");
|
|
|
13
13
|
const require_with_success_text = require("./with-success-text.cjs");
|
|
14
14
|
const require_with_contextual_help = require("./with-contextual-help.cjs");
|
|
15
15
|
const require_text_field = require("./text-field.cjs");
|
|
16
|
+
const require_option = require("./option.cjs");
|
|
16
17
|
const require_definition$3 = require("./definition29.cjs");
|
|
18
|
+
const require_optgroup = require("./optgroup.cjs");
|
|
17
19
|
const require_definition$4 = require("./definition30.cjs");
|
|
18
20
|
const require_listbox = require("./listbox.cjs");
|
|
19
21
|
let _microsoft_fast_element = require("@microsoft/fast-element");
|
|
@@ -64,7 +66,7 @@ var Combobox = class extends require_with_contextual_help.WithContextualHelp(req
|
|
|
64
66
|
this.selectedIndex = this._newDefaultSelectedIndex([], this.options, -1) ?? -1;
|
|
65
67
|
this.value = this.firstSelectedOption?.text || "";
|
|
66
68
|
}
|
|
67
|
-
/**
|
|
69
|
+
/** Validates the element against its constraints (e.g. `required`) and updates its validity state. */
|
|
68
70
|
validate() {
|
|
69
71
|
super.validate(this.control);
|
|
70
72
|
}
|
|
@@ -151,8 +153,8 @@ var Combobox = class extends require_with_contextual_help.WithContextualHelp(req
|
|
|
151
153
|
this._options.forEach((o) => {
|
|
152
154
|
o.hidden = !this.filteredOptions.includes(o);
|
|
153
155
|
});
|
|
154
|
-
for (const el of Array.from(this.children)) if (
|
|
155
|
-
const hasVisibleOption = Array.from(el.children).some((child) =>
|
|
156
|
+
for (const el of Array.from(this.children)) if (require_optgroup.isOptgroup(el)) {
|
|
157
|
+
const hasVisibleOption = Array.from(el.children).some((child) => require_option.isListboxOption(child) && !child.hidden);
|
|
156
158
|
el.style.display = hasVisibleOption ? "" : "none";
|
|
157
159
|
}
|
|
158
160
|
}
|
|
@@ -12,8 +12,10 @@ import { t as WithErrorText } from "./with-error-text.js";
|
|
|
12
12
|
import { t as WithSuccessText } from "./with-success-text.js";
|
|
13
13
|
import { t as WithContextualHelp } from "./with-contextual-help.js";
|
|
14
14
|
import { t as text_field_default } from "./text-field.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { n as isListboxOption } from "./option.js";
|
|
16
|
+
import { t as listboxOptionDefinition } from "./definition29.js";
|
|
17
|
+
import { n as isOptgroup } from "./optgroup.js";
|
|
18
|
+
import { t as optgroupDefinition } from "./definition30.js";
|
|
17
19
|
import { t as Listbox } from "./listbox.js";
|
|
18
20
|
import { Observable, attr, html, observable, ref, slotted, when } from "@microsoft/fast-element";
|
|
19
21
|
import { classNames, limit, uniqueId } from "@microsoft/fast-web-utilities";
|
|
@@ -63,7 +65,7 @@ var Combobox = class extends WithContextualHelp(WithFeedback(WithErrorText(WithS
|
|
|
63
65
|
this.selectedIndex = this._newDefaultSelectedIndex([], this.options, -1) ?? -1;
|
|
64
66
|
this.value = this.firstSelectedOption?.text || "";
|
|
65
67
|
}
|
|
66
|
-
/**
|
|
68
|
+
/** Validates the element against its constraints (e.g. `required`) and updates its validity state. */
|
|
67
69
|
validate() {
|
|
68
70
|
super.validate(this.control);
|
|
69
71
|
}
|
|
@@ -2,6 +2,7 @@ require("./chunk.cjs");
|
|
|
2
2
|
const require_vivid_element = require("./vivid-element.cjs");
|
|
3
3
|
const require_definition = require("./definition.cjs");
|
|
4
4
|
const require_decorate = require("./decorate.cjs");
|
|
5
|
+
const require_icon = require("./icon.cjs");
|
|
5
6
|
const require_utils = require("./utils.cjs");
|
|
6
7
|
let _microsoft_fast_element = require("@microsoft/fast-element");
|
|
7
8
|
//#region src/lib/country/country.scss?inline
|
|
@@ -31,7 +32,7 @@ require_decorate.__decorate([_microsoft_fast_element.attr], Country.prototype, "
|
|
|
31
32
|
//#endregion
|
|
32
33
|
//#region src/lib/country/country.template.ts
|
|
33
34
|
var CountryTemplate = (context) => {
|
|
34
|
-
const iconTag = context.tagFor(
|
|
35
|
+
const iconTag = context.tagFor(require_icon.Icon);
|
|
35
36
|
return _microsoft_fast_element.html`
|
|
36
37
|
<div class="base">
|
|
37
38
|
<slot name="icon" class="icon">
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { d as createRegisterFunction, t as VividElement, u as defineVividComponent } from "./vivid-element.js";
|
|
2
|
-
import {
|
|
2
|
+
import { t as iconDefinition } from "./definition.js";
|
|
3
3
|
import { t as __decorate } from "./decorate.js";
|
|
4
|
+
import { t as Icon } from "./icon.js";
|
|
4
5
|
import { t as getFlagIconName } from "./utils.js";
|
|
5
6
|
import { attr, html, when } from "@microsoft/fast-element";
|
|
6
7
|
//#region src/lib/country/country.scss?inline
|
|
@@ -2,6 +2,7 @@ require("./chunk.cjs");
|
|
|
2
2
|
const require_vivid_element = require("./vivid-element.cjs");
|
|
3
3
|
const require_definition = require("./definition.cjs");
|
|
4
4
|
const require_decorate = require("./decorate.cjs");
|
|
5
|
+
const require_icon = require("./icon.cjs");
|
|
5
6
|
const require_localized = require("./localized.cjs");
|
|
6
7
|
const require_key_codes = require("./key-codes.cjs");
|
|
7
8
|
const require_host_semantics = require("./host-semantics.cjs");
|
|
@@ -1868,7 +1869,7 @@ function calculateAriaSelectedValue(x) {
|
|
|
1868
1869
|
return null;
|
|
1869
1870
|
}
|
|
1870
1871
|
function renderSortIcons(c) {
|
|
1871
|
-
const iconTag = c.tagFor(
|
|
1872
|
+
const iconTag = c.tagFor(require_icon.Icon);
|
|
1872
1873
|
return _microsoft_fast_element.html`
|
|
1873
1874
|
${(0, _microsoft_fast_element.when)(shouldShowSortIcons, _microsoft_fast_element.html`
|
|
1874
1875
|
<${iconTag} class="header-icon" name="${getSortIcon}"></${iconTag}>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { d as createRegisterFunction, t as VividElement, u as defineVividComponent } from "./vivid-element.js";
|
|
2
|
-
import {
|
|
2
|
+
import { t as iconDefinition } from "./definition.js";
|
|
3
3
|
import { t as __decorate } from "./decorate.js";
|
|
4
|
+
import { t as Icon } from "./icon.js";
|
|
4
5
|
import { t as Localized } from "./localized.js";
|
|
5
6
|
import { n as keyArrowRight$1, t as keyArrowLeft$1 } from "./key-codes.js";
|
|
6
7
|
import { n as applyHostSemantics, t as HostSemantics } from "./host-semantics.js";
|
|
@@ -17,7 +17,7 @@ let _microsoft_fast_element = require("@microsoft/fast-element");
|
|
|
17
17
|
*
|
|
18
18
|
* @public
|
|
19
19
|
* @component date-picker
|
|
20
|
-
* @slot helper-text - Describes how to use the
|
|
20
|
+
* @slot helper-text - Describes how to use the Date Picker. Alternative to the `helper-text` attribute.
|
|
21
21
|
* @event {CustomEvent<undefined>} input - Emitted when the date is changed by the user.
|
|
22
22
|
* @event {CustomEvent<undefined>} change - Emitted when the date is changed by the user.
|
|
23
23
|
* @vueModel modelValue value input,@lazy:change `event.currentTarget.value`
|
|
@@ -16,7 +16,7 @@ import { volatile } from "@microsoft/fast-element";
|
|
|
16
16
|
*
|
|
17
17
|
* @public
|
|
18
18
|
* @component date-picker
|
|
19
|
-
* @slot helper-text - Describes how to use the
|
|
19
|
+
* @slot helper-text - Describes how to use the Date Picker. Alternative to the `helper-text` attribute.
|
|
20
20
|
* @event {CustomEvent<undefined>} input - Emitted when the date is changed by the user.
|
|
21
21
|
* @event {CustomEvent<undefined>} change - Emitted when the date is changed by the user.
|
|
22
22
|
* @vueModel modelValue value input,@lazy:change `event.currentTarget.value`
|
|
@@ -52,7 +52,7 @@ var ValidDateTimeFilter = {
|
|
|
52
52
|
*
|
|
53
53
|
* @public
|
|
54
54
|
* @component date-time-picker
|
|
55
|
-
* @slot helper-text - Describes how to use the
|
|
55
|
+
* @slot helper-text - Describes how to use the Date Time Picker. Alternative to the `helper-text` attribute.
|
|
56
56
|
* @event {CustomEvent<undefined>} input - Emitted when the date is changed by the user.
|
|
57
57
|
* @event {CustomEvent<undefined>} change - Emitted when the date is changed by the user.
|
|
58
58
|
* @vueModel modelValue value input,@lazy:change `event.currentTarget.value`
|
|
@@ -51,7 +51,7 @@ var ValidDateTimeFilter = {
|
|
|
51
51
|
*
|
|
52
52
|
* @public
|
|
53
53
|
* @component date-time-picker
|
|
54
|
-
* @slot helper-text - Describes how to use the
|
|
54
|
+
* @slot helper-text - Describes how to use the Date Time Picker. Alternative to the `helper-text` attribute.
|
|
55
55
|
* @event {CustomEvent<undefined>} input - Emitted when the date is changed by the user.
|
|
56
56
|
* @event {CustomEvent<undefined>} change - Emitted when the date is changed by the user.
|
|
57
57
|
* @vueModel modelValue value input,@lazy:change `event.currentTarget.value`
|
|
@@ -2,6 +2,7 @@ require("./chunk.cjs");
|
|
|
2
2
|
const require_vivid_element = require("./vivid-element.cjs");
|
|
3
3
|
const require_definition = require("./definition.cjs");
|
|
4
4
|
const require_decorate = require("./decorate.cjs");
|
|
5
|
+
const require_icon = require("./icon.cjs");
|
|
5
6
|
const require_localized = require("./localized.cjs");
|
|
6
7
|
const require_definition$1 = require("./definition6.cjs");
|
|
7
8
|
const require_definition$2 = require("./definition22.cjs");
|
|
@@ -54,6 +55,7 @@ var DialPad = class extends require_localized.Localized(require_vivid_element.Vi
|
|
|
54
55
|
this._errorAnnouncement = "";
|
|
55
56
|
this._forceAnnouncementToggle = false;
|
|
56
57
|
}
|
|
58
|
+
/** @internal */
|
|
57
59
|
valueChanged(_oldValue, newValue) {
|
|
58
60
|
if (newValue !== void 0 && newValue !== null && this._textFieldEl && newValue !== this._textFieldEl.value) {
|
|
59
61
|
this._textFieldEl.value = newValue;
|
|
@@ -116,7 +118,7 @@ var DialPad = class extends require_localized.Localized(require_vivid_element.Vi
|
|
|
116
118
|
}
|
|
117
119
|
/**
|
|
118
120
|
* Moves focus into the Dial Pad. If `no-input` attribute is specified, it will be the first digit
|
|
119
|
-
* button. Otherwise, the
|
|
121
|
+
* button. Otherwise, the text field will be focused.
|
|
120
122
|
*/
|
|
121
123
|
focus() {
|
|
122
124
|
const digitBtns = this.shadowRoot?.querySelectorAll(".digits .digit-btn");
|
|
@@ -413,7 +415,7 @@ function renderErrorAnnouncement(visuallyHiddenTag) {
|
|
|
413
415
|
}
|
|
414
416
|
var DialPadTemplate = (context) => {
|
|
415
417
|
const buttonTag = context.tagFor(require_definition$1.Button);
|
|
416
|
-
const iconTag = context.tagFor(
|
|
418
|
+
const iconTag = context.tagFor(require_icon.Icon);
|
|
417
419
|
const textFieldTag = context.tagFor(require_definition$3.TextField);
|
|
418
420
|
const visuallyHiddenTag = context.tagFor(require_definition$2.VisuallyHidden);
|
|
419
421
|
return _microsoft_fast_element.html` <div
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { d as createRegisterFunction, t as VividElement, u as defineVividComponent } from "./vivid-element.js";
|
|
2
|
-
import {
|
|
2
|
+
import { t as iconDefinition } from "./definition.js";
|
|
3
3
|
import { t as __decorate } from "./decorate.js";
|
|
4
|
+
import { t as Icon } from "./icon.js";
|
|
4
5
|
import { t as Localized } from "./localized.js";
|
|
5
6
|
import { i as Button, t as buttonDefinition } from "./definition6.js";
|
|
6
7
|
import { n as visuallyHiddenDefinition, r as VisuallyHidden } from "./definition22.js";
|
|
@@ -53,6 +54,7 @@ var DialPad = class extends Localized(VividElement) {
|
|
|
53
54
|
this._errorAnnouncement = "";
|
|
54
55
|
this._forceAnnouncementToggle = false;
|
|
55
56
|
}
|
|
57
|
+
/** @internal */
|
|
56
58
|
valueChanged(_oldValue, newValue) {
|
|
57
59
|
if (newValue !== void 0 && newValue !== null && this._textFieldEl && newValue !== this._textFieldEl.value) {
|
|
58
60
|
this._textFieldEl.value = newValue;
|
|
@@ -115,7 +117,7 @@ var DialPad = class extends Localized(VividElement) {
|
|
|
115
117
|
}
|
|
116
118
|
/**
|
|
117
119
|
* Moves focus into the Dial Pad. If `no-input` attribute is specified, it will be the first digit
|
|
118
|
-
* button. Otherwise, the
|
|
120
|
+
* button. Otherwise, the text field will be focused.
|
|
119
121
|
*/
|
|
120
122
|
focus() {
|
|
121
123
|
const digitBtns = this.shadowRoot?.querySelectorAll(".digits .digit-btn");
|
|
@@ -2,6 +2,7 @@ require("./chunk.cjs");
|
|
|
2
2
|
const require_vivid_element = require("./vivid-element.cjs");
|
|
3
3
|
const require_definition = require("./definition.cjs");
|
|
4
4
|
const require_decorate = require("./decorate.cjs");
|
|
5
|
+
const require_icon = require("./icon.cjs");
|
|
5
6
|
const require_delegates_aria = require("./delegates-aria.cjs");
|
|
6
7
|
const require_localized = require("./localized.cjs");
|
|
7
8
|
const require_definition$1 = require("./definition6.cjs");
|
|
@@ -16,11 +17,11 @@ var dialog_default = ".base{white-space:initial;box-sizing:border-box;color:var(
|
|
|
16
17
|
/**
|
|
17
18
|
* @public
|
|
18
19
|
* @component dialog
|
|
19
|
-
* @slot graphic - Use the graphic slot
|
|
20
|
-
* @slot body - Use the body slot
|
|
21
|
-
* @slot footer - Use the footer slot
|
|
22
|
-
* @slot main - Assign nodes to the main slot to fully override a
|
|
23
|
-
* @slot action-items - Use the action-items slot
|
|
20
|
+
* @slot graphic - Use the graphic slot to replace the icon.
|
|
21
|
+
* @slot body - Use the body slot to add custom HTML to the Dialog.
|
|
22
|
+
* @slot footer - Use the footer slot to add additional content beside the action items.
|
|
23
|
+
* @slot main - Assign nodes to the main slot to fully override a Dialog’s predefined flow and style with your own.
|
|
24
|
+
* @slot action-items - Use the action-items slot to add action buttons to the bottom of the Dialog.
|
|
24
25
|
* @event {CustomEvent<undefined>} open - The `open` event fires when the dialog opens.
|
|
25
26
|
* @event {CustomEvent<string>} close - The `close` event fires when the dialog closes (either via user interaction or via the API). It returns the return value inside the event's details property.
|
|
26
27
|
* @event {CustomEvent<undefined>} cancel - The `cancel` event fires when the user requests to close the dialog. You can prevent the dialog from closing by calling `.preventDefault()` on the event.
|
|
@@ -65,6 +66,7 @@ var Dialog = class extends require_localized.Localized(require_delegates_aria.De
|
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
}
|
|
69
|
+
/** Gets or sets the Dialog's return value, often used to indicate which button the user pressed to close it. */
|
|
68
70
|
set returnValue(value) {
|
|
69
71
|
/* v8 ignore else -- @preserve */
|
|
70
72
|
if (this.#dialog) this.#dialog.returnValue = value;
|
|
@@ -119,13 +121,16 @@ var Dialog = class extends require_localized.Localized(require_delegates_aria.De
|
|
|
119
121
|
cancelable: true
|
|
120
122
|
})) this.open = false;
|
|
121
123
|
}
|
|
124
|
+
/** Closes the Dialog. */
|
|
122
125
|
close() {
|
|
123
126
|
this.open = false;
|
|
124
127
|
}
|
|
128
|
+
/** Opens the Dialog as non-modal. */
|
|
125
129
|
show() {
|
|
126
130
|
if (this._openedAsModal && !this.modal) throw new DOMException("Failed to execute 'show' on 'Dialog': The dialog is already open as a modal dialog, and therefore cannot be opened as a non-modal dialog.", "InvalidStateError");
|
|
127
131
|
this.open = true;
|
|
128
132
|
}
|
|
133
|
+
/** Opens the Dialog as modal. */
|
|
129
134
|
showModal() {
|
|
130
135
|
if (this.open && !this._openedAsModal) throw new DOMException("Failed to execute 'showModal' on 'Dialog': The dialog is already open as a non-modal dialog, and therefore cannot be opened as a modal dialog.", "InvalidStateError");
|
|
131
136
|
this._openedAsModal = true;
|
|
@@ -220,7 +225,7 @@ function renderDismissButton(buttonTag) {
|
|
|
220
225
|
}
|
|
221
226
|
var DialogTemplate = (context) => {
|
|
222
227
|
const elevationTag = context.tagFor(require_definition$2.Elevation);
|
|
223
|
-
const iconTag = context.tagFor(
|
|
228
|
+
const iconTag = context.tagFor(require_icon.Icon);
|
|
224
229
|
const buttonTag = context.tagFor(require_definition$1.Button);
|
|
225
230
|
return _microsoft_fast_element.html`
|
|
226
231
|
<${elevationTag} dp="8" not-relative>
|