@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/definition8.js
CHANGED
|
@@ -1,30 +1,65 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as attr, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { a as iconRegistries } from './definition24.js';
|
|
3
|
+
import { f as focusRegistries } from './definition55.js';
|
|
4
|
+
import { B as BreadcrumbItem$1 } from './breadcrumb-item.js';
|
|
5
|
+
import { t as textAnchorTemplate } from './text-anchor.template.js';
|
|
6
|
+
import { I as Icon } from './icon.js';
|
|
7
|
+
import { w as when } from './when.js';
|
|
2
8
|
import { c as classNames } from './class-names.js';
|
|
3
9
|
|
|
4
|
-
|
|
5
|
-
__decorate([attr, __metadata("design:type", Number)], Elevation.prototype, "dp", void 0);
|
|
6
|
-
__decorate([attr({
|
|
7
|
-
attribute: 'no-shadow',
|
|
8
|
-
mode: 'boolean'
|
|
9
|
-
}), __metadata("design:type", Boolean)], Elevation.prototype, "noShadow", void 0);
|
|
10
|
+
const styles = "/**\n * Do not edit directly\n * Generated on Wed, 06 Sep 2023 09:40:36 GMT\n */\n.base {\n display: flex;\n align-items: center;\n color: var(--vvd-color-canvas-text);\n font: var(--vvd-typography-base);\n}\n.base .separator {\n margin: 0 16px;\n color: var(--vvd-color-neutral-600);\n font-size: 12px;\n}\n\n.control {\n position: relative;\n font: inherit;\n}\n@supports selector(:focus-visible) {\n .control:focus-visible {\n outline: none;\n }\n}\n.control:any-link {\n color: var(--vvd-color-cta-600);\n text-decoration: none;\n}\n.control:any-link:hover {\n text-decoration: underline;\n}\n\n.focus-indicator {\n --focus-inset: -4px -8px;\n --focus-stroke-gap-color: transparent;\n border-radius: 6px;\n}\n.control:not(:focus-visible) > .focus-indicator {\n display: none;\n}";
|
|
10
11
|
|
|
11
|
-
var
|
|
12
|
+
var __defProp = Object.defineProperty;
|
|
13
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
14
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
15
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
16
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
17
|
+
if (decorator = decorators[i])
|
|
18
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
19
|
+
if (kind && result)
|
|
20
|
+
__defProp(target, key, result);
|
|
21
|
+
return result;
|
|
22
|
+
};
|
|
23
|
+
class BreadcrumbItem extends BreadcrumbItem$1 {
|
|
24
|
+
constructor() {
|
|
25
|
+
super();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
__decorateClass([
|
|
29
|
+
attr
|
|
30
|
+
], BreadcrumbItem.prototype, "text", 2);
|
|
12
31
|
|
|
13
|
-
const getClasses = (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
32
|
+
const getClasses = (_) => classNames("base");
|
|
33
|
+
const BreadcrumbItemTemplate = (context, definition) => {
|
|
34
|
+
const iconTag = context.tagFor(Icon);
|
|
35
|
+
return html`
|
|
36
|
+
<div role="listitem" class="${getClasses}">
|
|
37
|
+
${when(
|
|
38
|
+
(x) => x.text && !x.href,
|
|
39
|
+
html`${(x) => x.text}`
|
|
40
|
+
)}
|
|
21
41
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
42
|
+
${when(
|
|
43
|
+
(x) => x.text && x.href && x.href.length > 0,
|
|
44
|
+
html`${textAnchorTemplate(context)}`
|
|
45
|
+
)}
|
|
46
|
+
|
|
47
|
+
${when(
|
|
48
|
+
(x) => x.separator,
|
|
49
|
+
html`<${iconTag} class="separator" name="chevron-right-solid"></${iconTag}>`
|
|
50
|
+
)}
|
|
51
|
+
</div>`;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const breadcrumbItemDefinition = BreadcrumbItem.compose({
|
|
55
|
+
baseName: "breadcrumb-item",
|
|
56
|
+
template: BreadcrumbItemTemplate,
|
|
57
|
+
styles,
|
|
58
|
+
shadowOptions: {
|
|
59
|
+
delegatesFocus: true
|
|
60
|
+
}
|
|
26
61
|
});
|
|
27
|
-
const
|
|
28
|
-
const
|
|
62
|
+
const breadcrumbItemRegistries = [breadcrumbItemDefinition(), ...iconRegistries, ...focusRegistries];
|
|
63
|
+
const registerBreadcrumbItem = registerFactory(breadcrumbItemRegistries);
|
|
29
64
|
|
|
30
|
-
export {
|
|
65
|
+
export { breadcrumbItemRegistries as a, breadcrumbItemDefinition as b, registerBreadcrumbItem as r };
|
package/shared/definition9.js
CHANGED
|
@@ -1,73 +1,99 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { F as FoundationElement, _ as __decorate, o as observable, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { e as elements } from './node-observation.js';
|
|
3
|
+
import { s as slotted } from './slotted.js';
|
|
4
|
+
import { B as BreadcrumbItem$1 } from './breadcrumb-item.js';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* A Breadcrumb Custom HTML Element.
|
|
8
|
+
* @slot - The default slot for the breadcrumb items
|
|
9
|
+
* @csspart list - The element wrapping the slotted items
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
let Breadcrumb$1 = class Breadcrumb extends FoundationElement {
|
|
14
|
+
slottedBreadcrumbItemsChanged() {
|
|
15
|
+
if (this.$fastController.isConnected) {
|
|
16
|
+
if (this.slottedBreadcrumbItems === undefined ||
|
|
17
|
+
this.slottedBreadcrumbItems.length === 0) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const lastNode = this.slottedBreadcrumbItems[this.slottedBreadcrumbItems.length - 1];
|
|
21
|
+
this.slottedBreadcrumbItems.forEach((item) => {
|
|
22
|
+
const itemIsLastNode = item === lastNode;
|
|
23
|
+
this.setItemSeparator(item, itemIsLastNode);
|
|
24
|
+
this.setAriaCurrent(item, itemIsLastNode);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
setItemSeparator(item, isLastNode) {
|
|
29
|
+
if (item instanceof BreadcrumbItem$1) {
|
|
30
|
+
item.separator = !isLastNode;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Finds href on childnodes in the light DOM or shadow DOM.
|
|
35
|
+
* We look in the shadow DOM because we insert an anchor when breadcrumb-item has an href.
|
|
36
|
+
*/
|
|
37
|
+
findChildWithHref(node) {
|
|
38
|
+
var _a, _b;
|
|
39
|
+
if (node.childElementCount > 0) {
|
|
40
|
+
return node.querySelector("a[href]");
|
|
41
|
+
}
|
|
42
|
+
else if ((_a = node.shadowRoot) === null || _a === void 0 ? void 0 : _a.childElementCount) {
|
|
43
|
+
return (_b = node.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector("a[href]");
|
|
44
|
+
}
|
|
45
|
+
else
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Sets ARIA Current for the current node
|
|
50
|
+
* If child node with an anchor tag and with href is found then set aria-current to correct value for the child node,
|
|
51
|
+
* otherwise apply aria-current to the host element, with an href
|
|
52
|
+
*/
|
|
53
|
+
setAriaCurrent(item, isLastNode) {
|
|
54
|
+
const childNodeWithHref = this.findChildWithHref(item);
|
|
55
|
+
if (childNodeWithHref === null &&
|
|
56
|
+
item.hasAttribute("href") &&
|
|
57
|
+
item instanceof BreadcrumbItem$1) {
|
|
58
|
+
isLastNode
|
|
59
|
+
? item.setAttribute("aria-current", "page")
|
|
60
|
+
: item.removeAttribute("aria-current");
|
|
61
|
+
}
|
|
62
|
+
else if (childNodeWithHref !== null) {
|
|
63
|
+
isLastNode
|
|
64
|
+
? childNodeWithHref.setAttribute("aria-current", "page")
|
|
65
|
+
: childNodeWithHref.removeAttribute("aria-current");
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
__decorate([
|
|
70
|
+
observable
|
|
71
|
+
], Breadcrumb$1.prototype, "slottedBreadcrumbItems", void 0);
|
|
7
72
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const progressSegments = 44;
|
|
18
|
-
const ProgressRingTemplate = _ => html`
|
|
19
|
-
<div
|
|
20
|
-
role="progressbar"
|
|
21
|
-
aria-valuenow="${x => x.value}"
|
|
22
|
-
aria-valuemin="${x => x.min}"
|
|
23
|
-
aria-valuemax="${x => x.max}"
|
|
24
|
-
class="${x => x.paused ? 'paused' : ''} ${getClasses}"
|
|
25
|
-
>
|
|
26
|
-
${when(x => typeof x.value === 'number', html`
|
|
27
|
-
<svg
|
|
28
|
-
class="progress"
|
|
29
|
-
viewBox="0 0 16 16"
|
|
30
|
-
>
|
|
31
|
-
<circle
|
|
32
|
-
class="background"
|
|
33
|
-
cx="8px"
|
|
34
|
-
cy="8px"
|
|
35
|
-
r="7px"
|
|
36
|
-
></circle>
|
|
37
|
-
<circle
|
|
38
|
-
class="determinate"
|
|
39
|
-
style="stroke-dasharray: ${x => progressSegments * x.percentComplete / 100}px ${progressSegments}px"
|
|
40
|
-
cx="8px"
|
|
41
|
-
cy="8px"
|
|
42
|
-
r="7px"
|
|
43
|
-
></circle>
|
|
44
|
-
</svg>
|
|
45
|
-
`)}
|
|
46
|
-
${when(x => typeof x.value !== 'number', html`
|
|
47
|
-
<svg class="progress" viewBox="0 0 16 16">
|
|
48
|
-
<circle
|
|
49
|
-
class="background"
|
|
50
|
-
cx="8px"
|
|
51
|
-
cy="8px"
|
|
52
|
-
r="7px"
|
|
53
|
-
></circle>
|
|
54
|
-
<circle
|
|
55
|
-
class="indeterminate-indicator-1"
|
|
56
|
-
cx="8px"
|
|
57
|
-
cy="8px"
|
|
58
|
-
r="7px"
|
|
59
|
-
></circle>
|
|
60
|
-
</svg>
|
|
61
|
-
`)}
|
|
73
|
+
const breadcrumbTemplate = () => html`
|
|
74
|
+
<nav aria-label="breadcrumbs" class="base">
|
|
75
|
+
<div role="list" class="list">
|
|
76
|
+
<slot
|
|
77
|
+
${slotted({
|
|
78
|
+
property: "slottedBreadcrumbItems",
|
|
79
|
+
filter: elements()
|
|
80
|
+
})}
|
|
81
|
+
></slot>
|
|
62
82
|
</div>
|
|
83
|
+
</nav>
|
|
63
84
|
`;
|
|
64
85
|
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
86
|
+
const styles = ".list {\n display: flex;\n}";
|
|
87
|
+
|
|
88
|
+
class Breadcrumb extends Breadcrumb$1 {
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const breadcrumbDefinition = Breadcrumb.compose({
|
|
92
|
+
baseName: "breadcrumb",
|
|
93
|
+
template: breadcrumbTemplate,
|
|
94
|
+
styles
|
|
69
95
|
});
|
|
70
|
-
const
|
|
71
|
-
const
|
|
96
|
+
const breadcrumbRegistries = [breadcrumbDefinition()];
|
|
97
|
+
const registerBreadcrumb = registerFactory(breadcrumbRegistries);
|
|
72
98
|
|
|
73
|
-
export {
|
|
99
|
+
export { breadcrumbRegistries as a, breadcrumbDefinition as b, registerBreadcrumb as r };
|
package/shared/focus.js
CHANGED
package/shared/focus2.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { F as Focus } from './focus.js';
|
|
2
2
|
import { h as html } from './index.js';
|
|
3
3
|
|
|
4
|
-
const focusTemplateFactory = context => {
|
|
4
|
+
const focusTemplateFactory = (context) => {
|
|
5
5
|
const focusTag = context.tagFor(Focus);
|
|
6
6
|
return html`<${focusTag} class="focus-indicator"></${focusTag}>`;
|
|
7
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as attr, o as observable,
|
|
2
|
-
import {
|
|
1
|
+
import { a as attr, o as observable, e as emptyArray, D as DOM, c as booleanConverter } from './index.js';
|
|
2
|
+
import { k as keyEnter } from './key-codes.js';
|
|
3
3
|
|
|
4
4
|
const proxySlotName = "form-associated-proxy";
|
|
5
5
|
const ElementInternalsKey = "ElementInternals";
|
package/shared/icon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, o as observable, v as volatile } from './index.js';
|
|
2
1
|
import { _ as _curry1, a as _curry2, b as _has } from './_has.js';
|
|
2
|
+
import { F as FoundationElement, a as attr, o as observable, v as volatile } from './index.js';
|
|
3
3
|
|
|
4
4
|
function _arity(n, fn) {
|
|
5
5
|
/* eslint-disable no-unused-vars */
|
|
@@ -92,7 +92,7 @@ var identity =
|
|
|
92
92
|
/*#__PURE__*/
|
|
93
93
|
_curry1(_identity);
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
const identity$1 = identity;
|
|
96
96
|
|
|
97
97
|
/**
|
|
98
98
|
* Creates a new function that, when invoked, caches the result of calling `fn`
|
|
@@ -140,7 +140,10 @@ _curry2(function memoizeWith(mFn, fn) {
|
|
|
140
140
|
});
|
|
141
141
|
});
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
const memoizeWith$1 = memoizeWith;
|
|
144
|
+
|
|
145
|
+
const ICONS_BASE_URL = "https://icon.resources.vonage.com";
|
|
146
|
+
const ICONS_VERSION = "4.3.0";
|
|
144
147
|
|
|
145
148
|
const PLACEHOLDER_ICON = `<svg width="80%" height="80%" viewBox="0 0 64 64">
|
|
146
149
|
<g>
|
|
@@ -155,59 +158,77 @@ const PLACEHOLDER_ICON = `<svg width="80%" height="80%" viewBox="0 0 64 64">
|
|
|
155
158
|
</g>
|
|
156
159
|
</svg>`;
|
|
157
160
|
|
|
158
|
-
|
|
159
|
-
|
|
161
|
+
var __defProp = Object.defineProperty;
|
|
162
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
163
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
164
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
165
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
166
|
+
if (decorator = decorators[i])
|
|
167
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
168
|
+
if (kind && result)
|
|
169
|
+
__defProp(target, key, result);
|
|
170
|
+
return result;
|
|
171
|
+
};
|
|
160
172
|
const PLACEHOLDER_DELAY = 500;
|
|
161
|
-
const PLACEHOLDER_TIMEOUT =
|
|
162
|
-
const baseUrlTemplate = (resource, version) => [
|
|
163
|
-
const assertIsValidResponse = ({
|
|
164
|
-
ok
|
|
165
|
-
|
|
166
|
-
}) => {
|
|
167
|
-
if (!ok || headers.get('content-type') !== 'image/svg+xml') {
|
|
168
|
-
throw new Error('Something went wrong');
|
|
173
|
+
const PLACEHOLDER_TIMEOUT = 2e3;
|
|
174
|
+
const baseUrlTemplate = (resource, version) => [ICONS_BASE_URL, `v${version}`, resource].join("/");
|
|
175
|
+
const assertIsValidResponse = ({ ok, headers }) => {
|
|
176
|
+
if (!ok || headers.get("content-type") !== "image/svg+xml") {
|
|
177
|
+
throw new Error("Something went wrong");
|
|
169
178
|
}
|
|
170
179
|
};
|
|
171
|
-
const extractSvg = response => {
|
|
180
|
+
const extractSvg = (response) => {
|
|
172
181
|
assertIsValidResponse(response);
|
|
173
182
|
return response.text();
|
|
174
183
|
};
|
|
175
|
-
const loadSvg = iconId => fetch(baseUrlTemplate([iconId,
|
|
176
|
-
const resolveIcon = memoizeWith$1(identity$1, (iconId =
|
|
184
|
+
const loadSvg = (iconId) => fetch(baseUrlTemplate([iconId, "svg"].join("."), ICONS_VERSION)).then(extractSvg);
|
|
185
|
+
const resolveIcon = memoizeWith$1(identity$1, (iconId = "") => iconId.trim() ? loadSvg(iconId) : Promise.resolve(""));
|
|
177
186
|
class Icon extends FoundationElement {
|
|
178
187
|
constructor() {
|
|
179
188
|
super(...arguments);
|
|
180
189
|
this.iconLoaded = false;
|
|
181
190
|
}
|
|
182
191
|
get iconUrl() {
|
|
183
|
-
return !this.name ? this._svg : baseUrlTemplate(`${this.name}.svg`,
|
|
192
|
+
return !this.name ? this._svg : baseUrlTemplate(`${this.name}.svg`, ICONS_VERSION);
|
|
184
193
|
}
|
|
185
194
|
async nameChanged() {
|
|
186
|
-
this._svg =
|
|
195
|
+
this._svg = void 0;
|
|
187
196
|
this.iconLoaded = false;
|
|
188
197
|
let timeout = setTimeout(() => {
|
|
189
198
|
this._svg = PLACEHOLDER_ICON;
|
|
190
199
|
timeout = setTimeout(() => {
|
|
191
200
|
if (this._svg === PLACEHOLDER_ICON) {
|
|
192
|
-
this._svg =
|
|
201
|
+
this._svg = void 0;
|
|
193
202
|
}
|
|
194
203
|
}, PLACEHOLDER_TIMEOUT);
|
|
195
204
|
}, PLACEHOLDER_DELAY);
|
|
196
|
-
await resolveIcon(this.name).then(svg => {
|
|
205
|
+
await resolveIcon(this.name).then((svg) => {
|
|
197
206
|
this._svg = svg;
|
|
198
207
|
}).catch(() => {
|
|
199
|
-
this._svg =
|
|
208
|
+
this._svg = void 0;
|
|
200
209
|
}).finally(() => {
|
|
201
210
|
clearTimeout(timeout);
|
|
202
211
|
this.iconLoaded = true;
|
|
203
212
|
});
|
|
204
213
|
}
|
|
205
214
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
215
|
+
__decorateClass([
|
|
216
|
+
attr
|
|
217
|
+
], Icon.prototype, "connotation", 2);
|
|
218
|
+
__decorateClass([
|
|
219
|
+
attr
|
|
220
|
+
], Icon.prototype, "size", 2);
|
|
221
|
+
__decorateClass([
|
|
222
|
+
observable
|
|
223
|
+
], Icon.prototype, "_svg", 2);
|
|
224
|
+
__decorateClass([
|
|
225
|
+
observable
|
|
226
|
+
], Icon.prototype, "iconLoaded", 2);
|
|
227
|
+
__decorateClass([
|
|
228
|
+
attr
|
|
229
|
+
], Icon.prototype, "name", 2);
|
|
230
|
+
__decorateClass([
|
|
231
|
+
volatile
|
|
232
|
+
], Icon.prototype, "iconUrl", 1);
|
|
212
233
|
|
|
213
234
|
export { Icon as I };
|
package/shared/index.js
CHANGED
|
@@ -2533,7 +2533,7 @@ class CSSDirective {
|
|
|
2533
2533
|
}
|
|
2534
2534
|
}
|
|
2535
2535
|
|
|
2536
|
-
|
|
2536
|
+
/*! *****************************************************************************
|
|
2537
2537
|
Copyright (c) Microsoft Corporation.
|
|
2538
2538
|
|
|
2539
2539
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -2547,35 +2547,15 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
2547
2547
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
2548
2548
|
PERFORMANCE OF THIS SOFTWARE.
|
|
2549
2549
|
***************************************************************************** */
|
|
2550
|
+
/* global Reflect, Promise */
|
|
2551
|
+
|
|
2550
2552
|
|
|
2551
2553
|
function __decorate(decorators, target, key, desc) {
|
|
2552
2554
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2553
2555
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2554
2556
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2555
2557
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2556
|
-
}
|
|
2557
|
-
|
|
2558
|
-
function __metadata(metadataKey, metadataValue) {
|
|
2559
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
2560
|
-
}
|
|
2561
|
-
|
|
2562
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
2563
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
2564
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
2565
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
2566
|
-
}
|
|
2567
|
-
|
|
2568
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
2569
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
2570
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
2571
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
2572
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
2573
|
-
}
|
|
2574
|
-
|
|
2575
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
2576
|
-
var e = new Error(message);
|
|
2577
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
2578
|
-
};
|
|
2558
|
+
}
|
|
2579
2559
|
|
|
2580
2560
|
/**
|
|
2581
2561
|
* Big thanks to https://github.com/fkleuver and the https://github.com/aurelia/aurelia project
|
|
@@ -5055,8 +5035,8 @@ class ElementDefinitionEntry {
|
|
|
5055
5035
|
}
|
|
5056
5036
|
/* eslint-enable @typescript-eslint/no-non-null-assertion */
|
|
5057
5037
|
|
|
5058
|
-
const defaultPrefix =
|
|
5038
|
+
const defaultPrefix = "vwc";
|
|
5059
5039
|
const designSystem = DesignSystem.getOrCreate();
|
|
5060
|
-
const registerFactory = registries => (prefix = defaultPrefix) => designSystem.withPrefix(prefix).register(...registries);
|
|
5040
|
+
const registerFactory = (registries) => (prefix = defaultPrefix) => designSystem.withPrefix(prefix).register(...registries);
|
|
5061
5041
|
|
|
5062
|
-
export { AttachedBehaviorHTMLDirective as A, DOM as D, FoundationElement as F, HTMLDirective as H, Observable as O, SubscriberSet as S, __decorate as _, attr as a,
|
|
5042
|
+
export { AttachedBehaviorHTMLDirective as A, DOM as D, FoundationElement as F, HTMLDirective as H, Observable as O, SubscriberSet as S, __decorate as _, attr as a, AttributeConfiguration as b, booleanConverter as c, designSystem as d, emptyArray as e, HTMLView as f, html as h, nullableNumberConverter as n, observable as o, registerFactory as r, volatile as v };
|