@vonage/vivid 3.0.0-next.8 → 3.0.0-next.80
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 +141 -4
- package/accordion/index.js +2 -4
- package/accordion-item/index.js +26 -20
- package/action-group/index.js +47 -0
- package/avatar/index.js +70 -0
- package/badge/index.js +17 -21
- package/banner/index.js +23 -87
- package/breadcrumb/index.js +21 -18
- package/breadcrumb-item/index.js +19 -12
- package/button/index.js +19 -757
- package/calendar/index.js +67 -25
- package/calendar-event/index.js +115 -0
- package/card/index.js +132 -0
- package/checkbox/index.js +184 -0
- package/dialog/index.js +281 -0
- package/divider/index.js +3 -0
- package/elevation/index.js +3 -31
- package/fab/index.js +105 -0
- package/focus/index.js +18 -3
- package/header/index.js +66 -0
- package/icon/index.js +9 -5
- package/index.js +53 -20
- package/layout/index.js +4 -6
- package/lib/accordion-item/accordion-item.d.ts +2 -2
- package/lib/accordion-item/index.d.ts +2 -1
- package/lib/action-group/action-group.d.ts +10 -0
- package/lib/{sidenav-item/sidenav-item.template.d.ts → action-group/action-group.template.d.ts} +2 -2
- package/lib/{sidenav-item → action-group}/index.d.ts +1 -2
- package/lib/avatar/avatar.d.ts +15 -0
- package/lib/avatar/avatar.template.d.ts +4 -0
- package/lib/avatar/index.d.ts +3 -0
- package/lib/badge/badge.d.ts +5 -5
- package/lib/badge/index.d.ts +1 -1
- package/lib/banner/banner.d.ts +1 -1
- package/lib/banner/banner.template.d.ts +0 -2
- package/lib/banner/index.d.ts +1 -0
- package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
- package/lib/breadcrumb-item/index.d.ts +1 -0
- package/lib/button/button.d.ts +6 -5
- package/lib/button/index.d.ts +2 -19
- package/lib/calendar/calendar.d.ts +3 -1
- package/lib/calendar/index.d.ts +0 -1
- package/lib/calendar-event/calendar-event.d.ts +14 -0
- package/lib/calendar-event/calendar-event.template.d.ts +4 -0
- package/lib/calendar-event/index.d.ts +2 -0
- package/lib/card/card.d.ts +10 -0
- package/lib/{text/text.template.d.ts → card/card.template.d.ts} +2 -2
- package/lib/card/index.d.ts +4 -0
- package/lib/checkbox/checkbox.d.ts +5 -0
- package/lib/checkbox/checkbox.template.d.ts +4 -0
- package/lib/checkbox/index.d.ts +4 -0
- package/lib/components.d.ts +27 -10
- package/lib/dialog/dialog.d.ts +20 -0
- package/lib/dialog/dialog.template.d.ts +4 -0
- package/lib/dialog/index.d.ts +5 -0
- package/lib/divider/divider.d.ts +3 -0
- package/lib/divider/divider.template.d.ts +4 -0
- package/lib/divider/index.d.ts +2 -0
- package/lib/elevation/elevation.d.ts +1 -0
- package/lib/elevation/index.d.ts +1 -1
- package/lib/enums.d.ts +11 -6
- package/lib/fab/fab.d.ts +13 -0
- package/lib/fab/fab.template.d.ts +4 -0
- package/lib/fab/index.d.ts +4 -0
- package/lib/focus/index.d.ts +1 -1
- package/lib/header/header.d.ts +5 -0
- package/lib/header/header.template.d.ts +4 -0
- package/lib/header/index.d.ts +3 -0
- package/lib/icon/icon.d.ts +4 -3
- package/lib/layout/index.d.ts +1 -1
- package/lib/layout/layout.d.ts +3 -3
- package/lib/menu/index.d.ts +12 -0
- package/lib/menu/menu.d.ts +10 -0
- package/lib/menu/menu.template.d.ts +3 -0
- package/lib/menu-item/index.d.ts +3 -0
- package/lib/menu-item/menu-item.d.ts +7 -0
- package/lib/menu-item/menu-item.template.d.ts +5 -0
- package/lib/nav/index.d.ts +2 -0
- package/lib/nav/nav.d.ts +3 -0
- package/lib/nav/nav.template.d.ts +4 -0
- package/lib/nav-disclosure/index.d.ts +4 -0
- package/lib/nav-disclosure/nav-disclosure.d.ts +10 -0
- package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -0
- package/lib/nav-item/index.d.ts +4 -0
- package/lib/{sidenav-item/sidenav-item.d.ts → nav-item/nav-item.d.ts} +2 -2
- package/lib/nav-item/nav-item.template.d.ts +4 -0
- package/lib/{text → note}/index.d.ts +1 -1
- package/lib/note/note.d.ts +10 -0
- package/lib/note/note.template.d.ts +5 -0
- package/lib/number-field/index.d.ts +4 -0
- package/lib/number-field/number-field.d.ts +16 -0
- package/lib/number-field/number-field.template.d.ts +4 -0
- package/lib/popup/index.d.ts +1 -1
- package/lib/popup/popup.d.ts +2 -1
- package/lib/progress/progress.d.ts +1 -1
- package/lib/progress-ring/progress-ring.d.ts +2 -1
- package/lib/radio/index.d.ts +3 -0
- package/lib/radio/radio.d.ts +4 -0
- package/lib/radio/radio.template.d.ts +4 -0
- package/lib/side-drawer/index.d.ts +1 -1
- package/lib/side-drawer/side-drawer.d.ts +3 -2
- package/lib/text-anchor/text-anchor.d.ts +1 -1
- package/lib/text-area/index.d.ts +3 -0
- package/lib/text-area/text-area.d.ts +9 -0
- package/lib/text-area/text-area.template.d.ts +4 -0
- package/lib/text-field/index.d.ts +4 -0
- package/lib/text-field/text-field.d.ts +16 -0
- package/lib/text-field/text-field.template.d.ts +5 -0
- package/lib/tooltip/tooltip.d.ts +2 -2
- package/menu/index.js +381 -0
- package/menu-item/index.js +19 -0
- package/nav/index.js +17 -0
- package/nav-disclosure/index.js +88 -0
- package/nav-item/index.js +45 -0
- package/note/index.js +66 -0
- package/number-field/index.js +529 -0
- package/package.json +51 -7
- package/popup/index.js +23 -2061
- package/progress/index.js +35 -28
- package/progress-ring/index.js +9 -5
- package/radio/index.js +174 -0
- package/shared/anchor.js +10 -2
- package/shared/aria-global.js +2 -86
- package/shared/base-progress.js +5 -0
- package/shared/breadcrumb-item.js +1 -1
- package/shared/button.js +200 -0
- package/shared/calendar-event.js +26 -0
- package/shared/dialog-polyfill.esm.js +858 -0
- package/shared/enums.js +79 -0
- package/shared/es.object.assign.js +7 -6
- package/shared/export.js +995 -0
- package/shared/focus.js +5 -0
- package/shared/focus2.js +11 -0
- package/shared/form-associated.js +466 -0
- package/shared/form-elements.js +299 -0
- package/shared/icon.js +533 -520
- package/shared/index.js +71 -55
- package/shared/index2.js +110 -13
- package/shared/index3.js +35 -0
- package/shared/index4.js +86 -0
- package/shared/index5.js +2100 -0
- package/shared/index6.js +371 -0
- package/shared/iterators.js +61 -0
- package/shared/key-codes.js +90 -0
- package/shared/object-keys.js +13 -0
- package/shared/patterns/focus.d.ts +3 -0
- package/shared/patterns/form-elements.d.ts +22 -0
- package/shared/patterns/index.d.ts +1 -0
- package/shared/ref.js +41 -0
- package/shared/regexp-flags.js +21 -0
- package/shared/start-end.js +50 -0
- package/shared/text-anchor.js +2 -11
- package/shared/text-anchor.template.js +5 -2
- package/shared/to-string.js +51 -0
- package/shared/web.dom-collections.iterator.js +78 -1083
- package/side-drawer/index.js +44 -23
- package/styles/core/all.css +75 -0
- package/styles/core/theme.css +11 -0
- package/styles/core/typography.css +69 -0
- package/styles/fonts/SpeziaCompleteVariableItalicWeb.woff2 +0 -0
- package/styles/fonts/SpeziaCompleteVariableUprightWeb.woff2 +0 -0
- package/styles/fonts/SpeziaMonoCompleteVariableWeb.woff2 +0 -0
- package/styles/fonts/spezia.css +9 -12
- package/styles/tokens/theme-dark.css +211 -0
- package/styles/tokens/theme-light.css +211 -0
- package/text-anchor/index.js +9 -1
- package/text-area/index.js +304 -0
- package/text-field/index.js +152 -0
- package/tooltip/index.js +23 -16
- package/lib/text/text.d.ts +0 -10
- package/shared/style-inject.es.js +0 -28
- package/sidenav-item/index.js +0 -38
- package/styles/themes/dark.css +0 -205
- package/styles/themes/light.css +0 -205
- package/text/index.js +0 -45
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { F as FoundationElement, D as DOM, _ as __decorate, a as attr, n as nullableNumberConverter, o as observable, b as __metadata, v as volatile, c as __classPrivateFieldGet, i as __classPrivateFieldSet } from './index.js';
|
|
2
|
+
import { a as applyMixins } from './apply-mixins.js';
|
|
3
|
+
import { F as FormAssociated } from './form-associated.js';
|
|
4
|
+
import { A as ARIAGlobalStatesAndProperties } from './aria-global.js';
|
|
5
|
+
import { S as StartEnd } from './start-end.js';
|
|
6
|
+
import './web.dom-collections.iterator.js';
|
|
7
|
+
|
|
8
|
+
class _TextField extends FoundationElement {
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A form-associated base class for the {@link @microsoft/fast-foundation#(TextField:class)} component.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
class FormAssociatedTextField extends FormAssociated(_TextField) {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.proxy = document.createElement("input");
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Text field sub-types
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
const TextFieldType = {
|
|
27
|
+
/**
|
|
28
|
+
* An email TextField
|
|
29
|
+
*/
|
|
30
|
+
email: "email",
|
|
31
|
+
/**
|
|
32
|
+
* A password TextField
|
|
33
|
+
*/
|
|
34
|
+
password: "password",
|
|
35
|
+
/**
|
|
36
|
+
* A telephone TextField
|
|
37
|
+
*/
|
|
38
|
+
tel: "tel",
|
|
39
|
+
/**
|
|
40
|
+
* A text TextField
|
|
41
|
+
*/
|
|
42
|
+
text: "text",
|
|
43
|
+
/**
|
|
44
|
+
* A URL TextField
|
|
45
|
+
*/
|
|
46
|
+
url: "url",
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* A Text Field Custom HTML Element.
|
|
51
|
+
* Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/text | <input type="text" /> element }.
|
|
52
|
+
*
|
|
53
|
+
* @slot start - Content which can be provided before the number field input
|
|
54
|
+
* @slot end - Content which can be provided after the number field input
|
|
55
|
+
* @slot - The default slot for the label
|
|
56
|
+
* @csspart label - The label
|
|
57
|
+
* @csspart root - The element wrapping the control, including start and end slots
|
|
58
|
+
* @csspart control - The text field element
|
|
59
|
+
* @fires change - Fires a custom 'change' event when the value has changed
|
|
60
|
+
*
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
63
|
+
class TextField extends FormAssociatedTextField {
|
|
64
|
+
constructor() {
|
|
65
|
+
super(...arguments);
|
|
66
|
+
/**
|
|
67
|
+
* Allows setting a type or mode of text.
|
|
68
|
+
* @public
|
|
69
|
+
* @remarks
|
|
70
|
+
* HTML Attribute: type
|
|
71
|
+
*/
|
|
72
|
+
this.type = TextFieldType.text;
|
|
73
|
+
}
|
|
74
|
+
readOnlyChanged() {
|
|
75
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
76
|
+
this.proxy.readOnly = this.readOnly;
|
|
77
|
+
this.validate();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
autofocusChanged() {
|
|
81
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
82
|
+
this.proxy.autofocus = this.autofocus;
|
|
83
|
+
this.validate();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
placeholderChanged() {
|
|
87
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
88
|
+
this.proxy.placeholder = this.placeholder;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
typeChanged() {
|
|
92
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
93
|
+
this.proxy.type = this.type;
|
|
94
|
+
this.validate();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
listChanged() {
|
|
98
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
99
|
+
this.proxy.setAttribute("list", this.list);
|
|
100
|
+
this.validate();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
maxlengthChanged() {
|
|
104
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
105
|
+
this.proxy.maxLength = this.maxlength;
|
|
106
|
+
this.validate();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
minlengthChanged() {
|
|
110
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
111
|
+
this.proxy.minLength = this.minlength;
|
|
112
|
+
this.validate();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
patternChanged() {
|
|
116
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
117
|
+
this.proxy.pattern = this.pattern;
|
|
118
|
+
this.validate();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
sizeChanged() {
|
|
122
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
123
|
+
this.proxy.size = this.size;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
spellcheckChanged() {
|
|
127
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
128
|
+
this.proxy.spellcheck = this.spellcheck;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* @internal
|
|
133
|
+
*/
|
|
134
|
+
connectedCallback() {
|
|
135
|
+
super.connectedCallback();
|
|
136
|
+
this.proxy.setAttribute("type", this.type);
|
|
137
|
+
this.validate();
|
|
138
|
+
if (this.autofocus) {
|
|
139
|
+
DOM.queueUpdate(() => {
|
|
140
|
+
this.focus();
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Selects all the text in the text field
|
|
146
|
+
*
|
|
147
|
+
* @public
|
|
148
|
+
*/
|
|
149
|
+
select() {
|
|
150
|
+
this.control.select();
|
|
151
|
+
/**
|
|
152
|
+
* The select event does not permeate the shadow DOM boundary.
|
|
153
|
+
* This fn effectively proxies the select event,
|
|
154
|
+
* emitting a `select` event whenever the internal
|
|
155
|
+
* control emits a `select` event
|
|
156
|
+
*/
|
|
157
|
+
this.$emit("select");
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Handles the internal control's `input` event
|
|
161
|
+
* @internal
|
|
162
|
+
*/
|
|
163
|
+
handleTextInput() {
|
|
164
|
+
this.value = this.control.value;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Change event handler for inner control.
|
|
168
|
+
* @remarks
|
|
169
|
+
* "Change" events are not `composable` so they will not
|
|
170
|
+
* permeate the shadow DOM boundary. This fn effectively proxies
|
|
171
|
+
* the change event, emitting a `change` event whenever the internal
|
|
172
|
+
* control emits a `change` event
|
|
173
|
+
* @internal
|
|
174
|
+
*/
|
|
175
|
+
handleChange() {
|
|
176
|
+
this.$emit("change");
|
|
177
|
+
}
|
|
178
|
+
/** {@inheritDoc (FormAssociated:interface).validate} */
|
|
179
|
+
validate() {
|
|
180
|
+
super.validate(this.control);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
__decorate([
|
|
184
|
+
attr({ attribute: "readonly", mode: "boolean" })
|
|
185
|
+
], TextField.prototype, "readOnly", void 0);
|
|
186
|
+
__decorate([
|
|
187
|
+
attr({ mode: "boolean" })
|
|
188
|
+
], TextField.prototype, "autofocus", void 0);
|
|
189
|
+
__decorate([
|
|
190
|
+
attr
|
|
191
|
+
], TextField.prototype, "placeholder", void 0);
|
|
192
|
+
__decorate([
|
|
193
|
+
attr
|
|
194
|
+
], TextField.prototype, "type", void 0);
|
|
195
|
+
__decorate([
|
|
196
|
+
attr
|
|
197
|
+
], TextField.prototype, "list", void 0);
|
|
198
|
+
__decorate([
|
|
199
|
+
attr({ converter: nullableNumberConverter })
|
|
200
|
+
], TextField.prototype, "maxlength", void 0);
|
|
201
|
+
__decorate([
|
|
202
|
+
attr({ converter: nullableNumberConverter })
|
|
203
|
+
], TextField.prototype, "minlength", void 0);
|
|
204
|
+
__decorate([
|
|
205
|
+
attr
|
|
206
|
+
], TextField.prototype, "pattern", void 0);
|
|
207
|
+
__decorate([
|
|
208
|
+
attr({ converter: nullableNumberConverter })
|
|
209
|
+
], TextField.prototype, "size", void 0);
|
|
210
|
+
__decorate([
|
|
211
|
+
attr({ mode: "boolean" })
|
|
212
|
+
], TextField.prototype, "spellcheck", void 0);
|
|
213
|
+
__decorate([
|
|
214
|
+
observable
|
|
215
|
+
], TextField.prototype, "defaultSlottedNodes", void 0);
|
|
216
|
+
/**
|
|
217
|
+
* Includes ARIA states and properties relating to the ARIA textbox role
|
|
218
|
+
*
|
|
219
|
+
* @public
|
|
220
|
+
*/
|
|
221
|
+
class DelegatesARIATextbox {
|
|
222
|
+
}
|
|
223
|
+
applyMixins(DelegatesARIATextbox, ARIAGlobalStatesAndProperties);
|
|
224
|
+
applyMixins(TextField, StartEnd, DelegatesARIATextbox);
|
|
225
|
+
|
|
226
|
+
const ElementInternalsKey = 'ElementInternals';
|
|
227
|
+
|
|
228
|
+
const supportsElementInternals = () => ElementInternalsKey in window && 'setFormValue' in window[ElementInternalsKey].prototype;
|
|
229
|
+
|
|
230
|
+
function formElements(constructor) {
|
|
231
|
+
var _Decorated_blurred;
|
|
232
|
+
|
|
233
|
+
class Decorated extends constructor {
|
|
234
|
+
constructor(...args) {
|
|
235
|
+
super(...args);
|
|
236
|
+
this.charCount = false;
|
|
237
|
+
this.userValid = true;
|
|
238
|
+
|
|
239
|
+
_Decorated_blurred.set(this, false);
|
|
240
|
+
|
|
241
|
+
this.validate = () => {
|
|
242
|
+
if (supportsElementInternals() && this.proxy instanceof HTMLElement) {
|
|
243
|
+
this.setValidity(this.proxy.validity, this.proxy.validationMessage, this.control);
|
|
244
|
+
} else {
|
|
245
|
+
super.validate();
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
this.userValid = !this.userValid;
|
|
249
|
+
|
|
250
|
+
if (this.proxy instanceof HTMLElement) {
|
|
251
|
+
this.userValid = __classPrivateFieldGet(this, _Decorated_blurred, "f") && this.dirtyValue ? !this.validationMessage : true;
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
this.addEventListener('blur', () => {
|
|
256
|
+
__classPrivateFieldSet(this, _Decorated_blurred, true, "f");
|
|
257
|
+
|
|
258
|
+
this.validate();
|
|
259
|
+
});
|
|
260
|
+
this.addEventListener('focus', () => {
|
|
261
|
+
__classPrivateFieldSet(this, _Decorated_blurred, false, "f");
|
|
262
|
+
});
|
|
263
|
+
this.addEventListener('invalid', () => {
|
|
264
|
+
if (__classPrivateFieldGet(this, _Decorated_blurred, "f") && this.dirtyValue) return;
|
|
265
|
+
|
|
266
|
+
__classPrivateFieldSet(this, _Decorated_blurred, true, "f");
|
|
267
|
+
|
|
268
|
+
this.dirtyValue = true;
|
|
269
|
+
this.validate();
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
get errorValidationMessage() {
|
|
274
|
+
return this.userValid ? '' : this.validationMessage;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
_Decorated_blurred = new WeakMap();
|
|
280
|
+
|
|
281
|
+
__decorate([attr, __metadata("design:type", String)], Decorated.prototype, "label", void 0);
|
|
282
|
+
|
|
283
|
+
__decorate([attr({
|
|
284
|
+
attribute: 'helper-text'
|
|
285
|
+
}), __metadata("design:type", String)], Decorated.prototype, "helperText", void 0);
|
|
286
|
+
|
|
287
|
+
__decorate([attr({
|
|
288
|
+
attribute: 'char-count',
|
|
289
|
+
mode: 'boolean'
|
|
290
|
+
}), __metadata("design:type", Object)], Decorated.prototype, "charCount", void 0);
|
|
291
|
+
|
|
292
|
+
__decorate([observable, __metadata("design:type", Object)], Decorated.prototype, "userValid", void 0);
|
|
293
|
+
|
|
294
|
+
__decorate([volatile, __metadata("design:type", Object), __metadata("design:paramtypes", [])], Decorated.prototype, "errorValidationMessage", null);
|
|
295
|
+
|
|
296
|
+
return Decorated;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export { DelegatesARIATextbox as D, TextField as T, formElements as f };
|