@vonage/vivid 3.47.0 → 3.49.0-preview.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/README.md +3 -403
- 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/alert/index.js +0 -1
- package/appearance-ui/index.cjs +96 -0
- package/audio-player/index.cjs +34 -0
- package/audio-player/index.js +0 -1
- package/avatar/index.cjs +11 -0
- package/badge/index.cjs +14 -0
- package/banner/index.cjs +29 -0
- package/banner/index.js +0 -1
- package/breadcrumb/index.cjs +13 -0
- package/breadcrumb-item/index.cjs +22 -0
- package/button/index.cjs +25 -0
- package/button/index.js +0 -1
- 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/combobox/index.js +1 -1
- package/custom-elements.json +30 -35
- package/data-grid/index.cjs +18 -0
- package/date-picker/index.cjs +40 -0
- package/date-picker/index.js +1 -1
- package/date-range-picker/index.cjs +40 -0
- package/date-range-picker/index.js +1 -1
- package/dialog/index.cjs +31 -0
- package/dialog/index.js +1 -1
- 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/file-picker/index.js +1 -1
- package/focus/index.cjs +7 -0
- package/header/index.cjs +8 -0
- package/icon/index.cjs +10 -0
- package/index.cjs +296 -0
- package/index.js +1 -1
- package/layout/index.cjs +7 -0
- package/lib/menu-item/menu-item.d.ts +1 -0
- package/lib/tabs/tabs.d.ts +1 -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/index.js +0 -1
- package/menu-item/index.cjs +22 -0
- package/menu-item/index.js +0 -1
- package/nav/index.cjs +6 -0
- package/nav-disclosure/index.cjs +17 -0
- package/nav-disclosure/index.js +0 -1
- package/nav-item/index.cjs +22 -0
- package/note/index.cjs +16 -0
- package/number-field/index.cjs +33 -0
- package/number-field/index.js +1 -1
- package/option/index.cjs +23 -0
- package/package.json +20 -2
- package/pagination/index.cjs +28 -0
- package/pagination/index.js +0 -1
- package/popup/index.cjs +27 -0
- package/popup/index.js +0 -1
- 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/select/index.js +1 -1
- 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 +39 -42
- 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/definition28.js +5 -4
- package/shared/definition29.cjs +72 -0
- package/shared/definition29.js +1 -1
- package/shared/definition3.cjs +72 -0
- package/shared/definition30.cjs +98 -0
- package/shared/definition30.js +1 -4
- 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/definition41.js +1 -6
- 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/definition45.js +1 -6
- package/shared/definition46.cjs +166 -0
- package/shared/definition46.js +2 -7
- package/shared/definition47.cjs +35 -0
- package/shared/definition48.cjs +98 -0
- package/shared/definition49.cjs +543 -0
- package/shared/definition49.js +12 -3
- 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/presentationDate.js +1 -6
- 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/split-button/index.js +0 -1
- package/style.css +1 -1
- 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/switch/index.js +0 -5
- 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/toggletip/index.js +0 -1
- package/tooltip/index.cjs +29 -0
- package/tooltip/index.js +0 -1
- package/tree-item/index.cjs +22 -0
- package/tree-view/index.cjs +14 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const definition = require('../shared/definition36.cjs');
|
|
4
|
+
require('../shared/definition11.cjs');
|
|
5
|
+
require('../shared/index.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/definition37.cjs');
|
|
14
|
+
require('../shared/base-progress.cjs');
|
|
15
|
+
require('../shared/affix.cjs');
|
|
16
|
+
require('../shared/slotted.cjs');
|
|
17
|
+
require('../shared/button.cjs');
|
|
18
|
+
require('../shared/apply-mixins.cjs');
|
|
19
|
+
require('../shared/form-associated.cjs');
|
|
20
|
+
require('../shared/key-codes.cjs');
|
|
21
|
+
require('../shared/aria-global.cjs');
|
|
22
|
+
require('../shared/start-end.cjs');
|
|
23
|
+
require('../shared/ref.cjs');
|
|
24
|
+
require('../shared/enums.cjs');
|
|
25
|
+
require('../shared/children.cjs');
|
|
26
|
+
require('../shared/repeat.cjs');
|
|
27
|
+
|
|
28
|
+
definition.registerPagination();
|
package/pagination/index.js
CHANGED
|
@@ -19,7 +19,6 @@ import '../shared/key-codes.js';
|
|
|
19
19
|
import '../shared/aria-global.js';
|
|
20
20
|
import '../shared/start-end.js';
|
|
21
21
|
import '../shared/ref.js';
|
|
22
|
-
import '../shared/focus2.js';
|
|
23
22
|
import '../shared/enums.js';
|
|
24
23
|
import '../shared/children.js';
|
|
25
24
|
import '../shared/repeat.js';
|
package/popup/index.cjs
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const definition = require('../shared/definition60.cjs');
|
|
4
|
+
require('../shared/index.cjs');
|
|
5
|
+
require('../shared/definition11.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/definition37.cjs');
|
|
14
|
+
require('../shared/base-progress.cjs');
|
|
15
|
+
require('../shared/affix.cjs');
|
|
16
|
+
require('../shared/slotted.cjs');
|
|
17
|
+
require('../shared/button.cjs');
|
|
18
|
+
require('../shared/apply-mixins.cjs');
|
|
19
|
+
require('../shared/form-associated.cjs');
|
|
20
|
+
require('../shared/key-codes.cjs');
|
|
21
|
+
require('../shared/aria-global.cjs');
|
|
22
|
+
require('../shared/start-end.cjs');
|
|
23
|
+
require('../shared/ref.cjs');
|
|
24
|
+
require('../shared/enums.cjs');
|
|
25
|
+
require('../shared/definition59.cjs');
|
|
26
|
+
|
|
27
|
+
definition.registerPopup();
|
package/popup/index.js
CHANGED
package/radio/index.cjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const definition = require('../shared/definition40.cjs');
|
|
4
|
+
require('../shared/index.cjs');
|
|
5
|
+
require('../shared/definition58.cjs');
|
|
6
|
+
require('../shared/focus.cjs');
|
|
7
|
+
require('../shared/radio.cjs');
|
|
8
|
+
require('../shared/form-associated.cjs');
|
|
9
|
+
require('../shared/key-codes.cjs');
|
|
10
|
+
require('../shared/focus2.cjs');
|
|
11
|
+
require('../shared/when.cjs');
|
|
12
|
+
require('../shared/class-names.cjs');
|
|
13
|
+
|
|
14
|
+
definition.registerRadio();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const definition = require('../shared/definition39.cjs');
|
|
4
|
+
require('../shared/index.cjs');
|
|
5
|
+
require('../shared/direction.cjs');
|
|
6
|
+
require('../shared/key-codes.cjs');
|
|
7
|
+
require('../shared/aria.cjs');
|
|
8
|
+
require('../shared/radio.cjs');
|
|
9
|
+
require('../shared/form-associated.cjs');
|
|
10
|
+
require('../shared/slotted.cjs');
|
|
11
|
+
require('../shared/when.cjs');
|
|
12
|
+
require('../shared/aria2.cjs');
|
|
13
|
+
|
|
14
|
+
definition.registerRadioGroup();
|
package/select/index.cjs
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const definition = require('../shared/definition41.cjs');
|
|
4
|
+
require('../shared/index.cjs');
|
|
5
|
+
require('../shared/definition58.cjs');
|
|
6
|
+
require('../shared/focus.cjs');
|
|
7
|
+
require('../shared/definition60.cjs');
|
|
8
|
+
require('../shared/definition11.cjs');
|
|
9
|
+
require('../shared/definition26.cjs');
|
|
10
|
+
require('../shared/icon.cjs');
|
|
11
|
+
require('../shared/_has.cjs');
|
|
12
|
+
require('../shared/class-names.cjs');
|
|
13
|
+
require('../shared/when.cjs');
|
|
14
|
+
require('../shared/definition37.cjs');
|
|
15
|
+
require('../shared/base-progress.cjs');
|
|
16
|
+
require('../shared/affix.cjs');
|
|
17
|
+
require('../shared/slotted.cjs');
|
|
18
|
+
require('../shared/button.cjs');
|
|
19
|
+
require('../shared/apply-mixins.cjs');
|
|
20
|
+
require('../shared/form-associated.cjs');
|
|
21
|
+
require('../shared/key-codes.cjs');
|
|
22
|
+
require('../shared/aria-global.cjs');
|
|
23
|
+
require('../shared/start-end.cjs');
|
|
24
|
+
require('../shared/ref.cjs');
|
|
25
|
+
require('../shared/enums.cjs');
|
|
26
|
+
require('../shared/definition59.cjs');
|
|
27
|
+
require('../shared/definition35.cjs');
|
|
28
|
+
require('../shared/dom.cjs');
|
|
29
|
+
require('../shared/focus2.cjs');
|
|
30
|
+
require('../shared/index2.cjs');
|
|
31
|
+
require('../locales/en-US.cjs');
|
|
32
|
+
require('../shared/listbox.cjs');
|
|
33
|
+
require('../shared/key-codes2.cjs');
|
|
34
|
+
require('../shared/strings.cjs');
|
|
35
|
+
require('../shared/numbers.cjs');
|
|
36
|
+
require('../shared/select.options.cjs');
|
|
37
|
+
|
|
38
|
+
definition.registerSelect();
|
package/select/index.js
CHANGED
|
@@ -20,11 +20,11 @@ import '../shared/key-codes.js';
|
|
|
20
20
|
import '../shared/aria-global.js';
|
|
21
21
|
import '../shared/start-end.js';
|
|
22
22
|
import '../shared/ref.js';
|
|
23
|
-
import '../shared/focus2.js';
|
|
24
23
|
import '../shared/enums.js';
|
|
25
24
|
import '../shared/definition59.js';
|
|
26
25
|
import '../shared/definition35.js';
|
|
27
26
|
import '../shared/dom.js';
|
|
27
|
+
import '../shared/focus2.js';
|
|
28
28
|
import '../shared/index2.js';
|
|
29
29
|
import '../locales/en-US.js';
|
|
30
30
|
import '../shared/listbox.js';
|
|
@@ -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;
|