@vonage/vivid 4.22.0 → 4.24.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.
Files changed (232) hide show
  1. package/custom-elements.json +1658 -370
  2. package/lib/accordion-item/accordion-item.d.ts +11 -5
  3. package/lib/action-group/action-group.d.ts +8 -6
  4. package/lib/alert/alert.d.ts +21 -9
  5. package/lib/audio-player/audio-player.d.ts +11 -5
  6. package/lib/badge/badge.d.ts +11 -5
  7. package/lib/banner/banner.d.ts +26 -12
  8. package/lib/breadcrumb/breadcrumb.d.ts +333 -1
  9. package/lib/breadcrumb/breadcrumb.template.d.ts +2 -3
  10. package/lib/breadcrumb-item/breadcrumb-item.d.ts +8 -6
  11. package/lib/button/button.d.ts +11 -5
  12. package/lib/calendar-event/calendar-event.d.ts +333 -1
  13. package/lib/checkbox/checkbox.d.ts +8 -6
  14. package/lib/combobox/combobox.d.ts +11 -5
  15. package/lib/date-picker/date-picker.d.ts +74 -50
  16. package/lib/date-range-picker/date-range-picker.d.ts +38 -26
  17. package/lib/date-time-picker/date-time-picker.d.ts +76 -52
  18. package/lib/dial-pad/dial-pad.d.ts +11 -5
  19. package/lib/dialog/dialog.d.ts +16 -8
  20. package/lib/divider/divider.d.ts +8 -6
  21. package/lib/fab/fab.d.ts +11 -5
  22. package/lib/file-picker/file-picker.d.ts +337 -1
  23. package/lib/file-picker/locale.d.ts +1 -0
  24. package/lib/header/header.d.ts +333 -1
  25. package/lib/menu/menu.d.ts +16 -8
  26. package/lib/menu-item/menu-item.d.ts +338 -2
  27. package/lib/nav/nav.d.ts +333 -1
  28. package/lib/nav-disclosure/nav-disclosure.d.ts +16 -8
  29. package/lib/nav-item/nav-item.d.ts +11 -5
  30. package/lib/note/note.d.ts +11 -5
  31. package/lib/number-field/number-field.d.ts +26 -12
  32. package/lib/option/option.d.ts +339 -3
  33. package/lib/progress/progress.d.ts +8 -6
  34. package/lib/progress-ring/progress-ring.d.ts +8 -6
  35. package/lib/radio-group/radio-group.d.ts +333 -1
  36. package/lib/range-slider/range-slider.d.ts +11 -5
  37. package/lib/rich-text-editor/facades/prose-mirror-vivid.schema.d.ts +1 -1
  38. package/lib/rich-text-editor/facades/vivid-prose-mirror.facade.d.ts +7 -1
  39. package/lib/rich-text-editor/locale.d.ts +9 -0
  40. package/lib/rich-text-editor/menubar/consts.d.ts +18 -0
  41. package/lib/rich-text-editor/menubar/menubar.d.ts +337 -1
  42. package/lib/rich-text-editor/rich-text-editor.d.ts +10 -0
  43. package/lib/searchable-select/locale.d.ts +1 -0
  44. package/lib/searchable-select/option-tag.d.ts +11 -5
  45. package/lib/searchable-select/searchable-select.d.ts +350 -7
  46. package/lib/select/select.d.ts +339 -3
  47. package/lib/selectable-box/selectable-box.d.ts +8 -6
  48. package/lib/slider/slider.d.ts +16 -8
  49. package/lib/split-button/split-button.d.ts +26 -12
  50. package/lib/switch/switch.d.ts +8 -6
  51. package/lib/tab/tab.d.ts +349 -7
  52. package/lib/tab-panel/tab-panel.d.ts +333 -1
  53. package/lib/tabs/tabs.d.ts +5 -21
  54. package/lib/tag/tag.d.ts +338 -2
  55. package/lib/tag-group/tag-group.d.ts +8 -6
  56. package/lib/text-anchor/text-anchor.d.ts +16 -8
  57. package/lib/text-area/text-area.d.ts +8 -6
  58. package/lib/text-field/text-field.d.ts +16 -8
  59. package/lib/time-picker/time-picker.d.ts +38 -26
  60. package/lib/toggletip/toggletip.d.ts +9 -3
  61. package/lib/tooltip/tooltip.d.ts +9 -3
  62. package/lib/tree-item/tree-item.d.ts +338 -2
  63. package/lib/tree-view/tree-view.d.ts +333 -1
  64. package/lib/video-player/video-player.d.ts +11 -5
  65. package/locales/de-DE.cjs +15 -1
  66. package/locales/de-DE.js +15 -1
  67. package/locales/en-GB.cjs +15 -1
  68. package/locales/en-GB.js +15 -1
  69. package/locales/en-US.cjs +15 -1
  70. package/locales/en-US.js +15 -1
  71. package/locales/ja-JP.cjs +15 -1
  72. package/locales/ja-JP.js +15 -1
  73. package/locales/zh-CN.cjs +15 -1
  74. package/locales/zh-CN.js +15 -1
  75. package/package.json +1 -1
  76. package/shared/affix.js +1 -1
  77. package/shared/aria/aria-change-subscription.d.ts +6 -0
  78. package/shared/aria/aria-mixin.d.ts +338 -0
  79. package/shared/aria/delegate-aria-behavior.d.ts +31 -0
  80. package/shared/aria/delegates-aria.d.ts +14 -9
  81. package/shared/aria/host-semantics-behavior.d.ts +22 -0
  82. package/shared/aria/host-semantics.d.ts +337 -0
  83. package/shared/attribute-binding-behaviour.cjs +41 -0
  84. package/shared/attribute-binding-behaviour.js +39 -0
  85. package/shared/button.cjs +6 -3
  86. package/shared/button.js +6 -3
  87. package/shared/calendar-event.cjs +2 -1
  88. package/shared/calendar-event.js +2 -1
  89. package/shared/definition.js +1 -1
  90. package/shared/definition10.cjs +8 -2
  91. package/shared/definition10.js +9 -3
  92. package/shared/definition11.cjs +4 -28
  93. package/shared/definition11.js +5 -29
  94. package/shared/definition12.cjs +5 -2
  95. package/shared/definition12.js +6 -3
  96. package/shared/definition13.js +1 -1
  97. package/shared/definition14.js +1 -1
  98. package/shared/definition15.cjs +8 -7
  99. package/shared/definition15.js +10 -9
  100. package/shared/definition16.js +1 -1
  101. package/shared/definition17.cjs +4 -1
  102. package/shared/definition17.js +5 -2
  103. package/shared/definition18.js +1 -1
  104. package/shared/definition19.js +1 -1
  105. package/shared/definition2.js +1 -1
  106. package/shared/definition20.js +1 -1
  107. package/shared/definition21.js +1 -1
  108. package/shared/definition22.cjs +11 -4
  109. package/shared/definition22.js +13 -6
  110. package/shared/definition23.cjs +4 -2
  111. package/shared/definition23.js +6 -4
  112. package/shared/definition24.js +1 -1
  113. package/shared/definition25.cjs +2 -14
  114. package/shared/definition25.js +3 -15
  115. package/shared/definition26.cjs +19 -3
  116. package/shared/definition26.js +20 -4
  117. package/shared/definition27.cjs +3 -2
  118. package/shared/definition27.js +4 -3
  119. package/shared/definition28.js +1 -1
  120. package/shared/definition29.js +1 -1
  121. package/shared/definition3.cjs +3 -2
  122. package/shared/definition3.js +5 -4
  123. package/shared/definition30.cjs +33 -34
  124. package/shared/definition30.js +35 -36
  125. package/shared/definition31.cjs +6 -4
  126. package/shared/definition31.js +8 -6
  127. package/shared/definition32.js +1 -1
  128. package/shared/definition33.cjs +7 -2
  129. package/shared/definition33.js +8 -3
  130. package/shared/definition34.js +1 -1
  131. package/shared/definition35.cjs +2 -13
  132. package/shared/definition35.js +4 -15
  133. package/shared/definition36.cjs +8 -5
  134. package/shared/definition36.js +9 -6
  135. package/shared/definition37.js +1 -1
  136. package/shared/definition38.cjs +7 -8
  137. package/shared/definition38.js +9 -10
  138. package/shared/definition39.cjs +7 -8
  139. package/shared/definition39.js +9 -10
  140. package/shared/definition4.js +1 -1
  141. package/shared/definition40.cjs +8 -5
  142. package/shared/definition40.js +9 -6
  143. package/shared/definition41.js +1 -1
  144. package/shared/definition42.js +1 -1
  145. package/shared/definition43.cjs +558 -134
  146. package/shared/definition43.js +550 -126
  147. package/shared/definition44.cjs +83 -10
  148. package/shared/definition44.js +84 -11
  149. package/shared/definition45.cjs +20 -8
  150. package/shared/definition45.js +21 -9
  151. package/shared/definition46.cjs +18 -6
  152. package/shared/definition46.js +20 -8
  153. package/shared/definition47.js +1 -1
  154. package/shared/definition48.js +1 -1
  155. package/shared/definition49.cjs +10 -3
  156. package/shared/definition49.js +12 -5
  157. package/shared/definition5.cjs +7 -2
  158. package/shared/definition5.js +8 -3
  159. package/shared/definition50.cjs +8 -7
  160. package/shared/definition50.js +10 -9
  161. package/shared/definition51.cjs +3 -2
  162. package/shared/definition51.js +4 -3
  163. package/shared/definition52.cjs +8 -4
  164. package/shared/definition52.js +9 -5
  165. package/shared/definition53.cjs +219 -297
  166. package/shared/definition53.js +221 -299
  167. package/shared/definition54.cjs +4 -3
  168. package/shared/definition54.js +6 -5
  169. package/shared/definition55.cjs +7 -4
  170. package/shared/definition55.js +8 -5
  171. package/shared/definition56.cjs +68 -14
  172. package/shared/definition56.js +69 -15
  173. package/shared/definition57.cjs +163 -112
  174. package/shared/definition57.js +165 -114
  175. package/shared/definition58.js +1 -1
  176. package/shared/definition59.js +1 -1
  177. package/shared/definition6.js +1 -1
  178. package/shared/definition60.js +1 -1
  179. package/shared/definition61.cjs +8 -5
  180. package/shared/definition61.js +9 -6
  181. package/shared/definition62.cjs +5 -2
  182. package/shared/definition62.js +6 -3
  183. package/shared/definition63.js +1 -1
  184. package/shared/definition64.js +1 -1
  185. package/shared/definition65.js +1 -1
  186. package/shared/definition7.js +1 -1
  187. package/shared/definition8.cjs +4 -2
  188. package/shared/definition8.js +6 -4
  189. package/shared/definition9.js +1 -1
  190. package/shared/delegates-aria.cjs +106 -56
  191. package/shared/delegates-aria.js +107 -58
  192. package/shared/foundation/button/button.d.ts +8 -6
  193. package/shared/foundation/vivid-element/vivid-element.d.ts +339 -1
  194. package/shared/host-semantics.cjs +65 -0
  195. package/shared/host-semantics.js +62 -0
  196. package/shared/localization/Locale.d.ts +2 -0
  197. package/shared/option.cjs +4 -1
  198. package/shared/option.js +4 -1
  199. package/shared/patterns/affix.d.ts +22 -10
  200. package/shared/patterns/anchored.d.ts +18 -6
  201. package/shared/patterns/localized.d.ts +11 -5
  202. package/shared/patterns/trapped-focus.d.ts +11 -5
  203. package/shared/picker-field/mixins/calendar-picker.d.ts +19 -13
  204. package/shared/picker-field/mixins/calendar-picker.template.d.ts +19 -13
  205. package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +11 -5
  206. package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +38 -26
  207. package/shared/picker-field/mixins/single-date-picker.d.ts +55 -37
  208. package/shared/picker-field/mixins/single-value-picker.d.ts +17 -11
  209. package/shared/picker-field/mixins/time-selection-picker.d.ts +38 -26
  210. package/shared/picker-field/mixins/time-selection-picker.template.d.ts +38 -26
  211. package/shared/picker-field/picker-field.d.ts +21 -9
  212. package/shared/picker-field.template.js +1 -1
  213. package/shared/repeat.js +1 -1
  214. package/shared/slider.template.cjs +10 -9
  215. package/shared/slider.template.js +10 -9
  216. package/shared/templating/attribute-binding-behaviour.d.ts +15 -0
  217. package/shared/templating/render-in-light-dom.d.ts +22 -0
  218. package/shared/text-anchor.template.cjs +2 -13
  219. package/shared/text-anchor.template.js +2 -13
  220. package/shared/time-selection-picker.template.js +1 -1
  221. package/shared/vivid-element.cjs +96 -2
  222. package/shared/vivid-element.js +93 -3
  223. package/styles/core/all.css +1 -1
  224. package/styles/core/theme.css +1 -1
  225. package/styles/core/typography.css +1 -1
  226. package/styles/tokens/theme-dark.css +4 -4
  227. package/styles/tokens/theme-light.css +4 -4
  228. package/styles/tokens/vivid-2-compat.css +1 -1
  229. package/text-anchor/index.js +1 -1
  230. package/vivid.api.json +188 -17
  231. package/shared/Reflector.cjs +0 -71
  232. package/shared/Reflector.js +0 -69
@@ -1,69 +1,119 @@
1
1
  'use strict';
2
2
 
3
+ const attributeBindingBehaviour = require('./attribute-binding-behaviour.cjs');
3
4
  const vividElement = require('./vivid-element.cjs');
4
5
 
5
- const ariaMixinProperties = [
6
- "role",
7
- "ariaAtomic",
8
- "ariaAutoComplete",
9
- "ariaBusy",
10
- "ariaChecked",
11
- "ariaColCount",
12
- "ariaColIndex",
13
- "ariaColIndexText",
14
- "ariaColSpan",
15
- "ariaCurrent",
16
- "ariaDescription",
17
- "ariaDisabled",
18
- "ariaExpanded",
19
- "ariaHasPopup",
20
- "ariaHidden",
21
- "ariaInvalid",
22
- "ariaKeyShortcuts",
23
- "ariaLabel",
24
- "ariaLevel",
25
- "ariaLive",
26
- "ariaModal",
27
- "ariaMultiLine",
28
- "ariaMultiSelectable",
29
- "ariaOrientation",
30
- "ariaPlaceholder",
31
- "ariaPosInSet",
32
- "ariaPressed",
33
- "ariaReadOnly",
34
- "ariaRequired",
35
- "ariaRoleDescription",
36
- "ariaRowCount",
37
- "ariaRowIndex",
38
- "ariaRowIndexText",
39
- "ariaRowSpan",
40
- "ariaSelected",
41
- "ariaSetSize",
42
- "ariaSort",
43
- "ariaValueMax",
44
- "ariaValueMin",
45
- "ariaValueNow",
46
- "ariaValueText",
47
- "ariaRelevant"
48
- // Non-standard
49
- ];
50
- const ariaAttributeName = (ariaPropertyName) => ariaPropertyName.replace("aria", "aria-").toLowerCase();
51
- const DelegatesAria = (Base) => {
52
- class DelegatesAriaElement extends Base {
53
- constructor(...rest) {
54
- super(...rest);
55
- for (const ariaProperty of ariaMixinProperties) {
56
- this[ariaProperty] = null;
6
+ class DelegateAriaBehavior {
7
+ constructor(target, params) {
8
+ this.target = target;
9
+ this.source = null;
10
+ this.bindingBehaviours = [];
11
+ this.onSourceAriaPropertyChanged = (source, property) => {
12
+ this.mitigateAccessibilityIssues(source);
13
+ if (!this.forwardedProperties.has(property)) {
14
+ return;
57
15
  }
16
+ this.forwardPropertyToTarget(this.target, property, source[property]);
17
+ };
18
+ this.boundProperties = params.boundProperties;
19
+ this.forwardedProperties = params.forwardedProperties;
20
+ this.isMitigationDisabled = params.disableAccessibilityMitigation;
21
+ }
22
+ bind(source) {
23
+ this.source = source;
24
+ this.bindPropertiesToTarget(source, this.boundProperties, this.target);
25
+ this.startForwardingPropertiesToTarget(
26
+ source,
27
+ this.forwardedProperties,
28
+ this.target
29
+ );
30
+ this.mitigateAccessibilityIssues(source);
31
+ }
32
+ unbind() {
33
+ if (this.source === null) {
34
+ return;
58
35
  }
36
+ this.releasePropertyBindings(this.source);
37
+ this.stopForwardingPropertiesToTarget(this.source);
38
+ this.source = null;
59
39
  }
60
- for (const ariaProperty of ariaMixinProperties) {
61
- vividElement.attr({ attribute: ariaAttributeName(ariaProperty) })(
62
- DelegatesAriaElement.prototype,
63
- ariaProperty
40
+ bindPropertiesToTarget(source, boundProperties, target) {
41
+ for (const [property, binding] of Object.entries(boundProperties)) {
42
+ const bindingFn = binding instanceof Function ? binding : () => binding;
43
+ this.bindingBehaviours.push(
44
+ new attributeBindingBehaviour.AttributeBindingBehavior(
45
+ target,
46
+ bindingFn,
47
+ vividElement.Observable.isVolatileBinding(bindingFn),
48
+ vividElement.ariaAttributeName(property)
49
+ )
50
+ );
51
+ }
52
+ source.$fastController.addBehaviors(this.bindingBehaviours);
53
+ }
54
+ releasePropertyBindings(source) {
55
+ source.$fastController.removeBehaviors(this.bindingBehaviours);
56
+ this.bindingBehaviours = [];
57
+ }
58
+ startForwardingPropertiesToTarget(source, delegatedProperties, target) {
59
+ for (const key of delegatedProperties) {
60
+ this.forwardPropertyToTarget(target, key, source[key]);
61
+ }
62
+ vividElement.subscribeToAriaPropertyChanges(source, this.onSourceAriaPropertyChanged);
63
+ }
64
+ stopForwardingPropertiesToTarget(source) {
65
+ vividElement.unsubscribeFromAriaPropertyChanges(
66
+ source,
67
+ this.onSourceAriaPropertyChanged
64
68
  );
65
69
  }
70
+ forwardPropertyToTarget(target, property, value) {
71
+ vividElement.DOM.setAttribute(target, vividElement.ariaAttributeName(property), value);
72
+ }
73
+ /**
74
+ * Sets role to presentation unless there are properties present that prohibit it.
75
+ * Using role="presentation" will cause non-global states or properties to be ignored.
76
+ * See: https://www.w3.org/TR/wai-aria-1.3/#conflict_resolution_presentation_none
77
+ */
78
+ mitigateAccessibilityIssues(source) {
79
+ if (this.isMitigationDisabled) {
80
+ return;
81
+ }
82
+ const hasProhibitedProperties = Boolean(
83
+ source.ariaLabel || source.ariaBrailleLabel || source.ariaChecked
84
+ );
85
+ if (hasProhibitedProperties) {
86
+ source.removeAttribute("role");
87
+ } else {
88
+ source.setAttribute("role", "presentation");
89
+ }
90
+ }
91
+ }
92
+
93
+ function delegateAria(boundProperties = {}, options = {}) {
94
+ const forwardedProperties = new Set(
95
+ (options.onlySpecified ? [] : vividElement.ariaMixinProperties).filter((p) => p !== "role").filter((p) => !(p in boundProperties))
96
+ );
97
+ const disableAccessibilityMitigation = boundProperties.role instanceof Function;
98
+ return new vividElement.AttachedBehaviorHTMLDirective(
99
+ "vvd-delegate-aria",
100
+ DelegateAriaBehavior,
101
+ {
102
+ boundProperties,
103
+ forwardedProperties,
104
+ disableAccessibilityMitigation
105
+ }
106
+ );
107
+ }
108
+ const DelegatesAria = (Base) => {
109
+ class DelegatesAriaElement extends Base {
110
+ constructor() {
111
+ super(...arguments);
112
+ this._vividAriaBehaviour = "delegate";
113
+ }
114
+ }
66
115
  return DelegatesAriaElement;
67
116
  };
68
117
 
69
118
  exports.DelegatesAria = DelegatesAria;
119
+ exports.delegateAria = delegateAria;
@@ -1,67 +1,116 @@
1
- import { a as attr } from './vivid-element.js';
1
+ import { A as AttributeBindingBehavior } from './attribute-binding-behaviour.js';
2
+ import { O as Observable, d as ariaAttributeName, s as subscribeToAriaPropertyChanges, u as unsubscribeFromAriaPropertyChanges, D as DOM, f as ariaMixinProperties, A as AttachedBehaviorHTMLDirective } from './vivid-element.js';
2
3
 
3
- const ariaMixinProperties = [
4
- "role",
5
- "ariaAtomic",
6
- "ariaAutoComplete",
7
- "ariaBusy",
8
- "ariaChecked",
9
- "ariaColCount",
10
- "ariaColIndex",
11
- "ariaColIndexText",
12
- "ariaColSpan",
13
- "ariaCurrent",
14
- "ariaDescription",
15
- "ariaDisabled",
16
- "ariaExpanded",
17
- "ariaHasPopup",
18
- "ariaHidden",
19
- "ariaInvalid",
20
- "ariaKeyShortcuts",
21
- "ariaLabel",
22
- "ariaLevel",
23
- "ariaLive",
24
- "ariaModal",
25
- "ariaMultiLine",
26
- "ariaMultiSelectable",
27
- "ariaOrientation",
28
- "ariaPlaceholder",
29
- "ariaPosInSet",
30
- "ariaPressed",
31
- "ariaReadOnly",
32
- "ariaRequired",
33
- "ariaRoleDescription",
34
- "ariaRowCount",
35
- "ariaRowIndex",
36
- "ariaRowIndexText",
37
- "ariaRowSpan",
38
- "ariaSelected",
39
- "ariaSetSize",
40
- "ariaSort",
41
- "ariaValueMax",
42
- "ariaValueMin",
43
- "ariaValueNow",
44
- "ariaValueText",
45
- "ariaRelevant"
46
- // Non-standard
47
- ];
48
- const ariaAttributeName = (ariaPropertyName) => ariaPropertyName.replace("aria", "aria-").toLowerCase();
49
- const DelegatesAria = (Base) => {
50
- class DelegatesAriaElement extends Base {
51
- constructor(...rest) {
52
- super(...rest);
53
- for (const ariaProperty of ariaMixinProperties) {
54
- this[ariaProperty] = null;
4
+ class DelegateAriaBehavior {
5
+ constructor(target, params) {
6
+ this.target = target;
7
+ this.source = null;
8
+ this.bindingBehaviours = [];
9
+ this.onSourceAriaPropertyChanged = (source, property) => {
10
+ this.mitigateAccessibilityIssues(source);
11
+ if (!this.forwardedProperties.has(property)) {
12
+ return;
55
13
  }
14
+ this.forwardPropertyToTarget(this.target, property, source[property]);
15
+ };
16
+ this.boundProperties = params.boundProperties;
17
+ this.forwardedProperties = params.forwardedProperties;
18
+ this.isMitigationDisabled = params.disableAccessibilityMitigation;
19
+ }
20
+ bind(source) {
21
+ this.source = source;
22
+ this.bindPropertiesToTarget(source, this.boundProperties, this.target);
23
+ this.startForwardingPropertiesToTarget(
24
+ source,
25
+ this.forwardedProperties,
26
+ this.target
27
+ );
28
+ this.mitigateAccessibilityIssues(source);
29
+ }
30
+ unbind() {
31
+ if (this.source === null) {
32
+ return;
56
33
  }
34
+ this.releasePropertyBindings(this.source);
35
+ this.stopForwardingPropertiesToTarget(this.source);
36
+ this.source = null;
57
37
  }
58
- for (const ariaProperty of ariaMixinProperties) {
59
- attr({ attribute: ariaAttributeName(ariaProperty) })(
60
- DelegatesAriaElement.prototype,
61
- ariaProperty
38
+ bindPropertiesToTarget(source, boundProperties, target) {
39
+ for (const [property, binding] of Object.entries(boundProperties)) {
40
+ const bindingFn = binding instanceof Function ? binding : () => binding;
41
+ this.bindingBehaviours.push(
42
+ new AttributeBindingBehavior(
43
+ target,
44
+ bindingFn,
45
+ Observable.isVolatileBinding(bindingFn),
46
+ ariaAttributeName(property)
47
+ )
48
+ );
49
+ }
50
+ source.$fastController.addBehaviors(this.bindingBehaviours);
51
+ }
52
+ releasePropertyBindings(source) {
53
+ source.$fastController.removeBehaviors(this.bindingBehaviours);
54
+ this.bindingBehaviours = [];
55
+ }
56
+ startForwardingPropertiesToTarget(source, delegatedProperties, target) {
57
+ for (const key of delegatedProperties) {
58
+ this.forwardPropertyToTarget(target, key, source[key]);
59
+ }
60
+ subscribeToAriaPropertyChanges(source, this.onSourceAriaPropertyChanged);
61
+ }
62
+ stopForwardingPropertiesToTarget(source) {
63
+ unsubscribeFromAriaPropertyChanges(
64
+ source,
65
+ this.onSourceAriaPropertyChanged
62
66
  );
63
67
  }
68
+ forwardPropertyToTarget(target, property, value) {
69
+ DOM.setAttribute(target, ariaAttributeName(property), value);
70
+ }
71
+ /**
72
+ * Sets role to presentation unless there are properties present that prohibit it.
73
+ * Using role="presentation" will cause non-global states or properties to be ignored.
74
+ * See: https://www.w3.org/TR/wai-aria-1.3/#conflict_resolution_presentation_none
75
+ */
76
+ mitigateAccessibilityIssues(source) {
77
+ if (this.isMitigationDisabled) {
78
+ return;
79
+ }
80
+ const hasProhibitedProperties = Boolean(
81
+ source.ariaLabel || source.ariaBrailleLabel || source.ariaChecked
82
+ );
83
+ if (hasProhibitedProperties) {
84
+ source.removeAttribute("role");
85
+ } else {
86
+ source.setAttribute("role", "presentation");
87
+ }
88
+ }
89
+ }
90
+
91
+ function delegateAria(boundProperties = {}, options = {}) {
92
+ const forwardedProperties = new Set(
93
+ (options.onlySpecified ? [] : ariaMixinProperties).filter((p) => p !== "role").filter((p) => !(p in boundProperties))
94
+ );
95
+ const disableAccessibilityMitigation = boundProperties.role instanceof Function;
96
+ return new AttachedBehaviorHTMLDirective(
97
+ "vvd-delegate-aria",
98
+ DelegateAriaBehavior,
99
+ {
100
+ boundProperties,
101
+ forwardedProperties,
102
+ disableAccessibilityMitigation
103
+ }
104
+ );
105
+ }
106
+ const DelegatesAria = (Base) => {
107
+ class DelegatesAriaElement extends Base {
108
+ constructor() {
109
+ super(...arguments);
110
+ this._vividAriaBehaviour = "delegate";
111
+ }
112
+ }
64
113
  return DelegatesAriaElement;
65
114
  };
66
115
 
67
- export { DelegatesAria as D };
116
+ export { DelegatesAria as D, delegateAria as d };
@@ -1,6 +1,13 @@
1
1
  import { FormAssociatedButton } from './button.form-associated';
2
2
  declare const VividFoundationButton_base: {
3
- new (...rest: any[]): {
3
+ new (...args: any[]): {
4
+ _vividAriaBehaviour: "delegate";
5
+ specialHandling: boolean;
6
+ readonly $fastController: import("@microsoft/fast-element").Controller;
7
+ $emit(type: string, detail?: any, options?: Omit<CustomEventInit<any>, "detail"> | undefined): boolean | void;
8
+ connectedCallback(): void;
9
+ disconnectedCallback(): void;
10
+ attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
4
11
  accessKey: string;
5
12
  readonly accessKeyLabel: string;
6
13
  autocapitalize: string;
@@ -317,11 +324,6 @@ declare const VividFoundationButton_base: {
317
324
  tabIndex: number;
318
325
  blur(): void;
319
326
  focus(options?: FocusOptions | undefined): void;
320
- readonly $fastController: import("@microsoft/fast-element").Controller;
321
- $emit(type: string, detail?: any, options?: Omit<CustomEventInit<any>, "detail"> | undefined): boolean | void;
322
- connectedCallback(): void;
323
- disconnectedCallback(): void;
324
- attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
325
327
  ariaColIndexText: string | null;
326
328
  ariaDescription: string | null;
327
329
  ariaRowIndexText: string | null;