@vonage/vivid 4.14.1 → 4.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +393 -201
- package/index.cjs +1 -0
- package/index.js +1 -1
- package/lib/accordion/definition.d.ts +5 -1
- package/lib/combobox/combobox.d.ts +5 -1
- package/lib/divider/divider.d.ts +1 -1
- package/lib/divider/divider.template.d.ts +1 -1
- package/lib/file-picker/file-picker.d.ts +1 -0
- package/lib/menu-item/definition.d.ts +1 -1
- package/lib/menu-item/menu-item-role.d.ts +7 -0
- package/lib/menu-item/menu-item.d.ts +1 -7
- package/lib/number-field/number-field.d.ts +1 -1
- package/lib/radio/radio.d.ts +2 -2
- package/lib/searchable-select/option-tag.d.ts +2 -2
- package/lib/select/select.form-associated.d.ts +1 -1
- package/lib/switch/switch.d.ts +1 -0
- package/lib/tabs/tabs.d.ts +5 -1
- package/lib/text-anchor/text-anchor.d.ts +1 -1
- package/lib/tree-item/tree-item.d.ts +1 -1
- package/lib/tree-view/tree-view.d.ts +1 -1
- package/package.json +1 -1
- package/shared/affix.js +1 -1
- package/shared/applyMixinsWithObservables.cjs +1 -1
- package/shared/applyMixinsWithObservables.js +1 -1
- package/shared/definition.js +1 -1
- package/shared/definition11.cjs +1 -1
- package/shared/definition11.js +2 -2
- package/shared/definition16.cjs +64 -32
- package/shared/definition16.js +62 -30
- package/shared/definition17.cjs +9 -7
- package/shared/definition17.js +9 -7
- package/shared/definition2.cjs +9 -4
- package/shared/definition2.js +9 -5
- package/shared/definition22.cjs +2 -1
- package/shared/definition22.js +2 -1
- package/shared/definition24.js +1 -1
- package/shared/definition25.cjs +25 -18
- package/shared/definition25.js +26 -19
- package/shared/definition27.cjs +1 -1
- package/shared/definition27.js +1 -1
- package/shared/definition29.cjs +12 -30
- package/shared/definition29.js +13 -31
- package/shared/definition30.js +1 -1
- package/shared/definition31.js +1 -1
- package/shared/definition33.cjs +1 -1
- package/shared/definition33.js +2 -2
- package/shared/definition34.cjs +7 -228
- package/shared/definition34.js +5 -226
- package/shared/definition35.cjs +2 -201
- package/shared/definition35.js +4 -201
- package/shared/definition4.js +1 -1
- package/shared/definition41.cjs +1 -1
- package/shared/definition41.js +1 -1
- package/shared/definition42.cjs +2 -3
- package/shared/definition42.js +3 -4
- package/shared/definition43.cjs +10 -11
- package/shared/definition43.js +6 -7
- package/shared/definition46.cjs +2 -2
- package/shared/definition46.js +3 -3
- package/shared/definition47.js +1 -1
- package/shared/definition48.cjs +22 -15
- package/shared/definition48.js +22 -15
- package/shared/definition5.cjs +3 -2
- package/shared/definition5.js +3 -2
- package/shared/definition50.js +1 -1
- package/shared/definition51.cjs +14 -383
- package/shared/definition51.js +17 -386
- package/shared/definition53.js +1 -1
- package/shared/definition54.js +1 -1
- package/shared/definition56.js +1 -1
- package/shared/definition59.js +1 -1
- package/shared/definition7.js +1 -1
- package/shared/definition8.js +1 -1
- package/shared/direction.cjs +2 -16
- package/shared/direction.js +3 -17
- package/shared/foundation/utilities/direction.d.ts +2 -0
- package/shared/listbox.cjs +25 -6
- package/shared/listbox.js +22 -3
- package/shared/option.cjs +205 -0
- package/shared/option.js +202 -0
- package/shared/text-anchor.cjs +1 -1
- package/shared/text-anchor.js +2 -2
- package/shared/text-field2.js +2 -2
- package/shared/vivid-element.cjs +0 -2
- package/shared/vivid-element.js +1 -1
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/vivid.api.json +70 -3
- package/lib/listbox/definition.d.ts +0 -2
- package/lib/listbox/listbox.d.ts +0 -14
- package/lib/listbox/listbox.template.d.ts +0 -2
- package/listbox/index.cjs +0 -54
- package/listbox/index.js +0 -52
- package/shared/apply-mixins2.cjs +0 -25
- package/shared/apply-mixins2.js +0 -23
- package/shared/aria-global2.cjs +0 -75
- package/shared/aria-global2.js +0 -73
- package/shared/form-associated2.cjs +0 -383
- package/shared/form-associated2.js +0 -381
- package/shared/key-codes2.cjs +0 -1565
- package/shared/key-codes2.js +0 -1551
- package/shared/listbox2.cjs +0 -1267
- package/shared/listbox2.js +0 -1264
- package/shared/strings2.cjs +0 -37
- package/shared/strings2.js +0 -33
package/shared/definition34.js
CHANGED
|
@@ -1,245 +1,24 @@
|
|
|
1
1
|
import { B as Button, b as buttonDefinition } from './definition11.js';
|
|
2
2
|
import { D as Divider, d as dividerDefinition } from './definition22.js';
|
|
3
|
-
import {
|
|
3
|
+
import { V as VividElement, D as DOM, a as attr, o as observable, n as nullableNumberConverter, h as html, d as defineVividComponent, f as createRegisterFunction } from './vivid-element.js';
|
|
4
4
|
import { i as iconDefinition } from './definition27.js';
|
|
5
|
+
import { D as DelegatesARIATextbox } from './text-field2.js';
|
|
5
6
|
import { a as applyMixinsWithObservables } from './applyMixinsWithObservables.js';
|
|
6
|
-
import { F as FormAssociated
|
|
7
|
-
import { F as FoundationElement, _ as __decorate, S as StartEnd } from './key-codes2.js';
|
|
8
|
-
import { a as applyMixins } from './apply-mixins2.js';
|
|
9
|
-
import { F as FormAssociated } from './form-associated2.js';
|
|
10
|
-
import { A as ARIAGlobalStatesAndProperties } from './aria-global2.js';
|
|
7
|
+
import { F as FormAssociated } from './form-associated.js';
|
|
11
8
|
import { f as keyArrowDown, e as keyArrowUp } from './key-codes.js';
|
|
12
9
|
import { e as errorText, f as formElements, F as FormElementSuccessText, a as FormElementHelperText, b as FormElementCharCount, g as getFeedbackTemplate } from './form-elements.js';
|
|
13
|
-
import {
|
|
10
|
+
import { b as AffixIcon } from './affix.js';
|
|
14
11
|
import { L as Localized } from './localized.js';
|
|
15
12
|
import { S as Shape } from './enums.js';
|
|
16
13
|
import { w as when } from './when.js';
|
|
17
14
|
import { r as ref } from './ref.js';
|
|
18
15
|
import { c as classNames } from './class-names.js';
|
|
19
16
|
|
|
20
|
-
class _TextField extends FoundationElement {
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* A form-associated base class for the {@link @microsoft/fast-foundation#(TextField:class)} component.
|
|
24
|
-
*
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
27
|
-
class FormAssociatedTextField extends FormAssociated(_TextField) {
|
|
28
|
-
constructor() {
|
|
29
|
-
super(...arguments);
|
|
30
|
-
this.proxy = document.createElement("input");
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Text field sub-types
|
|
36
|
-
* @public
|
|
37
|
-
*/
|
|
38
|
-
const TextFieldType = {
|
|
39
|
-
/**
|
|
40
|
-
* An email TextField
|
|
41
|
-
*/
|
|
42
|
-
email: "email",
|
|
43
|
-
/**
|
|
44
|
-
* A password TextField
|
|
45
|
-
*/
|
|
46
|
-
password: "password",
|
|
47
|
-
/**
|
|
48
|
-
* A telephone TextField
|
|
49
|
-
*/
|
|
50
|
-
tel: "tel",
|
|
51
|
-
/**
|
|
52
|
-
* A text TextField
|
|
53
|
-
*/
|
|
54
|
-
text: "text",
|
|
55
|
-
/**
|
|
56
|
-
* A URL TextField
|
|
57
|
-
*/
|
|
58
|
-
url: "url",
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* A Text Field Custom HTML Element.
|
|
63
|
-
* Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/text | <input type="text" /> element }.
|
|
64
|
-
*
|
|
65
|
-
* @slot start - Content which can be provided before the number field input
|
|
66
|
-
* @slot end - Content which can be provided after the number field input
|
|
67
|
-
* @slot - The default slot for the label
|
|
68
|
-
* @csspart label - The label
|
|
69
|
-
* @csspart root - The element wrapping the control, including start and end slots
|
|
70
|
-
* @csspart control - The text field element
|
|
71
|
-
* @fires change - Fires a custom 'change' event when the value has changed
|
|
72
|
-
*
|
|
73
|
-
* @public
|
|
74
|
-
*/
|
|
75
|
-
class TextField extends FormAssociatedTextField {
|
|
76
|
-
constructor() {
|
|
77
|
-
super(...arguments);
|
|
78
|
-
/**
|
|
79
|
-
* Allows setting a type or mode of text.
|
|
80
|
-
* @public
|
|
81
|
-
* @remarks
|
|
82
|
-
* HTML Attribute: type
|
|
83
|
-
*/
|
|
84
|
-
this.type = TextFieldType.text;
|
|
85
|
-
}
|
|
86
|
-
readOnlyChanged() {
|
|
87
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
88
|
-
this.proxy.readOnly = this.readOnly;
|
|
89
|
-
this.validate();
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
autofocusChanged() {
|
|
93
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
94
|
-
this.proxy.autofocus = this.autofocus;
|
|
95
|
-
this.validate();
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
placeholderChanged() {
|
|
99
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
100
|
-
this.proxy.placeholder = this.placeholder;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
typeChanged() {
|
|
104
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
105
|
-
this.proxy.type = this.type;
|
|
106
|
-
this.validate();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
listChanged() {
|
|
110
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
111
|
-
this.proxy.setAttribute("list", this.list);
|
|
112
|
-
this.validate();
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
maxlengthChanged() {
|
|
116
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
117
|
-
this.proxy.maxLength = this.maxlength;
|
|
118
|
-
this.validate();
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
minlengthChanged() {
|
|
122
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
123
|
-
this.proxy.minLength = this.minlength;
|
|
124
|
-
this.validate();
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
patternChanged() {
|
|
128
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
129
|
-
this.proxy.pattern = this.pattern;
|
|
130
|
-
this.validate();
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
sizeChanged() {
|
|
134
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
135
|
-
this.proxy.size = this.size;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
spellcheckChanged() {
|
|
139
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
140
|
-
this.proxy.spellcheck = this.spellcheck;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* @internal
|
|
145
|
-
*/
|
|
146
|
-
connectedCallback() {
|
|
147
|
-
super.connectedCallback();
|
|
148
|
-
this.proxy.setAttribute("type", this.type);
|
|
149
|
-
this.validate();
|
|
150
|
-
if (this.autofocus) {
|
|
151
|
-
DOM.queueUpdate(() => {
|
|
152
|
-
this.focus();
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Selects all the text in the text field
|
|
158
|
-
*
|
|
159
|
-
* @public
|
|
160
|
-
*/
|
|
161
|
-
select() {
|
|
162
|
-
this.control.select();
|
|
163
|
-
/**
|
|
164
|
-
* The select event does not permeate the shadow DOM boundary.
|
|
165
|
-
* This fn effectively proxies the select event,
|
|
166
|
-
* emitting a `select` event whenever the internal
|
|
167
|
-
* control emits a `select` event
|
|
168
|
-
*/
|
|
169
|
-
this.$emit("select");
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Handles the internal control's `input` event
|
|
173
|
-
* @internal
|
|
174
|
-
*/
|
|
175
|
-
handleTextInput() {
|
|
176
|
-
this.value = this.control.value;
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Change event handler for inner control.
|
|
180
|
-
* @remarks
|
|
181
|
-
* "Change" events are not `composable` so they will not
|
|
182
|
-
* permeate the shadow DOM boundary. This fn effectively proxies
|
|
183
|
-
* the change event, emitting a `change` event whenever the internal
|
|
184
|
-
* control emits a `change` event
|
|
185
|
-
* @internal
|
|
186
|
-
*/
|
|
187
|
-
handleChange() {
|
|
188
|
-
this.$emit("change");
|
|
189
|
-
}
|
|
190
|
-
/** {@inheritDoc (FormAssociated:interface).validate} */
|
|
191
|
-
validate() {
|
|
192
|
-
super.validate(this.control);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
__decorate([
|
|
196
|
-
attr({ attribute: "readonly", mode: "boolean" })
|
|
197
|
-
], TextField.prototype, "readOnly", void 0);
|
|
198
|
-
__decorate([
|
|
199
|
-
attr({ mode: "boolean" })
|
|
200
|
-
], TextField.prototype, "autofocus", void 0);
|
|
201
|
-
__decorate([
|
|
202
|
-
attr
|
|
203
|
-
], TextField.prototype, "placeholder", void 0);
|
|
204
|
-
__decorate([
|
|
205
|
-
attr
|
|
206
|
-
], TextField.prototype, "type", void 0);
|
|
207
|
-
__decorate([
|
|
208
|
-
attr
|
|
209
|
-
], TextField.prototype, "list", void 0);
|
|
210
|
-
__decorate([
|
|
211
|
-
attr({ converter: nullableNumberConverter })
|
|
212
|
-
], TextField.prototype, "maxlength", void 0);
|
|
213
|
-
__decorate([
|
|
214
|
-
attr({ converter: nullableNumberConverter })
|
|
215
|
-
], TextField.prototype, "minlength", void 0);
|
|
216
|
-
__decorate([
|
|
217
|
-
attr
|
|
218
|
-
], TextField.prototype, "pattern", void 0);
|
|
219
|
-
__decorate([
|
|
220
|
-
attr({ converter: nullableNumberConverter })
|
|
221
|
-
], TextField.prototype, "size", void 0);
|
|
222
|
-
__decorate([
|
|
223
|
-
attr({ mode: "boolean" })
|
|
224
|
-
], TextField.prototype, "spellcheck", void 0);
|
|
225
|
-
__decorate([
|
|
226
|
-
observable
|
|
227
|
-
], TextField.prototype, "defaultSlottedNodes", void 0);
|
|
228
|
-
/**
|
|
229
|
-
* Includes ARIA states and properties relating to the ARIA textbox role
|
|
230
|
-
*
|
|
231
|
-
* @public
|
|
232
|
-
*/
|
|
233
|
-
class DelegatesARIATextbox {
|
|
234
|
-
}
|
|
235
|
-
applyMixins(DelegatesARIATextbox, ARIAGlobalStatesAndProperties);
|
|
236
|
-
applyMixins(TextField, StartEnd, DelegatesARIATextbox);
|
|
237
|
-
|
|
238
17
|
const styles = ":host{display:inline-block}.base{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.base.appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-fierce)}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.base:where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.base:where(.disabled,:disabled).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.readonly):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: var(--vvd-color-neutral-400)}.base:where(.readonly):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-600);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.error):where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: var(--vvd-color-alert-500)}.base:where(.error):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: transparent}.base:where(.success):where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: var(--vvd-color-success-500)}.base:where(.success):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: transparent}.base{--_connotation-color-primary: var(--vvd-text-field-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-text-field-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-text-field-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-intermediate: var(--vvd-text-field-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-firm: var(--vvd-text-field-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-fierce: var(--vvd-text-field-accent-fierce, var(--vvd-color-neutral-700));--_connotation-color-faint: var(--vvd-text-field-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-text-field-accent-soft, var(--vvd-color-neutral-100))}.base{--_text-field-gutter-start: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))*.4) ;--_text-field-gutter-end: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))*.4) ;--_text-field-icon-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))/2) ;--_text-field-block-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;--_text-field-border-radius: 8px;--_text-field-pill-border-radius: 24px;display:inline-grid;width:100%;gap:4px;grid-template-columns:min-content 1fr max-content}.base.size-condensed{--_text-field-gutter-start: calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))/2) ;--_text-field-gutter-end: calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))/2) ;--_text-field-icon-size: calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))/2) ;--_text-field-block-size: calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;--_text-field-border-radius: 4px}@supports (user-select: none){.base{user-select:none}}.base:not(.disabled){--_low-ink-color: var(--vvd-color-neutral-600)}.base.disabled{--_low-ink-color: var(--_appearance-color-text)}.label:not(slot),.label::slotted(label){box-sizing:initial!important;padding:initial!important;margin:initial!important;color:var(--vvd-color-canvas-text)!important;contain:inline-size!important;font:var(--vvd-typography-base);grid-column:1/4;grid-row:1}.char-count+.label:not(slot),.char-count+.label::slotted(label){grid-column:1/3}.char-count{color:var(--_low-ink-color);font:var(--vvd-typography-base);grid-column:3/4}.fieldset{position:relative;display:flex;align-items:center;background-color:var(--_appearance-color-fill);font:var(--vvd-typography-base);grid-column:1/4;padding-block:0;transition:color .2s,background-color .2s}.fieldset:after{position:absolute;display:block;border-radius:inherit;block-size:100%;box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);content:\"\";inline-size:100%;pointer-events:none;transition:box-shadow .2s}.fieldset:focus-visible{outline:none}.base>.fieldset{block-size:var(--_text-field-block-size)}.base:not(.shape-pill) .fieldset{border-radius:var(--_text-field-border-radius)}.base.shape-pill .fieldset{border-radius:var(--_text-field-pill-border-radius)}.wrapper{border-radius:inherit;block-size:100%;inline-size:100%}.control{border-radius:inherit;text-align:start}.control:not(slot),.control::slotted(input){width:100%!important;box-sizing:border-box!important;border:0 none!important;border-radius:inherit!important;margin:initial!important;appearance:none!important;background-color:transparent!important;block-size:100%!important;color:inherit!important;font:inherit;outline:transparent;padding-block:0!important;padding-inline:var(--_text-field-gutter-start) var(--_text-field-gutter-end)!important;text-align:inherit}.control:not(slot):disabled,.control::slotted(input:disabled){cursor:not-allowed!important;opacity:1!important;-webkit-text-fill-color:var(--_appearance-color-text)!important}.control:not(slot)::placeholder{opacity:1!important;-webkit-text-fill-color:var(--_low-ink-color)!important}.control::slotted(input:-webkit-autofill),.control:not(slot):-webkit-autofill{-webkit-box-shadow:0 0 0 1000px var(--_appearance-color-fill) inset;-webkit-text-fill-color:var(--_appearance-color-text)!important}.has-icon .control:not(slot),.has-icon .control::slotted(input){padding-inline-start:calc(var(--_text-field-icon-size) + var(--_text-field-gutter-start) * 2)!important}.icon{position:absolute;z-index:1;color:var(--_low-ink-color);font-size:var(--_text-field-icon-size);inset-block-start:50%;inset-inline-start:calc(100% + var(--_text-field-gutter-start));line-height:1;transform:translateY(-50%)}.leading-items-wrapper{position:relative}.base.no-leading .leading-items-wrapper{display:none}.action-items-wrapper{margin-inline-end:4px}.base:not(.action-items) .action-items-wrapper{display:none}@supports selector(:has(*)){.fieldset:has(.wrapper .control:focus-within):after{--focus-stroke-gap-color: transparent;box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px))}}@supports not selector(:has(*)){.wrapper:focus-within:after{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent;position:absolute;z-index:1;display:block;border-radius:inherit;content:\"\";inset:0;pointer-events:none}}:host([internal-part]) .fieldset{background-color:transparent;font:var(--vvd-typography-heading-4);line-height:1.1}:host([internal-part]) .fieldset:not(:focus-within):after{block-size:1px;inset-block-end:0}@supports selector(:has(*)){:host([internal-part]) .fieldset:has(.action-items-wrapper:focus-within):after{block-size:1px;inset-block-end:0}}:host([internal-part]) .control{text-align:center}slot[name=_mirrored-helper-text]{display:none}.base{--_text-field-gutter-end: 70px}.control::-webkit-outer-spin-button,.control::-webkit-inner-spin-button{appearance:none}.control-buttons{position:absolute;z-index:1;right:3px;display:flex}.readonly .control-buttons,.disabled .control-buttons{pointer-events:none}.control-buttons .divider{margin-block:8px}.control-buttons>*{flex-shrink:0}";
|
|
239
18
|
|
|
240
19
|
class _NumberField extends VividElement {
|
|
241
20
|
}
|
|
242
|
-
class FormAssociatedNumberField extends FormAssociated
|
|
21
|
+
class FormAssociatedNumberField extends FormAssociated(_NumberField) {
|
|
243
22
|
constructor() {
|
|
244
23
|
super(...arguments);
|
|
245
24
|
this.proxy = document.createElement("input");
|
package/shared/definition35.cjs
CHANGED
|
@@ -2,208 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
const definition = require('./definition27.cjs');
|
|
4
4
|
const vividElement = require('./vivid-element.cjs');
|
|
5
|
-
const
|
|
5
|
+
const option = require('./option.cjs');
|
|
6
6
|
const affix = require('./affix.cjs');
|
|
7
|
-
const ariaGlobal = require('./aria-global.cjs');
|
|
8
|
-
const dom = require('./dom.cjs');
|
|
9
7
|
const when = require('./when.cjs');
|
|
10
8
|
const classNames = require('./class-names.cjs');
|
|
11
9
|
|
|
12
|
-
var __defProp = Object.defineProperty;
|
|
13
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
14
|
-
var result = void 0 ;
|
|
15
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
16
|
-
if (decorator = decorators[i])
|
|
17
|
-
result = (decorator(target, key, result) ) || result;
|
|
18
|
-
if (result) __defProp(target, key, result);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
function isListboxOption(el) {
|
|
22
|
-
return dom.isHTMLElement(el) && (el.getAttribute("role") === "option" || el instanceof HTMLOptionElement);
|
|
23
|
-
}
|
|
24
|
-
class ListboxOption extends vividElement.VividElement {
|
|
25
|
-
constructor(text, value, defaultSelected, selected) {
|
|
26
|
-
super();
|
|
27
|
-
this.defaultSelected = false;
|
|
28
|
-
/**
|
|
29
|
-
* Tracks whether the "selected" property has been changed.
|
|
30
|
-
* @internal
|
|
31
|
-
*/
|
|
32
|
-
this.dirtySelected = false;
|
|
33
|
-
this.selected = this.defaultSelected;
|
|
34
|
-
/**
|
|
35
|
-
* Track whether the value has been changed from the initial value
|
|
36
|
-
*/
|
|
37
|
-
this.dirtyValue = false;
|
|
38
|
-
this._highlighted = false;
|
|
39
|
-
this._displayCheckmark = false;
|
|
40
|
-
this._matchedRange = null;
|
|
41
|
-
if (text) {
|
|
42
|
-
this.text = text;
|
|
43
|
-
}
|
|
44
|
-
if (value) {
|
|
45
|
-
this.initialValue = value;
|
|
46
|
-
}
|
|
47
|
-
if (defaultSelected) {
|
|
48
|
-
this.defaultSelected = defaultSelected;
|
|
49
|
-
}
|
|
50
|
-
if (selected) {
|
|
51
|
-
this.selected = selected;
|
|
52
|
-
}
|
|
53
|
-
this.proxy = new Option(
|
|
54
|
-
this.text,
|
|
55
|
-
// @ts-expect-error Propery is used before it is assigned
|
|
56
|
-
this.initialValue,
|
|
57
|
-
this.defaultSelected,
|
|
58
|
-
this.selected
|
|
59
|
-
);
|
|
60
|
-
this.proxy.disabled = this.disabled;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Updates the ariaChecked property when the checked property changes.
|
|
64
|
-
*
|
|
65
|
-
* @param _ - the previous checked value
|
|
66
|
-
* @param next - the current checked value
|
|
67
|
-
*
|
|
68
|
-
* @public
|
|
69
|
-
*/
|
|
70
|
-
checkedChanged(_, next) {
|
|
71
|
-
if (typeof next === "boolean") {
|
|
72
|
-
this.ariaChecked = next ? "true" : "false";
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
this.ariaChecked = null;
|
|
76
|
-
}
|
|
77
|
-
defaultSelectedChanged() {
|
|
78
|
-
if (!this.dirtySelected) {
|
|
79
|
-
this.selected = this.defaultSelected;
|
|
80
|
-
if (this.proxy instanceof HTMLOptionElement) {
|
|
81
|
-
this.proxy.selected = this.defaultSelected;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
disabledChanged() {
|
|
86
|
-
this.ariaDisabled = this.disabled ? "true" : "false";
|
|
87
|
-
if (this.proxy instanceof HTMLOptionElement) {
|
|
88
|
-
this.proxy.disabled = this.disabled;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
selectedAttributeChanged() {
|
|
92
|
-
this.defaultSelected = this.selectedAttribute;
|
|
93
|
-
if (this.proxy instanceof HTMLOptionElement) {
|
|
94
|
-
this.proxy.defaultSelected = this.defaultSelected;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
selectedChanged() {
|
|
98
|
-
this.ariaSelected = this.selected ? "true" : "false";
|
|
99
|
-
if (!this.dirtySelected) {
|
|
100
|
-
this.dirtySelected = true;
|
|
101
|
-
}
|
|
102
|
-
if (this.proxy instanceof HTMLOptionElement) {
|
|
103
|
-
this.proxy.selected = this.selected;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
initialValueChanged() {
|
|
107
|
-
if (!this.dirtyValue) {
|
|
108
|
-
this.value = this.initialValue;
|
|
109
|
-
this.dirtyValue = false;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
get label() {
|
|
113
|
-
return this._label ?? this.text;
|
|
114
|
-
}
|
|
115
|
-
set label(value) {
|
|
116
|
-
this._label = value;
|
|
117
|
-
}
|
|
118
|
-
set text(value) {
|
|
119
|
-
this._text = value;
|
|
120
|
-
}
|
|
121
|
-
get text() {
|
|
122
|
-
return this._text ?? "";
|
|
123
|
-
}
|
|
124
|
-
set value(next) {
|
|
125
|
-
const newValue = `${next ?? ""}`;
|
|
126
|
-
this._value = newValue;
|
|
127
|
-
this.dirtyValue = true;
|
|
128
|
-
if (this.proxy instanceof HTMLOptionElement) {
|
|
129
|
-
this.proxy.value = newValue;
|
|
130
|
-
}
|
|
131
|
-
vividElement.Observable.notify(this, "value");
|
|
132
|
-
}
|
|
133
|
-
get value() {
|
|
134
|
-
vividElement.Observable.track(this, "value");
|
|
135
|
-
return this._value ?? this.text;
|
|
136
|
-
}
|
|
137
|
-
get form() {
|
|
138
|
-
return null;
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* @internal
|
|
142
|
-
*/
|
|
143
|
-
get _matchedRangeSafe() {
|
|
144
|
-
return this._matchedRange ?? { from: 0, to: 0 };
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
__decorateClass([
|
|
148
|
-
vividElement.observable
|
|
149
|
-
], ListboxOption.prototype, "checked");
|
|
150
|
-
__decorateClass([
|
|
151
|
-
vividElement.observable
|
|
152
|
-
], ListboxOption.prototype, "defaultSelected");
|
|
153
|
-
// @ts-expect-error Type is incorrectly non-optional
|
|
154
|
-
__decorateClass([
|
|
155
|
-
vividElement.attr({ mode: "boolean" })
|
|
156
|
-
], ListboxOption.prototype, "disabled");
|
|
157
|
-
// @ts-expect-error Type is incorrectly non-optional
|
|
158
|
-
__decorateClass([
|
|
159
|
-
vividElement.attr({ attribute: "selected", mode: "boolean" })
|
|
160
|
-
], ListboxOption.prototype, "selectedAttribute");
|
|
161
|
-
__decorateClass([
|
|
162
|
-
vividElement.observable
|
|
163
|
-
], ListboxOption.prototype, "selected");
|
|
164
|
-
__decorateClass([
|
|
165
|
-
vividElement.attr({ attribute: "value", mode: "fromView" })
|
|
166
|
-
], ListboxOption.prototype, "initialValue");
|
|
167
|
-
__decorateClass([
|
|
168
|
-
vividElement.attr({
|
|
169
|
-
attribute: "label"
|
|
170
|
-
})
|
|
171
|
-
], ListboxOption.prototype, "_label");
|
|
172
|
-
__decorateClass([
|
|
173
|
-
vividElement.attr({
|
|
174
|
-
attribute: "text"
|
|
175
|
-
})
|
|
176
|
-
], ListboxOption.prototype, "_text");
|
|
177
|
-
__decorateClass([
|
|
178
|
-
vividElement.observable
|
|
179
|
-
], ListboxOption.prototype, "_highlighted");
|
|
180
|
-
__decorateClass([
|
|
181
|
-
vividElement.observable
|
|
182
|
-
], ListboxOption.prototype, "_displayCheckmark");
|
|
183
|
-
__decorateClass([
|
|
184
|
-
vividElement.observable
|
|
185
|
-
], ListboxOption.prototype, "_matchedRange");
|
|
186
|
-
class DelegatesARIAListboxOption {
|
|
187
|
-
}
|
|
188
|
-
// @ts-expect-error Type is incorrectly non-optional
|
|
189
|
-
__decorateClass([
|
|
190
|
-
vividElement.observable
|
|
191
|
-
], DelegatesARIAListboxOption.prototype, "ariaChecked");
|
|
192
|
-
// @ts-expect-error Type is incorrectly non-optional
|
|
193
|
-
__decorateClass([
|
|
194
|
-
vividElement.observable
|
|
195
|
-
], DelegatesARIAListboxOption.prototype, "ariaPosInSet");
|
|
196
|
-
// @ts-expect-error Type is incorrectly non-optional
|
|
197
|
-
__decorateClass([
|
|
198
|
-
vividElement.observable
|
|
199
|
-
], DelegatesARIAListboxOption.prototype, "ariaSelected");
|
|
200
|
-
// @ts-expect-error Type is incorrectly non-optional
|
|
201
|
-
__decorateClass([
|
|
202
|
-
vividElement.observable
|
|
203
|
-
], DelegatesARIAListboxOption.prototype, "ariaSetSize");
|
|
204
|
-
applyMixins.applyMixins(DelegatesARIAListboxOption, ariaGlobal.ARIAGlobalStatesAndProperties);
|
|
205
|
-
applyMixins.applyMixins(ListboxOption, affix.AffixIconWithTrailing, DelegatesARIAListboxOption);
|
|
206
|
-
|
|
207
10
|
const getClasses = (x) => classNames.classNames(
|
|
208
11
|
"base",
|
|
209
12
|
["disabled", x.disabled],
|
|
@@ -253,7 +56,7 @@ const styles = ":host([disabled]){cursor:not-allowed}.base{--_connotation-color-
|
|
|
253
56
|
|
|
254
57
|
const listboxOptionDefinition = vividElement.defineVividComponent(
|
|
255
58
|
"option",
|
|
256
|
-
ListboxOption,
|
|
59
|
+
option.ListboxOption,
|
|
257
60
|
ListboxOptionTemplate,
|
|
258
61
|
[definition.iconDefinition],
|
|
259
62
|
{
|
|
@@ -262,7 +65,5 @@ const listboxOptionDefinition = vividElement.defineVividComponent(
|
|
|
262
65
|
);
|
|
263
66
|
const registerOption = vividElement.createRegisterFunction(listboxOptionDefinition);
|
|
264
67
|
|
|
265
|
-
exports.ListboxOption = ListboxOption;
|
|
266
|
-
exports.isListboxOption = isListboxOption;
|
|
267
68
|
exports.listboxOptionDefinition = listboxOptionDefinition;
|
|
268
69
|
exports.registerOption = registerOption;
|