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