@watermarkinsights/ripple 5.12.0 → 5.14.0-alpha.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 (482) hide show
  1. package/LICENSE +21 -0
  2. package/dist/{esm/chartFunctions-9099c7e9.js → components/chartFunctions.js} +4 -4
  3. package/dist/components/functions.js +17465 -0
  4. package/dist/components/index.d.ts +33 -0
  5. package/dist/{collection/global/global.js → components/index.js} +52 -2
  6. package/dist/{collection/global → components}/interfaces.js +6 -4
  7. package/dist/{esm/intl-a6f16883.js → components/intl.js} +1 -1
  8. package/dist/components/priv-calendar.d.ts +11 -0
  9. package/dist/components/priv-calendar.js +6 -0
  10. package/dist/{esm/priv-calendar.entry.js → components/priv-calendar2.js} +40 -17
  11. package/dist/components/priv-chart-popover.d.ts +11 -0
  12. package/dist/components/priv-chart-popover.js +6 -0
  13. package/dist/{esm/priv-chart-popover.entry.js → components/priv-chart-popover2.js} +32 -13
  14. package/dist/components/priv-navigator-button.d.ts +11 -0
  15. package/dist/components/priv-navigator-button.js +6 -0
  16. package/dist/{esm/priv-navigator-button.entry.js → components/priv-navigator-button2.js} +27 -9
  17. package/dist/components/priv-navigator-item.d.ts +11 -0
  18. package/dist/components/priv-navigator-item.js +6 -0
  19. package/dist/{esm/priv-navigator-item.entry.js → components/priv-navigator-item2.js} +28 -9
  20. package/dist/components/priv-option-list.d.ts +11 -0
  21. package/dist/components/priv-option-list.js +6 -0
  22. package/dist/{esm/priv-option-list.entry.js → components/priv-option-list2.js} +54 -21
  23. package/dist/components/wm-action-menu.d.ts +11 -0
  24. package/dist/components/wm-action-menu.js +6 -0
  25. package/dist/{cjs/wm-pagination.cjs.entry.js → components/wm-action-menu2.js} +216 -212
  26. package/dist/components/wm-button.d.ts +11 -0
  27. package/dist/components/wm-button.js +6 -0
  28. package/dist/{esm/wm-button.entry.js → components/wm-button2.js} +49 -20
  29. package/dist/components/wm-chart-slice.d.ts +11 -0
  30. package/dist/components/wm-chart-slice.js +41 -0
  31. package/dist/components/wm-chart.d.ts +11 -0
  32. package/dist/{esm/wm-chart.entry.js → components/wm-chart.js} +61 -22
  33. package/dist/components/wm-date-range.d.ts +11 -0
  34. package/dist/{esm/wm-date-range.entry.js → components/wm-date-range.js} +66 -23
  35. package/dist/components/wm-datepicker.d.ts +11 -0
  36. package/dist/{esm/wm-datepicker.entry.js → components/wm-datepicker.js} +58 -20
  37. package/dist/components/wm-file-list.d.ts +11 -0
  38. package/dist/{cjs/wm-file-list.cjs.entry.js → components/wm-file-list.js} +29 -13
  39. package/dist/components/wm-file.d.ts +11 -0
  40. package/dist/{esm/wm-file.entry.js → components/wm-file.js} +59 -20
  41. package/dist/components/wm-input.d.ts +11 -0
  42. package/dist/{esm/wm-input.entry.js → components/wm-input.js} +54 -22
  43. package/dist/components/wm-line-chart.d.ts +11 -0
  44. package/dist/{esm/wm-line-chart.entry.js → components/wm-line-chart.js} +80 -39
  45. package/dist/components/wm-menuitem.d.ts +11 -0
  46. package/dist/components/wm-menuitem.js +6 -0
  47. package/dist/{cjs/wm-optgroup.cjs.entry.js → components/wm-menuitem2.js} +130 -57
  48. package/dist/components/wm-modal-footer.d.ts +11 -0
  49. package/dist/components/wm-modal-footer.js +73 -0
  50. package/dist/components/wm-modal-header.d.ts +11 -0
  51. package/dist/components/wm-modal-header.js +61 -0
  52. package/dist/components/wm-modal-pss-footer.d.ts +11 -0
  53. package/dist/{cjs/priv-chart-popover.cjs.entry.js → components/wm-modal-pss-footer.js} +58 -128
  54. package/dist/components/wm-modal-pss-header.d.ts +11 -0
  55. package/dist/components/wm-modal-pss-header.js +64 -0
  56. package/dist/components/wm-modal-pss.d.ts +11 -0
  57. package/dist/{cjs/wm-textarea.cjs.entry.js → components/wm-modal-pss.js} +141 -66
  58. package/dist/components/wm-modal.d.ts +11 -0
  59. package/dist/{cjs/wm-input.cjs.entry.js → components/wm-modal.js} +140 -103
  60. package/dist/components/wm-navigation-hamburger.d.ts +11 -0
  61. package/dist/{ripple/p-f9cade98.entry.js → components/wm-navigation-hamburger.js} +70 -1
  62. package/dist/components/wm-navigation-item.d.ts +11 -0
  63. package/dist/components/wm-navigation-item.js +40 -0
  64. package/dist/components/wm-navigation.d.ts +11 -0
  65. package/dist/{ripple/p-1a71d867.system.entry.js → components/wm-navigation.js} +144 -1
  66. package/dist/components/wm-navigator.d.ts +11 -0
  67. package/dist/{esm/wm-navigator.entry.js → components/wm-navigator.js} +106 -18
  68. package/dist/components/wm-nested-select.d.ts +11 -0
  69. package/dist/{esm/wm-nested-select.entry.js → components/wm-nested-select.js} +56 -23
  70. package/dist/components/wm-optgroup.d.ts +11 -0
  71. package/dist/{esm/wm-optgroup.entry.js → components/wm-optgroup.js} +49 -11
  72. package/dist/components/wm-option.d.ts +11 -0
  73. package/dist/components/wm-option.js +6 -0
  74. package/dist/{cjs/wm-search.cjs.entry.js → components/wm-option2.js} +168 -165
  75. package/dist/components/wm-pagination.d.ts +11 -0
  76. package/dist/{esm/wm-pagination.entry.js → components/wm-pagination.js} +45 -17
  77. package/dist/components/wm-progress-indicator.d.ts +11 -0
  78. package/dist/{esm/wm-progress-indicator_3.entry.js → components/wm-progress-indicator.js} +52 -104
  79. package/dist/components/wm-progress-monitor.d.ts +11 -0
  80. package/dist/components/wm-progress-monitor.js +93 -0
  81. package/dist/components/wm-progress-slice.d.ts +11 -0
  82. package/dist/components/wm-progress-slice.js +37 -0
  83. package/dist/components/wm-search.d.ts +11 -0
  84. package/dist/{esm/wm-search.entry.js → components/wm-search.js} +76 -15
  85. package/dist/components/wm-select.d.ts +11 -0
  86. package/dist/components/wm-select.js +6 -0
  87. package/dist/components/wm-select2.js +294 -0
  88. package/dist/components/wm-snackbar.d.ts +11 -0
  89. package/dist/{esm/wm-snackbar.entry.js → components/wm-snackbar.js} +41 -16
  90. package/dist/components/wm-tab-item.d.ts +11 -0
  91. package/dist/components/wm-tab-item.js +85 -0
  92. package/dist/components/wm-tab-list.d.ts +11 -0
  93. package/dist/{cjs/wm-uploader.cjs.entry.js → components/wm-tab-list.js} +174 -281
  94. package/dist/components/wm-tab-panel.d.ts +11 -0
  95. package/dist/{esm/wm-file-list.entry.js → components/wm-tab-panel.js} +46 -12
  96. package/dist/components/wm-tag-input.d.ts +11 -0
  97. package/dist/{esm/wm-tag-input.entry.js → components/wm-tag-input.js} +64 -32
  98. package/dist/components/wm-tag-option.d.ts +11 -0
  99. package/dist/components/wm-tag-option.js +63 -0
  100. package/dist/components/wm-textarea.d.ts +11 -0
  101. package/dist/{esm/wm-textarea.entry.js → components/wm-textarea.js} +47 -17
  102. package/dist/components/wm-timepicker.d.ts +11 -0
  103. package/dist/{esm/wm-timepicker.entry.js → components/wm-timepicker.js} +51 -20
  104. package/dist/components/wm-toggletip.d.ts +11 -0
  105. package/dist/{esm/wm-toggletip.entry.js → components/wm-toggletip.js} +38 -16
  106. package/dist/components/wm-uploader.d.ts +11 -0
  107. package/dist/{esm/wm-uploader.entry.js → components/wm-uploader.js} +52 -24
  108. package/dist/components/wm-wrapper.d.ts +11 -0
  109. package/dist/components/wm-wrapper.js +34 -0
  110. package/dist/types/stencil-public-runtime.d.ts +31 -10
  111. package/package.json +4 -8
  112. package/dist/cjs/chartFunctions-a1981e06.js +0 -732
  113. package/dist/cjs/functions-4b187487.js +0 -9679
  114. package/dist/cjs/global-4e034486.js +0 -85
  115. package/dist/cjs/index-e86c28b6.js +0 -2649
  116. package/dist/cjs/index.cjs.js +0 -2
  117. package/dist/cjs/interfaces-85d78ae9.js +0 -37
  118. package/dist/cjs/intl-7fd0760e.js +0 -283
  119. package/dist/cjs/loader.cjs.js +0 -14
  120. package/dist/cjs/priv-calendar.cjs.entry.js +0 -573
  121. package/dist/cjs/priv-navigator-button.cjs.entry.js +0 -28
  122. package/dist/cjs/priv-navigator-item.cjs.entry.js +0 -34
  123. package/dist/cjs/priv-option-list.cjs.entry.js +0 -392
  124. package/dist/cjs/ripple.cjs.js +0 -24
  125. package/dist/cjs/wm-action-menu_2.cjs.entry.js +0 -333
  126. package/dist/cjs/wm-button.cjs.entry.js +0 -206
  127. package/dist/cjs/wm-chart-slice.cjs.entry.js +0 -27
  128. package/dist/cjs/wm-chart.cjs.entry.js +0 -162
  129. package/dist/cjs/wm-date-range.cjs.entry.js +0 -483
  130. package/dist/cjs/wm-datepicker.cjs.entry.js +0 -253
  131. package/dist/cjs/wm-file.cjs.entry.js +0 -193
  132. package/dist/cjs/wm-line-chart.cjs.entry.js +0 -460
  133. package/dist/cjs/wm-modal-pss_3.cjs.entry.js +0 -214
  134. package/dist/cjs/wm-modal_3.cjs.entry.js +0 -212
  135. package/dist/cjs/wm-navigation_3.cjs.entry.js +0 -185
  136. package/dist/cjs/wm-navigator.cjs.entry.js +0 -326
  137. package/dist/cjs/wm-nested-select.cjs.entry.js +0 -314
  138. package/dist/cjs/wm-option_2.cjs.entry.js +0 -425
  139. package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +0 -202
  140. package/dist/cjs/wm-snackbar.cjs.entry.js +0 -181
  141. package/dist/cjs/wm-tab-item_3.cjs.entry.js +0 -260
  142. package/dist/cjs/wm-tag-input.cjs.entry.js +0 -891
  143. package/dist/cjs/wm-tag-option.cjs.entry.js +0 -43
  144. package/dist/cjs/wm-timepicker.cjs.entry.js +0 -306
  145. package/dist/cjs/wm-toggletip.cjs.entry.js +0 -182
  146. package/dist/cjs/wm-wrapper.cjs.entry.js +0 -21
  147. package/dist/collection/collection-manifest.json +0 -191
  148. package/dist/collection/components/charts/chartFunctions.js +0 -665
  149. package/dist/collection/components/charts/chartFunctions.spec.js +0 -16
  150. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.css +0 -908
  151. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.e2e.js +0 -81
  152. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +0 -257
  153. package/dist/collection/components/charts/screenshots.e2e.js +0 -96
  154. package/dist/collection/components/charts/wm-chart/wm-chart-slice.js +0 -125
  155. package/dist/collection/components/charts/wm-chart/wm-chart.css +0 -1274
  156. package/dist/collection/components/charts/wm-chart/wm-chart.e2e.js +0 -213
  157. package/dist/collection/components/charts/wm-chart/wm-chart.js +0 -422
  158. package/dist/collection/components/charts/wm-chart/wm-chart.spec.js +0 -37
  159. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.css +0 -1067
  160. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.e2e.js +0 -176
  161. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.js +0 -723
  162. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.spec.js +0 -163
  163. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.css +0 -1274
  164. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +0 -264
  165. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.css +0 -909
  166. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.e2e.js +0 -69
  167. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +0 -151
  168. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.spec.js +0 -79
  169. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-slice.js +0 -121
  170. package/dist/collection/components/datepickers/datepicker.css +0 -1043
  171. package/dist/collection/components/datepickers/priv-calendar/priv-calendar.css +0 -1279
  172. package/dist/collection/components/datepickers/priv-calendar/priv-calendar.js +0 -840
  173. package/dist/collection/components/datepickers/priv-calendar/priv-calendar.spec.js +0 -89
  174. package/dist/collection/components/datepickers/wm-date-range.e2e.js +0 -443
  175. package/dist/collection/components/datepickers/wm-date-range.js +0 -845
  176. package/dist/collection/components/datepickers/wm-date-range.spec.js +0 -22
  177. package/dist/collection/components/datepickers/wm-datepicker.e2e.js +0 -382
  178. package/dist/collection/components/datepickers/wm-datepicker.js +0 -520
  179. package/dist/collection/components/datepickers/wm-datepicker.spec.js +0 -21
  180. package/dist/collection/components/selects/priv-option-list/priv-option-list.css +0 -918
  181. package/dist/collection/components/selects/priv-option-list/priv-option-list.js +0 -778
  182. package/dist/collection/components/selects/wm-nested-select/wm-nested-select.css +0 -1181
  183. package/dist/collection/components/selects/wm-nested-select/wm-nested-select.js +0 -620
  184. package/dist/collection/components/selects/wm-optgroup/wm-optgroup.css +0 -830
  185. package/dist/collection/components/selects/wm-optgroup/wm-optgroup.js +0 -258
  186. package/dist/collection/components/selects/wm-option/wm-option.css +0 -931
  187. package/dist/collection/components/selects/wm-option/wm-option.e2e.js +0 -22
  188. package/dist/collection/components/selects/wm-option/wm-option.js +0 -530
  189. package/dist/collection/components/selects/wm-option/wm-option.spec.js +0 -63
  190. package/dist/collection/components/selects/wm-select/wm-select.css +0 -1104
  191. package/dist/collection/components/selects/wm-select/wm-select.e2e.js +0 -521
  192. package/dist/collection/components/selects/wm-select/wm-select.js +0 -584
  193. package/dist/collection/components/selects/wm-select/wm-select.spec.js +0 -271
  194. package/dist/collection/components/wm-action-menu/wm-action-menu.css +0 -891
  195. package/dist/collection/components/wm-action-menu/wm-action-menu.e2e.js +0 -200
  196. package/dist/collection/components/wm-action-menu/wm-action-menu.js +0 -435
  197. package/dist/collection/components/wm-action-menu/wm-action-menu.spec.js +0 -48
  198. package/dist/collection/components/wm-button/wm-button.css +0 -1261
  199. package/dist/collection/components/wm-button/wm-button.e2e.js +0 -55
  200. package/dist/collection/components/wm-button/wm-button.js +0 -489
  201. package/dist/collection/components/wm-button/wm-button.spec.js +0 -74
  202. package/dist/collection/components/wm-file/wm-file.css +0 -927
  203. package/dist/collection/components/wm-file/wm-file.js +0 -412
  204. package/dist/collection/components/wm-file/wm-file.spec.js +0 -194
  205. package/dist/collection/components/wm-file-list/wm-file-list.css +0 -820
  206. package/dist/collection/components/wm-file-list/wm-file-list.js +0 -45
  207. package/dist/collection/components/wm-file-list/wm-file-list.spec.js +0 -69
  208. package/dist/collection/components/wm-input/wm-input.css +0 -992
  209. package/dist/collection/components/wm-input/wm-input.e2e.js +0 -32
  210. package/dist/collection/components/wm-input/wm-input.js +0 -471
  211. package/dist/collection/components/wm-input/wm-input.spec.js +0 -173
  212. package/dist/collection/components/wm-menuitem/wm-menuitem.css +0 -891
  213. package/dist/collection/components/wm-menuitem/wm-menuitem.e2e.js +0 -23
  214. package/dist/collection/components/wm-menuitem/wm-menuitem.js +0 -419
  215. package/dist/collection/components/wm-menuitem/wm-menuitem.spec.js +0 -54
  216. package/dist/collection/components/wm-modal/wm-modal-footer.css +0 -845
  217. package/dist/collection/components/wm-modal/wm-modal-footer.js +0 -141
  218. package/dist/collection/components/wm-modal/wm-modal-footer.spec.js +0 -11
  219. package/dist/collection/components/wm-modal/wm-modal-header.css +0 -844
  220. package/dist/collection/components/wm-modal/wm-modal-header.js +0 -78
  221. package/dist/collection/components/wm-modal/wm-modal-header.spec.js +0 -8
  222. package/dist/collection/components/wm-modal/wm-modal.css +0 -891
  223. package/dist/collection/components/wm-modal/wm-modal.e2e.js +0 -104
  224. package/dist/collection/components/wm-modal/wm-modal.js +0 -350
  225. package/dist/collection/components/wm-modal/wm-modal.spec.js +0 -30
  226. package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.css +0 -852
  227. package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.js +0 -138
  228. package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.css +0 -846
  229. package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.js +0 -82
  230. package/dist/collection/components/wm-modal-pss/wm-modal-pss.css +0 -927
  231. package/dist/collection/components/wm-modal-pss/wm-modal-pss.js +0 -362
  232. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.css +0 -847
  233. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +0 -119
  234. package/dist/collection/components/wm-navigation/wm-navigation-item.css +0 -856
  235. package/dist/collection/components/wm-navigation/wm-navigation-item.js +0 -98
  236. package/dist/collection/components/wm-navigation/wm-navigation.css +0 -898
  237. package/dist/collection/components/wm-navigation/wm-navigation.e2e.js +0 -102
  238. package/dist/collection/components/wm-navigation/wm-navigation.js +0 -190
  239. package/dist/collection/components/wm-navigation/wm-navigation.spec.js +0 -91
  240. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.css +0 -849
  241. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.e2e.js +0 -50
  242. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +0 -86
  243. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.css +0 -830
  244. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +0 -124
  245. package/dist/collection/components/wm-navigator/wm-navigator.css +0 -903
  246. package/dist/collection/components/wm-navigator/wm-navigator.e2e.js +0 -209
  247. package/dist/collection/components/wm-navigator/wm-navigator.js +0 -496
  248. package/dist/collection/components/wm-navigator/wm-navigator.spec.js +0 -177
  249. package/dist/collection/components/wm-pagination/wm-pagination.css +0 -971
  250. package/dist/collection/components/wm-pagination/wm-pagination.e2e.js +0 -312
  251. package/dist/collection/components/wm-pagination/wm-pagination.js +0 -363
  252. package/dist/collection/components/wm-search/wm-search.css +0 -895
  253. package/dist/collection/components/wm-search/wm-search.e2e.js +0 -76
  254. package/dist/collection/components/wm-search/wm-search.js +0 -426
  255. package/dist/collection/components/wm-search/wm-search.spec.js +0 -71
  256. package/dist/collection/components/wm-snackbar/wm-snackbar.css +0 -1077
  257. package/dist/collection/components/wm-snackbar/wm-snackbar.e2e.js +0 -112
  258. package/dist/collection/components/wm-snackbar/wm-snackbar.js +0 -269
  259. package/dist/collection/components/wm-snackbar/wm-snackbar.spec.js +0 -9
  260. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.css +0 -868
  261. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +0 -175
  262. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.css +0 -840
  263. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +0 -273
  264. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.css +0 -825
  265. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +0 -87
  266. package/dist/collection/components/wm-tabs/wm-tabs.e2e.js +0 -91
  267. package/dist/collection/components/wm-tabs/wm-tabs.spec.js +0 -12
  268. package/dist/collection/components/wm-tag-input/wm-tag-input.css +0 -1275
  269. package/dist/collection/components/wm-tag-input/wm-tag-input.e2e.js +0 -204
  270. package/dist/collection/components/wm-tag-input/wm-tag-input.js +0 -1227
  271. package/dist/collection/components/wm-tag-input/wm-tag-input.spec.js +0 -195
  272. package/dist/collection/components/wm-tag-input/wm-tag-option/wm-tag-option.js +0 -243
  273. package/dist/collection/components/wm-textarea/wm-textarea.css +0 -979
  274. package/dist/collection/components/wm-textarea/wm-textarea.e2e.js +0 -41
  275. package/dist/collection/components/wm-textarea/wm-textarea.js +0 -313
  276. package/dist/collection/components/wm-textarea/wm-textarea.spec.js +0 -79
  277. package/dist/collection/components/wm-timepicker/wm-timepicker.css +0 -1093
  278. package/dist/collection/components/wm-timepicker/wm-timepicker.e2e.js +0 -163
  279. package/dist/collection/components/wm-timepicker/wm-timepicker.js +0 -544
  280. package/dist/collection/components/wm-timepicker/wm-timepicker.spec.js +0 -147
  281. package/dist/collection/components/wm-toggletip/wm-toggletip.css +0 -1152
  282. package/dist/collection/components/wm-toggletip/wm-toggletip.e2e.js +0 -69
  283. package/dist/collection/components/wm-toggletip/wm-toggletip.js +0 -289
  284. package/dist/collection/components/wm-toggletip/wm-toggletip.spec.js +0 -21
  285. package/dist/collection/components/wm-uploader/wm-uploader.css +0 -1563
  286. package/dist/collection/components/wm-uploader/wm-uploader.e2e.js +0 -70
  287. package/dist/collection/components/wm-uploader/wm-uploader.js +0 -603
  288. package/dist/collection/components/wm-uploader/wm-uploader.spec.js +0 -234
  289. package/dist/collection/components/wm-wrapper/wm-wrapper.js +0 -28
  290. package/dist/collection/dev/button.js +0 -0
  291. package/dist/collection/dev/chart-small.js +0 -56
  292. package/dist/collection/dev/chart.js +0 -18
  293. package/dist/collection/dev/date-range.js +0 -6
  294. package/dist/collection/dev/datepicker.js +0 -46
  295. package/dist/collection/dev/file-list.js +0 -16
  296. package/dist/collection/dev/file.js +0 -0
  297. package/dist/collection/dev/input.js +0 -6
  298. package/dist/collection/dev/line-chart.js +0 -0
  299. package/dist/collection/dev/modal.js +0 -48
  300. package/dist/collection/dev/navigation.js +0 -13
  301. package/dist/collection/dev/navigator.js +0 -34
  302. package/dist/collection/dev/nested-select.js +0 -36
  303. package/dist/collection/dev/pagination.js +0 -7
  304. package/dist/collection/dev/progress-monitor.js +0 -0
  305. package/dist/collection/dev/pss-modal.js +0 -8
  306. package/dist/collection/dev/scripts.js +0 -49
  307. package/dist/collection/dev/search.js +0 -72
  308. package/dist/collection/dev/select.js +0 -57
  309. package/dist/collection/dev/snackbar.js +0 -54
  310. package/dist/collection/dev/tabs.js +0 -44
  311. package/dist/collection/dev/tag-input.js +0 -32
  312. package/dist/collection/dev/textarea.js +0 -28
  313. package/dist/collection/dev/timepicker.js +0 -32
  314. package/dist/collection/dev/toggletip.js +0 -9
  315. package/dist/collection/dev/uploader.js +0 -139
  316. package/dist/collection/global/__mocks__/functions.js +0 -6
  317. package/dist/collection/global/functions.js +0 -825
  318. package/dist/collection/global/functions.spec.js +0 -126
  319. package/dist/collection/global/intl.js +0 -274
  320. package/dist/collection/global/services/__mocks__/http-service.js +0 -130
  321. package/dist/collection/global/services/http-service.js +0 -50
  322. package/dist/collection/lang/lang.js +0 -5
  323. package/dist/collection/lang/lang.spec.js +0 -20
  324. package/dist/collection/lang/missing.js +0 -43
  325. package/dist/collection/lang/piglatin.js +0 -101
  326. package/dist/esm/functions-00e1916b.js +0 -9639
  327. package/dist/esm/global-c76064cb.js +0 -83
  328. package/dist/esm/index-558b5a82.js +0 -2618
  329. package/dist/esm/index.js +0 -1
  330. package/dist/esm/interfaces-cc5b177f.js +0 -34
  331. package/dist/esm/loader.js +0 -10
  332. package/dist/esm/polyfills/core-js.js +0 -11
  333. package/dist/esm/polyfills/dom.js +0 -79
  334. package/dist/esm/polyfills/es5-html-element.js +0 -1
  335. package/dist/esm/polyfills/index.js +0 -34
  336. package/dist/esm/polyfills/system.js +0 -6
  337. package/dist/esm/ripple.js +0 -19
  338. package/dist/esm/wm-action-menu_2.entry.js +0 -328
  339. package/dist/esm/wm-chart-slice.entry.js +0 -23
  340. package/dist/esm/wm-modal-pss_3.entry.js +0 -208
  341. package/dist/esm/wm-modal_3.entry.js +0 -206
  342. package/dist/esm/wm-navigation_3.entry.js +0 -179
  343. package/dist/esm/wm-option_2.entry.js +0 -420
  344. package/dist/esm/wm-tab-item_3.entry.js +0 -254
  345. package/dist/esm/wm-tag-option.entry.js +0 -39
  346. package/dist/esm/wm-wrapper.entry.js +0 -17
  347. package/dist/esm-es5/chartFunctions-9099c7e9.js +0 -1
  348. package/dist/esm-es5/functions-00e1916b.js +0 -1
  349. package/dist/esm-es5/global-c76064cb.js +0 -1
  350. package/dist/esm-es5/index-558b5a82.js +0 -1
  351. package/dist/esm-es5/index.js +0 -0
  352. package/dist/esm-es5/interfaces-cc5b177f.js +0 -1
  353. package/dist/esm-es5/intl-a6f16883.js +0 -1
  354. package/dist/esm-es5/loader.js +0 -1
  355. package/dist/esm-es5/priv-calendar.entry.js +0 -1
  356. package/dist/esm-es5/priv-chart-popover.entry.js +0 -1
  357. package/dist/esm-es5/priv-navigator-button.entry.js +0 -1
  358. package/dist/esm-es5/priv-navigator-item.entry.js +0 -1
  359. package/dist/esm-es5/priv-option-list.entry.js +0 -1
  360. package/dist/esm-es5/ripple.js +0 -1
  361. package/dist/esm-es5/wm-action-menu_2.entry.js +0 -1
  362. package/dist/esm-es5/wm-button.entry.js +0 -1
  363. package/dist/esm-es5/wm-chart-slice.entry.js +0 -1
  364. package/dist/esm-es5/wm-chart.entry.js +0 -1
  365. package/dist/esm-es5/wm-date-range.entry.js +0 -1
  366. package/dist/esm-es5/wm-datepicker.entry.js +0 -1
  367. package/dist/esm-es5/wm-file-list.entry.js +0 -1
  368. package/dist/esm-es5/wm-file.entry.js +0 -1
  369. package/dist/esm-es5/wm-input.entry.js +0 -1
  370. package/dist/esm-es5/wm-line-chart.entry.js +0 -1
  371. package/dist/esm-es5/wm-modal-pss_3.entry.js +0 -1
  372. package/dist/esm-es5/wm-modal_3.entry.js +0 -1
  373. package/dist/esm-es5/wm-navigation_3.entry.js +0 -1
  374. package/dist/esm-es5/wm-navigator.entry.js +0 -1
  375. package/dist/esm-es5/wm-nested-select.entry.js +0 -1
  376. package/dist/esm-es5/wm-optgroup.entry.js +0 -1
  377. package/dist/esm-es5/wm-option_2.entry.js +0 -1
  378. package/dist/esm-es5/wm-pagination.entry.js +0 -1
  379. package/dist/esm-es5/wm-progress-indicator_3.entry.js +0 -1
  380. package/dist/esm-es5/wm-search.entry.js +0 -1
  381. package/dist/esm-es5/wm-snackbar.entry.js +0 -1
  382. package/dist/esm-es5/wm-tab-item_3.entry.js +0 -1
  383. package/dist/esm-es5/wm-tag-input.entry.js +0 -1
  384. package/dist/esm-es5/wm-tag-option.entry.js +0 -1
  385. package/dist/esm-es5/wm-textarea.entry.js +0 -1
  386. package/dist/esm-es5/wm-timepicker.entry.js +0 -1
  387. package/dist/esm-es5/wm-toggletip.entry.js +0 -1
  388. package/dist/esm-es5/wm-uploader.entry.js +0 -1
  389. package/dist/esm-es5/wm-wrapper.entry.js +0 -1
  390. package/dist/index.cjs.js +0 -1
  391. package/dist/index.js +0 -1
  392. package/dist/loader/cdn.js +0 -3
  393. package/dist/loader/index.cjs.js +0 -3
  394. package/dist/loader/index.d.ts +0 -21
  395. package/dist/loader/index.es2017.js +0 -3
  396. package/dist/loader/index.js +0 -4
  397. package/dist/loader/package.json +0 -11
  398. package/dist/ripple/index.esm.js +0 -0
  399. package/dist/ripple/p-05ae54d7.entry.js +0 -1
  400. package/dist/ripple/p-0d89d63c.system.entry.js +0 -1
  401. package/dist/ripple/p-118c47eb.system.entry.js +0 -1
  402. package/dist/ripple/p-1a4b6b02.system.entry.js +0 -1
  403. package/dist/ripple/p-1a4b7504.system.entry.js +0 -1
  404. package/dist/ripple/p-1a951dfb.entry.js +0 -1
  405. package/dist/ripple/p-1c8f550f.system.entry.js +0 -1
  406. package/dist/ripple/p-1f751b87.js +0 -1
  407. package/dist/ripple/p-1fac5bf9.js +0 -1
  408. package/dist/ripple/p-20a8f732.system.entry.js +0 -1
  409. package/dist/ripple/p-249b56fb.entry.js +0 -1
  410. package/dist/ripple/p-249d13a1.system.entry.js +0 -1
  411. package/dist/ripple/p-26906899.entry.js +0 -1
  412. package/dist/ripple/p-2732bddd.js +0 -1
  413. package/dist/ripple/p-28119645.system.entry.js +0 -1
  414. package/dist/ripple/p-2f37f3ee.system.js +0 -1
  415. package/dist/ripple/p-32bf3f5b.system.entry.js +0 -1
  416. package/dist/ripple/p-335c03d3.system.entry.js +0 -1
  417. package/dist/ripple/p-363b534b.entry.js +0 -1
  418. package/dist/ripple/p-393e4636.js +0 -1
  419. package/dist/ripple/p-39f79d71.system.entry.js +0 -1
  420. package/dist/ripple/p-3a231f4b.system.entry.js +0 -1
  421. package/dist/ripple/p-3d4bb85f.entry.js +0 -1
  422. package/dist/ripple/p-4228de00.entry.js +0 -1
  423. package/dist/ripple/p-42fa7a77.system.js +0 -1
  424. package/dist/ripple/p-48e09589.entry.js +0 -1
  425. package/dist/ripple/p-4f8fe1d1.system.js +0 -1
  426. package/dist/ripple/p-50ea2036.system.js +0 -1
  427. package/dist/ripple/p-522ecb7d.system.entry.js +0 -1
  428. package/dist/ripple/p-54d6f0f9.entry.js +0 -1
  429. package/dist/ripple/p-568c595f.js +0 -2
  430. package/dist/ripple/p-56aeee6e.system.entry.js +0 -1
  431. package/dist/ripple/p-5e6a4f70.system.js +0 -1
  432. package/dist/ripple/p-5f082360.system.entry.js +0 -1
  433. package/dist/ripple/p-5f5fe905.js +0 -1
  434. package/dist/ripple/p-617c2c75.entry.js +0 -1
  435. package/dist/ripple/p-6524c53e.system.entry.js +0 -1
  436. package/dist/ripple/p-65d26233.system.entry.js +0 -1
  437. package/dist/ripple/p-6834a6d3.entry.js +0 -1
  438. package/dist/ripple/p-68e04222.entry.js +0 -1
  439. package/dist/ripple/p-68fddfaa.system.entry.js +0 -1
  440. package/dist/ripple/p-694903e6.system.entry.js +0 -1
  441. package/dist/ripple/p-73ca2f26.system.js +0 -1
  442. package/dist/ripple/p-7b6a65f8.system.entry.js +0 -1
  443. package/dist/ripple/p-7b7e1eb5.system.entry.js +0 -1
  444. package/dist/ripple/p-88ebddd7.entry.js +0 -1
  445. package/dist/ripple/p-8c1d27a7.entry.js +0 -1
  446. package/dist/ripple/p-8e9c24f3.entry.js +0 -1
  447. package/dist/ripple/p-8f836507.system.entry.js +0 -1
  448. package/dist/ripple/p-94495341.entry.js +0 -1
  449. package/dist/ripple/p-958331bf.entry.js +0 -1
  450. package/dist/ripple/p-9872623b.entry.js +0 -1
  451. package/dist/ripple/p-9ab3c088.system.entry.js +0 -1
  452. package/dist/ripple/p-9aedd599.entry.js +0 -1
  453. package/dist/ripple/p-9b848151.entry.js +0 -1
  454. package/dist/ripple/p-a04ef164.system.entry.js +0 -1
  455. package/dist/ripple/p-a78bb423.system.entry.js +0 -1
  456. package/dist/ripple/p-a880d9a0.system.entry.js +0 -1
  457. package/dist/ripple/p-ab8d78cc.system.js +0 -2
  458. package/dist/ripple/p-adc254e6.entry.js +0 -1
  459. package/dist/ripple/p-b165d61a.entry.js +0 -1
  460. package/dist/ripple/p-b39377c7.entry.js +0 -1
  461. package/dist/ripple/p-b9bca547.entry.js +0 -1
  462. package/dist/ripple/p-bae2c236.entry.js +0 -1
  463. package/dist/ripple/p-c53f3704.system.entry.js +0 -1
  464. package/dist/ripple/p-c56ff16f.entry.js +0 -1
  465. package/dist/ripple/p-c8cf09a2.system.entry.js +0 -1
  466. package/dist/ripple/p-cbdceb6e.entry.js +0 -1
  467. package/dist/ripple/p-cc813406.system.js +0 -1
  468. package/dist/ripple/p-d20a0f0c.system.entry.js +0 -1
  469. package/dist/ripple/p-d6111226.entry.js +0 -1
  470. package/dist/ripple/p-da68c87c.entry.js +0 -1
  471. package/dist/ripple/p-ddef82fa.system.entry.js +0 -1
  472. package/dist/ripple/p-dee6d5a3.entry.js +0 -1
  473. package/dist/ripple/p-e55d5371.entry.js +0 -1
  474. package/dist/ripple/p-e8c22f01.system.entry.js +0 -1
  475. package/dist/ripple/p-f555831b.entry.js +0 -1
  476. package/dist/ripple/p-f5c40e9e.system.entry.js +0 -1
  477. package/dist/ripple/p-fa09191b.system.entry.js +0 -1
  478. package/dist/ripple/p-fdfca58b.entry.js +0 -1
  479. package/dist/ripple/ripple.css +0 -1
  480. package/dist/ripple/ripple.esm.js +0 -1
  481. package/dist/ripple/ripple.js +0 -127
  482. /package/dist/{collection/dev/action-menu.js → types/test-setup.d.ts} +0 -0
@@ -1,1227 +0,0 @@
1
- import { h, forceUpdate } from "@stencil/core";
2
- import { csvToArray, debounce, hideTooltip, intl, measureText, shouldOpenUp, showTooltip, truncateText, findPrev, findNext, } from "../../global/functions";
3
- import { globalMessages } from "../../global/intl";
4
- export class TagInput {
5
- constructor() {
6
- this.addNewHelpText = intl.formatMessage({
7
- id: "tagInput.addNewHelpText",
8
- defaultMessage: "Press the Enter or Comma key to add a new tag.",
9
- description: "Instructional text, where tag refers to a tag UI element that can be added to a list. Use imperative",
10
- });
11
- this.selectionHelpText = intl.formatMessage({
12
- id: "tagInput.selectionHelpText",
13
- defaultMessage: "Search and select a tag.",
14
- description: "Instructional text, where tag refers to a tag UI element that can be added to a list. Use imperative",
15
- });
16
- this.maxTagsReachedMessage = intl.formatMessage({
17
- id: "tagInput.maxTagsReached",
18
- defaultMessage: "No more tags can be added because the limit has been reached.",
19
- description: "Tag refers to a tag UI element that can be added to a list.",
20
- });
21
- this.tagAreaInstructions = intl.formatMessage({
22
- id: "tagInput.tagAreaInstructions",
23
- defaultMessage: "tag selection. Press Backspace or Delete to remove a tag.",
24
- description: "Label for a UI element where a user can select from a list of tags.",
25
- });
26
- this.tagsAddedMessage = intl.formatMessage({
27
- id: "tagInput.tagsAdded",
28
- defaultMessage: "Tags added",
29
- description: "Tag refers to a tag UI element that can be added to a list. Full message for context: 'Tags added: x/y",
30
- });
31
- this.noResultsMessage = intl.formatMessage({
32
- id: "tagInput.noResults",
33
- defaultMessage: "No results match your search.",
34
- });
35
- this.openUp = false;
36
- this.inModal = false;
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.isKeying = false;
53
- this.isExpanded = false;
54
- this.liveRegionMessage = "";
55
- this.focusedOption = undefined;
56
- this.focusedColumn = 0;
57
- this.focusedTagIndex = undefined;
58
- this.tagsList = [];
59
- }
60
- addNewTagMessage(newTagName) {
61
- return intl.formatMessage({
62
- id: "tagInput.addNewTag",
63
- defaultMessage: "Add {newTagName}",
64
- description: "Button text to add a new tag to a list of tags",
65
- }, { newTagName: newTagName });
66
- }
67
- toggleKeyingOn() {
68
- this.isKeying = true;
69
- }
70
- toggleKeyingOff() {
71
- this.isKeying = false;
72
- }
73
- get isDropdown() {
74
- return this.tagInputType === "dropdown";
75
- }
76
- get isTable() {
77
- return this.tagInputType === "table";
78
- }
79
- get charCount() {
80
- return this.inputEl ? this.inputEl.value.length : 0;
81
- }
82
- get tooltipVisible() {
83
- return document.getElementById("wm-tooltip").classList.contains("show");
84
- }
85
- get optionEls() {
86
- return Array.from(this.el.querySelectorAll("wm-tag-option"));
87
- }
88
- // list of options matching user query
89
- get filteredOptionEls() {
90
- const query = this.inputEl ? this.inputEl.value.toLowerCase() : "";
91
- const list = Array.from(this.optionEls).filter((o) => {
92
- let values = "";
93
- if (this.isDropdown) {
94
- values = o.textContent.toLowerCase();
95
- }
96
- else if (this.isTable) {
97
- values = [o.col1, o.col2, o.col3, o.col4].join("").toLowerCase();
98
- }
99
- return values.includes(query);
100
- });
101
- return list;
102
- }
103
- // the ones that should be rendered as tags
104
- get taggedOptions() {
105
- return this.optionEls.filter((o) => o.selected || o.locked);
106
- }
107
- // for visual stuff (measuring, truncating...)
108
- get _tagEls() {
109
- return this.tagAreaEl ? Array.from(this.tagAreaEl.querySelectorAll(".tag")) : [];
110
- }
111
- get focusedTag() {
112
- if (this.focusedTagIndex !== undefined && this.focusedTagIndex >= 0) {
113
- return this._tagEls[this.focusedTagIndex];
114
- }
115
- }
116
- // get the wm-tag-option, given the internal representation (dropdown li or table tr)
117
- tagOptionFromEl(el) {
118
- return el.id === "add-new-btn" ? undefined : this.el.querySelector("#" + el.id);
119
- }
120
- // get the wm-tag-option, given the internal representation of a tag
121
- tagOptionFromTag(el) {
122
- const id = el.id.replace("tag-", "");
123
- return this.el.querySelector("#" + id);
124
- }
125
- // get the internal representation of a wm-tag-option
126
- elFromTagOption(el) {
127
- return this.el.shadowRoot.querySelector("#" + el.id);
128
- }
129
- // focusedOption state refers to the wm-tag-option. This gets the corresponding element in the shadow DOM, or the "Add New" button.
130
- get _focusedOption() {
131
- if (!!this.focusedOption) {
132
- return this.elFromTagOption(this.focusedOption);
133
- }
134
- else if (this.addNewButton && this.addNewButton.classList.contains("focused")) {
135
- return this.addNewButton;
136
- }
137
- }
138
- get _focusedCell() {
139
- if (!!this._focusedOption) {
140
- const allCells = Array.from(this._focusedOption.querySelectorAll("td"));
141
- const index = this.focusedColumn || 0;
142
- return allCells[index];
143
- }
144
- }
145
- get inputActiveDescendantId() {
146
- if (this._focusedOption) {
147
- if (this.isTable) {
148
- const cells = Array.from(this._focusedOption.querySelectorAll("td"));
149
- return cells[this.focusedColumn].id;
150
- }
151
- return this._focusedOption.id;
152
- }
153
- return null;
154
- }
155
- get tagLimitReached() {
156
- return !!(this.maxTags && this.taggedOptions.length >= this.maxTags);
157
- }
158
- get inputMinimumWidth() {
159
- if (this._tagEls) {
160
- // 150px is the minimum width of the input field, or the length of the placeholder text
161
- const inputElStyles = getComputedStyle(this.inputEl);
162
- const tagElStyles = getComputedStyle(this._tagEls[this._tagEls.length - 1]);
163
- const inputElBuffer = [
164
- inputElStyles.paddingLeft,
165
- inputElStyles.paddingRight,
166
- inputElStyles.marginLeft,
167
- inputElStyles.marginRight,
168
- tagElStyles.marginRight,
169
- ].reduce((prev, curr) => prev + parseInt(curr.replace("px", "")), 0);
170
- const minimumWidth = Math.max(150, measureText(this.inputEl, this.placeholder).width + inputElBuffer);
171
- return minimumWidth;
172
- }
173
- else {
174
- return 150;
175
- }
176
- }
177
- getTagName(o) {
178
- // 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)
179
- return this.isDropdown ? o.textContent : o.col1;
180
- }
181
- isExistingTag(tag) {
182
- const list = this.optionEls.map((o) => this.getTagName(o).toLowerCase());
183
- return list.includes(tag.toLowerCase());
184
- }
185
- tagAddedMessage(tag) {
186
- return intl.formatMessage({
187
- id: "tagInput.tagAdded",
188
- defaultMessage: "{tagName} added.",
189
- description: "Confirmation for adding a tag UI element to a list of tags.",
190
- }, { tagName: tag });
191
- }
192
- tagRemovedMessage(tag) {
193
- return intl.formatMessage({
194
- id: "tagInput.tagRemoved",
195
- defaultMessage: "{tagName} removed.",
196
- description: "Confirmation for removing a tag UI element from a list of tags.",
197
- }, { tagName: tag });
198
- }
199
- tagAlreadyAddedMessage(tag) {
200
- return intl.formatMessage({
201
- id: "tagInput.tagAlreadyAdded",
202
- defaultMessage: "{tagName} has already been added.",
203
- description: "Alert for adding a tag UI element that is already included in the list.",
204
- }, { tagName: tag });
205
- }
206
- tagLockedMessage(tag) {
207
- return intl.formatMessage({
208
- id: "tagInput.tagLocked",
209
- defaultMessage: "{tagName} is locked and cannot be removed.",
210
- description: "Alert indicating a tag UI element cannot be removed from its list.",
211
- }, { tagName: tag });
212
- }
213
- isElOrChild(el) {
214
- return el === this.el || this.el.shadowRoot.contains(el) || this.el.contains(el);
215
- }
216
- componentWillLoad() {
217
- if (!this.placeholder) {
218
- this.placeholder = this.createPlaceholderDefault(this.addNew, this.optionEls.length > 0);
219
- }
220
- if (!this.label) {
221
- console.error("wm-tag-input must have a label property");
222
- }
223
- this.el.focus = () => {
224
- const firstFocusableTag = this._tagEls[0];
225
- if (firstFocusableTag) {
226
- this.tagAreaEl.focus();
227
- this.focusTag(firstFocusableTag);
228
- }
229
- else {
230
- this.inputEl.focus();
231
- }
232
- };
233
- // on resize of component, trigger componentDidRender -> positionInput
234
- const resizeObserver = new ResizeObserver(() => this.debouncedUpdate());
235
- resizeObserver.observe(this.el);
236
- // if within wm-modal, change max-height to vh unit
237
- if (this.el.closest("wm-modal")) {
238
- this.inModal = true;
239
- }
240
- const lockedTags = [];
241
- const regularTags = [];
242
- this.optionEls.forEach((o) => {
243
- if (o.locked) {
244
- lockedTags.push(o);
245
- }
246
- else if (o.selected) {
247
- regularTags.push(o);
248
- }
249
- });
250
- this.tagsList = [...lockedTags, ...regularTags];
251
- }
252
- componentDidLoad() {
253
- // Set up observer to announce changes in selected tags, or removed user-added tags
254
- const observerAnnouncer = new MutationObserver((optionListMutations) => optionListMutations.forEach((mutationRecord) => this.handleChangeAnnouncement(mutationRecord)));
255
- observerAnnouncer.observe(this.el, {
256
- subtree: true,
257
- attributes: true,
258
- attributeFilter: ["selected"],
259
- childList: true,
260
- });
261
- // Set up observer that ensures parent reload
262
- // when children wm-tag-options are removed
263
- const optionListObserver = new MutationObserver((optionListMutations) => optionListMutations.forEach((mutationRecord) => this.handleOptionListChange(mutationRecord)));
264
- optionListObserver.observe(this.el, {
265
- childList: true,
266
- });
267
- // Set up the observer that will handle focus
268
- // when tag list changes
269
- if (!!this.tagAreaEl) {
270
- const tagListObserver = new MutationObserver((tagListMutations) => tagListMutations.forEach((mutationRecord) => this.handleTagListChange(mutationRecord)));
271
- tagListObserver.observe(this.tagAreaEl, {
272
- childList: true,
273
- });
274
- }
275
- }
276
- handleChangeAnnouncement(mutationRecord) {
277
- const tagOptionEl = mutationRecord.target;
278
- if (mutationRecord.type == "childList" && mutationRecord.removedNodes.length > 0) {
279
- // announce deselection of user-added tag, whose element removal is picked up
280
- this.announce(this.tagRemovedMessage(mutationRecord.removedNodes[0].textContent));
281
- }
282
- else if (mutationRecord.type == "attributes") {
283
- const tagName = this.getTagName(tagOptionEl);
284
- // announce selection or deselection of all kinds of tags
285
- if (tagOptionEl.selected) {
286
- let changeAnnouncement = this.tagAddedMessage(tagName);
287
- if (this.tagLimitReached) {
288
- changeAnnouncement += ` ${this.maxTagsReachedMessage}`;
289
- }
290
- this.announce(changeAnnouncement);
291
- }
292
- else {
293
- this.announce(this.tagRemovedMessage(tagName));
294
- }
295
- }
296
- }
297
- handleOptionListChange(record) {
298
- const addedNodes = Array.from(record.addedNodes);
299
- if (addedNodes.length > 0) {
300
- addedNodes.forEach((n) => !this.tagsList.includes(n) && this.tagsList.push(n));
301
- }
302
- const removedNodes = Array.from(record.removedNodes);
303
- if (removedNodes.length > 0) {
304
- this.tagsList = this.tagsList.filter((t) => !removedNodes.includes(t));
305
- }
306
- }
307
- handleTagOptionSelected(ev) {
308
- const selOption = ev.target;
309
- this.tagsList = this.tagsList.concat(selOption);
310
- }
311
- handleTagOptionDeselected(ev) {
312
- const deselOption = ev.target;
313
- this.tagsList = this.tagsList.filter((t) => t != deselOption);
314
- }
315
- handleTagListChange(mutationRecord) {
316
- const addedTags = Array.from(mutationRecord.addedNodes);
317
- if (!!addedTags) {
318
- addedTags.forEach((t) => {
319
- t.classList.add("highlight");
320
- });
321
- }
322
- // there are 2 cases: the option still exists but is no longer selected,
323
- // or it was removed altogether
324
- const removedTag = mutationRecord.removedNodes[0];
325
- if (!!removedTag) {
326
- removedTag.classList.remove("highlight");
327
- // this is a trick. focusedTag gets the ref from an index. When an element
328
- // is removed it will fall back on the new element with that index if it exists
329
- if (this.focusedTag) {
330
- this.focusTag(this.focusedTag);
331
- }
332
- else if (this._tagEls.length > 0) {
333
- // Otherwise the last tag was deleted and we reassign to the new last tag.
334
- const tagToFocus = this._tagEls[this._tagEls.length - 1];
335
- this.focusTag(tagToFocus);
336
- }
337
- else {
338
- // unless there are no more tags...
339
- this.inputEl.focus();
340
- }
341
- }
342
- }
343
- componentDidRender() {
344
- this.positionInput();
345
- // check each tag if truncation is needed
346
- this._tagEls.forEach((tag) => {
347
- const textEl = tag.querySelector(".tag-text");
348
- const wrapper = this.el.shadowRoot.querySelector(".tags-and-input-wrapper");
349
- const leftBound = textEl.getBoundingClientRect().left;
350
- // the numbers represent spacing values for padding, margin, and delete icon
351
- const rightBound = wrapper.getBoundingClientRect().right - 10 - 8 - 28;
352
- const id = tag.id.replace("tag-", "");
353
- const optionEl = id && this.el.querySelector("#" + id);
354
- if (optionEl) {
355
- // tag text for table variant is first column text
356
- textEl.textContent = truncateText(textEl, this.getTagName(optionEl), rightBound - leftBound, 5);
357
- }
358
- });
359
- }
360
- createPlaceholderDefault(addNew, hasOptions) {
361
- const addAndSearchPlaceholder = intl.formatMessage({
362
- id: "tagInput.placeholderAddAndSearch",
363
- defaultMessage: "Add or search for a tag",
364
- description: "Placeholder text. Use imperative",
365
- });
366
- const searchPlaceholder = intl.formatMessage({
367
- id: "tagInput.placeholderSearch",
368
- defaultMessage: "Search and select a tag",
369
- description: "Placeholder text. Use imperative",
370
- });
371
- const addPlaceholder = intl.formatMessage({
372
- id: "tagInput.placeholderAdd",
373
- defaultMessage: "Add a new tag",
374
- description: "Placeholder text. Use imperative",
375
- });
376
- let placeholder = "";
377
- if (addNew && hasOptions) {
378
- placeholder = addAndSearchPlaceholder;
379
- }
380
- else if (!addNew && hasOptions) {
381
- placeholder = searchPlaceholder;
382
- }
383
- else if (addNew) {
384
- placeholder = addPlaceholder;
385
- }
386
- return placeholder;
387
- }
388
- handleClick(ev) {
389
- const el = ev.target;
390
- if (this.isDropdown && !this.el.contains(el) && this.isExpanded) {
391
- this.closeDropdown();
392
- }
393
- }
394
- announceError() {
395
- if (this.errorMessage) {
396
- setTimeout(() => this.announce(this.errorMessage), 100);
397
- }
398
- }
399
- handleOptionClick(ev) {
400
- ev.preventDefault();
401
- this.resetInput();
402
- let option;
403
- if (this.isTable) {
404
- option = ev.target;
405
- option = this.tagOptionFromEl(option.closest("tr"));
406
- }
407
- else {
408
- option = this.tagOptionFromEl(ev.target);
409
- }
410
- // if someone wants to attach a click event listener on wm-tag-option
411
- option.click();
412
- if (option.locked) {
413
- this.announce(this.tagLockedMessage(this.getTagName(option)));
414
- }
415
- else {
416
- option.selected
417
- ? this.isTable && option.emitDeselectedEvent() // dropdown doesn't deselect on option click
418
- : option.emitSelectedEvent();
419
- }
420
- }
421
- // From wm-button
422
- // we need to listen for scroll events during the capture phase because they do not bubble up
423
- // there can be layouts where the main content has 100vh and overflows
424
- // in these cases window will register no scroll events unless we catch on they way down
425
- dismissTooltip() {
426
- if (this.tooltipVisible) {
427
- hideTooltip();
428
- }
429
- }
430
- handleInputKeyDown(ev) {
431
- if (/^.$/.test(ev.key) && this.charCount >= this.characterLimit) {
432
- this.announce(this.generateCharacterLimitWarning(this.charCount, this.characterLimit));
433
- }
434
- switch (ev.key) {
435
- case "Enter":
436
- ev.preventDefault();
437
- this.handleInputEnter();
438
- break;
439
- case "ArrowDown":
440
- ev.preventDefault();
441
- this.handleInputArrowDown();
442
- break;
443
- case "ArrowUp":
444
- ev.preventDefault();
445
- this.handleInputArrowUp();
446
- break;
447
- case "ArrowLeft":
448
- if (this.isTable) {
449
- ev.preventDefault();
450
- this.focusPrevCell();
451
- }
452
- break;
453
- case "ArrowRight":
454
- if (this.isTable) {
455
- ev.preventDefault();
456
- this.focusNextCell();
457
- }
458
- break;
459
- case "Escape":
460
- if (this.isDropdown && this.isExpanded) {
461
- ev.preventDefault();
462
- this.closeDropdown();
463
- }
464
- break;
465
- case "ArrowLeft":
466
- case "Backspace":
467
- this.handleInputBackspace();
468
- break;
469
- }
470
- }
471
- handleInputFocus() {
472
- if (this.isDropdown) {
473
- this.openDropdown();
474
- this.clearOptionFocus();
475
- }
476
- }
477
- handleInputChanged(ev) {
478
- this.clearOptionFocus();
479
- if (this.isDropdown) {
480
- if (this.charCount >= this.characterLimit - 5) {
481
- this.announce(this.generateCharacterLimitWarning(this.charCount, this.characterLimit));
482
- }
483
- if (!this.isExpanded) {
484
- this.openDropdown();
485
- }
486
- }
487
- const val = ev.target.value;
488
- if (val.includes(",") && this.addNew) {
489
- this.addTags(val);
490
- }
491
- else {
492
- this.announceExistingOptions();
493
- }
494
- }
495
- handleInputEnter() {
496
- // user has selected an option in the list
497
- if (this.focusedOption) {
498
- if (this.focusedOption.locked) {
499
- this.announce(this.tagLockedMessage(this.getTagName(this.focusedOption)));
500
- }
501
- else {
502
- this.focusedOption.click();
503
- this.focusedOption.selected
504
- ? this.isTable && this.focusedOption.emitDeselectedEvent()
505
- : this.focusedOption.emitSelectedEvent();
506
- this.resetInput();
507
- }
508
- }
509
- else if (this.isDropdown) {
510
- // user is adding a new tag
511
- const tagName = this.inputEl.value;
512
- if (!!tagName) {
513
- this.isExistingTag(tagName) ? this.announce(this.tagAlreadyAddedMessage(tagName)) : this.addTags(tagName);
514
- this.resetInput();
515
- }
516
- }
517
- }
518
- handleInputArrowDown() {
519
- if (this.isDropdown) {
520
- if (!this.isExpanded) {
521
- this.openDropdown();
522
- }
523
- else {
524
- let items = [];
525
- // 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)
526
- if (this.addNewButton && this.addNewButton.id === "add-new-btn") {
527
- items.push(this.addNewButton);
528
- }
529
- this.filteredOptionEls.forEach((o) => {
530
- items.push(this.elFromTagOption(o));
531
- });
532
- const next = findNext(items, this._focusedOption, true);
533
- this.focusOption(next);
534
- }
535
- }
536
- else {
537
- const items = this.filteredOptionEls.map((o) => this.elFromTagOption(o));
538
- const next = findNext(items, this._focusedOption, true);
539
- this.focusOption(next);
540
- }
541
- }
542
- handleInputArrowUp() {
543
- if (this.isDropdown) {
544
- if (!this.isExpanded) {
545
- this.openDropdown();
546
- }
547
- else {
548
- let items = [];
549
- if (this.addNewButton) {
550
- items.push(this.addNewButton);
551
- }
552
- this.filteredOptionEls.forEach((o) => {
553
- items.push(this.elFromTagOption(o));
554
- });
555
- const prev = findPrev(items, this._focusedOption, true);
556
- this.focusOption(prev);
557
- }
558
- }
559
- else {
560
- const items = this.filteredOptionEls.map((o) => this.elFromTagOption(o));
561
- const prev = findPrev(items, this._focusedOption, true);
562
- this.focusOption(prev);
563
- }
564
- }
565
- handleInputBackspace() {
566
- if (this.inputEl.value === "" && this._tagEls.length > 0) {
567
- this.isKeying = true;
568
- // wait for events to finish firing before redirecting focus
569
- // prevents double input in input area and tag area
570
- window.requestAnimationFrame(() => {
571
- this.tagAreaEl.focus();
572
- this.focusTag(this._tagEls[this._tagEls.length - 1]);
573
- });
574
- }
575
- }
576
- handleTagAreaKeyDown(ev) {
577
- switch (ev.key) {
578
- case "ArrowLeft":
579
- case "ArrowUp":
580
- ev.preventDefault();
581
- if (this.focusedTag) {
582
- const prev = findPrev(this._tagEls, this.focusedTag, true);
583
- this.focusTag(prev);
584
- }
585
- break;
586
- case "ArrowRight":
587
- case "ArrowDown":
588
- ev.preventDefault();
589
- if (this.focusedTag) {
590
- const next = findNext(this._tagEls, this.focusedTag, true);
591
- this.focusTag(next);
592
- }
593
- break;
594
- case "Backspace":
595
- case "Delete":
596
- if (this.focusedTag) {
597
- const option = this.tagOptionFromTag(this.focusedTag);
598
- if (option.locked) {
599
- this.announce(this.tagLockedMessage(this.getTagName(option)));
600
- }
601
- else {
602
- option.emitDeselectedEvent();
603
- }
604
- }
605
- break;
606
- }
607
- }
608
- handleBlur(ev) {
609
- this.dismissTooltip();
610
- this.clearOptionFocus();
611
- const relTarget = ev.relatedTarget;
612
- if (!this.isElOrChild(relTarget)) {
613
- this.fieldWrapperEl.classList.remove("focused");
614
- if (this.isDropdown) {
615
- this.closeDropdown();
616
- }
617
- }
618
- }
619
- handleTagAreaFocus(ev) {
620
- if (this.isDropdown) {
621
- this.closeDropdown();
622
- }
623
- if (this._tagEls.length > 0) {
624
- const relTarget = ev.relatedTarget;
625
- if (relTarget && relTarget.id === "input") {
626
- const lastFocusableTag = this._tagEls[this._tagEls.length - 1];
627
- this.focusTag(lastFocusableTag);
628
- }
629
- else {
630
- const firstFocusableTag = this._tagEls[0];
631
- this.focusTag(firstFocusableTag);
632
- }
633
- }
634
- }
635
- focusPrevCell() {
636
- if (this.focusedOption) {
637
- if (this.focusedColumn > 0) {
638
- this.focusedColumn -= 1;
639
- }
640
- }
641
- }
642
- focusNextCell() {
643
- if (this._focusedOption) {
644
- const lastCellIdx = this._focusedOption.querySelectorAll("td").length - 1;
645
- if (this.focusedColumn < lastCellIdx) {
646
- this.focusedColumn += 1;
647
- }
648
- }
649
- }
650
- focusOption(optionToFocus) {
651
- if (optionToFocus) {
652
- // will be undefined for the "Add New" button
653
- this.focusedOption = this.tagOptionFromEl(optionToFocus);
654
- if (optionToFocus === this.addNewButton) {
655
- this.addNewButton.classList.add("focused");
656
- }
657
- else {
658
- this.addNewButton && this.addNewButton.classList.remove("focused");
659
- }
660
- if (this.isTable) {
661
- // tooltip
662
- const contentWrapper = this._focusedOption.querySelector(".cell-content-wrapper");
663
- const isTruncated = contentWrapper.scrollWidth > contentWrapper.clientWidth;
664
- this.dismissTooltip();
665
- if (isTruncated) {
666
- // innerText is necessary vs textContent, as innerText ignores sr-only / display: none text
667
- showTooltip("bottom", this._focusedOption, this._focusedOption.innerText);
668
- }
669
- }
670
- optionToFocus.scrollIntoView({ block: "nearest" });
671
- }
672
- }
673
- showTooltipIfTruncated(el) {
674
- const displayedText = el.querySelector(".tag-text").textContent;
675
- const id = el.id.replace("tag-", "");
676
- if (id) {
677
- const tagEl = this.el.querySelector("#" + id);
678
- const fullText = this.getTagName(tagEl);
679
- if (displayedText !== fullText && displayedText.includes("...")) {
680
- showTooltip("bottom", el, fullText);
681
- }
682
- }
683
- }
684
- focusTag(element) {
685
- // technically it's the tag area that has focus. This function handles the aria-activedescendant value within that parent
686
- this.focusedTagIndex = this._tagEls.indexOf(element);
687
- element.scrollIntoView({ block: "nearest" });
688
- window.requestAnimationFrame(() => {
689
- hideTooltip();
690
- this.showTooltipIfTruncated(element);
691
- });
692
- }
693
- clearOptionFocus() {
694
- this.focusedOption = undefined;
695
- this.focusedColumn = 0;
696
- }
697
- openDropdown() {
698
- // offset of -2px to avoid overlapping the focus border
699
- this.openUp = shouldOpenUp(this.el, this.dropdownEl.clientHeight, this.el.clientHeight, -2);
700
- this.isExpanded = true;
701
- }
702
- closeDropdown() {
703
- this.clearOptionFocus();
704
- this.isExpanded = false;
705
- }
706
- resetInput() {
707
- this.inputEl.value = "";
708
- }
709
- announce(message) {
710
- // \u00A0 is a non-breaking space character, which causes the message to be read as a new one
711
- if (this.liveRegionEl.textContent === message) {
712
- message += "\u00A0";
713
- }
714
- this.liveRegionMessage = message;
715
- }
716
- addTags(tagNames) {
717
- // covers both typing "," and pasting in text that includes ","
718
- // if tag added without "," (typing enter), split puts the whole string in an array
719
- const addedTags = tagNames.split(",").filter((t) => t.match(/\S/));
720
- addedTags.forEach((tag) => {
721
- this.wmTagInputTagAdded.emit(tag);
722
- });
723
- this.announce(this.tagAddedMessage(addedTags.join(", ")));
724
- this.resetInput();
725
- }
726
- announceExistingOptions() {
727
- // request animation frame to wait for re-rendering of filtered options
728
- window.requestAnimationFrame(() => {
729
- const numResults = this.filteredOptionEls.length;
730
- const existingOptionsMessage = intl.formatMessage({
731
- id: "tagInput.existingOptions",
732
- defaultMessage: "{num, plural, one {1 existing option.} other {# existing options.}}",
733
- }, { num: numResults });
734
- this.announce(existingOptionsMessage);
735
- });
736
- }
737
- generateCharacterLimitWarning(charCount, charLimit) {
738
- let message = globalMessages.getCharactersEntered(charCount, charLimit);
739
- if (charCount >= charLimit) {
740
- message += ` ${globalMessages.characterLimitReached}`;
741
- }
742
- return message;
743
- }
744
- positionInput() {
745
- if (this.tagAreaEl) {
746
- const lastTag = this._tagEls[this._tagEls.length - 1];
747
- // default placement to fall back to when no tags are present, or not enough space is available
748
- this.inputEl.style.position = "static";
749
- this.inputEl.style.width = "100%";
750
- this.inputEl.classList.add("extended");
751
- if (lastTag) {
752
- const spaceAvailable = this.tagAreaEl.getBoundingClientRect().right - lastTag.getBoundingClientRect().right;
753
- if (spaceAvailable >= this.inputMinimumWidth) {
754
- // because the input has right: 0px
755
- // all thats needed to properly place it is setting position: absolute, top, and width
756
- this.inputEl.style.position = "absolute";
757
- this.inputEl.style.top = lastTag.offsetTop.toString() + "px";
758
- this.inputEl.style.width = (spaceAvailable - 8).toString() + "px";
759
- this.inputEl.classList.remove("extended");
760
- }
761
- }
762
- }
763
- }
764
- handleTagMouseEnter(ev) {
765
- this.showTooltipIfTruncated(ev.target);
766
- }
767
- renderDropdown() {
768
- 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)))));
769
- }
770
- renderHelpText() {
771
- if (this.helpText)
772
- return this.helpText;
773
- let helpText = "";
774
- if (this.optionEls.length > 0) {
775
- helpText = this.selectionHelpText;
776
- }
777
- if (this.addNew) {
778
- helpText += " " + this.addNewHelpText;
779
- }
780
- return helpText;
781
- }
782
- renderAddNewButton() {
783
- const inputValue = this.inputEl.value.trim();
784
- const hasNonWhiteSpaceCharacters = this.inputEl.value.match(/\S/);
785
- const optionAlreadyExists = this.isExistingTag(this.inputEl.value.trim());
786
- return (this.addNew &&
787
- hasNonWhiteSpaceCharacters &&
788
- !optionAlreadyExists && (h("li", { ref: (el) => (this.addNewButton = el), id: "add-new-btn", class: "add-new-btn", onClick: () => this.addTags(inputValue) }, this.addNewTagMessage(inputValue))));
789
- }
790
- renderTable() {
791
- return (h("div", { class: "table-wrapper", onScroll: () => this.dismissTooltip() }, h("table", { id: "table", role: "grid", class: `${this.colWidths ? "fixed-widths" : ""}`, "aria-label": this.label, "aria-multiselectable": "true" }, this.renderTableHeaders(), this.filteredOptionEls.length ? (this.filteredOptionEls.map((o) => this.renderTableRow(o))) : (h("div", { class: "no-results" }, this.noResultsMessage)))));
792
- }
793
- renderTableHeaders() {
794
- return (h("tr", { class: "headers", role: "row" }, csvToArray(this.colHeaders).map((header, idx) => {
795
- let overflowRule = "wrap";
796
- if (this.colWrap && csvToArray(this.colWrap)[idx]) {
797
- overflowRule = csvToArray(this.colWrap)[idx];
798
- }
799
- return (h("th", { class: `header-cell ${overflowRule}`, role: "columnheader",
800
- // @ts-ignore
801
- width: this.colWidths ? csvToArray(this.colWidths)[idx] : "" }, header));
802
- })));
803
- }
804
- renderTag(o) {
805
- const focused = this.focusedTag && this.focusedTag.id === "tag-" + o.id ? "focused" : "";
806
- const tagName = this.getTagName(o);
807
- return (h("li", { id: "tag-" + o.id, role: "option", class: `tag ${focused} ${o.locked ? "locked" : ""}`, "aria-describedby": `tag-${o.id}-description`, onMouseEnter: (ev) => this.handleTagMouseEnter(ev), onMouseLeave: hideTooltip }, h("span", { class: "sr-only" }, tagName), h("div", { class: "description", id: `tag-${o.id}-description` }, o.locked ? "locked" : ""), h("span", { class: "tag-text", "aria-hidden": "true" }, tagName), o.locked ? (h("div", { class: "svg-icon svg-locked" })) : (h("button", { class: "icon remove-btn", tabIndex: -1, onClick: () => o.emitDeselectedEvent() }, h("div", { class: "svg-icon svg-close" })))));
808
- }
809
- renderTags() {
810
- return this.tagsList.map((o) => this.renderTag(o));
811
- }
812
- renderTagCounter() {
813
- if (this.maxTags) {
814
- return (h("div", { class: "lower-row" }, h("div", { id: "max-tags" }, this.renderMaxTags())));
815
- }
816
- }
817
- renderMaxTags() {
818
- if (this.helpText) {
819
- return this.helpText;
820
- }
821
- else {
822
- let msg = `${this.tagsAddedMessage}: ${this.taggedOptions.length}/${this.maxTags}`;
823
- if (this.tagLimitReached) {
824
- msg += `- ${this.maxTagsReachedMessage}`;
825
- }
826
- return msg;
827
- }
828
- }
829
- handleCellMouseEnter(ev) {
830
- const cell = ev.target;
831
- const contentWrapper = cell.querySelector(".cell-content-wrapper");
832
- const isTruncated = contentWrapper.scrollWidth > contentWrapper.clientWidth;
833
- if (isTruncated) {
834
- // innerText is necessary vs textContent, as innerText ignores sr-only / display: none text
835
- showTooltip("bottom", cell, cell.innerText);
836
- }
837
- }
838
- renderTableCells(o) {
839
- const colValues = [o.col1, o.col2, o.col3, o.col4].filter((val) => !!val);
840
- return colValues.map((val, idx) => {
841
- const cellId = `${o.id}-col${idx + 1}`;
842
- let overflowRule = "wrap";
843
- if (this.colWrap && csvToArray(this.colWrap)[idx]) {
844
- overflowRule = csvToArray(this.colWrap)[idx];
845
- }
846
- const classes = {
847
- focused: !!this._focusedCell && cellId === this._focusedCell.id,
848
- };
849
- return (h("td", { id: cellId, class: classes, role: "gridcell", "aria-describedby": `${cellId}-description`, "aria-selected": o.selected ? "true" : "false", "aria-readonly": o.locked ? "true" : null, onMouseEnter: (ev) => this.handleCellMouseEnter(ev), onMouseLeave: () => hideTooltip() }, h("div", { class: `cell-content-wrapper ${overflowRule}` }, o.locked && idx == 0 && h("div", { class: "svg-icon svg-locked" }), val), h("div", { class: "description", id: `${cellId}-description` }, o.locked ? globalMessages.locked : "")));
850
- });
851
- }
852
- renderTableRow(o) {
853
- const classes = {
854
- selected: o.selected,
855
- locked: o.locked,
856
- focused: this.focusedOption && o === this.focusedOption ? true : false,
857
- };
858
- return (h("tr", { id: o.id, class: classes, onClick: (ev) => this.handleOptionClick(ev) }, this.renderTableCells(o)));
859
- }
860
- renderListItem(o) {
861
- if (!!this.inputEl) {
862
- const isFocused = this.focusedOption && o === this.focusedOption;
863
- 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));
864
- }
865
- }
866
- render() {
867
- return (h("div", { class: `wrapper label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { class: "label-wrapper" }, h("label", { class: "label", htmlFor: "input" }, this.label, this.requiredField && (h("span", { class: "required", "aria-hidden": "true" }, "*")))), h("div", { class: `field-wrapper ${this.el.shadowRoot.activeElement === this.inputEl ? "focused" : ""} ${this.errorMessage ? "invalid" : ""}`, ref: (el) => (this.fieldWrapperEl = el) }, h("div", { class: "upper-row" }, h("div", { class: "svg-icon svg-search" }), h("div", { class: `tags-and-input-wrapper ${this.inModal ? "in-modal" : ""}` }, h("ul", { ref: (el) => (this.tagAreaEl = el), class: `tag-area ${this.taggedOptions.length === 0 && "empty"} ${this.isKeying ? "user-is-keying" : ""}`, role: "listbox", "aria-activedescendant": this.focusedTag ? this.focusedTag.id : null, "aria-orientation": "horizontal", "aria-label": `${this.label} ${this.tagAreaInstructions}`, tabindex: this._tagEls.length > 0 ? 0 : -1, "aria-describedby": `info max-tags`, onFocus: (ev) => this.handleTagAreaFocus(ev), onBlur: (ev) => {
868
- this.focusedTagIndex = undefined;
869
- this.handleBlur(ev);
870
- }, onKeyDown: (ev) => this.handleTagAreaKeyDown(ev) }, this.renderTags()), h("input", { id: "input", class: "input", role: "combobox", ref: (el) => (this.inputEl = el), autocomplete: "off", "aria-required": this.requiredField ? "true" : null, "aria-controls": this.tagInputType, "aria-describedby": `help-text${this.errorMessage ? " error " : ""} max-tags`, "aria-label": `${this.label} ${this.isDropdown ? globalMessages.getCharacterLimit(this.characterLimit) : ""}`, "aria-expanded": this.isDropdown ? this.isExpanded.toString() : null, "aria-activedescendant": this.inputActiveDescendantId, placeholder: this.placeholder, maxLength: this.isDropdown ? this.characterLimit : undefined, onInput: (ev) => this.handleInputChanged(ev), onBlur: (ev) => {
871
- this.handleBlur(ev);
872
- }, onFocus: () => this.handleInputFocus(), onKeyDown: (ev) => this.handleInputKeyDown(ev) })), this.isDropdown && (h("div", { class: "character-count" }, this.charCount, "/", this.characterLimit))), this.renderTagCounter(), this.isDropdown && this.renderDropdown()), this.info && (h("div", { id: "info", class: "info-text" }, this.info)), h("div", { id: "error" }, this.errorMessage), h("div", { class: "sr-only", "aria-live": "polite", ref: (el) => (this.liveRegionEl = el), "aria-atomic": "true" }, this.liveRegionMessage), this.isTable && this.renderTable()));
873
- }
874
- static get is() { return "wm-tag-input"; }
875
- static get encapsulation() { return "shadow"; }
876
- static get delegatesFocus() { return true; }
877
- static get originalStyleUrls() {
878
- return {
879
- "$": ["wm-tag-input.scss"]
880
- };
881
- }
882
- static get styleUrls() {
883
- return {
884
- "$": ["wm-tag-input.css"]
885
- };
886
- }
887
- static get properties() {
888
- return {
889
- "label": {
890
- "type": "string",
891
- "mutable": false,
892
- "complexType": {
893
- "original": "string",
894
- "resolved": "string",
895
- "references": {}
896
- },
897
- "required": true,
898
- "optional": false,
899
- "docs": {
900
- "tags": [],
901
- "text": ""
902
- },
903
- "attribute": "label",
904
- "reflect": false
905
- },
906
- "errorMessage": {
907
- "type": "string",
908
- "mutable": false,
909
- "complexType": {
910
- "original": "string",
911
- "resolved": "string | undefined",
912
- "references": {}
913
- },
914
- "required": false,
915
- "optional": true,
916
- "docs": {
917
- "tags": [],
918
- "text": ""
919
- },
920
- "attribute": "error-message",
921
- "reflect": false
922
- },
923
- "info": {
924
- "type": "string",
925
- "mutable": false,
926
- "complexType": {
927
- "original": "string",
928
- "resolved": "string | undefined",
929
- "references": {}
930
- },
931
- "required": false,
932
- "optional": true,
933
- "docs": {
934
- "tags": [],
935
- "text": ""
936
- },
937
- "attribute": "info",
938
- "reflect": false
939
- },
940
- "labelPosition": {
941
- "type": "string",
942
- "mutable": false,
943
- "complexType": {
944
- "original": "\"top\" | \"left\" | \"none\"",
945
- "resolved": "\"left\" | \"none\" | \"top\"",
946
- "references": {}
947
- },
948
- "required": false,
949
- "optional": false,
950
- "docs": {
951
- "tags": [],
952
- "text": ""
953
- },
954
- "attribute": "label-position",
955
- "reflect": false,
956
- "defaultValue": "\"top\""
957
- },
958
- "maxTags": {
959
- "type": "number",
960
- "mutable": false,
961
- "complexType": {
962
- "original": "number",
963
- "resolved": "number | undefined",
964
- "references": {}
965
- },
966
- "required": false,
967
- "optional": true,
968
- "docs": {
969
- "tags": [],
970
- "text": ""
971
- },
972
- "attribute": "max-tags",
973
- "reflect": false
974
- },
975
- "placeholder": {
976
- "type": "string",
977
- "mutable": true,
978
- "complexType": {
979
- "original": "string",
980
- "resolved": "string | undefined",
981
- "references": {}
982
- },
983
- "required": false,
984
- "optional": true,
985
- "docs": {
986
- "tags": [],
987
- "text": ""
988
- },
989
- "attribute": "placeholder",
990
- "reflect": false
991
- },
992
- "requiredField": {
993
- "type": "boolean",
994
- "mutable": false,
995
- "complexType": {
996
- "original": "boolean",
997
- "resolved": "boolean",
998
- "references": {}
999
- },
1000
- "required": false,
1001
- "optional": false,
1002
- "docs": {
1003
- "tags": [],
1004
- "text": ""
1005
- },
1006
- "attribute": "required-field",
1007
- "reflect": false,
1008
- "defaultValue": "false"
1009
- },
1010
- "tagInputType": {
1011
- "type": "string",
1012
- "mutable": false,
1013
- "complexType": {
1014
- "original": "\"dropdown\" | \"table\"",
1015
- "resolved": "\"dropdown\" | \"table\"",
1016
- "references": {}
1017
- },
1018
- "required": false,
1019
- "optional": false,
1020
- "docs": {
1021
- "tags": [],
1022
- "text": ""
1023
- },
1024
- "attribute": "tag-input-type",
1025
- "reflect": false,
1026
- "defaultValue": "\"dropdown\""
1027
- },
1028
- "helpText": {
1029
- "type": "string",
1030
- "mutable": false,
1031
- "complexType": {
1032
- "original": "string",
1033
- "resolved": "string | undefined",
1034
- "references": {}
1035
- },
1036
- "required": false,
1037
- "optional": true,
1038
- "docs": {
1039
- "tags": [],
1040
- "text": ""
1041
- },
1042
- "attribute": "help-text",
1043
- "reflect": false
1044
- },
1045
- "addNew": {
1046
- "type": "boolean",
1047
- "mutable": false,
1048
- "complexType": {
1049
- "original": "boolean",
1050
- "resolved": "boolean",
1051
- "references": {}
1052
- },
1053
- "required": false,
1054
- "optional": false,
1055
- "docs": {
1056
- "tags": [],
1057
- "text": ""
1058
- },
1059
- "attribute": "add-new",
1060
- "reflect": false,
1061
- "defaultValue": "true"
1062
- },
1063
- "characterLimit": {
1064
- "type": "number",
1065
- "mutable": false,
1066
- "complexType": {
1067
- "original": "number",
1068
- "resolved": "number",
1069
- "references": {}
1070
- },
1071
- "required": false,
1072
- "optional": false,
1073
- "docs": {
1074
- "tags": [],
1075
- "text": ""
1076
- },
1077
- "attribute": "character-limit",
1078
- "reflect": false,
1079
- "defaultValue": "50"
1080
- },
1081
- "colHeaders": {
1082
- "type": "string",
1083
- "mutable": false,
1084
- "complexType": {
1085
- "original": "string",
1086
- "resolved": "string",
1087
- "references": {}
1088
- },
1089
- "required": true,
1090
- "optional": false,
1091
- "docs": {
1092
- "tags": [],
1093
- "text": ""
1094
- },
1095
- "attribute": "col-headers",
1096
- "reflect": false
1097
- },
1098
- "colWidths": {
1099
- "type": "string",
1100
- "mutable": false,
1101
- "complexType": {
1102
- "original": "string",
1103
- "resolved": "string | undefined",
1104
- "references": {}
1105
- },
1106
- "required": false,
1107
- "optional": true,
1108
- "docs": {
1109
- "tags": [],
1110
- "text": ""
1111
- },
1112
- "attribute": "col-widths",
1113
- "reflect": false
1114
- },
1115
- "colWrap": {
1116
- "type": "string",
1117
- "mutable": false,
1118
- "complexType": {
1119
- "original": "string",
1120
- "resolved": "string | undefined",
1121
- "references": {}
1122
- },
1123
- "required": false,
1124
- "optional": true,
1125
- "docs": {
1126
- "tags": [],
1127
- "text": ""
1128
- },
1129
- "attribute": "col-wrap",
1130
- "reflect": false
1131
- }
1132
- };
1133
- }
1134
- static get states() {
1135
- return {
1136
- "isKeying": {},
1137
- "isExpanded": {},
1138
- "liveRegionMessage": {},
1139
- "focusedOption": {},
1140
- "focusedColumn": {},
1141
- "focusedTagIndex": {},
1142
- "tagsList": {}
1143
- };
1144
- }
1145
- static get events() {
1146
- return [{
1147
- "method": "wmTagInputTagAdded",
1148
- "name": "wmTagInputTagAdded",
1149
- "bubbles": true,
1150
- "cancelable": true,
1151
- "composed": true,
1152
- "docs": {
1153
- "tags": [],
1154
- "text": ""
1155
- },
1156
- "complexType": {
1157
- "original": "any",
1158
- "resolved": "any",
1159
- "references": {}
1160
- }
1161
- }];
1162
- }
1163
- static get elementRef() { return "el"; }
1164
- static get watchers() {
1165
- return [{
1166
- "propName": "errorMessage",
1167
- "methodName": "announceError"
1168
- }];
1169
- }
1170
- static get listeners() {
1171
- return [{
1172
- "name": "wmUserIsKeying",
1173
- "method": "toggleKeyingOn",
1174
- "target": "window",
1175
- "capture": false,
1176
- "passive": false
1177
- }, {
1178
- "name": "wmUserIsTabbing",
1179
- "method": "toggleKeyingOn",
1180
- "target": "window",
1181
- "capture": false,
1182
- "passive": false
1183
- }, {
1184
- "name": "wmUserIsNotKeying",
1185
- "method": "toggleKeyingOff",
1186
- "target": "window",
1187
- "capture": false,
1188
- "passive": false
1189
- }, {
1190
- "name": "wmUserIsNotTabbing",
1191
- "method": "toggleKeyingOff",
1192
- "target": "window",
1193
- "capture": false,
1194
- "passive": false
1195
- }, {
1196
- "name": "privTagOptionSelected",
1197
- "method": "handleTagOptionSelected",
1198
- "target": undefined,
1199
- "capture": false,
1200
- "passive": false
1201
- }, {
1202
- "name": "privTagOptionDeselected",
1203
- "method": "handleTagOptionDeselected",
1204
- "target": undefined,
1205
- "capture": false,
1206
- "passive": false
1207
- }, {
1208
- "name": "click",
1209
- "method": "handleClick",
1210
- "target": "document",
1211
- "capture": false,
1212
- "passive": false
1213
- }, {
1214
- "name": "scroll",
1215
- "method": "dismissTooltip",
1216
- "target": "window",
1217
- "capture": true,
1218
- "passive": true
1219
- }, {
1220
- "name": "blur",
1221
- "method": "handleBlur",
1222
- "target": undefined,
1223
- "capture": false,
1224
- "passive": false
1225
- }];
1226
- }
1227
- }