@lmvz-ds/components 0.16.0 → 0.17.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 (248) hide show
  1. package/dist/cjs/{icons-BOM23oli.js → Effect-DdYOHaR4.js} +153 -889
  2. package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -3
  3. package/dist/cjs/aria-loader-BRxRUIyi.js +121 -0
  4. package/dist/cjs/{assets-XY-cBmal.js → assets-OvQ-WUwR.js} +2 -5
  5. package/dist/cjs/component-Csg9MtNK.js +140 -0
  6. package/dist/cjs/element-activation-controller-DC_6T0Rt.js +31 -0
  7. package/dist/cjs/icons-EHBLbidD.js +653 -0
  8. package/dist/cjs/{index-ww_DCXU7.js → index-BBqtydE-.js} +426 -431
  9. package/dist/cjs/index-Bp6Dd2i1.js +94 -0
  10. package/dist/cjs/{index-B1Puzu82.js → index-CH-YLRgg.js} +650 -10
  11. package/dist/cjs/index.cjs.js +12 -13
  12. package/dist/cjs/lmvz-action.cjs.entry.js +2 -5
  13. package/dist/cjs/lmvz-button.cjs.entry.js +73 -0
  14. package/dist/cjs/lmvz-card.cjs.entry.js +3 -6
  15. package/dist/cjs/lmvz-chip.cjs.entry.js +2 -5
  16. package/dist/cjs/lmvz-components.cjs.js +2 -5
  17. package/dist/cjs/lmvz-header_2.cjs.entry.js +153 -0
  18. package/dist/cjs/lmvz-icon.cjs.entry.js +87 -0
  19. package/dist/cjs/lmvz-input.cjs.entry.js +183 -0
  20. package/dist/cjs/lmvz-menuitem.cjs.entry.js +36 -0
  21. package/dist/cjs/lmvz-select.cjs.entry.js +71 -0
  22. package/dist/cjs/loader.cjs.js +2 -5
  23. package/dist/cjs/reactive-controller-host-vy1TIIXv.js +189 -0
  24. package/dist/collection/api/ds.constants.js +0 -1
  25. package/dist/collection/api/index.js +0 -1
  26. package/dist/collection/collection-manifest.json +13 -1
  27. package/dist/collection/components/lmvz-action/lmvz-action.js +1 -2
  28. package/dist/collection/components/lmvz-button/lmvz-button.css +2 -24
  29. package/dist/collection/components/lmvz-button/lmvz-button.js +1 -2
  30. package/dist/collection/components/lmvz-card/lmvz-card.css +2 -24
  31. package/dist/collection/components/lmvz-card/lmvz-card.js +1 -2
  32. package/dist/collection/components/lmvz-chip/lmvz-chip.js +1 -2
  33. package/dist/collection/components/lmvz-header/lmvz-header.js +1 -2
  34. package/dist/collection/components/lmvz-icon/icons.js +0 -1
  35. package/dist/collection/components/lmvz-icon/lmvz-icon.js +1 -2
  36. package/dist/collection/components/lmvz-icon/public.js +0 -1
  37. package/dist/collection/components/lmvz-icon/test/icons.unit.js +0 -1
  38. package/dist/collection/components/lmvz-input/lmvz-input.css +2 -24
  39. package/dist/collection/components/lmvz-input/lmvz-input.js +2 -3
  40. package/dist/collection/components/lmvz-menuitem/lmvz-menuitem.css +2 -24
  41. package/dist/collection/components/lmvz-menuitem/lmvz-menuitem.js +1 -2
  42. package/dist/collection/components/lmvz-select/lmvz-select.css +2 -24
  43. package/dist/collection/components/lmvz-select/lmvz-select.js +1 -2
  44. package/dist/collection/index.js +0 -1
  45. package/dist/collection/integration/header-integration.js +1 -2
  46. package/dist/collection/utils/aria/aria-validation-controller.js +0 -1
  47. package/dist/collection/utils/aria/element-activation-controller.js +0 -1
  48. package/dist/collection/utils/aria/list-keyboard-controller.js +0 -1
  49. package/dist/collection/utils/assets.js +0 -1
  50. package/dist/collection/utils/component.js +0 -1
  51. package/dist/collection/utils/effect.js +0 -1
  52. package/dist/collection/utils/environment.js +0 -1
  53. package/dist/collection/utils/http.js +0 -1
  54. package/dist/collection/utils/http.unit.js +0 -1
  55. package/dist/collection/utils/public.js +0 -1
  56. package/dist/collection/utils/reactive-controller-host.js +0 -1
  57. package/dist/collection/utils/validation/svg.js +0 -1
  58. package/dist/components/index.d.ts +0 -2
  59. package/dist/components/index.js +1 -2
  60. package/dist/components/lmvz-action.js +1 -2
  61. package/dist/components/lmvz-button.js +1 -2
  62. package/dist/components/lmvz-card.js +1 -2
  63. package/dist/components/lmvz-chip.js +1 -2
  64. package/dist/components/lmvz-header.js +1 -2
  65. package/dist/components/lmvz-icon.js +1 -2
  66. package/dist/components/lmvz-input.js +1 -2
  67. package/dist/components/lmvz-menuitem.js +1 -2
  68. package/dist/components/lmvz-select.js +1 -2
  69. package/dist/components/p-BfTCfPZ1.js +2 -3
  70. package/dist/components/p-BsHYIl56.js +1 -2
  71. package/dist/components/p-CKtksB0G.js +1 -0
  72. package/dist/components/p-CN0JX9-m.js +1 -2
  73. package/dist/components/p-CahBdGGN.js +1 -0
  74. package/dist/components/p-DQEkWkMh.js +1 -2
  75. package/dist/components/p-GKEnURpp.js +1 -0
  76. package/dist/components/p-vIq2biqy.js +2 -3
  77. package/dist/esm/{icons-D1lxdRXP.js → Effect-9SROYpxM.js} +91 -854
  78. package/dist/esm/app-globals-DQuL1Twl.js +0 -3
  79. package/dist/esm/aria-loader-JxXwTAe5.js +114 -0
  80. package/dist/esm/{assets-BD98wsl7.js → assets-CNHv_WMG.js} +1 -4
  81. package/dist/esm/component-DIrAQ4IB.js +134 -0
  82. package/dist/esm/element-activation-controller-CN0JX9-m.js +29 -0
  83. package/dist/esm/icons-B255FOe4.js +649 -0
  84. package/dist/esm/{index-DoNkkDv1.js → index-BW1YMEA3.js} +1 -6
  85. package/dist/esm/index-BfTCfPZ1.js +92 -0
  86. package/dist/esm/{index-WeqgWisK.js → index-CQb-mBBB.js} +650 -10
  87. package/dist/esm/index.js +5 -7
  88. package/dist/esm/lmvz-action.entry.js +2 -5
  89. package/dist/esm/lmvz-button.entry.js +71 -0
  90. package/dist/esm/lmvz-card.entry.js +3 -6
  91. package/dist/esm/lmvz-chip.entry.js +2 -5
  92. package/dist/esm/lmvz-components.js +3 -6
  93. package/dist/esm/lmvz-header_2.entry.js +150 -0
  94. package/dist/esm/lmvz-icon.entry.js +85 -0
  95. package/dist/esm/lmvz-input.entry.js +181 -0
  96. package/dist/esm/lmvz-menuitem.entry.js +34 -0
  97. package/dist/esm/lmvz-select.entry.js +69 -0
  98. package/dist/esm/loader.js +3 -6
  99. package/dist/esm/reactive-controller-host-OhKYwMvP.js +186 -0
  100. package/dist/lmvz-components/index.esm.js +1 -2
  101. package/dist/lmvz-components/lmvz-components.esm.js +1 -2
  102. package/dist/lmvz-components/p-150ecfb6.entry.js +1 -0
  103. package/dist/lmvz-components/p-22f67eff.entry.js +1 -0
  104. package/dist/lmvz-components/p-4530f088.entry.js +1 -0
  105. package/dist/lmvz-components/p-47d7ed0e.entry.js +1 -0
  106. package/dist/lmvz-components/p-5c3f1404.entry.js +1 -0
  107. package/dist/lmvz-components/p-8d51e396.entry.js +1 -0
  108. package/dist/lmvz-components/p-9SROYpxM.js +1 -0
  109. package/dist/lmvz-components/p-BfTCfPZ1.js +6 -0
  110. package/dist/lmvz-components/p-Bx29-tJt.js +1 -0
  111. package/dist/lmvz-components/p-CN0JX9-m.js +1 -0
  112. package/dist/lmvz-components/p-CQb-mBBB.js +2 -0
  113. package/dist/lmvz-components/p-Cp76bcGb.js +1 -0
  114. package/dist/lmvz-components/p-Cp7cp10e.js +12 -0
  115. package/dist/lmvz-components/p-DIrAQ4IB.js +1 -0
  116. package/dist/lmvz-components/p-DQuL1Twl.js +1 -2
  117. package/dist/lmvz-components/p-DyO6wO4l.js +1 -0
  118. package/dist/lmvz-components/p-b8926640.entry.js +1 -0
  119. package/dist/lmvz-components/p-b9d1953f.entry.js +1 -0
  120. package/dist/lmvz-components/p-d9c3f542.entry.js +1 -0
  121. package/dist/lmvz-components/p-i2508Ct1.js +1 -0
  122. package/dist/manifest.json +11 -47
  123. package/dist/stencil.config.base.js +0 -1
  124. package/dist/stencil.config.dev.js +0 -1
  125. package/dist/stencil.config.integration.js +0 -1
  126. package/dist/stencil.config.js +0 -1
  127. package/dist/stencil.config.prod.js +0 -1
  128. package/dist/types/components.d.ts +0 -18
  129. package/hydrate/index.js +11 -11
  130. package/hydrate/index.mjs +11 -11
  131. package/package.json +4 -4
  132. package/readme.md +1 -1
  133. package/dist/cjs/app-globals-V2Kpy_OQ.js.map +0 -1
  134. package/dist/cjs/assets-XY-cBmal.js.map +0 -1
  135. package/dist/cjs/header-integration_7.cjs.entry.js +0 -1024
  136. package/dist/cjs/header-integration_7.cjs.entry.js.map +0 -1
  137. package/dist/cjs/icons-BOM23oli.js.map +0 -1
  138. package/dist/cjs/index-B1Puzu82.js.map +0 -1
  139. package/dist/cjs/index-ww_DCXU7.js.map +0 -1
  140. package/dist/cjs/index.cjs.js.map +0 -1
  141. package/dist/cjs/lmvz-action.cjs.entry.js.map +0 -1
  142. package/dist/cjs/lmvz-card.cjs.entry.js.map +0 -1
  143. package/dist/cjs/lmvz-chip.cjs.entry.js.map +0 -1
  144. package/dist/cjs/lmvz-components.cjs.js.map +0 -1
  145. package/dist/cjs/loader.cjs.js.map +0 -1
  146. package/dist/collection/api/ds.constants.js.map +0 -1
  147. package/dist/collection/api/index.js.map +0 -1
  148. package/dist/collection/components/lmvz-action/lmvz-action.js.map +0 -1
  149. package/dist/collection/components/lmvz-button/lmvz-button.js.map +0 -1
  150. package/dist/collection/components/lmvz-card/lmvz-card.js.map +0 -1
  151. package/dist/collection/components/lmvz-chip/lmvz-chip.js.map +0 -1
  152. package/dist/collection/components/lmvz-header/lmvz-header.js.map +0 -1
  153. package/dist/collection/components/lmvz-icon/icons.js.map +0 -1
  154. package/dist/collection/components/lmvz-icon/lmvz-icon.js.map +0 -1
  155. package/dist/collection/components/lmvz-icon/public.js.map +0 -1
  156. package/dist/collection/components/lmvz-icon/test/icons.unit.js.map +0 -1
  157. package/dist/collection/components/lmvz-input/lmvz-input.js.map +0 -1
  158. package/dist/collection/components/lmvz-menuitem/lmvz-menuitem.js.map +0 -1
  159. package/dist/collection/components/lmvz-select/lmvz-select.js.map +0 -1
  160. package/dist/collection/index.js.map +0 -1
  161. package/dist/collection/integration/header-integration.js.map +0 -1
  162. package/dist/collection/utils/aria/aria-validation-controller.js.map +0 -1
  163. package/dist/collection/utils/aria/element-activation-controller.js.map +0 -1
  164. package/dist/collection/utils/aria/list-keyboard-controller.js.map +0 -1
  165. package/dist/collection/utils/assets.js.map +0 -1
  166. package/dist/collection/utils/component.js.map +0 -1
  167. package/dist/collection/utils/effect.js.map +0 -1
  168. package/dist/collection/utils/environment.js.map +0 -1
  169. package/dist/collection/utils/http.js.map +0 -1
  170. package/dist/collection/utils/http.unit.js.map +0 -1
  171. package/dist/collection/utils/public.js.map +0 -1
  172. package/dist/collection/utils/reactive-controller-host.js.map +0 -1
  173. package/dist/collection/utils/validation/svg.js.map +0 -1
  174. package/dist/components/header-integration.d.ts +0 -11
  175. package/dist/components/header-integration.js +0 -2
  176. package/dist/components/header-integration.js.map +0 -1
  177. package/dist/components/index.js.map +0 -1
  178. package/dist/components/lmvz-action.js.map +0 -1
  179. package/dist/components/lmvz-button.js.map +0 -1
  180. package/dist/components/lmvz-card.js.map +0 -1
  181. package/dist/components/lmvz-chip.js.map +0 -1
  182. package/dist/components/lmvz-header.js.map +0 -1
  183. package/dist/components/lmvz-icon.js.map +0 -1
  184. package/dist/components/lmvz-input.js.map +0 -1
  185. package/dist/components/lmvz-menuitem.js.map +0 -1
  186. package/dist/components/lmvz-select.js.map +0 -1
  187. package/dist/components/p-B2g3aN-E.js +0 -2
  188. package/dist/components/p-B2g3aN-E.js.map +0 -1
  189. package/dist/components/p-BXdOuZTp.js +0 -2
  190. package/dist/components/p-BXdOuZTp.js.map +0 -1
  191. package/dist/components/p-BfTCfPZ1.js.map +0 -1
  192. package/dist/components/p-BpCjj39Z.js +0 -2
  193. package/dist/components/p-BpCjj39Z.js.map +0 -1
  194. package/dist/components/p-BsHYIl56.js.map +0 -1
  195. package/dist/components/p-C5rqq3bf.js +0 -2
  196. package/dist/components/p-C5rqq3bf.js.map +0 -1
  197. package/dist/components/p-CI0tffvo.js +0 -2
  198. package/dist/components/p-CI0tffvo.js.map +0 -1
  199. package/dist/components/p-CN0JX9-m.js.map +0 -1
  200. package/dist/components/p-ClmDNIy4.js +0 -2
  201. package/dist/components/p-ClmDNIy4.js.map +0 -1
  202. package/dist/components/p-DQEkWkMh.js.map +0 -1
  203. package/dist/components/p-X5fEFT9T.js +0 -2
  204. package/dist/components/p-X5fEFT9T.js.map +0 -1
  205. package/dist/components/p-vIq2biqy.js.map +0 -1
  206. package/dist/esm/app-globals-DQuL1Twl.js.map +0 -1
  207. package/dist/esm/assets-BD98wsl7.js.map +0 -1
  208. package/dist/esm/header-integration_7.entry.js +0 -1016
  209. package/dist/esm/header-integration_7.entry.js.map +0 -1
  210. package/dist/esm/icons-D1lxdRXP.js.map +0 -1
  211. package/dist/esm/index-DoNkkDv1.js.map +0 -1
  212. package/dist/esm/index-WeqgWisK.js.map +0 -1
  213. package/dist/esm/index.js.map +0 -1
  214. package/dist/esm/lmvz-action.entry.js.map +0 -1
  215. package/dist/esm/lmvz-card.entry.js.map +0 -1
  216. package/dist/esm/lmvz-chip.entry.js.map +0 -1
  217. package/dist/esm/lmvz-components.js.map +0 -1
  218. package/dist/esm/loader.js.map +0 -1
  219. package/dist/lmvz-components/index.esm.js.map +0 -1
  220. package/dist/lmvz-components/lmvz-components.esm.js.map +0 -1
  221. package/dist/lmvz-components/p-33485219.entry.js +0 -2
  222. package/dist/lmvz-components/p-33485219.entry.js.map +0 -1
  223. package/dist/lmvz-components/p-76032c32.entry.js +0 -2
  224. package/dist/lmvz-components/p-76032c32.entry.js.map +0 -1
  225. package/dist/lmvz-components/p-7aeec9a8.entry.js +0 -7
  226. package/dist/lmvz-components/p-7aeec9a8.entry.js.map +0 -1
  227. package/dist/lmvz-components/p-84e0a9dd.entry.js +0 -2
  228. package/dist/lmvz-components/p-84e0a9dd.entry.js.map +0 -1
  229. package/dist/lmvz-components/p-CkJb8WVZ.js +0 -2
  230. package/dist/lmvz-components/p-CkJb8WVZ.js.map +0 -1
  231. package/dist/lmvz-components/p-DQuL1Twl.js.map +0 -1
  232. package/dist/lmvz-components/p-WeqgWisK.js +0 -3
  233. package/dist/lmvz-components/p-WeqgWisK.js.map +0 -1
  234. package/dist/lmvz-components/p-Z9X0_ik0.js +0 -2
  235. package/dist/lmvz-components/p-Z9X0_ik0.js.map +0 -1
  236. package/dist/lmvz-components/p-eP0oxQ44.js +0 -13
  237. package/dist/lmvz-components/p-eP0oxQ44.js.map +0 -1
  238. package/dist/stencil.config.base.js.map +0 -1
  239. package/dist/stencil.config.dev.js.map +0 -1
  240. package/dist/stencil.config.integration.js.map +0 -1
  241. package/dist/stencil.config.js.map +0 -1
  242. package/dist/stencil.config.prod.js.map +0 -1
  243. package/dist/types/integration/header-integration.d.ts +0 -5
  244. /package/dist/types/{Users/patrick.nemenz/workspace/lmvz/lmvz-ds → opt/atlassian/pipelines/agent/build}/packages/components/.stencil/stencil.config.base.d.ts +0 -0
  245. /package/dist/types/{Users/patrick.nemenz/workspace/lmvz/lmvz-ds → opt/atlassian/pipelines/agent/build}/packages/components/.stencil/stencil.config.d.ts +0 -0
  246. /package/dist/types/{Users/patrick.nemenz/workspace/lmvz/lmvz-ds → opt/atlassian/pipelines/agent/build}/packages/components/.stencil/stencil.config.dev.d.ts +0 -0
  247. /package/dist/types/{Users/patrick.nemenz/workspace/lmvz/lmvz-ds → opt/atlassian/pipelines/agent/build}/packages/components/.stencil/stencil.config.integration.d.ts +0 -0
  248. /package/dist/types/{Users/patrick.nemenz/workspace/lmvz/lmvz-ds → opt/atlassian/pipelines/agent/build}/packages/components/.stencil/stencil.config.prod.d.ts +0 -0
@@ -1,6 +1,3 @@
1
1
  const globalScripts = () => {};
2
2
 
3
3
  export { globalScripts as g };
4
- //# sourceMappingURL=app-globals-DQuL1Twl.js.map
5
-
6
- //# sourceMappingURL=app-globals-DQuL1Twl.js.map
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Verify whether a value is a Promise by duck-testing for a 'then' function
3
+ */
4
+ function isPromise(value) {
5
+ if (!value)
6
+ return false;
7
+ return typeof value === 'object' && typeof value.then === 'function';
8
+ }
9
+
10
+ /**
11
+ * Resolve the result of a function that may be async or not, as a Promise.
12
+ */
13
+ function resolvePossiblyAsyncFunction(func, args = []) {
14
+ const res = func(...args);
15
+ if (isPromise(res)) {
16
+ return res;
17
+ }
18
+ return Promise.resolve(res);
19
+ }
20
+
21
+ const GLOBAL_STATE_KEY = Symbol('__lmvzAriaValidationRuntimeState');
22
+ const ARIA_VALIDATION_RUNTIME_CHANGED_EVENT = 'lmvz:aria-validation-runtime-changed';
23
+ function getRuntimeState() {
24
+ const globalState = globalThis;
25
+ if (!globalState[GLOBAL_STATE_KEY]) {
26
+ globalState[GLOBAL_STATE_KEY] = {
27
+ enabled: false,
28
+ };
29
+ }
30
+ return globalState[GLOBAL_STATE_KEY];
31
+ }
32
+ function notifyRuntimeChange() {
33
+ if (typeof window === 'undefined')
34
+ return;
35
+ window.dispatchEvent(new CustomEvent(ARIA_VALIDATION_RUNTIME_CHANGED_EVENT));
36
+ }
37
+ async function fetchRuntime() {
38
+ const state = getRuntimeState();
39
+ if (!state.enabled)
40
+ return null;
41
+ if (state.runtime)
42
+ return state.runtime;
43
+ if (!state.loadPromise) {
44
+ state.loadPromise = import('./index-BW1YMEA3.js').catch(() => null);
45
+ }
46
+ const runtime = await state.loadPromise;
47
+ if (runtime) {
48
+ state.runtime = runtime;
49
+ }
50
+ return runtime;
51
+ }
52
+ async function initializeValidation(...args) {
53
+ const runtime = await fetchRuntime();
54
+ const s = getRuntimeState();
55
+ if (!s.enabled)
56
+ return;
57
+ if (!runtime) {
58
+ console.warn('Failed to load aria validation runtime');
59
+ return;
60
+ }
61
+ runtime.initializeValidationStream(...args);
62
+ }
63
+ const isAriaValidationEnabled = () => getRuntimeState().enabled;
64
+ const useVerboseLogging = () => getRuntimeState().verboseLogging ?? false;
65
+ const enableAriaValidation = (options = {}) => {
66
+ const state = getRuntimeState();
67
+ if (state.enabled)
68
+ return;
69
+ Object.assign(state, options);
70
+ state.enabled = true;
71
+ initializeValidation().then(() => {
72
+ notifyRuntimeChange();
73
+ });
74
+ };
75
+ const disableAriaValidation = () => {
76
+ const state = getRuntimeState();
77
+ if (!state.enabled)
78
+ return;
79
+ state.enabled = false;
80
+ notifyRuntimeChange();
81
+ };
82
+ function queueValidation(...args) {
83
+ const { enabled, runtime, loadPromise, lazyCondition } = getRuntimeState();
84
+ if (!enabled)
85
+ return;
86
+ if (!lazyCondition)
87
+ return q();
88
+ resolvePossiblyAsyncFunction(lazyCondition).then((shouldEnqueue) => {
89
+ if (!shouldEnqueue)
90
+ return;
91
+ q();
92
+ });
93
+ function q() {
94
+ if (runtime)
95
+ return runtime.enqueueValidation(...args);
96
+ if (!loadPromise) {
97
+ console.warn('neither runtime nor load promise found for aria validation. This should not happen, as enabling aria validation should have triggered the loading of the runtime.');
98
+ return;
99
+ }
100
+ loadPromise
101
+ .then((loadedRuntime) => {
102
+ if (!loadedRuntime?.enqueueValidation) {
103
+ console.error('Failed to load aria validation runtime');
104
+ return;
105
+ }
106
+ loadedRuntime.enqueueValidation(...args);
107
+ })
108
+ .catch(() => {
109
+ console.error('Failed to enqueue validation due to an error while loading the runtime');
110
+ });
111
+ }
112
+ }
113
+
114
+ export { ARIA_VALIDATION_RUNTIME_CHANGED_EVENT as A, disableAriaValidation as d, enableAriaValidation as e, isAriaValidationEnabled as i, queueValidation as q, useVerboseLogging as u };
@@ -1,4 +1,4 @@
1
- import { a as getAssetPath } from './index-WeqgWisK.js';
1
+ import { a as getAssetPath } from './index-CQb-mBBB.js';
2
2
 
3
3
  function getLocationBase() {
4
4
  return import.meta?.url ?? window?.location?.origin ?? '';
@@ -21,6 +21,3 @@ function joinPath(...parts) {
21
21
  }
22
22
 
23
23
  export { createAssetUrlSafely as c };
24
- //# sourceMappingURL=assets-BD98wsl7.js.map
25
-
26
- //# sourceMappingURL=assets-BD98wsl7.js.map
@@ -0,0 +1,134 @@
1
+ const componentOnReady = (el, callback) => {
2
+ if (el.componentOnReady) {
3
+ el.componentOnReady().then((resolvedEl) => callback(resolvedEl));
4
+ }
5
+ else {
6
+ raf(() => callback(el));
7
+ }
8
+ };
9
+ const inheritAttributes = (el, attributes = []) => {
10
+ const attributeObject = {};
11
+ attributes.forEach((attr) => {
12
+ if (el.hasAttribute(attr)) {
13
+ const value = el.getAttribute(attr);
14
+ if (value !== null) {
15
+ attributeObject[attr] = el.getAttribute(attr);
16
+ }
17
+ el.removeAttribute(attr);
18
+ }
19
+ });
20
+ return attributeObject;
21
+ };
22
+ const ariaAttributes = [
23
+ 'role',
24
+ 'aria-activedescendant',
25
+ 'aria-atomic',
26
+ 'aria-autocomplete',
27
+ 'aria-braillelabel',
28
+ 'aria-brailleroledescription',
29
+ 'aria-busy',
30
+ 'aria-checked',
31
+ 'aria-colcount',
32
+ 'aria-colindex',
33
+ 'aria-colindextext',
34
+ 'aria-colspan',
35
+ 'aria-controls',
36
+ 'aria-current',
37
+ 'aria-describedby',
38
+ 'aria-description',
39
+ 'aria-details',
40
+ 'aria-disabled',
41
+ 'aria-errormessage',
42
+ 'aria-expanded',
43
+ 'aria-flowto',
44
+ 'aria-haspopup',
45
+ 'aria-hidden',
46
+ 'aria-invalid',
47
+ 'aria-keyshortcuts',
48
+ 'aria-label',
49
+ 'aria-labelledby',
50
+ 'aria-level',
51
+ 'aria-live',
52
+ 'aria-multiline',
53
+ 'aria-multiselectable',
54
+ 'aria-orientation',
55
+ 'aria-owns',
56
+ 'aria-placeholder',
57
+ 'aria-posinset',
58
+ 'aria-pressed',
59
+ 'aria-readonly',
60
+ 'aria-relevant',
61
+ 'aria-required',
62
+ 'aria-roledescription',
63
+ 'aria-rowcount',
64
+ 'aria-rowindex',
65
+ 'aria-rowindextext',
66
+ 'aria-rowspan',
67
+ 'aria-selected',
68
+ 'aria-setsize',
69
+ 'aria-sort',
70
+ 'aria-valuemax',
71
+ 'aria-valuemin',
72
+ 'aria-valuenow',
73
+ 'aria-valuetext',
74
+ ];
75
+ const inheritAriaAttributes = (el, ignoreList) => {
76
+ let attributesToInherit = ariaAttributes;
77
+ return inheritAttributes(el, attributesToInherit);
78
+ };
79
+ const raf = (h) => {
80
+ if (typeof __zone_symbol__requestAnimationFrame === 'function') {
81
+ return __zone_symbol__requestAnimationFrame(h);
82
+ }
83
+ if (typeof requestAnimationFrame === 'function') {
84
+ return requestAnimationFrame(h);
85
+ }
86
+ return setTimeout(h);
87
+ };
88
+ function getDeepActiveElement(root = document) {
89
+ let activeElement = root.activeElement;
90
+ if (!activeElement) {
91
+ return null;
92
+ }
93
+ while (activeElement?.shadowRoot) {
94
+ const next = activeElement.shadowRoot.activeElement;
95
+ if (!next) {
96
+ break;
97
+ }
98
+ activeElement = next;
99
+ }
100
+ return activeElement;
101
+ }
102
+ function canReceiveFocus(el) {
103
+ if (!el)
104
+ return false;
105
+ return (el instanceof HTMLElement && el.tabIndex >= 0 && !el.hasAttribute('disabled') && el.getAttribute('aria-hidden') !== 'true' && el.checkVisibility() && el.offsetParent !== null);
106
+ }
107
+ function findFormByRef(form, el) {
108
+ if (form instanceof HTMLFormElement) {
109
+ return form;
110
+ }
111
+ if (typeof form === 'string') {
112
+ const el = document.getElementById(form);
113
+ if (el) {
114
+ if (el instanceof HTMLFormElement) {
115
+ return el;
116
+ }
117
+ else {
118
+ console.warn(`No Form found with selector: "#${form}". Verify that the element with id exists and is actually a <form> element.`, el);
119
+ return null;
120
+ }
121
+ }
122
+ else {
123
+ console.warn(`No Form found with selector: "#${form}". Verify that the id is correct and the form is rendered in the DOM.`, el);
124
+ return null;
125
+ }
126
+ }
127
+ if (form !== undefined) {
128
+ console.warn(`The provided "form" element is invalid. Verify that the form is a HTMLFormElement and rendered in the DOM.`, el);
129
+ return null;
130
+ }
131
+ return el.closest('form');
132
+ }
133
+
134
+ export { canReceiveFocus as a, componentOnReady as c, findFormByRef as f, getDeepActiveElement as g, inheritAriaAttributes as i };
@@ -0,0 +1,29 @@
1
+ class ElementActivationController {
2
+ host;
3
+ config;
4
+ constructor(host, config) {
5
+ this.host = host;
6
+ this.config = config;
7
+ }
8
+ hostDidLoad() {
9
+ if (!this.host.el.hasAttribute('tabindex')) {
10
+ console.warn('Interactive element does not have a tabindex attribute!', this.host.el);
11
+ }
12
+ this.host.el.addEventListener('keydown', this.handleKeyDown.bind(this));
13
+ this.host.el.addEventListener('click', this.handleActivation.bind(this));
14
+ }
15
+ handleKeyDown = (event) => {
16
+ if ((this.config?.keys ?? ['Enter', ' ']).includes(event.key)) {
17
+ event.preventDefault();
18
+ this.handleActivation(event);
19
+ }
20
+ };
21
+ handleActivation = (event) => {
22
+ this.host.lmvzActivation.emit();
23
+ if (this.config?.localHandler) {
24
+ this.config.localHandler(event);
25
+ }
26
+ };
27
+ }
28
+
29
+ export { ElementActivationController as E };