@watermarkinsights/ripple 4.2.0-0 → 4.2.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 (375) hide show
  1. package/dist/cjs/chartFunctions-2c3e010e.js +600 -0
  2. package/dist/cjs/{functions-4208c444.js → functions-91da05e9.js} +362 -362
  3. package/dist/cjs/{global-38728020.js → global-b85941b0.js} +29 -24
  4. package/dist/cjs/{index-f8ef86de.js → index-fae02cd7.js} +150 -436
  5. package/dist/cjs/interfaces-245d7bff.js +38 -0
  6. package/dist/cjs/intl-fa3bb4ae.js +179 -0
  7. package/dist/cjs/loader.cjs.js +13 -4
  8. package/dist/cjs/priv-chart-popover.cjs.entry.js +85 -85
  9. package/dist/cjs/priv-datepicker.cjs.entry.js +637 -637
  10. package/dist/cjs/priv-navigator-button.cjs.entry.js +18 -18
  11. package/dist/cjs/priv-navigator-item.cjs.entry.js +21 -21
  12. package/dist/cjs/ripple.cjs.js +7 -4
  13. package/dist/cjs/wm-action-menu_2.cjs.entry.js +314 -314
  14. package/dist/cjs/wm-button.cjs.entry.js +174 -174
  15. package/dist/cjs/wm-chart-slice.cjs.entry.js +17 -17
  16. package/dist/cjs/wm-chart.cjs.entry.js +164 -164
  17. package/dist/cjs/wm-datepicker.cjs.entry.js +160 -160
  18. package/dist/cjs/wm-file-list.cjs.entry.js +10 -10
  19. package/dist/cjs/wm-file.cjs.entry.js +178 -178
  20. package/dist/cjs/wm-input.cjs.entry.js +102 -102
  21. package/dist/cjs/wm-line-chart.cjs.entry.js +448 -448
  22. package/dist/cjs/wm-modal-footer.cjs.entry.js +27 -27
  23. package/dist/cjs/wm-modal-header.cjs.entry.js +21 -21
  24. package/dist/cjs/wm-modal.cjs.entry.js +92 -92
  25. package/dist/cjs/wm-navigation_3.cjs.entry.js +180 -180
  26. package/dist/cjs/wm-navigator.cjs.entry.js +251 -251
  27. package/dist/cjs/wm-option_2.cjs.entry.js +712 -712
  28. package/dist/cjs/wm-pagination.cjs.entry.js +169 -169
  29. package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +151 -151
  30. package/dist/cjs/wm-search.cjs.entry.js +192 -192
  31. package/dist/cjs/wm-snackbar.cjs.entry.js +114 -114
  32. package/dist/cjs/wm-tab-item_3.cjs.entry.js +247 -247
  33. package/dist/cjs/wm-tag-input.cjs.entry.js +849 -849
  34. package/dist/cjs/wm-tag-option.cjs.entry.js +33 -33
  35. package/dist/cjs/wm-timepicker.cjs.entry.js +270 -270
  36. package/dist/cjs/wm-toggletip.cjs.entry.js +100 -100
  37. package/dist/cjs/wm-uploader.cjs.entry.js +198 -198
  38. package/dist/cjs/wm-wrapper.cjs.entry.js +12 -12
  39. package/dist/collection/collection-manifest.json +41 -41
  40. package/dist/collection/components/charts/chartFunctions.js +456 -456
  41. package/dist/collection/components/charts/chartFunctions.spec.js +13 -13
  42. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.e2e.js +73 -73
  43. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +254 -257
  44. package/dist/collection/components/charts/screenshots.e2e.js +30 -30
  45. package/dist/collection/components/charts/wm-chart/wm-chart-slice.js +121 -121
  46. package/dist/collection/components/charts/wm-chart/wm-chart.e2e.js +160 -160
  47. package/dist/collection/components/charts/wm-chart/wm-chart.js +381 -382
  48. package/dist/collection/components/charts/wm-chart/wm-chart.spec.js +26 -26
  49. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.css +2 -1
  50. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.e2e.js +138 -138
  51. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.js +717 -717
  52. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.spec.js +106 -106
  53. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +202 -202
  54. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.e2e.js +54 -54
  55. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +136 -136
  56. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.spec.js +31 -31
  57. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-slice.js +119 -119
  58. package/dist/collection/components/wm-action-menu/wm-action-menu.e2e.js +187 -187
  59. package/dist/collection/components/wm-action-menu/wm-action-menu.js +435 -435
  60. package/dist/collection/components/wm-action-menu/wm-action-menu.spec.js +35 -35
  61. package/dist/collection/components/wm-button/wm-button.e2e.js +58 -58
  62. package/dist/collection/components/wm-button/wm-button.js +452 -454
  63. package/dist/collection/components/wm-button/wm-button.spec.js +63 -63
  64. package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.js +939 -943
  65. package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.spec.js +71 -71
  66. package/dist/collection/components/wm-datepicker/wm-datepicker.css +2 -1
  67. package/dist/collection/components/wm-datepicker/wm-datepicker.e2e.js +359 -359
  68. package/dist/collection/components/wm-datepicker/wm-datepicker.js +413 -415
  69. package/dist/collection/components/wm-datepicker/wm-datepicker.spec.js +13 -13
  70. package/dist/collection/components/wm-file/wm-file.js +380 -380
  71. package/dist/collection/components/wm-file/wm-file.spec.js +107 -107
  72. package/dist/collection/components/wm-file-list/wm-file-list.js +42 -42
  73. package/dist/collection/components/wm-file-list/wm-file-list.spec.js +47 -47
  74. package/dist/collection/components/wm-input/wm-input.e2e.js +26 -26
  75. package/dist/collection/components/wm-input/wm-input.js +453 -453
  76. package/dist/collection/components/wm-input/wm-input.spec.js +168 -168
  77. package/dist/collection/components/wm-menuitem/wm-menuitem.e2e.js +18 -18
  78. package/dist/collection/components/wm-menuitem/wm-menuitem.js +436 -446
  79. package/dist/collection/components/wm-menuitem/wm-menuitem.spec.js +46 -46
  80. package/dist/collection/components/wm-modal/wm-modal-footer.js +130 -130
  81. package/dist/collection/components/wm-modal/wm-modal-footer.spec.js +8 -8
  82. package/dist/collection/components/wm-modal/wm-modal-header.js +68 -68
  83. package/dist/collection/components/wm-modal/wm-modal-header.spec.js +5 -5
  84. package/dist/collection/components/wm-modal/wm-modal.css +1 -0
  85. package/dist/collection/components/wm-modal/wm-modal.e2e.js +65 -65
  86. package/dist/collection/components/wm-modal/wm-modal.js +296 -299
  87. package/dist/collection/components/wm-modal/wm-modal.spec.js +22 -22
  88. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.css +1 -0
  89. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +112 -112
  90. package/dist/collection/components/wm-navigation/wm-navigation-item.js +125 -125
  91. package/dist/collection/components/wm-navigation/wm-navigation.css +3 -1
  92. package/dist/collection/components/wm-navigation/wm-navigation.e2e.js +86 -86
  93. package/dist/collection/components/wm-navigation/wm-navigation.js +209 -209
  94. package/dist/collection/components/wm-navigation/wm-navigation.spec.js +79 -79
  95. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.e2e.js +30 -30
  96. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +103 -103
  97. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +118 -119
  98. package/dist/collection/components/wm-navigator/wm-navigator.e2e.js +180 -180
  99. package/dist/collection/components/wm-navigator/wm-navigator.js +454 -454
  100. package/dist/collection/components/wm-navigator/wm-navigator.spec.js +153 -153
  101. package/dist/collection/components/wm-option/wm-option.css +1 -1
  102. package/dist/collection/components/wm-option/wm-option.e2e.js +19 -19
  103. package/dist/collection/components/wm-option/wm-option.js +463 -474
  104. package/dist/collection/components/wm-option/wm-option.spec.js +39 -39
  105. package/dist/collection/components/wm-pagination/wm-pagination.e2e.js +301 -301
  106. package/dist/collection/components/wm-pagination/wm-pagination.js +327 -327
  107. package/dist/collection/components/wm-search/wm-search.e2e.js +69 -69
  108. package/dist/collection/components/wm-search/wm-search.js +414 -415
  109. package/dist/collection/components/wm-search/wm-search.spec.js +64 -64
  110. package/dist/collection/components/wm-select/wm-select.css +1 -0
  111. package/dist/collection/components/wm-select/wm-select.e2e.js +443 -443
  112. package/dist/collection/components/wm-select/wm-select.js +966 -967
  113. package/dist/collection/components/wm-select/wm-select.spec.js +250 -250
  114. package/dist/collection/components/wm-snackbar/wm-snackbar.e2e.js +114 -114
  115. package/dist/collection/components/wm-snackbar/wm-snackbar.js +207 -209
  116. package/dist/collection/components/wm-snackbar/wm-snackbar.spec.js +4 -4
  117. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +188 -190
  118. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +261 -261
  119. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +104 -104
  120. package/dist/collection/components/wm-tabs/wm-tabs.e2e.js +79 -79
  121. package/dist/collection/components/wm-tabs/wm-tabs.spec.js +6 -6
  122. package/dist/collection/components/wm-tag-input/wm-tag-input.css +4 -2
  123. package/dist/collection/components/wm-tag-input/wm-tag-input.e2e.js +168 -168
  124. package/dist/collection/components/wm-tag-input/wm-tag-input.js +1159 -1159
  125. package/dist/collection/components/wm-tag-input/wm-tag-input.spec.js +147 -147
  126. package/dist/collection/components/wm-tag-input/wm-tag-option/wm-tag-option.js +234 -236
  127. package/dist/collection/components/wm-timepicker/wm-timepicker.css +2 -1
  128. package/dist/collection/components/wm-timepicker/wm-timepicker.e2e.js +147 -147
  129. package/dist/collection/components/wm-timepicker/wm-timepicker.js +527 -531
  130. package/dist/collection/components/wm-timepicker/wm-timepicker.spec.js +151 -151
  131. package/dist/collection/components/wm-toggletip/wm-toggletip.css +1 -1
  132. package/dist/collection/components/wm-toggletip/wm-toggletip.e2e.js +61 -61
  133. package/dist/collection/components/wm-toggletip/wm-toggletip.js +208 -209
  134. package/dist/collection/components/wm-toggletip/wm-toggletip.spec.js +16 -16
  135. package/dist/collection/components/wm-uploader/wm-uploader.e2e.js +56 -56
  136. package/dist/collection/components/wm-uploader/wm-uploader.js +422 -423
  137. package/dist/collection/components/wm-uploader/wm-uploader.spec.js +149 -149
  138. package/dist/collection/components/wm-wrapper/wm-wrapper.js +26 -26
  139. package/dist/collection/global/__mocks__/functions.js +1 -1
  140. package/dist/collection/global/functions.js +510 -510
  141. package/dist/collection/global/functions.spec.js +123 -123
  142. package/dist/collection/global/global.js +16 -16
  143. package/dist/collection/global/interfaces.js +39 -39
  144. package/dist/collection/global/intl.js +162 -162
  145. package/dist/collection/global/services/__mocks__/http-service.js +112 -112
  146. package/dist/collection/global/services/http-service.js +41 -41
  147. package/dist/collection/global/themes/default.js +9 -4
  148. package/dist/collection/global/themes/neutral.js +4 -4
  149. package/dist/collection/lang/lang.spec.js +13 -13
  150. package/dist/esm/chartFunctions-36634c04.js +584 -0
  151. package/dist/esm/{functions-d0e70094.js → functions-5afd09f4.js} +362 -362
  152. package/dist/esm/{global-462b022e.js → global-91088105.js} +29 -24
  153. package/dist/esm/{index-f164fbca.js → index-7e11ea42.js} +150 -436
  154. package/dist/esm/interfaces-89cad2fc.js +35 -0
  155. package/dist/esm/intl-e2da750a.js +174 -0
  156. package/dist/esm/loader.js +14 -5
  157. package/dist/esm/polyfills/css-shim.js +1 -0
  158. package/dist/esm/priv-chart-popover.entry.js +85 -85
  159. package/dist/esm/priv-datepicker.entry.js +637 -637
  160. package/dist/esm/priv-navigator-button.entry.js +18 -18
  161. package/dist/esm/priv-navigator-item.entry.js +21 -21
  162. package/dist/esm/ripple.js +8 -5
  163. package/dist/esm/wm-action-menu_2.entry.js +314 -314
  164. package/dist/esm/wm-button.entry.js +174 -174
  165. package/dist/esm/wm-chart-slice.entry.js +17 -17
  166. package/dist/esm/wm-chart.entry.js +164 -164
  167. package/dist/esm/wm-datepicker.entry.js +160 -160
  168. package/dist/esm/wm-file-list.entry.js +10 -10
  169. package/dist/esm/wm-file.entry.js +178 -178
  170. package/dist/esm/wm-input.entry.js +102 -102
  171. package/dist/esm/wm-line-chart.entry.js +448 -448
  172. package/dist/esm/wm-modal-footer.entry.js +27 -27
  173. package/dist/esm/wm-modal-header.entry.js +21 -21
  174. package/dist/esm/wm-modal.entry.js +92 -92
  175. package/dist/esm/wm-navigation_3.entry.js +180 -180
  176. package/dist/esm/wm-navigator.entry.js +251 -251
  177. package/dist/esm/wm-option_2.entry.js +712 -712
  178. package/dist/esm/wm-pagination.entry.js +169 -169
  179. package/dist/esm/wm-progress-indicator_3.entry.js +151 -151
  180. package/dist/esm/wm-search.entry.js +192 -192
  181. package/dist/esm/wm-snackbar.entry.js +114 -114
  182. package/dist/esm/wm-tab-item_3.entry.js +247 -247
  183. package/dist/esm/wm-tag-input.entry.js +849 -849
  184. package/dist/esm/wm-tag-option.entry.js +33 -33
  185. package/dist/esm/wm-timepicker.entry.js +270 -270
  186. package/dist/esm/wm-toggletip.entry.js +100 -100
  187. package/dist/esm/wm-uploader.entry.js +198 -198
  188. package/dist/esm/wm-wrapper.entry.js +12 -12
  189. package/dist/esm-es5/chartFunctions-36634c04.js +1 -0
  190. package/dist/esm-es5/functions-5afd09f4.js +1 -0
  191. package/dist/esm-es5/global-91088105.js +1 -0
  192. package/dist/esm-es5/index-7e11ea42.js +2 -0
  193. package/dist/esm-es5/{intl-05c9e0c9.js → intl-e2da750a.js} +1 -1
  194. package/dist/esm-es5/loader.js +1 -1
  195. package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
  196. package/dist/esm-es5/priv-datepicker.entry.js +1 -1
  197. package/dist/esm-es5/priv-navigator-button.entry.js +1 -1
  198. package/dist/esm-es5/priv-navigator-item.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-datepicker.entry.js +1 -1
  205. package/dist/esm-es5/wm-file-list.entry.js +1 -1
  206. package/dist/esm-es5/wm-file.entry.js +1 -1
  207. package/dist/esm-es5/wm-input.entry.js +1 -1
  208. package/dist/esm-es5/wm-line-chart.entry.js +1 -1
  209. package/dist/esm-es5/wm-modal-footer.entry.js +1 -1
  210. package/dist/esm-es5/wm-modal-header.entry.js +1 -1
  211. package/dist/esm-es5/wm-modal.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-option_2.entry.js +1 -1
  215. package/dist/esm-es5/wm-pagination.entry.js +1 -1
  216. package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
  217. package/dist/esm-es5/wm-search.entry.js +1 -1
  218. package/dist/esm-es5/wm-snackbar.entry.js +1 -1
  219. package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
  220. package/dist/esm-es5/wm-tag-input.entry.js +1 -1
  221. package/dist/esm-es5/wm-tag-option.entry.js +1 -1
  222. package/dist/esm-es5/wm-timepicker.entry.js +1 -1
  223. package/dist/esm-es5/wm-toggletip.entry.js +1 -1
  224. package/dist/esm-es5/wm-uploader.entry.js +1 -1
  225. package/dist/esm-es5/wm-wrapper.entry.js +1 -1
  226. package/dist/loader/index.d.ts +1 -1
  227. package/dist/ripple/p-00acacbe.system.entry.js +1 -0
  228. package/dist/ripple/{p-3446852f.system.entry.js → p-0631be01.system.entry.js} +1 -1
  229. package/dist/ripple/{p-ad6dc751.entry.js → p-0aecac86.entry.js} +1 -1
  230. package/dist/ripple/{p-c717d895.entry.js → p-0d9f70ab.entry.js} +1 -1
  231. package/dist/ripple/{p-b253d2fc.entry.js → p-0f1ff645.entry.js} +1 -1
  232. package/dist/ripple/{p-63f75d43.entry.js → p-1205fdc1.entry.js} +1 -1
  233. package/dist/ripple/{p-27f47edc.entry.js → p-1283e85d.entry.js} +1 -1
  234. package/dist/ripple/{p-43e2a49a.entry.js → p-13594c2e.entry.js} +1 -1
  235. package/dist/ripple/{p-5a921e55.entry.js → p-13af8346.entry.js} +1 -1
  236. package/dist/ripple/{p-ceced3d9.system.entry.js → p-15497721.system.entry.js} +1 -1
  237. package/dist/ripple/p-16363e1c.system.entry.js +1 -0
  238. package/dist/ripple/{p-3a070f35.entry.js → p-19773c40.entry.js} +1 -1
  239. package/dist/ripple/{p-b4d862e1.system.entry.js → p-1cde16a7.system.entry.js} +1 -1
  240. package/dist/ripple/{p-f711c914.entry.js → p-20f5c695.entry.js} +1 -1
  241. package/dist/ripple/{p-13ca30d8.js → p-24b08e1f.js} +1 -1
  242. package/dist/ripple/{p-2c834d27.system.entry.js → p-2a95b63f.system.entry.js} +1 -1
  243. package/dist/ripple/{p-c96a5c94.system.entry.js → p-2e773564.system.entry.js} +1 -1
  244. package/dist/ripple/p-30bf24f8.system.js +2 -0
  245. package/dist/ripple/p-3248c0fa.system.entry.js +1 -0
  246. package/dist/ripple/{p-473ff44e.system.entry.js → p-32b1126c.system.entry.js} +1 -1
  247. package/dist/ripple/{p-aadf8c59.entry.js → p-36049d2f.entry.js} +1 -1
  248. package/dist/ripple/p-3aca2871.js +1 -0
  249. package/dist/ripple/{p-633cd89a.system.entry.js → p-3becce62.system.entry.js} +1 -1
  250. package/dist/ripple/{p-58174f4e.entry.js → p-3c80bf67.entry.js} +1 -1
  251. package/dist/ripple/p-40fcae38.system.js +1 -0
  252. package/dist/ripple/p-47c20b05.entry.js +1 -0
  253. package/dist/ripple/p-4825101c.system.js +1 -0
  254. package/dist/ripple/p-56d64283.system.entry.js +1 -0
  255. package/dist/ripple/p-5e85967a.system.js +1 -0
  256. package/dist/ripple/{p-067d7922.system.entry.js → p-622a7791.system.entry.js} +1 -1
  257. package/dist/ripple/{p-aba5a00e.system.entry.js → p-676c1089.system.entry.js} +1 -1
  258. package/dist/ripple/{p-153701f9.entry.js → p-6abb903c.entry.js} +1 -1
  259. package/dist/ripple/{p-9e25bfd5.entry.js → p-7529706d.entry.js} +1 -1
  260. package/dist/ripple/{p-de349bee.entry.js → p-7962f562.entry.js} +1 -1
  261. package/dist/ripple/{p-8d4734ad.entry.js → p-80aef387.entry.js} +1 -1
  262. package/dist/ripple/{p-8cace32f.entry.js → p-84a7e757.entry.js} +1 -1
  263. package/dist/ripple/{p-9fecbc8a.system.js → p-85f744ed.system.js} +1 -1
  264. package/dist/ripple/{p-05d4e49b.js → p-863e737a.js} +1 -1
  265. package/dist/ripple/{p-7e56da2e.system.entry.js → p-8ea68cb3.system.entry.js} +1 -1
  266. package/dist/ripple/{p-1402cfa2.system.js → p-8f3f903f.system.js} +1 -1
  267. package/dist/ripple/{p-c249063c.entry.js → p-8f8c3705.entry.js} +1 -1
  268. package/dist/ripple/{p-67d48c33.system.entry.js → p-90ea7e3a.system.entry.js} +1 -1
  269. package/dist/ripple/{p-a82a8931.entry.js → p-9288659b.entry.js} +1 -1
  270. package/dist/ripple/{p-f7aa5a73.entry.js → p-935513f8.entry.js} +1 -1
  271. package/dist/ripple/{p-8b83de0a.entry.js → p-a0bf5eef.entry.js} +1 -1
  272. package/dist/ripple/{p-06776596.system.entry.js → p-a1e95b05.system.entry.js} +1 -1
  273. package/dist/ripple/{p-25446670.entry.js → p-a52c5a1c.entry.js} +1 -1
  274. package/dist/ripple/p-a5b23781.system.entry.js +1 -0
  275. package/dist/ripple/p-a6be3cca.system.entry.js +1 -0
  276. package/dist/ripple/p-a9c096b5.entry.js +1 -0
  277. package/dist/ripple/p-aafa111a.system.js +1 -0
  278. package/dist/ripple/{p-1d8b0039.entry.js → p-ad37cdfd.entry.js} +1 -1
  279. package/dist/ripple/{p-350fe5da.entry.js → p-ae674a54.entry.js} +1 -1
  280. package/dist/ripple/{p-e24ddae1.entry.js → p-b3c73bc9.entry.js} +1 -1
  281. package/dist/ripple/{p-e8b58666.system.entry.js → p-b3e08b14.system.entry.js} +1 -1
  282. package/dist/ripple/p-b5bedd63.js +2 -0
  283. package/dist/ripple/{p-a69c37e0.entry.js → p-b71a83e3.entry.js} +1 -1
  284. package/dist/ripple/p-bd537299.system.entry.js +1 -0
  285. package/dist/ripple/{p-42ebfcfa.entry.js → p-c41603e6.entry.js} +1 -1
  286. package/dist/ripple/{p-5a4d9897.system.entry.js → p-c5e8f8a5.system.entry.js} +1 -1
  287. package/dist/ripple/{p-7a8816d9.system.entry.js → p-c76bbedf.system.entry.js} +1 -1
  288. package/dist/ripple/{p-3af72848.js → p-c7b5ac39.js} +1 -1
  289. package/dist/ripple/{p-361cc8fc.system.entry.js → p-cbd8a60b.system.entry.js} +1 -1
  290. package/dist/ripple/{p-3583d113.system.entry.js → p-d04ba5f8.system.entry.js} +1 -1
  291. package/dist/ripple/{p-1fa2a756.system.entry.js → p-d0f1b8c4.system.entry.js} +1 -1
  292. package/dist/ripple/{p-bdd4f919.system.entry.js → p-d496bc44.system.entry.js} +1 -1
  293. package/dist/ripple/{p-7e8daaac.entry.js → p-deb4f5a2.entry.js} +1 -1
  294. package/dist/ripple/{p-91ad0233.system.entry.js → p-e3f0b57f.system.entry.js} +1 -1
  295. package/dist/ripple/{p-f1a92576.system.entry.js → p-e4919f95.system.entry.js} +1 -1
  296. package/dist/ripple/{p-49118468.entry.js → p-ed942b42.entry.js} +1 -1
  297. package/dist/ripple/{p-0ecbf569.system.entry.js → p-f30839a1.system.entry.js} +1 -1
  298. package/dist/ripple/{p-d3f9d028.system.entry.js → p-ff14e4ec.system.entry.js} +1 -1
  299. package/dist/ripple/ripple.esm.js +1 -1
  300. package/dist/ripple/ripple.js +20 -16
  301. package/dist/types/components/charts/chartFunctions.d.ts +13 -13
  302. package/dist/types/components/charts/priv-chart-popover/priv-chart-popover.d.ts +24 -24
  303. package/dist/types/components/charts/wm-chart/wm-chart-slice.d.ts +8 -8
  304. package/dist/types/components/charts/wm-chart/wm-chart.d.ts +39 -39
  305. package/dist/types/components/charts/wm-line-chart/wm-line-chart.d.ts +73 -73
  306. package/dist/types/components/charts/wm-progress-monitor/wm-progress-indicator.d.ts +26 -26
  307. package/dist/types/components/charts/wm-progress-monitor/wm-progress-monitor.d.ts +17 -17
  308. package/dist/types/components/charts/wm-progress-monitor/wm-progress-slice.d.ts +7 -7
  309. package/dist/types/components/wm-action-menu/wm-action-menu.d.ts +43 -43
  310. package/dist/types/components/wm-button/wm-button.d.ts +40 -40
  311. package/dist/types/components/wm-datepicker/priv-datepicker/priv-datepicker.d.ts +76 -76
  312. package/dist/types/components/wm-datepicker/wm-datepicker.d.ts +31 -31
  313. package/dist/types/components/wm-file/wm-file.d.ts +40 -40
  314. package/dist/types/components/wm-file-list/wm-file-list.d.ts +3 -3
  315. package/dist/types/components/wm-input/wm-input.d.ts +46 -46
  316. package/dist/types/components/wm-menuitem/wm-menuitem.d.ts +31 -31
  317. package/dist/types/components/wm-modal/wm-modal-footer.d.ts +11 -11
  318. package/dist/types/components/wm-modal/wm-modal-header.d.ts +7 -7
  319. package/dist/types/components/wm-modal/wm-modal.d.ts +24 -24
  320. package/dist/types/components/wm-navigation/wm-navigation-hamburger.d.ts +13 -13
  321. package/dist/types/components/wm-navigation/wm-navigation-item.d.ts +10 -10
  322. package/dist/types/components/wm-navigation/wm-navigation.d.ts +23 -23
  323. package/dist/types/components/wm-navigator/priv-navigator-button/priv-navigator-button.d.ts +7 -7
  324. package/dist/types/components/wm-navigator/priv-navigator-item/priv-navigator-item.d.ts +10 -10
  325. package/dist/types/components/wm-navigator/wm-navigator.d.ts +57 -57
  326. package/dist/types/components/wm-option/wm-option.d.ts +36 -36
  327. package/dist/types/components/wm-pagination/wm-pagination.d.ts +27 -27
  328. package/dist/types/components/wm-search/wm-search.d.ts +73 -73
  329. package/dist/types/components/wm-select/wm-select.d.ts +99 -99
  330. package/dist/types/components/wm-snackbar/wm-snackbar.d.ts +24 -24
  331. package/dist/types/components/wm-tabs/wm-tab-item/wm-tab-item.d.ts +30 -30
  332. package/dist/types/components/wm-tabs/wm-tab-list/wm-tab-list.d.ts +41 -41
  333. package/dist/types/components/wm-tabs/wm-tab-panel/wm-tab-panel.d.ts +16 -16
  334. package/dist/types/components/wm-timepicker/wm-timepicker.d.ts +48 -48
  335. package/dist/types/components/wm-toggletip/wm-toggletip.d.ts +20 -20
  336. package/dist/types/components/wm-uploader/wm-uploader.d.ts +47 -47
  337. package/dist/types/components/wm-wrapper/wm-wrapper.d.ts +4 -4
  338. package/dist/types/components.d.ts +0 -382
  339. package/dist/types/global/__mocks__/functions.d.ts +1 -1
  340. package/dist/types/global/functions.d.ts +4 -4
  341. package/dist/types/global/interfaces.d.ts +49 -49
  342. package/dist/types/global/intl.d.ts +31 -31
  343. package/dist/types/global/services/__mocks__/http-service.d.ts +1 -1
  344. package/dist/types/stencil-public-runtime.d.ts +5 -46
  345. package/package.json +1 -1
  346. package/dist/cjs/chartFunctions-cecf8134.js +0 -600
  347. package/dist/cjs/interfaces-ad9e80a6.js +0 -38
  348. package/dist/cjs/intl-3fafc6d1.js +0 -179
  349. package/dist/esm/chartFunctions-23173fce.js +0 -584
  350. package/dist/esm/interfaces-9b75fb61.js +0 -35
  351. package/dist/esm/intl-05c9e0c9.js +0 -174
  352. package/dist/esm-es5/chartFunctions-23173fce.js +0 -1
  353. package/dist/esm-es5/functions-d0e70094.js +0 -1
  354. package/dist/esm-es5/global-462b022e.js +0 -1
  355. package/dist/esm-es5/index-f164fbca.js +0 -2
  356. package/dist/ripple/p-09d62ddd.entry.js +0 -1
  357. package/dist/ripple/p-0fe97e85.system.js +0 -2
  358. package/dist/ripple/p-1453ea51.system.entry.js +0 -1
  359. package/dist/ripple/p-1cc91907.system.js +0 -1
  360. package/dist/ripple/p-26602428.system.js +0 -1
  361. package/dist/ripple/p-30b17818.system.entry.js +0 -1
  362. package/dist/ripple/p-3deccefa.system.js +0 -1
  363. package/dist/ripple/p-4de51706.js +0 -2
  364. package/dist/ripple/p-8133ee44.system.entry.js +0 -1
  365. package/dist/ripple/p-88406560.system.entry.js +0 -1
  366. package/dist/ripple/p-8f76a838.system.entry.js +0 -1
  367. package/dist/ripple/p-a99b05de.system.entry.js +0 -1
  368. package/dist/ripple/p-b56e0d1e.entry.js +0 -1
  369. package/dist/ripple/p-c18b398c.system.js +0 -1
  370. package/dist/ripple/p-cb674aad.js +0 -1
  371. package/dist/ripple/p-e66bbd87.system.entry.js +0 -1
  372. package/dist/types/components/wm-tag-input/wm-tag-input.d.ts +0 -117
  373. package/dist/types/components/wm-tag-input/wm-tag-option/wm-tag-option.d.ts +0 -18
  374. /package/dist/esm-es5/{interfaces-9b75fb61.js → interfaces-89cad2fc.js} +0 -0
  375. /package/dist/ripple/{p-196eb2f3.js → p-c0c111fd.js} +0 -0
@@ -2,867 +2,867 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-f8ef86de.js');
6
- const functions = require('./functions-4208c444.js');
7
- const intl = require('./intl-3fafc6d1.js');
5
+ const index = require('./index-fae02cd7.js');
6
+ const functions = require('./functions-91da05e9.js');
7
+ const intl = require('./intl-fa3bb4ae.js');
8
8
 
9
9
  const wmTagInputCss = ":host{--wmcolor-taginput-altrow-background-table:var(--wmcolor-table-altrow-background);--wmcolor-taginput-border:var(--wmcolor-input-border);--wmcolor-taginput-charcount-background:var(--wmcolor-input-charcount-background);--wmcolor-taginput-header-background-table:var(--wmcolor-table-header-background);--wmcolor-taginput-help-text:var(--wmcolor-text);--wmcolor-taginput-icon:var(--wmcolor-icon-accent);--wmcolor-taginput-maxtags-background:var(--wmcolor-background-readonly);--wmcolor-taginput-maxtags-border:var(--wmcolor-input-border);--wmcolor-taginput-maxtags-text:var(--wmcolor-text);--wmcolor-taginput-option-background-hover:var(--wmcolor-option-background-hover);--wmcolor-taginput-option-background:var(--wmcolor-option-background);--wmcolor-taginput-option-border:var(--wmcolor-option-border);--wmcolor-taginput-option-text-selected:var(--wmcolor-option-text-disabled);--wmcolor-taginput-option-text:var(--wmcolor-interactive);--wmcolor-taginput-row-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-taginput-row-background-selected:var(--wmcolor-table-row-background-selected);--wmcolor-taginput-row-background-table:var(--wmcolor-table-row-background);--wmcolor-taginput-row-border-selected:var(--wmcolor-table-row-border-selected);--wmcolor-taginput-tag-background-focus:var(--wmcolor-palelilacgray-dark);--wmcolor-taginput-tag-background-highlight:var(--wmcolor-background-highlight);--wmcolor-taginput-tag-background-locked:var(--wmcolor-interactive-disabled);--wmcolor-taginput-tag-background:var(--wmcolor-palelilacgray);--wmcolor-taginput-tag-text-locked:var(--wmcolor-text-ondark);--wmcolor-taginput-tag-text:var(--wmcolor-text);--wmcolor-taginput-tagbutton-background-hover:var(--wmcolor-button-background-icononly-hover);--wmcolor-taginput-tagbutton-border:var(--wmcolor-button-border-icononly);--wmcolor-taginput-tagbutton-icon-hover:var(--wmcolor-button-icon-icononly-hover);--wmcolor-taginput-tagbutton-icon:var(--wmcolor-button-icon-icononly);font-family:inherit;width:100%;display:block;max-height:80vh}:host *{-webkit-box-sizing:border-box;box-sizing:border-box;font-size:14px}:host .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required{color:var(--wmcolor-text-required)}:host .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .wrapper.invalid .label{color:var(--wmcolor-text-error)}:host .wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f026\";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper{width:100%;height:100%;max-height:inherit;min-height:inherit;position:relative}:host .field-wrapper{position:relative;width:100%;border:1px solid;border-color:var(--wmcolor-taginput-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px}:host .field-wrapper.focused{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-focus);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-focus);box-shadow:0 0 0 1px var(--wmcolor-input-border-focus);outline:none;border-color:var(--wmcolor-input-border-focus)}:host .field-wrapper.invalid{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}:host .wrapper:not(.label-left) .field-wrapper{-ms-flex-negative:0;flex-shrink:0}:host .character-count{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:5rem;background-color:var(--wmcolor-taginput-charcount-background);font-size:0.875rem;font-weight:500;-ms-flex-item-align:stretch;align-self:stretch}:host .tags-and-input-wrapper{position:relative;width:100%;padding:8px 8px 8px 0;overflow:auto;max-height:200px}:host .tags-and-input-wrapper.in-modal{max-height:20vh}:host .upper-row{width:100%;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:justify;justify-content:space-between}:host .upper-row:before{-ms-flex-item-align:start;align-self:flex-start;display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f349\";color:var(--wmcolor-taginput-icon);padding:0.75rem 0.5rem 0.75rem 0.75rem;line-height:normal;font-size:1.12rem}:host .lower-row{width:100%;min-height:1.875rem}:host #max-tags{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:1.875rem;background-color:var(--wmcolor-taginput-maxtags-background);padding:0.5rem 1rem;color:var(--wmcolor-taginput-maxtags-text);font-size:0.875rem;border-top:1px solid var(--wmcolor-taginput-maxtags-border);border-radius:0 0 3px 3px}:host .tag-area{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:0;margin:0;gap:8px}:host .tag-area:focus{outline:none}:host .tag-area li{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;height:1.75rem;list-style:none;color:var(--wmcolor-taginput-tag-text);background-color:var(--wmcolor-taginput-tag-background);padding:0.5rem 0.625rem;-webkit-transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);white-space:pre}:host .tag-area li.highlight{-webkit-animation:fadeIn 1s;animation:fadeIn 1s}@-webkit-keyframes fadeIn{0%{background-color:var(--wmcolor-taginput-tag-background)}50%{background-color:var(--wmcolor-taginput-tag-background-highlight)}100%{background-color:var(--wmcolor-taginput-tag-background)}}@keyframes fadeIn{0%{background-color:var(--wmcolor-taginput-tag-background)}50%{background-color:var(--wmcolor-taginput-tag-background-highlight)}100%{background-color:var(--wmcolor-taginput-tag-background)}}:host .tag-area li.focused{background-color:var(--wmcolor-taginput-tag-background-focus)}:host .tag-area li.locked{background-color:var(--wmcolor-taginput-tag-background-locked);color:var(--wmcolor-taginput-tag-text-locked)}:host .tag-area li .icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:1.25rem;width:1.25rem;padding:0;margin-left:0.5rem}:host .tag-area li .icon.remove-btn{border:1px solid var(--wmcolor-taginput-tagbutton-border);color:var(--wmcolor-taginput-tagbutton-icon);border-radius:50%;cursor:pointer;-webkit-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1)}:host .tag-area li .icon.remove-btn:hover{color:var(--wmcolor-taginput-tagbutton-icon-hover);background-color:var(--wmcolor-taginput-tagbutton-background-hover)}:host .tag-area li .icon.remove-btn:before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f156\"}:host .tag-area li .icon.lock{color:var(--wmcolor-taginput-tag-text-locked)}:host .tag-area li .icon.lock:before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f341\"}:host .input{font-family:inherit;border:none;height:1.75rem;padding:0;margin:0;right:8px}:host .input:focus{outline:none}:host .tag-area:not(.empty)+.input.extended{-webkit-margin-before:8px;margin-block-start:8px}:host .dropdown-wrapper{margin:0;padding:0;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;position:absolute;top:calc(100% + 2px);right:0;z-index:100;width:100%;font-size:0.875rem}:host .dropdown-wrapper .dropdown{-webkit-overflow-scrolling:touch;overflow:auto;max-height:12.5rem;margin:0;padding:0}:host .dropdown-wrapper.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .dropdown-wrapper.upwards{top:unset;bottom:calc(100% + 2px);-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}:host .dropdown-wrapper li,:host .dropdown-wrapper div{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0 1rem;background:var(--wmcolor-taginput-option-background);list-style:none;min-height:2.6875rem;white-space:pre-wrap;overflow-wrap:anywhere}:host .dropdown-wrapper li.option,:host .dropdown-wrapper li.add-new-btn,:host .dropdown-wrapper div.option,:host .dropdown-wrapper div.add-new-btn{cursor:pointer;color:var(--wmcolor-taginput-option-text);font-weight:bold;width:100%;border:none}:host .dropdown-wrapper li.option[aria-selected=true],:host .dropdown-wrapper li.add-new-btn[aria-selected=true],:host .dropdown-wrapper div.option[aria-selected=true],:host .dropdown-wrapper div.add-new-btn[aria-selected=true]{color:var(--wmcolor-taginput-option-text-selected);font-style:italic;font-weight:normal;cursor:unset}:host .dropdown-wrapper li.option:hover:not([aria-selected=true]),:host .dropdown-wrapper li.option.focused,:host .dropdown-wrapper li.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper li.add-new-btn.focused,:host .dropdown-wrapper div.option:hover:not([aria-selected=true]),:host .dropdown-wrapper div.option.focused,:host .dropdown-wrapper div.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper div.add-new-btn.focused{outline:none;background:var(--wmcolor-taginput-option-background-hover)}:host .dropdown-wrapper li.help-text,:host .dropdown-wrapper div.help-text{color:var(--wmcolor-taginput-help-text);height:auto;min-height:2.6875rem;padding-top:0.25rem;padding-bottom:0.25rem;white-space:normal}:host .dropdown-wrapper li:not(:last-child),:host .dropdown-wrapper div:not(:last-child){border-bottom:2px solid var(--wmcolor-taginput-option-border)}:host .info-text{font-style:italic;margin-top:0.25rem}:host .table-wrapper{overflow:auto;margin-top:1.5rem}:host .table-wrapper #table{width:100%;border-spacing:0px}:host .table-wrapper #table.fixed-widths{table-layout:fixed}:host .table-wrapper #table .headers{height:2.5rem;background-color:var(--wmcolor-taginput-header-background-table)}:host .table-wrapper #table .headers th{text-align:left;font-size:0.75rem;font-weight:700;text-transform:uppercase;padding:0 1.5rem}:host .table-wrapper tr:nth-child(even){background-color:var(--wmcolor-taginput-altrow-background-table)}:host .table-wrapper tr.selected,:host .table-wrapper tr.locked{background-color:var(--wmcolor-taginput-row-background-selected);-webkit-box-shadow:inset 0 0 0 1px var(--wmcolor-taginput-row-border-selected);box-shadow:inset 0 0 0 1px var(--wmcolor-taginput-row-border-selected);font-weight:500}:host .table-wrapper tr.focused:not(.locked),:host .table-wrapper tr:hover:not(.locked){background-color:var(--wmcolor-taginput-row-background-hover);-webkit-box-shadow:none;box-shadow:none}:host .table-wrapper tr.locked td{cursor:auto}:host .table-wrapper tr.locked td:first-child .cell-content-wrapper:before{display:inline-block;font:normal normal normal 24px/1 \"Material Design Icons\";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:\"\\f33e\";margin-right:0.5rem;color:var(--wmcolor-taginput-tag-text)}:host .table-wrapper td{height:3.75rem;vertical-align:middle;padding:0 1.5rem;cursor:pointer}:host .table-wrapper td.focused{-webkit-box-shadow:inset 0 2px 2px 0 rgba(244, 243, 246, 0.2), inset 0 2px 2px 0 rgba(0, 0, 0, 0.1), inset 0 0 4px 3px var(--wmcolor-interactive-focus);box-shadow:inset 0 2px 2px 0 rgba(244, 243, 246, 0.2), inset 0 2px 2px 0 rgba(0, 0, 0, 0.1), inset 0 0 4px 3px var(--wmcolor-interactive-focus)}:host .table-wrapper td .cell-content-wrapper.trunc{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .table-wrapper td .description{display:none}:host .no-results{padding:1.25rem 1.5rem}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host #error{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;margin-top:0.25rem}";
10
10
 
11
11
  const TagInput = class {
12
- constructor(hostRef) {
13
- index.registerInstance(this, hostRef);
14
- this.wmTagInputTagAdded = index.createEvent(this, "wmTagInputTagAdded", 7);
15
- this.addNewHelpText = functions.intl.formatMessage({
16
- id: "tagInput.addNewHelpText",
17
- defaultMessage: "Press the Enter or Comma key to add a new tag.",
18
- description: "Help text appearing in a dropdown. Use imperative",
19
- });
20
- this.selectionHelpText = functions.intl.formatMessage({
21
- id: "tagInput.selectionHelpText",
22
- defaultMessage: "Search and select a tag.",
23
- description: "Help text appearing in a dropdown. Use imperative",
24
- });
25
- this.maxTagsReachedMessage = functions.intl.formatMessage({
26
- id: "tagInput.maxTagsReached",
27
- defaultMessage: "No more tags can be added because the limit has been reached.",
28
- });
29
- this.tagAreaInstructions = functions.intl.formatMessage({
30
- id: "tagInput.tagAreaInstructions",
31
- defaultMessage: "tag selection. Press Backspace or Delete to remove a tag.",
32
- });
33
- this.tagsAddedMessage = functions.intl.formatMessage({
34
- id: "tagInput.tagsAdded",
35
- defaultMessage: "Tags added",
36
- description: "Full message for context: 'Tags added: x/y",
37
- });
38
- this.openUp = false;
39
- this.inModal = false;
40
- this.lastAddedTags = []; // the tag(s) added by the user on their last action (for highlighting)
41
- this.debouncedUpdate = functions.debounce(() => index.forceUpdate(this.el), 30);
42
- this.label = undefined;
43
- this.errorMessage = undefined;
44
- this.info = undefined;
45
- this.labelPosition = "top";
46
- this.maxTags = undefined;
47
- this.placeholder = undefined;
48
- this.requiredField = false;
49
- this.tagInputType = "dropdown";
50
- this.helpText = undefined;
51
- this.addNew = true;
52
- this.characterLimit = 50;
53
- this.colHeaders = undefined;
54
- this.colWidths = undefined;
55
- this.colWrap = undefined;
56
- this.isExpanded = false;
57
- this.liveRegionMessage = "";
58
- this.focusedOption = undefined;
59
- this.focusedColumn = 0;
60
- this.focusedTagIndex = undefined;
61
- this.tagsList = [];
62
- }
63
- get isDropdown() {
64
- return this.tagInputType === "dropdown";
65
- }
66
- get isTable() {
67
- return this.tagInputType === "table";
68
- }
69
- get charCount() {
70
- return this.inputEl ? this.inputEl.value.length : 0;
71
- }
72
- get tooltipVisible() {
73
- return document.getElementById("wm-tooltip").classList.contains("show");
74
- }
75
- get optionEls() {
76
- return Array.from(this.el.querySelectorAll("wm-tag-option"));
77
- }
78
- // list of options matching user query
79
- get filteredOptionEls() {
80
- const query = this.inputEl ? this.inputEl.value.toLowerCase() : "";
81
- const list = Array.from(this.optionEls).filter((o) => {
82
- let values = "";
83
- if (this.isDropdown) {
84
- values = o.textContent.toLowerCase();
85
- }
86
- else if (this.isTable) {
87
- values = [o.col1, o.col2, o.col3, o.col4].join("").toLowerCase();
88
- }
89
- return values.includes(query);
90
- });
91
- return list;
92
- }
93
- // the ones that should be rendered as tags
94
- get taggedOptions() {
95
- return this.optionEls.filter((o) => o.selected || o.locked);
96
- }
97
- // for visual stuff (measuring, truncating...)
98
- get _tagEls() {
99
- return this.tagAreaEl ? Array.from(this.tagAreaEl.querySelectorAll(".tag")) : [];
100
- }
101
- // unlocked and selected tags, i.e. the ones that the user can interact with.
102
- // (as opposed to locked tags who can't be focused / deleted)
103
- // used for focus logic
104
- get focusableTags() {
105
- return this._tagEls.filter((t) => !t.classList.contains("locked"));
106
- }
107
- get focusedTag() {
108
- if (this.focusedTagIndex !== undefined && this.focusedTagIndex >= 0)
109
- return this.focusableTags[this.focusedTagIndex];
110
- }
111
- // get the wm-tag-option, given the internal representation (dropdown li or table tr)
112
- tagOptionFromEl(el) {
113
- return el.id === "add-new-btn" ? undefined : this.el.querySelector("#" + el.id);
114
- }
115
- // get the wm-tag-option, given the internal representation of a tag
116
- tagOptionFromTag(el) {
117
- const id = el.id.replace("tag-", "");
118
- return this.el.querySelector("#" + id);
119
- }
120
- // get the internal representation of a wm-tag-option
121
- elFromTagOption(el) {
122
- return this.el.shadowRoot.querySelector("#" + el.id);
123
- }
124
- // focusedOption state refers to the wm-tag-option. This gets the corresponding element in the shadow DOM, or the "Add New" button.
125
- get _focusedOption() {
126
- if (!!this.focusedOption) {
127
- return this.elFromTagOption(this.focusedOption);
128
- }
129
- else if (this.addNewButton && this.addNewButton.classList.contains("focused")) {
130
- return this.addNewButton;
131
- }
132
- }
133
- get _focusedCell() {
134
- if (!!this._focusedOption) {
135
- const allCells = Array.from(this._focusedOption.querySelectorAll("td"));
136
- const index = this.focusedColumn || 0;
137
- return allCells[index];
138
- }
139
- }
140
- get inputActiveDescendantId() {
141
- if (this._focusedOption) {
142
- if (this.isTable) {
143
- const cells = Array.from(this._focusedOption.querySelectorAll("td"));
144
- return cells[this.focusedColumn].id;
145
- }
146
- return this._focusedOption.id;
147
- }
148
- return null;
149
- }
150
- get tagLimitReached() {
151
- return !!(this.maxTags && this.taggedOptions.length >= this.maxTags);
152
- }
153
- get noResultsMessage() {
154
- return functions.intl.formatMessage({
155
- id: "tagInput.noResults",
156
- defaultMessage: "No results match your search.",
157
- description: "Message displayed when a user's search returns empty.",
158
- });
159
- }
160
- get inputMinimumWidth() {
161
- if (this._tagEls) {
162
- // 150px is the minimum width of the input field, or the length of the placeholder text
163
- const inputElStyles = getComputedStyle(this.inputEl);
164
- const tagElStyles = getComputedStyle(this._tagEls[this._tagEls.length - 1]);
165
- const inputElBuffer = [
166
- inputElStyles.paddingLeft,
167
- inputElStyles.paddingRight,
168
- inputElStyles.marginLeft,
169
- inputElStyles.marginRight,
170
- tagElStyles.marginRight,
171
- ].reduce((prev, curr) => prev + parseInt(curr.replace("px", "")), 0);
172
- const minimumWidth = Math.max(150, functions.measureText(this.inputEl, this.placeholder).width + inputElBuffer);
173
- return minimumWidth;
174
- }
175
- else {
176
- return 150;
177
- }
178
- }
179
- getTagName(o) {
180
- // when the user is typing and adding a new option, all we can pass is the text typed. so for the dropdown type the tag name is the identifier. It also takes care of duplicates. Table variant requires an id as the tag name is the first column but we want to allow duplicates here (e.g. people with the same name)
181
- return this.isDropdown ? o.textContent : o.col1;
182
- }
183
- isExistingTag(tag) {
184
- const list = this.optionEls.map((o) => this.getTagName(o).toLowerCase());
185
- return list.includes(tag.toLowerCase());
186
- }
187
- tagAddedMessage(tag) {
188
- return functions.intl.formatMessage({
189
- id: "tagInput.tagAdded",
190
- defaultMessage: "{tagName} added.",
191
- description: "A confirmation for adding a tag.",
192
- }, { tagName: tag });
193
- }
194
- tagRemovedMessage(tag) {
195
- return functions.intl.formatMessage({
196
- id: "tagInput.tagRemoved",
197
- defaultMessage: "{tagName} removed.",
198
- description: "A confirmation for removing a tag.",
199
- }, { tagName: tag });
200
- }
201
- tagAlreadyAddedMessage(tag) {
202
- return functions.intl.formatMessage({
203
- id: "tagInput.tagAlreadyAdded",
204
- defaultMessage: "{tagName} has already been added.",
205
- description: "An alert for adding a tag that is already present.",
206
- }, { tagName: tag });
207
- }
208
- isElOrChild(el) {
209
- return el === this.el || this.el.shadowRoot.contains(el) || this.el.contains(el);
210
- }
211
- componentWillLoad() {
212
- if (!this.placeholder) {
213
- this.placeholder = this.createPlaceholderDefault(this.addNew, this.optionEls.length > 0);
214
- }
215
- if (!this.label) {
216
- console.error("wm-tag-input must have a label property");
217
- }
218
- this.el.focus = () => {
219
- const firstFocusableTag = this.focusableTags[0];
220
- if (firstFocusableTag) {
221
- this.tagAreaEl.focus();
222
- this.focusTag(firstFocusableTag);
223
- }
224
- else {
225
- this.inputEl.focus();
226
- }
227
- };
228
- // on resize of component, trigger componentDidRender -> positionInput
229
- const resizeObserver = new ResizeObserver(() => this.debouncedUpdate());
230
- resizeObserver.observe(this.el);
231
- // if within wm-modal, change max-height to vh unit
232
- if (this.el.closest("wm-modal")) {
233
- this.inModal = true;
234
- }
235
- const lockedTags = [];
236
- const regularTags = [];
237
- this.optionEls.forEach((o) => {
238
- if (o.locked) {
239
- lockedTags.push(o);
240
- }
241
- else if (o.selected) {
242
- regularTags.push(o);
243
- }
244
- });
245
- this.tagsList = [...lockedTags, ...regularTags];
246
- }
247
- componentDidLoad() {
248
- // Set up observer to announce changes in selected tags, or removed user-added tags
249
- const observerAnnouncer = new MutationObserver((optionListMutations) => optionListMutations.forEach((mutationRecord) => this.handleChangeAnnouncement(mutationRecord)));
250
- observerAnnouncer.observe(this.el, {
251
- subtree: true,
252
- attributes: true,
253
- attributeFilter: ["selected"],
254
- childList: true,
255
- });
256
- // Set up observer that ensures parent reload
257
- // when children wm-tag-options are removed
258
- const optionListObserver = new MutationObserver((optionListMutations) => optionListMutations.forEach((mutationRecord) => this.handleOptionListChange(mutationRecord)));
259
- optionListObserver.observe(this.el, {
260
- childList: true,
261
- });
262
- // Set up the observer that will handle focus
263
- // when tag list changes
264
- if (!!this.tagAreaEl) {
265
- const tagListObserver = new MutationObserver((tagListMutations) => tagListMutations.forEach((mutationRecord) => this.handleTagListChange(mutationRecord)));
266
- tagListObserver.observe(this.tagAreaEl, {
267
- childList: true,
268
- });
269
- }
270
- }
271
- handleChangeAnnouncement(mutationRecord) {
272
- const tagOptionEl = mutationRecord.target;
273
- if (mutationRecord.type == "childList" && mutationRecord.removedNodes.length > 0) {
274
- // announce deselection of user-added tag, whose element removal is picked up
275
- this.announce(this.tagRemovedMessage(mutationRecord.removedNodes[0].textContent));
276
- }
277
- else if (mutationRecord.type == "attributes") {
278
- // announce selection or deselection of all kinds of tags
279
- if (tagOptionEl.selected) {
280
- this.announce(this.tagAddedMessage(tagOptionEl.textContent));
281
- }
282
- else {
283
- this.announce(this.tagRemovedMessage(tagOptionEl.textContent));
284
- }
285
- }
286
- }
287
- handleOptionListChange(record) {
288
- const addedNodes = Array.from(record.addedNodes);
289
- if (addedNodes.length > 0) {
290
- addedNodes.forEach((n) => !this.tagsList.includes(n) && this.tagsList.push(n));
291
- }
292
- const removedNodes = Array.from(record.removedNodes);
293
- if (removedNodes.length > 0) {
294
- this.tagsList = this.tagsList.filter((t) => !removedNodes.includes(t));
295
- }
296
- }
297
- handleTagOptionSelected(ev) {
298
- const selOption = ev.target;
299
- this.tagsList = this.tagsList.concat(selOption);
300
- }
301
- handleTagOptionDeselected(ev) {
302
- const deselOption = ev.target;
303
- this.tagsList = this.tagsList.filter((t) => t != deselOption);
304
- }
305
- handleTagListChange(mutationRecord) {
306
- // there are 2 cases: the option still exists but is no longer selected,
307
- // or it was removed altogether
308
- const removedTag = mutationRecord.removedNodes[0];
309
- if (!!removedTag) {
310
- // this is a trick. focusedTag gets the ref from an index. When an element
311
- // is removed it will fall back on the new element with that index if it exists
312
- if (this.focusedTag) {
313
- this.focusTag(this.focusedTag);
314
- }
315
- else if (this.focusableTags.length > 0) {
316
- // Otherwise the last tag was deleted and we reassign to the new last tag.
317
- const tagToFocus = this.focusableTags[this.focusableTags.length - 1];
318
- this.focusTag(tagToFocus);
319
- }
320
- else {
321
- // unless there are no more tags...
322
- this.inputEl.focus();
323
- }
324
- this.lastAddedTags = [];
325
- }
326
- }
327
- componentDidRender() {
328
- this.positionInput();
329
- // check each tag if truncation is needed
330
- this._tagEls.forEach((tag) => {
331
- const textEl = tag.querySelector(".tag-text");
332
- const wrapper = this.el.shadowRoot.querySelector(".tags-and-input-wrapper");
333
- const leftBound = textEl.getBoundingClientRect().left;
334
- // the numbers represent spacing values for padding, margin, and delete icon
335
- const rightBound = wrapper.getBoundingClientRect().right - 10 - 8 - 28;
336
- const id = tag.id.replace("tag-", "");
337
- const optionEl = id && this.el.querySelector("#" + id);
338
- if (optionEl) {
339
- // tag text for table variant is first column text
340
- textEl.textContent = functions.truncateText(textEl, this.getTagName(optionEl), rightBound - leftBound, 5);
341
- }
342
- });
343
- }
344
- createPlaceholderDefault(addNew, hasOptions) {
345
- const addAndSearchPlaceholder = functions.intl.formatMessage({
346
- id: "tagInput.placeholderAddAndSearch",
347
- defaultMessage: "Add or search for a tag",
348
- description: "Placeholder text. Use imperative",
349
- });
350
- const searchPlaceholder = functions.intl.formatMessage({
351
- id: "tagInput.placeholderSearch",
352
- defaultMessage: "Search and select a tag",
353
- description: "Placeholder text. Use imperative",
354
- });
355
- const addPlaceholder = functions.intl.formatMessage({
356
- id: "tagInput.placeholderAdd",
357
- defaultMessage: "Add a new tag",
358
- description: "Placeholder text. Use imperative",
359
- });
360
- let placeholder = "";
361
- if (addNew && hasOptions) {
362
- placeholder = addAndSearchPlaceholder;
363
- }
364
- else if (!addNew && hasOptions) {
365
- placeholder = searchPlaceholder;
366
- }
367
- else if (addNew) {
368
- placeholder = addPlaceholder;
369
- }
370
- return placeholder;
371
- }
372
- handleErrorMessageChange() {
373
- if (this.errorMessage) {
374
- this.announce(this.errorMessage);
375
- }
376
- }
377
- handleClick(ev) {
378
- const el = ev.target;
379
- if (this.isDropdown && !this.el.contains(el) && this.isExpanded) {
380
- this.closeDropdown();
381
- }
382
- else if (Array.from(this.el.children).includes(el)) {
383
- const option = el;
384
- const tagName = this.getTagName(option);
385
- this.lastAddedTags = [tagName];
386
- }
387
- }
388
- handleOptionClick(ev) {
12
+ constructor(hostRef) {
13
+ index.registerInstance(this, hostRef);
14
+ this.wmTagInputTagAdded = index.createEvent(this, "wmTagInputTagAdded", 7);
15
+ this.addNewHelpText = functions.intl.formatMessage({
16
+ id: "tagInput.addNewHelpText",
17
+ defaultMessage: "Press the Enter or Comma key to add a new tag.",
18
+ description: "Help text appearing in a dropdown. Use imperative",
19
+ });
20
+ this.selectionHelpText = functions.intl.formatMessage({
21
+ id: "tagInput.selectionHelpText",
22
+ defaultMessage: "Search and select a tag.",
23
+ description: "Help text appearing in a dropdown. Use imperative",
24
+ });
25
+ this.maxTagsReachedMessage = functions.intl.formatMessage({
26
+ id: "tagInput.maxTagsReached",
27
+ defaultMessage: "No more tags can be added because the limit has been reached.",
28
+ });
29
+ this.tagAreaInstructions = functions.intl.formatMessage({
30
+ id: "tagInput.tagAreaInstructions",
31
+ defaultMessage: "tag selection. Press Backspace or Delete to remove a tag.",
32
+ });
33
+ this.tagsAddedMessage = functions.intl.formatMessage({
34
+ id: "tagInput.tagsAdded",
35
+ defaultMessage: "Tags added",
36
+ description: "Full message for context: 'Tags added: x/y",
37
+ });
38
+ this.openUp = false;
39
+ this.inModal = false;
40
+ this.lastAddedTags = []; // the tag(s) added by the user on their last action (for highlighting)
41
+ this.debouncedUpdate = functions.debounce(() => index.forceUpdate(this.el), 30);
42
+ this.label = undefined;
43
+ this.errorMessage = undefined;
44
+ this.info = undefined;
45
+ this.labelPosition = "top";
46
+ this.maxTags = undefined;
47
+ this.placeholder = undefined;
48
+ this.requiredField = false;
49
+ this.tagInputType = "dropdown";
50
+ this.helpText = undefined;
51
+ this.addNew = true;
52
+ this.characterLimit = 50;
53
+ this.colHeaders = undefined;
54
+ this.colWidths = undefined;
55
+ this.colWrap = undefined;
56
+ this.isExpanded = false;
57
+ this.liveRegionMessage = "";
58
+ this.focusedOption = undefined;
59
+ this.focusedColumn = 0;
60
+ this.focusedTagIndex = undefined;
61
+ this.tagsList = [];
62
+ }
63
+ get isDropdown() {
64
+ return this.tagInputType === "dropdown";
65
+ }
66
+ get isTable() {
67
+ return this.tagInputType === "table";
68
+ }
69
+ get charCount() {
70
+ return this.inputEl ? this.inputEl.value.length : 0;
71
+ }
72
+ get tooltipVisible() {
73
+ return document.getElementById("wm-tooltip").classList.contains("show");
74
+ }
75
+ get optionEls() {
76
+ return Array.from(this.el.querySelectorAll("wm-tag-option"));
77
+ }
78
+ // list of options matching user query
79
+ get filteredOptionEls() {
80
+ const query = this.inputEl ? this.inputEl.value.toLowerCase() : "";
81
+ const list = Array.from(this.optionEls).filter((o) => {
82
+ let values = "";
83
+ if (this.isDropdown) {
84
+ values = o.textContent.toLowerCase();
85
+ }
86
+ else if (this.isTable) {
87
+ values = [o.col1, o.col2, o.col3, o.col4].join("").toLowerCase();
88
+ }
89
+ return values.includes(query);
90
+ });
91
+ return list;
92
+ }
93
+ // the ones that should be rendered as tags
94
+ get taggedOptions() {
95
+ return this.optionEls.filter((o) => o.selected || o.locked);
96
+ }
97
+ // for visual stuff (measuring, truncating...)
98
+ get _tagEls() {
99
+ return this.tagAreaEl ? Array.from(this.tagAreaEl.querySelectorAll(".tag")) : [];
100
+ }
101
+ // unlocked and selected tags, i.e. the ones that the user can interact with.
102
+ // (as opposed to locked tags who can't be focused / deleted)
103
+ // used for focus logic
104
+ get focusableTags() {
105
+ return this._tagEls.filter((t) => !t.classList.contains("locked"));
106
+ }
107
+ get focusedTag() {
108
+ if (this.focusedTagIndex !== undefined && this.focusedTagIndex >= 0)
109
+ return this.focusableTags[this.focusedTagIndex];
110
+ }
111
+ // get the wm-tag-option, given the internal representation (dropdown li or table tr)
112
+ tagOptionFromEl(el) {
113
+ return el.id === "add-new-btn" ? undefined : this.el.querySelector("#" + el.id);
114
+ }
115
+ // get the wm-tag-option, given the internal representation of a tag
116
+ tagOptionFromTag(el) {
117
+ const id = el.id.replace("tag-", "");
118
+ return this.el.querySelector("#" + id);
119
+ }
120
+ // get the internal representation of a wm-tag-option
121
+ elFromTagOption(el) {
122
+ return this.el.shadowRoot.querySelector("#" + el.id);
123
+ }
124
+ // focusedOption state refers to the wm-tag-option. This gets the corresponding element in the shadow DOM, or the "Add New" button.
125
+ get _focusedOption() {
126
+ if (!!this.focusedOption) {
127
+ return this.elFromTagOption(this.focusedOption);
128
+ }
129
+ else if (this.addNewButton && this.addNewButton.classList.contains("focused")) {
130
+ return this.addNewButton;
131
+ }
132
+ }
133
+ get _focusedCell() {
134
+ if (!!this._focusedOption) {
135
+ const allCells = Array.from(this._focusedOption.querySelectorAll("td"));
136
+ const index = this.focusedColumn || 0;
137
+ return allCells[index];
138
+ }
139
+ }
140
+ get inputActiveDescendantId() {
141
+ if (this._focusedOption) {
142
+ if (this.isTable) {
143
+ const cells = Array.from(this._focusedOption.querySelectorAll("td"));
144
+ return cells[this.focusedColumn].id;
145
+ }
146
+ return this._focusedOption.id;
147
+ }
148
+ return null;
149
+ }
150
+ get tagLimitReached() {
151
+ return !!(this.maxTags && this.taggedOptions.length >= this.maxTags);
152
+ }
153
+ get noResultsMessage() {
154
+ return functions.intl.formatMessage({
155
+ id: "tagInput.noResults",
156
+ defaultMessage: "No results match your search.",
157
+ description: "Message displayed when a user's search returns empty.",
158
+ });
159
+ }
160
+ get inputMinimumWidth() {
161
+ if (this._tagEls) {
162
+ // 150px is the minimum width of the input field, or the length of the placeholder text
163
+ const inputElStyles = getComputedStyle(this.inputEl);
164
+ const tagElStyles = getComputedStyle(this._tagEls[this._tagEls.length - 1]);
165
+ const inputElBuffer = [
166
+ inputElStyles.paddingLeft,
167
+ inputElStyles.paddingRight,
168
+ inputElStyles.marginLeft,
169
+ inputElStyles.marginRight,
170
+ tagElStyles.marginRight,
171
+ ].reduce((prev, curr) => prev + parseInt(curr.replace("px", "")), 0);
172
+ const minimumWidth = Math.max(150, functions.measureText(this.inputEl, this.placeholder).width + inputElBuffer);
173
+ return minimumWidth;
174
+ }
175
+ else {
176
+ return 150;
177
+ }
178
+ }
179
+ getTagName(o) {
180
+ // when the user is typing and adding a new option, all we can pass is the text typed. so for the dropdown type the tag name is the identifier. It also takes care of duplicates. Table variant requires an id as the tag name is the first column but we want to allow duplicates here (e.g. people with the same name)
181
+ return this.isDropdown ? o.textContent : o.col1;
182
+ }
183
+ isExistingTag(tag) {
184
+ const list = this.optionEls.map((o) => this.getTagName(o).toLowerCase());
185
+ return list.includes(tag.toLowerCase());
186
+ }
187
+ tagAddedMessage(tag) {
188
+ return functions.intl.formatMessage({
189
+ id: "tagInput.tagAdded",
190
+ defaultMessage: "{tagName} added.",
191
+ description: "A confirmation for adding a tag.",
192
+ }, { tagName: tag });
193
+ }
194
+ tagRemovedMessage(tag) {
195
+ return functions.intl.formatMessage({
196
+ id: "tagInput.tagRemoved",
197
+ defaultMessage: "{tagName} removed.",
198
+ description: "A confirmation for removing a tag.",
199
+ }, { tagName: tag });
200
+ }
201
+ tagAlreadyAddedMessage(tag) {
202
+ return functions.intl.formatMessage({
203
+ id: "tagInput.tagAlreadyAdded",
204
+ defaultMessage: "{tagName} has already been added.",
205
+ description: "An alert for adding a tag that is already present.",
206
+ }, { tagName: tag });
207
+ }
208
+ isElOrChild(el) {
209
+ return el === this.el || this.el.shadowRoot.contains(el) || this.el.contains(el);
210
+ }
211
+ componentWillLoad() {
212
+ if (!this.placeholder) {
213
+ this.placeholder = this.createPlaceholderDefault(this.addNew, this.optionEls.length > 0);
214
+ }
215
+ if (!this.label) {
216
+ console.error("wm-tag-input must have a label property");
217
+ }
218
+ this.el.focus = () => {
219
+ const firstFocusableTag = this.focusableTags[0];
220
+ if (firstFocusableTag) {
221
+ this.tagAreaEl.focus();
222
+ this.focusTag(firstFocusableTag);
223
+ }
224
+ else {
225
+ this.inputEl.focus();
226
+ }
227
+ };
228
+ // on resize of component, trigger componentDidRender -> positionInput
229
+ const resizeObserver = new ResizeObserver(() => this.debouncedUpdate());
230
+ resizeObserver.observe(this.el);
231
+ // if within wm-modal, change max-height to vh unit
232
+ if (this.el.closest("wm-modal")) {
233
+ this.inModal = true;
234
+ }
235
+ const lockedTags = [];
236
+ const regularTags = [];
237
+ this.optionEls.forEach((o) => {
238
+ if (o.locked) {
239
+ lockedTags.push(o);
240
+ }
241
+ else if (o.selected) {
242
+ regularTags.push(o);
243
+ }
244
+ });
245
+ this.tagsList = [...lockedTags, ...regularTags];
246
+ }
247
+ componentDidLoad() {
248
+ // Set up observer to announce changes in selected tags, or removed user-added tags
249
+ const observerAnnouncer = new MutationObserver((optionListMutations) => optionListMutations.forEach((mutationRecord) => this.handleChangeAnnouncement(mutationRecord)));
250
+ observerAnnouncer.observe(this.el, {
251
+ subtree: true,
252
+ attributes: true,
253
+ attributeFilter: ["selected"],
254
+ childList: true,
255
+ });
256
+ // Set up observer that ensures parent reload
257
+ // when children wm-tag-options are removed
258
+ const optionListObserver = new MutationObserver((optionListMutations) => optionListMutations.forEach((mutationRecord) => this.handleOptionListChange(mutationRecord)));
259
+ optionListObserver.observe(this.el, {
260
+ childList: true,
261
+ });
262
+ // Set up the observer that will handle focus
263
+ // when tag list changes
264
+ if (!!this.tagAreaEl) {
265
+ const tagListObserver = new MutationObserver((tagListMutations) => tagListMutations.forEach((mutationRecord) => this.handleTagListChange(mutationRecord)));
266
+ tagListObserver.observe(this.tagAreaEl, {
267
+ childList: true,
268
+ });
269
+ }
270
+ }
271
+ handleChangeAnnouncement(mutationRecord) {
272
+ const tagOptionEl = mutationRecord.target;
273
+ if (mutationRecord.type == "childList" && mutationRecord.removedNodes.length > 0) {
274
+ // announce deselection of user-added tag, whose element removal is picked up
275
+ this.announce(this.tagRemovedMessage(mutationRecord.removedNodes[0].textContent));
276
+ }
277
+ else if (mutationRecord.type == "attributes") {
278
+ // announce selection or deselection of all kinds of tags
279
+ if (tagOptionEl.selected) {
280
+ this.announce(this.tagAddedMessage(tagOptionEl.textContent));
281
+ }
282
+ else {
283
+ this.announce(this.tagRemovedMessage(tagOptionEl.textContent));
284
+ }
285
+ }
286
+ }
287
+ handleOptionListChange(record) {
288
+ const addedNodes = Array.from(record.addedNodes);
289
+ if (addedNodes.length > 0) {
290
+ addedNodes.forEach((n) => !this.tagsList.includes(n) && this.tagsList.push(n));
291
+ }
292
+ const removedNodes = Array.from(record.removedNodes);
293
+ if (removedNodes.length > 0) {
294
+ this.tagsList = this.tagsList.filter((t) => !removedNodes.includes(t));
295
+ }
296
+ }
297
+ handleTagOptionSelected(ev) {
298
+ const selOption = ev.target;
299
+ this.tagsList = this.tagsList.concat(selOption);
300
+ }
301
+ handleTagOptionDeselected(ev) {
302
+ const deselOption = ev.target;
303
+ this.tagsList = this.tagsList.filter((t) => t != deselOption);
304
+ }
305
+ handleTagListChange(mutationRecord) {
306
+ // there are 2 cases: the option still exists but is no longer selected,
307
+ // or it was removed altogether
308
+ const removedTag = mutationRecord.removedNodes[0];
309
+ if (!!removedTag) {
310
+ // this is a trick. focusedTag gets the ref from an index. When an element
311
+ // is removed it will fall back on the new element with that index if it exists
312
+ if (this.focusedTag) {
313
+ this.focusTag(this.focusedTag);
314
+ }
315
+ else if (this.focusableTags.length > 0) {
316
+ // Otherwise the last tag was deleted and we reassign to the new last tag.
317
+ const tagToFocus = this.focusableTags[this.focusableTags.length - 1];
318
+ this.focusTag(tagToFocus);
319
+ }
320
+ else {
321
+ // unless there are no more tags...
322
+ this.inputEl.focus();
323
+ }
324
+ this.lastAddedTags = [];
325
+ }
326
+ }
327
+ componentDidRender() {
328
+ this.positionInput();
329
+ // check each tag if truncation is needed
330
+ this._tagEls.forEach((tag) => {
331
+ const textEl = tag.querySelector(".tag-text");
332
+ const wrapper = this.el.shadowRoot.querySelector(".tags-and-input-wrapper");
333
+ const leftBound = textEl.getBoundingClientRect().left;
334
+ // the numbers represent spacing values for padding, margin, and delete icon
335
+ const rightBound = wrapper.getBoundingClientRect().right - 10 - 8 - 28;
336
+ const id = tag.id.replace("tag-", "");
337
+ const optionEl = id && this.el.querySelector("#" + id);
338
+ if (optionEl) {
339
+ // tag text for table variant is first column text
340
+ textEl.textContent = functions.truncateText(textEl, this.getTagName(optionEl), rightBound - leftBound, 5);
341
+ }
342
+ });
343
+ }
344
+ createPlaceholderDefault(addNew, hasOptions) {
345
+ const addAndSearchPlaceholder = functions.intl.formatMessage({
346
+ id: "tagInput.placeholderAddAndSearch",
347
+ defaultMessage: "Add or search for a tag",
348
+ description: "Placeholder text. Use imperative",
349
+ });
350
+ const searchPlaceholder = functions.intl.formatMessage({
351
+ id: "tagInput.placeholderSearch",
352
+ defaultMessage: "Search and select a tag",
353
+ description: "Placeholder text. Use imperative",
354
+ });
355
+ const addPlaceholder = functions.intl.formatMessage({
356
+ id: "tagInput.placeholderAdd",
357
+ defaultMessage: "Add a new tag",
358
+ description: "Placeholder text. Use imperative",
359
+ });
360
+ let placeholder = "";
361
+ if (addNew && hasOptions) {
362
+ placeholder = addAndSearchPlaceholder;
363
+ }
364
+ else if (!addNew && hasOptions) {
365
+ placeholder = searchPlaceholder;
366
+ }
367
+ else if (addNew) {
368
+ placeholder = addPlaceholder;
369
+ }
370
+ return placeholder;
371
+ }
372
+ handleErrorMessageChange() {
373
+ if (this.errorMessage) {
374
+ this.announce(this.errorMessage);
375
+ }
376
+ }
377
+ handleClick(ev) {
378
+ const el = ev.target;
379
+ if (this.isDropdown && !this.el.contains(el) && this.isExpanded) {
380
+ this.closeDropdown();
381
+ }
382
+ else if (Array.from(this.el.children).includes(el)) {
383
+ const option = el;
384
+ const tagName = this.getTagName(option);
385
+ this.lastAddedTags = [tagName];
386
+ }
387
+ }
388
+ handleOptionClick(ev) {
389
+ ev.preventDefault();
390
+ this.resetInput();
391
+ let option;
392
+ if (this.isTable) {
393
+ option = ev.target;
394
+ option = this.tagOptionFromEl(option.closest("tr"));
395
+ }
396
+ else {
397
+ option = this.tagOptionFromEl(ev.target);
398
+ }
399
+ // if someone wants to attach a click event listener on wm-tag-option
400
+ option.click();
401
+ if (!option.locked) {
402
+ option.selected
403
+ ? this.isTable && option.emitDeselectedEvent() // dropdown doesn't deselect on option click
404
+ : option.emitSelectedEvent();
405
+ }
406
+ }
407
+ // From wm-button
408
+ // we need to listen for scroll events during the capture phase because they do not bubble up
409
+ // there can be layouts where the main content has 100vh and overflows
410
+ // in these cases window will register no scroll events unless we catch on they way down
411
+ dismissTooltip() {
412
+ if (this.tooltipVisible) {
413
+ functions.hideTooltip();
414
+ }
415
+ }
416
+ handleInputKeyDown(ev) {
417
+ if (/^.$/.test(ev.key) && this.charCount >= this.characterLimit) {
418
+ this.announce(this.generateCharacterLimitWarning(this.charCount, this.characterLimit));
419
+ }
420
+ // prevent keydown triggering on tag area
421
+ ev.stopPropagation();
422
+ switch (ev.key) {
423
+ case "Enter":
389
424
  ev.preventDefault();
390
- this.resetInput();
391
- let option;
425
+ this.handleInputEnter();
426
+ break;
427
+ case "ArrowDown":
428
+ ev.preventDefault();
429
+ this.handleInputArrowDown();
430
+ break;
431
+ case "ArrowUp":
432
+ ev.preventDefault();
433
+ this.handleInputArrowUp();
434
+ break;
435
+ case "ArrowLeft":
392
436
  if (this.isTable) {
393
- option = ev.target;
394
- option = this.tagOptionFromEl(option.closest("tr"));
395
- }
396
- else {
397
- option = this.tagOptionFromEl(ev.target);
398
- }
399
- // if someone wants to attach a click event listener on wm-tag-option
400
- option.click();
401
- if (!option.locked) {
402
- option.selected
403
- ? this.isTable && option.emitDeselectedEvent() // dropdown doesn't deselect on option click
404
- : option.emitSelectedEvent();
405
- }
406
- }
407
- // From wm-button
408
- // we need to listen for scroll events during the capture phase because they do not bubble up
409
- // there can be layouts where the main content has 100vh and overflows
410
- // in these cases window will register no scroll events unless we catch on they way down
411
- dismissTooltip() {
412
- if (this.tooltipVisible) {
413
- functions.hideTooltip();
414
- }
415
- }
416
- handleInputKeyDown(ev) {
417
- if (/^.$/.test(ev.key) && this.charCount >= this.characterLimit) {
418
- this.announce(this.generateCharacterLimitWarning(this.charCount, this.characterLimit));
419
- }
420
- // prevent keydown triggering on tag area
421
- ev.stopPropagation();
422
- switch (ev.key) {
423
- case "Enter":
424
- ev.preventDefault();
425
- this.handleInputEnter();
426
- break;
427
- case "ArrowDown":
428
- ev.preventDefault();
429
- this.handleInputArrowDown();
430
- break;
431
- case "ArrowUp":
432
- ev.preventDefault();
433
- this.handleInputArrowUp();
434
- break;
435
- case "ArrowLeft":
436
- if (this.isTable) {
437
- ev.preventDefault();
438
- this.focusPrevCell();
439
- }
440
- break;
441
- case "ArrowRight":
442
- if (this.isTable) {
443
- ev.preventDefault();
444
- this.focusNextCell();
445
- }
446
- break;
447
- case "Escape":
448
- if (this.isDropdown && this.isExpanded) {
449
- this.closeDropdown();
450
- }
451
- break;
452
- case "ArrowLeft":
453
- case "Backspace":
454
- this.handleInputBackspace();
455
- break;
456
- }
457
- }
458
- handleInputFocus() {
459
- if (this.isDropdown) {
460
- this.openDropdown();
461
- this.clearOptionFocus();
462
- }
463
- }
464
- handleInputChanged(ev) {
465
- this.clearOptionFocus();
466
- if (this.isDropdown) {
467
- if (this.charCount >= this.characterLimit - 5) {
468
- this.announce(this.generateCharacterLimitWarning(this.charCount, this.characterLimit));
469
- }
470
- if (!this.isExpanded) {
471
- this.openDropdown();
472
- }
437
+ ev.preventDefault();
438
+ this.focusPrevCell();
473
439
  }
474
- const val = ev.target.value;
475
- if (val.includes(",") && this.addNew) {
476
- this.addTags(val);
477
- }
478
- else {
479
- this.announceExistingOptions();
480
- }
481
- }
482
- handleInputEnter() {
483
- // user has selected an option in the list
484
- if (this.focusedOption) {
485
- const tagName = this.getTagName(this.focusedOption);
486
- this.lastAddedTags = [tagName];
487
- this.focusedOption.click();
488
- this.focusedOption.selected
489
- ? this.isTable && this.focusedOption.emitDeselectedEvent()
490
- : this.focusedOption.emitSelectedEvent();
491
- this.resetInput();
492
- }
493
- else if (this.isDropdown) {
494
- // user is adding a new tag
495
- const tagName = this.inputEl.value;
496
- if (!!tagName) {
497
- this.isExistingTag(tagName) ? this.announce(this.tagAlreadyAddedMessage(tagName)) : this.addTags(tagName);
498
- this.resetInput();
499
- }
500
- }
501
- }
502
- handleInputArrowDown() {
503
- if (this.isDropdown) {
504
- if (!this.isExpanded) {
505
- this.openDropdown();
506
- }
507
- else {
508
- let items = [];
509
- // the id check prevents a bug where the ref is reassigned to the first option causing it to be added twice (after adding a new user option)
510
- if (this.addNewButton && this.addNewButton.id === "add-new-btn") {
511
- items.push(this.addNewButton);
512
- }
513
- this.filteredOptionEls.forEach((o) => {
514
- items.push(this.elFromTagOption(o));
515
- });
516
- const next = functions.findNext(items, this._focusedOption, true);
517
- this.focusOption(next);
518
- }
519
- }
520
- else {
521
- const items = this.filteredOptionEls.filter((o) => !o.locked).map((o) => this.elFromTagOption(o));
522
- const next = functions.findNext(items, this._focusedOption, true);
523
- this.focusOption(next);
524
- }
525
- }
526
- handleInputArrowUp() {
527
- if (this.isDropdown) {
528
- if (!this.isExpanded) {
529
- this.openDropdown();
530
- }
531
- else {
532
- let items = [];
533
- if (this.addNewButton) {
534
- items.push(this.addNewButton);
535
- }
536
- this.filteredOptionEls.forEach((o) => {
537
- items.push(this.elFromTagOption(o));
538
- });
539
- const prev = functions.findPrev(items, this._focusedOption, true);
540
- this.focusOption(prev);
541
- }
542
- }
543
- else {
544
- const items = this.filteredOptionEls.filter((o) => !o.locked).map((o) => this.elFromTagOption(o));
545
- const prev = functions.findPrev(items, this._focusedOption, true);
546
- this.focusOption(prev);
547
- }
548
- }
549
- handleInputBackspace() {
550
- if (this.inputEl.value === "" && this.focusableTags.length > 0) {
551
- // wait for events to finish firing before redirecting focus
552
- // prevents double input in input area and tag area
553
- window.requestAnimationFrame(() => {
554
- this.tagAreaEl.focus();
555
- this.focusTag(this.focusableTags[this.focusableTags.length - 1]);
556
- });
557
- }
558
- }
559
- handleTagAreaKeyDown(ev) {
560
- switch (ev.key) {
561
- case "ArrowLeft":
562
- case "ArrowUp":
563
- ev.preventDefault();
564
- if (this.focusedTag) {
565
- const prev = functions.findPrev(this.focusableTags, this.focusedTag, true);
566
- this.focusTag(prev);
567
- }
568
- break;
569
- case "ArrowRight":
570
- case "ArrowDown":
571
- ev.preventDefault();
572
- if (this.focusedTag) {
573
- const next = functions.findNext(this.focusableTags, this.focusedTag, true);
574
- this.focusTag(next);
575
- }
576
- break;
577
- case "Backspace":
578
- case "Delete":
579
- if (this.focusedTag) {
580
- const option = this.tagOptionFromTag(this.focusedTag);
581
- if (!option.locked) {
582
- option.emitDeselectedEvent();
583
- }
584
- }
585
- break;
586
- }
587
- }
588
- handleBlur(ev) {
589
- this.dismissTooltip();
590
- this.clearOptionFocus();
591
- const relTarget = ev.relatedTarget;
592
- if (!this.isElOrChild(relTarget)) {
593
- this.fieldWrapperEl.classList.remove("focused");
594
- if (this.isDropdown) {
595
- this.closeDropdown();
596
- }
597
- }
598
- }
599
- handleTagAreaFocus(ev) {
600
- if (this.isDropdown) {
601
- this.closeDropdown();
602
- }
603
- if (this.focusableTags.length > 0) {
604
- const relTarget = ev.relatedTarget;
605
- if (relTarget && relTarget.id === "input") {
606
- const lastFocusableTag = this.focusableTags[this.focusableTags.length - 1];
607
- this.focusTag(lastFocusableTag);
608
- }
609
- else {
610
- const firstFocusableTag = this.focusableTags[0];
611
- this.focusTag(firstFocusableTag);
612
- }
613
- }
614
- }
615
- focusPrevCell() {
616
- if (this.focusedOption) {
617
- if (this.focusedColumn > 0) {
618
- this.focusedColumn -= 1;
619
- }
620
- }
621
- }
622
- focusNextCell() {
623
- if (this._focusedOption) {
624
- const lastCellIdx = this._focusedOption.querySelectorAll("td").length - 1;
625
- if (this.focusedColumn < lastCellIdx) {
626
- this.focusedColumn += 1;
627
- }
628
- }
629
- }
630
- focusOption(optionToFocus) {
631
- if (optionToFocus) {
632
- // will be undefined for the "Add New" button
633
- this.focusedOption = this.tagOptionFromEl(optionToFocus);
634
- if (optionToFocus === this.addNewButton) {
635
- this.addNewButton.classList.add("focused");
636
- }
637
- else {
638
- this.addNewButton && this.addNewButton.classList.remove("focused");
639
- }
640
- if (this.isTable) {
641
- // tooltip
642
- const contentWrapper = this._focusedOption.querySelector(".cell-content-wrapper");
643
- const isTruncated = contentWrapper.scrollWidth > contentWrapper.clientWidth;
644
- this.dismissTooltip();
645
- if (isTruncated) {
646
- // innerText is necessary vs textContent, as innerText ignores sr-only / display: none text
647
- functions.showTooltip("bottom", this._focusedOption, this._focusedOption.innerText);
648
- }
649
- }
650
- optionToFocus.scrollIntoView({ block: "nearest" });
651
- }
652
- }
653
- showTooltipIfTruncated(el) {
654
- const displayedText = el.querySelector(".tag-text").textContent;
655
- const id = el.id.replace("tag-", "");
656
- if (id) {
657
- const tagEl = this.el.querySelector("#" + id);
658
- const fullText = this.getTagName(tagEl);
659
- if (displayedText !== fullText && displayedText.includes("...")) {
660
- functions.showTooltip("bottom", el, fullText);
661
- }
662
- }
663
- }
664
- focusTag(element) {
665
- // technically it's the tag area that has focus. This function handles the aria-activedescendant value within that parent
666
- this.focusedTagIndex = this.focusableTags.indexOf(element);
667
- element.scrollIntoView({ block: "nearest" });
668
- window.requestAnimationFrame(() => {
669
- functions.hideTooltip();
670
- this.showTooltipIfTruncated(element);
671
- });
672
- }
673
- clearOptionFocus() {
674
- this.focusedOption = undefined;
675
- this.focusedColumn = 0;
676
- }
677
- openDropdown() {
678
- // offset of -2px to avoid overlapping the focus border
679
- this.openUp = functions.shouldOpenUp(this.el, this.dropdownEl.clientHeight, this.el.clientHeight, -2);
680
- this.isExpanded = true;
681
- }
682
- closeDropdown() {
683
- this.clearOptionFocus();
684
- this.isExpanded = false;
685
- }
686
- resetInput() {
687
- this.inputEl.value = "";
688
- }
689
- announce(message) {
690
- // \u00A0 is a non-breaking space character, which causes the message to be read as a new one
691
- if (this.liveRegionEl.textContent === message) {
692
- message += "\u00A0";
693
- }
694
- this.liveRegionMessage = message;
695
- }
696
- addTags(tagNames) {
697
- // covers both typing "," and pasting in text that includes ","
698
- // if tag added without "," (typing enter), split puts the whole string in an array
699
- this.lastAddedTags = tagNames.split(",").filter((t) => t.match(/\S/));
700
- this.lastAddedTags.forEach((tag) => {
701
- this.wmTagInputTagAdded.emit(tag);
702
- });
703
- this.announce(this.tagAddedMessage(this.lastAddedTags.join(", ")));
440
+ break;
441
+ case "ArrowRight":
442
+ if (this.isTable) {
443
+ ev.preventDefault();
444
+ this.focusNextCell();
445
+ }
446
+ break;
447
+ case "Escape":
448
+ if (this.isDropdown && this.isExpanded) {
449
+ this.closeDropdown();
450
+ }
451
+ break;
452
+ case "ArrowLeft":
453
+ case "Backspace":
454
+ this.handleInputBackspace();
455
+ break;
456
+ }
457
+ }
458
+ handleInputFocus() {
459
+ if (this.isDropdown) {
460
+ this.openDropdown();
461
+ this.clearOptionFocus();
462
+ }
463
+ }
464
+ handleInputChanged(ev) {
465
+ this.clearOptionFocus();
466
+ if (this.isDropdown) {
467
+ if (this.charCount >= this.characterLimit - 5) {
468
+ this.announce(this.generateCharacterLimitWarning(this.charCount, this.characterLimit));
469
+ }
470
+ if (!this.isExpanded) {
471
+ this.openDropdown();
472
+ }
473
+ }
474
+ const val = ev.target.value;
475
+ if (val.includes(",") && this.addNew) {
476
+ this.addTags(val);
477
+ }
478
+ else {
479
+ this.announceExistingOptions();
480
+ }
481
+ }
482
+ handleInputEnter() {
483
+ // user has selected an option in the list
484
+ if (this.focusedOption) {
485
+ const tagName = this.getTagName(this.focusedOption);
486
+ this.lastAddedTags = [tagName];
487
+ this.focusedOption.click();
488
+ this.focusedOption.selected
489
+ ? this.isTable && this.focusedOption.emitDeselectedEvent()
490
+ : this.focusedOption.emitSelectedEvent();
491
+ this.resetInput();
492
+ }
493
+ else if (this.isDropdown) {
494
+ // user is adding a new tag
495
+ const tagName = this.inputEl.value;
496
+ if (!!tagName) {
497
+ this.isExistingTag(tagName) ? this.announce(this.tagAlreadyAddedMessage(tagName)) : this.addTags(tagName);
704
498
  this.resetInput();
705
- }
706
- announceExistingOptions() {
707
- // request animation frame to wait for re-rendering of filtered options
708
- window.requestAnimationFrame(() => {
709
- let numResults = 0;
710
- if (this.isDropdown) {
711
- numResults = this.optionEls.length;
712
- }
713
- else if (this.isTable) {
714
- numResults = this.filteredOptionEls.length;
715
- }
716
- const existingOptionsMessage = functions.intl.formatMessage({
717
- id: "tagInput.existingOptions",
718
- defaultMessage: "{num, plural, one {1 existing option.} other {# existing options.}}",
719
- }, { num: numResults });
720
- this.announce(existingOptionsMessage);
499
+ }
500
+ }
501
+ }
502
+ handleInputArrowDown() {
503
+ if (this.isDropdown) {
504
+ if (!this.isExpanded) {
505
+ this.openDropdown();
506
+ }
507
+ else {
508
+ let items = [];
509
+ // the id check prevents a bug where the ref is reassigned to the first option causing it to be added twice (after adding a new user option)
510
+ if (this.addNewButton && this.addNewButton.id === "add-new-btn") {
511
+ items.push(this.addNewButton);
512
+ }
513
+ this.filteredOptionEls.forEach((o) => {
514
+ items.push(this.elFromTagOption(o));
721
515
  });
722
- }
723
- generateCharacterLimitWarning(charCount, charLimit) {
724
- let message = intl.globalMessages.getCharactersEntered(charCount, charLimit);
725
- if (charCount >= charLimit) {
726
- message += ` ${intl.globalMessages.characterLimitReached}`;
727
- }
728
- return message;
729
- }
730
- positionInput() {
731
- if (this.tagAreaEl) {
732
- const lastTag = this._tagEls[this._tagEls.length - 1];
733
- // default placement to fall back to when no tags are present, or not enough space is available
734
- this.inputEl.style.position = "static";
735
- this.inputEl.style.width = "100%";
736
- this.inputEl.classList.add("extended");
737
- if (lastTag) {
738
- const spaceAvailable = this.tagAreaEl.getBoundingClientRect().right - lastTag.getBoundingClientRect().right;
739
- if (spaceAvailable >= this.inputMinimumWidth) {
740
- // because the input has right: 0px
741
- // all thats needed to properly place it is setting position: absolute, top, and width
742
- this.inputEl.style.position = "absolute";
743
- this.inputEl.style.top = lastTag.offsetTop.toString() + "px";
744
- this.inputEl.style.width = (spaceAvailable - 8).toString() + "px";
745
- this.inputEl.classList.remove("extended");
746
- }
747
- }
748
- }
749
- }
750
- handleTagMouseEnter(ev) {
751
- this.showTooltipIfTruncated(ev.target);
752
- }
753
- renderDropdown() {
754
- return (index.h("div", { class: `dropdown-wrapper ${this.isExpanded ? "open" : ""} ${this.openUp ? "upwards" : ""}`, ref: (el) => (this.dropdownEl = el) }, index.h("div", { id: "help-text", class: "help-text" }, this.renderHelpText()), index.h("ul", { class: "dropdown", id: "dropdown", role: "listbox", "aria-multiselectable": "true", "aria-expanded": this.isExpanded ? "true" : "false", "aria-label": this.label, tabindex: -1 }, this.inputEl && this.renderAddNewButton(), this.filteredOptionEls.map((o) => this.renderListItem(o)))));
755
- }
756
- renderHelpText() {
757
- if (this.helpText)
758
- return this.helpText;
759
- let helpText = "";
760
- if (this.optionEls.length > 0) {
761
- helpText = this.selectionHelpText;
762
- }
763
- if (this.addNew) {
764
- helpText += " " + this.addNewHelpText;
765
- }
766
- return helpText;
767
- }
768
- renderAddNewButton() {
769
- const inputValue = this.inputEl.value.trim();
770
- const hasNonWhiteSpaceCharacters = this.inputEl.value.match(/\S/);
771
- const optionAlreadyExists = this.isExistingTag(this.inputEl.value.trim());
772
- return (this.addNew &&
773
- hasNonWhiteSpaceCharacters &&
774
- !optionAlreadyExists && (index.h("li", { ref: (el) => (this.addNewButton = el), id: "add-new-btn", class: "add-new-btn", onClick: () => this.addTags(inputValue) }, "Add " + inputValue)));
775
- }
776
- renderTable() {
777
- return (index.h("div", { class: "table-wrapper", onScroll: () => this.dismissTooltip() }, index.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))) : (index.h("div", { class: "no-results" }, this.noResultsMessage)))));
778
- }
779
- renderTableHeaders() {
780
- return (index.h("tr", { class: "headers", role: "row" }, functions.csvToArray(this.colHeaders).map((header, idx) => {
781
- let overflowRule = "wrap";
782
- if (this.colWrap && functions.csvToArray(this.colWrap)[idx]) {
783
- overflowRule = functions.csvToArray(this.colWrap)[idx];
784
- }
785
- return (index.h("th", { class: `header-cell ${overflowRule}`, role: "columnheader",
786
- // @ts-ignore
787
- width: this.colWidths ? functions.csvToArray(this.colWidths)[idx] : "" }, header));
788
- })));
789
- }
790
- renderTag(o) {
791
- const focused = this.focusedTag && this.focusedTag.id === "tag-" + o.id ? "focused" : "";
792
- const tagName = this.getTagName(o);
793
- const highlight = this.lastAddedTags.includes(tagName) ? "highlight" : "";
794
- return (index.h("li", { id: "tag-" + o.id, role: "option", class: `tag ${highlight} ${focused} ${o.locked ? "locked" : ""}`, onMouseEnter: (ev) => this.handleTagMouseEnter(ev), onMouseLeave: functions.hideTooltip }, index.h("span", { class: "sr-only" }, tagName), index.h("span", { class: "tag-text", "aria-hidden": "true" }, tagName), o.locked ? (index.h("div", { class: "icon lock" })) : (index.h("button", { class: "icon remove-btn", tabIndex: -1, onClick: () => o.emitDeselectedEvent() }))));
795
- }
796
- renderTags() {
797
- return this.tagsList.map((o) => this.renderTag(o));
798
- }
799
- renderTagCounter() {
800
- if (this.maxTags) {
801
- return (index.h("div", { class: "lower-row" }, index.h("div", { id: "max-tags" }, this.renderMaxTags())));
802
- }
803
- }
804
- renderMaxTags() {
805
- if (this.helpText) {
806
- return this.helpText;
807
- }
808
- else {
809
- let msg = `${this.tagsAddedMessage}: ${this.taggedOptions.length}/${this.maxTags}`;
810
- if (this.tagLimitReached) {
811
- msg += `- ${this.maxTagsReachedMessage}`;
812
- }
813
- return msg;
516
+ const next = functions.findNext(items, this._focusedOption, true);
517
+ this.focusOption(next);
518
+ }
519
+ }
520
+ else {
521
+ const items = this.filteredOptionEls.filter((o) => !o.locked).map((o) => this.elFromTagOption(o));
522
+ const next = functions.findNext(items, this._focusedOption, true);
523
+ this.focusOption(next);
524
+ }
525
+ }
526
+ handleInputArrowUp() {
527
+ if (this.isDropdown) {
528
+ if (!this.isExpanded) {
529
+ this.openDropdown();
530
+ }
531
+ else {
532
+ let items = [];
533
+ if (this.addNewButton) {
534
+ items.push(this.addNewButton);
535
+ }
536
+ this.filteredOptionEls.forEach((o) => {
537
+ items.push(this.elFromTagOption(o));
538
+ });
539
+ const prev = functions.findPrev(items, this._focusedOption, true);
540
+ this.focusOption(prev);
541
+ }
542
+ }
543
+ else {
544
+ const items = this.filteredOptionEls.filter((o) => !o.locked).map((o) => this.elFromTagOption(o));
545
+ const prev = functions.findPrev(items, this._focusedOption, true);
546
+ this.focusOption(prev);
547
+ }
548
+ }
549
+ handleInputBackspace() {
550
+ if (this.inputEl.value === "" && this.focusableTags.length > 0) {
551
+ // wait for events to finish firing before redirecting focus
552
+ // prevents double input in input area and tag area
553
+ window.requestAnimationFrame(() => {
554
+ this.tagAreaEl.focus();
555
+ this.focusTag(this.focusableTags[this.focusableTags.length - 1]);
556
+ });
557
+ }
558
+ }
559
+ handleTagAreaKeyDown(ev) {
560
+ switch (ev.key) {
561
+ case "ArrowLeft":
562
+ case "ArrowUp":
563
+ ev.preventDefault();
564
+ if (this.focusedTag) {
565
+ const prev = functions.findPrev(this.focusableTags, this.focusedTag, true);
566
+ this.focusTag(prev);
814
567
  }
815
- }
816
- handleCellMouseEnter(ev) {
817
- const cell = ev.target;
818
- const contentWrapper = cell.querySelector(".cell-content-wrapper");
568
+ break;
569
+ case "ArrowRight":
570
+ case "ArrowDown":
571
+ ev.preventDefault();
572
+ if (this.focusedTag) {
573
+ const next = functions.findNext(this.focusableTags, this.focusedTag, true);
574
+ this.focusTag(next);
575
+ }
576
+ break;
577
+ case "Backspace":
578
+ case "Delete":
579
+ if (this.focusedTag) {
580
+ const option = this.tagOptionFromTag(this.focusedTag);
581
+ if (!option.locked) {
582
+ option.emitDeselectedEvent();
583
+ }
584
+ }
585
+ break;
586
+ }
587
+ }
588
+ handleBlur(ev) {
589
+ this.dismissTooltip();
590
+ this.clearOptionFocus();
591
+ const relTarget = ev.relatedTarget;
592
+ if (!this.isElOrChild(relTarget)) {
593
+ this.fieldWrapperEl.classList.remove("focused");
594
+ if (this.isDropdown) {
595
+ this.closeDropdown();
596
+ }
597
+ }
598
+ }
599
+ handleTagAreaFocus(ev) {
600
+ if (this.isDropdown) {
601
+ this.closeDropdown();
602
+ }
603
+ if (this.focusableTags.length > 0) {
604
+ const relTarget = ev.relatedTarget;
605
+ if (relTarget && relTarget.id === "input") {
606
+ const lastFocusableTag = this.focusableTags[this.focusableTags.length - 1];
607
+ this.focusTag(lastFocusableTag);
608
+ }
609
+ else {
610
+ const firstFocusableTag = this.focusableTags[0];
611
+ this.focusTag(firstFocusableTag);
612
+ }
613
+ }
614
+ }
615
+ focusPrevCell() {
616
+ if (this.focusedOption) {
617
+ if (this.focusedColumn > 0) {
618
+ this.focusedColumn -= 1;
619
+ }
620
+ }
621
+ }
622
+ focusNextCell() {
623
+ if (this._focusedOption) {
624
+ const lastCellIdx = this._focusedOption.querySelectorAll("td").length - 1;
625
+ if (this.focusedColumn < lastCellIdx) {
626
+ this.focusedColumn += 1;
627
+ }
628
+ }
629
+ }
630
+ focusOption(optionToFocus) {
631
+ if (optionToFocus) {
632
+ // will be undefined for the "Add New" button
633
+ this.focusedOption = this.tagOptionFromEl(optionToFocus);
634
+ if (optionToFocus === this.addNewButton) {
635
+ this.addNewButton.classList.add("focused");
636
+ }
637
+ else {
638
+ this.addNewButton && this.addNewButton.classList.remove("focused");
639
+ }
640
+ if (this.isTable) {
641
+ // tooltip
642
+ const contentWrapper = this._focusedOption.querySelector(".cell-content-wrapper");
819
643
  const isTruncated = contentWrapper.scrollWidth > contentWrapper.clientWidth;
644
+ this.dismissTooltip();
820
645
  if (isTruncated) {
821
- // innerText is necessary vs textContent, as innerText ignores sr-only / display: none text
822
- functions.showTooltip("bottom", cell, cell.innerText);
823
- }
824
- }
825
- renderTableCells(o) {
826
- const colValues = [o.col1, o.col2, o.col3, o.col4].filter((val) => !!val);
827
- return colValues.map((val, idx) => {
828
- const cellId = `${o.id}-col${idx + 1}`;
829
- let overflowRule = "wrap";
830
- if (this.colWrap && functions.csvToArray(this.colWrap)[idx]) {
831
- overflowRule = functions.csvToArray(this.colWrap)[idx];
832
- }
833
- const classes = {
834
- focused: !!this._focusedCell && cellId === this._focusedCell.id,
835
- };
836
- return (index.h("td", { id: cellId, class: classes, role: "gridcell", "aria-describedby": `${cellId}-description`, "aria-selected": o.selected ? "true" : "false", onMouseEnter: (ev) => this.handleCellMouseEnter(ev), onMouseLeave: () => functions.hideTooltip() }, index.h("div", { class: `cell-content-wrapper ${overflowRule}` }, val), index.h("div", { class: "description", id: `${cellId}-description` }, o.locked ? "locked" : "")));
837
- });
838
- }
839
- renderTableRow(o) {
840
- const classes = {
841
- selected: o.selected,
842
- locked: o.locked,
843
- focused: this.focusedOption && o === this.focusedOption ? true : false,
844
- };
845
- return (index.h("tr", { id: o.id, class: classes, onClick: (ev) => this.handleOptionClick(ev) }, this.renderTableCells(o)));
846
- }
847
- renderListItem(o) {
848
- if (!!this.inputEl) {
849
- const isFocused = this.focusedOption && o === this.focusedOption;
850
- return (index.h("li", { id: o.id, role: "option", class: `option ${isFocused ? "focused" : ""}`, "aria-selected": o.selected ? "true" : "false", onClick: (ev) => this.handleOptionClick(ev) }, o.textContent));
851
- }
852
- }
853
- render() {
854
- return (index.h("div", { class: `wrapper label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, index.h("div", { class: "label-wrapper" }, index.h("label", { class: "label", htmlFor: "input" }, this.label, this.requiredField && (index.h("span", { class: "required", "aria-hidden": "true" }, "*")))), index.h("div", { class: `field-wrapper ${this.el.shadowRoot.activeElement === this.inputEl ? "focused" : ""} ${this.errorMessage ? "invalid" : ""}`, ref: (el) => (this.fieldWrapperEl = el) }, index.h("div", { class: "upper-row" }, index.h("div", { class: `tags-and-input-wrapper ${this.inModal ? "in-modal" : ""}` }, index.h("ul", { ref: (el) => (this.tagAreaEl = el), class: `tag-area ${this.taggedOptions.length === 0 && "empty"}`, role: "listbox", "aria-activedescendant": this.focusedTag ? this.focusedTag.id : null, "aria-orientation": "horizontal", "aria-label": `${this.label} ${this.tagAreaInstructions}`, tabindex: this.focusableTags.length > 0 ? 0 : -1, "aria-describedby": `info max-tags`, onFocus: (ev) => this.handleTagAreaFocus(ev), onBlur: (ev) => {
855
- this.focusedTagIndex = undefined;
856
- this.handleBlur(ev);
857
- }, onKeyDown: (ev) => this.handleTagAreaKeyDown(ev) }, this.renderTags()), index.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 " : ""}`, "aria-label": `${this.label} ${this.isDropdown ? intl.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) => {
858
- this.handleBlur(ev);
859
- }, onFocus: () => this.handleInputFocus(), onKeyDown: (ev) => this.handleInputKeyDown(ev) })), this.isDropdown && (index.h("div", { class: "character-count" }, this.charCount, "/", this.characterLimit))), this.renderTagCounter(), this.isDropdown && this.renderDropdown()), this.info && (index.h("div", { id: "info", class: "info-text" }, this.info)), this.errorMessage && index.h("div", { id: "error" }, this.errorMessage), index.h("div", { class: "sr-only", "aria-live": "assertive", ref: (el) => (this.liveRegionEl = el), "aria-atomic": "true" }, this.liveRegionMessage), this.isTable && this.renderTable()));
860
- }
861
- static get delegatesFocus() { return true; }
862
- get el() { return index.getElement(this); }
863
- static get watchers() { return {
864
- "errorMessage": ["handleErrorMessageChange"]
865
- }; }
646
+ // innerText is necessary vs textContent, as innerText ignores sr-only / display: none text
647
+ functions.showTooltip("bottom", this._focusedOption, this._focusedOption.innerText);
648
+ }
649
+ }
650
+ optionToFocus.scrollIntoView({ block: "nearest" });
651
+ }
652
+ }
653
+ showTooltipIfTruncated(el) {
654
+ const displayedText = el.querySelector(".tag-text").textContent;
655
+ const id = el.id.replace("tag-", "");
656
+ if (id) {
657
+ const tagEl = this.el.querySelector("#" + id);
658
+ const fullText = this.getTagName(tagEl);
659
+ if (displayedText !== fullText && displayedText.includes("...")) {
660
+ functions.showTooltip("bottom", el, fullText);
661
+ }
662
+ }
663
+ }
664
+ focusTag(element) {
665
+ // technically it's the tag area that has focus. This function handles the aria-activedescendant value within that parent
666
+ this.focusedTagIndex = this.focusableTags.indexOf(element);
667
+ element.scrollIntoView({ block: "nearest" });
668
+ window.requestAnimationFrame(() => {
669
+ functions.hideTooltip();
670
+ this.showTooltipIfTruncated(element);
671
+ });
672
+ }
673
+ clearOptionFocus() {
674
+ this.focusedOption = undefined;
675
+ this.focusedColumn = 0;
676
+ }
677
+ openDropdown() {
678
+ // offset of -2px to avoid overlapping the focus border
679
+ this.openUp = functions.shouldOpenUp(this.el, this.dropdownEl.clientHeight, this.el.clientHeight, -2);
680
+ this.isExpanded = true;
681
+ }
682
+ closeDropdown() {
683
+ this.clearOptionFocus();
684
+ this.isExpanded = false;
685
+ }
686
+ resetInput() {
687
+ this.inputEl.value = "";
688
+ }
689
+ announce(message) {
690
+ // \u00A0 is a non-breaking space character, which causes the message to be read as a new one
691
+ if (this.liveRegionEl.textContent === message) {
692
+ message += "\u00A0";
693
+ }
694
+ this.liveRegionMessage = message;
695
+ }
696
+ addTags(tagNames) {
697
+ // covers both typing "," and pasting in text that includes ","
698
+ // if tag added without "," (typing enter), split puts the whole string in an array
699
+ this.lastAddedTags = tagNames.split(",").filter((t) => t.match(/\S/));
700
+ this.lastAddedTags.forEach((tag) => {
701
+ this.wmTagInputTagAdded.emit(tag);
702
+ });
703
+ this.announce(this.tagAddedMessage(this.lastAddedTags.join(", ")));
704
+ this.resetInput();
705
+ }
706
+ announceExistingOptions() {
707
+ // request animation frame to wait for re-rendering of filtered options
708
+ window.requestAnimationFrame(() => {
709
+ let numResults = 0;
710
+ if (this.isDropdown) {
711
+ numResults = this.optionEls.length;
712
+ }
713
+ else if (this.isTable) {
714
+ numResults = this.filteredOptionEls.length;
715
+ }
716
+ const existingOptionsMessage = functions.intl.formatMessage({
717
+ id: "tagInput.existingOptions",
718
+ defaultMessage: "{num, plural, one {1 existing option.} other {# existing options.}}",
719
+ }, { num: numResults });
720
+ this.announce(existingOptionsMessage);
721
+ });
722
+ }
723
+ generateCharacterLimitWarning(charCount, charLimit) {
724
+ let message = intl.globalMessages.getCharactersEntered(charCount, charLimit);
725
+ if (charCount >= charLimit) {
726
+ message += ` ${intl.globalMessages.characterLimitReached}`;
727
+ }
728
+ return message;
729
+ }
730
+ positionInput() {
731
+ if (this.tagAreaEl) {
732
+ const lastTag = this._tagEls[this._tagEls.length - 1];
733
+ // default placement to fall back to when no tags are present, or not enough space is available
734
+ this.inputEl.style.position = "static";
735
+ this.inputEl.style.width = "100%";
736
+ this.inputEl.classList.add("extended");
737
+ if (lastTag) {
738
+ const spaceAvailable = this.tagAreaEl.getBoundingClientRect().right - lastTag.getBoundingClientRect().right;
739
+ if (spaceAvailable >= this.inputMinimumWidth) {
740
+ // because the input has right: 0px
741
+ // all thats needed to properly place it is setting position: absolute, top, and width
742
+ this.inputEl.style.position = "absolute";
743
+ this.inputEl.style.top = lastTag.offsetTop.toString() + "px";
744
+ this.inputEl.style.width = (spaceAvailable - 8).toString() + "px";
745
+ this.inputEl.classList.remove("extended");
746
+ }
747
+ }
748
+ }
749
+ }
750
+ handleTagMouseEnter(ev) {
751
+ this.showTooltipIfTruncated(ev.target);
752
+ }
753
+ renderDropdown() {
754
+ return (index.h("div", { class: `dropdown-wrapper ${this.isExpanded ? "open" : ""} ${this.openUp ? "upwards" : ""}`, ref: (el) => (this.dropdownEl = el) }, index.h("div", { id: "help-text", class: "help-text" }, this.renderHelpText()), index.h("ul", { class: "dropdown", id: "dropdown", role: "listbox", "aria-multiselectable": "true", "aria-expanded": this.isExpanded ? "true" : "false", "aria-label": this.label, tabindex: -1 }, this.inputEl && this.renderAddNewButton(), this.filteredOptionEls.map((o) => this.renderListItem(o)))));
755
+ }
756
+ renderHelpText() {
757
+ if (this.helpText)
758
+ return this.helpText;
759
+ let helpText = "";
760
+ if (this.optionEls.length > 0) {
761
+ helpText = this.selectionHelpText;
762
+ }
763
+ if (this.addNew) {
764
+ helpText += " " + this.addNewHelpText;
765
+ }
766
+ return helpText;
767
+ }
768
+ renderAddNewButton() {
769
+ const inputValue = this.inputEl.value.trim();
770
+ const hasNonWhiteSpaceCharacters = this.inputEl.value.match(/\S/);
771
+ const optionAlreadyExists = this.isExistingTag(this.inputEl.value.trim());
772
+ return (this.addNew &&
773
+ hasNonWhiteSpaceCharacters &&
774
+ !optionAlreadyExists && (index.h("li", { ref: (el) => (this.addNewButton = el), id: "add-new-btn", class: "add-new-btn", onClick: () => this.addTags(inputValue) }, "Add " + inputValue)));
775
+ }
776
+ renderTable() {
777
+ return (index.h("div", { class: "table-wrapper", onScroll: () => this.dismissTooltip() }, index.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))) : (index.h("div", { class: "no-results" }, this.noResultsMessage)))));
778
+ }
779
+ renderTableHeaders() {
780
+ return (index.h("tr", { class: "headers", role: "row" }, functions.csvToArray(this.colHeaders).map((header, idx) => {
781
+ let overflowRule = "wrap";
782
+ if (this.colWrap && functions.csvToArray(this.colWrap)[idx]) {
783
+ overflowRule = functions.csvToArray(this.colWrap)[idx];
784
+ }
785
+ return (index.h("th", { class: `header-cell ${overflowRule}`, role: "columnheader",
786
+ // @ts-ignore
787
+ width: this.colWidths ? functions.csvToArray(this.colWidths)[idx] : "" }, header));
788
+ })));
789
+ }
790
+ renderTag(o) {
791
+ const focused = this.focusedTag && this.focusedTag.id === "tag-" + o.id ? "focused" : "";
792
+ const tagName = this.getTagName(o);
793
+ const highlight = this.lastAddedTags.includes(tagName) ? "highlight" : "";
794
+ return (index.h("li", { id: "tag-" + o.id, role: "option", class: `tag ${highlight} ${focused} ${o.locked ? "locked" : ""}`, onMouseEnter: (ev) => this.handleTagMouseEnter(ev), onMouseLeave: functions.hideTooltip }, index.h("span", { class: "sr-only" }, tagName), index.h("span", { class: "tag-text", "aria-hidden": "true" }, tagName), o.locked ? (index.h("div", { class: "icon lock" })) : (index.h("button", { class: "icon remove-btn", tabIndex: -1, onClick: () => o.emitDeselectedEvent() }))));
795
+ }
796
+ renderTags() {
797
+ return this.tagsList.map((o) => this.renderTag(o));
798
+ }
799
+ renderTagCounter() {
800
+ if (this.maxTags) {
801
+ return (index.h("div", { class: "lower-row" }, index.h("div", { id: "max-tags" }, this.renderMaxTags())));
802
+ }
803
+ }
804
+ renderMaxTags() {
805
+ if (this.helpText) {
806
+ return this.helpText;
807
+ }
808
+ else {
809
+ let msg = `${this.tagsAddedMessage}: ${this.taggedOptions.length}/${this.maxTags}`;
810
+ if (this.tagLimitReached) {
811
+ msg += `- ${this.maxTagsReachedMessage}`;
812
+ }
813
+ return msg;
814
+ }
815
+ }
816
+ handleCellMouseEnter(ev) {
817
+ const cell = ev.target;
818
+ const contentWrapper = cell.querySelector(".cell-content-wrapper");
819
+ const isTruncated = contentWrapper.scrollWidth > contentWrapper.clientWidth;
820
+ if (isTruncated) {
821
+ // innerText is necessary vs textContent, as innerText ignores sr-only / display: none text
822
+ functions.showTooltip("bottom", cell, cell.innerText);
823
+ }
824
+ }
825
+ renderTableCells(o) {
826
+ const colValues = [o.col1, o.col2, o.col3, o.col4].filter((val) => !!val);
827
+ return colValues.map((val, idx) => {
828
+ const cellId = `${o.id}-col${idx + 1}`;
829
+ let overflowRule = "wrap";
830
+ if (this.colWrap && functions.csvToArray(this.colWrap)[idx]) {
831
+ overflowRule = functions.csvToArray(this.colWrap)[idx];
832
+ }
833
+ const classes = {
834
+ focused: !!this._focusedCell && cellId === this._focusedCell.id,
835
+ };
836
+ return (index.h("td", { id: cellId, class: classes, role: "gridcell", "aria-describedby": `${cellId}-description`, "aria-selected": o.selected ? "true" : "false", onMouseEnter: (ev) => this.handleCellMouseEnter(ev), onMouseLeave: () => functions.hideTooltip() }, index.h("div", { class: `cell-content-wrapper ${overflowRule}` }, val), index.h("div", { class: "description", id: `${cellId}-description` }, o.locked ? "locked" : "")));
837
+ });
838
+ }
839
+ renderTableRow(o) {
840
+ const classes = {
841
+ selected: o.selected,
842
+ locked: o.locked,
843
+ focused: this.focusedOption && o === this.focusedOption ? true : false,
844
+ };
845
+ return (index.h("tr", { id: o.id, class: classes, onClick: (ev) => this.handleOptionClick(ev) }, this.renderTableCells(o)));
846
+ }
847
+ renderListItem(o) {
848
+ if (!!this.inputEl) {
849
+ const isFocused = this.focusedOption && o === this.focusedOption;
850
+ return (index.h("li", { id: o.id, role: "option", class: `option ${isFocused ? "focused" : ""}`, "aria-selected": o.selected ? "true" : "false", onClick: (ev) => this.handleOptionClick(ev) }, o.textContent));
851
+ }
852
+ }
853
+ render() {
854
+ return (index.h("div", { class: `wrapper label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, index.h("div", { class: "label-wrapper" }, index.h("label", { class: "label", htmlFor: "input" }, this.label, this.requiredField && (index.h("span", { class: "required", "aria-hidden": "true" }, "*")))), index.h("div", { class: `field-wrapper ${this.el.shadowRoot.activeElement === this.inputEl ? "focused" : ""} ${this.errorMessage ? "invalid" : ""}`, ref: (el) => (this.fieldWrapperEl = el) }, index.h("div", { class: "upper-row" }, index.h("div", { class: `tags-and-input-wrapper ${this.inModal ? "in-modal" : ""}` }, index.h("ul", { ref: (el) => (this.tagAreaEl = el), class: `tag-area ${this.taggedOptions.length === 0 && "empty"}`, role: "listbox", "aria-activedescendant": this.focusedTag ? this.focusedTag.id : null, "aria-orientation": "horizontal", "aria-label": `${this.label} ${this.tagAreaInstructions}`, tabindex: this.focusableTags.length > 0 ? 0 : -1, "aria-describedby": `info max-tags`, onFocus: (ev) => this.handleTagAreaFocus(ev), onBlur: (ev) => {
855
+ this.focusedTagIndex = undefined;
856
+ this.handleBlur(ev);
857
+ }, onKeyDown: (ev) => this.handleTagAreaKeyDown(ev) }, this.renderTags()), index.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 " : ""}`, "aria-label": `${this.label} ${this.isDropdown ? intl.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) => {
858
+ this.handleBlur(ev);
859
+ }, onFocus: () => this.handleInputFocus(), onKeyDown: (ev) => this.handleInputKeyDown(ev) })), this.isDropdown && (index.h("div", { class: "character-count" }, this.charCount, "/", this.characterLimit))), this.renderTagCounter(), this.isDropdown && this.renderDropdown()), this.info && (index.h("div", { id: "info", class: "info-text" }, this.info)), this.errorMessage && index.h("div", { id: "error" }, this.errorMessage), index.h("div", { class: "sr-only", "aria-live": "assertive", ref: (el) => (this.liveRegionEl = el), "aria-atomic": "true" }, this.liveRegionMessage), this.isTable && this.renderTable()));
860
+ }
861
+ static get delegatesFocus() { return true; }
862
+ get el() { return index.getElement(this); }
863
+ static get watchers() { return {
864
+ "errorMessage": ["handleErrorMessageChange"]
865
+ }; }
866
866
  };
867
867
  TagInput.style = wmTagInputCss;
868
868