@watermarkinsights/ripple 5.2.1-2 → 5.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (374) hide show
  1. package/dist/cjs/{chartFunctions-e86ed63c.js → chartFunctions-51de43eb.js} +4 -4
  2. package/dist/cjs/{functions-698530be.js → functions-48a748f0.js} +6 -103
  3. package/dist/{esm/app-globals-f193ab33.js → cjs/global-c8dd677d.js} +2 -7
  4. package/dist/cjs/index-f8ef86de.js +2578 -0
  5. package/dist/cjs/{intl-6751b1c3.js → intl-29d2cc42.js} +1 -1
  6. package/dist/cjs/loader.cjs.js +3 -4
  7. package/dist/cjs/priv-chart-popover.cjs.entry.js +5 -6
  8. package/dist/cjs/priv-datepicker.cjs.entry.js +8 -9
  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-datepicker.cjs.entry.js +4 -5
  17. package/dist/cjs/wm-file-list.cjs.entry.js +4 -5
  18. package/dist/cjs/wm-file.cjs.entry.js +4 -5
  19. package/dist/cjs/wm-input.cjs.entry.js +5 -6
  20. package/dist/cjs/wm-line-chart.cjs.entry.js +14 -15
  21. package/dist/cjs/wm-modal-footer.cjs.entry.js +3 -4
  22. package/dist/cjs/wm-modal-header.cjs.entry.js +5 -6
  23. package/dist/cjs/wm-modal.cjs.entry.js +6 -6
  24. package/dist/cjs/wm-navigation_3.cjs.entry.js +10 -13
  25. package/dist/cjs/wm-navigator.cjs.entry.js +3 -4
  26. package/dist/cjs/wm-option_2.cjs.entry.js +8 -10
  27. package/dist/cjs/wm-pagination.cjs.entry.js +4 -5
  28. package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +7 -9
  29. package/dist/cjs/wm-search.cjs.entry.js +6 -7
  30. package/dist/cjs/wm-snackbar.cjs.entry.js +6 -7
  31. package/dist/cjs/wm-tab-item_3.cjs.entry.js +8 -11
  32. package/dist/cjs/wm-tag-input.cjs.entry.js +7 -8
  33. package/dist/cjs/wm-tag-option.cjs.entry.js +2 -2
  34. package/dist/cjs/wm-textarea.cjs.entry.js +5 -6
  35. package/dist/cjs/wm-timepicker.cjs.entry.js +5 -6
  36. package/dist/cjs/wm-toggletip.cjs.entry.js +5 -6
  37. package/dist/cjs/wm-uploader.cjs.entry.js +6 -7
  38. package/dist/cjs/wm-wrapper.cjs.entry.js +1 -1
  39. package/dist/collection/collection-manifest.json +2 -2
  40. package/dist/collection/components/charts/chartFunctions.js +2 -2
  41. package/dist/collection/components/charts/chartFunctions.spec.js +16 -0
  42. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.e2e.js +81 -0
  43. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +2 -2
  44. package/dist/collection/components/charts/screenshots.e2e.js +96 -0
  45. package/dist/collection/components/charts/wm-chart/wm-chart.e2e.js +213 -0
  46. package/dist/collection/components/charts/wm-chart/wm-chart.js +1 -1
  47. package/dist/collection/components/charts/wm-chart/wm-chart.spec.js +37 -0
  48. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.e2e.js +176 -0
  49. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.js +9 -9
  50. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.spec.js +163 -0
  51. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +1 -1
  52. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.e2e.js +69 -0
  53. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +1 -1
  54. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.spec.js +79 -0
  55. package/dist/collection/components/wm-action-menu/wm-action-menu.e2e.js +200 -0
  56. package/dist/collection/components/wm-action-menu/wm-action-menu.js +1 -1
  57. package/dist/collection/components/wm-action-menu/wm-action-menu.spec.js +48 -0
  58. package/dist/collection/components/wm-button/wm-button.e2e.js +55 -0
  59. package/dist/collection/components/wm-button/wm-button.js +1 -1
  60. package/dist/collection/components/wm-button/wm-button.spec.js +74 -0
  61. package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.js +5 -5
  62. package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.spec.js +76 -0
  63. package/dist/collection/components/wm-datepicker/wm-datepicker.e2e.js +382 -0
  64. package/dist/collection/components/wm-datepicker/wm-datepicker.js +9 -13
  65. package/dist/collection/components/wm-datepicker/wm-datepicker.spec.js +21 -0
  66. package/dist/collection/components/wm-file/wm-file.js +1 -1
  67. package/dist/collection/components/wm-file/wm-file.spec.js +194 -0
  68. package/dist/collection/components/wm-file-list/wm-file-list.js +5 -5
  69. package/dist/collection/components/wm-file-list/wm-file-list.spec.js +69 -0
  70. package/dist/collection/components/wm-input/wm-input.e2e.js +32 -0
  71. package/dist/collection/components/wm-input/wm-input.js +1 -1
  72. package/dist/collection/components/wm-input/wm-input.spec.js +173 -0
  73. package/dist/collection/components/wm-menuitem/wm-menuitem.e2e.js +23 -0
  74. package/dist/collection/components/wm-menuitem/wm-menuitem.js +1 -1
  75. package/dist/collection/components/wm-menuitem/wm-menuitem.spec.js +54 -0
  76. package/dist/collection/components/wm-modal/wm-modal-footer.js +1 -1
  77. package/dist/collection/components/wm-modal/wm-modal-footer.spec.js +11 -0
  78. package/dist/collection/components/wm-modal/wm-modal-header.js +1 -1
  79. package/dist/collection/components/wm-modal/wm-modal-header.spec.js +8 -0
  80. package/dist/collection/components/wm-modal/wm-modal.e2e.js +104 -0
  81. package/dist/collection/components/wm-modal/wm-modal.js +3 -2
  82. package/dist/collection/components/wm-modal/wm-modal.spec.js +30 -0
  83. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +1 -1
  84. package/dist/collection/components/wm-navigation/wm-navigation-item.js +1 -1
  85. package/dist/collection/components/wm-navigation/wm-navigation.e2e.js +102 -0
  86. package/dist/collection/components/wm-navigation/wm-navigation.js +2 -2
  87. package/dist/collection/components/wm-navigation/wm-navigation.spec.js +91 -0
  88. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.e2e.js +50 -0
  89. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +1 -1
  90. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +1 -1
  91. package/dist/collection/components/wm-navigator/wm-navigator.e2e.js +209 -0
  92. package/dist/collection/components/wm-navigator/wm-navigator.spec.js +177 -0
  93. package/dist/collection/components/wm-option/wm-option.e2e.js +22 -0
  94. package/dist/collection/components/wm-option/wm-option.js +1 -1
  95. package/dist/collection/components/wm-option/wm-option.spec.js +63 -0
  96. package/dist/collection/components/wm-pagination/wm-pagination.e2e.js +312 -0
  97. package/dist/collection/components/wm-pagination/wm-pagination.js +1 -1
  98. package/dist/collection/components/wm-search/wm-search.e2e.js +76 -0
  99. package/dist/collection/components/wm-search/wm-search.js +4 -5
  100. package/dist/collection/components/wm-search/wm-search.spec.js +71 -0
  101. package/dist/collection/components/wm-select/wm-select.e2e.js +521 -0
  102. package/dist/collection/components/wm-select/wm-select.js +2 -2
  103. package/dist/collection/components/wm-select/wm-select.spec.js +271 -0
  104. package/dist/collection/components/wm-snackbar/wm-snackbar.e2e.js +112 -0
  105. package/dist/collection/components/wm-snackbar/wm-snackbar.js +2 -2
  106. package/dist/collection/components/wm-snackbar/wm-snackbar.spec.js +9 -0
  107. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +1 -1
  108. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +1 -1
  109. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +1 -1
  110. package/dist/collection/components/wm-tabs/wm-tabs.e2e.js +91 -0
  111. package/dist/collection/components/wm-tabs/wm-tabs.spec.js +12 -0
  112. package/dist/collection/components/wm-tag-input/wm-tag-input.e2e.js +204 -0
  113. package/dist/collection/components/wm-tag-input/wm-tag-input.js +3 -3
  114. package/dist/collection/components/wm-tag-input/wm-tag-input.spec.js +195 -0
  115. package/dist/collection/components/wm-textarea/wm-textarea.e2e.js +41 -0
  116. package/dist/collection/components/wm-textarea/wm-textarea.js +1 -1
  117. package/dist/collection/components/wm-textarea/wm-textarea.spec.js +79 -0
  118. package/dist/collection/components/wm-timepicker/wm-timepicker.e2e.js +163 -0
  119. package/dist/collection/components/wm-timepicker/wm-timepicker.js +8 -11
  120. package/dist/collection/components/wm-timepicker/wm-timepicker.spec.js +147 -0
  121. package/dist/collection/components/wm-toggletip/wm-toggletip.e2e.js +69 -0
  122. package/dist/collection/components/wm-toggletip/wm-toggletip.js +2 -2
  123. package/dist/collection/components/wm-toggletip/wm-toggletip.spec.js +21 -0
  124. package/dist/collection/components/wm-uploader/wm-uploader.e2e.js +70 -0
  125. package/dist/collection/components/wm-uploader/wm-uploader.js +2 -2
  126. package/dist/collection/components/wm-uploader/wm-uploader.spec.js +234 -0
  127. package/dist/collection/dev/scripts.js +748 -31
  128. package/dist/collection/global/functions.spec.js +126 -0
  129. package/dist/collection/lang/lang.spec.js +20 -0
  130. package/dist/esm/{chartFunctions-8098e455.js → chartFunctions-cb845edd.js} +4 -4
  131. package/dist/esm/{functions-f317d2d6.js → functions-58918a32.js} +6 -103
  132. package/dist/{cjs/app-globals-46a0b37c.js → esm/global-7c286bb3.js} +1 -10
  133. package/dist/esm/index-f164fbca.js +2548 -0
  134. package/dist/esm/{intl-00a637cf.js → intl-f9d79dff.js} +1 -1
  135. package/dist/esm/loader.js +4 -5
  136. package/dist/esm/polyfills/core-js.js +0 -0
  137. package/dist/esm/polyfills/dom.js +0 -0
  138. package/dist/esm/polyfills/es5-html-element.js +0 -0
  139. package/dist/esm/polyfills/index.js +0 -0
  140. package/dist/esm/polyfills/system.js +0 -0
  141. package/dist/esm/priv-chart-popover.entry.js +5 -6
  142. package/dist/esm/priv-datepicker.entry.js +8 -9
  143. package/dist/esm/priv-navigator-button.entry.js +3 -4
  144. package/dist/esm/priv-navigator-item.entry.js +3 -4
  145. package/dist/esm/ripple.js +12 -13
  146. package/dist/esm/wm-action-menu_2.entry.js +6 -8
  147. package/dist/esm/wm-button.entry.js +4 -5
  148. package/dist/esm/wm-chart-slice.entry.js +1 -1
  149. package/dist/esm/wm-chart.entry.js +6 -7
  150. package/dist/esm/wm-datepicker.entry.js +4 -5
  151. package/dist/esm/wm-file-list.entry.js +4 -5
  152. package/dist/esm/wm-file.entry.js +4 -5
  153. package/dist/esm/wm-input.entry.js +5 -6
  154. package/dist/esm/wm-line-chart.entry.js +14 -15
  155. package/dist/esm/wm-modal-footer.entry.js +3 -4
  156. package/dist/esm/wm-modal-header.entry.js +5 -6
  157. package/dist/esm/wm-modal.entry.js +6 -6
  158. package/dist/esm/wm-navigation_3.entry.js +10 -13
  159. package/dist/esm/wm-navigator.entry.js +3 -4
  160. package/dist/esm/wm-option_2.entry.js +8 -10
  161. package/dist/esm/wm-pagination.entry.js +4 -5
  162. package/dist/esm/wm-progress-indicator_3.entry.js +7 -9
  163. package/dist/esm/wm-search.entry.js +6 -7
  164. package/dist/esm/wm-snackbar.entry.js +6 -7
  165. package/dist/esm/wm-tab-item_3.entry.js +8 -11
  166. package/dist/esm/wm-tag-input.entry.js +7 -8
  167. package/dist/esm/wm-tag-option.entry.js +2 -2
  168. package/dist/esm/wm-textarea.entry.js +5 -6
  169. package/dist/esm/wm-timepicker.entry.js +5 -6
  170. package/dist/esm/wm-toggletip.entry.js +5 -6
  171. package/dist/esm/wm-uploader.entry.js +6 -7
  172. package/dist/esm/wm-wrapper.entry.js +1 -1
  173. package/dist/esm-es5/{chartFunctions-8098e455.js → chartFunctions-cb845edd.js} +1 -1
  174. package/dist/esm-es5/functions-58918a32.js +1 -0
  175. package/dist/esm-es5/global-7c286bb3.js +1 -0
  176. package/dist/esm-es5/index-f164fbca.js +1 -0
  177. package/dist/esm-es5/{intl-00a637cf.js → intl-f9d79dff.js} +1 -1
  178. package/dist/esm-es5/loader.js +1 -1
  179. package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
  180. package/dist/esm-es5/priv-datepicker.entry.js +1 -1
  181. package/dist/esm-es5/priv-navigator-button.entry.js +1 -1
  182. package/dist/esm-es5/priv-navigator-item.entry.js +1 -1
  183. package/dist/esm-es5/ripple.js +1 -1
  184. package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
  185. package/dist/esm-es5/wm-button.entry.js +1 -1
  186. package/dist/esm-es5/wm-chart-slice.entry.js +1 -1
  187. package/dist/esm-es5/wm-chart.entry.js +1 -1
  188. package/dist/esm-es5/wm-datepicker.entry.js +1 -1
  189. package/dist/esm-es5/wm-file-list.entry.js +1 -1
  190. package/dist/esm-es5/wm-file.entry.js +1 -1
  191. package/dist/esm-es5/wm-input.entry.js +1 -1
  192. package/dist/esm-es5/wm-line-chart.entry.js +1 -1
  193. package/dist/esm-es5/wm-modal-footer.entry.js +1 -1
  194. package/dist/esm-es5/wm-modal-header.entry.js +1 -1
  195. package/dist/esm-es5/wm-modal.entry.js +1 -1
  196. package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
  197. package/dist/esm-es5/wm-navigator.entry.js +1 -1
  198. package/dist/esm-es5/wm-option_2.entry.js +1 -1
  199. package/dist/esm-es5/wm-pagination.entry.js +1 -1
  200. package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
  201. package/dist/esm-es5/wm-search.entry.js +1 -1
  202. package/dist/esm-es5/wm-snackbar.entry.js +1 -1
  203. package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
  204. package/dist/esm-es5/wm-tag-input.entry.js +1 -1
  205. package/dist/esm-es5/wm-tag-option.entry.js +1 -1
  206. package/dist/esm-es5/wm-textarea.entry.js +1 -1
  207. package/dist/esm-es5/wm-timepicker.entry.js +1 -1
  208. package/dist/esm-es5/wm-toggletip.entry.js +1 -1
  209. package/dist/esm-es5/wm-uploader.entry.js +1 -1
  210. package/dist/esm-es5/wm-wrapper.entry.js +1 -1
  211. package/dist/loader/cdn.js +2 -1
  212. package/dist/loader/index.cjs.js +2 -1
  213. package/dist/loader/index.d.ts +0 -3
  214. package/dist/loader/index.es2017.js +2 -1
  215. package/dist/loader/index.js +2 -1
  216. package/dist/ripple/{p-e0ff556b.system.entry.js → p-011a4acc.system.entry.js} +1 -1
  217. package/dist/ripple/{p-8151c39b.system.entry.js → p-02b625f6.system.entry.js} +1 -1
  218. package/dist/ripple/{p-636ca7f2.entry.js → p-071fde45.entry.js} +1 -1
  219. package/dist/ripple/{p-06c018cf.system.entry.js → p-0ba8d3b6.system.entry.js} +1 -1
  220. package/dist/ripple/{p-ed372e19.system.js → p-0d15e3f0.system.js} +1 -1
  221. package/dist/ripple/p-0fe97e85.system.js +2 -0
  222. package/dist/ripple/p-105f479a.system.entry.js +1 -0
  223. package/dist/ripple/p-1453ea51.system.entry.js +1 -0
  224. package/dist/ripple/p-194bdaa4.system.entry.js +1 -0
  225. package/dist/ripple/p-1b43e46e.js +1 -0
  226. package/dist/ripple/{p-2f39732e.entry.js → p-25446670.entry.js} +1 -1
  227. package/dist/ripple/{p-66a57d81.system.entry.js → p-29509665.system.entry.js} +1 -1
  228. package/dist/ripple/p-30a9ba6e.entry.js +1 -0
  229. package/dist/ripple/p-31f97455.system.entry.js +1 -0
  230. package/dist/ripple/p-32dd0a11.entry.js +1 -0
  231. package/dist/ripple/p-39dc88f3.system.entry.js +1 -0
  232. package/dist/ripple/{p-9d4ea9f8.entry.js → p-3a070f35.entry.js} +1 -1
  233. package/dist/ripple/{p-0bb464b1.entry.js → p-3e9fcb47.entry.js} +1 -1
  234. package/dist/ripple/p-45126063.system.entry.js +1 -0
  235. package/dist/ripple/p-4bc27adf.entry.js +1 -0
  236. package/dist/ripple/p-4de51706.js +2 -0
  237. package/dist/ripple/p-4ee9f962.entry.js +1 -0
  238. package/dist/ripple/p-4fb3748d.js +1 -0
  239. package/dist/ripple/{p-00f8637e.system.entry.js → p-4fc6019b.system.entry.js} +1 -1
  240. package/dist/ripple/p-568818bb.js +1 -0
  241. package/dist/ripple/p-5a4f76e1.entry.js +1 -0
  242. package/dist/ripple/p-5ca67373.entry.js +1 -0
  243. package/dist/ripple/p-5ceb9894.entry.js +1 -0
  244. package/dist/ripple/p-63d5db34.entry.js +1 -0
  245. package/dist/ripple/p-63fabfed.entry.js +1 -0
  246. package/dist/ripple/{p-18c1593b.entry.js → p-65420b71.entry.js} +1 -1
  247. package/dist/ripple/{p-7cb98aa5.entry.js → p-6a9f7651.entry.js} +1 -1
  248. package/dist/ripple/{p-0d0e0a1e.system.entry.js → p-6d70b692.system.entry.js} +1 -1
  249. package/dist/ripple/p-75592b7a.entry.js +1 -0
  250. package/dist/ripple/{p-9d8817a7.system.entry.js → p-7e56da2e.system.entry.js} +1 -1
  251. package/dist/ripple/p-7e8daaac.entry.js +1 -0
  252. package/dist/ripple/p-7ea95937.entry.js +1 -0
  253. package/dist/ripple/p-7f1efb21.entry.js +1 -0
  254. package/dist/ripple/p-82d5ea8d.system.entry.js +1 -0
  255. package/dist/ripple/{p-3639dbbc.system.entry.js → p-82f3bd04.system.entry.js} +1 -1
  256. package/dist/ripple/p-82f7eca7.entry.js +1 -0
  257. package/dist/ripple/p-88406560.system.entry.js +1 -0
  258. package/dist/ripple/{p-94a54d68.system.js → p-8d177669.system.js} +1 -1
  259. package/dist/ripple/p-8d840770.system.js +1 -0
  260. package/dist/ripple/p-8e1fd831.entry.js +1 -0
  261. package/dist/ripple/p-994dc497.system.entry.js +1 -0
  262. package/dist/ripple/p-9dff37db.system.entry.js +1 -0
  263. package/dist/ripple/p-a71bc14f.entry.js +1 -0
  264. package/dist/ripple/p-a768d7f1.system.js +1 -0
  265. package/dist/ripple/{p-edcb8f48.system.entry.js → p-a99b05de.system.entry.js} +1 -1
  266. package/dist/ripple/{p-49f94f8a.entry.js → p-abe3242c.entry.js} +1 -1
  267. package/dist/ripple/p-b0579a2a.system.entry.js +1 -0
  268. package/dist/ripple/p-b1a4f626.system.entry.js +1 -0
  269. package/dist/ripple/p-b3dfb34a.entry.js +1 -0
  270. package/dist/ripple/p-b4cb2b12.entry.js +1 -0
  271. package/dist/ripple/p-c3283bce.system.entry.js +1 -0
  272. package/dist/ripple/p-c717d895.entry.js +1 -0
  273. package/dist/ripple/{p-b02c0c41.system.entry.js → p-c9943d2e.system.entry.js} +1 -1
  274. package/dist/ripple/p-cd5fdcb1.entry.js +1 -0
  275. package/dist/ripple/p-cd659e3e.system.entry.js +1 -0
  276. package/dist/ripple/p-d02bc2f2.system.entry.js +1 -0
  277. package/dist/ripple/p-d87de822.system.entry.js +1 -0
  278. package/dist/ripple/p-dd479c47.entry.js +1 -0
  279. package/dist/ripple/p-df78942e.entry.js +1 -0
  280. package/dist/ripple/p-e1b60b9e.system.entry.js +1 -0
  281. package/dist/ripple/p-e5de7cae.system.entry.js +1 -0
  282. package/dist/ripple/p-eb9cb021.system.entry.js +1 -0
  283. package/dist/ripple/p-ef3e35fa.entry.js +1 -0
  284. package/dist/ripple/p-ef7b1f3d.system.js +1 -0
  285. package/dist/ripple/p-f2556f03.system.entry.js +1 -0
  286. package/dist/ripple/p-f7ac9698.system.entry.js +1 -0
  287. package/dist/ripple/{p-e3d8f2f6.entry.js → p-f9689d7a.entry.js} +1 -1
  288. package/dist/ripple/{p-644092fd.js → p-fa3d10db.js} +1 -1
  289. package/dist/ripple/ripple.esm.js +1 -1
  290. package/dist/ripple/ripple.js +1 -1
  291. package/dist/types/components/wm-file-list/wm-file-list.d.ts +1 -1
  292. package/dist/types/components.d.ts +2 -2
  293. package/dist/types/stencil-public-runtime.d.ts +10 -3
  294. package/package.json +1 -1
  295. package/dist/cjs/index-4853a7b4.js +0 -1800
  296. package/dist/collection/dev/action-menu.js +0 -0
  297. package/dist/collection/dev/button.js +0 -0
  298. package/dist/collection/dev/chart-small.js +0 -56
  299. package/dist/collection/dev/chart.js +0 -37
  300. package/dist/collection/dev/datepicker.js +0 -46
  301. package/dist/collection/dev/file-list.js +0 -16
  302. package/dist/collection/dev/file.js +0 -0
  303. package/dist/collection/dev/input.js +0 -6
  304. package/dist/collection/dev/line-chart.js +0 -0
  305. package/dist/collection/dev/modal.js +0 -45
  306. package/dist/collection/dev/navigation.js +0 -13
  307. package/dist/collection/dev/navigator.js +0 -34
  308. package/dist/collection/dev/pagination.js +0 -7
  309. package/dist/collection/dev/progress-monitor.js +0 -0
  310. package/dist/collection/dev/search.js +0 -72
  311. package/dist/collection/dev/select.js +0 -57
  312. package/dist/collection/dev/snackbar.js +0 -38
  313. package/dist/collection/dev/tabs.js +0 -44
  314. package/dist/collection/dev/tag-input.js +0 -32
  315. package/dist/collection/dev/textarea.js +0 -28
  316. package/dist/collection/dev/timepicker.js +0 -32
  317. package/dist/collection/dev/toggletip.js +0 -0
  318. package/dist/collection/dev/uploader.js +0 -139
  319. package/dist/esm/index-7923308f.js +0 -1770
  320. package/dist/esm-es5/app-globals-f193ab33.js +0 -1
  321. package/dist/esm-es5/functions-f317d2d6.js +0 -1
  322. package/dist/esm-es5/index-7923308f.js +0 -1
  323. package/dist/ripple/p-0707b4c2.entry.js +0 -1
  324. package/dist/ripple/p-0ec1e075.entry.js +0 -1
  325. package/dist/ripple/p-0f72ed3a.entry.js +0 -1
  326. package/dist/ripple/p-19f29a48.entry.js +0 -1
  327. package/dist/ripple/p-1ee68e06.system.entry.js +0 -1
  328. package/dist/ripple/p-1fcc8007.system.entry.js +0 -1
  329. package/dist/ripple/p-28119849.system.entry.js +0 -1
  330. package/dist/ripple/p-2849847d.system.entry.js +0 -1
  331. package/dist/ripple/p-2ec13501.entry.js +0 -1
  332. package/dist/ripple/p-3132d4d3.entry.js +0 -1
  333. package/dist/ripple/p-340f96b5.entry.js +0 -1
  334. package/dist/ripple/p-3e605541.entry.js +0 -1
  335. package/dist/ripple/p-439d839b.system.entry.js +0 -1
  336. package/dist/ripple/p-445d6915.entry.js +0 -1
  337. package/dist/ripple/p-48ed56a0.entry.js +0 -1
  338. package/dist/ripple/p-4978ff1b.system.entry.js +0 -1
  339. package/dist/ripple/p-4c3f4047.system.js +0 -1
  340. package/dist/ripple/p-4d511ecc.system.entry.js +0 -1
  341. package/dist/ripple/p-510fab1c.system.entry.js +0 -1
  342. package/dist/ripple/p-539b7be9.system.js +0 -2
  343. package/dist/ripple/p-58a286e8.system.entry.js +0 -1
  344. package/dist/ripple/p-5ff41948.entry.js +0 -1
  345. package/dist/ripple/p-681c1853.js +0 -1
  346. package/dist/ripple/p-6b71806b.entry.js +0 -1
  347. package/dist/ripple/p-7afa2fdc.system.entry.js +0 -1
  348. package/dist/ripple/p-7b329a58.system.js +0 -1
  349. package/dist/ripple/p-7dbc4abc.system.entry.js +0 -1
  350. package/dist/ripple/p-950edf62.entry.js +0 -1
  351. package/dist/ripple/p-9bda128e.system.entry.js +0 -1
  352. package/dist/ripple/p-9ca027b7.entry.js +0 -1
  353. package/dist/ripple/p-a1f60f8e.entry.js +0 -1
  354. package/dist/ripple/p-a431d6e5.js +0 -2
  355. package/dist/ripple/p-a6119885.system.entry.js +0 -1
  356. package/dist/ripple/p-a77f2168.entry.js +0 -1
  357. package/dist/ripple/p-adfaeeea.entry.js +0 -1
  358. package/dist/ripple/p-bbb8c02f.system.entry.js +0 -1
  359. package/dist/ripple/p-bd7e892d.entry.js +0 -1
  360. package/dist/ripple/p-c096b90c.system.js +0 -1
  361. package/dist/ripple/p-c9552e88.system.entry.js +0 -1
  362. package/dist/ripple/p-cd0a862f.system.entry.js +0 -1
  363. package/dist/ripple/p-d344e490.entry.js +0 -1
  364. package/dist/ripple/p-d87e105b.system.entry.js +0 -1
  365. package/dist/ripple/p-e19e1ece.system.entry.js +0 -1
  366. package/dist/ripple/p-e8eef357.entry.js +0 -1
  367. package/dist/ripple/p-eb596891.entry.js +0 -1
  368. package/dist/ripple/p-ec384895.system.entry.js +0 -1
  369. package/dist/ripple/p-eccb5aaf.entry.js +0 -1
  370. package/dist/ripple/p-f4bc9c19.entry.js +0 -1
  371. package/dist/ripple/p-f7c47815.js +0 -1
  372. package/dist/ripple/p-fa5a601e.system.entry.js +0 -1
  373. package/dist/ripple/p-fc710a30.js +0 -1
  374. package/dist/ripple/p-ff7dac66.system.entry.js +0 -1
@@ -0,0 +1,200 @@
1
+ import { newE2EPage } from "@stencil/core/testing";
2
+ import { AxePuppeteer } from "@axe-core/puppeteer";
3
+ describe("wm-action-menu", () => {
4
+ let page;
5
+ beforeEach(async () => {
6
+ page = await newE2EPage();
7
+ await page.setContent("<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1><wm-action-menu id='test' tooltip='menu name'><wm-menuitem id='first' onClick='action()'>First action</wm-menuitem><wm-menuitem id='second'>Second action</wm-menuitem><wm-menuitem id='third'>Third action</wm-menuitem></wm-action-menu><script>function action() {document.getElementById('first').innerHTML = 'Changed text'}</script></main></body></html>");
8
+ });
9
+ it("passes Axe checks", async () => {
10
+ const results = await new AxePuppeteer(page).analyze();
11
+ expect(results.violations.length).toBe(0);
12
+ });
13
+ //ATTRIBUTES;
14
+ it("has the right WAI_ARIA roles, states and properties", async () => {
15
+ const wmbtn = await page.find("wm-action-menu >>> wm-button");
16
+ const menu = await page.find("wm-action-menu >>> #menu-test");
17
+ const second = await page.find("#second");
18
+ const third = await page.find("#third");
19
+ await page.waitForChanges();
20
+ // check aria-expanded attribute
21
+ expect(wmbtn).toEqualAttribute("aria-expanded", "false");
22
+ // If the element with the aria-expanded attribute controls the expansion of another grouping container that is not 'owned by' the element, the author SHOULD reference the container by using the aria-controls attribute.
23
+ // src: https://www.w3.org/WAI/PF/aria/states_and_properties#aria-expanded
24
+ expect(wmbtn).toEqualAttribute("aria-controls", "menu-test");
25
+ // An element that contains or owns all the menu items has role menu.
26
+ expect(menu).toEqualAttribute("role", "menu");
27
+ expect(menu).toEqualAttribute("tabindex", "-1");
28
+ // Each menuitem in the menu has role menuitem.
29
+ expect(second).toEqualAttribute("role", "menuitem"); // just checking one randomly
30
+ expect(third).toEqualAttribute("tabindex", "-1");
31
+ });
32
+ // Down Arrow: Moves focus to the first menuitem. If the dropdown is collapsed, it also expands the list.
33
+ // Up Arrow: Moves focus to the last menuitem. If the dropdown is collapsed, it also expands the list.
34
+ it("handles Up and Down Arrow keys", async () => {
35
+ const wmbtn = await page.find("wm-action-menu >>> wm-button");
36
+ expect(wmbtn.getAttribute("aria-expanded")).toEqual("false");
37
+ await page.keyboard.press("Tab");
38
+ await page.waitForChanges();
39
+ await page.keyboard.press("ArrowDown");
40
+ await page.waitForChanges();
41
+ expect(wmbtn.getAttribute("aria-expanded")).toEqual("true");
42
+ const first = await page.find("wm-menuitem#first >>> div");
43
+ const second = await page.find("wm-menuitem#second >>> div");
44
+ expect(first).toHaveClass("focus");
45
+ await page.keyboard.press("ArrowDown");
46
+ await page.waitForChanges();
47
+ expect(second).toHaveClass("focus");
48
+ await page.keyboard.press("ArrowUp");
49
+ await page.waitForChanges();
50
+ expect(first).toHaveClass("focus");
51
+ await page.keyboard.press("Enter");
52
+ await page.waitForChanges();
53
+ await page.waitForTimeout(500); //allow closing animation and setTimeout to finish
54
+ expect(wmbtn.getAttribute("aria-expanded")).toEqual("false");
55
+ await page.keyboard.press("ArrowUp");
56
+ await page.waitForChanges();
57
+ // after the action runs the dropdown close and the dev should focus the relevant element.
58
+ // in case they don't, focus will return to the body. The component checks that and brings focus
59
+ // back to the button when that's the case.
60
+ // Things seem to happen differently with headless chrome / puppeteer. Focus stays on the menuitem even after
61
+ // it has become unable to have focus in normal browsers (after dropdown closes). Focus never gets to body.
62
+ // So here we simply test that the active el is not the body
63
+ const activeEl = await page.evaluate(() => document.activeElement.tagName);
64
+ expect(activeEl).not.toEqual("BODY");
65
+ expect(wmbtn.getAttribute("aria-expanded")).toEqual("true");
66
+ await page.keyboard.press("ArrowUp");
67
+ await page.waitForChanges();
68
+ expect(second).toHaveClass("focus");
69
+ });
70
+ // Home: If the dropdown is displayed, moves focus to first menuitem.
71
+ // End: If the dropdown is displayed, moves focus to last menuitem.
72
+ it("handles Home and End keys", async () => {
73
+ await page.keyboard.press("Tab");
74
+ await page.keyboard.press("Enter");
75
+ await page.waitForTimeout(40);
76
+ await page.keyboard.press("ArrowDown");
77
+ await page.keyboard.press("ArrowDown");
78
+ await page.waitForChanges();
79
+ const focusedEl = await page.find("wm-menuitem#third >>> div");
80
+ expect(focusedEl).toHaveClass("focus");
81
+ await page.keyboard.press("Home");
82
+ await page.waitForChanges();
83
+ const homefocusedEl = await page.find("wm-menuitem#first >>> div");
84
+ expect(focusedEl).not.toHaveClass("focus");
85
+ expect(homefocusedEl).toHaveClass("focus");
86
+ await page.keyboard.press("End");
87
+ await page.waitForChanges();
88
+ const endfocusedEl = await page.find("wm-menuitem#third >>> div");
89
+ expect(endfocusedEl).toHaveClass("focus");
90
+ });
91
+ // - Type a character: focus moves to the next menuitem with a name that starts with the typed character.
92
+ // - Type multiple characters in rapid succession: focus moves to the next menuitem with a name that starts with the string of characters typed
93
+ it("handles typing", async () => {
94
+ await page.keyboard.press("Tab");
95
+ await page.keyboard.press("Enter");
96
+ await page.waitForChanges();
97
+ await page.keyboard.press("t");
98
+ await page.waitForChanges();
99
+ const focusedEl = await page.find("wm-menuitem#third >>> div");
100
+ expect(focusedEl).toHaveClass("focus");
101
+ });
102
+ // OPEN / CLOSE
103
+ // Spacebar: Should open the popup (we didn't implement, comes for free. Test is to make sure we don't break it)
104
+ it("handles the Spacebar key", async () => {
105
+ await page.keyboard.press("Tab");
106
+ await page.keyboard.press("Space");
107
+ await page.waitForChanges();
108
+ const wmbtn = await page.find("wm-action-menu >>> wm-button");
109
+ expect(wmbtn.getAttribute("aria-expanded")).toEqual("true");
110
+ });
111
+ // Escape: If the menu is displayed, closes the popup and returns focus to the button.
112
+ it("handles the Escape key", async () => {
113
+ await page.keyboard.press("Tab");
114
+ await page.keyboard.press("Enter");
115
+ await page.waitForChanges();
116
+ const wmbtn = await page.find("wm-action-menu >>> wm-button");
117
+ expect(wmbtn.getAttribute("aria-expanded")).toEqual("true");
118
+ await page.keyboard.press("ArrowDown");
119
+ await page.keyboard.press("Escape");
120
+ await page.waitForChanges();
121
+ await page.waitForTimeout(500); //allow closing animation and setTimeout to finish
122
+ expect(wmbtn.getAttribute("aria-expanded")).toEqual("false");
123
+ const activeElId = await page.evaluate(() => document.activeElement.id);
124
+ expect(activeElId).toEqual("test");
125
+ //When dropdown reopens, focus returns to first element
126
+ await page.keyboard.press("Enter");
127
+ await page.waitForChanges();
128
+ expect(wmbtn.getAttribute("aria-expanded")).toEqual("true");
129
+ const focusedEl = await page.find("wm-menuitem#first >>> div");
130
+ expect(focusedEl).toHaveClass("focus"); //
131
+ });
132
+ // Enter:
133
+ // - If the focus is on the button, it expands the dropdown and places focuses on the first menuitem.
134
+ // - If the dropdown is open, it closes the dropdown.
135
+ it("opens and closes the dropdown when enter key is pressed", async () => {
136
+ await page.keyboard.press("Tab");
137
+ const wmbtn = await page.find("wm-action-menu >>> wm-button");
138
+ await page.keyboard.press("Enter");
139
+ await page.waitForChanges();
140
+ expect(wmbtn.getAttribute("aria-expanded")).toEqual("true");
141
+ await page.keyboard.press("Enter");
142
+ await page.waitForChanges();
143
+ expect(wmbtn.getAttribute("aria-expanded")).toEqual("false");
144
+ });
145
+ it("runs the onClick function passed to the menuitem when clicked or key pressed", async () => {
146
+ page = await newE2EPage();
147
+ await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
148
+ <wm-action-menu id='test' tooltip='menu name'>
149
+ <wm-menuitem id='first' onClick='action()'>First action</wm-menuitem>
150
+ </wm-action-menu>
151
+ <div id='changeMe'>default</div>
152
+ <script>
153
+ function action() {
154
+ document.getElementById('changeMe').textContent += "&"
155
+ }
156
+ </script></main></body></html>`);
157
+ const div = await page.find("#changeMe");
158
+ await page.keyboard.press("Tab");
159
+ await page.waitForChanges();
160
+ await page.keyboard.press("Enter");
161
+ await page.waitForChanges();
162
+ await page.keyboard.press("Enter");
163
+ await page.waitForChanges();
164
+ expect(div.textContent).toBe("default&");
165
+ await page.waitForTimeout(300); // make sure menu is closed before reopening (closes after the 250ms animation)
166
+ await page.keyboard.press("Enter");
167
+ await page.waitForChanges();
168
+ await page.click("#first");
169
+ await page.waitForChanges();
170
+ expect(div.textContent).toBe("default&&");
171
+ });
172
+ it("doesn't open the dropdown if the dropdown is disabled", async () => {
173
+ await page.evaluate(() => document.querySelector("wm-action-menu").setAttribute("disabled", "true"));
174
+ await page.keyboard.press("Tab");
175
+ await page.keyboard.press("Enter");
176
+ await page.waitForChanges();
177
+ const wmbtn = await page.find("wm-action-menu >>> wm-button");
178
+ await page.waitForChanges();
179
+ expect(wmbtn.getAttribute("aria-expanded")).toEqual("false");
180
+ });
181
+ // TOOLTIP
182
+ it("renders a tooltip when type is icon", async () => {
183
+ await page.keyboard.press("Tab");
184
+ await page.waitForChanges();
185
+ const tooltipEl = await page.find("#wm-tooltip");
186
+ expect(tooltipEl.textContent).toBe("menu name");
187
+ });
188
+ it("uses the label instead of tooltip text", async () => {
189
+ page = await newE2EPage();
190
+ await page.setContent("<wm-action-menu icon='f1c0' action-menu-type='icon' tooltip='delete' label-for-identical-buttons='delete this particular thing'><wm-menuitem>1</wm-menuitem></wm-action-menu>");
191
+ // use case: when the tooltip is something like "edit" and there are several buttons on a page, the aria label should be more specific than the tooltip
192
+ const wmbtn = await page.find("wm-action-menu >>> wm-button");
193
+ const btn = wmbtn.shadowRoot.querySelector("button");
194
+ await page.keyboard.press("Tab");
195
+ await page.waitForChanges();
196
+ const tooltipEl = await page.find("#wm-tooltip");
197
+ expect(tooltipEl.textContent).toEqual("delete");
198
+ expect(btn).toEqualAttribute("aria-label", "delete this particular thing");
199
+ });
200
+ });
@@ -190,7 +190,7 @@ export class ActionMenu {
190
190
  return null;
191
191
  }
192
192
  render() {
193
- return (h(Host, { key: 'b7837795e21f17c3dd39b07a7793fb6618ea4266', onBlur: () => this.close(false) }, h("div", { key: 'cf91d1c9c4d219f9a5a4e8515bd65a8e6be6f66e', class: getTextDir() }, h("wm-button", { key: 'e3a96d49020444b6e144f076b21d330c0b51f8a4', "button-type": this.internalButtonType, tooltip: this.tooltip, "custom-background": this.darkMode ? "dark" : undefined, "label-for-identical-buttons": this.labelForIdenticalButtons, icon: this.actionMenuType === "icon" ? "f1d9" : "", iconSize: this.actionMenuType === "icon" ? "24px" : undefined, id: "menubtn", onClick: () => (this.isExpanded ? this.close() : this.open()), onBlur: (ev) => this.handleButtonBlur(ev), disabled: this.disabled, ref: (el) => (this.wmButtonEl = el), "tooltip-position": this.tooltipPosition || this.horizontalPosition, "aria-haspopup": "true", "aria-expanded": this.isExpanded ? "true" : "false", "aria-controls": "menu" }, this.buttonText), h("div", { key: 'bc01f9c3df76416f41be0dffbd4413ef462e1c26', class: `dropdown ${this.openUp ? "open-up" : ""} ${this.horizontalPosition} ${this.isExpanded ? "open" : ""} hidden`, id: "menu", tabindex: -1, role: "menu", ref: (el) => (this.itemsEl = el) }, h("slot", { key: 'ab2d540947baccd6ed16fa6d1cc32bc61e8c847c' })))));
193
+ return (h(Host, { onBlur: () => this.close(false) }, h("div", { class: getTextDir() }, h("wm-button", { "button-type": this.internalButtonType, tooltip: this.tooltip, "custom-background": this.darkMode ? "dark" : undefined, "label-for-identical-buttons": this.labelForIdenticalButtons, icon: this.actionMenuType === "icon" ? "f1d9" : "", iconSize: this.actionMenuType === "icon" ? "24px" : undefined, id: "menubtn", onClick: () => (this.isExpanded ? this.close() : this.open()), onBlur: (ev) => this.handleButtonBlur(ev), disabled: this.disabled, ref: (el) => (this.wmButtonEl = el), "tooltip-position": this.tooltipPosition || this.horizontalPosition, "aria-haspopup": "true", "aria-expanded": this.isExpanded ? "true" : "false", "aria-controls": "menu" }, this.buttonText), h("div", { class: `dropdown ${this.openUp ? "open-up" : ""} ${this.horizontalPosition} ${this.isExpanded ? "open" : ""} hidden`, id: "menu", tabindex: -1, role: "menu", ref: (el) => (this.itemsEl = el) }, h("slot", null)))));
194
194
  }
195
195
  static get is() { return "wm-action-menu"; }
196
196
  static get encapsulation() { return "shadow"; }
@@ -0,0 +1,48 @@
1
+ import { newSpecPage } from "@stencil/core/testing";
2
+ import { ActionMenu } from "./wm-action-menu";
3
+ import { Menuitem } from "../wm-menuitem/wm-menuitem";
4
+ import * as globalFuncs from "../../global/functions";
5
+ jest.spyOn(globalFuncs, "getTextDir").mockImplementation(() => "rtl");
6
+ jest.spyOn(globalFuncs, "generateId");
7
+ // @ts-ignore
8
+ globalFuncs.generateId.mockImplementation(() => "random-id");
9
+ describe("wm-action-menu", () => {
10
+ it("builds", async () => {
11
+ const page = await newSpecPage({
12
+ components: [ActionMenu, Menuitem],
13
+ html: "<wm-action-menu action-menu-type='icon' tooltip='Menu Name'><wm-menuitem icon='f3eb' onClick='someFunction()'>Menuitem one</wm-menuitem></wm-action-menu>",
14
+ });
15
+ expect(page.root).toMatchSnapshot();
16
+ });
17
+ it("has the right props", () => {
18
+ const menu = new ActionMenu();
19
+ expect(menu).toHaveProperty("childItems");
20
+ expect(menu).toHaveProperty("keysSoFar");
21
+ expect(menu).toHaveProperty("searchIndex");
22
+ expect(menu).toHaveProperty("tooltipPosition");
23
+ expect(menu).toHaveProperty("actionMenuType");
24
+ expect(menu).toHaveProperty("buttonText");
25
+ expect(menu).toHaveProperty("tooltip");
26
+ expect(menu).toHaveProperty("labelForIdenticalButtons");
27
+ });
28
+ describe("error throwing", () => {
29
+ it("throws error when action-menu-type is text/selector but no button-text is passed", async () => {
30
+ const mockFunc = jest.fn();
31
+ console.error = mockFunc;
32
+ await newSpecPage({
33
+ components: [ActionMenu, Menuitem],
34
+ html: "<wm-action-menu action-menu-type='text'><wm-menuitem icon='f3eb' onClick='someFunction()'>Menuitem one</wm-menuitem></wm-action-menu>",
35
+ });
36
+ expect(mockFunc).toHaveBeenCalledWith("wm-action-menu should have a valid button-text property when action-menu-type is set to 'text' or 'selector'");
37
+ });
38
+ it("throws error when action-menu-type is icon but no tooltip is passed", async () => {
39
+ const mockFunc = jest.fn();
40
+ console.error = mockFunc;
41
+ await newSpecPage({
42
+ components: [ActionMenu, Menuitem],
43
+ html: "<wm-action-menu action-menu-type='icon'><wm-menuitem icon='f3eb' onClick='someFunction()'>Menuitem one</wm-menuitem></wm-action-menu>",
44
+ });
45
+ expect(mockFunc).toHaveBeenCalledWith("wm-action-menu should have a valid tooltip when action-menu-type is set to 'icon'");
46
+ });
47
+ });
48
+ });
@@ -0,0 +1,55 @@
1
+ import { newE2EPage } from "@stencil/core/testing";
2
+ import { AxePuppeteer } from "@axe-core/puppeteer";
3
+ describe("wm-button", () => {
4
+ let page;
5
+ beforeEach(async () => {
6
+ page = await newE2EPage();
7
+ });
8
+ it("passes Axe checks", async () => {
9
+ await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
10
+ <wm-button>Click me</wm-button>
11
+ </main></body></html>`);
12
+ const results = await new AxePuppeteer(page).analyze();
13
+ expect(results.violations.length).toBe(0);
14
+ });
15
+ it("renders a button", async () => {
16
+ await page.setContent("<wm-button></wm-button>");
17
+ const element = await page.find("wm-button >>> button");
18
+ expect(element).not.toBeNull();
19
+ });
20
+ it("delegates focus", async () => {
21
+ await page.setContent("<wm-button>click here</wm-button>");
22
+ const wmButton = await page.find("wm-button");
23
+ wmButton.focus();
24
+ let activeEl = await page.evaluate(async () => {
25
+ let el = await document.activeElement.shadowRoot.activeElement;
26
+ return el.nodeName;
27
+ });
28
+ expect(activeEl).toBe("BUTTON");
29
+ });
30
+ it("renders a tooltip for text-only buttons if text is truncated", async () => {
31
+ await page.setContent("<wm-button text-wrap='false' style='width: 100px' button-type='textonly'>Text-only button with a very long text and text-wrap set to false</wm-button>");
32
+ await page.waitForChanges();
33
+ await page.keyboard.press("Tab");
34
+ await page.waitForChanges();
35
+ const tooltip = await page.find("#wm-tooltip");
36
+ expect(tooltip.textContent).toEqual("Text-only button with a very long text and text-wrap set to false");
37
+ });
38
+ it("uses the label instead of tooltip text", async () => {
39
+ // use case: when the tooltip is something like "edit" and there are several buttons on a page, the aria label should be more specific than the tooltip
40
+ await page.setContent("<wm-button button-type='icononly' icon='f1c0' tooltip='delete' label-for-identical-buttons='Delete item 37' ></wm-button>");
41
+ await page.waitForChanges();
42
+ const btn = await page.find("wm-button >>> button");
43
+ expect(btn.getAttribute("aria-label")).toBe("Delete item 37");
44
+ });
45
+ it("renders the passed-in property button type property as a class", async () => {
46
+ await page.setContent("<wm-button></wm-button>");
47
+ const component = await page.find("wm-button");
48
+ const defaultButton = await page.find("wm-button >>> button");
49
+ expect(defaultButton).toHaveClass("-secondary");
50
+ component.setProperty("buttonType", "primary");
51
+ const primaryButton = await page.find("wm-button >>> button");
52
+ await page.waitForChanges();
53
+ expect(primaryButton).toHaveClass("-primary");
54
+ });
55
+ });
@@ -166,7 +166,7 @@ export class Button {
166
166
  }
167
167
  }
168
168
  render() {
169
- return (h(Host, { key: 'b0a1fc9ed2ba71f10e6829bd92552edf4cc61713', class: `${this.isDisabled ? "button-disabled" : ""} -${this.buttonType}` }, h("button", { key: '2d7f90caad6311d35fc61be079d5492c0da77b8e', id: this.id, class: `${this.buttonClasses}`, disabled: this.isDisabled, ref: (el) => (this.buttonEl = el), "aria-label": this.getAriaLabel(), "aria-hasPopup": this.ariaPopup ? "menu" : null, onMouseEnter: (ev) => this.handleMouseEnter(ev), onMouseLeave: () => hideTooltip(), onFocus: (ev) => this.handleFocus(ev), onBlur: () => hideTooltip(), onClick: () => hideTooltip() }, this.icon && (h("span", { key: 'eebe3af5e1105a5adb3939a2fa9cc7cbb09ded38', class: "mdi", style: this.iconStyles, "aria-hidden": "true" }, String.fromCodePoint(parseInt(`0x${this.icon}`)))), h("span", { key: 'ea3115ae0ffa964e69e58f125bedf5e7dbd334c0', class: "button-text" }, h("slot", { key: '184b3d077d4bc2c5d37ae9fb119178783776672a' })))));
169
+ return (h(Host, { class: `${this.isDisabled ? "button-disabled" : ""} -${this.buttonType}` }, h("button", { id: this.id, class: `${this.buttonClasses}`, disabled: this.isDisabled, ref: (el) => (this.buttonEl = el), "aria-label": this.getAriaLabel(), "aria-hasPopup": this.ariaPopup ? "menu" : null, onMouseEnter: (ev) => this.handleMouseEnter(ev), onMouseLeave: () => hideTooltip(), onFocus: (ev) => this.handleFocus(ev), onBlur: () => hideTooltip(), onClick: () => hideTooltip() }, this.icon && (h("span", { class: "mdi", style: this.iconStyles, "aria-hidden": "true" }, String.fromCodePoint(parseInt(`0x${this.icon}`)))), h("span", { class: "button-text" }, h("slot", null)))));
170
170
  }
171
171
  static get is() { return "wm-button"; }
172
172
  static get encapsulation() { return "shadow"; }
@@ -0,0 +1,74 @@
1
+ import { newSpecPage } from "@stencil/core/testing";
2
+ import * as globalFunctions from "../../global/functions";
3
+ jest.spyOn(globalFunctions, "generateId").mockReturnValue("random-id");
4
+ import { Button } from "./wm-button";
5
+ describe("button", () => {
6
+ it("builds", async () => {
7
+ const page = await newSpecPage({
8
+ components: [Button],
9
+ html: "<wm-button></wm-button>",
10
+ });
11
+ expect(page.root).toMatchSnapshot();
12
+ });
13
+ it("has style and an icon type props with default values", async () => {
14
+ const page = await newSpecPage({
15
+ components: [Button],
16
+ html: "<wm-button></wm-button>",
17
+ });
18
+ const button = page.root;
19
+ const buttonEl = page.root.shadowRoot.querySelector("button");
20
+ expect(button).toHaveProperty("buttonType");
21
+ expect(button.buttonType).toEqual("secondary");
22
+ expect(buttonEl).toHaveClass("-secondary");
23
+ expect(button).toHaveProperty("icon");
24
+ expect(button.icon).toEqual(undefined);
25
+ expect(button).toHaveProperty("iconSize");
26
+ expect(button.iconSize).toBeUndefined;
27
+ });
28
+ it("has a method that validates the style property and resets an invalid property to a button type of secondary", async () => {
29
+ const page = await newSpecPage({
30
+ components: [Button],
31
+ html: "<wm-button></wm-button>",
32
+ });
33
+ const button = page.root;
34
+ expect(button).toHaveProperty("buttonType");
35
+ button.setAttribute("button-type", "foobar");
36
+ expect(button.buttonType).toEqual("secondary");
37
+ });
38
+ it("sets the aria label if the property labelForIdenticalButtons is passed", async () => {
39
+ const page = await newSpecPage({
40
+ components: [Button],
41
+ html: "<wm-button label-for-identical-buttons='read this instead of the text'>Button</wm-button>",
42
+ });
43
+ const button = page.root.shadowRoot.querySelector("button");
44
+ expect(button).toEqualAttribute("aria-label", "read this instead of the text");
45
+ });
46
+ // TOOLTIP
47
+ describe("error throwing", () => {
48
+ it("throws error when icononly or navigational button used without tooltip", async () => {
49
+ const mockFunc = jest.fn();
50
+ console.error = mockFunc;
51
+ await newSpecPage({
52
+ components: [Button],
53
+ html: "<wm-button icon='f1c0' button-type='icononly'></wm-button>",
54
+ });
55
+ expect(mockFunc).toHaveBeenCalledWith("wm-button should have a valid 'tooltip' property when button-type is set to 'icononly' or 'navigational'.");
56
+ const mockFunc2 = jest.fn();
57
+ console.error = mockFunc2;
58
+ await newSpecPage({
59
+ components: [Button],
60
+ html: "<wm-button icon='f1c0' button-type='navigational'></wm-button>",
61
+ });
62
+ expect(mockFunc2).toHaveBeenCalledWith("wm-button should have a valid 'tooltip' property when button-type is set to 'icononly' or 'navigational'.");
63
+ });
64
+ it("throws error when icononly button used without icon", async () => {
65
+ const mockFunc = jest.fn();
66
+ console.error = mockFunc;
67
+ await newSpecPage({
68
+ components: [Button],
69
+ html: "<wm-button button-type='icononly' tooltip='edit'></wm-button>",
70
+ });
71
+ expect(mockFunc).toHaveBeenCalledWith("wm-button should have a valid 'icon' property when button-type is set to 'icononly' or 'navigational'.");
72
+ });
73
+ });
74
+ });
@@ -534,11 +534,11 @@ export class PrivDatepicker {
534
534
  }
535
535
  render() {
536
536
  const dates = this.getCalendarDates(this.monthInFocus, this.yearInFocus);
537
- return (h("div", { key: '63dd17051b10d920b9763c2b63c7118afa864893', class: "container", id: "wm-container" }, h("button", { key: 'a627ca7a362da89e6459e29d16c6a186a2abab16', disabled: this.disabled, onClick: this.togglePopup.bind(this), "aria-describedby": "date-input", ref: (el) => (this.buttonEl = el), "aria-expanded": `${this.isExpanded}`, class: "toggle", id: "toggle" }, h("span", { key: 'b8fe448b71923d162da3255122b9691d4079b69a', class: "calendar", title: intl.formatMessage({
537
+ return (h("div", { class: "container", id: "wm-container" }, h("button", { disabled: this.disabled, onClick: this.togglePopup.bind(this), "aria-describedby": "date-input", ref: (el) => (this.buttonEl = el), "aria-expanded": `${this.isExpanded}`, class: "toggle", id: "toggle" }, h("span", { class: "calendar", title: intl.formatMessage({
538
538
  id: "date.calendarView",
539
539
  defaultMessage: "Calendar View",
540
540
  description: "Calendar button",
541
- }) })), h("div", { key: '7c63c85d3683903cd8557f2412acdccf2b349d09', class: `popup ${this.view}-view ${this.openUp ? "expand-upwards" : ""}`, id: "popup", ref: (el) => (this.popupEl = el), onClick: () => (this.popupClicked = true), role: "application", "aria-describedby": "application" }, this.view === "day" ? (h("div", { class: "day-view" }, h("div", { class: "calendar-header" }, h("button", { onClick: () => {
541
+ }) })), h("div", { class: `popup ${this.view}-view ${this.openUp ? "expand-upwards" : ""}`, id: "popup", ref: (el) => (this.popupEl = el), onClick: () => (this.popupClicked = true), role: "application", "aria-describedby": "application" }, this.view === "day" ? (h("div", { class: "day-view" }, h("div", { class: "calendar-header" }, h("button", { onClick: () => {
542
542
  this.prevClicked = true;
543
543
  this.popupClicked = true;
544
544
  this.backOneMonth();
@@ -623,15 +623,15 @@ export class PrivDatepicker {
623
623
  .slice(6, 9)
624
624
  .map((month, index) => this.renderMonths(month, index + 6))), h("div", { role: "row", class: "month-row" }, this.calendar_months
625
625
  .slice(9)
626
- .map((month, index) => this.renderMonths(month, index + 9))))))), this.isExpanded && h("div", { key: 'd6498e254f33356e698b38fc803e6c7dd8dc754b', id: "live-region", "aria-live": "polite", "aria-relevant": "text", class: "sr-only" }), h("div", { key: '023003cea63532f55a674d6e75aad6d2efca5d32', id: "month-title", class: "sr-only" }, intl.formatMessage({
626
+ .map((month, index) => this.renderMonths(month, index + 9))))))), this.isExpanded && h("div", { id: "live-region", "aria-live": "polite", "aria-relevant": "text", class: "sr-only" }), h("div", { id: "month-title", class: "sr-only" }, intl.formatMessage({
627
627
  id: "date.selectMonth",
628
628
  defaultMessage: "Activate to select a month.",
629
629
  description: "Calendar button",
630
- })), h("div", { key: '0c6358445c65906e90e3b97d560a8efa558849e0', id: "year-title", class: "sr-only" }, intl.formatMessage({
630
+ })), h("div", { id: "year-title", class: "sr-only" }, intl.formatMessage({
631
631
  id: "date.selectYear",
632
632
  defaultMessage: "Activate to select a year.",
633
633
  description: "Calendar button",
634
- })), h("div", { key: '86ce610bb1f0b5ecf202ed7009aaf24d1d8fff90', id: "application", class: "sr-only" }, intl.formatMessage({
634
+ })), h("div", { id: "application", class: "sr-only" }, intl.formatMessage({
635
635
  id: "date.instructions",
636
636
  defaultMessage: "Use arrows to select a date in the table. Tab left or right to buttons for selecting previous month, next month, or the month selection table.",
637
637
  }))));
@@ -0,0 +1,76 @@
1
+ import { newSpecPage } from "@stencil/core/testing";
2
+ import { PrivDatepicker } from "./priv-datepicker";
3
+ describe("priv-datepicker", () => {
4
+ // ts erroneously prints a warning (unused var)
5
+ // @ts-ignore
6
+ let page, privDatepicker;
7
+ beforeEach(async () => {
8
+ page = await newSpecPage({
9
+ components: [PrivDatepicker],
10
+ html: "<priv-datepicker></priv-datepicker>",
11
+ });
12
+ privDatepicker = page.root;
13
+ });
14
+ it("gets the number of days in a month", async () => {
15
+ const pd = new PrivDatepicker();
16
+ expect(pd.getMonthDays(1, 2021)).toBe(31);
17
+ expect(pd.getMonthDays(2, 2021)).toBe(28);
18
+ expect(pd.getMonthDays(2, 2020)).toBe(29);
19
+ expect(pd.getMonthDays(11, 2067)).toBe(30);
20
+ expect(pd.getMonthDays(13, 2)).toBe(31); // returns 31 by default
21
+ });
22
+ it("pads numbers", async () => {
23
+ const pd = new PrivDatepicker();
24
+ expect(pd.zeroPad(3, 1)).toBe("3");
25
+ expect(pd.zeroPad(3, 2)).toBe("03");
26
+ expect(pd.zeroPad(3, 3)).toBe("003");
27
+ expect(pd.zeroPad("003", 3)).toBe("003");
28
+ expect(pd.zeroPad("12345", 3)).toBe("12345");
29
+ expect(pd.zeroPad("12345.34", 3)).toBe("12345.34");
30
+ });
31
+ it("removes leading zeroes", async () => {
32
+ const pd = new PrivDatepicker();
33
+ expect(pd.removeZeroes("12")).toBe(12);
34
+ expect(pd.removeZeroes("01")).toBe(1);
35
+ expect(pd.removeZeroes("0001312")).toBe(1312);
36
+ // note that the function only works for integers
37
+ // the following would fail
38
+ // expect(pd.removeZeroes("3.1415")).toBe(3.1415);
39
+ });
40
+ it("finds the first weekday of the month", async () => {
41
+ // 1 = Sunday, 7 = Saturday
42
+ const pd = new PrivDatepicker();
43
+ expect(pd.getMonthFirstDay(2, 2021)).toBe(2); // Mon
44
+ expect(pd.getMonthFirstDay(7, 1986)).toBe(3); // Tue
45
+ expect(pd.getMonthFirstDay(12, 2030)).toBe(1); // Sun
46
+ });
47
+ it("finds the previous month", async () => {
48
+ const pd = new PrivDatepicker();
49
+ expect(pd.getPreviousMonth(12, 2000)).toStrictEqual({ month: 11, year: 2000 });
50
+ expect(pd.getPreviousMonth(1, 2000)).toStrictEqual({ month: 12, year: 1999 });
51
+ });
52
+ it("finds the next month", async () => {
53
+ const pd = new PrivDatepicker();
54
+ expect(pd.getNextMonth(12, 2000)).toStrictEqual({ month: 1, year: 2001 });
55
+ expect(pd.getNextMonth(1, 2000)).toStrictEqual({ month: 2, year: 2000 });
56
+ });
57
+ it("generates the calendar dates", async () => {
58
+ const pd = new PrivDatepicker();
59
+ expect(pd.getCalendarDates(8, 2021)).toMatchSnapshot();
60
+ });
61
+ it("checks if the date is today", async () => {
62
+ // format is array with year, month, day
63
+ const pd = new PrivDatepicker();
64
+ expect(pd.isDateToday(["2012", "12", "12"])).toBe(false);
65
+ expect(pd.isDateToday(["2021", "9", "13"])).toBe(false);
66
+ const today = new Date();
67
+ let todayDateArray = [
68
+ today.getFullYear().toString(),
69
+ (today.getMonth() + 1).toString(),
70
+ today.getDate().toString(),
71
+ ];
72
+ todayDateArray[1] = pd.zeroPad(todayDateArray[1], 2);
73
+ todayDateArray[2] = pd.zeroPad(todayDateArray[2], 2);
74
+ expect(pd.isDateToday(todayDateArray)).toBe(true);
75
+ });
76
+ });