@vonage/vivid 4.12.1 → 4.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +1388 -128
- package/lib/file-picker/file-picker.d.ts +6 -0
- package/lib/menu/menu.d.ts +16 -3
- package/lib/menu-item/menu-item.d.ts +10 -2
- package/lib/option/option.d.ts +27 -7
- package/lib/switch/switch.d.ts +5 -2
- package/lib/switch/switch.form-associated.d.ts +10 -0
- package/lib/tabs/tabs.d.ts +3 -2
- package/lib/text-area/text-area.d.ts +25 -3
- package/lib/text-area/text-field.form-associated.d.ts +10 -0
- package/lib/text-field/text-field.d.ts +28 -3
- package/lib/text-field/text-field.form-associated.d.ts +10 -0
- package/package.json +1 -1
- package/shared/definition11.cjs +1 -1
- package/shared/definition11.js +1 -1
- package/shared/definition17.cjs +1 -1
- package/shared/definition17.js +1 -1
- package/shared/definition20.cjs +2 -1
- package/shared/definition20.js +2 -1
- package/shared/definition21.cjs +1 -1
- package/shared/definition21.js +1 -1
- package/shared/definition24.cjs +1 -1
- package/shared/definition24.js +1 -1
- package/shared/definition25.cjs +24 -3
- package/shared/definition25.js +24 -3
- package/shared/definition29.cjs +358 -559
- package/shared/definition29.js +359 -560
- package/shared/definition30.cjs +2 -0
- package/shared/definition30.js +2 -0
- package/shared/definition35.cjs +222 -2
- package/shared/definition35.js +222 -2
- package/shared/definition36.cjs +149 -14
- package/shared/definition36.js +150 -15
- package/shared/definition46.cjs +1 -1
- package/shared/definition46.js +1 -1
- package/shared/definition47.cjs +5 -14
- package/shared/definition47.js +1 -10
- package/shared/definition49.cjs +65 -90
- package/shared/definition49.js +66 -91
- package/shared/definition51.cjs +1 -1
- package/shared/definition51.js +1 -1
- package/shared/definition52.cjs +15 -1
- package/shared/definition52.js +15 -1
- package/shared/definition55.cjs +160 -180
- package/shared/definition55.js +160 -180
- package/shared/definition56.cjs +3 -307
- package/shared/definition56.js +5 -309
- package/shared/definition57.cjs +8 -7
- package/shared/definition57.js +3 -2
- package/shared/definition64.cjs +18 -7
- package/shared/definition64.js +19 -8
- package/shared/listbox.cjs +198 -3
- package/shared/listbox.js +197 -2
- package/shared/{direction.cjs → localization.cjs} +12 -3
- package/shared/{direction.js → localization.js} +12 -3
- package/shared/presentationDate.cjs +8 -8
- package/shared/presentationDate.js +1 -1
- package/shared/text-field2.cjs +538 -194
- package/shared/text-field2.js +539 -195
- package/styles/core/all.css +21 -1
- package/styles/core/theme.css +21 -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 +44 -0
- package/shared/Reflector.cjs +0 -71
- package/shared/Reflector.js +0 -69
- package/shared/listbox-option.cjs +0 -204
- package/shared/listbox-option.js +0 -201
package/styles/core/all.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on
|
|
3
|
+
* Generated on Mon, 02 Dec 2024 10:48:08 GMT
|
|
4
4
|
*/
|
|
5
5
|
.vvd-root {
|
|
6
6
|
color-scheme: var(--vvd-color-scheme);
|
|
@@ -8,6 +8,26 @@
|
|
|
8
8
|
color: var(--vvd-color-canvas-text);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
.vvd-scrollbar {
|
|
12
|
+
--scrollbar-track-color: transparent;
|
|
13
|
+
--scrollbar-thumb-color: color-mix(in srgb, var(--vvd-color-neutral-950), transparent 70%);
|
|
14
|
+
}
|
|
15
|
+
.vvd-scrollbar {
|
|
16
|
+
scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-track-color);
|
|
17
|
+
scrollbar-width: thin;
|
|
18
|
+
}
|
|
19
|
+
.vvd-scrollbar ::-webkit-scrollbar {
|
|
20
|
+
width: 4px;
|
|
21
|
+
}
|
|
22
|
+
.vvd-scrollbar ::-webkit-scrollbar-track {
|
|
23
|
+
background: var(--scrollbar-track-color);
|
|
24
|
+
}
|
|
25
|
+
.vvd-scrollbar ::-webkit-scrollbar-thumb {
|
|
26
|
+
border: 0;
|
|
27
|
+
border-radius: 4px;
|
|
28
|
+
background-color: var(--scrollbar-thumb-color);
|
|
29
|
+
}
|
|
30
|
+
|
|
11
31
|
.vvd-root:root {
|
|
12
32
|
--vvd-size-font-scale-base: 1rem;
|
|
13
33
|
font-size: unset;
|
package/styles/core/theme.css
CHANGED
|
@@ -1,9 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on
|
|
3
|
+
* Generated on Mon, 02 Dec 2024 10:48:08 GMT
|
|
4
4
|
*/
|
|
5
5
|
.vvd-root {
|
|
6
6
|
color-scheme: var(--vvd-color-scheme);
|
|
7
7
|
background-color: var(--vvd-color-canvas);
|
|
8
8
|
color: var(--vvd-color-canvas-text);
|
|
9
9
|
}
|
|
10
|
+
|
|
11
|
+
.vvd-scrollbar {
|
|
12
|
+
--scrollbar-track-color: transparent;
|
|
13
|
+
--scrollbar-thumb-color: color-mix(in srgb, var(--vvd-color-neutral-950), transparent 70%);
|
|
14
|
+
}
|
|
15
|
+
.vvd-scrollbar {
|
|
16
|
+
scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-track-color);
|
|
17
|
+
scrollbar-width: thin;
|
|
18
|
+
}
|
|
19
|
+
.vvd-scrollbar ::-webkit-scrollbar {
|
|
20
|
+
width: 4px;
|
|
21
|
+
}
|
|
22
|
+
.vvd-scrollbar ::-webkit-scrollbar-track {
|
|
23
|
+
background: var(--scrollbar-track-color);
|
|
24
|
+
}
|
|
25
|
+
.vvd-scrollbar ::-webkit-scrollbar-thumb {
|
|
26
|
+
border: 0;
|
|
27
|
+
border-radius: 4px;
|
|
28
|
+
background-color: var(--scrollbar-thumb-color);
|
|
29
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on
|
|
3
|
+
* Generated on Mon, 02 Dec 2024 10:48:08 GMT
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Do not edit directly
|
|
7
|
-
* Generated on
|
|
7
|
+
* Generated on Mon, 02 Dec 2024 10:48:08 GMT
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
10
|
* Do not edit directly
|
|
11
|
-
* Generated on
|
|
11
|
+
* Generated on Mon, 02 Dec 2024 10:48:08 GMT
|
|
12
12
|
*/
|
|
13
13
|
/**
|
|
14
14
|
* Do not edit directly
|
|
15
|
-
* Generated on
|
|
15
|
+
* Generated on Mon, 02 Dec 2024 10:48:08 GMT
|
|
16
16
|
*/
|
|
17
17
|
@property --vvd-size-density {
|
|
18
18
|
syntax: "<integer>";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on
|
|
3
|
+
* Generated on Mon, 02 Dec 2024 10:48:08 GMT
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Do not edit directly
|
|
7
|
-
* Generated on
|
|
7
|
+
* Generated on Mon, 02 Dec 2024 10:48:08 GMT
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
10
|
* Do not edit directly
|
|
11
|
-
* Generated on
|
|
11
|
+
* Generated on Mon, 02 Dec 2024 10:48:08 GMT
|
|
12
12
|
*/
|
|
13
13
|
/**
|
|
14
14
|
* Do not edit directly
|
|
15
|
-
* Generated on
|
|
15
|
+
* Generated on Mon, 02 Dec 2024 10:48:08 GMT
|
|
16
16
|
*/
|
|
17
17
|
@property --vvd-size-density {
|
|
18
18
|
syntax: "<integer>";
|
package/vivid.api.json
CHANGED
|
@@ -4636,6 +4636,50 @@
|
|
|
4636
4636
|
],
|
|
4637
4637
|
"name": "menuItemDefinition"
|
|
4638
4638
|
},
|
|
4639
|
+
{
|
|
4640
|
+
"kind": "TypeAlias",
|
|
4641
|
+
"canonicalReference": "@vonage/vivid!MenuItemRole:type",
|
|
4642
|
+
"docComment": "",
|
|
4643
|
+
"excerptTokens": [
|
|
4644
|
+
{
|
|
4645
|
+
"kind": "Content",
|
|
4646
|
+
"text": "export type MenuItemRole = "
|
|
4647
|
+
},
|
|
4648
|
+
{
|
|
4649
|
+
"kind": "Content",
|
|
4650
|
+
"text": "typeof "
|
|
4651
|
+
},
|
|
4652
|
+
{
|
|
4653
|
+
"kind": "Reference",
|
|
4654
|
+
"text": "MenuItemRole",
|
|
4655
|
+
"canonicalReference": "@vonage/vivid!MenuItemRole:var"
|
|
4656
|
+
},
|
|
4657
|
+
{
|
|
4658
|
+
"kind": "Content",
|
|
4659
|
+
"text": "[keyof typeof "
|
|
4660
|
+
},
|
|
4661
|
+
{
|
|
4662
|
+
"kind": "Reference",
|
|
4663
|
+
"text": "MenuItemRole",
|
|
4664
|
+
"canonicalReference": "@vonage/vivid!MenuItemRole:var"
|
|
4665
|
+
},
|
|
4666
|
+
{
|
|
4667
|
+
"kind": "Content",
|
|
4668
|
+
"text": "]"
|
|
4669
|
+
},
|
|
4670
|
+
{
|
|
4671
|
+
"kind": "Content",
|
|
4672
|
+
"text": ";"
|
|
4673
|
+
}
|
|
4674
|
+
],
|
|
4675
|
+
"fileUrlPath": "../../dist/libs/components/lib/menu-item/menu-item.d.ts",
|
|
4676
|
+
"releaseTag": "Public",
|
|
4677
|
+
"name": "MenuItemRole",
|
|
4678
|
+
"typeTokenRange": {
|
|
4679
|
+
"startIndex": 1,
|
|
4680
|
+
"endIndex": 6
|
|
4681
|
+
}
|
|
4682
|
+
},
|
|
4639
4683
|
{
|
|
4640
4684
|
"kind": "Variable",
|
|
4641
4685
|
"canonicalReference": "@vonage/vivid!MenuItemRole:var",
|
package/shared/Reflector.cjs
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const index = require('./index.cjs');
|
|
4
|
-
|
|
5
|
-
class Reflector {
|
|
6
|
-
#reflectedProperties = /* @__PURE__ */ new Map();
|
|
7
|
-
#source;
|
|
8
|
-
#target;
|
|
9
|
-
constructor(source, target) {
|
|
10
|
-
this.#source = source;
|
|
11
|
-
this.#target = target;
|
|
12
|
-
}
|
|
13
|
-
attribute(propertyName, attributeName) {
|
|
14
|
-
this.#addReflectedProperty(propertyName, {
|
|
15
|
-
type: "attribute",
|
|
16
|
-
destination: attributeName
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
booleanAttribute(propertyName, attributeName) {
|
|
20
|
-
this.#addReflectedProperty(propertyName, {
|
|
21
|
-
type: "boolean-attribute",
|
|
22
|
-
destination: attributeName
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
property(propertyName, targetProperty, skipIfEqual = false) {
|
|
26
|
-
this.#addReflectedProperty(propertyName, {
|
|
27
|
-
type: "property",
|
|
28
|
-
destination: targetProperty,
|
|
29
|
-
skipIfEqual
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
destroy() {
|
|
33
|
-
const notifier = index.Observable.getNotifier(this.#source);
|
|
34
|
-
for (const prop of this.#reflectedProperties.keys()) {
|
|
35
|
-
notifier.unsubscribe(this.#propertyChangeHandler, prop);
|
|
36
|
-
}
|
|
37
|
-
this.#reflectedProperties.clear();
|
|
38
|
-
}
|
|
39
|
-
#addReflectedProperty(name, reflected) {
|
|
40
|
-
this.#reflectedProperties.set(name, reflected);
|
|
41
|
-
const notifier = index.Observable.getNotifier(this.#source);
|
|
42
|
-
notifier.subscribe(this.#propertyChangeHandler, name);
|
|
43
|
-
this.#propertyChangeHandler.handleChange(this.#source, name);
|
|
44
|
-
}
|
|
45
|
-
#propertyChangeHandler = {
|
|
46
|
-
handleChange: (source, propertyName) => {
|
|
47
|
-
const reflectedProperty = this.#reflectedProperties.get(propertyName);
|
|
48
|
-
const value = source[propertyName];
|
|
49
|
-
switch (reflectedProperty.type) {
|
|
50
|
-
case "boolean-attribute":
|
|
51
|
-
index.DOM.setBooleanAttribute(
|
|
52
|
-
this.#target,
|
|
53
|
-
reflectedProperty.destination,
|
|
54
|
-
Boolean(value)
|
|
55
|
-
);
|
|
56
|
-
break;
|
|
57
|
-
case "attribute":
|
|
58
|
-
index.DOM.setAttribute(this.#target, reflectedProperty.destination, value);
|
|
59
|
-
break;
|
|
60
|
-
case "property":
|
|
61
|
-
if (reflectedProperty.skipIfEqual && this.#target[reflectedProperty.destination] === value) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
this.#target[reflectedProperty.destination] = value;
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
exports.Reflector = Reflector;
|
package/shared/Reflector.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { O as Observable, D as DOM } from './index.js';
|
|
2
|
-
|
|
3
|
-
class Reflector {
|
|
4
|
-
#reflectedProperties = /* @__PURE__ */ new Map();
|
|
5
|
-
#source;
|
|
6
|
-
#target;
|
|
7
|
-
constructor(source, target) {
|
|
8
|
-
this.#source = source;
|
|
9
|
-
this.#target = target;
|
|
10
|
-
}
|
|
11
|
-
attribute(propertyName, attributeName) {
|
|
12
|
-
this.#addReflectedProperty(propertyName, {
|
|
13
|
-
type: "attribute",
|
|
14
|
-
destination: attributeName
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
booleanAttribute(propertyName, attributeName) {
|
|
18
|
-
this.#addReflectedProperty(propertyName, {
|
|
19
|
-
type: "boolean-attribute",
|
|
20
|
-
destination: attributeName
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
property(propertyName, targetProperty, skipIfEqual = false) {
|
|
24
|
-
this.#addReflectedProperty(propertyName, {
|
|
25
|
-
type: "property",
|
|
26
|
-
destination: targetProperty,
|
|
27
|
-
skipIfEqual
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
destroy() {
|
|
31
|
-
const notifier = Observable.getNotifier(this.#source);
|
|
32
|
-
for (const prop of this.#reflectedProperties.keys()) {
|
|
33
|
-
notifier.unsubscribe(this.#propertyChangeHandler, prop);
|
|
34
|
-
}
|
|
35
|
-
this.#reflectedProperties.clear();
|
|
36
|
-
}
|
|
37
|
-
#addReflectedProperty(name, reflected) {
|
|
38
|
-
this.#reflectedProperties.set(name, reflected);
|
|
39
|
-
const notifier = Observable.getNotifier(this.#source);
|
|
40
|
-
notifier.subscribe(this.#propertyChangeHandler, name);
|
|
41
|
-
this.#propertyChangeHandler.handleChange(this.#source, name);
|
|
42
|
-
}
|
|
43
|
-
#propertyChangeHandler = {
|
|
44
|
-
handleChange: (source, propertyName) => {
|
|
45
|
-
const reflectedProperty = this.#reflectedProperties.get(propertyName);
|
|
46
|
-
const value = source[propertyName];
|
|
47
|
-
switch (reflectedProperty.type) {
|
|
48
|
-
case "boolean-attribute":
|
|
49
|
-
DOM.setBooleanAttribute(
|
|
50
|
-
this.#target,
|
|
51
|
-
reflectedProperty.destination,
|
|
52
|
-
Boolean(value)
|
|
53
|
-
);
|
|
54
|
-
break;
|
|
55
|
-
case "attribute":
|
|
56
|
-
DOM.setAttribute(this.#target, reflectedProperty.destination, value);
|
|
57
|
-
break;
|
|
58
|
-
case "property":
|
|
59
|
-
if (reflectedProperty.skipIfEqual && this.#target[reflectedProperty.destination] === value) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
this.#target[reflectedProperty.destination] = value;
|
|
63
|
-
break;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export { Reflector as R };
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const index = require('./index.cjs');
|
|
4
|
-
const ariaGlobal = require('./aria-global.cjs');
|
|
5
|
-
const startEnd = require('./start-end.cjs');
|
|
6
|
-
const applyMixins = require('./apply-mixins.cjs');
|
|
7
|
-
const dom = require('./dom.cjs');
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Determines if the element is a {@link (ListboxOption:class)}
|
|
11
|
-
*
|
|
12
|
-
* @param element - the element to test.
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
function isListboxOption(el) {
|
|
16
|
-
return (dom.isHTMLElement(el) &&
|
|
17
|
-
(el.getAttribute("role") === "option" ||
|
|
18
|
-
el instanceof HTMLOptionElement));
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* An Option Custom HTML Element.
|
|
22
|
-
* Implements {@link https://www.w3.org/TR/wai-aria-1.1/#option | ARIA option }.
|
|
23
|
-
*
|
|
24
|
-
* @slot start - Content which can be provided before the listbox option content
|
|
25
|
-
* @slot end - Content which can be provided after the listbox option content
|
|
26
|
-
* @slot - The default slot for listbox option content
|
|
27
|
-
* @csspart content - Wraps the listbox option content
|
|
28
|
-
*
|
|
29
|
-
* @public
|
|
30
|
-
*/
|
|
31
|
-
let ListboxOption$1 = class ListboxOption extends index.FoundationElement {
|
|
32
|
-
constructor(text, value, defaultSelected, selected) {
|
|
33
|
-
super();
|
|
34
|
-
/**
|
|
35
|
-
* The defaultSelected state of the option.
|
|
36
|
-
* @public
|
|
37
|
-
*/
|
|
38
|
-
this.defaultSelected = false;
|
|
39
|
-
/**
|
|
40
|
-
* Tracks whether the "selected" property has been changed.
|
|
41
|
-
* @internal
|
|
42
|
-
*/
|
|
43
|
-
this.dirtySelected = false;
|
|
44
|
-
/**
|
|
45
|
-
* The checked state of the control.
|
|
46
|
-
*
|
|
47
|
-
* @public
|
|
48
|
-
*/
|
|
49
|
-
this.selected = this.defaultSelected;
|
|
50
|
-
/**
|
|
51
|
-
* Track whether the value has been changed from the initial value
|
|
52
|
-
*/
|
|
53
|
-
this.dirtyValue = false;
|
|
54
|
-
if (text) {
|
|
55
|
-
this.textContent = text;
|
|
56
|
-
}
|
|
57
|
-
if (value) {
|
|
58
|
-
this.initialValue = value;
|
|
59
|
-
}
|
|
60
|
-
if (defaultSelected) {
|
|
61
|
-
this.defaultSelected = defaultSelected;
|
|
62
|
-
}
|
|
63
|
-
if (selected) {
|
|
64
|
-
this.selected = selected;
|
|
65
|
-
}
|
|
66
|
-
this.proxy = new Option(`${this.textContent}`, this.initialValue, this.defaultSelected, this.selected);
|
|
67
|
-
this.proxy.disabled = this.disabled;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Updates the ariaChecked property when the checked property changes.
|
|
71
|
-
*
|
|
72
|
-
* @param prev - the previous checked value
|
|
73
|
-
* @param next - the current checked value
|
|
74
|
-
*
|
|
75
|
-
* @public
|
|
76
|
-
*/
|
|
77
|
-
checkedChanged(prev, next) {
|
|
78
|
-
if (typeof next === "boolean") {
|
|
79
|
-
this.ariaChecked = next ? "true" : "false";
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
this.ariaChecked = null;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Updates the proxy's text content when the default slot changes.
|
|
86
|
-
* @param prev - the previous content value
|
|
87
|
-
* @param next - the current content value
|
|
88
|
-
*
|
|
89
|
-
* @internal
|
|
90
|
-
*/
|
|
91
|
-
contentChanged(prev, next) {
|
|
92
|
-
if (this.proxy instanceof HTMLOptionElement) {
|
|
93
|
-
this.proxy.textContent = this.textContent;
|
|
94
|
-
}
|
|
95
|
-
this.$emit("contentchange", null, { bubbles: true });
|
|
96
|
-
}
|
|
97
|
-
defaultSelectedChanged() {
|
|
98
|
-
if (!this.dirtySelected) {
|
|
99
|
-
this.selected = this.defaultSelected;
|
|
100
|
-
if (this.proxy instanceof HTMLOptionElement) {
|
|
101
|
-
this.proxy.selected = this.defaultSelected;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
disabledChanged(prev, next) {
|
|
106
|
-
this.ariaDisabled = this.disabled ? "true" : "false";
|
|
107
|
-
if (this.proxy instanceof HTMLOptionElement) {
|
|
108
|
-
this.proxy.disabled = this.disabled;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
selectedAttributeChanged() {
|
|
112
|
-
this.defaultSelected = this.selectedAttribute;
|
|
113
|
-
if (this.proxy instanceof HTMLOptionElement) {
|
|
114
|
-
this.proxy.defaultSelected = this.defaultSelected;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
selectedChanged() {
|
|
118
|
-
this.ariaSelected = this.selected ? "true" : "false";
|
|
119
|
-
if (!this.dirtySelected) {
|
|
120
|
-
this.dirtySelected = true;
|
|
121
|
-
}
|
|
122
|
-
if (this.proxy instanceof HTMLOptionElement) {
|
|
123
|
-
this.proxy.selected = this.selected;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
initialValueChanged(previous, next) {
|
|
127
|
-
// If the value is clean and the component is connected to the DOM
|
|
128
|
-
// then set value equal to the attribute value.
|
|
129
|
-
if (!this.dirtyValue) {
|
|
130
|
-
this.value = this.initialValue;
|
|
131
|
-
this.dirtyValue = false;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
get label() {
|
|
135
|
-
var _a;
|
|
136
|
-
return (_a = this.value) !== null && _a !== void 0 ? _a : this.text;
|
|
137
|
-
}
|
|
138
|
-
get text() {
|
|
139
|
-
var _a, _b;
|
|
140
|
-
return (_b = (_a = this.textContent) === null || _a === void 0 ? void 0 : _a.replace(/\s+/g, " ").trim()) !== null && _b !== void 0 ? _b : "";
|
|
141
|
-
}
|
|
142
|
-
set value(next) {
|
|
143
|
-
const newValue = `${next !== null && next !== void 0 ? next : ""}`;
|
|
144
|
-
this._value = newValue;
|
|
145
|
-
this.dirtyValue = true;
|
|
146
|
-
if (this.proxy instanceof HTMLOptionElement) {
|
|
147
|
-
this.proxy.value = newValue;
|
|
148
|
-
}
|
|
149
|
-
index.Observable.notify(this, "value");
|
|
150
|
-
}
|
|
151
|
-
get value() {
|
|
152
|
-
var _a;
|
|
153
|
-
index.Observable.track(this, "value");
|
|
154
|
-
return (_a = this._value) !== null && _a !== void 0 ? _a : this.text;
|
|
155
|
-
}
|
|
156
|
-
get form() {
|
|
157
|
-
return this.proxy ? this.proxy.form : null;
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
index.__decorate([
|
|
161
|
-
index.observable
|
|
162
|
-
], ListboxOption$1.prototype, "checked", void 0);
|
|
163
|
-
index.__decorate([
|
|
164
|
-
index.observable
|
|
165
|
-
], ListboxOption$1.prototype, "content", void 0);
|
|
166
|
-
index.__decorate([
|
|
167
|
-
index.observable
|
|
168
|
-
], ListboxOption$1.prototype, "defaultSelected", void 0);
|
|
169
|
-
index.__decorate([
|
|
170
|
-
index.attr({ mode: "boolean" })
|
|
171
|
-
], ListboxOption$1.prototype, "disabled", void 0);
|
|
172
|
-
index.__decorate([
|
|
173
|
-
index.attr({ attribute: "selected", mode: "boolean" })
|
|
174
|
-
], ListboxOption$1.prototype, "selectedAttribute", void 0);
|
|
175
|
-
index.__decorate([
|
|
176
|
-
index.observable
|
|
177
|
-
], ListboxOption$1.prototype, "selected", void 0);
|
|
178
|
-
index.__decorate([
|
|
179
|
-
index.attr({ attribute: "value", mode: "fromView" })
|
|
180
|
-
], ListboxOption$1.prototype, "initialValue", void 0);
|
|
181
|
-
/**
|
|
182
|
-
* States and properties relating to the ARIA `option` role.
|
|
183
|
-
*
|
|
184
|
-
* @public
|
|
185
|
-
*/
|
|
186
|
-
class DelegatesARIAListboxOption {
|
|
187
|
-
}
|
|
188
|
-
index.__decorate([
|
|
189
|
-
index.observable
|
|
190
|
-
], DelegatesARIAListboxOption.prototype, "ariaChecked", void 0);
|
|
191
|
-
index.__decorate([
|
|
192
|
-
index.observable
|
|
193
|
-
], DelegatesARIAListboxOption.prototype, "ariaPosInSet", void 0);
|
|
194
|
-
index.__decorate([
|
|
195
|
-
index.observable
|
|
196
|
-
], DelegatesARIAListboxOption.prototype, "ariaSelected", void 0);
|
|
197
|
-
index.__decorate([
|
|
198
|
-
index.observable
|
|
199
|
-
], DelegatesARIAListboxOption.prototype, "ariaSetSize", void 0);
|
|
200
|
-
applyMixins.applyMixins(DelegatesARIAListboxOption, ariaGlobal.ARIAGlobalStatesAndProperties);
|
|
201
|
-
applyMixins.applyMixins(ListboxOption$1, startEnd.StartEnd, DelegatesARIAListboxOption);
|
|
202
|
-
|
|
203
|
-
exports.ListboxOption = ListboxOption$1;
|
|
204
|
-
exports.isListboxOption = isListboxOption;
|