@watermarkinsights/ripple 5.12.0-8 → 5.12.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 (366) hide show
  1. package/dist/cjs/{chartFunctions-7314b414.js → chartFunctions-a1981e06.js} +31 -11
  2. package/dist/cjs/{functions-5ac8a62f.js → functions-4b187487.js} +1587 -370
  3. package/dist/{esm/app-globals-7306e215.js → cjs/global-4e034486.js} +2 -7
  4. package/dist/cjs/index-e86c28b6.js +2649 -0
  5. package/dist/cjs/{intl-07aaf53c.js → intl-7fd0760e.js} +104 -1
  6. package/dist/cjs/loader.cjs.js +3 -4
  7. package/dist/cjs/priv-calendar.cjs.entry.js +5 -6
  8. package/dist/cjs/priv-chart-popover.cjs.entry.js +5 -6
  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/priv-option-list.cjs.entry.js +14 -52
  12. package/dist/cjs/ripple.cjs.js +11 -12
  13. package/dist/cjs/wm-action-menu_2.cjs.entry.js +6 -8
  14. package/dist/cjs/wm-button.cjs.entry.js +4 -5
  15. package/dist/cjs/wm-chart-slice.cjs.entry.js +1 -1
  16. package/dist/cjs/wm-chart.cjs.entry.js +15 -9
  17. package/dist/cjs/wm-date-range.cjs.entry.js +21 -11
  18. package/dist/cjs/wm-datepicker.cjs.entry.js +8 -9
  19. package/dist/cjs/wm-file-list.cjs.entry.js +3 -4
  20. package/dist/cjs/wm-file.cjs.entry.js +4 -5
  21. package/dist/cjs/wm-input.cjs.entry.js +5 -6
  22. package/dist/cjs/wm-line-chart.cjs.entry.js +18 -18
  23. package/dist/cjs/wm-modal-pss_3.cjs.entry.js +10 -13
  24. package/dist/cjs/wm-modal_3.cjs.entry.js +13 -16
  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-nested-select.cjs.entry.js +16 -56
  28. package/dist/cjs/wm-optgroup.cjs.entry.js +4 -5
  29. package/dist/cjs/wm-option_2.cjs.entry.js +11 -25
  30. package/dist/cjs/wm-pagination.cjs.entry.js +65 -14
  31. package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +7 -9
  32. package/dist/cjs/wm-search.cjs.entry.js +6 -7
  33. package/dist/cjs/wm-snackbar.cjs.entry.js +13 -9
  34. package/dist/cjs/wm-tab-item_3.cjs.entry.js +14 -12
  35. package/dist/cjs/wm-tag-input.cjs.entry.js +29 -24
  36. package/dist/cjs/wm-tag-option.cjs.entry.js +2 -2
  37. package/dist/cjs/wm-textarea.cjs.entry.js +5 -6
  38. package/dist/cjs/wm-timepicker.cjs.entry.js +5 -6
  39. package/dist/cjs/wm-toggletip.cjs.entry.js +6 -7
  40. package/dist/cjs/wm-uploader.cjs.entry.js +6 -7
  41. package/dist/cjs/wm-wrapper.cjs.entry.js +1 -1
  42. package/dist/collection/collection-manifest.json +2 -2
  43. package/dist/collection/components/charts/chartFunctions.js +29 -9
  44. package/dist/collection/components/charts/chartFunctions.spec.js +16 -0
  45. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.e2e.js +81 -0
  46. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +2 -2
  47. package/dist/collection/components/charts/screenshots.e2e.js +96 -0
  48. package/dist/collection/components/charts/wm-chart/wm-chart.e2e.js +213 -0
  49. package/dist/collection/components/charts/wm-chart/wm-chart.js +10 -3
  50. package/dist/collection/components/charts/wm-chart/wm-chart.spec.js +37 -0
  51. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.e2e.js +176 -0
  52. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.js +14 -13
  53. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.spec.js +163 -0
  54. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +1 -1
  55. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.e2e.js +69 -0
  56. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +1 -1
  57. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.spec.js +79 -0
  58. package/dist/collection/components/datepickers/priv-calendar/priv-calendar.js +2 -2
  59. package/dist/collection/components/datepickers/priv-calendar/priv-calendar.spec.js +89 -0
  60. package/dist/collection/components/datepickers/wm-date-range.e2e.js +443 -0
  61. package/dist/collection/components/datepickers/wm-date-range.js +26 -19
  62. package/dist/collection/components/datepickers/wm-date-range.spec.js +22 -0
  63. package/dist/collection/components/datepickers/wm-datepicker.e2e.js +382 -0
  64. package/dist/collection/components/datepickers/wm-datepicker.js +13 -17
  65. package/dist/collection/components/datepickers/wm-datepicker.spec.js +21 -0
  66. package/dist/collection/components/selects/priv-option-list/priv-option-list.js +16 -55
  67. package/dist/collection/components/selects/wm-nested-select/wm-nested-select.js +17 -56
  68. package/dist/collection/components/selects/wm-optgroup/wm-optgroup.js +1 -1
  69. package/dist/collection/components/selects/wm-option/wm-option.e2e.js +22 -0
  70. package/dist/collection/components/selects/wm-option/wm-option.js +1 -1
  71. package/dist/collection/components/selects/wm-option/wm-option.spec.js +63 -0
  72. package/dist/collection/components/selects/wm-select/wm-select.e2e.js +521 -0
  73. package/dist/collection/components/selects/wm-select/wm-select.js +10 -22
  74. package/dist/collection/components/selects/wm-select/wm-select.spec.js +271 -0
  75. package/dist/collection/components/wm-action-menu/wm-action-menu.e2e.js +200 -0
  76. package/dist/collection/components/wm-action-menu/wm-action-menu.js +1 -1
  77. package/dist/collection/components/wm-action-menu/wm-action-menu.spec.js +48 -0
  78. package/dist/collection/components/wm-button/wm-button.e2e.js +55 -0
  79. package/dist/collection/components/wm-button/wm-button.js +1 -1
  80. package/dist/collection/components/wm-button/wm-button.spec.js +74 -0
  81. package/dist/collection/components/wm-file/wm-file.js +1 -1
  82. package/dist/collection/components/wm-file/wm-file.spec.js +194 -0
  83. package/dist/collection/components/wm-file-list/wm-file-list.js +1 -1
  84. package/dist/collection/components/wm-file-list/wm-file-list.spec.js +69 -0
  85. package/dist/collection/components/wm-input/wm-input.e2e.js +32 -0
  86. package/dist/collection/components/wm-input/wm-input.js +1 -1
  87. package/dist/collection/components/wm-input/wm-input.spec.js +173 -0
  88. package/dist/collection/components/wm-menuitem/wm-menuitem.e2e.js +23 -0
  89. package/dist/collection/components/wm-menuitem/wm-menuitem.js +1 -1
  90. package/dist/collection/components/wm-menuitem/wm-menuitem.spec.js +54 -0
  91. package/dist/collection/components/wm-modal/wm-modal-footer.css +9 -16
  92. package/dist/collection/components/wm-modal/wm-modal-footer.js +1 -1
  93. package/dist/collection/components/wm-modal/wm-modal-footer.spec.js +11 -0
  94. package/dist/collection/components/wm-modal/wm-modal-header.css +1 -3
  95. package/dist/collection/components/wm-modal/wm-modal-header.js +1 -1
  96. package/dist/collection/components/wm-modal/wm-modal-header.spec.js +8 -0
  97. package/dist/collection/components/wm-modal/wm-modal.css +5 -4
  98. package/dist/collection/components/wm-modal/wm-modal.e2e.js +104 -0
  99. package/dist/collection/components/wm-modal/wm-modal.js +2 -2
  100. package/dist/collection/components/wm-modal/wm-modal.spec.js +30 -0
  101. package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.js +1 -1
  102. package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.js +1 -1
  103. package/dist/collection/components/wm-modal-pss/wm-modal-pss.js +2 -2
  104. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +1 -1
  105. package/dist/collection/components/wm-navigation/wm-navigation-item.js +1 -1
  106. package/dist/collection/components/wm-navigation/wm-navigation.e2e.js +102 -0
  107. package/dist/collection/components/wm-navigation/wm-navigation.js +2 -2
  108. package/dist/collection/components/wm-navigation/wm-navigation.spec.js +91 -0
  109. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.e2e.js +50 -0
  110. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +1 -1
  111. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +1 -1
  112. package/dist/collection/components/wm-navigator/wm-navigator.e2e.js +209 -0
  113. package/dist/collection/components/wm-navigator/wm-navigator.spec.js +177 -0
  114. package/dist/collection/components/wm-pagination/wm-pagination.e2e.js +312 -0
  115. package/dist/collection/components/wm-pagination/wm-pagination.js +63 -11
  116. package/dist/collection/components/wm-search/wm-search.e2e.js +76 -0
  117. package/dist/collection/components/wm-search/wm-search.js +4 -5
  118. package/dist/collection/components/wm-search/wm-search.spec.js +71 -0
  119. package/dist/collection/components/wm-snackbar/wm-snackbar.e2e.js +112 -0
  120. package/dist/collection/components/wm-snackbar/wm-snackbar.js +10 -5
  121. package/dist/collection/components/wm-snackbar/wm-snackbar.spec.js +9 -0
  122. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +1 -1
  123. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +8 -3
  124. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +1 -1
  125. package/dist/collection/components/wm-tabs/wm-tabs.e2e.js +91 -0
  126. package/dist/collection/components/wm-tabs/wm-tabs.spec.js +12 -0
  127. package/dist/collection/components/wm-tag-input/wm-tag-input.e2e.js +204 -0
  128. package/dist/collection/components/wm-tag-input/wm-tag-input.js +25 -19
  129. package/dist/collection/components/wm-tag-input/wm-tag-input.spec.js +195 -0
  130. package/dist/collection/components/wm-textarea/wm-textarea.e2e.js +41 -0
  131. package/dist/collection/components/wm-textarea/wm-textarea.js +1 -1
  132. package/dist/collection/components/wm-textarea/wm-textarea.spec.js +79 -0
  133. package/dist/collection/components/wm-timepicker/wm-timepicker.e2e.js +163 -0
  134. package/dist/collection/components/wm-timepicker/wm-timepicker.js +8 -11
  135. package/dist/collection/components/wm-timepicker/wm-timepicker.spec.js +147 -0
  136. package/dist/collection/components/wm-toggletip/wm-toggletip.css +0 -1
  137. package/dist/collection/components/wm-toggletip/wm-toggletip.e2e.js +69 -0
  138. package/dist/collection/components/wm-toggletip/wm-toggletip.js +2 -2
  139. package/dist/collection/components/wm-toggletip/wm-toggletip.spec.js +21 -0
  140. package/dist/collection/components/wm-uploader/wm-uploader.e2e.js +70 -0
  141. package/dist/collection/components/wm-uploader/wm-uploader.js +2 -2
  142. package/dist/collection/components/wm-uploader/wm-uploader.spec.js +234 -0
  143. package/dist/collection/global/functions.spec.js +126 -0
  144. package/dist/collection/global/intl.js +102 -0
  145. package/dist/collection/lang/lang.spec.js +20 -0
  146. package/dist/collection/lang/piglatin.js +9 -1
  147. package/dist/esm/{chartFunctions-1478f4db.js → chartFunctions-9099c7e9.js} +31 -11
  148. package/dist/esm/{functions-f53b3537.js → functions-00e1916b.js} +1588 -371
  149. package/dist/{cjs/app-globals-f0911027.js → esm/global-c76064cb.js} +1 -10
  150. package/dist/esm/index-558b5a82.js +2618 -0
  151. package/dist/esm/{intl-6426ba51.js → intl-a6f16883.js} +104 -2
  152. package/dist/esm/loader.js +4 -5
  153. package/dist/esm/priv-calendar.entry.js +5 -6
  154. package/dist/esm/priv-chart-popover.entry.js +5 -6
  155. package/dist/esm/priv-navigator-button.entry.js +3 -4
  156. package/dist/esm/priv-navigator-item.entry.js +3 -4
  157. package/dist/esm/priv-option-list.entry.js +14 -52
  158. package/dist/esm/ripple.js +12 -13
  159. package/dist/esm/wm-action-menu_2.entry.js +6 -8
  160. package/dist/esm/wm-button.entry.js +4 -5
  161. package/dist/esm/wm-chart-slice.entry.js +1 -1
  162. package/dist/esm/wm-chart.entry.js +15 -9
  163. package/dist/esm/wm-date-range.entry.js +21 -11
  164. package/dist/esm/wm-datepicker.entry.js +8 -9
  165. package/dist/esm/wm-file-list.entry.js +3 -4
  166. package/dist/esm/wm-file.entry.js +4 -5
  167. package/dist/esm/wm-input.entry.js +5 -6
  168. package/dist/esm/wm-line-chart.entry.js +18 -18
  169. package/dist/esm/wm-modal-pss_3.entry.js +10 -13
  170. package/dist/esm/wm-modal_3.entry.js +13 -16
  171. package/dist/esm/wm-navigation_3.entry.js +10 -13
  172. package/dist/esm/wm-navigator.entry.js +3 -4
  173. package/dist/esm/wm-nested-select.entry.js +16 -56
  174. package/dist/esm/wm-optgroup.entry.js +4 -5
  175. package/dist/esm/wm-option_2.entry.js +11 -25
  176. package/dist/esm/wm-pagination.entry.js +65 -14
  177. package/dist/esm/wm-progress-indicator_3.entry.js +7 -9
  178. package/dist/esm/wm-search.entry.js +6 -7
  179. package/dist/esm/wm-snackbar.entry.js +13 -9
  180. package/dist/esm/wm-tab-item_3.entry.js +14 -12
  181. package/dist/esm/wm-tag-input.entry.js +29 -24
  182. package/dist/esm/wm-tag-option.entry.js +2 -2
  183. package/dist/esm/wm-textarea.entry.js +5 -6
  184. package/dist/esm/wm-timepicker.entry.js +5 -6
  185. package/dist/esm/wm-toggletip.entry.js +6 -7
  186. package/dist/esm/wm-uploader.entry.js +6 -7
  187. package/dist/esm/wm-wrapper.entry.js +1 -1
  188. package/dist/esm-es5/chartFunctions-9099c7e9.js +1 -0
  189. package/dist/esm-es5/functions-00e1916b.js +1 -0
  190. package/dist/esm-es5/global-c76064cb.js +1 -0
  191. package/dist/esm-es5/index-558b5a82.js +1 -0
  192. package/dist/esm-es5/intl-a6f16883.js +1 -0
  193. package/dist/esm-es5/loader.js +1 -1
  194. package/dist/esm-es5/priv-calendar.entry.js +1 -1
  195. package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
  196. package/dist/esm-es5/priv-navigator-button.entry.js +1 -1
  197. package/dist/esm-es5/priv-navigator-item.entry.js +1 -1
  198. package/dist/esm-es5/priv-option-list.entry.js +1 -1
  199. package/dist/esm-es5/ripple.js +1 -1
  200. package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
  201. package/dist/esm-es5/wm-button.entry.js +1 -1
  202. package/dist/esm-es5/wm-chart-slice.entry.js +1 -1
  203. package/dist/esm-es5/wm-chart.entry.js +1 -1
  204. package/dist/esm-es5/wm-date-range.entry.js +1 -1
  205. package/dist/esm-es5/wm-datepicker.entry.js +1 -1
  206. package/dist/esm-es5/wm-file-list.entry.js +1 -1
  207. package/dist/esm-es5/wm-file.entry.js +1 -1
  208. package/dist/esm-es5/wm-input.entry.js +1 -1
  209. package/dist/esm-es5/wm-line-chart.entry.js +1 -1
  210. package/dist/esm-es5/wm-modal-pss_3.entry.js +1 -1
  211. package/dist/esm-es5/wm-modal_3.entry.js +1 -1
  212. package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
  213. package/dist/esm-es5/wm-navigator.entry.js +1 -1
  214. package/dist/esm-es5/wm-nested-select.entry.js +1 -1
  215. package/dist/esm-es5/wm-optgroup.entry.js +1 -1
  216. package/dist/esm-es5/wm-option_2.entry.js +1 -1
  217. package/dist/esm-es5/wm-pagination.entry.js +1 -1
  218. package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
  219. package/dist/esm-es5/wm-search.entry.js +1 -1
  220. package/dist/esm-es5/wm-snackbar.entry.js +1 -1
  221. package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
  222. package/dist/esm-es5/wm-tag-input.entry.js +1 -1
  223. package/dist/esm-es5/wm-tag-option.entry.js +1 -1
  224. package/dist/esm-es5/wm-textarea.entry.js +1 -1
  225. package/dist/esm-es5/wm-timepicker.entry.js +1 -1
  226. package/dist/esm-es5/wm-toggletip.entry.js +1 -1
  227. package/dist/esm-es5/wm-uploader.entry.js +1 -1
  228. package/dist/esm-es5/wm-wrapper.entry.js +1 -1
  229. package/dist/loader/cdn.js +2 -1
  230. package/dist/loader/index.cjs.js +2 -1
  231. package/dist/loader/index.d.ts +0 -3
  232. package/dist/loader/index.es2017.js +2 -1
  233. package/dist/loader/index.js +2 -1
  234. package/dist/ripple/p-05ae54d7.entry.js +1 -0
  235. package/dist/ripple/{p-fdfa3579.system.entry.js → p-0d89d63c.system.entry.js} +1 -1
  236. package/dist/ripple/p-118c47eb.system.entry.js +1 -0
  237. package/dist/ripple/{p-658f146a.system.entry.js → p-1a4b6b02.system.entry.js} +1 -1
  238. package/dist/ripple/{p-a0edf336.system.entry.js → p-1a4b7504.system.entry.js} +1 -1
  239. package/dist/ripple/{p-165b5d3d.system.entry.js → p-1a71d867.system.entry.js} +1 -1
  240. package/dist/ripple/p-1a951dfb.entry.js +1 -0
  241. package/dist/ripple/{p-28f9e202.system.entry.js → p-1c8f550f.system.entry.js} +1 -1
  242. package/dist/ripple/p-1f751b87.js +1 -0
  243. package/dist/ripple/p-1fac5bf9.js +1 -0
  244. package/dist/ripple/{p-03fafb82.entry.js → p-20a8f732.system.entry.js} +1 -1
  245. package/dist/ripple/{p-3b5d106d.entry.js → p-249b56fb.entry.js} +1 -1
  246. package/dist/ripple/p-249d13a1.system.entry.js +1 -0
  247. package/dist/ripple/p-26906899.entry.js +1 -0
  248. package/dist/ripple/{p-486b3b56.system.entry.js → p-28119645.system.entry.js} +1 -1
  249. package/dist/ripple/{p-a2544443.system.js → p-2f37f3ee.system.js} +1 -1
  250. package/dist/ripple/{p-823d7b4e.system.entry.js → p-32bf3f5b.system.entry.js} +1 -1
  251. package/dist/ripple/{p-20b137a3.system.entry.js → p-335c03d3.system.entry.js} +1 -1
  252. package/dist/ripple/p-363b534b.entry.js +1 -0
  253. package/dist/ripple/p-393e4636.js +1 -0
  254. package/dist/ripple/p-39f79d71.system.entry.js +1 -0
  255. package/dist/ripple/{p-ff60375d.system.entry.js → p-3a231f4b.system.entry.js} +1 -1
  256. package/dist/ripple/{p-55f8aa05.entry.js → p-3d4bb85f.entry.js} +1 -1
  257. package/dist/ripple/p-4228de00.entry.js +1 -0
  258. package/dist/ripple/{p-13b1d775.entry.js → p-48e09589.entry.js} +1 -1
  259. package/dist/ripple/p-4f8fe1d1.system.js +1 -0
  260. package/dist/ripple/{p-02e60a11.system.entry.js → p-522ecb7d.system.entry.js} +1 -1
  261. package/dist/ripple/{p-ee825214.entry.js → p-54d6f0f9.entry.js} +1 -1
  262. package/dist/ripple/p-568c595f.js +2 -0
  263. package/dist/ripple/p-56aeee6e.system.entry.js +1 -0
  264. package/dist/ripple/p-5e6a4f70.system.js +1 -0
  265. package/dist/ripple/{p-82819500.system.entry.js → p-5f082360.system.entry.js} +1 -1
  266. package/dist/ripple/p-5f5fe905.js +1 -0
  267. package/dist/ripple/p-617c2c75.entry.js +1 -0
  268. package/dist/ripple/{p-4fbe205e.system.entry.js → p-6524c53e.system.entry.js} +1 -1
  269. package/dist/ripple/{p-043901ab.system.entry.js → p-65d26233.system.entry.js} +1 -1
  270. package/dist/ripple/p-6834a6d3.entry.js +1 -0
  271. package/dist/ripple/{p-81ac8d49.entry.js → p-68e04222.entry.js} +1 -1
  272. package/dist/ripple/{p-f778baf4.system.entry.js → p-68fddfaa.system.entry.js} +1 -1
  273. package/dist/ripple/{p-e2fbed8c.system.entry.js → p-694903e6.system.entry.js} +1 -1
  274. package/dist/ripple/p-73ca2f26.system.js +1 -0
  275. package/dist/ripple/{p-1f174e18.system.entry.js → p-7b6a65f8.system.entry.js} +1 -1
  276. package/dist/ripple/{p-a9a7731b.system.entry.js → p-7b7e1eb5.system.entry.js} +1 -1
  277. package/dist/ripple/{p-cd0cc88d.entry.js → p-88ebddd7.entry.js} +1 -1
  278. package/dist/ripple/{p-791513e7.entry.js → p-8c1d27a7.entry.js} +1 -1
  279. package/dist/ripple/{p-ccae5bec.entry.js → p-8e9c24f3.entry.js} +1 -1
  280. package/dist/ripple/{p-b16f07f1.system.entry.js → p-8f836507.system.entry.js} +1 -1
  281. package/dist/ripple/p-94495341.entry.js +1 -0
  282. package/dist/ripple/{p-76f9acec.entry.js → p-958331bf.entry.js} +1 -1
  283. package/dist/ripple/p-9872623b.entry.js +1 -0
  284. package/dist/ripple/{p-e6e36701.system.entry.js → p-9ab3c088.system.entry.js} +1 -1
  285. package/dist/ripple/p-9aedd599.entry.js +1 -0
  286. package/dist/ripple/p-9b848151.entry.js +1 -0
  287. package/dist/ripple/{p-3376581a.system.entry.js → p-a04ef164.system.entry.js} +1 -1
  288. package/dist/ripple/{p-02bd68af.system.entry.js → p-a78bb423.system.entry.js} +1 -1
  289. package/dist/ripple/{p-0d163672.system.entry.js → p-a880d9a0.system.entry.js} +1 -1
  290. package/dist/ripple/p-ab8d78cc.system.js +2 -0
  291. package/dist/ripple/p-adc254e6.entry.js +1 -0
  292. package/dist/ripple/p-b165d61a.entry.js +1 -0
  293. package/dist/ripple/p-b39377c7.entry.js +1 -0
  294. package/dist/ripple/p-b9bca547.entry.js +1 -0
  295. package/dist/ripple/p-bae2c236.entry.js +1 -0
  296. package/dist/ripple/{p-8634abad.system.entry.js → p-c53f3704.system.entry.js} +1 -1
  297. package/dist/ripple/p-c56ff16f.entry.js +1 -0
  298. package/dist/ripple/{p-94fbf6f6.system.entry.js → p-c8cf09a2.system.entry.js} +1 -1
  299. package/dist/ripple/p-cbdceb6e.entry.js +1 -0
  300. package/dist/ripple/p-cc813406.system.js +1 -0
  301. package/dist/ripple/{p-529f179c.system.entry.js → p-d20a0f0c.system.entry.js} +1 -1
  302. package/dist/ripple/p-d6111226.entry.js +1 -0
  303. package/dist/ripple/{p-f28106ea.entry.js → p-da68c87c.entry.js} +1 -1
  304. package/dist/ripple/{p-e8cfa832.entry.js → p-ddef82fa.system.entry.js} +1 -1
  305. package/dist/ripple/p-dee6d5a3.entry.js +1 -0
  306. package/dist/ripple/p-e55d5371.entry.js +1 -0
  307. package/dist/ripple/{p-7959c4bd.system.entry.js → p-e8c22f01.system.entry.js} +1 -1
  308. package/dist/ripple/p-f555831b.entry.js +1 -0
  309. package/dist/ripple/{p-226217d3.system.entry.js → p-f5c40e9e.system.entry.js} +1 -1
  310. package/dist/ripple/p-f9cade98.entry.js +1 -0
  311. package/dist/ripple/{p-fc7965e4.system.entry.js → p-fa09191b.system.entry.js} +1 -1
  312. package/dist/ripple/{p-233f14ec.system.entry.js → p-fdfca58b.entry.js} +1 -1
  313. package/dist/ripple/ripple.esm.js +1 -1
  314. package/dist/ripple/ripple.js +1 -1
  315. package/dist/types/components/selects/priv-option-list/priv-option-list.d.ts +0 -6
  316. package/dist/types/components/wm-pagination/wm-pagination.d.ts +6 -0
  317. package/dist/types/components/wm-snackbar/wm-snackbar.d.ts +1 -0
  318. package/dist/types/components/wm-tabs/wm-tab-list/wm-tab-list.d.ts +1 -0
  319. package/dist/types/components/wm-tag-input/wm-tag-input.d.ts +2 -1
  320. package/dist/types/global/intl.d.ts +22 -0
  321. package/dist/types/stencil-public-runtime.d.ts +10 -3
  322. package/package.json +2 -2
  323. package/dist/cjs/index-788526f5.js +0 -1859
  324. package/dist/esm/index-130e07bb.js +0 -1828
  325. package/dist/esm-es5/app-globals-7306e215.js +0 -1
  326. package/dist/esm-es5/chartFunctions-1478f4db.js +0 -1
  327. package/dist/esm-es5/functions-f53b3537.js +0 -1
  328. package/dist/esm-es5/index-130e07bb.js +0 -1
  329. package/dist/esm-es5/intl-6426ba51.js +0 -1
  330. package/dist/ripple/p-243a7a17.system.entry.js +0 -1
  331. package/dist/ripple/p-263e42e0.entry.js +0 -1
  332. package/dist/ripple/p-2c8153c1.entry.js +0 -1
  333. package/dist/ripple/p-368e9ee9.entry.js +0 -1
  334. package/dist/ripple/p-3a2a3b70.entry.js +0 -1
  335. package/dist/ripple/p-45b5d2d2.entry.js +0 -1
  336. package/dist/ripple/p-49e24926.entry.js +0 -1
  337. package/dist/ripple/p-50294e3f.entry.js +0 -1
  338. package/dist/ripple/p-53400bc4.system.entry.js +0 -1
  339. package/dist/ripple/p-58734b13.entry.js +0 -1
  340. package/dist/ripple/p-5c62e26d.entry.js +0 -1
  341. package/dist/ripple/p-6136d0d7.entry.js +0 -1
  342. package/dist/ripple/p-66141f19.entry.js +0 -1
  343. package/dist/ripple/p-713ea307.entry.js +0 -1
  344. package/dist/ripple/p-727175e1.system.entry.js +0 -1
  345. package/dist/ripple/p-77a96f3e.system.entry.js +0 -1
  346. package/dist/ripple/p-79f8f38d.entry.js +0 -1
  347. package/dist/ripple/p-7a1bb29b.js +0 -1
  348. package/dist/ripple/p-84dc142f.js +0 -1
  349. package/dist/ripple/p-864158de.system.entry.js +0 -1
  350. package/dist/ripple/p-87e5a642.system.js +0 -1
  351. package/dist/ripple/p-8c95493c.js +0 -1
  352. package/dist/ripple/p-94dc80a0.entry.js +0 -1
  353. package/dist/ripple/p-9513c937.system.js +0 -1
  354. package/dist/ripple/p-9b739280.entry.js +0 -1
  355. package/dist/ripple/p-a280d710.entry.js +0 -1
  356. package/dist/ripple/p-c550716e.js +0 -1
  357. package/dist/ripple/p-cef8a45b.system.js +0 -2
  358. package/dist/ripple/p-d530c703.entry.js +0 -1
  359. package/dist/ripple/p-d96291e7.entry.js +0 -1
  360. package/dist/ripple/p-d9da0502.js +0 -2
  361. package/dist/ripple/p-e973024a.entry.js +0 -1
  362. package/dist/ripple/p-ed24dc42.entry.js +0 -1
  363. package/dist/ripple/p-f471ee29.system.js +0 -1
  364. package/dist/ripple/p-f66480de.entry.js +0 -1
  365. package/dist/ripple/p-f9a71cf6.entry.js +0 -1
  366. package/dist/ripple/p-ffbb9fc0.system.js +0 -1
@@ -6,25 +6,31 @@ export class TagInput {
6
6
  this.addNewHelpText = intl.formatMessage({
7
7
  id: "tagInput.addNewHelpText",
8
8
  defaultMessage: "Press the Enter or Comma key to add a new tag.",
9
- description: "Help text appearing in a dropdown. Use imperative",
9
+ description: "Instructional text, where tag refers to a tag UI element that can be added to a list. Use imperative",
10
10
  });
11
11
  this.selectionHelpText = intl.formatMessage({
12
12
  id: "tagInput.selectionHelpText",
13
13
  defaultMessage: "Search and select a tag.",
14
- description: "Help text appearing in a dropdown. Use imperative",
14
+ description: "Instructional text, where tag refers to a tag UI element that can be added to a list. Use imperative",
15
15
  });
16
16
  this.maxTagsReachedMessage = intl.formatMessage({
17
17
  id: "tagInput.maxTagsReached",
18
18
  defaultMessage: "No more tags can be added because the limit has been reached.",
19
+ description: "Tag refers to a tag UI element that can be added to a list.",
19
20
  });
20
21
  this.tagAreaInstructions = intl.formatMessage({
21
22
  id: "tagInput.tagAreaInstructions",
22
23
  defaultMessage: "tag selection. Press Backspace or Delete to remove a tag.",
24
+ description: "Label for a UI element where a user can select from a list of tags.",
23
25
  });
24
26
  this.tagsAddedMessage = intl.formatMessage({
25
27
  id: "tagInput.tagsAdded",
26
28
  defaultMessage: "Tags added",
27
- description: "Full message for context: 'Tags added: x/y",
29
+ description: "Tag refers to a tag UI element that can be added to a list. Full message for context: 'Tags added: x/y",
30
+ });
31
+ this.noResultsMessage = intl.formatMessage({
32
+ id: "tagInput.noResults",
33
+ defaultMessage: "No results match your search.",
28
34
  });
29
35
  this.openUp = false;
30
36
  this.inModal = false;
@@ -51,6 +57,13 @@ export class TagInput {
51
57
  this.focusedTagIndex = undefined;
52
58
  this.tagsList = [];
53
59
  }
60
+ addNewTagMessage(newTagName) {
61
+ return intl.formatMessage({
62
+ id: "tagInput.addNewTag",
63
+ defaultMessage: "Add {newTagName}",
64
+ description: "Button text to add a new tag to a list of tags",
65
+ }, { newTagName: newTagName });
66
+ }
54
67
  toggleKeyingOn() {
55
68
  this.isKeying = true;
56
69
  }
@@ -142,13 +155,6 @@ export class TagInput {
142
155
  get tagLimitReached() {
143
156
  return !!(this.maxTags && this.taggedOptions.length >= this.maxTags);
144
157
  }
145
- get noResultsMessage() {
146
- return intl.formatMessage({
147
- id: "tagInput.noResults",
148
- defaultMessage: "No results match your search.",
149
- description: "Message displayed when a user's search returns empty.",
150
- });
151
- }
152
158
  get inputMinimumWidth() {
153
159
  if (this._tagEls) {
154
160
  // 150px is the minimum width of the input field, or the length of the placeholder text
@@ -180,28 +186,28 @@ export class TagInput {
180
186
  return intl.formatMessage({
181
187
  id: "tagInput.tagAdded",
182
188
  defaultMessage: "{tagName} added.",
183
- description: "A confirmation for adding a tag.",
189
+ description: "Confirmation for adding a tag UI element to a list of tags.",
184
190
  }, { tagName: tag });
185
191
  }
186
192
  tagRemovedMessage(tag) {
187
193
  return intl.formatMessage({
188
194
  id: "tagInput.tagRemoved",
189
195
  defaultMessage: "{tagName} removed.",
190
- description: "A confirmation for removing a tag.",
196
+ description: "Confirmation for removing a tag UI element from a list of tags.",
191
197
  }, { tagName: tag });
192
198
  }
193
199
  tagAlreadyAddedMessage(tag) {
194
200
  return intl.formatMessage({
195
201
  id: "tagInput.tagAlreadyAdded",
196
202
  defaultMessage: "{tagName} has already been added.",
197
- description: "An alert for adding a tag that is already present.",
203
+ description: "Alert for adding a tag UI element that is already included in the list.",
198
204
  }, { tagName: tag });
199
205
  }
200
206
  tagLockedMessage(tag) {
201
207
  return intl.formatMessage({
202
208
  id: "tagInput.tagLocked",
203
209
  defaultMessage: "{tagName} is locked and cannot be removed.",
204
- description: "An alert for when a user tries to remove a tag that is locked.",
210
+ description: "Alert indicating a tag UI element cannot be removed from its list.",
205
211
  }, { tagName: tag });
206
212
  }
207
213
  isElOrChild(el) {
@@ -779,7 +785,7 @@ export class TagInput {
779
785
  const optionAlreadyExists = this.isExistingTag(this.inputEl.value.trim());
780
786
  return (this.addNew &&
781
787
  hasNonWhiteSpaceCharacters &&
782
- !optionAlreadyExists && (h("li", { ref: (el) => (this.addNewButton = el), id: "add-new-btn", class: "add-new-btn", onClick: () => this.addTags(inputValue) }, "Add " + inputValue)));
788
+ !optionAlreadyExists && (h("li", { ref: (el) => (this.addNewButton = el), id: "add-new-btn", class: "add-new-btn", onClick: () => this.addTags(inputValue) }, this.addNewTagMessage(inputValue))));
783
789
  }
784
790
  renderTable() {
785
791
  return (h("div", { class: "table-wrapper", onScroll: () => this.dismissTooltip() }, h("table", { id: "table", role: "grid", class: `${this.colWidths ? "fixed-widths" : ""}`, "aria-label": this.label, "aria-multiselectable": "true" }, this.renderTableHeaders(), this.filteredOptionEls.length ? (this.filteredOptionEls.map((o) => this.renderTableRow(o))) : (h("div", { class: "no-results" }, this.noResultsMessage)))));
@@ -840,7 +846,7 @@ export class TagInput {
840
846
  const classes = {
841
847
  focused: !!this._focusedCell && cellId === this._focusedCell.id,
842
848
  };
843
- return (h("td", { id: cellId, class: classes, role: "gridcell", "aria-describedby": `${cellId}-description`, "aria-selected": o.selected ? "true" : "false", "aria-readonly": o.locked ? "true" : null, onMouseEnter: (ev) => this.handleCellMouseEnter(ev), onMouseLeave: () => hideTooltip() }, h("div", { class: `cell-content-wrapper ${overflowRule}` }, o.locked && idx == 0 && h("div", { class: "svg-icon svg-locked" }), val), h("div", { class: "description", id: `${cellId}-description` }, o.locked ? "locked" : "")));
849
+ return (h("td", { id: cellId, class: classes, role: "gridcell", "aria-describedby": `${cellId}-description`, "aria-selected": o.selected ? "true" : "false", "aria-readonly": o.locked ? "true" : null, onMouseEnter: (ev) => this.handleCellMouseEnter(ev), onMouseLeave: () => hideTooltip() }, h("div", { class: `cell-content-wrapper ${overflowRule}` }, o.locked && idx == 0 && h("div", { class: "svg-icon svg-locked" }), val), h("div", { class: "description", id: `${cellId}-description` }, o.locked ? globalMessages.locked : "")));
844
850
  });
845
851
  }
846
852
  renderTableRow(o) {
@@ -858,12 +864,12 @@ export class TagInput {
858
864
  }
859
865
  }
860
866
  render() {
861
- return (h("div", { key: 'af231128d260623c879ef2089b09027063499160', class: `wrapper label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { key: '2f59f083c55296c78ed525a58d029bfc9b9529ee', class: "label-wrapper" }, h("label", { key: '635e5dd747f1d4efde1a69263852783233b2a5f0', class: "label", htmlFor: "input" }, this.label, this.requiredField && (h("span", { key: 'd320313704264ea92481fe5949dd7bb6d05c2a0d', class: "required", "aria-hidden": "true" }, "*")))), h("div", { key: '0b4ba6ae8448bc0163400f6491afd3d9698e229e', class: `field-wrapper ${this.el.shadowRoot.activeElement === this.inputEl ? "focused" : ""} ${this.errorMessage ? "invalid" : ""}`, ref: (el) => (this.fieldWrapperEl = el) }, h("div", { key: '2a88752b7448ea96bb22f810f4eb836eb8c46396', class: "upper-row" }, h("div", { key: '2a651303dd7ae11a1d4b69ec8d2238858c60db70', class: "svg-icon svg-search" }), h("div", { key: '91bee9d946319fc824b7e8d16044b94b25d69a52', class: `tags-and-input-wrapper ${this.inModal ? "in-modal" : ""}` }, h("ul", { key: '60e54382a3449bbc4cbeef5de986679201e4d019', ref: (el) => (this.tagAreaEl = el), class: `tag-area ${this.taggedOptions.length === 0 && "empty"} ${this.isKeying ? "user-is-keying" : ""}`, role: "listbox", "aria-activedescendant": this.focusedTag ? this.focusedTag.id : null, "aria-orientation": "horizontal", "aria-label": `${this.label} ${this.tagAreaInstructions}`, tabindex: this._tagEls.length > 0 ? 0 : -1, "aria-describedby": `info max-tags`, onFocus: (ev) => this.handleTagAreaFocus(ev), onBlur: (ev) => {
867
+ return (h("div", { class: `wrapper label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { class: "label-wrapper" }, h("label", { class: "label", htmlFor: "input" }, this.label, this.requiredField && (h("span", { class: "required", "aria-hidden": "true" }, "*")))), h("div", { class: `field-wrapper ${this.el.shadowRoot.activeElement === this.inputEl ? "focused" : ""} ${this.errorMessage ? "invalid" : ""}`, ref: (el) => (this.fieldWrapperEl = el) }, h("div", { class: "upper-row" }, h("div", { class: "svg-icon svg-search" }), h("div", { class: `tags-and-input-wrapper ${this.inModal ? "in-modal" : ""}` }, h("ul", { ref: (el) => (this.tagAreaEl = el), class: `tag-area ${this.taggedOptions.length === 0 && "empty"} ${this.isKeying ? "user-is-keying" : ""}`, role: "listbox", "aria-activedescendant": this.focusedTag ? this.focusedTag.id : null, "aria-orientation": "horizontal", "aria-label": `${this.label} ${this.tagAreaInstructions}`, tabindex: this._tagEls.length > 0 ? 0 : -1, "aria-describedby": `info max-tags`, onFocus: (ev) => this.handleTagAreaFocus(ev), onBlur: (ev) => {
862
868
  this.focusedTagIndex = undefined;
863
869
  this.handleBlur(ev);
864
- }, onKeyDown: (ev) => this.handleTagAreaKeyDown(ev) }, this.renderTags()), h("input", { key: 'e967fb3dd1543cc71e689127a3ff4de287e63122', id: "input", class: "input", role: "combobox", ref: (el) => (this.inputEl = el), autocomplete: "off", "aria-required": this.requiredField ? "true" : null, "aria-controls": this.tagInputType, "aria-describedby": `help-text${this.errorMessage ? " error " : ""} max-tags`, "aria-label": `${this.label} ${this.isDropdown ? globalMessages.getCharacterLimit(this.characterLimit) : ""}`, "aria-expanded": this.isDropdown ? this.isExpanded.toString() : null, "aria-activedescendant": this.inputActiveDescendantId, placeholder: this.placeholder, maxLength: this.isDropdown ? this.characterLimit : undefined, onInput: (ev) => this.handleInputChanged(ev), onBlur: (ev) => {
870
+ }, onKeyDown: (ev) => this.handleTagAreaKeyDown(ev) }, this.renderTags()), h("input", { id: "input", class: "input", role: "combobox", ref: (el) => (this.inputEl = el), autocomplete: "off", "aria-required": this.requiredField ? "true" : null, "aria-controls": this.tagInputType, "aria-describedby": `help-text${this.errorMessage ? " error " : ""} max-tags`, "aria-label": `${this.label} ${this.isDropdown ? globalMessages.getCharacterLimit(this.characterLimit) : ""}`, "aria-expanded": this.isDropdown ? this.isExpanded.toString() : null, "aria-activedescendant": this.inputActiveDescendantId, placeholder: this.placeholder, maxLength: this.isDropdown ? this.characterLimit : undefined, onInput: (ev) => this.handleInputChanged(ev), onBlur: (ev) => {
865
871
  this.handleBlur(ev);
866
- }, onFocus: () => this.handleInputFocus(), onKeyDown: (ev) => this.handleInputKeyDown(ev) })), this.isDropdown && (h("div", { key: '75b899bc274fd826a49dd70faa502ec2812e7ff7', class: "character-count" }, this.charCount, "/", this.characterLimit))), this.renderTagCounter(), this.isDropdown && this.renderDropdown()), this.info && (h("div", { key: '94b40202dce3a7f9e28e2ef7efcfc696c5613ac7', id: "info", class: "info-text" }, this.info)), h("div", { key: '1351786b25c5c28c65a646393c8f93a2a9bdf2c1', id: "error" }, this.errorMessage), h("div", { key: '6704903361bdfd1412df5d95d28b1569d0b303ad', class: "sr-only", "aria-live": "polite", ref: (el) => (this.liveRegionEl = el), "aria-atomic": "true" }, this.liveRegionMessage), this.isTable && this.renderTable()));
872
+ }, onFocus: () => this.handleInputFocus(), onKeyDown: (ev) => this.handleInputKeyDown(ev) })), this.isDropdown && (h("div", { class: "character-count" }, this.charCount, "/", this.characterLimit))), this.renderTagCounter(), this.isDropdown && this.renderDropdown()), this.info && (h("div", { id: "info", class: "info-text" }, this.info)), h("div", { id: "error" }, this.errorMessage), h("div", { class: "sr-only", "aria-live": "polite", ref: (el) => (this.liveRegionEl = el), "aria-atomic": "true" }, this.liveRegionMessage), this.isTable && this.renderTable()));
867
873
  }
868
874
  static get is() { return "wm-tag-input"; }
869
875
  static get encapsulation() { return "shadow"; }
@@ -0,0 +1,195 @@
1
+ import { newSpecPage } from "@stencil/core/testing";
2
+ import { TagInput } from "./wm-tag-input";
3
+ import { TagOption } from "./wm-tag-option/wm-tag-option";
4
+ import * as globalFuncs from "../../global/functions";
5
+ jest.spyOn(globalFuncs, "generateId");
6
+ // @ts-ignore
7
+ globalFuncs.generateId.mockImplementation(() => "random-id");
8
+ // mock observers
9
+ global.ResizeObserver = jest.fn().mockImplementation(() => ({
10
+ observe: jest.fn(),
11
+ unobserve: jest.fn(),
12
+ disconnect: jest.fn(),
13
+ }));
14
+ global.MutationObserver = jest.fn().mockImplementation(() => ({
15
+ observe: jest.fn(),
16
+ unobserve: jest.fn(),
17
+ disconnect: jest.fn(),
18
+ }));
19
+ // mockComputedStyle, component measures the placeholder on render to properly position the input
20
+ global.getComputedStyle = jest
21
+ .fn()
22
+ .mockImplementation(() => ({
23
+ paddingLeft: "0px",
24
+ paddingRight: "0px",
25
+ marginLeft: "0px",
26
+ marginRight: "0px",
27
+ }));
28
+ describe("taginput", () => {
29
+ let page;
30
+ beforeEach(async () => {
31
+ page = await newSpecPage({
32
+ components: [TagInput, TagOption],
33
+ html: `<wm-tag-input id="input" label="label">
34
+ <wm-tag-option>one</wm-tag-option>
35
+ <wm-tag-option>two</wm-tag-option>
36
+ <wm-tag-option>three</wm-tag-option>
37
+ <wm-tag-option>four</wm-tag-option>
38
+ </wm-tag-input>`,
39
+ });
40
+ });
41
+ it("builds", async () => {
42
+ expect(page.root).toMatchSnapshot();
43
+ });
44
+ it("has right aria roles", async () => {
45
+ page = await newSpecPage({
46
+ components: [TagInput, TagOption],
47
+ html: `<wm-tag-input label="label" info="info text">
48
+ <wm-tag-option selected>one</wm-tag-option>
49
+ <wm-tag-option>two</wm-tag-option>
50
+ <wm-tag-option selected>three</wm-tag-option>
51
+ <wm-tag-option>four</wm-tag-option>
52
+ </wm-tag-input>`,
53
+ });
54
+ const label = await page.root.shadowRoot.querySelector("label");
55
+ expect(label.textContent).toBe("label");
56
+ const input = await page.root.shadowRoot.querySelector("input");
57
+ expect(input).toEqualAttribute("role", "combobox");
58
+ expect(input).toEqualAttribute("aria-label", "label 50 characters allowed.");
59
+ const helpText = await page.root.shadowRoot.querySelector(".help-text");
60
+ expect(input).toEqualAttribute("aria-describedby", helpText.id);
61
+ const dropdown = await page.root.shadowRoot.querySelector(".dropdown");
62
+ expect(dropdown).toEqualAttribute("role", "listbox");
63
+ expect(dropdown).toHaveAttribute("aria-multiselectable");
64
+ const options = await page.root.shadowRoot.querySelectorAll(".option");
65
+ options.forEach((option) => {
66
+ expect(option).toEqualAttribute("role", "option");
67
+ });
68
+ const tagArea = await page.root.shadowRoot.querySelector(".tag-area");
69
+ expect(tagArea).toEqualAttribute("role", "listbox");
70
+ expect(tagArea).toEqualAttribute("aria-label", "label tag selection. Press Backspace or Delete to remove a tag.");
71
+ expect(tagArea).toEqualAttribute("aria-describedby", "info max-tags");
72
+ expect(tagArea).toEqualAttribute("aria-orientation", "horizontal");
73
+ const tags = await page.root.shadowRoot.querySelectorAll(".tag");
74
+ tags.forEach((tag) => {
75
+ expect(tag).toEqualAttribute("role", "option");
76
+ });
77
+ });
78
+ it("changes help text when options are not provided", async () => {
79
+ // not editable with options
80
+ page = await newSpecPage({
81
+ components: [TagInput, TagOption],
82
+ html: `<wm-tag-input label="label" add-new="false">
83
+ <wm-tag-option>One</wm-tag-option>
84
+ <wm-tag-option>Two</wm-tag-option>
85
+ <wm-tag-option>Three</wm-tag-option>
86
+ </wm-tag-input>`,
87
+ });
88
+ const el = page.root;
89
+ let helpText = await el.shadowRoot.querySelector(".help-text");
90
+ expect(helpText.textContent).toBe("Search and select a tag.");
91
+ // editable with options
92
+ page = await newSpecPage({
93
+ components: [TagInput, TagOption],
94
+ html: `<wm-tag-input label="label">
95
+ <wm-tag-option>One</wm-tag-option>
96
+ <wm-tag-option>Two</wm-tag-option>
97
+ <wm-tag-option>Three</wm-tag-option>
98
+ </wm-tag-input>`,
99
+ });
100
+ helpText = await page.root.shadowRoot.querySelector(".help-text");
101
+ expect(helpText.textContent).toBe("Search and select a tag. Press the Enter or Comma key to add a new tag.");
102
+ // editable without options
103
+ page = await newSpecPage({
104
+ components: [TagInput, TagOption],
105
+ html: `<wm-tag-input label="label"></wm-tag-input>`,
106
+ });
107
+ helpText = await page.root.shadowRoot.querySelector(".help-text");
108
+ expect(helpText.textContent).toBe(" Press the Enter or Comma key to add a new tag.");
109
+ });
110
+ it("shows the appropriate default placeholder text", async () => {
111
+ // editable with options
112
+ await page.setContent(`<wm-tag-input label="label">
113
+ <wm-tag-option>One</wm-tag-option>
114
+ <wm-tag-option>Two</wm-tag-option>
115
+ </wm-tag-input>`);
116
+ let input = await page.root.shadowRoot.querySelector("input");
117
+ expect(input).toEqualAttribute("placeholder", "Add or search for a tag");
118
+ // editable without options
119
+ page = await newSpecPage({
120
+ components: [TagInput, TagOption],
121
+ html: `<wm-tag-input label="label"></wm-tag-input>`,
122
+ });
123
+ input = await page.root.shadowRoot.querySelector("input");
124
+ expect(input).toEqualAttribute("placeholder", "Add a new tag");
125
+ // not editable
126
+ page = await newSpecPage({
127
+ components: [TagInput, TagOption],
128
+ html: `<wm-tag-input label="label" add-new="false">
129
+ <wm-tag-option>One</wm-tag-option>
130
+ <wm-tag-option>Two</wm-tag-option>
131
+ <wm-tag-option>Three</wm-tag-option>
132
+ </wm-tag-input>`,
133
+ });
134
+ input = await page.root.shadowRoot.querySelector("input");
135
+ expect(input).toEqualAttribute("placeholder", "Search and select a tag");
136
+ });
137
+ it("throws error if no label prop is passed", async () => {
138
+ const mockConsoleError = (console.error = jest.fn());
139
+ await page.setContent(`<wm-tag-input></wm-tag-input>`);
140
+ expect(mockConsoleError).toHaveBeenCalledWith("wm-tag-input must have a label property");
141
+ jest.restoreAllMocks();
142
+ });
143
+ describe("handles announcements", () => {
144
+ it("announces live region notifications", async () => {
145
+ // announce
146
+ const component = new TagInput();
147
+ const div = document.createElement("div");
148
+ div.textContent = "";
149
+ //@ts-ignore
150
+ component.liveRegionEl = div;
151
+ component.announce("Message");
152
+ expect(component.liveRegionMessage).toBe("Message");
153
+ });
154
+ it("announces existing options", async () => {
155
+ // announceExistingOptions
156
+ const component = new TagInput();
157
+ const element1 = {};
158
+ const element2 = {};
159
+ const mockAnnounce = (component.announce = jest.fn());
160
+ jest.spyOn(component, "optionEls", "get").mockReturnValue([element1, element2]);
161
+ const spyRequestAnimationFrame = jest
162
+ .spyOn(window, "requestAnimationFrame")
163
+ //@ts-ignore
164
+ .mockImplementation((cb) => cb());
165
+ component.announceExistingOptions();
166
+ expect(spyRequestAnimationFrame).toHaveBeenCalledTimes(1);
167
+ expect(mockAnnounce).toHaveBeenCalledTimes(1);
168
+ expect(mockAnnounce).toHaveBeenLastCalledWith("2 existing options.");
169
+ jest.clearAllMocks();
170
+ jest.spyOn(component, "optionEls", "get").mockReturnValue([element1]);
171
+ component.announceExistingOptions();
172
+ expect(spyRequestAnimationFrame).toHaveBeenCalledTimes(1);
173
+ expect(mockAnnounce).toHaveBeenCalledTimes(1);
174
+ expect(mockAnnounce).toHaveBeenLastCalledWith("1 existing option.");
175
+ jest.clearAllMocks();
176
+ jest.spyOn(component, "optionEls", "get").mockReturnValue([]);
177
+ component.announceExistingOptions();
178
+ expect(spyRequestAnimationFrame).toHaveBeenCalledTimes(1);
179
+ expect(mockAnnounce).toHaveBeenCalledTimes(1);
180
+ expect(mockAnnounce).toHaveBeenLastCalledWith("0 existing options.");
181
+ jest.restoreAllMocks();
182
+ });
183
+ it("announces character limits warnings", async () => {
184
+ const component = new TagInput();
185
+ let message = component.generateCharacterLimitWarning(0, 50);
186
+ expect(message).toBe("0 of 50 characters entered.");
187
+ message = component.generateCharacterLimitWarning(30, 50);
188
+ expect(message).toBe("30 of 50 characters entered.");
189
+ message = component.generateCharacterLimitWarning(50, 50);
190
+ expect(message).toBe("50 of 50 characters entered. No additional characters will be entered.");
191
+ message = component.generateCharacterLimitWarning(75, 50);
192
+ expect(message).toBe("75 of 50 characters entered. No additional characters will be entered.");
193
+ });
194
+ });
195
+ });
@@ -0,0 +1,41 @@
1
+ import AxePuppeteer from "@axe-core/puppeteer";
2
+ import { newE2EPage } from "@stencil/core/testing";
3
+ describe("wm-textarea", () => {
4
+ // ts throws erroneous warning about vars being unused...
5
+ // @ts-ignore
6
+ let page, el, textarea;
7
+ beforeEach(async () => {
8
+ page = await newE2EPage();
9
+ await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
10
+ <wm-textarea label='label' character-limit="20"></wm-textarea>
11
+ </main></body></html>`);
12
+ el = await page.find("wm-textarea");
13
+ textarea = await page.find("wm-textarea >>> textarea");
14
+ await page.waitForChanges();
15
+ });
16
+ it("passes Axe checks", async () => {
17
+ const results = await new AxePuppeteer(page).analyze();
18
+ expect(results.violations.length).toBe(0);
19
+ });
20
+ it("updates character count on text entry", async () => {
21
+ await page.keyboard.press("Tab");
22
+ await page.keyboard.type("1234");
23
+ await page.waitForChanges();
24
+ const characterCount = await page.find("wm-textarea >>> .character-count");
25
+ expect(characterCount.textContent).toBe("4/20");
26
+ });
27
+ it("emits event on value change", async () => {
28
+ const eventSpy = await el.spyOnEvent("wmTextareaValueChanged");
29
+ await el.focus();
30
+ await page.keyboard.type("1234");
31
+ await page.waitForChanges();
32
+ expect(eventSpy).toHaveReceivedEventTimes(0);
33
+ await page.keyboard.press("Tab");
34
+ expect(eventSpy).toHaveReceivedEventTimes(1);
35
+ await el.focus();
36
+ await page.keyboard.press("Tab");
37
+ await page.waitForChanges();
38
+ // expect event to still have fired only once, because value has not changed
39
+ expect(eventSpy).toHaveReceivedEventTimes(1);
40
+ });
41
+ });
@@ -65,7 +65,7 @@ export class Textarea {
65
65
  this.announcement = message;
66
66
  }
67
67
  render() {
68
- return (h("div", { key: 'e2d740d8479a2c7fceafb2cd68d9f97eb876f785', class: `wrapper label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { key: '2f410dc0729e16d0b18e614f376825f2046df597', class: "label-wrapper" }, h("label", { key: '42478a23be2991709f1225d29fc5b70f1c265e60', htmlFor: "inputfield", class: "label" }, this.label, this.characterLimit && (h("span", { key: '075b4662280aca2fd60c0d9c1c5c55943432fa40', class: "sr-only" }, " ", globalMessages.getCharacterLimit(this.characterLimit))), this.requiredField && (h("span", { key: '04170738af7aed5c0c1c93e0514a0820ce95f45d', class: "required", "aria-hidden": "true" }, "*")))), h("div", { key: '8c95a78fc48323b507f698b7a60e23ee695eafd5', class: "inner-wrapper" }, h("div", { key: 'f2d97022f110d272158a4b66b99823855e9446ee', class: `inputfield-wrapper ${this.errorMessage ? "invalid" : ""}`, style: this.inputWidth ? { width: this.inputWidth } : {} }, h("textarea", { key: '53c1dfdeaee25b4ead90e5077df55c5e75860510', id: "inputfield", disabled: this.isDisabled, "aria-describedby": "info error", onInput: (ev) => this.handleInput(ev), onBlur: () => this.handleBlur(), placeholder: this.placeholder, autocomplete: "off", "aria-required": this.requiredField ? "true" : null, value: this.value, rows: 3, style: { height: this.inputHeight } }), this.characterLimit && typeof this.characterLimit === "number" ? (h("div", { class: `character-count ${this.value.length > this.characterLimit ? "exceeded" : ""}` }, this.charCount, "/", this.characterLimit)) : ("")), this.info && (h("div", { key: 'e6752b037381940fd2c02fc994b018bff40d0160', id: "info", class: "info" }, this.info)), h("div", { key: '207fc1dd5736e9c9a401daab3334e52f2dbdb7b5', id: "error", class: "error-message" }, this.errorMessage), h("div", { key: 'a310af56a1bf1b1ba045707ee1b5b8fb7a0bd770', id: "live-polite", class: "sr-only", "aria-live": "polite", "aria-atomic": "true", ref: (el) => (this.liveRegionEl = el) }, this.announcement))));
68
+ return (h("div", { class: `wrapper label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { class: "label-wrapper" }, h("label", { htmlFor: "inputfield", class: "label" }, this.label, this.characterLimit && (h("span", { class: "sr-only" }, " ", globalMessages.getCharacterLimit(this.characterLimit))), this.requiredField && (h("span", { class: "required", "aria-hidden": "true" }, "*")))), h("div", { class: "inner-wrapper" }, h("div", { class: `inputfield-wrapper ${this.errorMessage ? "invalid" : ""}`, style: this.inputWidth ? { width: this.inputWidth } : {} }, h("textarea", { id: "inputfield", disabled: this.isDisabled, "aria-describedby": "info error", onInput: (ev) => this.handleInput(ev), onBlur: () => this.handleBlur(), placeholder: this.placeholder, autocomplete: "off", "aria-required": this.requiredField ? "true" : null, value: this.value, rows: 3, style: { height: this.inputHeight } }), this.characterLimit && typeof this.characterLimit === "number" ? (h("div", { class: `character-count ${this.value.length > this.characterLimit ? "exceeded" : ""}` }, this.charCount, "/", this.characterLimit)) : ("")), this.info && (h("div", { id: "info", class: "info" }, this.info)), h("div", { id: "error", class: "error-message" }, this.errorMessage), h("div", { id: "live-polite", class: "sr-only", "aria-live": "polite", "aria-atomic": "true", ref: (el) => (this.liveRegionEl = el) }, this.announcement))));
69
69
  }
70
70
  static get is() { return "wm-textarea"; }
71
71
  static get encapsulation() { return "shadow"; }
@@ -0,0 +1,79 @@
1
+ import { newSpecPage } from "@stencil/core/testing";
2
+ import { Textarea } from "./wm-textarea";
3
+ // mock observers
4
+ // global.ResizeObserver = jest.fn().mockImplementation(() => ({
5
+ // observe: jest.fn(),
6
+ // unobserve: jest.fn(),
7
+ // disconnect: jest.fn(),
8
+ // }));
9
+ // global.MutationObserver = jest.fn().mockImplementation(() => ({
10
+ // observe: jest.fn(),
11
+ // unobserve: jest.fn(),
12
+ // disconnect: jest.fn(),
13
+ // }));
14
+ describe("textarea", () => {
15
+ let page;
16
+ let component;
17
+ beforeEach(async () => {
18
+ page = await newSpecPage({
19
+ components: [Textarea],
20
+ html: `<wm-textarea id="textarea" label="label"></wm-textarea>`,
21
+ });
22
+ component = page.root;
23
+ });
24
+ it("builds", async () => {
25
+ expect(page.root).toMatchSnapshot();
26
+ });
27
+ it("has right aria roles", async () => {
28
+ page = await newSpecPage({
29
+ components: [Textarea],
30
+ html: `<wm-textarea id="textarea" label="label" disabled required-field></wm-textarea>`,
31
+ });
32
+ const textarea = await page.root.shadowRoot.querySelector("textarea");
33
+ expect(textarea).toEqualAttribute("aria-describedby", "info error");
34
+ expect(textarea).toHaveAttribute("disabled");
35
+ const error = await page.root.shadowRoot.querySelector("#error");
36
+ expect(error).toEqualAttribute("aria-live", "assertive");
37
+ const livePolite = await page.root.shadowRoot.querySelector("#live-polite");
38
+ expect(livePolite).toEqualAttribute("aria-live", "polite");
39
+ });
40
+ it("sets initial value from textcontent", async () => {
41
+ page = await newSpecPage({
42
+ components: [Textarea],
43
+ html: `<wm-textarea id="textarea" label="label">Initial value</wm-textarea>`,
44
+ });
45
+ component = page.root;
46
+ expect(component.value).toBe("Initial value");
47
+ });
48
+ it("renders character limit", async () => {
49
+ page = await newSpecPage({
50
+ components: [Textarea],
51
+ html: `<wm-textarea id="textarea" label="label" character-limit="20">Hello</wm-textarea>`,
52
+ });
53
+ component = page.root;
54
+ const characterLimitArea = await page.root.shadowRoot.querySelector(".character-count");
55
+ expect(characterLimitArea.textContent).toBe("5/20");
56
+ });
57
+ it("properties override height and width", async () => {
58
+ page = await newSpecPage({
59
+ components: [Textarea],
60
+ html: `<wm-textarea id="textarea" label="label" input-width="200px" input-height="300px"></wm-textarea>`,
61
+ });
62
+ component = page.root;
63
+ const textarea = await component.shadowRoot.querySelector("textarea");
64
+ expect(textarea).toEqualAttribute("style", "height: 300px;");
65
+ const widthWrapper = await component.shadowRoot.querySelector(".inputfield-wrapper");
66
+ expect(widthWrapper).toEqualAttribute("style", "width: 200px;");
67
+ });
68
+ it("displays info and error-message properties", async () => {
69
+ page = await newSpecPage({
70
+ components: [Textarea],
71
+ html: `<wm-textarea id="textarea" label="label" info="example info text" error-message="example error text"></wm-textarea>`,
72
+ });
73
+ component = page.root;
74
+ const info = await component.shadowRoot.querySelector("#info");
75
+ expect(info.textContent).toBe("example info text");
76
+ const error = await component.shadowRoot.querySelector("#error");
77
+ expect(error.textContent).toBe("example error text");
78
+ });
79
+ });
@@ -0,0 +1,163 @@
1
+ import AxePuppeteer from "@axe-core/puppeteer";
2
+ import { newE2EPage } from "@stencil/core/testing";
3
+ describe("wm-timepicker", () => {
4
+ let page, input;
5
+ beforeEach(async () => {
6
+ page = await newE2EPage();
7
+ await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
8
+ <wm-timepicker label="timepicker" dropdown-time="09:00"></wm-timepicker>
9
+ </main></body></html>`);
10
+ input = await page.find("wm-timepicker >>> input");
11
+ await page.waitForChanges();
12
+ });
13
+ it("passes Axe checks", async () => {
14
+ const results = await new AxePuppeteer(page).analyze();
15
+ expect(results.violations.length).toBe(0);
16
+ });
17
+ it("emits input blurred event", async () => {
18
+ page = await newE2EPage();
19
+ await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
20
+ <wm-timepicker label="timepicker"></wm-timepicker>
21
+ <div id="indicator">no event heard</div>
22
+ </main></body></html>`);
23
+ input = await page.find("wm-timepicker >>> input");
24
+ await page.waitForChanges();
25
+ await page.evaluate(async () => {
26
+ const indicator = document.querySelector("#indicator");
27
+ await document.addEventListener("wmTimepickerInputBlurred", () => (indicator.textContent = "event heard"));
28
+ });
29
+ await page.waitForChanges;
30
+ let indicator = await page.find("#indicator");
31
+ expect(indicator.textContent).toBe("no event heard");
32
+ await input.type("522");
33
+ await page.waitForChanges();
34
+ await page.keyboard.press("Tab");
35
+ await page.waitForChanges();
36
+ expect(indicator.textContent).toBe("event heard");
37
+ });
38
+ it("opens to preselected time", async () => {
39
+ page = await newE2EPage();
40
+ await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
41
+ <wm-timepicker label="timepicker" preselected="14:15"></wm-timepicker>
42
+ </main></body></html>`);
43
+ await page.waitForChanges();
44
+ await page.keyboard.press("Tab");
45
+ await page.waitForChanges();
46
+ await page.keyboard.press("Tab");
47
+ await page.waitForChanges();
48
+ await page.keyboard.press("Enter");
49
+ await page.waitForChanges();
50
+ const nineAm = await page.find("wm-timepicker >>> li#option58");
51
+ expect(nineAm).toEqualAttribute("tabindex", 0);
52
+ });
53
+ it("opens next option with down arrow key", async () => {
54
+ await page.keyboard.press("Tab");
55
+ await page.waitForChanges();
56
+ await page.keyboard.press("Tab");
57
+ await page.waitForChanges();
58
+ await page.keyboard.press("ArrowDown");
59
+ await page.waitForChanges();
60
+ const nineFifteenAm = await page.find("wm-timepicker >>> li#option38");
61
+ expect(nineFifteenAm).toEqualAttribute("tabindex", 0);
62
+ });
63
+ it("opens previous option with up arrow key", async () => {
64
+ await page.keyboard.press("Tab");
65
+ await page.waitForChanges();
66
+ await page.keyboard.press("Tab");
67
+ await page.waitForChanges();
68
+ await page.keyboard.press("ArrowUp");
69
+ await page.waitForChanges();
70
+ const eightFourtyFiveAm = await page.find("wm-timepicker >>> li#option36");
71
+ expect(eightFourtyFiveAm).toEqualAttribute("tabindex", 0);
72
+ });
73
+ it("navigates through the dropdown with keyboard", async () => {
74
+ await page.keyboard.press("Tab");
75
+ await page.waitForChanges();
76
+ await page.keyboard.press("Tab");
77
+ await page.waitForChanges();
78
+ await page.keyboard.press("Enter");
79
+ await page.waitForChanges();
80
+ const nineAm = await page.find("wm-timepicker >>> li#option37");
81
+ const nineFifteenAm = await page.find("wm-timepicker >>> li#option38");
82
+ await page.keyboard.press("ArrowDown");
83
+ await page.waitForChanges();
84
+ expect(nineFifteenAm).toEqualAttribute("tabindex", 0);
85
+ await page.keyboard.press("ArrowUp");
86
+ await page.waitForChanges();
87
+ expect(nineAm).toEqualAttribute("tabindex", 0);
88
+ });
89
+ it("emits timeSelected event with time", async () => {
90
+ page = await newE2EPage();
91
+ await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
92
+ <wm-timepicker label="timepicker" value="03:15 PM" preselected="15:15"></wm-timepicker>
93
+ <div id="indicator">no event heard</div>
94
+ </main></body></html>`);
95
+ input = await page.find("wm-timepicker >>> input");
96
+ await page.waitForChanges();
97
+ await page.evaluate(async () => {
98
+ const indicator = document.querySelector("#indicator");
99
+ await document.addEventListener("wmTimepickerTimeSelected", (ev) => (indicator.textContent = `event heard: ${ev.detail.time}`));
100
+ });
101
+ await page.waitForChanges;
102
+ let indicator = await page.find("#indicator");
103
+ expect(indicator.textContent).toBe("no event heard");
104
+ await page.keyboard.press("Tab");
105
+ await page.keyboard.press("Tab");
106
+ await page.keyboard.press("Enter");
107
+ await page.waitForChanges();
108
+ await page.keyboard.press("Enter");
109
+ await page.waitForChanges();
110
+ expect(indicator.textContent).toBe("event heard: 15:15");
111
+ });
112
+ it("closes dropdown on Escape and Tab", async () => {
113
+ const dropdown = await page.find("wm-timepicker >>> ul.options");
114
+ expect(dropdown).not.toHaveClass("open");
115
+ await page.keyboard.press("Tab");
116
+ await page.waitForChanges();
117
+ await page.keyboard.press("Tab");
118
+ await page.waitForChanges();
119
+ await page.keyboard.press("Enter");
120
+ await page.waitForChanges();
121
+ expect(dropdown).toHaveClass("open");
122
+ await page.keyboard.press("Escape");
123
+ await page.waitForChanges();
124
+ expect(dropdown).not.toHaveClass("open");
125
+ await page.waitForChanges();
126
+ await page.keyboard.press("Enter");
127
+ await page.waitForChanges();
128
+ expect(dropdown).toHaveClass("open");
129
+ await page.keyboard.press("Tab");
130
+ await page.waitForChanges();
131
+ expect(dropdown).not.toHaveClass("open");
132
+ });
133
+ it("closes dropdown when clicking outside component", async () => {
134
+ const dropdown = await page.find("wm-timepicker >>> ul.options");
135
+ expect(dropdown).not.toHaveClass("open");
136
+ await page.keyboard.press("Tab");
137
+ await page.waitForChanges();
138
+ await page.keyboard.press("Tab");
139
+ await page.waitForChanges();
140
+ await page.keyboard.press("Enter");
141
+ await page.waitForChanges();
142
+ expect(dropdown).toHaveClass("open");
143
+ await page.mouse.click(-10, -10);
144
+ await page.waitForChanges();
145
+ expect(dropdown).not.toHaveClass("open");
146
+ });
147
+ it("handles Home and End keys", async () => {
148
+ await page.keyboard.press("Tab");
149
+ await page.waitForChanges();
150
+ await page.keyboard.press("Tab");
151
+ await page.waitForChanges();
152
+ await page.keyboard.press("Enter");
153
+ await page.waitForChanges();
154
+ const firstOption = await page.find("wm-timepicker >>> li#option1");
155
+ await page.keyboard.press("Home");
156
+ await page.waitForChanges();
157
+ expect(firstOption).toEqualAttribute("tabindex", 0);
158
+ const lastOption = await page.find("wm-timepicker >>> li#option96");
159
+ await page.keyboard.press("End");
160
+ await page.waitForChanges();
161
+ expect(lastOption).toEqualAttribute("tabindex", 0);
162
+ });
163
+ });