@vonage/vivid 3.48.0 → 3.49.0-preview.1
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.cjs +21 -0
- package/accordion-item/index.cjs +18 -0
- package/action-group/index.cjs +7 -0
- package/alert/index.cjs +30 -0
- package/appearance-ui/index.cjs +96 -0
- package/audio-player/index.cjs +34 -0
- package/avatar/index.cjs +11 -0
- package/badge/index.cjs +14 -0
- package/banner/index.cjs +29 -0
- package/breadcrumb/index.cjs +13 -0
- package/breadcrumb-item/index.cjs +22 -0
- package/button/index.cjs +25 -0
- package/calendar/index.cjs +9 -0
- package/calendar-event/index.cjs +9 -0
- package/card/index.cjs +14 -0
- package/checkbox/index.cjs +21 -0
- package/combobox/index.cjs +39 -0
- package/data-grid/index.cjs +18 -0
- package/date-picker/index.cjs +40 -0
- package/date-range-picker/index.cjs +40 -0
- package/dialog/index.cjs +31 -0
- package/divider/index.cjs +8 -0
- package/elevation/index.cjs +7 -0
- package/empty-state/index.cjs +12 -0
- package/fab/index.cjs +22 -0
- package/file-picker/index.cjs +30 -0
- package/focus/index.cjs +7 -0
- package/header/index.cjs +8 -0
- package/icon/index.cjs +10 -0
- package/index.cjs +296 -0
- package/layout/index.cjs +7 -0
- package/listbox/index.cjs +77 -0
- package/locales/en-GB.cjs +106 -0
- package/locales/en-US.cjs +106 -0
- package/locales/ja-JP.cjs +106 -0
- package/locales/zh-CN.cjs +106 -0
- package/menu/index.cjs +32 -0
- package/menu-item/index.cjs +22 -0
- package/nav/index.cjs +6 -0
- package/nav-disclosure/index.cjs +17 -0
- package/nav-item/index.cjs +22 -0
- package/note/index.cjs +16 -0
- package/number-field/index.cjs +33 -0
- package/option/index.cjs +23 -0
- package/package.json +20 -2
- package/pagination/index.cjs +28 -0
- package/popup/index.cjs +27 -0
- package/progress/index.cjs +9 -0
- package/progress-ring/index.cjs +9 -0
- package/radio/index.cjs +14 -0
- package/radio-group/index.cjs +14 -0
- package/select/index.cjs +38 -0
- package/selectable-box/index.cjs +25 -0
- package/shared/Reflector.cjs +67 -0
- package/shared/_has.cjs +62 -0
- package/shared/affix.cjs +64 -0
- package/shared/affix.js +8 -4
- package/shared/anchor.cjs +90 -0
- package/shared/anchored.cjs +78 -0
- package/shared/apply-mixins.cjs +25 -0
- package/shared/aria-global.cjs +74 -0
- package/shared/aria.cjs +11 -0
- package/shared/aria2.cjs +11 -0
- package/shared/base-progress.cjs +72 -0
- package/shared/breadcrumb-item.cjs +27 -0
- package/shared/button.cjs +202 -0
- package/shared/calendar-event.cjs +41 -0
- package/shared/children.cjs +61 -0
- package/shared/class-names.cjs +17 -0
- package/shared/definition.cjs +165 -0
- package/shared/definition10.cjs +102 -0
- package/shared/definition11.cjs +164 -0
- package/shared/definition11.js +38 -36
- package/shared/definition12.cjs +50 -0
- package/shared/definition13.cjs +779 -0
- package/shared/definition14.cjs +157 -0
- package/shared/definition15.cjs +249 -0
- package/shared/definition16.cjs +746 -0
- package/shared/definition17.cjs +1372 -0
- package/shared/definition18.cjs +175 -0
- package/shared/definition19.cjs +416 -0
- package/shared/definition2.cjs +232 -0
- package/shared/definition20.cjs +278 -0
- package/shared/definition21.cjs +83 -0
- package/shared/definition22.cjs +74 -0
- package/shared/definition23.cjs +106 -0
- package/shared/definition24.cjs +2392 -0
- package/shared/definition25.cjs +75 -0
- package/shared/definition26.cjs +39 -0
- package/shared/definition27.cjs +66 -0
- package/shared/definition28.cjs +849 -0
- package/shared/definition29.cjs +72 -0
- package/shared/definition3.cjs +72 -0
- package/shared/definition30.cjs +98 -0
- package/shared/definition31.cjs +37 -0
- package/shared/definition32.cjs +24 -0
- package/shared/definition33.cjs +64 -0
- package/shared/definition34.cjs +533 -0
- package/shared/definition35.cjs +295 -0
- package/shared/definition36.cjs +219 -0
- package/shared/definition37.cjs +109 -0
- package/shared/definition38.cjs +92 -0
- package/shared/definition39.cjs +448 -0
- package/shared/definition4.cjs +198 -0
- package/shared/definition40.cjs +49 -0
- package/shared/definition41.cjs +694 -0
- package/shared/definition42.cjs +152 -0
- package/shared/definition43.cjs +113 -0
- package/shared/definition44.cjs +607 -0
- package/shared/definition45.cjs +152 -0
- package/shared/definition46.cjs +166 -0
- package/shared/definition47.cjs +35 -0
- package/shared/definition48.cjs +98 -0
- package/shared/definition49.cjs +543 -0
- package/shared/definition5.cjs +199 -0
- package/shared/definition50.cjs +52 -0
- package/shared/definition51.cjs +150 -0
- package/shared/definition52.cjs +304 -0
- package/shared/definition53.cjs +309 -0
- package/shared/definition54.cjs +146 -0
- package/shared/definition55.cjs +128 -0
- package/shared/definition56.cjs +99 -0
- package/shared/definition57.cjs +310 -0
- package/shared/definition58.cjs +20 -0
- package/shared/definition59.cjs +51 -0
- package/shared/definition6.cjs +83 -0
- package/shared/definition60.cjs +1810 -0
- package/shared/definition7.cjs +72 -0
- package/shared/definition8.cjs +152 -0
- package/shared/definition9.cjs +69 -0
- package/shared/dialog-polyfill.esm.cjs +862 -0
- package/shared/direction.cjs +22 -0
- package/shared/dom.cjs +23 -0
- package/shared/enums.cjs +87 -0
- package/shared/focus.cjs +8 -0
- package/shared/focus2.cjs +11 -0
- package/shared/form-associated.cjs +470 -0
- package/shared/icon.cjs +237 -0
- package/shared/index.cjs +5061 -0
- package/shared/index2.cjs +231 -0
- package/shared/key-codes.cjs +115 -0
- package/shared/key-codes2.cjs +14 -0
- package/shared/listbox.cjs +1072 -0
- package/shared/localized.cjs +11 -0
- package/shared/numbers.cjs +38 -0
- package/shared/patterns/affix.d.ts +5 -1
- package/shared/presentationDate.cjs +6192 -0
- package/shared/radio.cjs +153 -0
- package/shared/ref.cjs +43 -0
- package/shared/repeat.cjs +767 -0
- package/shared/select.options.cjs +12 -0
- package/shared/slotted.cjs +123 -0
- package/shared/start-end.cjs +52 -0
- package/shared/strings.cjs +11 -0
- package/shared/text-anchor.cjs +33 -0
- package/shared/text-anchor.template.cjs +48 -0
- package/shared/text-field.cjs +5 -0
- package/shared/text-field2.cjs +228 -0
- package/shared/tree-item.cjs +154 -0
- package/shared/when.cjs +31 -0
- package/side-drawer/index.cjs +8 -0
- package/slider/index.cjs +16 -0
- package/split-button/index.cjs +20 -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.cjs +15 -0
- package/tab/index.cjs +17 -0
- package/tab-panel/index.cjs +6 -0
- package/tabs/index.cjs +24 -0
- package/tag/index.cjs +17 -0
- package/tag-group/index.cjs +7 -0
- package/text-anchor/index.cjs +24 -0
- package/text-area/index.cjs +25 -0
- package/text-field/index.cjs +27 -0
- package/toggletip/index.cjs +29 -0
- package/tooltip/index.cjs +29 -0
- package/tree-item/index.cjs +22 -0
- package/tree-view/index.cjs +14 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const definition = require('../shared/definition42.cjs');
|
|
4
|
+
require('../shared/index.cjs');
|
|
5
|
+
require('../shared/definition15.cjs');
|
|
6
|
+
require('../shared/definition26.cjs');
|
|
7
|
+
require('../shared/icon.cjs');
|
|
8
|
+
require('../shared/_has.cjs');
|
|
9
|
+
require('../shared/class-names.cjs');
|
|
10
|
+
require('../shared/when.cjs');
|
|
11
|
+
require('../shared/definition58.cjs');
|
|
12
|
+
require('../shared/focus.cjs');
|
|
13
|
+
require('../shared/affix.cjs');
|
|
14
|
+
require('../shared/slotted.cjs');
|
|
15
|
+
require('../shared/index2.cjs');
|
|
16
|
+
require('../locales/en-US.cjs');
|
|
17
|
+
require('../shared/form-associated.cjs');
|
|
18
|
+
require('../shared/key-codes.cjs');
|
|
19
|
+
require('../shared/apply-mixins.cjs');
|
|
20
|
+
require('../shared/focus2.cjs');
|
|
21
|
+
require('../shared/definition40.cjs');
|
|
22
|
+
require('../shared/radio.cjs');
|
|
23
|
+
require('../shared/enums.cjs');
|
|
24
|
+
|
|
25
|
+
definition.registerSelectableBox();
|
|
@@ -0,0 +1,67 @@
|
|
|
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(this.#target, reflectedProperty.destination, Boolean(value));
|
|
52
|
+
break;
|
|
53
|
+
case "attribute":
|
|
54
|
+
index.DOM.setAttribute(this.#target, reflectedProperty.destination, value);
|
|
55
|
+
break;
|
|
56
|
+
case "property":
|
|
57
|
+
if (reflectedProperty.skipIfEqual && this.#target[reflectedProperty.destination] === value) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
this.#target[reflectedProperty.destination] = value;
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
exports.Reflector = Reflector;
|
package/shared/_has.cjs
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _isPlaceholder(a) {
|
|
4
|
+
return a != null && typeof a === 'object' && a['@@functional/placeholder'] === true;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Optimized internal one-arity curry function.
|
|
9
|
+
*
|
|
10
|
+
* @private
|
|
11
|
+
* @category Function
|
|
12
|
+
* @param {Function} fn The function to curry.
|
|
13
|
+
* @return {Function} The curried function.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
function _curry1(fn) {
|
|
17
|
+
return function f1(a) {
|
|
18
|
+
if (arguments.length === 0 || _isPlaceholder(a)) {
|
|
19
|
+
return f1;
|
|
20
|
+
} else {
|
|
21
|
+
return fn.apply(this, arguments);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Optimized internal two-arity curry function.
|
|
28
|
+
*
|
|
29
|
+
* @private
|
|
30
|
+
* @category Function
|
|
31
|
+
* @param {Function} fn The function to curry.
|
|
32
|
+
* @return {Function} The curried function.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
function _curry2(fn) {
|
|
36
|
+
return function f2(a, b) {
|
|
37
|
+
switch (arguments.length) {
|
|
38
|
+
case 0:
|
|
39
|
+
return f2;
|
|
40
|
+
|
|
41
|
+
case 1:
|
|
42
|
+
return _isPlaceholder(a) ? f2 : _curry1(function (_b) {
|
|
43
|
+
return fn(a, _b);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
default:
|
|
47
|
+
return _isPlaceholder(a) && _isPlaceholder(b) ? f2 : _isPlaceholder(a) ? _curry1(function (_a) {
|
|
48
|
+
return fn(_a, b);
|
|
49
|
+
}) : _isPlaceholder(b) ? _curry1(function (_b) {
|
|
50
|
+
return fn(a, _b);
|
|
51
|
+
}) : fn(a, b);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function _has(prop, obj) {
|
|
57
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
exports._curry1 = _curry1;
|
|
61
|
+
exports._curry2 = _curry2;
|
|
62
|
+
exports._has = _has;
|
package/shared/affix.cjs
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const icon = require('./icon.cjs');
|
|
4
|
+
const index = require('./index.cjs');
|
|
5
|
+
const slotted = require('./slotted.cjs');
|
|
6
|
+
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
10
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
11
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
12
|
+
if (decorator = decorators[i])
|
|
13
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
14
|
+
if (kind && result)
|
|
15
|
+
__defProp(target, key, result);
|
|
16
|
+
return result;
|
|
17
|
+
};
|
|
18
|
+
class AffixIcon {
|
|
19
|
+
}
|
|
20
|
+
__decorateClass([
|
|
21
|
+
index.attr
|
|
22
|
+
], AffixIcon.prototype, "icon", 2);
|
|
23
|
+
__decorateClass([
|
|
24
|
+
index.attr({ mode: "fromView" })
|
|
25
|
+
], AffixIcon.prototype, "iconSlottedContent", 2);
|
|
26
|
+
class AffixIconWithTrailing extends AffixIcon {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(...arguments);
|
|
29
|
+
this.iconTrailing = false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
__decorateClass([
|
|
33
|
+
index.attr({
|
|
34
|
+
mode: "boolean",
|
|
35
|
+
attribute: "icon-trailing"
|
|
36
|
+
})
|
|
37
|
+
], AffixIconWithTrailing.prototype, "iconTrailing", 2);
|
|
38
|
+
const IconWrapper = {
|
|
39
|
+
Slot: false,
|
|
40
|
+
Span: true
|
|
41
|
+
};
|
|
42
|
+
const IconAriaHidden = {
|
|
43
|
+
Hidden: "true",
|
|
44
|
+
Visible: "false"
|
|
45
|
+
};
|
|
46
|
+
const affixIconTemplateFactory = (context) => {
|
|
47
|
+
const iconTag = context.tagFor(icon.Icon);
|
|
48
|
+
return (icon, slottedState = IconWrapper.Span, ariaHidden = IconAriaHidden.Visible) => {
|
|
49
|
+
if (!icon && !slottedState) {
|
|
50
|
+
return index.html`<slot name="icon" aria-hidden="${() => ariaHidden}" ${slotted.slotted("iconSlottedContent")}></slot>`;
|
|
51
|
+
}
|
|
52
|
+
if (!icon && slottedState) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
const iconTemplate = index.html`<${iconTag} :name="${() => icon}"></${iconTag}>`;
|
|
56
|
+
return slottedState ? index.html`<span class="icon" aria-hidden="${() => ariaHidden}">${iconTemplate}</span>` : index.html`<slot name="icon" aria-hidden="${() => ariaHidden}">${iconTemplate}</slot>`;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
exports.AffixIcon = AffixIcon;
|
|
61
|
+
exports.AffixIconWithTrailing = AffixIconWithTrailing;
|
|
62
|
+
exports.IconAriaHidden = IconAriaHidden;
|
|
63
|
+
exports.IconWrapper = IconWrapper;
|
|
64
|
+
exports.affixIconTemplateFactory = affixIconTemplateFactory;
|
package/shared/affix.js
CHANGED
|
@@ -37,18 +37,22 @@ const IconWrapper = {
|
|
|
37
37
|
Slot: false,
|
|
38
38
|
Span: true
|
|
39
39
|
};
|
|
40
|
+
const IconAriaHidden = {
|
|
41
|
+
Hidden: "true",
|
|
42
|
+
Visible: "false"
|
|
43
|
+
};
|
|
40
44
|
const affixIconTemplateFactory = (context) => {
|
|
41
45
|
const iconTag = context.tagFor(Icon);
|
|
42
|
-
return (icon, slottedState = IconWrapper.Span) => {
|
|
46
|
+
return (icon, slottedState = IconWrapper.Span, ariaHidden = IconAriaHidden.Visible) => {
|
|
43
47
|
if (!icon && !slottedState) {
|
|
44
|
-
return html`<slot name="icon" ${slotted("iconSlottedContent")}></slot>`;
|
|
48
|
+
return html`<slot name="icon" aria-hidden="${() => ariaHidden}" ${slotted("iconSlottedContent")}></slot>`;
|
|
45
49
|
}
|
|
46
50
|
if (!icon && slottedState) {
|
|
47
51
|
return null;
|
|
48
52
|
}
|
|
49
53
|
const iconTemplate = html`<${iconTag} :name="${() => icon}"></${iconTag}>`;
|
|
50
|
-
return slottedState ? html`<span class="icon">${iconTemplate}</span>` : html`<slot name="icon">${iconTemplate}</slot>`;
|
|
54
|
+
return slottedState ? html`<span class="icon" aria-hidden="${() => ariaHidden}">${iconTemplate}</span>` : html`<slot name="icon" aria-hidden="${() => ariaHidden}">${iconTemplate}</slot>`;
|
|
51
55
|
};
|
|
52
56
|
};
|
|
53
57
|
|
|
54
|
-
export { AffixIcon as A, IconWrapper as I, affixIconTemplateFactory as a, AffixIconWithTrailing as b };
|
|
58
|
+
export { AffixIcon as A, IconWrapper as I, affixIconTemplateFactory as a, AffixIconWithTrailing as b, IconAriaHidden as c };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index.cjs');
|
|
4
|
+
const applyMixins = require('./apply-mixins.cjs');
|
|
5
|
+
const ariaGlobal = require('./aria-global.cjs');
|
|
6
|
+
const startEnd = require('./start-end.cjs');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* An Anchor Custom HTML Element.
|
|
10
|
+
* Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element }.
|
|
11
|
+
*
|
|
12
|
+
* @slot start - Content which can be provided before the anchor content
|
|
13
|
+
* @slot end - Content which can be provided after the anchor content
|
|
14
|
+
* @slot - The default slot for anchor content
|
|
15
|
+
* @csspart control - The anchor element
|
|
16
|
+
* @csspart content - The element wrapping anchor content
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
class Anchor extends index.FoundationElement {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
/**
|
|
24
|
+
* Overrides the focus call for where delegatesFocus is unsupported.
|
|
25
|
+
* This check works for Chrome, Edge Chromium, FireFox, and Safari
|
|
26
|
+
* Relevant PR on the Firefox browser: https://phabricator.services.mozilla.com/D123858
|
|
27
|
+
*/
|
|
28
|
+
this.handleUnsupportedDelegatesFocus = () => {
|
|
29
|
+
var _a;
|
|
30
|
+
// Check to see if delegatesFocus is supported
|
|
31
|
+
if (window.ShadowRoot &&
|
|
32
|
+
!window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") &&
|
|
33
|
+
((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) {
|
|
34
|
+
this.focus = () => {
|
|
35
|
+
var _a;
|
|
36
|
+
(_a = this.control) === null || _a === void 0 ? void 0 : _a.focus();
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
connectedCallback() {
|
|
45
|
+
super.connectedCallback();
|
|
46
|
+
this.handleUnsupportedDelegatesFocus();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
index.__decorate([
|
|
50
|
+
index.attr
|
|
51
|
+
], Anchor.prototype, "download", void 0);
|
|
52
|
+
index.__decorate([
|
|
53
|
+
index.attr
|
|
54
|
+
], Anchor.prototype, "href", void 0);
|
|
55
|
+
index.__decorate([
|
|
56
|
+
index.attr
|
|
57
|
+
], Anchor.prototype, "hreflang", void 0);
|
|
58
|
+
index.__decorate([
|
|
59
|
+
index.attr
|
|
60
|
+
], Anchor.prototype, "ping", void 0);
|
|
61
|
+
index.__decorate([
|
|
62
|
+
index.attr
|
|
63
|
+
], Anchor.prototype, "referrerpolicy", void 0);
|
|
64
|
+
index.__decorate([
|
|
65
|
+
index.attr
|
|
66
|
+
], Anchor.prototype, "rel", void 0);
|
|
67
|
+
index.__decorate([
|
|
68
|
+
index.attr
|
|
69
|
+
], Anchor.prototype, "target", void 0);
|
|
70
|
+
index.__decorate([
|
|
71
|
+
index.attr
|
|
72
|
+
], Anchor.prototype, "type", void 0);
|
|
73
|
+
index.__decorate([
|
|
74
|
+
index.observable
|
|
75
|
+
], Anchor.prototype, "defaultSlottedContent", void 0);
|
|
76
|
+
/**
|
|
77
|
+
* Includes ARIA states and properties relating to the ARIA link role
|
|
78
|
+
*
|
|
79
|
+
* @public
|
|
80
|
+
*/
|
|
81
|
+
class DelegatesARIALink {
|
|
82
|
+
}
|
|
83
|
+
index.__decorate([
|
|
84
|
+
index.attr({ attribute: "aria-expanded" })
|
|
85
|
+
], DelegatesARIALink.prototype, "ariaExpanded", void 0);
|
|
86
|
+
applyMixins.applyMixins(DelegatesARIALink, ariaGlobal.ARIAGlobalStatesAndProperties);
|
|
87
|
+
applyMixins.applyMixins(Anchor, startEnd.StartEnd, DelegatesARIALink);
|
|
88
|
+
|
|
89
|
+
exports.Anchor = Anchor;
|
|
90
|
+
exports.DelegatesARIALink = DelegatesARIALink;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index.cjs');
|
|
4
|
+
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
8
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
9
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
10
|
+
if (decorator = decorators[i])
|
|
11
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
12
|
+
if (kind && result)
|
|
13
|
+
__defProp(target, key, result);
|
|
14
|
+
return result;
|
|
15
|
+
};
|
|
16
|
+
function anchored(constructor) {
|
|
17
|
+
class Decorated extends constructor {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
this.#updateAnchorEl = () => {
|
|
21
|
+
if (!this.isConnected) {
|
|
22
|
+
this._anchorEl = void 0;
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
this.#cleanupObserverIfNeeded();
|
|
26
|
+
let newAnchor = void 0;
|
|
27
|
+
if (this.anchor instanceof HTMLElement) {
|
|
28
|
+
newAnchor = this.anchor;
|
|
29
|
+
} else if (typeof this.anchor === "string") {
|
|
30
|
+
newAnchor = document.getElementById(this.anchor) ?? void 0;
|
|
31
|
+
if (!newAnchor) {
|
|
32
|
+
this.#observeMissingAnchor(this.anchor);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
this._anchorEl = newAnchor;
|
|
36
|
+
};
|
|
37
|
+
this.#observeMissingAnchor = (anchorId) => {
|
|
38
|
+
this.#observer = new MutationObserver(() => {
|
|
39
|
+
const anchor = document.getElementById(anchorId);
|
|
40
|
+
if (anchor) {
|
|
41
|
+
this._anchorEl = anchor;
|
|
42
|
+
this.#cleanupObserverIfNeeded();
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
this.#observer.observe(document.body, { childList: true, subtree: true });
|
|
46
|
+
};
|
|
47
|
+
this.#cleanupObserverIfNeeded = () => {
|
|
48
|
+
this.#observer?.disconnect();
|
|
49
|
+
this.#observer = void 0;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
anchorChanged() {
|
|
53
|
+
this.#updateAnchorEl();
|
|
54
|
+
}
|
|
55
|
+
#updateAnchorEl;
|
|
56
|
+
#observer;
|
|
57
|
+
#observeMissingAnchor;
|
|
58
|
+
#cleanupObserverIfNeeded;
|
|
59
|
+
connectedCallback() {
|
|
60
|
+
super.connectedCallback();
|
|
61
|
+
this.#updateAnchorEl();
|
|
62
|
+
}
|
|
63
|
+
disconnectedCallback() {
|
|
64
|
+
super.disconnectedCallback();
|
|
65
|
+
this.#cleanupObserverIfNeeded();
|
|
66
|
+
this._anchorEl = void 0;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
__decorateClass([
|
|
70
|
+
index.attr
|
|
71
|
+
], Decorated.prototype, "anchor", 2);
|
|
72
|
+
__decorateClass([
|
|
73
|
+
index.observable
|
|
74
|
+
], Decorated.prototype, "_anchorEl", 2);
|
|
75
|
+
return Decorated;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
exports.anchored = anchored;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index.cjs');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Apply mixins to a constructor.
|
|
7
|
+
* Sourced from {@link https://www.typescriptlang.org/docs/handbook/mixins.html | TypeScript Documentation }.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
function applyMixins(derivedCtor, ...baseCtors) {
|
|
11
|
+
const derivedAttributes = index.AttributeConfiguration.locate(derivedCtor);
|
|
12
|
+
baseCtors.forEach(baseCtor => {
|
|
13
|
+
Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {
|
|
14
|
+
if (name !== "constructor") {
|
|
15
|
+
Object.defineProperty(derivedCtor.prototype, name,
|
|
16
|
+
/* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */
|
|
17
|
+
Object.getOwnPropertyDescriptor(baseCtor.prototype, name));
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const baseAttributes = index.AttributeConfiguration.locate(baseCtor);
|
|
21
|
+
baseAttributes.forEach(x => derivedAttributes.push(x));
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
exports.applyMixins = applyMixins;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index.cjs');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Some states and properties are applicable to all host language elements regardless of whether a role is applied.
|
|
7
|
+
* The following global states and properties are supported by all roles and by all base markup elements.
|
|
8
|
+
* {@link https://www.w3.org/TR/wai-aria-1.1/#global_states}
|
|
9
|
+
*
|
|
10
|
+
* This is intended to be used as a mixin. Be sure you extend FASTElement.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
class ARIAGlobalStatesAndProperties {
|
|
15
|
+
}
|
|
16
|
+
index.__decorate([
|
|
17
|
+
index.attr({ attribute: "aria-atomic" })
|
|
18
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaAtomic", void 0);
|
|
19
|
+
index.__decorate([
|
|
20
|
+
index.attr({ attribute: "aria-busy" })
|
|
21
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaBusy", void 0);
|
|
22
|
+
index.__decorate([
|
|
23
|
+
index.attr({ attribute: "aria-controls" })
|
|
24
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaControls", void 0);
|
|
25
|
+
index.__decorate([
|
|
26
|
+
index.attr({ attribute: "aria-current" })
|
|
27
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaCurrent", void 0);
|
|
28
|
+
index.__decorate([
|
|
29
|
+
index.attr({ attribute: "aria-describedby" })
|
|
30
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaDescribedby", void 0);
|
|
31
|
+
index.__decorate([
|
|
32
|
+
index.attr({ attribute: "aria-details" })
|
|
33
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaDetails", void 0);
|
|
34
|
+
index.__decorate([
|
|
35
|
+
index.attr({ attribute: "aria-disabled" })
|
|
36
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaDisabled", void 0);
|
|
37
|
+
index.__decorate([
|
|
38
|
+
index.attr({ attribute: "aria-errormessage" })
|
|
39
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaErrormessage", void 0);
|
|
40
|
+
index.__decorate([
|
|
41
|
+
index.attr({ attribute: "aria-flowto" })
|
|
42
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaFlowto", void 0);
|
|
43
|
+
index.__decorate([
|
|
44
|
+
index.attr({ attribute: "aria-haspopup" })
|
|
45
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaHaspopup", void 0);
|
|
46
|
+
index.__decorate([
|
|
47
|
+
index.attr({ attribute: "aria-hidden" })
|
|
48
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaHidden", void 0);
|
|
49
|
+
index.__decorate([
|
|
50
|
+
index.attr({ attribute: "aria-invalid" })
|
|
51
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaInvalid", void 0);
|
|
52
|
+
index.__decorate([
|
|
53
|
+
index.attr({ attribute: "aria-keyshortcuts" })
|
|
54
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaKeyshortcuts", void 0);
|
|
55
|
+
index.__decorate([
|
|
56
|
+
index.attr({ attribute: "aria-label" })
|
|
57
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaLabel", void 0);
|
|
58
|
+
index.__decorate([
|
|
59
|
+
index.attr({ attribute: "aria-labelledby" })
|
|
60
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaLabelledby", void 0);
|
|
61
|
+
index.__decorate([
|
|
62
|
+
index.attr({ attribute: "aria-live" })
|
|
63
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaLive", void 0);
|
|
64
|
+
index.__decorate([
|
|
65
|
+
index.attr({ attribute: "aria-owns" })
|
|
66
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaOwns", void 0);
|
|
67
|
+
index.__decorate([
|
|
68
|
+
index.attr({ attribute: "aria-relevant" })
|
|
69
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaRelevant", void 0);
|
|
70
|
+
index.__decorate([
|
|
71
|
+
index.attr({ attribute: "aria-roledescription" })
|
|
72
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaRoledescription", void 0);
|
|
73
|
+
|
|
74
|
+
exports.ARIAGlobalStatesAndProperties = ARIAGlobalStatesAndProperties;
|
package/shared/aria.cjs
ADDED
package/shared/aria2.cjs
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index.cjs');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* An Progress HTML Element.
|
|
7
|
+
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#progressbar | ARIA progressbar }.
|
|
8
|
+
*
|
|
9
|
+
* @slot indeterminate - The slot for a custom indeterminate indicator
|
|
10
|
+
* @csspart progress - Represents the progress element
|
|
11
|
+
* @csspart determinate - The determinate indicator
|
|
12
|
+
* @csspart indeterminate - The indeterminate indicator
|
|
13
|
+
*
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
class BaseProgress extends index.FoundationElement {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
/**
|
|
20
|
+
* Indicates progress in %
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
this.percentComplete = 0;
|
|
24
|
+
}
|
|
25
|
+
valueChanged() {
|
|
26
|
+
if (this.$fastController.isConnected) {
|
|
27
|
+
this.updatePercentComplete();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
minChanged() {
|
|
31
|
+
if (this.$fastController.isConnected) {
|
|
32
|
+
this.updatePercentComplete();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
maxChanged() {
|
|
36
|
+
if (this.$fastController.isConnected) {
|
|
37
|
+
this.updatePercentComplete();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
connectedCallback() {
|
|
44
|
+
super.connectedCallback();
|
|
45
|
+
this.updatePercentComplete();
|
|
46
|
+
}
|
|
47
|
+
updatePercentComplete() {
|
|
48
|
+
const min = typeof this.min === "number" ? this.min : 0;
|
|
49
|
+
const max = typeof this.max === "number" ? this.max : 100;
|
|
50
|
+
const value = typeof this.value === "number" ? this.value : 0;
|
|
51
|
+
const range = max - min;
|
|
52
|
+
this.percentComplete =
|
|
53
|
+
range === 0 ? 0 : Math.fround(((value - min) / range) * 100);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
index.__decorate([
|
|
57
|
+
index.attr({ converter: index.nullableNumberConverter })
|
|
58
|
+
], BaseProgress.prototype, "value", void 0);
|
|
59
|
+
index.__decorate([
|
|
60
|
+
index.attr({ converter: index.nullableNumberConverter })
|
|
61
|
+
], BaseProgress.prototype, "min", void 0);
|
|
62
|
+
index.__decorate([
|
|
63
|
+
index.attr({ converter: index.nullableNumberConverter })
|
|
64
|
+
], BaseProgress.prototype, "max", void 0);
|
|
65
|
+
index.__decorate([
|
|
66
|
+
index.attr({ mode: "boolean" })
|
|
67
|
+
], BaseProgress.prototype, "paused", void 0);
|
|
68
|
+
index.__decorate([
|
|
69
|
+
index.observable
|
|
70
|
+
], BaseProgress.prototype, "percentComplete", void 0);
|
|
71
|
+
|
|
72
|
+
exports.BaseProgress = BaseProgress;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index.cjs');
|
|
4
|
+
const anchor = require('./anchor.cjs');
|
|
5
|
+
const applyMixins = require('./apply-mixins.cjs');
|
|
6
|
+
const startEnd = require('./start-end.cjs');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A Breadcrumb Item Custom HTML Element.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
let BreadcrumbItem$1 = class BreadcrumbItem extends anchor.Anchor {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
/**
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
this.separator = true;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
index.__decorate([
|
|
23
|
+
index.observable
|
|
24
|
+
], BreadcrumbItem$1.prototype, "separator", void 0);
|
|
25
|
+
applyMixins.applyMixins(BreadcrumbItem$1, startEnd.StartEnd, anchor.DelegatesARIALink);
|
|
26
|
+
|
|
27
|
+
exports.BreadcrumbItem = BreadcrumbItem$1;
|