@watermarkinsights/ripple 5.3.0-9 → 5.3.1-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 (361) hide show
  1. package/dist/cjs/{chartFunctions-86227b27.js → chartFunctions-0238043b.js} +3 -3
  2. package/dist/cjs/{functions-05e7ad5a.js → functions-3be85c6d.js} +7 -104
  3. package/dist/{esm/app-globals-17afed20.js → cjs/global-c7fa7be9.js} +2 -7
  4. package/dist/cjs/index-e86c28b6.js +2641 -0
  5. package/dist/cjs/{intl-2b550151.js → intl-567eb9d8.js} +1 -1
  6. package/dist/cjs/loader.cjs.js +3 -4
  7. package/dist/cjs/priv-calendar.cjs.entry.js +26 -27
  8. package/dist/cjs/priv-chart-popover.cjs.entry.js +17 -16
  9. package/dist/cjs/priv-navigator-button.cjs.entry.js +3 -4
  10. package/dist/cjs/priv-navigator-item.cjs.entry.js +3 -4
  11. package/dist/cjs/ripple.cjs.js +11 -12
  12. package/dist/cjs/wm-action-menu_2.cjs.entry.js +6 -8
  13. package/dist/cjs/wm-button.cjs.entry.js +4 -5
  14. package/dist/cjs/wm-chart-slice.cjs.entry.js +1 -1
  15. package/dist/cjs/wm-chart.cjs.entry.js +6 -7
  16. package/dist/cjs/wm-date-range.cjs.entry.js +12 -14
  17. package/dist/cjs/wm-datepicker.cjs.entry.js +7 -8
  18. package/dist/cjs/wm-file-list.cjs.entry.js +3 -4
  19. package/dist/cjs/wm-file.cjs.entry.js +4 -5
  20. package/dist/cjs/wm-input.cjs.entry.js +5 -6
  21. package/dist/cjs/wm-line-chart.cjs.entry.js +14 -15
  22. package/dist/cjs/wm-modal-footer.cjs.entry.js +3 -4
  23. package/dist/cjs/wm-modal-header.cjs.entry.js +5 -6
  24. package/dist/cjs/wm-modal.cjs.entry.js +5 -6
  25. package/dist/cjs/wm-navigation_3.cjs.entry.js +10 -13
  26. package/dist/cjs/wm-navigator.cjs.entry.js +3 -4
  27. package/dist/cjs/wm-option_2.cjs.entry.js +8 -10
  28. package/dist/cjs/wm-pagination.cjs.entry.js +4 -5
  29. package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +7 -9
  30. package/dist/cjs/wm-search.cjs.entry.js +6 -7
  31. package/dist/cjs/wm-snackbar.cjs.entry.js +42 -33
  32. package/dist/cjs/wm-tab-item_3.cjs.entry.js +8 -11
  33. package/dist/cjs/wm-tag-input.cjs.entry.js +7 -8
  34. package/dist/cjs/wm-tag-option.cjs.entry.js +2 -2
  35. package/dist/cjs/wm-textarea.cjs.entry.js +5 -6
  36. package/dist/cjs/wm-timepicker.cjs.entry.js +5 -6
  37. package/dist/cjs/wm-toggletip.cjs.entry.js +5 -6
  38. package/dist/cjs/wm-uploader.cjs.entry.js +6 -7
  39. package/dist/cjs/wm-wrapper.cjs.entry.js +1 -1
  40. package/dist/collection/collection-manifest.json +2 -2
  41. package/dist/collection/components/charts/chartFunctions.js +1 -1
  42. package/dist/collection/components/charts/chartFunctions.spec.js +16 -0
  43. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.e2e.js +81 -0
  44. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +14 -12
  45. package/dist/collection/components/charts/screenshots.e2e.js +96 -0
  46. package/dist/collection/components/charts/wm-chart/wm-chart.e2e.js +213 -0
  47. package/dist/collection/components/charts/wm-chart/wm-chart.js +1 -1
  48. package/dist/collection/components/charts/wm-chart/wm-chart.spec.js +37 -0
  49. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.e2e.js +176 -0
  50. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.js +9 -9
  51. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.spec.js +163 -0
  52. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +1 -1
  53. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.e2e.js +69 -0
  54. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +1 -1
  55. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.spec.js +79 -0
  56. package/dist/collection/components/datepickers/priv-calendar/priv-calendar.css +23 -17
  57. package/dist/collection/components/datepickers/priv-calendar/priv-calendar.js +22 -22
  58. package/dist/collection/components/datepickers/priv-calendar/priv-calendar.spec.js +89 -0
  59. package/dist/collection/components/datepickers/wm-date-range.e2e.js +443 -0
  60. package/dist/collection/components/datepickers/wm-date-range.js +17 -22
  61. package/dist/collection/components/datepickers/wm-date-range.spec.js +22 -0
  62. package/dist/collection/components/datepickers/wm-datepicker.e2e.js +382 -0
  63. package/dist/collection/components/datepickers/wm-datepicker.js +12 -16
  64. package/dist/collection/components/datepickers/wm-datepicker.spec.js +21 -0
  65. package/dist/collection/components/wm-action-menu/wm-action-menu.e2e.js +200 -0
  66. package/dist/collection/components/wm-action-menu/wm-action-menu.js +1 -1
  67. package/dist/collection/components/wm-action-menu/wm-action-menu.spec.js +48 -0
  68. package/dist/collection/components/wm-button/wm-button.e2e.js +55 -0
  69. package/dist/collection/components/wm-button/wm-button.js +1 -1
  70. package/dist/collection/components/wm-button/wm-button.spec.js +74 -0
  71. package/dist/collection/components/wm-file/wm-file.js +1 -1
  72. package/dist/collection/components/wm-file/wm-file.spec.js +194 -0
  73. package/dist/collection/components/wm-file-list/wm-file-list.js +1 -1
  74. package/dist/collection/components/wm-file-list/wm-file-list.spec.js +69 -0
  75. package/dist/collection/components/wm-input/wm-input.e2e.js +32 -0
  76. package/dist/collection/components/wm-input/wm-input.js +1 -1
  77. package/dist/collection/components/wm-input/wm-input.spec.js +173 -0
  78. package/dist/collection/components/wm-menuitem/wm-menuitem.e2e.js +23 -0
  79. package/dist/collection/components/wm-menuitem/wm-menuitem.js +1 -1
  80. package/dist/collection/components/wm-menuitem/wm-menuitem.spec.js +54 -0
  81. package/dist/collection/components/wm-modal/wm-modal-footer.js +1 -1
  82. package/dist/collection/components/wm-modal/wm-modal-footer.spec.js +11 -0
  83. package/dist/collection/components/wm-modal/wm-modal-header.js +1 -1
  84. package/dist/collection/components/wm-modal/wm-modal-header.spec.js +8 -0
  85. package/dist/collection/components/wm-modal/wm-modal.e2e.js +104 -0
  86. package/dist/collection/components/wm-modal/wm-modal.js +2 -2
  87. package/dist/collection/components/wm-modal/wm-modal.spec.js +30 -0
  88. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +1 -1
  89. package/dist/collection/components/wm-navigation/wm-navigation-item.js +1 -1
  90. package/dist/collection/components/wm-navigation/wm-navigation.e2e.js +102 -0
  91. package/dist/collection/components/wm-navigation/wm-navigation.js +2 -2
  92. package/dist/collection/components/wm-navigation/wm-navigation.spec.js +91 -0
  93. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.e2e.js +50 -0
  94. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +1 -1
  95. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +1 -1
  96. package/dist/collection/components/wm-navigator/wm-navigator.e2e.js +209 -0
  97. package/dist/collection/components/wm-navigator/wm-navigator.spec.js +177 -0
  98. package/dist/collection/components/wm-option/wm-option.e2e.js +22 -0
  99. package/dist/collection/components/wm-option/wm-option.js +1 -1
  100. package/dist/collection/components/wm-option/wm-option.spec.js +63 -0
  101. package/dist/collection/components/wm-pagination/wm-pagination.e2e.js +312 -0
  102. package/dist/collection/components/wm-pagination/wm-pagination.js +1 -1
  103. package/dist/collection/components/wm-search/wm-search.e2e.js +76 -0
  104. package/dist/collection/components/wm-search/wm-search.js +4 -5
  105. package/dist/collection/components/wm-search/wm-search.spec.js +71 -0
  106. package/dist/collection/components/wm-select/wm-select.e2e.js +521 -0
  107. package/dist/collection/components/wm-select/wm-select.js +2 -2
  108. package/dist/collection/components/wm-select/wm-select.spec.js +271 -0
  109. package/dist/collection/components/wm-snackbar/wm-snackbar.css +40 -21
  110. package/dist/collection/components/wm-snackbar/wm-snackbar.e2e.js +112 -0
  111. package/dist/collection/components/wm-snackbar/wm-snackbar.js +37 -27
  112. package/dist/collection/components/wm-snackbar/wm-snackbar.spec.js +9 -0
  113. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +1 -1
  114. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +1 -1
  115. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +1 -1
  116. package/dist/collection/components/wm-tabs/wm-tabs.e2e.js +91 -0
  117. package/dist/collection/components/wm-tabs/wm-tabs.spec.js +12 -0
  118. package/dist/collection/components/wm-tag-input/wm-tag-input.e2e.js +204 -0
  119. package/dist/collection/components/wm-tag-input/wm-tag-input.js +3 -3
  120. package/dist/collection/components/wm-tag-input/wm-tag-input.spec.js +195 -0
  121. package/dist/collection/components/wm-textarea/wm-textarea.e2e.js +41 -0
  122. package/dist/collection/components/wm-textarea/wm-textarea.js +1 -1
  123. package/dist/collection/components/wm-textarea/wm-textarea.spec.js +79 -0
  124. package/dist/collection/components/wm-timepicker/wm-timepicker.e2e.js +163 -0
  125. package/dist/collection/components/wm-timepicker/wm-timepicker.js +8 -11
  126. package/dist/collection/components/wm-timepicker/wm-timepicker.spec.js +147 -0
  127. package/dist/collection/components/wm-toggletip/wm-toggletip.e2e.js +69 -0
  128. package/dist/collection/components/wm-toggletip/wm-toggletip.js +2 -2
  129. package/dist/collection/components/wm-toggletip/wm-toggletip.spec.js +21 -0
  130. package/dist/collection/components/wm-uploader/wm-uploader.e2e.js +70 -0
  131. package/dist/collection/components/wm-uploader/wm-uploader.js +2 -2
  132. package/dist/collection/components/wm-uploader/wm-uploader.spec.js +234 -0
  133. package/dist/collection/global/functions.spec.js +126 -0
  134. package/dist/collection/lang/lang.spec.js +20 -0
  135. package/dist/esm/{chartFunctions-da985798.js → chartFunctions-036fdb89.js} +3 -3
  136. package/dist/esm/{functions-25781571.js → functions-46843ea0.js} +8 -105
  137. package/dist/{cjs/app-globals-4606bf8f.js → esm/global-56d6c80b.js} +1 -10
  138. package/dist/esm/index-558b5a82.js +2610 -0
  139. package/dist/esm/{intl-df3d34d1.js → intl-8b8740b9.js} +1 -1
  140. package/dist/esm/loader.js +4 -5
  141. package/dist/esm/polyfills/core-js.js +0 -0
  142. package/dist/esm/polyfills/dom.js +0 -0
  143. package/dist/esm/polyfills/es5-html-element.js +0 -0
  144. package/dist/esm/polyfills/index.js +0 -0
  145. package/dist/esm/polyfills/system.js +0 -0
  146. package/dist/esm/priv-calendar.entry.js +26 -27
  147. package/dist/esm/priv-chart-popover.entry.js +17 -16
  148. package/dist/esm/priv-navigator-button.entry.js +3 -4
  149. package/dist/esm/priv-navigator-item.entry.js +3 -4
  150. package/dist/esm/ripple.js +12 -13
  151. package/dist/esm/wm-action-menu_2.entry.js +6 -8
  152. package/dist/esm/wm-button.entry.js +4 -5
  153. package/dist/esm/wm-chart-slice.entry.js +1 -1
  154. package/dist/esm/wm-chart.entry.js +6 -7
  155. package/dist/esm/wm-date-range.entry.js +12 -14
  156. package/dist/esm/wm-datepicker.entry.js +7 -8
  157. package/dist/esm/wm-file-list.entry.js +3 -4
  158. package/dist/esm/wm-file.entry.js +4 -5
  159. package/dist/esm/wm-input.entry.js +5 -6
  160. package/dist/esm/wm-line-chart.entry.js +14 -15
  161. package/dist/esm/wm-modal-footer.entry.js +3 -4
  162. package/dist/esm/wm-modal-header.entry.js +5 -6
  163. package/dist/esm/wm-modal.entry.js +5 -6
  164. package/dist/esm/wm-navigation_3.entry.js +10 -13
  165. package/dist/esm/wm-navigator.entry.js +3 -4
  166. package/dist/esm/wm-option_2.entry.js +8 -10
  167. package/dist/esm/wm-pagination.entry.js +4 -5
  168. package/dist/esm/wm-progress-indicator_3.entry.js +7 -9
  169. package/dist/esm/wm-search.entry.js +6 -7
  170. package/dist/esm/wm-snackbar.entry.js +42 -33
  171. package/dist/esm/wm-tab-item_3.entry.js +8 -11
  172. package/dist/esm/wm-tag-input.entry.js +7 -8
  173. package/dist/esm/wm-tag-option.entry.js +2 -2
  174. package/dist/esm/wm-textarea.entry.js +5 -6
  175. package/dist/esm/wm-timepicker.entry.js +5 -6
  176. package/dist/esm/wm-toggletip.entry.js +5 -6
  177. package/dist/esm/wm-uploader.entry.js +6 -7
  178. package/dist/esm/wm-wrapper.entry.js +1 -1
  179. package/dist/esm-es5/{chartFunctions-da985798.js → chartFunctions-036fdb89.js} +1 -1
  180. package/dist/esm-es5/functions-46843ea0.js +1 -0
  181. package/dist/esm-es5/global-56d6c80b.js +1 -0
  182. package/dist/esm-es5/index-558b5a82.js +1 -0
  183. package/dist/esm-es5/{intl-df3d34d1.js → intl-8b8740b9.js} +1 -1
  184. package/dist/esm-es5/loader.js +1 -1
  185. package/dist/esm-es5/priv-calendar.entry.js +1 -1
  186. package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
  187. package/dist/esm-es5/priv-navigator-button.entry.js +1 -1
  188. package/dist/esm-es5/priv-navigator-item.entry.js +1 -1
  189. package/dist/esm-es5/ripple.js +1 -1
  190. package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
  191. package/dist/esm-es5/wm-button.entry.js +1 -1
  192. package/dist/esm-es5/wm-chart-slice.entry.js +1 -1
  193. package/dist/esm-es5/wm-chart.entry.js +1 -1
  194. package/dist/esm-es5/wm-date-range.entry.js +1 -1
  195. package/dist/esm-es5/wm-datepicker.entry.js +1 -1
  196. package/dist/esm-es5/wm-file-list.entry.js +1 -1
  197. package/dist/esm-es5/wm-file.entry.js +1 -1
  198. package/dist/esm-es5/wm-input.entry.js +1 -1
  199. package/dist/esm-es5/wm-line-chart.entry.js +1 -1
  200. package/dist/esm-es5/wm-modal-footer.entry.js +1 -1
  201. package/dist/esm-es5/wm-modal-header.entry.js +1 -1
  202. package/dist/esm-es5/wm-modal.entry.js +1 -1
  203. package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
  204. package/dist/esm-es5/wm-navigator.entry.js +1 -1
  205. package/dist/esm-es5/wm-option_2.entry.js +1 -1
  206. package/dist/esm-es5/wm-pagination.entry.js +1 -1
  207. package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
  208. package/dist/esm-es5/wm-search.entry.js +1 -1
  209. package/dist/esm-es5/wm-snackbar.entry.js +1 -1
  210. package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
  211. package/dist/esm-es5/wm-tag-input.entry.js +1 -1
  212. package/dist/esm-es5/wm-tag-option.entry.js +1 -1
  213. package/dist/esm-es5/wm-textarea.entry.js +1 -1
  214. package/dist/esm-es5/wm-timepicker.entry.js +1 -1
  215. package/dist/esm-es5/wm-toggletip.entry.js +1 -1
  216. package/dist/esm-es5/wm-uploader.entry.js +1 -1
  217. package/dist/esm-es5/wm-wrapper.entry.js +1 -1
  218. package/dist/loader/cdn.js +2 -1
  219. package/dist/loader/index.cjs.js +2 -1
  220. package/dist/loader/index.d.ts +0 -3
  221. package/dist/loader/index.es2017.js +2 -1
  222. package/dist/loader/index.js +2 -1
  223. package/dist/ripple/p-09a31f0c.entry.js +1 -0
  224. package/dist/ripple/p-0aa17cac.entry.js +1 -0
  225. package/dist/ripple/p-0dc51fad.entry.js +1 -0
  226. package/dist/ripple/p-0ea8609b.system.entry.js +1 -0
  227. package/dist/ripple/{p-a9d89ac8.system.js → p-1ac66a15.system.js} +1 -1
  228. package/dist/ripple/p-22ed3b52.system.js +1 -0
  229. package/dist/ripple/p-240124b0.system.entry.js +1 -0
  230. package/dist/ripple/p-26fbc7f5.system.entry.js +1 -0
  231. package/dist/ripple/p-294b38ca.system.entry.js +1 -0
  232. package/dist/ripple/p-2b05bf05.entry.js +1 -0
  233. package/dist/ripple/{p-72bdebb5.system.entry.js → p-2ba7e68e.system.entry.js} +1 -1
  234. package/dist/ripple/p-311923b2.system.entry.js +1 -0
  235. package/dist/ripple/p-3183bba8.entry.js +1 -0
  236. package/dist/ripple/p-31976813.entry.js +1 -0
  237. package/dist/ripple/{p-823d7b4e.system.entry.js → p-32bf3f5b.system.entry.js} +1 -1
  238. package/dist/ripple/p-33679b9d.entry.js +1 -0
  239. package/dist/ripple/p-34b5830f.system.js +1 -0
  240. package/dist/ripple/p-3568472c.entry.js +1 -0
  241. package/dist/ripple/p-359d45dc.entry.js +1 -0
  242. package/dist/ripple/{p-67a7f0b0.entry.js → p-3a44e1c8.entry.js} +1 -1
  243. package/dist/ripple/{p-672ae2cb.entry.js → p-42d1c301.entry.js} +1 -1
  244. package/dist/ripple/{p-041e579b.entry.js → p-45abd8fe.entry.js} +1 -1
  245. package/dist/ripple/{p-13b1d775.entry.js → p-48e09589.entry.js} +1 -1
  246. package/dist/ripple/p-4e56f3f5.system.entry.js +1 -0
  247. package/dist/ripple/{p-9f06ed3b.system.entry.js → p-5029fcd8.system.entry.js} +1 -1
  248. package/dist/ripple/p-568c595f.js +2 -0
  249. package/dist/ripple/p-591918a4.entry.js +1 -0
  250. package/dist/ripple/{p-bee8ab6e.entry.js → p-624a2812.entry.js} +1 -1
  251. package/dist/ripple/p-62a8f09c.entry.js +1 -0
  252. package/dist/ripple/{p-043901ab.system.entry.js → p-65d26233.system.entry.js} +1 -1
  253. package/dist/ripple/p-75ba63ba.entry.js +1 -0
  254. package/dist/ripple/{p-ac40417b.system.entry.js → p-79106e23.system.entry.js} +1 -1
  255. package/dist/ripple/p-7e6f5a1e.system.entry.js +1 -0
  256. package/dist/ripple/p-8029af07.system.entry.js +1 -0
  257. package/dist/ripple/{p-8e72de50.entry.js → p-8159cdf5.entry.js} +1 -1
  258. package/dist/ripple/p-822618d7.entry.js +1 -0
  259. package/dist/ripple/p-86d655fb.system.entry.js +1 -0
  260. package/dist/ripple/p-884294c6.entry.js +1 -0
  261. package/dist/ripple/{p-cd0cc88d.entry.js → p-88ebddd7.entry.js} +1 -1
  262. package/dist/ripple/p-8fbddb6c.system.entry.js +1 -0
  263. package/dist/ripple/p-902a54c5.entry.js +1 -0
  264. package/dist/ripple/p-905dd4da.system.entry.js +1 -0
  265. package/dist/ripple/{p-aab56a37.system.entry.js → p-a152cf3a.system.entry.js} +1 -1
  266. package/dist/ripple/{p-468a0218.entry.js → p-a37cf34a.entry.js} +1 -1
  267. package/dist/ripple/p-a8524a48.entry.js +1 -0
  268. package/dist/ripple/p-ab8d78cc.system.js +2 -0
  269. package/dist/ripple/p-afe08b14.entry.js +1 -0
  270. package/dist/ripple/p-b2214a37.system.js +1 -0
  271. package/dist/ripple/{p-6fe35d1e.system.entry.js → p-b7ead395.system.entry.js} +1 -1
  272. package/dist/ripple/p-bc5e9d24.entry.js +1 -0
  273. package/dist/ripple/p-c3ac0ad7.system.entry.js +1 -0
  274. package/dist/ripple/p-c4b9d46d.entry.js +1 -0
  275. package/dist/ripple/p-c885c7f9.entry.js +1 -0
  276. package/dist/ripple/p-c91b10f3.system.entry.js +1 -0
  277. package/dist/ripple/p-c9543950.system.entry.js +1 -0
  278. package/dist/ripple/p-cacfbaf1.system.entry.js +1 -0
  279. package/dist/ripple/{p-2e3728f1.entry.js → p-cc4a429b.entry.js} +1 -1
  280. package/dist/ripple/p-ce9a8bd1.entry.js +1 -0
  281. package/dist/ripple/p-d24882a7.system.entry.js +1 -0
  282. package/dist/ripple/p-d33d6e96.system.entry.js +1 -0
  283. package/dist/ripple/{p-777b8ebc.system.js → p-d4b209ec.system.js} +1 -1
  284. package/dist/ripple/{p-f54e9ed0.js → p-d79fdf0b.js} +1 -1
  285. package/dist/ripple/{p-fcf76854.js → p-d837c1f5.js} +1 -1
  286. package/dist/ripple/{p-d93c51dd.system.entry.js → p-df1a11f1.system.entry.js} +1 -1
  287. package/dist/ripple/p-df2560f3.system.entry.js +1 -0
  288. package/dist/ripple/p-e3bcdde8.system.entry.js +1 -0
  289. package/dist/ripple/p-e3de5bbd.system.entry.js +1 -0
  290. package/dist/ripple/p-e7a64841.system.entry.js +1 -0
  291. package/dist/ripple/p-e83a98d3.entry.js +1 -0
  292. package/dist/ripple/p-e995f7f0.js +1 -0
  293. package/dist/ripple/p-eaac6bcd.entry.js +1 -0
  294. package/dist/ripple/p-f67fd802.system.entry.js +1 -0
  295. package/dist/ripple/p-fd9cb5b7.js +1 -0
  296. package/dist/ripple/p-fe8d02c3.system.entry.js +1 -0
  297. package/dist/ripple/{p-b0c566b5.system.entry.js → p-ffb31979.system.entry.js} +1 -1
  298. package/dist/ripple/ripple.esm.js +1 -1
  299. package/dist/ripple/ripple.js +1 -1
  300. package/dist/types/components/charts/priv-chart-popover/priv-chart-popover.d.ts +1 -2
  301. package/dist/types/components/wm-snackbar/wm-snackbar.d.ts +2 -2
  302. package/dist/types/stencil-public-runtime.d.ts +10 -3
  303. package/package.json +1 -1
  304. package/dist/cjs/index-788526f5.js +0 -1851
  305. package/dist/esm/index-130e07bb.js +0 -1820
  306. package/dist/esm-es5/app-globals-17afed20.js +0 -1
  307. package/dist/esm-es5/functions-25781571.js +0 -1
  308. package/dist/esm-es5/index-130e07bb.js +0 -1
  309. package/dist/ripple/p-0abc9300.entry.js +0 -1
  310. package/dist/ripple/p-0af94825.entry.js +0 -1
  311. package/dist/ripple/p-0ff41567.system.entry.js +0 -1
  312. package/dist/ripple/p-13fc2164.entry.js +0 -1
  313. package/dist/ripple/p-155224a2.system.entry.js +0 -1
  314. package/dist/ripple/p-1f09134c.entry.js +0 -1
  315. package/dist/ripple/p-298c2675.entry.js +0 -1
  316. package/dist/ripple/p-31781d88.system.entry.js +0 -1
  317. package/dist/ripple/p-31d7ecf9.system.entry.js +0 -1
  318. package/dist/ripple/p-341ebafa.entry.js +0 -1
  319. package/dist/ripple/p-35f209d9.system.entry.js +0 -1
  320. package/dist/ripple/p-376efca9.entry.js +0 -1
  321. package/dist/ripple/p-3b5f4364.system.entry.js +0 -1
  322. package/dist/ripple/p-418ed08c.system.entry.js +0 -1
  323. package/dist/ripple/p-4670ccb4.system.js +0 -1
  324. package/dist/ripple/p-488e1690.entry.js +0 -1
  325. package/dist/ripple/p-4978eebe.entry.js +0 -1
  326. package/dist/ripple/p-4b7a444c.system.entry.js +0 -1
  327. package/dist/ripple/p-4baaf026.entry.js +0 -1
  328. package/dist/ripple/p-56766bb2.entry.js +0 -1
  329. package/dist/ripple/p-5caaf651.system.entry.js +0 -1
  330. package/dist/ripple/p-5ece78e5.system.entry.js +0 -1
  331. package/dist/ripple/p-681c5f0f.system.entry.js +0 -1
  332. package/dist/ripple/p-691ecf14.entry.js +0 -1
  333. package/dist/ripple/p-6d0e5159.system.entry.js +0 -1
  334. package/dist/ripple/p-6d56676e.system.entry.js +0 -1
  335. package/dist/ripple/p-71a18f64.entry.js +0 -1
  336. package/dist/ripple/p-737c7172.system.js +0 -1
  337. package/dist/ripple/p-74ee1ed1.js +0 -1
  338. package/dist/ripple/p-799d06ad.system.entry.js +0 -1
  339. package/dist/ripple/p-7eab6bea.system.entry.js +0 -1
  340. package/dist/ripple/p-7fb95b89.entry.js +0 -1
  341. package/dist/ripple/p-85cbeb7d.system.entry.js +0 -1
  342. package/dist/ripple/p-88cfd58d.js +0 -1
  343. package/dist/ripple/p-8d075bcf.system.entry.js +0 -1
  344. package/dist/ripple/p-a2b807ba.system.entry.js +0 -1
  345. package/dist/ripple/p-a2bbb62d.entry.js +0 -1
  346. package/dist/ripple/p-a62e7532.entry.js +0 -1
  347. package/dist/ripple/p-b7307be6.system.entry.js +0 -1
  348. package/dist/ripple/p-c2181de0.entry.js +0 -1
  349. package/dist/ripple/p-ca76dc92.entry.js +0 -1
  350. package/dist/ripple/p-cef8a45b.system.js +0 -2
  351. package/dist/ripple/p-d00b8233.system.js +0 -1
  352. package/dist/ripple/p-d5ba9de1.system.entry.js +0 -1
  353. package/dist/ripple/p-d9da0502.js +0 -2
  354. package/dist/ripple/p-db10990a.entry.js +0 -1
  355. package/dist/ripple/p-e2fe86a7.system.entry.js +0 -1
  356. package/dist/ripple/p-e85b1f40.entry.js +0 -1
  357. package/dist/ripple/p-ea0dfadf.system.entry.js +0 -1
  358. package/dist/ripple/p-eb14b354.entry.js +0 -1
  359. package/dist/ripple/p-f17fd62b.entry.js +0 -1
  360. package/dist/ripple/p-fabe4ca4.entry.js +0 -1
  361. package/dist/ripple/p-fbaae34d.system.entry.js +0 -1
@@ -0,0 +1,271 @@
1
+ import { newSpecPage } from "@stencil/core/testing";
2
+ import * as globalFuncs from "../../global/functions";
3
+ jest.spyOn(globalFuncs, "getTextDir").mockImplementation(() => "rtl");
4
+ import { Select } from "./wm-select";
5
+ import { Option } from "../wm-option/wm-option";
6
+ // mock MutationObserver
7
+ global.MutationObserver = jest.fn().mockImplementation(() => ({
8
+ observe: jest.fn(),
9
+ unobserve: jest.fn(),
10
+ disconnect: jest.fn(),
11
+ }));
12
+ describe("wm-select", () => {
13
+ it("builds", async () => {
14
+ const comp = await newSpecPage({
15
+ components: [Select, Option],
16
+ html: '<wm-select label="mock label"><wm-option selected></wm-option></wm-select>',
17
+ });
18
+ expect(comp.root).toMatchSnapshot();
19
+ });
20
+ it("has the right props", () => {
21
+ const select = new Select();
22
+ expect(select).toHaveProperty("label");
23
+ expect(select).toHaveProperty("labelPosition");
24
+ expect(select).toHaveProperty("maxHeight");
25
+ expect(select).toHaveProperty("requiredField");
26
+ expect(select).toHaveProperty("errorMessage");
27
+ expect(select).toHaveProperty("disabled");
28
+ expect(select).toHaveProperty("multiple");
29
+ expect(select).toHaveProperty("search");
30
+ expect(select).toHaveProperty("selectAll");
31
+ expect(select).toHaveProperty("placeholder");
32
+ expect(select).toHaveProperty("isExpanded");
33
+ expect(select).toHaveProperty("childOptions");
34
+ expect(select).toHaveProperty("keysSoFar");
35
+ expect(select).toHaveProperty("searchIndex");
36
+ });
37
+ it("has the right roles", async () => {
38
+ const page = await newSpecPage({
39
+ components: [Select, Option],
40
+ html: '<wm-select id="random-id" search label="mock label"><wm-option selected>First option</wm-option></wm-select>',
41
+ });
42
+ const searchFieldEl = await page.root.shadowRoot.querySelector(".searchfield");
43
+ const listboxEl = await page.root.shadowRoot.querySelector("#list");
44
+ expect(listboxEl).toEqualAttribute("role", "listbox");
45
+ expect(listboxEl).not.toHaveAttribute("aria-multiselectable"); // only multiselect
46
+ expect(searchFieldEl).toEqualAttribute("role", "combobox");
47
+ });
48
+ it("multiselect has multiselectable aria attr", async () => {
49
+ const page = await newSpecPage({
50
+ components: [Select, Option],
51
+ html: '<wm-select multiple label="mock label"><wm-option>1</wm-option></wm-select>',
52
+ });
53
+ const listboxEl = await page.root.shadowRoot.querySelector("#list");
54
+ expect(listboxEl).toHaveAttribute("aria-multiselectable");
55
+ });
56
+ it("displays error message", async () => {
57
+ const page = await newSpecPage({
58
+ components: [Select, Option],
59
+ html: '<wm-select error-message="test error" label="mock label"><wm-option selected></wm-option></wm-select>',
60
+ });
61
+ const errorMessage = await page.root.shadowRoot.querySelector(".error-message");
62
+ expect(errorMessage.textContent).toBe("test error");
63
+ });
64
+ it("adapts options correctly - multiselect", async () => {
65
+ const page = await newSpecPage({
66
+ components: [Select, Option],
67
+ html: '<wm-select multiple label="mock label"><wm-option></wm-option></wm-select>',
68
+ });
69
+ const option = await page.root.querySelector("wm-option");
70
+ expect(option === null || option === void 0 ? void 0 : option.classList.contains("multi-option")).toBe(true);
71
+ });
72
+ describe("reacts to wm-option events", () => {
73
+ it("handles option Enter", () => {
74
+ // handleChildEnter
75
+ const component = new Select();
76
+ const mockClose = (component.close = jest.fn());
77
+ component.handleChildEnter();
78
+ expect(mockClose).toHaveBeenCalledTimes(1);
79
+ jest.restoreAllMocks();
80
+ });
81
+ it("handles option Up", () => {
82
+ // handleChildUp
83
+ const component = new Select();
84
+ const mockMoveUp = (component.moveUp = jest.fn());
85
+ const optionEl = document.createElement("option");
86
+ const event = { detail: optionEl };
87
+ component.handleChildUp(event);
88
+ expect(mockMoveUp).toHaveBeenCalledTimes(1);
89
+ expect(mockMoveUp).toHaveBeenCalledWith(optionEl);
90
+ jest.restoreAllMocks();
91
+ });
92
+ it("handles option Down", () => {
93
+ // handleChildDown
94
+ const component = new Select();
95
+ const mockMoveDown = (component.moveDown = jest.fn());
96
+ const optionEl = document.createElement("option");
97
+ const event = { detail: optionEl };
98
+ component.handleChildDown(event);
99
+ expect(mockMoveDown).toHaveBeenCalledTimes(1);
100
+ expect(mockMoveDown).toHaveBeenCalledWith(optionEl);
101
+ jest.restoreAllMocks();
102
+ });
103
+ it("handles option Home", () => {
104
+ // moveToFirstOption
105
+ const component = new Select();
106
+ const mockFocusOption = (component.focusOption = jest.fn());
107
+ const option1 = document.createElement("option");
108
+ option1.textContent = "1";
109
+ const option2 = document.createElement("option");
110
+ option2.textContent = "2";
111
+ const option3 = document.createElement("option");
112
+ option3.textContent = "3";
113
+ jest
114
+ .spyOn(component, "visibleOptionEls", "get")
115
+ // @ts-ignore
116
+ .mockReturnValue([option1, option2, option3]);
117
+ component.moveToFirstOption();
118
+ expect(mockFocusOption).toHaveBeenCalledTimes(1);
119
+ expect(mockFocusOption).toHaveBeenCalledWith(option1);
120
+ jest.restoreAllMocks();
121
+ });
122
+ it("handles option End", () => {
123
+ // moveToLastOption
124
+ const component = new Select();
125
+ const mockFocusOption = (component.focusOption = jest.fn());
126
+ const option1 = document.createElement("option");
127
+ option1.textContent = "1";
128
+ const option2 = document.createElement("option");
129
+ option2.textContent = "2";
130
+ const option3 = document.createElement("option");
131
+ option3.textContent = "3";
132
+ jest
133
+ .spyOn(component, "visibleOptionEls", "get")
134
+ // @ts-ignore
135
+ .mockReturnValue([option1, option2, option3]);
136
+ component.moveToLastOption();
137
+ expect(mockFocusOption).toHaveBeenCalledTimes(1);
138
+ expect(mockFocusOption).toHaveBeenCalledWith(option3);
139
+ jest.restoreAllMocks();
140
+ });
141
+ it("handles option Escape", () => {
142
+ // closePopupOnEscape
143
+ const component = new Select();
144
+ const mockClose = (component.close = jest.fn());
145
+ component.closePopupOnEscape();
146
+ expect(mockClose).toHaveBeenCalledTimes(1);
147
+ expect(mockClose).toHaveBeenCalledWith();
148
+ jest.restoreAllMocks();
149
+ });
150
+ it("handles option Blur", () => {
151
+ // handleOptionBlur
152
+ const component = new Select();
153
+ const blurObserver = jest.fn();
154
+ const fakeTarget = document.createElement("div");
155
+ component.el.addEventListener("blur", blurObserver);
156
+ component.handleOptionBlur({ detail: { relatedTarget: component.el } });
157
+ expect(blurObserver).toHaveBeenCalledTimes(0);
158
+ jest.clearAllMocks();
159
+ component.handleOptionBlur({ detail: { relatedTarget: fakeTarget } });
160
+ expect(blurObserver).toHaveBeenCalledTimes(1);
161
+ expect(blurObserver.mock.calls[0][0].relatedTarget).toStrictEqual(fakeTarget);
162
+ jest.clearAllMocks();
163
+ jest.restoreAllMocks();
164
+ });
165
+ });
166
+ it("prevent button blur", () => {
167
+ const component = new Select();
168
+ const mockStopPropagation = jest.fn();
169
+ const event = { stopPropagation: mockStopPropagation };
170
+ const fakeTarget = document.createElement("div");
171
+ // @ts-ignore
172
+ event.relatedTarget = fakeTarget;
173
+ component.handleButtonBlur(event);
174
+ expect(mockStopPropagation).toHaveBeenCalledTimes(0);
175
+ jest.clearAllMocks();
176
+ // @ts-ignore
177
+ event.relatedTarget = component.el;
178
+ component.handleButtonBlur(event);
179
+ expect(mockStopPropagation).toHaveBeenCalledTimes(1);
180
+ jest.clearAllMocks();
181
+ jest.restoreAllMocks();
182
+ });
183
+ it("handles keydowns", () => {
184
+ const component = new Select();
185
+ const mockPreventDefault = jest.fn();
186
+ const event = { preventDefault: mockPreventDefault, key: "" };
187
+ const mockOpen = (component.open = jest.fn());
188
+ // @ts-ignore
189
+ event.key = "ArrowDown";
190
+ component.isExpanded = false;
191
+ component.handleKey(event);
192
+ expect(mockPreventDefault).toHaveBeenCalledTimes(1);
193
+ expect(mockOpen).toHaveBeenCalledTimes(1);
194
+ expect(mockOpen).toHaveBeenCalledWith("next");
195
+ jest.clearAllMocks();
196
+ component.isExpanded = true;
197
+ component.handleKey(event);
198
+ expect(mockPreventDefault).toHaveBeenCalledTimes(0);
199
+ expect(mockOpen).toHaveBeenCalledTimes(0);
200
+ jest.clearAllMocks();
201
+ // @ts-ignore
202
+ event.key = "ArrowUp";
203
+ component.isExpanded = false;
204
+ component.handleKey(event);
205
+ expect(mockPreventDefault).toHaveBeenCalledTimes(1);
206
+ expect(mockOpen).toHaveBeenCalledTimes(1);
207
+ expect(mockOpen).toHaveBeenCalledWith("previous");
208
+ jest.clearAllMocks();
209
+ component.isExpanded = true;
210
+ component.handleKey(event);
211
+ expect(mockPreventDefault).toHaveBeenCalledTimes(0);
212
+ expect(mockOpen).toHaveBeenCalledTimes(0);
213
+ jest.clearAllMocks();
214
+ // any other key
215
+ // @ts-ignore
216
+ event.key = "f";
217
+ component.handleKey(event);
218
+ expect(mockPreventDefault).toHaveBeenCalledTimes(0);
219
+ expect(mockOpen).toHaveBeenCalledTimes(0);
220
+ jest.clearAllMocks();
221
+ jest.restoreAllMocks();
222
+ });
223
+ describe("select-all option", () => {
224
+ it("shows select-all button when prop is set and multiple is set", async () => {
225
+ const page = await newSpecPage({
226
+ components: [Select, Option],
227
+ html: '<wm-select multiple select-all label="mock label"><wm-option></wm-option></wm-select>',
228
+ });
229
+ const btn = page.root.shadowRoot.querySelector(".select-all");
230
+ expect(btn).not.toBeNull();
231
+ });
232
+ it("doesn't show select-all button when prop is not set", async () => {
233
+ const page = await newSpecPage({
234
+ components: [Select, Option],
235
+ html: '<wm-select label="mock label"><wm-option selected></wm-option></wm-select>',
236
+ });
237
+ const btn = page.root.shadowRoot.querySelector(".select-all");
238
+ expect(btn).toBeNull();
239
+ });
240
+ it("doesn't show select-all button when prop is set but multiple is not", async () => {
241
+ const page = await newSpecPage({
242
+ components: [Select, Option],
243
+ html: '<wm-select select-all label="mock label"><wm-option selected></wm-option></wm-select>',
244
+ });
245
+ const btn = page.root.shadowRoot.querySelector(".select-all");
246
+ expect(btn).toBeNull();
247
+ });
248
+ it("button text is 'Select all'", async () => {
249
+ const page = await newSpecPage({
250
+ components: [Select, Option],
251
+ html: `<wm-select multiple select-all label="mock label">
252
+ <wm-option>first</wm-option>
253
+ <wm-option>second</wm-option>
254
+ </wm-select>`,
255
+ });
256
+ const btn = page.root.shadowRoot.querySelector(".select-all");
257
+ expect(btn.textContent).toBe("Select All");
258
+ });
259
+ it("button text is 'Deselect all' when all options are selected", async () => {
260
+ const page = await newSpecPage({
261
+ components: [Select, Option],
262
+ html: `<wm-select multiple select-all label="mock label">
263
+ <wm-option selected>first</wm-option>
264
+ <wm-option selected>second</wm-option>
265
+ </wm-select>`,
266
+ });
267
+ const btn = page.root.shadowRoot.querySelector(".select-all");
268
+ expect(btn.textContent).toBe("Deselect All");
269
+ });
270
+ });
271
+ });
@@ -38,9 +38,6 @@
38
38
  --wmcolor-snackbar-text: var(--wmcolor-text-ondark);
39
39
  position: fixed;
40
40
  bottom: 0;
41
- left: 1.25rem;
42
- right: 1.25rem;
43
- z-index: 2001;
44
41
  }
45
42
  :host * {
46
43
  box-sizing: border-box;
@@ -51,10 +48,17 @@
51
48
  max-width: 35.5rem;
52
49
  max-height: 17.5rem;
53
50
  overflow: auto;
54
- padding: 0.25rem 0.625rem 1.875rem;
51
+ padding: 1.125rem;
55
52
  display: flex;
56
- flex-direction: column-reverse;
53
+ flex-direction: column;
57
54
  gap: 1.25rem;
55
+ position: fixed;
56
+ bottom: 0.75rem;
57
+ left: 0.75rem;
58
+ z-index: 2001;
59
+ }
60
+ :host .list-wrapper.empty {
61
+ visibility: hidden;
58
62
  }
59
63
  :host .wm-snack-wrapper {
60
64
  width: 100%;
@@ -101,6 +105,21 @@
101
105
  transform: scale(1);
102
106
  }
103
107
  }
108
+ :host .wm-snack-wrapper .wm-snackbar.shrink {
109
+ animation: shrink 0.25s;
110
+ animation-fill-mode: forwards;
111
+ animation-timing-function: ease-in-out;
112
+ }
113
+ @keyframes shrink {
114
+ 0% {
115
+ opacity: 1;
116
+ transform: scale(1);
117
+ }
118
+ 100% {
119
+ opacity: 0;
120
+ transform: scale(0.9);
121
+ }
122
+ }
104
123
  :host .wm-snack-wrapper .wm-snackbar .link {
105
124
  letter-spacing: 0;
106
125
  text-transform: none;
@@ -145,7 +164,7 @@
145
164
  :host .wm-snack-wrapper .wm-snackbar.active:not(button) {
146
165
  opacity: 1;
147
166
  }
148
- :host .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg {
167
+ :host .wm-snack-wrapper .wm-snackbar .content-wrapper {
149
168
  display: -webkit-box;
150
169
  display: -webkit-flex;
151
170
  display: -ms-flexbox;
@@ -162,31 +181,31 @@
162
181
  position: relative;
163
182
  padding: 0;
164
183
  }
165
- :host .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .msgtext {
184
+ :host .wm-snack-wrapper .wm-snackbar .content-wrapper .msg-wrapper {
166
185
  display: flex;
167
186
  flex-wrap: wrap;
168
187
  gap: 12px;
169
188
  width: 100%;
170
189
  align-items: center;
171
190
  }
172
- :host .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .msgtext .msg {
191
+ :host .wm-snack-wrapper .wm-snackbar .content-wrapper .msg-wrapper .msg {
173
192
  display: block;
174
193
  flex: 0 0 0;
175
194
  min-width: fit-content;
176
195
  }
177
- :host .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .msgtext .msg.long {
196
+ :host .wm-snack-wrapper .wm-snackbar .content-wrapper .msg-wrapper .msg.long {
178
197
  min-width: 216px;
179
198
  flex: 1 0 0;
180
199
  }
181
- :host .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .msgtext .link {
200
+ :host .wm-snack-wrapper .wm-snackbar .content-wrapper .msg-wrapper .link {
182
201
  display: flex;
183
202
  flex: 0 0 auto;
184
203
  }
185
- :host .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .msgtext .link span {
204
+ :host .wm-snack-wrapper .wm-snackbar .content-wrapper .msg-wrapper .link span {
186
205
  display: block;
187
206
  white-space: nowrap;
188
207
  }
189
- :host .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack {
208
+ :host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack {
190
209
  -webkit-box-shadow: none;
191
210
  -moz-box-shadow: none;
192
211
  box-shadow: none;
@@ -207,7 +226,7 @@
207
226
  text-align: center;
208
227
  letter-spacing: normal;
209
228
  }
210
- :host .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:before {
229
+ :host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:before {
211
230
  display: inline-block;
212
231
  font: normal normal normal 24px/1 "Material Design Icons";
213
232
  font-size: inherit;
@@ -218,18 +237,18 @@
218
237
  content: "\f156";
219
238
  font-size: 1.12rem;
220
239
  }
221
- :host .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:hover {
240
+ :host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:hover {
222
241
  background-color: var(--wmcolor-snackbar-close-background-hover);
223
242
  color: var(--wmcolor-snackbar-close-icon-hover);
224
243
  }
225
- :host .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:focus {
244
+ :host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:focus {
226
245
  outline: none;
227
246
  }
228
- :host .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack::-moz-focus-inner {
247
+ :host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack::-moz-focus-inner {
229
248
  border: 0;
230
249
  outline: none;
231
250
  }
232
- :host .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:active {
251
+ :host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:active {
233
252
  -ms-transform: scale(0.9, 0.9);
234
253
  -webkit-transform: scale(0.9, 0.9);
235
254
  -moz-transform: scale(0.9, 0.9);
@@ -264,11 +283,11 @@
264
283
  left: 0;
265
284
  }
266
285
 
267
- .user-is-tabbing .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:focus:not(:active) {
286
+ .user-is-tabbing .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:focus:not(:active) {
268
287
  outline: 3px solid var(--wmcolor-interactive-focus);
269
288
  outline-offset: 0;
270
289
  }
271
- .user-is-tabbing .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:focus:not(:active) > .tooltip {
290
+ .user-is-tabbing .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:focus:not(:active) > .tooltip {
272
291
  clip: auto;
273
292
  width: auto;
274
293
  height: auto;
@@ -281,13 +300,13 @@
281
300
  transform: translateX(-50%);
282
301
  }
283
302
  @media screen and (min-width: 48rem) {
284
- .user-is-tabbing .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .closesnack:focus:not(:active) > .tooltip {
303
+ .user-is-tabbing .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:focus:not(:active) > .tooltip {
285
304
  top: 2.0625rem;
286
305
  left: auto;
287
306
  }
288
307
  }
289
308
 
290
- .user-is-tabbing .wm-snack-wrapper .wm-snackbar .wm-snackbarmsg .link:focus:not(:active) {
309
+ .user-is-tabbing .wm-snack-wrapper .wm-snackbar .content-wrapper .link:focus:not(:active) {
291
310
  outline: 3px solid var(--wmcolor-interactive-focus);
292
311
  outline-offset: 2px;
293
312
  }
@@ -0,0 +1,112 @@
1
+ import { newE2EPage } from "@stencil/core/testing";
2
+ describe("wm-snackbar", () => {
3
+ let page;
4
+ beforeEach(async () => {
5
+ page = await newE2EPage();
6
+ await page.setContent("<wm-button id='create-snack' onclick='generateSnackbar()'></wm-button><wm-snackbar notifications='[]' id='snack'></wm-snackbar ><script>function generateSnackbar() { const snackbar = document.getElementById('snack'); const id = '3'; let notifications = JSON.parse(snackbar.notifications); let newNotification = {'id': id, message: 'You did something', link: 'Undo'}; let updatedNotifications = [ ...notifications, newNotification ]; snackbar.notifications = JSON.stringify(updatedNotifications); }</script>");
7
+ await page.evaluate(async () => {
8
+ document.addEventListener("wmSnackbarSnackFinished", (ev) => {
9
+ const snackbar = document.querySelector("wm-snackbar");
10
+ let newSnacks = JSON.parse(snackbar.notifications).filter((snack) => +snack.id !== +ev.detail.id);
11
+ snackbar.notifications = JSON.stringify(newSnacks);
12
+ });
13
+ });
14
+ });
15
+ afterEach(async () => {
16
+ jest.clearAllTimers();
17
+ });
18
+ // RENDER
19
+ it("it displays a snackbar when it receives a notification", async () => {
20
+ //generate snackbar
21
+ const button = await page.find("wm-button");
22
+ button.click(); //perform action that generates a notification
23
+ await page.waitForChanges();
24
+ const snackbar = await page.find("wm-snackbar >>> .content-wrapper");
25
+ expect(snackbar).not.toBeNull();
26
+ });
27
+ it("it displays multiple snackbars when it receives more than one notification", async () => {
28
+ //generate snackbars
29
+ const button = await page.find("wm-button");
30
+ button.click();
31
+ await page.waitForChanges();
32
+ button.click();
33
+ await page.waitForChanges();
34
+ const snackbars = await page.findAll("wm-snackbar >>> .content-wrapper");
35
+ expect(snackbars.length).toBe(2);
36
+ });
37
+ it("dismisses the snackbar after 20 seconds if the user is clicking and not tabbing", async () => {
38
+ //generate snackbar
39
+ const snackExpired = await page.spyOnEvent("wmSnackbarSnackFinished");
40
+ const button = await page.find("wm-button");
41
+ button.click();
42
+ await page.waitForChanges();
43
+ let snack = await page.find("wm-snackbar >>> .content-wrapper");
44
+ expect(snack).not.toBeNull();
45
+ await new Promise((resolve) => {
46
+ setTimeout(() => {
47
+ resolve("");
48
+ }, 21000);
49
+ });
50
+ snack = await page.find("wm-snackbar >>> .content-wrapper");
51
+ expect(snack).toBeNull();
52
+ expect(snackExpired).toHaveReceivedEventDetail({
53
+ id: "3",
54
+ message: "You did something",
55
+ link: "Undo",
56
+ });
57
+ });
58
+ it("dismisses the snackbar when the close button is clicked", async () => {
59
+ //generate snackbar
60
+ const triggerButton = await page.find("wm-button");
61
+ triggerButton.click();
62
+ await page.waitForChanges();
63
+ //press close button
64
+ const closeButton = await page.find("wm-snackbar >>> button");
65
+ closeButton.click();
66
+ await page.waitForChanges();
67
+ const snackbar = await page.find("wm-snackbar >>> .content-wrapper");
68
+ expect(snackbar).toBeNull();
69
+ });
70
+ //ACCESSIBILITY
71
+ it("renders an aria-live region", async () => {
72
+ const element = await page.find("wm-snackbar >>> #wm-live-region-snack");
73
+ expect(element).toEqualAttribute("aria-live", "polite");
74
+ });
75
+ it("focuses the action link in snackbar if the user is tabbing", async () => {
76
+ //generate snackbar
77
+ await page.keyboard.press("Tab");
78
+ await page.keyboard.press("Enter");
79
+ await page.waitForChanges();
80
+ const focusedElId = await page.evaluate(() => document.activeElement.shadowRoot.activeElement.id);
81
+ const link = await page.find("wm-snackbar >>> .link");
82
+ expect(focusedElId).toBe(link.id);
83
+ });
84
+ it("dismisses the snackbar when enter is pressed on close button and returns focus to last active element before snackbar was created", async () => {
85
+ //generate snackbar
86
+ await page.keyboard.press("Tab");
87
+ await page.keyboard.press("Enter");
88
+ await page.waitForChanges();
89
+ //press close button
90
+ await page.keyboard.press("Tab");
91
+ await page.keyboard.press("Enter");
92
+ await page.waitForChanges();
93
+ const snackbar = await page.find("wm-snackbar >>> .content-wrapper");
94
+ expect(snackbar).toBeNull();
95
+ const focusedElId = await page.evaluate(() => document.activeElement.id);
96
+ expect(focusedElId).toBe("create-snack");
97
+ });
98
+ it("dismisses the snackbar if the user tabs out of it and it returns focus to last active element before snackbar was created", async () => {
99
+ //generate snackbar
100
+ await page.keyboard.press("Tab");
101
+ await page.keyboard.press("Enter");
102
+ await page.waitForChanges();
103
+ //tab out
104
+ await page.keyboard.press("Tab");
105
+ await page.keyboard.press("Tab");
106
+ await page.waitForChanges();
107
+ const snackbar = await page.find("wm-snackbar >>> .content-wrapper");
108
+ expect(snackbar).toBeNull();
109
+ const focusedElId = await page.evaluate(() => document.activeElement.id);
110
+ expect(focusedElId).toBe("create-snack");
111
+ });
112
+ });
@@ -25,11 +25,13 @@ export class Snackbar {
25
25
  updateSnacks(newValue) {
26
26
  const prevParsedNotifications = [...this.parsedNotifications];
27
27
  this.parsedNotifications = [...JSON.parse(newValue)];
28
- this.refreshUpdatedNotifications(prevParsedNotifications);
28
+ this.resetUpdatedNotifications(prevParsedNotifications);
29
29
  if (prevParsedNotifications.length < this.parsedNotifications.length) {
30
30
  const latestNotification = this.parsedNotifications[0];
31
- const newTimer = window.setTimeout(() => this.snackExpired(latestNotification.id), 6000);
32
- this.timers = Object.assign({ [latestNotification.id]: newTimer }, this.timers);
31
+ if (!latestNotification.link) {
32
+ const newTimer = window.setTimeout(() => this.snackExpired(latestNotification.id), 6000);
33
+ this.timers = Object.assign({ [latestNotification.id]: newTimer }, this.timers);
34
+ }
33
35
  // don't announce link if user is tabbing because link is focused after announcement
34
36
  this.announce(`${latestNotification.message} ${this.isTabbing ? "" : latestNotification.link}`);
35
37
  if (this.isTabbing && latestNotification.link) {
@@ -44,7 +46,19 @@ export class Snackbar {
44
46
  }
45
47
  this.setMinWidths();
46
48
  }
47
- refreshUpdatedNotifications(prevNotifications) {
49
+ setMinWidths() {
50
+ // wait for render to get updated scrollWidth
51
+ requestAnimationFrame(() => {
52
+ const msgEls = this.el.shadowRoot.querySelectorAll(".msg");
53
+ msgEls.forEach((msgEl) => {
54
+ msgEl.classList.remove("long");
55
+ if (msgEl.scrollWidth > 216) {
56
+ msgEl.classList.add("long");
57
+ }
58
+ });
59
+ });
60
+ }
61
+ resetUpdatedNotifications(prevNotifications) {
48
62
  let updatedNotifications = [];
49
63
  prevNotifications.forEach((prevNotification) => {
50
64
  this.parsedNotifications.forEach((newNotification) => {
@@ -60,8 +74,10 @@ export class Snackbar {
60
74
  window.requestAnimationFrame(() => notifEl.classList.add("grow"));
61
75
  }
62
76
  this.stopTimer(updatedNotification);
63
- const newTimer = window.setTimeout(() => this.snackExpired(updatedNotification.id), 6000);
64
- this.timers = Object.assign({ [updatedNotification.id]: newTimer }, this.timers);
77
+ if (!updatedNotification.link) {
78
+ const newTimer = window.setTimeout(() => this.snackExpired(updatedNotification.id), 6000);
79
+ this.timers = Object.assign({ [updatedNotification.id]: newTimer }, this.timers);
80
+ }
65
81
  this.announce(`${updatedNotification.message} ${this.isTabbing ? "" : updatedNotification.link}`);
66
82
  });
67
83
  }
@@ -93,12 +109,17 @@ export class Snackbar {
93
109
  endSnack(notification) {
94
110
  //App listens for wmSnackbarSnackFinished event and deletes the emitted notification.
95
111
  this.stopTimer(notification);
96
- this.wmSnackbarSnackFinished.emit({
97
- id: notification.id,
98
- message: notification.message,
99
- link: notification.link,
100
- newWindow: notification.newWindow,
101
- });
112
+ const notifEl = this.el.shadowRoot.querySelector(`#snack-${notification.id}`);
113
+ notifEl.classList.add("shrink");
114
+ setTimeout(() => {
115
+ // wait for animation to complete, then emit event for removal
116
+ this.wmSnackbarSnackFinished.emit({
117
+ id: notification.id,
118
+ message: notification.message,
119
+ link: notification.link,
120
+ newWindow: notification.newWindow,
121
+ });
122
+ }, 250);
102
123
  }
103
124
  snackLinkClicked(notification) {
104
125
  //App listens for wmSnackbarActionTriggered event, deletes emitted notification, and takes over focus.
@@ -117,18 +138,6 @@ export class Snackbar {
117
138
  delete this.timers[notification.id];
118
139
  }
119
140
  }
120
- setMinWidths() {
121
- // wait for render to get updated scrollWidth
122
- requestAnimationFrame(() => {
123
- const msgEls = this.el.shadowRoot.querySelectorAll(".msg");
124
- msgEls.forEach((msgEl) => {
125
- msgEl.classList.remove("long");
126
- if (msgEl.scrollWidth > 216) {
127
- msgEl.classList.add("long");
128
- }
129
- });
130
- });
131
- }
132
141
  announce(message) {
133
142
  if (this.liveRegionEl.textContent === message) {
134
143
  message += "\u00A0";
@@ -136,15 +145,16 @@ export class Snackbar {
136
145
  this.announcement = message;
137
146
  }
138
147
  renderSnackbars() {
139
- return [...this.parsedNotifications].reverse().map((notification) => (h("div", { class: "wm-snack-wrapper" }, h("div", { id: `snack-${notification.id}`, class: "wm-snackbar active neutral" }, h("div", { class: "sr-only", tabindex: notification.link ? 0 : -1, onFocus: () => notification.link && this.snackDismissed(notification) }), h("div", { class: "wm-snackbarmsg" }, h("div", { class: "msgtext" }, h("span", { class: "msg" }, notification.message), notification.link && (h("a", { id: `action-${notification.id}`, class: `link ${notification.newWindow ? "new-window" : ""}`, "aria-label": `Click to ${notification.link}...${notification.newWindow ? " " + globalMessages.newWindow : ""}`, tabindex: 0, onClick: () => {
148
+ return this.parsedNotifications.map((notification) => (h("div", { class: "wm-snack-wrapper", key: `snack-${notification.id}` }, h("div", { id: `snack-${notification.id}`, class: "wm-snackbar active neutral" }, h("div", { class: "sr-only", tabindex: notification.link ? 0 : -1, onFocus: () => notification.link && this.snackDismissed(notification) }), h("div", { class: "content-wrapper" }, h("div", { class: "msg-wrapper" }, h("span", { class: "msg" }, notification.message), notification.link && (h("a", { id: `action-${notification.id}`, class: `link ${notification.newWindow ? "new-window" : ""}`, "aria-label": `Click to ${notification.link}...${notification.newWindow ? " " + globalMessages.newWindow : ""}`, tabindex: 0, onClick: () => {
140
149
  this.snackLinkClicked(notification);
141
150
  }, onKeyDown: (ev) => ev.key === "Enter" && this.snackLinkClicked(notification) }, h("span", { "aria-hidden": "true" }, notification.link)))), h("button", { id: `close-button-${notification.id}`, "aria-label": "Close this notification", class: "closesnack", tabindex: notification.link ? 0 : -1, onClick: () => this.snackDismissed(notification), onMouseEnter: (ev) => showTooltip("bottom", ev.target, globalMessages.close), onMouseLeave: () => hideTooltip(), onFocus: (ev) => this.isTabbing && showTooltip("bottom", ev.target, globalMessages.close), onBlur: () => hideTooltip() })), h("div", { class: "sr-only", tabindex: notification.link ? 0 : -1, onFocus: () => notification.link && this.snackDismissed(notification) })))));
142
151
  }
143
152
  render() {
144
- return (h(Host, { key: '67f36569152cc7f7df8e17a48b72737cf06b2249' }, h("div", { key: '2646611246f9ab87624bb1ad2bad217c364d89e7', ref: (el) => (this.snackAreaEl = el), class: {
153
+ return (h(Host, null, h("div", { ref: (el) => (this.snackAreaEl = el), class: {
145
154
  "list-wrapper": true,
146
155
  "user-is-tabbing": this.isTabbing,
147
- } }, this.renderSnackbars()), h("div", { key: '26284c415d2be1b8e944d7c2830c8eada5030fe3', class: "sr-only", "aria-live": "polite", "aria-atomic": "false", id: `wm-live-region-${this.uid}`, ref: (el) => (this.liveRegionEl = el) }, this.announcement)));
156
+ empty: this.parsedNotifications.length == 0,
157
+ } }, this.renderSnackbars()), h("div", { class: "sr-only", "aria-live": "polite", "aria-atomic": "false", id: `wm-live-region-${this.uid}`, ref: (el) => (this.liveRegionEl = el) }, this.announcement)));
148
158
  }
149
159
  static get is() { return "wm-snackbar"; }
150
160
  static get encapsulation() { return "shadow"; }
@@ -0,0 +1,9 @@
1
+ import { newSpecPage } from "@stencil/core/testing";
2
+ jest.mock("../../global/functions");
3
+ import { Snackbar } from "./wm-snackbar";
4
+ describe("wm-snackbar", () => {
5
+ it("builds", async () => {
6
+ const comp = await newSpecPage({ components: [Snackbar], html: "<wm-snackbar><wm-snackbar>" });
7
+ expect(comp.root).toMatchSnapshot();
8
+ });
9
+ });