@vonage/vivid 3.32.0 → 3.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/index.js +5 -5
- package/accordion-item/index.js +4 -4
- package/action-group/index.js +1 -1
- package/alert/index.js +6 -6
- package/avatar/index.js +2 -2
- package/badge/index.js +2 -2
- package/banner/index.js +5 -5
- package/breadcrumb/index.js +1 -1
- package/breadcrumb-item/index.js +3 -3
- package/button/index.js +4 -4
- package/calendar/index.js +1 -1
- package/calendar-event/index.js +1 -1
- package/card/index.js +3 -3
- package/checkbox/index.js +5 -3
- package/combobox/index.js +8 -8
- package/custom-elements.json +256 -18
- package/data-grid/index.js +2 -2
- package/date-picker/index.js +9 -9
- package/dialog/index.js +6 -6
- package/divider/index.js +1 -1
- package/elevation/index.js +1 -1
- package/empty-state/index.js +2 -2
- package/fab/index.js +4 -4
- package/file-picker/index.js +5 -5
- package/focus/index.js +1 -1
- package/header/index.js +2 -2
- package/icon/index.js +1 -1
- package/index.js +59 -59
- package/layout/index.js +1 -1
- package/lib/avatar/avatar.d.ts +1 -1
- package/lib/calendar/calendar.d.ts +1 -1
- package/lib/date-picker/calendar/dateStr.d.ts +1 -0
- package/lib/date-picker/calendar/month.d.ts +1 -0
- package/lib/date-picker/calendar/year.d.ts +2 -0
- package/lib/date-picker/date-picker.d.ts +2 -0
- package/lib/icon/icon.d.ts +0 -1
- package/lib/listbox/listbox.d.ts +9 -1
- package/lib/progress-ring/progress-ring.d.ts +1 -1
- package/lib/text-field/text-field.d.ts +1 -0
- package/listbox/index.js +20 -16
- package/locales/en-GB.js +48 -14
- package/locales/en-US.js +48 -14
- package/locales/ja-JP.js +48 -14
- package/locales/zh-CN.js +48 -14
- package/menu/index.js +8 -8
- package/menu-item/index.js +4 -4
- package/nav/index.js +1 -1
- package/nav-disclosure/index.js +3 -3
- package/nav-item/index.js +3 -3
- package/note/index.js +2 -3
- package/number-field/index.js +6 -6
- package/option/index.js +3 -3
- package/package.json +2 -16
- package/pagination/index.js +5 -5
- package/popup/index.js +6 -6
- package/progress/index.js +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.js +2 -2
- package/radio-group/index.js +1 -1
- package/select/index.js +8 -8
- package/shared/affix.js +25 -9
- package/shared/apply-mixins.js +1 -1
- package/shared/breadcrumb-item.js +5 -5
- package/shared/button.js +13 -13
- package/shared/calendar-event.js +36 -16
- package/shared/definition.js +133 -194
- package/shared/definition10.js +225 -40
- package/shared/definition11.js +36 -32
- package/shared/definition12.js +763 -98
- package/shared/definition13.js +125 -89
- package/shared/definition14.js +207 -27
- package/shared/definition15.js +710 -731
- package/shared/definition16.js +1289 -47
- package/shared/definition17.js +6113 -93
- package/shared/definition18.js +242 -164
- package/shared/definition19.js +47 -692
- package/shared/definition2.js +199 -117
- package/shared/definition20.js +59 -1671
- package/shared/definition21.js +95 -255
- package/shared/definition22.js +2218 -1167
- package/shared/definition23.js +61 -5784
- package/shared/definition24.js +28 -117
- package/shared/definition25.js +52 -66
- package/shared/definition26.js +391 -214
- package/shared/definition27.js +441 -34
- package/shared/definition28.js +85 -73
- package/shared/definition29.js +21 -2283
- package/shared/definition3.js +61 -24
- package/shared/definition30.js +13 -49
- package/shared/definition31.js +54 -39
- package/shared/definition32.js +413 -375
- package/shared/definition33.js +223 -304
- package/shared/definition34.js +197 -13
- package/shared/definition35.js +88 -73
- package/shared/definition36.js +75 -25
- package/shared/definition37.js +434 -34
- package/shared/definition38.js +32 -432
- package/shared/definition39.js +677 -187
- package/shared/definition4.js +157 -12
- package/shared/definition40.js +95 -48
- package/shared/definition41.js +577 -31
- package/shared/definition42.js +126 -424
- package/shared/definition43.js +114 -618
- package/shared/definition44.js +24 -80
- package/shared/definition45.js +71 -543
- package/shared/definition46.js +499 -92
- package/shared/definition47.js +19 -133
- package/shared/definition48.js +129 -52
- package/shared/definition49.js +281 -17
- package/shared/definition5.js +71 -36
- package/shared/definition50.js +153 -484
- package/shared/definition51.js +131 -98
- package/shared/definition52.js +131 -16
- package/shared/definition53.js +80 -264
- package/shared/definition54.js +293 -118
- package/shared/definition55.js +12 -117
- package/shared/definition56.js +39 -68
- package/shared/definition57.js +166 -288
- package/shared/definition6.js +56 -111
- package/shared/definition7.js +120 -195
- package/shared/definition8.js +58 -23
- package/shared/definition9.js +92 -66
- package/shared/focus.js +2 -1
- package/shared/focus2.js +1 -1
- package/shared/form-associated.js +2 -2
- package/shared/icon.js +48 -27
- package/shared/index.js +7 -27
- package/shared/index2.js +108 -80
- package/shared/key-codes.js +1 -1
- package/shared/listbox.js +88 -11
- package/shared/patterns/form-elements/form-elements.d.ts +4 -4
- package/shared/radio.js +23 -7
- package/shared/repeat.js +1 -1
- package/shared/text-anchor.js +21 -4
- package/shared/text-anchor.template.js +37 -40
- package/shared/text-field.js +2 -2
- package/shared/text-field2.js +15 -15
- package/shared/tree-item.js +12 -12
- package/side-drawer/index.js +1 -1
- package/slider/index.js +2 -2
- package/split-button/index.js +3 -3
- package/style.css +6106 -0
- 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/switch/index.js +3 -3
- package/tab/index.js +3 -3
- package/tab-panel/index.js +1 -1
- package/tabs/index.js +5 -5
- package/tag/index.js +3 -3
- package/tag-group/index.js +1 -1
- package/text-anchor/index.js +1 -1
- package/text-area/index.js +3 -3
- package/text-field/index.js +3 -3
- package/toggletip/index.js +7 -7
- package/tooltip/index.js +7 -7
- package/tree-item/index.js +3 -3
- package/tree-view/index.js +1 -1
- package/vivid.api.json +10 -1
- package/lib/accordion/index.d.ts +0 -1
- package/lib/accordion-item/index.d.ts +0 -1
- package/lib/action-group/index.d.ts +0 -1
- package/lib/alert/index.d.ts +0 -1
- package/lib/avatar/index.d.ts +0 -1
- package/lib/badge/index.d.ts +0 -1
- package/lib/banner/index.d.ts +0 -1
- package/lib/breadcrumb/index.d.ts +0 -1
- package/lib/breadcrumb-item/index.d.ts +0 -1
- package/lib/button/index.d.ts +0 -1
- package/lib/calendar/index.d.ts +0 -1
- package/lib/calendar-event/index.d.ts +0 -1
- package/lib/card/index.d.ts +0 -1
- package/lib/checkbox/index.d.ts +0 -1
- package/lib/combobox/index.d.ts +0 -1
- package/lib/data-grid/index.d.ts +0 -1
- package/lib/date-picker/index.d.ts +0 -1
- package/lib/dialog/index.d.ts +0 -1
- package/lib/divider/index.d.ts +0 -1
- package/lib/elevation/index.d.ts +0 -1
- package/lib/empty-state/index.d.ts +0 -1
- package/lib/fab/index.d.ts +0 -1
- package/lib/file-picker/index.d.ts +0 -1
- package/lib/focus/index.d.ts +0 -1
- package/lib/header/index.d.ts +0 -1
- package/lib/icon/index.d.ts +0 -1
- package/lib/layout/index.d.ts +0 -1
- package/lib/listbox/index.d.ts +0 -1
- package/lib/menu/index.d.ts +0 -1
- package/lib/menu-item/index.d.ts +0 -1
- package/lib/nav/index.d.ts +0 -1
- package/lib/nav-disclosure/index.d.ts +0 -1
- package/lib/nav-item/index.d.ts +0 -1
- package/lib/note/index.d.ts +0 -1
- package/lib/number-field/index.d.ts +0 -1
- package/lib/option/index.d.ts +0 -1
- package/lib/pagination/index.d.ts +0 -1
- package/lib/popup/index.d.ts +0 -1
- package/lib/progress/index.d.ts +0 -1
- package/lib/progress-ring/index.d.ts +0 -1
- package/lib/radio/index.d.ts +0 -1
- package/lib/radio-group/index.d.ts +0 -1
- package/lib/select/index.d.ts +0 -1
- package/lib/side-drawer/index.d.ts +0 -1
- package/lib/slider/index.d.ts +0 -1
- package/lib/split-button/index.d.ts +0 -1
- package/lib/switch/index.d.ts +0 -1
- package/lib/tab/index.d.ts +0 -1
- package/lib/tab-panel/index.d.ts +0 -1
- package/lib/tabs/index.d.ts +0 -1
- package/lib/tag/index.d.ts +0 -1
- package/lib/tag-group/index.d.ts +0 -1
- package/lib/text-anchor/index.d.ts +0 -1
- package/lib/text-area/index.d.ts +0 -1
- package/lib/text-field/index.d.ts +0 -1
- package/lib/toggletip/index.d.ts +0 -1
- package/lib/tooltip/index.d.ts +0 -1
- package/lib/tree-item/index.d.ts +0 -1
- package/lib/tree-view/index.d.ts +0 -1
package/shared/index2.js
CHANGED
|
@@ -1,45 +1,57 @@
|
|
|
1
|
-
import { _ as __decorate, a as attr, b as __metadata, o as observable, v as volatile, h as html, d as __classPrivateFieldGet, f as __classPrivateFieldSet } from './index.js';
|
|
2
1
|
import { I as Icon } from './icon.js';
|
|
2
|
+
import { a as attr, o as observable, v as volatile, h as html } from './index.js';
|
|
3
3
|
import { w as when } from './when.js';
|
|
4
4
|
import enUS from '../locales/en-US.js';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const messageStyles = "/**\n * Do not edit directly\n * Generated on Wed, 06 Sep 2023 09:40:36 GMT\n */\n.message {\n display: flex;\n contain: inline-size;\n font: var(--vvd-typography-base-condensed);\n gap: 4px;\n grid-column: 1/-1;\n}\n.message-text {\n color: var(--vvd-color-canvas-text);\n}\n.helper-message .message-text {\n color: var(--_low-ink-color);\n}\n.message-icon {\n font-size: 16px;\n}\n.success-message .message-icon {\n color: var(--vvd-color-success-500);\n}\n.error-message .message-icon {\n color: var(--vvd-color-alert-500);\n}";
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
var __defProp$1 = Object.defineProperty;
|
|
9
|
+
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
11
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
|
|
12
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
13
|
+
if (decorator = decorators[i])
|
|
14
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
15
|
+
if (kind && result)
|
|
16
|
+
__defProp$1(target, key, result);
|
|
17
|
+
return result;
|
|
18
|
+
};
|
|
19
|
+
const ElementInternalsKey = "ElementInternals";
|
|
20
|
+
const supportsElementInternals = () => ElementInternalsKey in window && "setFormValue" in window[ElementInternalsKey].prototype;
|
|
21
|
+
class FormElementHelperText {
|
|
22
|
+
}
|
|
23
|
+
__decorateClass$1([
|
|
24
|
+
attr({ attribute: "helper-text" })
|
|
25
|
+
], FormElementHelperText.prototype, "helperText", 2);
|
|
26
|
+
class FormElementSuccessText {
|
|
27
|
+
}
|
|
28
|
+
__decorateClass$1([
|
|
29
|
+
attr({ attribute: "success-text" })
|
|
30
|
+
], FormElementSuccessText.prototype, "successText", 2);
|
|
18
31
|
class FormElementCharCount {
|
|
19
32
|
constructor() {
|
|
20
33
|
this.charCount = false;
|
|
21
34
|
}
|
|
22
35
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
36
|
+
__decorateClass$1([
|
|
37
|
+
attr({
|
|
38
|
+
attribute: "char-count",
|
|
39
|
+
mode: "boolean"
|
|
40
|
+
})
|
|
41
|
+
], FormElementCharCount.prototype, "charCount", 2);
|
|
27
42
|
function formElements(constructor) {
|
|
28
|
-
var _Decorated_blurred, _Decorated_handleInvalidEvent;
|
|
29
43
|
class Decorated extends constructor {
|
|
30
|
-
get errorValidationMessage() {
|
|
31
|
-
return this.userValid ? '' : this.validationMessage;
|
|
32
|
-
}
|
|
33
44
|
constructor(...args) {
|
|
34
45
|
super(...args);
|
|
35
46
|
this.userValid = true;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (
|
|
39
|
-
|
|
47
|
+
this.#blurred = false;
|
|
48
|
+
this.#handleInvalidEvent = () => {
|
|
49
|
+
if (this.#blurred && this.dirtyValue)
|
|
50
|
+
return;
|
|
51
|
+
this.#blurred = true;
|
|
40
52
|
this.dirtyValue = true;
|
|
41
53
|
this.validate();
|
|
42
|
-
}
|
|
54
|
+
};
|
|
43
55
|
this.validate = () => {
|
|
44
56
|
if (supportsElementInternals() && this.proxy instanceof HTMLElement) {
|
|
45
57
|
this.setValidity(this.proxy.validity, this.proxy.validationMessage, this.control);
|
|
@@ -48,53 +60,61 @@ function formElements(constructor) {
|
|
|
48
60
|
}
|
|
49
61
|
this.userValid = !this.userValid;
|
|
50
62
|
if (this.proxy instanceof HTMLElement) {
|
|
51
|
-
this.userValid =
|
|
63
|
+
this.userValid = this.#blurred && this.dirtyValue ? !this.validationMessage : true;
|
|
52
64
|
}
|
|
53
65
|
};
|
|
54
|
-
this.addEventListener(
|
|
55
|
-
|
|
66
|
+
this.addEventListener("blur", () => {
|
|
67
|
+
this.#blurred = true;
|
|
56
68
|
this.validate();
|
|
57
69
|
});
|
|
58
|
-
this.addEventListener(
|
|
59
|
-
|
|
70
|
+
this.addEventListener("focus", () => {
|
|
71
|
+
this.#blurred = false;
|
|
60
72
|
});
|
|
61
|
-
this.addEventListener(
|
|
62
|
-
this.proxy.dispatchEvent(new Event(
|
|
73
|
+
this.addEventListener("invalid", () => {
|
|
74
|
+
this.proxy.dispatchEvent(new Event("invalid"));
|
|
63
75
|
});
|
|
64
76
|
}
|
|
77
|
+
#blurred;
|
|
78
|
+
get errorValidationMessage() {
|
|
79
|
+
return this.userValid ? "" : this.validationMessage;
|
|
80
|
+
}
|
|
65
81
|
connectedCallback() {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
this.proxy.addEventListener('invalid', __classPrivateFieldGet(this, _Decorated_handleInvalidEvent, "f"));
|
|
82
|
+
super.connectedCallback?.();
|
|
83
|
+
this.proxy.addEventListener("invalid", this.#handleInvalidEvent);
|
|
69
84
|
}
|
|
85
|
+
#handleInvalidEvent;
|
|
70
86
|
disconnectedCallback() {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
this.proxy.removeEventListener('invalid', __classPrivateFieldGet(this, _Decorated_handleInvalidEvent, "f"));
|
|
87
|
+
super.disconnectedCallback?.();
|
|
88
|
+
this.proxy.removeEventListener("invalid", this.#handleInvalidEvent);
|
|
74
89
|
}
|
|
75
90
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
91
|
+
__decorateClass$1([
|
|
92
|
+
attr
|
|
93
|
+
], Decorated.prototype, "label", 2);
|
|
94
|
+
__decorateClass$1([
|
|
95
|
+
observable
|
|
96
|
+
], Decorated.prototype, "userValid", 2);
|
|
97
|
+
__decorateClass$1([
|
|
98
|
+
volatile
|
|
99
|
+
], Decorated.prototype, "errorValidationMessage", 1);
|
|
80
100
|
return Decorated;
|
|
81
101
|
}
|
|
82
102
|
function getFeedbackTemplate(messageType, context) {
|
|
83
103
|
const MessageTypeMap = {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
104
|
+
"helper": {
|
|
105
|
+
"messageProperty": "helperText",
|
|
106
|
+
"className": "helper",
|
|
107
|
+
"iconType": ""
|
|
88
108
|
},
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
109
|
+
"error": {
|
|
110
|
+
"messageProperty": "errorValidationMessage",
|
|
111
|
+
"className": "error",
|
|
112
|
+
"iconType": "info-line"
|
|
93
113
|
},
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
114
|
+
"success": {
|
|
115
|
+
"messageProperty": "successText",
|
|
116
|
+
"className": "success",
|
|
117
|
+
"iconType": "check-circle-line"
|
|
98
118
|
}
|
|
99
119
|
};
|
|
100
120
|
const iconTag = context.tagFor(Icon);
|
|
@@ -102,7 +122,7 @@ function getFeedbackTemplate(messageType, context) {
|
|
|
102
122
|
const iconType = messageTypeConfig.iconType;
|
|
103
123
|
return html`
|
|
104
124
|
<style>
|
|
105
|
-
${
|
|
125
|
+
${messageStyles}
|
|
106
126
|
|
|
107
127
|
</style>
|
|
108
128
|
<div class="message ${MessageTypeMap[messageType].className}-message">
|
|
@@ -113,61 +133,69 @@ function getFeedbackTemplate(messageType, context) {
|
|
|
113
133
|
})}
|
|
114
134
|
</div>`;
|
|
115
135
|
}
|
|
116
|
-
function feedbackMessage({
|
|
117
|
-
messageProperty
|
|
118
|
-
}) {
|
|
136
|
+
function feedbackMessage({ messageProperty }) {
|
|
119
137
|
return html`
|
|
120
|
-
<span class="message-text">${x => x[messageProperty]}</span>
|
|
138
|
+
<span class="message-text">${(x) => x[messageProperty]}</span>
|
|
121
139
|
`;
|
|
122
140
|
}
|
|
123
141
|
function errorText(constructor) {
|
|
124
|
-
var _Decorated_shouldValidate, _Decorated_prevSuccessText;
|
|
125
142
|
class Decorated extends constructor {
|
|
126
143
|
constructor(...args) {
|
|
127
144
|
super(...args);
|
|
128
|
-
|
|
129
|
-
|
|
145
|
+
this.#shouldValidate = true;
|
|
146
|
+
this.#prevSuccessText = "";
|
|
130
147
|
this._validate = this.validate;
|
|
131
148
|
this.validate = () => {
|
|
132
|
-
if (
|
|
149
|
+
if (this.#shouldValidate)
|
|
150
|
+
this._validate();
|
|
133
151
|
};
|
|
134
152
|
}
|
|
153
|
+
#shouldValidate;
|
|
154
|
+
#prevSuccessText;
|
|
135
155
|
errorTextChanged(_, newmsg) {
|
|
136
156
|
if (newmsg) {
|
|
137
|
-
this.setValidity({
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
__classPrivateFieldSet(this, _Decorated_prevSuccessText, this.successText, "f");
|
|
141
|
-
this.successText = '';
|
|
157
|
+
this.setValidity({ customError: true }, newmsg, this.control);
|
|
158
|
+
this.#prevSuccessText = this.successText;
|
|
159
|
+
this.successText = "";
|
|
142
160
|
this.userValid = !this.userValid;
|
|
143
161
|
this.userValid = false;
|
|
144
|
-
|
|
162
|
+
this.#shouldValidate = false;
|
|
145
163
|
} else {
|
|
146
|
-
this.setValidity({
|
|
147
|
-
|
|
148
|
-
}, '', this.control);
|
|
149
|
-
this.successText = __classPrivateFieldGet(this, _Decorated_prevSuccessText, "f");
|
|
164
|
+
this.setValidity({ customError: false }, "", this.control);
|
|
165
|
+
this.successText = this.#prevSuccessText;
|
|
150
166
|
this.userValid = true;
|
|
151
|
-
|
|
167
|
+
this.#shouldValidate = true;
|
|
152
168
|
this._validate();
|
|
153
169
|
}
|
|
154
170
|
}
|
|
155
171
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}), __metadata("design:type", String)], Decorated.prototype, "errorText", void 0);
|
|
172
|
+
__decorateClass$1([
|
|
173
|
+
attr({ attribute: "error-text" })
|
|
174
|
+
], Decorated.prototype, "errorText", 2);
|
|
160
175
|
return Decorated;
|
|
161
176
|
}
|
|
162
177
|
|
|
178
|
+
var __defProp = Object.defineProperty;
|
|
179
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
180
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
181
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
182
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
183
|
+
if (decorator = decorators[i])
|
|
184
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
185
|
+
if (kind && result)
|
|
186
|
+
__defProp(target, key, result);
|
|
187
|
+
return result;
|
|
188
|
+
};
|
|
163
189
|
class CurrentLocale {
|
|
164
190
|
constructor() {
|
|
165
191
|
this.locale = enUS;
|
|
166
192
|
}
|
|
167
193
|
}
|
|
168
|
-
|
|
194
|
+
__decorateClass([
|
|
195
|
+
observable
|
|
196
|
+
], CurrentLocale.prototype, "locale", 2);
|
|
169
197
|
const currentLocale = new CurrentLocale();
|
|
170
|
-
const setLocale = locale => {
|
|
198
|
+
const setLocale = (locale) => {
|
|
171
199
|
currentLocale.locale = locale;
|
|
172
200
|
};
|
|
173
201
|
|
package/shared/key-codes.js
CHANGED
|
@@ -97,4 +97,4 @@ const ArrowKeys = {
|
|
|
97
97
|
ArrowUp: keyArrowUp,
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
-
export { ArrowKeys as A,
|
|
100
|
+
export { ArrowKeys as A, keySpace as a, keyEnd as b, keyHome as c, keyArrowDown as d, keyArrowUp as e, keyEscape as f, keyTab as g, keyArrowRight as h, keyArrowLeft as i, keyPageDown as j, keyEnter as k, keyPageUp as l, keyFunction2 as m };
|
package/shared/listbox.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { F as FoundationElement, O as Observable, _ as __decorate, a as attr, o as observable, D as DOM, n as nullableNumberConverter
|
|
2
|
-
import { i as isListboxOption } from './
|
|
1
|
+
import { F as FoundationElement, O as Observable, _ as __decorate, a as attr, o as observable, D as DOM, n as nullableNumberConverter } from './index.js';
|
|
2
|
+
import { i as isListboxOption } from './definition33.js';
|
|
3
3
|
import { A as ARIAGlobalStatesAndProperties } from './aria-global.js';
|
|
4
4
|
import { a as applyMixins } from './apply-mixins.js';
|
|
5
|
-
import {
|
|
5
|
+
import { a as keySpace, f as keyEscape, k as keyEnter, g as keyTab, b as keyEnd, e as keyArrowUp, d as keyArrowDown, c as keyHome } from './key-codes.js';
|
|
6
6
|
import { u as uniqueId } from './strings.js';
|
|
7
7
|
import { i as inRange } from './numbers.js';
|
|
8
8
|
|
|
@@ -30,7 +30,7 @@ function findLastIndex(array, predicate) {
|
|
|
30
30
|
*
|
|
31
31
|
* @public
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
let Listbox$1 = class Listbox extends FoundationElement {
|
|
34
34
|
constructor() {
|
|
35
35
|
super(...arguments);
|
|
36
36
|
/**
|
|
@@ -226,7 +226,7 @@ class Listbox$1 extends FoundationElement {
|
|
|
226
226
|
handleChange(source, propertyName) {
|
|
227
227
|
switch (propertyName) {
|
|
228
228
|
case "selected": {
|
|
229
|
-
if (Listbox
|
|
229
|
+
if (Listbox.slottedOptionFilter(source)) {
|
|
230
230
|
this.selectedIndex = this.options.indexOf(source);
|
|
231
231
|
}
|
|
232
232
|
this.setSelectedOptions();
|
|
@@ -248,7 +248,7 @@ class Listbox$1 extends FoundationElement {
|
|
|
248
248
|
if (this.typeaheadTimeout) {
|
|
249
249
|
window.clearTimeout(this.typeaheadTimeout);
|
|
250
250
|
}
|
|
251
|
-
this.typeaheadTimeout = window.setTimeout(() => (this.typeaheadExpired = true), Listbox
|
|
251
|
+
this.typeaheadTimeout = window.setTimeout(() => (this.typeaheadExpired = true), Listbox.TYPE_AHEAD_TIMEOUT_MS);
|
|
252
252
|
if (key.length > 1) {
|
|
253
253
|
return;
|
|
254
254
|
}
|
|
@@ -374,7 +374,7 @@ class Listbox$1 extends FoundationElement {
|
|
|
374
374
|
*/
|
|
375
375
|
selectedOptionsChanged(prev, next) {
|
|
376
376
|
var _a;
|
|
377
|
-
const filteredNext = next.filter(Listbox
|
|
377
|
+
const filteredNext = next.filter(Listbox.slottedOptionFilter);
|
|
378
378
|
(_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach(o => {
|
|
379
379
|
const notifier = Observable.getNotifier(o);
|
|
380
380
|
notifier.unsubscribe(this, "selected");
|
|
@@ -493,7 +493,7 @@ class Listbox$1 extends FoundationElement {
|
|
|
493
493
|
this.typeaheadExpired = false;
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
}
|
|
496
|
+
};
|
|
497
497
|
/**
|
|
498
498
|
* A static filter to include only selectable options.
|
|
499
499
|
*
|
|
@@ -989,7 +989,84 @@ __decorate([
|
|
|
989
989
|
attr({ converter: nullableNumberConverter })
|
|
990
990
|
], ListboxElement.prototype, "size", void 0);
|
|
991
991
|
|
|
992
|
-
|
|
993
|
-
|
|
992
|
+
/**
|
|
993
|
+
* String values for use with KeyboardEvent.key
|
|
994
|
+
*/
|
|
995
|
+
const keyArrowLeft = "ArrowLeft";
|
|
996
|
+
const keyArrowRight = "ArrowRight";
|
|
997
|
+
|
|
998
|
+
var __defProp = Object.defineProperty;
|
|
999
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
1000
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
1001
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
1002
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1003
|
+
if (decorator = decorators[i])
|
|
1004
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1005
|
+
if (kind && result)
|
|
1006
|
+
__defProp(target, key, result);
|
|
1007
|
+
return result;
|
|
1008
|
+
};
|
|
1009
|
+
class Listbox extends ListboxElement {
|
|
1010
|
+
orientationChanged() {
|
|
1011
|
+
if (this.orientation === "horizontal") {
|
|
1012
|
+
this.addEventListener("keydown", this.#horizontalKeydownHandler);
|
|
1013
|
+
} else {
|
|
1014
|
+
this.removeEventListener("keydown", this.#horizontalKeydownHandler);
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
/**
|
|
1018
|
+
* Handles `keydown` actions for horizontal listbox navigation and typeahead.
|
|
1019
|
+
*
|
|
1020
|
+
* @internal
|
|
1021
|
+
*/
|
|
1022
|
+
#horizontalKeydownHandler(e) {
|
|
1023
|
+
if (this.disabled) {
|
|
1024
|
+
return true;
|
|
1025
|
+
}
|
|
1026
|
+
const key = e.key;
|
|
1027
|
+
switch (key) {
|
|
1028
|
+
case keyArrowRight: {
|
|
1029
|
+
if (!e.shiftKey) {
|
|
1030
|
+
e.preventDefault();
|
|
1031
|
+
this.selectNextOption();
|
|
1032
|
+
}
|
|
1033
|
+
break;
|
|
1034
|
+
}
|
|
1035
|
+
case keyArrowLeft: {
|
|
1036
|
+
if (!e.shiftKey) {
|
|
1037
|
+
e.preventDefault();
|
|
1038
|
+
this.selectPreviousOption();
|
|
1039
|
+
}
|
|
1040
|
+
break;
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
slottedOptionsChanged(prev, next) {
|
|
1045
|
+
super.slottedOptionsChanged(prev, next);
|
|
1046
|
+
this.#disableSlottedChildren();
|
|
1047
|
+
}
|
|
1048
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
1049
|
+
super.attributeChangedCallback(name, oldValue, newValue);
|
|
1050
|
+
if (name === "disabled") {
|
|
1051
|
+
this.#disableSlottedChildren();
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
#disableSlottedChildren() {
|
|
1055
|
+
this.options.forEach((optionElement) => {
|
|
1056
|
+
if (!optionElement.disabled) {
|
|
1057
|
+
optionElement.disabled = this.disabled;
|
|
1058
|
+
}
|
|
1059
|
+
});
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
__decorateClass([
|
|
1063
|
+
attr
|
|
1064
|
+
], Listbox.prototype, "appearance", 2);
|
|
1065
|
+
__decorateClass([
|
|
1066
|
+
attr
|
|
1067
|
+
], Listbox.prototype, "orientation", 2);
|
|
1068
|
+
__decorateClass([
|
|
1069
|
+
attr
|
|
1070
|
+
], Listbox.prototype, "shape", 2);
|
|
994
1071
|
|
|
995
|
-
export { DelegatesARIAListbox as D,
|
|
1072
|
+
export { DelegatesARIAListbox as D, ListboxElement as L, Listbox as a, Listbox$1 as b };
|
|
@@ -33,10 +33,10 @@ export declare function formElements<T extends {
|
|
|
33
33
|
[x: string]: any;
|
|
34
34
|
label?: string | undefined;
|
|
35
35
|
userValid: boolean;
|
|
36
|
-
"__#
|
|
36
|
+
"__#2@#blurred": boolean;
|
|
37
37
|
readonly errorValidationMessage: any;
|
|
38
38
|
connectedCallback(): void;
|
|
39
|
-
"__#
|
|
39
|
+
"__#2@#handleInvalidEvent": () => void;
|
|
40
40
|
disconnectedCallback(): void;
|
|
41
41
|
validate: () => void;
|
|
42
42
|
};
|
|
@@ -49,8 +49,8 @@ export declare function errorText<T extends {
|
|
|
49
49
|
new (...args: any[]): {
|
|
50
50
|
[x: string]: any;
|
|
51
51
|
errorText?: string | undefined;
|
|
52
|
-
"__#
|
|
53
|
-
"__#
|
|
52
|
+
"__#3@#shouldValidate": boolean;
|
|
53
|
+
"__#3@#prevSuccessText": string;
|
|
54
54
|
errorTextChanged(_: string, newmsg: string | undefined): void;
|
|
55
55
|
};
|
|
56
56
|
} & T;
|
package/shared/radio.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { F as FoundationElement, _ as __decorate, a as attr, o as observable
|
|
1
|
+
import { F as FoundationElement, _ as __decorate, a as attr, o as observable } from './index.js';
|
|
2
2
|
import { C as CheckableFormAssociated } from './form-associated.js';
|
|
3
|
-
import {
|
|
3
|
+
import { a as keySpace } from './key-codes.js';
|
|
4
4
|
|
|
5
5
|
class _Radio extends FoundationElement {
|
|
6
6
|
}
|
|
@@ -28,7 +28,7 @@ class FormAssociatedRadio extends CheckableFormAssociated(_Radio) {
|
|
|
28
28
|
*
|
|
29
29
|
* @public
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
let Radio$1 = class Radio extends FormAssociatedRadio {
|
|
32
32
|
constructor() {
|
|
33
33
|
super();
|
|
34
34
|
/**
|
|
@@ -110,7 +110,7 @@ class Radio$1 extends FormAssociatedRadio {
|
|
|
110
110
|
this.checked = true;
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
}
|
|
113
|
+
};
|
|
114
114
|
__decorate([
|
|
115
115
|
attr({ attribute: "readonly", mode: "boolean" })
|
|
116
116
|
], Radio$1.prototype, "readOnly", void 0);
|
|
@@ -121,8 +121,24 @@ __decorate([
|
|
|
121
121
|
observable
|
|
122
122
|
], Radio$1.prototype, "defaultSlottedNodes", void 0);
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
var __defProp = Object.defineProperty;
|
|
125
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
126
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
127
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
128
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
129
|
+
if (decorator = decorators[i])
|
|
130
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
131
|
+
if (kind && result)
|
|
132
|
+
__defProp(target, key, result);
|
|
133
|
+
return result;
|
|
134
|
+
};
|
|
135
|
+
class Radio extends Radio$1 {
|
|
136
|
+
}
|
|
137
|
+
__decorateClass([
|
|
138
|
+
attr
|
|
139
|
+
], Radio.prototype, "label", 2);
|
|
140
|
+
__decorateClass([
|
|
141
|
+
attr
|
|
142
|
+
], Radio.prototype, "connotation", 2);
|
|
127
143
|
|
|
128
144
|
export { Radio as R };
|
package/shared/repeat.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as emptyArray, O as Observable, S as SubscriberSet, D as DOM, H as HTMLDirective,
|
|
1
|
+
import { e as emptyArray, O as Observable, S as SubscriberSet, D as DOM, H as HTMLDirective, f as HTMLView } from './index.js';
|
|
2
2
|
|
|
3
3
|
/** @internal */
|
|
4
4
|
function newSplice(index, removed, addedCount) {
|
package/shared/text-anchor.js
CHANGED
|
@@ -1,14 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { b as AffixIcon } from './affix.js';
|
|
1
|
+
import { A as AffixIcon } from './affix.js';
|
|
3
2
|
import { A as Anchor } from './anchor.js';
|
|
4
3
|
import { a as applyMixins } from './apply-mixins.js';
|
|
4
|
+
import { a as attr } from './index.js';
|
|
5
5
|
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
9
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
10
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
11
|
+
if (decorator = decorators[i])
|
|
12
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
13
|
+
if (kind && result)
|
|
14
|
+
__defProp(target, key, result);
|
|
15
|
+
return result;
|
|
16
|
+
};
|
|
6
17
|
class TextAnchor extends Anchor {
|
|
18
|
+
/**
|
|
19
|
+
* Allows subclasses to provide a body template that will be rendered inside the anchor.
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
7
22
|
getBodyTemplate() {
|
|
8
|
-
return
|
|
23
|
+
return void 0;
|
|
9
24
|
}
|
|
10
25
|
}
|
|
11
|
-
|
|
26
|
+
__decorateClass([
|
|
27
|
+
attr
|
|
28
|
+
], TextAnchor.prototype, "text", 2);
|
|
12
29
|
applyMixins(TextAnchor, AffixIcon);
|
|
13
30
|
|
|
14
31
|
export { TextAnchor as T };
|
|
@@ -4,52 +4,49 @@ import { h as html } from './index.js';
|
|
|
4
4
|
import { r as ref } from './ref.js';
|
|
5
5
|
import { c as classNames } from './class-names.js';
|
|
6
6
|
|
|
7
|
-
const getClasses = ({
|
|
8
|
-
|
|
9
|
-
icon
|
|
10
|
-
|
|
11
|
-
const textAnchorTemplate = context => {
|
|
7
|
+
const getClasses = ({ text, icon }) => classNames(
|
|
8
|
+
"control",
|
|
9
|
+
["icon-only", !text && !!icon]
|
|
10
|
+
);
|
|
11
|
+
const textAnchorTemplate = (context) => {
|
|
12
12
|
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
13
13
|
const focusTemplate = focusTemplateFactory(context);
|
|
14
14
|
return html`<a
|
|
15
15
|
class="${getClasses}"
|
|
16
|
-
download="${x => x.download}"
|
|
17
|
-
href="${x => x.href}"
|
|
18
|
-
hreflang="${x => x.hreflang}"
|
|
19
|
-
ping="${x => x.ping}"
|
|
20
|
-
referrerpolicy="${x => x.referrerpolicy}"
|
|
21
|
-
rel="${x => x.rel}"
|
|
22
|
-
target="${x => x.target}"
|
|
23
|
-
type="${x => x.type}"
|
|
24
|
-
aria-atomic="${x => x.ariaAtomic}"
|
|
25
|
-
aria-busy="${x => x.ariaBusy}"
|
|
26
|
-
aria-controls="${x => x.ariaControls}"
|
|
27
|
-
aria-current="${x => x.ariaCurrent}"
|
|
28
|
-
aria-describedby="${x => x.ariaDescribedby}"
|
|
29
|
-
aria-details="${x => x.ariaDetails}"
|
|
30
|
-
aria-disabled="${x => x.ariaDisabled}"
|
|
31
|
-
aria-errormessage="${x => x.ariaErrormessage}"
|
|
32
|
-
aria-expanded="${x => x.ariaExpanded}"
|
|
33
|
-
aria-flowto="${x => x.ariaFlowto}"
|
|
34
|
-
aria-haspopup="${x => x.ariaHaspopup}"
|
|
35
|
-
aria-hidden="${x => x.ariaHidden}"
|
|
36
|
-
aria-invalid="${x => x.ariaInvalid}"
|
|
37
|
-
aria-keyshortcuts="${x => x.ariaKeyshortcuts}"
|
|
38
|
-
aria-label="${x => x.ariaLabel}"
|
|
39
|
-
aria-labelledby="${x => x.ariaLabelledby}"
|
|
40
|
-
aria-live="${x => x.ariaLive}"
|
|
41
|
-
aria-owns="${x => x.ariaOwns}"
|
|
42
|
-
aria-relevant="${x => x.ariaRelevant}"
|
|
43
|
-
aria-roledescription="${x => x.ariaRoledescription}"
|
|
44
|
-
${ref(
|
|
16
|
+
download="${(x) => x.download}"
|
|
17
|
+
href="${(x) => x.href}"
|
|
18
|
+
hreflang="${(x) => x.hreflang}"
|
|
19
|
+
ping="${(x) => x.ping}"
|
|
20
|
+
referrerpolicy="${(x) => x.referrerpolicy}"
|
|
21
|
+
rel="${(x) => x.rel}"
|
|
22
|
+
target="${(x) => x.target}"
|
|
23
|
+
type="${(x) => x.type}"
|
|
24
|
+
aria-atomic="${(x) => x.ariaAtomic}"
|
|
25
|
+
aria-busy="${(x) => x.ariaBusy}"
|
|
26
|
+
aria-controls="${(x) => x.ariaControls}"
|
|
27
|
+
aria-current="${(x) => x.ariaCurrent}"
|
|
28
|
+
aria-describedby="${(x) => x.ariaDescribedby}"
|
|
29
|
+
aria-details="${(x) => x.ariaDetails}"
|
|
30
|
+
aria-disabled="${(x) => x.ariaDisabled}"
|
|
31
|
+
aria-errormessage="${(x) => x.ariaErrormessage}"
|
|
32
|
+
aria-expanded="${(x) => x.ariaExpanded}"
|
|
33
|
+
aria-flowto="${(x) => x.ariaFlowto}"
|
|
34
|
+
aria-haspopup="${(x) => x.ariaHaspopup}"
|
|
35
|
+
aria-hidden="${(x) => x.ariaHidden}"
|
|
36
|
+
aria-invalid="${(x) => x.ariaInvalid}"
|
|
37
|
+
aria-keyshortcuts="${(x) => x.ariaKeyshortcuts}"
|
|
38
|
+
aria-label="${(x) => x.ariaLabel}"
|
|
39
|
+
aria-labelledby="${(x) => x.ariaLabelledby}"
|
|
40
|
+
aria-live="${(x) => x.ariaLive}"
|
|
41
|
+
aria-owns="${(x) => x.ariaOwns}"
|
|
42
|
+
aria-relevant="${(x) => x.ariaRelevant}"
|
|
43
|
+
aria-roledescription="${(x) => x.ariaRoledescription}"
|
|
44
|
+
${ref("control")}
|
|
45
45
|
>
|
|
46
46
|
${() => focusTemplate}
|
|
47
|
-
${x => affixIconTemplate(x.icon)}
|
|
48
|
-
${x => x.text}
|
|
49
|
-
${x =>
|
|
50
|
-
var _a, _b;
|
|
51
|
-
return (_b = (_a = x.getBodyTemplate) === null || _a === void 0 ? void 0 : _a.call(x)) !== null && _b !== void 0 ? _b : '';
|
|
52
|
-
}}
|
|
47
|
+
${(x) => affixIconTemplate(x.icon)}
|
|
48
|
+
${(x) => x.text}
|
|
49
|
+
${(x) => x.getBodyTemplate?.() ?? ""}
|
|
53
50
|
</a>
|
|
54
51
|
`;
|
|
55
52
|
};
|