@watermarkinsights/ripple 0.0.0 → 0.1.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 (580) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -1
  3. package/dist/cjs/app-globals-f836e216.js +103 -0
  4. package/dist/cjs/chartFunctions-608adb05.js +908 -0
  5. package/dist/cjs/{functions-f2333f02.js → functions-b188d5b3.js} +6137 -1590
  6. package/dist/cjs/index-786066a1.js +1880 -0
  7. package/dist/cjs/interfaces-8419be91.js +59 -0
  8. package/dist/cjs/intl-01531391.js +283 -0
  9. package/dist/cjs/loader.cjs.js +7 -14
  10. package/dist/cjs/priv-calendar.cjs.entry.js +608 -0
  11. package/dist/cjs/priv-chart-popover-old.cjs.entry.js +146 -0
  12. package/dist/cjs/priv-chart-popover_2.cjs.entry.js +194 -0
  13. package/dist/cjs/priv-navigator-button.cjs.entry.js +19 -19
  14. package/dist/cjs/priv-navigator-item.cjs.entry.js +24 -23
  15. package/dist/cjs/priv-option-list.cjs.entry.js +391 -0
  16. package/dist/cjs/ripple.cjs.js +25 -0
  17. package/dist/cjs/wm-action-menu_2.cjs.entry.js +471 -302
  18. package/dist/cjs/wm-button.cjs.entry.js +263 -142
  19. package/dist/cjs/wm-chart-bar.cjs.entry.js +441 -0
  20. package/dist/cjs/wm-chart-column.cjs.entry.js +544 -0
  21. package/dist/cjs/wm-chart-slice.cjs.entry.js +17 -12
  22. package/dist/cjs/wm-chart.cjs.entry.js +133 -478
  23. package/dist/cjs/wm-date-range.cjs.entry.js +526 -0
  24. package/dist/cjs/wm-datepicker.cjs.entry.js +285 -224
  25. package/dist/cjs/wm-file-list.cjs.entry.js +23 -0
  26. package/dist/cjs/wm-file.cjs.entry.js +210 -0
  27. package/dist/cjs/wm-flyout.cjs.entry.js +181 -0
  28. package/dist/cjs/wm-input.cjs.entry.js +121 -100
  29. package/dist/cjs/wm-line-chart.cjs.entry.js +541 -0
  30. package/dist/cjs/wm-modal-pss_3.cjs.entry.js +220 -0
  31. package/dist/cjs/wm-modal_3.cjs.entry.js +223 -0
  32. package/dist/cjs/wm-navigation_3.cjs.entry.js +188 -0
  33. package/dist/cjs/wm-navigator.cjs.entry.js +305 -250
  34. package/dist/cjs/wm-nested-select.cjs.entry.js +320 -0
  35. package/dist/cjs/wm-optgroup.cjs.entry.js +74 -0
  36. package/dist/cjs/wm-option_2.cjs.entry.js +517 -465
  37. package/dist/cjs/wm-pagination.cjs.entry.js +218 -165
  38. package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +204 -0
  39. package/dist/cjs/wm-search.cjs.entry.js +182 -217
  40. package/dist/cjs/wm-snackbar.cjs.entry.js +158 -142
  41. package/dist/cjs/wm-tab-item_3.cjs.entry.js +317 -276
  42. package/dist/cjs/wm-tag-input.cjs.entry.js +940 -500
  43. package/dist/cjs/wm-tag-option.cjs.entry.js +43 -0
  44. package/dist/cjs/wm-textarea.cjs.entry.js +94 -0
  45. package/dist/cjs/wm-timepicker.cjs.entry.js +276 -349
  46. package/dist/cjs/wm-toggletip.cjs.entry.js +238 -114
  47. package/dist/cjs/wm-uploader.cjs.entry.js +322 -323
  48. package/dist/cjs/wm-wrapper.cjs.entry.js +12 -12
  49. package/dist/collection/collection-manifest.json +104 -34
  50. package/dist/collection/components/charts/chartFunctions.js +833 -0
  51. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.css +995 -0
  52. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +340 -0
  53. package/dist/collection/components/charts/priv-chart-popover-old/priv-chart-popover-old.css +990 -0
  54. package/dist/collection/components/charts/priv-chart-popover-old/priv-chart-popover-old.js +263 -0
  55. package/dist/collection/components/charts/wm-chart/wm-chart-slice.js +125 -0
  56. package/dist/collection/components/charts/wm-chart/wm-chart.css +1326 -0
  57. package/dist/collection/components/charts/wm-chart/wm-chart.js +422 -0
  58. package/dist/collection/components/charts/wm-chart-bar/wm-chart-bar.css +1116 -0
  59. package/dist/collection/components/charts/wm-chart-bar/wm-chart-bar.js +579 -0
  60. package/dist/collection/components/charts/wm-chart-column/wm-chart-column.css +1169 -0
  61. package/dist/collection/components/charts/wm-chart-column/wm-chart-column.js +688 -0
  62. package/dist/collection/components/charts/wm-chart-legend/wm-chart-legend.css +932 -0
  63. package/dist/collection/components/charts/wm-chart-legend/wm-chart-legend.js +194 -0
  64. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.css +1208 -0
  65. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.js +862 -0
  66. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.css +1326 -0
  67. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +264 -0
  68. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.css +967 -0
  69. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +151 -0
  70. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-slice.js +121 -0
  71. package/dist/collection/components/datepickers/datepicker.css +1137 -0
  72. package/dist/collection/components/datepickers/priv-calendar/priv-calendar.css +1403 -0
  73. package/dist/collection/components/datepickers/priv-calendar/priv-calendar.js +881 -0
  74. package/dist/collection/components/datepickers/wm-date-range.js +870 -0
  75. package/dist/collection/components/datepickers/wm-datepicker.js +579 -0
  76. package/dist/collection/components/selects/priv-option-list/priv-option-list.css +999 -0
  77. package/dist/collection/components/selects/priv-option-list/priv-option-list.js +778 -0
  78. package/dist/collection/components/selects/wm-nested-select/wm-nested-select.css +1259 -0
  79. package/dist/collection/components/selects/wm-nested-select/wm-nested-select.js +626 -0
  80. package/dist/collection/components/selects/wm-optgroup/wm-optgroup.css +909 -0
  81. package/dist/collection/components/selects/wm-optgroup/wm-optgroup.js +258 -0
  82. package/dist/collection/components/selects/wm-option/wm-option.css +1033 -0
  83. package/dist/collection/components/selects/wm-option/wm-option.js +530 -0
  84. package/dist/collection/components/selects/wm-select/wm-select.css +1187 -0
  85. package/dist/collection/components/selects/wm-select/wm-select.js +705 -0
  86. package/dist/collection/components/wm-action-menu/wm-action-menu.css +1614 -50
  87. package/dist/collection/components/wm-action-menu/wm-action-menu.js +605 -387
  88. package/dist/collection/components/wm-button/wm-button.css +1440 -385
  89. package/dist/collection/components/wm-button/wm-button.js +538 -348
  90. package/dist/collection/components/wm-file/wm-file.css +1086 -0
  91. package/dist/collection/components/wm-file/wm-file.js +428 -0
  92. package/dist/collection/components/wm-file-list/wm-file-list.css +899 -0
  93. package/dist/collection/components/wm-file-list/wm-file-list.js +45 -0
  94. package/dist/collection/components/wm-flyout/wm-flyout.css +1117 -0
  95. package/dist/collection/components/wm-flyout/wm-flyout.js +449 -0
  96. package/dist/collection/components/wm-input/wm-input.css +965 -96
  97. package/dist/collection/components/wm-input/wm-input.js +466 -291
  98. package/dist/collection/components/wm-menuitem/wm-menuitem.css +919 -55
  99. package/dist/collection/components/wm-menuitem/wm-menuitem.js +402 -397
  100. package/dist/collection/components/wm-modal/wm-modal-footer.css +871 -28
  101. package/dist/collection/components/wm-modal/wm-modal-footer.js +139 -156
  102. package/dist/collection/components/wm-modal/wm-modal-header.css +864 -16
  103. package/dist/collection/components/wm-modal/wm-modal-header.js +76 -106
  104. package/dist/collection/components/wm-modal/wm-modal.css +921 -93
  105. package/dist/collection/components/wm-modal/wm-modal.js +337 -337
  106. package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.css +931 -0
  107. package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.js +138 -0
  108. package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.css +925 -0
  109. package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.js +82 -0
  110. package/dist/collection/components/wm-modal-pss/wm-modal-pss.css +1007 -0
  111. package/dist/collection/components/wm-modal-pss/wm-modal-pss.js +365 -0
  112. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.css +926 -0
  113. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +119 -0
  114. package/dist/collection/components/wm-navigation/wm-navigation-item.css +935 -0
  115. package/dist/collection/components/wm-navigation/wm-navigation-item.js +98 -0
  116. package/dist/collection/components/wm-navigation/wm-navigation.css +977 -0
  117. package/dist/collection/components/wm-navigation/wm-navigation.js +190 -0
  118. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.css +868 -33
  119. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +83 -94
  120. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.css +876 -25
  121. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +120 -110
  122. package/dist/collection/components/wm-navigator/wm-navigator.css +891 -38
  123. package/dist/collection/components/wm-navigator/wm-navigator.js +491 -456
  124. package/dist/collection/components/wm-pagination/wm-pagination.css +895 -68
  125. package/dist/collection/components/wm-pagination/wm-pagination.js +374 -340
  126. package/dist/collection/components/wm-search/wm-search.css +895 -73
  127. package/dist/collection/components/wm-search/wm-search.js +411 -421
  128. package/dist/collection/components/wm-snackbar/wm-snackbar.css +979 -160
  129. package/dist/collection/components/wm-snackbar/wm-snackbar.js +258 -235
  130. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.css +904 -50
  131. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +162 -198
  132. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.css +922 -29
  133. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +334 -292
  134. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.css +862 -13
  135. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +83 -100
  136. package/dist/collection/components/wm-tag-input/wm-tag-input.css +1212 -200
  137. package/dist/collection/components/wm-tag-input/wm-tag-input.js +1283 -702
  138. package/dist/collection/components/wm-tag-input/wm-tag-option/wm-tag-option.js +243 -0
  139. package/dist/collection/components/wm-textarea/wm-textarea.css +1065 -0
  140. package/dist/collection/components/wm-textarea/wm-textarea.js +319 -0
  141. package/dist/collection/components/wm-timepicker/wm-timepicker.css +962 -168
  142. package/dist/collection/components/wm-timepicker/wm-timepicker.js +539 -553
  143. package/dist/collection/components/wm-toggletip/wm-toggletip.css +1094 -148
  144. package/dist/collection/components/wm-toggletip/wm-toggletip.js +370 -211
  145. package/dist/collection/components/wm-uploader/wm-uploader.css +1756 -438
  146. package/dist/collection/components/wm-uploader/wm-uploader.js +607 -661
  147. package/dist/collection/components/wm-wrapper/wm-wrapper.js +26 -25
  148. package/dist/collection/dev/action-menu.js +18 -0
  149. package/dist/collection/dev/chart-bar.js +423 -0
  150. package/dist/collection/dev/chart-column.js +437 -0
  151. package/dist/collection/dev/chart-small.js +56 -0
  152. package/dist/collection/dev/chart.js +18 -0
  153. package/dist/collection/dev/date-range.js +6 -0
  154. package/dist/collection/dev/datepicker.js +46 -0
  155. package/dist/collection/dev/file-list.js +16 -0
  156. package/dist/collection/dev/file.js +0 -0
  157. package/dist/collection/dev/flyout.js +194 -0
  158. package/dist/collection/dev/input.js +6 -0
  159. package/dist/collection/dev/line-chart.js +45 -0
  160. package/dist/collection/dev/modal.js +48 -0
  161. package/dist/collection/dev/navigation.js +13 -0
  162. package/dist/collection/dev/navigator.js +34 -0
  163. package/dist/collection/dev/nested-select.js +36 -0
  164. package/dist/collection/dev/pagination.js +7 -0
  165. package/dist/collection/dev/progress-monitor.js +0 -0
  166. package/dist/collection/dev/pss-modal.js +8 -0
  167. package/dist/collection/dev/scripts.js +43 -14
  168. package/dist/collection/dev/search.js +72 -0
  169. package/dist/collection/dev/select.js +57 -0
  170. package/dist/collection/dev/snackbar.js +68 -0
  171. package/dist/collection/dev/tabs.js +44 -0
  172. package/dist/collection/dev/tag-input.js +32 -0
  173. package/dist/collection/dev/textarea.js +28 -0
  174. package/dist/collection/dev/timepicker.js +32 -0
  175. package/dist/collection/dev/toggletip.js +9 -0
  176. package/dist/collection/dev/uploader.js +139 -0
  177. package/dist/collection/global/__mocks__/functions.js +2 -1
  178. package/dist/collection/global/functions.js +853 -371
  179. package/dist/collection/global/global.js +88 -28
  180. package/dist/collection/global/interfaces.js +62 -39
  181. package/dist/collection/global/intl.js +274 -0
  182. package/dist/collection/global/services/__mocks__/http-service.js +112 -112
  183. package/dist/collection/global/services/http-service.js +41 -41
  184. package/dist/collection/lang/missing.js +43 -0
  185. package/dist/collection/lang/piglatin.js +11 -3
  186. package/dist/esm/app-globals-d0ca31a6.js +101 -0
  187. package/dist/esm/chartFunctions-4bc77b76.js +883 -0
  188. package/dist/esm/{functions-60034bf7.js → functions-de887809.js} +6110 -1584
  189. package/dist/esm/index-ef50bc01.js +1849 -0
  190. package/dist/esm/interfaces-7e50d034.js +55 -0
  191. package/dist/esm/intl-56b47a7b.js +277 -0
  192. package/dist/esm/loader.js +7 -14
  193. package/dist/esm/priv-calendar.entry.js +604 -0
  194. package/dist/esm/priv-chart-popover-old.entry.js +142 -0
  195. package/dist/esm/priv-chart-popover_2.entry.js +189 -0
  196. package/dist/esm/priv-navigator-button.entry.js +19 -19
  197. package/dist/esm/priv-navigator-item.entry.js +24 -23
  198. package/dist/esm/priv-option-list.entry.js +387 -0
  199. package/dist/esm/ripple.js +20 -0
  200. package/dist/esm/wm-action-menu_2.entry.js +471 -302
  201. package/dist/esm/wm-button.entry.js +263 -142
  202. package/dist/esm/wm-chart-bar.entry.js +437 -0
  203. package/dist/esm/wm-chart-column.entry.js +540 -0
  204. package/dist/esm/wm-chart-slice.entry.js +17 -12
  205. package/dist/esm/wm-chart.entry.js +133 -478
  206. package/dist/esm/wm-date-range.entry.js +522 -0
  207. package/dist/esm/wm-datepicker.entry.js +285 -224
  208. package/dist/esm/wm-file-list.entry.js +19 -0
  209. package/dist/esm/wm-file.entry.js +206 -0
  210. package/dist/esm/wm-flyout.entry.js +177 -0
  211. package/dist/esm/wm-input.entry.js +121 -100
  212. package/dist/esm/wm-line-chart.entry.js +537 -0
  213. package/dist/esm/wm-modal-pss_3.entry.js +214 -0
  214. package/dist/esm/wm-modal_3.entry.js +217 -0
  215. package/dist/esm/wm-navigation_3.entry.js +182 -0
  216. package/dist/esm/wm-navigator.entry.js +305 -250
  217. package/dist/esm/wm-nested-select.entry.js +316 -0
  218. package/dist/esm/wm-optgroup.entry.js +70 -0
  219. package/dist/esm/wm-option_2.entry.js +517 -465
  220. package/dist/esm/wm-pagination.entry.js +218 -165
  221. package/dist/esm/wm-progress-indicator_3.entry.js +198 -0
  222. package/dist/esm/wm-search.entry.js +182 -217
  223. package/dist/esm/wm-snackbar.entry.js +158 -142
  224. package/dist/esm/wm-tab-item_3.entry.js +317 -276
  225. package/dist/esm/wm-tag-input.entry.js +940 -500
  226. package/dist/esm/wm-tag-option.entry.js +39 -0
  227. package/dist/esm/wm-textarea.entry.js +90 -0
  228. package/dist/esm/wm-timepicker.entry.js +276 -349
  229. package/dist/esm/wm-toggletip.entry.js +238 -114
  230. package/dist/esm/wm-uploader.entry.js +322 -323
  231. package/dist/esm/wm-wrapper.entry.js +12 -12
  232. package/dist/esm-es5/app-globals-d0ca31a6.js +1 -0
  233. package/dist/esm-es5/chartFunctions-4bc77b76.js +1 -0
  234. package/dist/esm-es5/functions-de887809.js +1 -0
  235. package/dist/esm-es5/index-ef50bc01.js +1 -0
  236. package/dist/esm-es5/index.js +0 -0
  237. package/dist/esm-es5/interfaces-7e50d034.js +1 -0
  238. package/dist/esm-es5/intl-56b47a7b.js +1 -0
  239. package/dist/esm-es5/loader.js +1 -0
  240. package/dist/esm-es5/priv-calendar.entry.js +1 -0
  241. package/dist/esm-es5/priv-chart-popover-old.entry.js +1 -0
  242. package/dist/esm-es5/priv-chart-popover_2.entry.js +1 -0
  243. package/dist/esm-es5/priv-navigator-button.entry.js +1 -0
  244. package/dist/esm-es5/priv-navigator-item.entry.js +1 -0
  245. package/dist/esm-es5/priv-option-list.entry.js +1 -0
  246. package/dist/esm-es5/ripple.js +1 -0
  247. package/dist/esm-es5/wm-action-menu_2.entry.js +1 -0
  248. package/dist/esm-es5/wm-button.entry.js +1 -0
  249. package/dist/esm-es5/wm-chart-bar.entry.js +1 -0
  250. package/dist/esm-es5/wm-chart-column.entry.js +1 -0
  251. package/dist/esm-es5/wm-chart-slice.entry.js +1 -0
  252. package/dist/esm-es5/wm-chart.entry.js +1 -0
  253. package/dist/esm-es5/wm-date-range.entry.js +1 -0
  254. package/dist/esm-es5/wm-datepicker.entry.js +1 -0
  255. package/dist/esm-es5/wm-file-list.entry.js +1 -0
  256. package/dist/esm-es5/wm-file.entry.js +1 -0
  257. package/dist/esm-es5/wm-flyout.entry.js +1 -0
  258. package/dist/esm-es5/wm-input.entry.js +1 -0
  259. package/dist/esm-es5/wm-line-chart.entry.js +1 -0
  260. package/dist/esm-es5/wm-modal-pss_3.entry.js +1 -0
  261. package/dist/esm-es5/wm-modal_3.entry.js +1 -0
  262. package/dist/esm-es5/wm-navigation_3.entry.js +1 -0
  263. package/dist/esm-es5/wm-navigator.entry.js +1 -0
  264. package/dist/esm-es5/wm-nested-select.entry.js +1 -0
  265. package/dist/esm-es5/wm-optgroup.entry.js +1 -0
  266. package/dist/esm-es5/wm-option_2.entry.js +1 -0
  267. package/dist/esm-es5/wm-pagination.entry.js +1 -0
  268. package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -0
  269. package/dist/esm-es5/wm-search.entry.js +1 -0
  270. package/dist/esm-es5/wm-snackbar.entry.js +1 -0
  271. package/dist/esm-es5/wm-tab-item_3.entry.js +1 -0
  272. package/dist/esm-es5/wm-tag-input.entry.js +1 -0
  273. package/dist/esm-es5/wm-tag-option.entry.js +1 -0
  274. package/dist/esm-es5/wm-textarea.entry.js +1 -0
  275. package/dist/esm-es5/wm-timepicker.entry.js +1 -0
  276. package/dist/esm-es5/wm-toggletip.entry.js +1 -0
  277. package/dist/esm-es5/wm-uploader.entry.js +1 -0
  278. package/dist/esm-es5/wm-wrapper.entry.js +1 -0
  279. package/dist/index.js +1 -1
  280. package/dist/loader/cdn.js +1 -2
  281. package/dist/loader/index.cjs.js +1 -2
  282. package/dist/loader/index.d.ts +13 -2
  283. package/dist/loader/index.es2017.js +1 -2
  284. package/dist/loader/index.js +1 -2
  285. package/dist/loader/package.json +2 -1
  286. package/dist/ripple/index.esm.js +0 -0
  287. package/dist/ripple/p-03a6850a.entry.js +1 -0
  288. package/dist/ripple/p-0c3162d5.system.entry.js +1 -0
  289. package/dist/ripple/p-0ec71f08.system.entry.js +1 -0
  290. package/dist/ripple/p-1032c0db.system.entry.js +1 -0
  291. package/dist/ripple/p-117c3d78.system.js +2 -0
  292. package/dist/ripple/p-12024d3b.system.entry.js +1 -0
  293. package/dist/ripple/p-13152ac1.system.entry.js +1 -0
  294. package/dist/ripple/p-1318ae67.entry.js +1 -0
  295. package/dist/ripple/p-137bf0c0.system.entry.js +1 -0
  296. package/dist/ripple/p-13bb6faf.entry.js +1 -0
  297. package/dist/ripple/p-16ff8110.entry.js +1 -0
  298. package/dist/ripple/p-1825d519.system.entry.js +1 -0
  299. package/dist/ripple/p-18417851.entry.js +1 -0
  300. package/dist/ripple/p-1c655f6b.entry.js +1 -0
  301. package/dist/ripple/p-1ce77857.system.entry.js +1 -0
  302. package/dist/ripple/p-1d76061a.entry.js +1 -0
  303. package/dist/ripple/p-22b57f73.system.entry.js +1 -0
  304. package/dist/ripple/p-24dfbf1d.system.entry.js +1 -0
  305. package/dist/ripple/p-28996d67.system.entry.js +1 -0
  306. package/dist/ripple/p-30118d12.system.entry.js +1 -0
  307. package/dist/ripple/p-32f3581a.entry.js +1 -0
  308. package/dist/ripple/p-334d8711.system.js +1 -0
  309. package/dist/ripple/p-3c8c5933.js +1 -0
  310. package/dist/ripple/p-436bf381.system.entry.js +1 -0
  311. package/dist/ripple/p-43843597.system.entry.js +1 -0
  312. package/dist/ripple/p-45999149.system.js +1 -0
  313. package/dist/ripple/p-48b596ae.entry.js +1 -0
  314. package/dist/ripple/p-4bab5360.system.js +1 -0
  315. package/dist/ripple/p-4ff0db4d.entry.js +1 -0
  316. package/dist/ripple/p-50ea2036.system.js +1 -0
  317. package/dist/ripple/p-57f1bafd.system.entry.js +1 -0
  318. package/dist/ripple/p-5b0e9165.entry.js +1 -0
  319. package/dist/ripple/p-6266fcbf.system.entry.js +1 -0
  320. package/dist/ripple/p-646e22d3.system.entry.js +1 -0
  321. package/dist/ripple/p-6950e8ed.system.js +1 -0
  322. package/dist/ripple/p-6c6da5db.entry.js +1 -0
  323. package/dist/ripple/p-6d2af8d9.system.entry.js +1 -0
  324. package/dist/ripple/p-6d46f775.system.entry.js +1 -0
  325. package/dist/ripple/p-6de0efee.entry.js +1 -0
  326. package/dist/ripple/p-7833db63.entry.js +1 -0
  327. package/dist/ripple/p-7b7c32af.entry.js +1 -0
  328. package/dist/ripple/p-817aa29c.entry.js +1 -0
  329. package/dist/ripple/p-82c9bd47.entry.js +1 -0
  330. package/dist/ripple/p-8480138d.entry.js +1 -0
  331. package/dist/ripple/p-85ef702d.entry.js +1 -0
  332. package/dist/ripple/p-86bcd942.system.entry.js +1 -0
  333. package/dist/ripple/p-8799bce9.entry.js +1 -0
  334. package/dist/ripple/p-8ac14bb1.system.js +1 -0
  335. package/dist/ripple/p-8dcc8c0c.entry.js +1 -0
  336. package/dist/ripple/p-8fa572a8.entry.js +1 -0
  337. package/dist/ripple/p-904545cc.js +1 -0
  338. package/dist/ripple/p-90cb5d27.system.entry.js +1 -0
  339. package/dist/ripple/p-9202ef69.system.entry.js +1 -0
  340. package/dist/ripple/p-9f971522.system.entry.js +1 -0
  341. package/dist/ripple/p-a5dc49c1.system.entry.js +1 -0
  342. package/dist/ripple/p-a73fb160.system.entry.js +1 -0
  343. package/dist/ripple/p-a9580e7a.system.entry.js +1 -0
  344. package/dist/ripple/p-b04a6351.entry.js +1 -0
  345. package/dist/ripple/p-b09998e1.entry.js +1 -0
  346. package/dist/ripple/p-b3a86ec4.system.entry.js +1 -0
  347. package/dist/ripple/p-b501f06c.entry.js +1 -0
  348. package/dist/ripple/p-b957033b.entry.js +1 -0
  349. package/dist/ripple/p-c2258438.entry.js +1 -0
  350. package/dist/ripple/p-ca3abcc0.system.entry.js +1 -0
  351. package/dist/ripple/p-cc455a6c.system.entry.js +1 -0
  352. package/dist/ripple/p-cda66d45.js +1 -0
  353. package/dist/ripple/p-cde2ca4d.system.entry.js +1 -0
  354. package/dist/ripple/p-cdf9c0e9.entry.js +1 -0
  355. package/dist/ripple/p-d0858afa.js +2 -0
  356. package/dist/ripple/p-d37f8f66.js +1 -0
  357. package/dist/ripple/p-d4ae193e.js +1 -0
  358. package/dist/ripple/p-d4d769a7.system.js +1 -0
  359. package/dist/ripple/p-d6a9000f.system.entry.js +1 -0
  360. package/dist/ripple/p-d6cd9f79.entry.js +1 -0
  361. package/dist/ripple/p-d9e4335e.entry.js +1 -0
  362. package/dist/ripple/p-dadf3ed3.entry.js +1 -0
  363. package/dist/ripple/p-dc3684b5.entry.js +1 -0
  364. package/dist/ripple/p-dca94e24.entry.js +1 -0
  365. package/dist/ripple/p-dcd6acc5.system.entry.js +1 -0
  366. package/dist/ripple/p-dd81e308.entry.js +1 -0
  367. package/dist/ripple/p-e11d9b06.system.entry.js +1 -0
  368. package/dist/ripple/p-e36e71dc.system.entry.js +1 -0
  369. package/dist/ripple/p-e6a81600.entry.js +1 -0
  370. package/dist/ripple/p-ef7d84da.system.entry.js +1 -0
  371. package/dist/ripple/p-f1de3153.entry.js +1 -0
  372. package/dist/ripple/p-f3e84476.system.entry.js +1 -0
  373. package/dist/ripple/p-f4d27fea.system.entry.js +1 -0
  374. package/dist/ripple/p-fcf4bd61.system.entry.js +1 -0
  375. package/dist/ripple/p-fd02c124.entry.js +1 -0
  376. package/dist/ripple/p-ffa20853.entry.js +1 -0
  377. package/dist/ripple/ripple.esm.js +1 -0
  378. package/dist/ripple/ripple.js +127 -0
  379. package/dist/types/components/charts/chartFunctions.d.ts +54 -0
  380. package/dist/types/components/charts/priv-chart-popover/priv-chart-popover.d.ts +35 -0
  381. package/dist/types/components/charts/priv-chart-popover-old/priv-chart-popover-old.d.ts +26 -0
  382. package/dist/types/components/charts/wm-chart/wm-chart-slice.d.ts +11 -0
  383. package/dist/types/components/charts/wm-chart/wm-chart.d.ts +44 -0
  384. package/dist/types/components/charts/wm-chart-bar/wm-chart-bar.d.ts +62 -0
  385. package/dist/types/components/charts/wm-chart-column/wm-chart-column.d.ts +73 -0
  386. package/dist/types/components/charts/wm-chart-legend/wm-chart-legend.d.ts +26 -0
  387. package/dist/types/components/charts/wm-line-chart/wm-line-chart.d.ts +87 -0
  388. package/dist/types/components/charts/wm-progress-monitor/wm-progress-indicator.d.ts +34 -0
  389. package/dist/types/components/charts/wm-progress-monitor/wm-progress-monitor.d.ts +22 -0
  390. package/dist/types/components/charts/wm-progress-monitor/wm-progress-slice.d.ts +10 -0
  391. package/dist/types/components/datepickers/priv-calendar/priv-calendar.d.ts +89 -0
  392. package/dist/types/components/datepickers/wm-date-range.d.ts +73 -0
  393. package/dist/types/components/datepickers/wm-datepicker.d.ts +54 -0
  394. package/dist/types/components/selects/priv-option-list/priv-option-list.d.ts +71 -0
  395. package/dist/types/components/selects/wm-nested-select/wm-nested-select.d.ts +62 -0
  396. package/dist/types/components/selects/wm-optgroup/wm-optgroup.d.ts +21 -0
  397. package/dist/types/components/selects/wm-option/wm-option.d.ts +40 -0
  398. package/dist/types/components/selects/wm-select/wm-select.d.ts +66 -0
  399. package/dist/types/components/wm-action-menu/wm-action-menu.d.ts +54 -40
  400. package/dist/types/components/wm-button/wm-button.d.ts +43 -34
  401. package/dist/types/components/wm-file/wm-file.d.ts +48 -0
  402. package/dist/types/components/wm-file-list/wm-file-list.d.ts +5 -0
  403. package/dist/types/components/wm-flyout/wm-flyout.d.ts +48 -0
  404. package/dist/types/components/wm-input/wm-input.d.ts +50 -28
  405. package/dist/types/components/wm-menuitem/wm-menuitem.d.ts +26 -27
  406. package/dist/types/components/wm-modal/wm-modal-footer.d.ts +12 -13
  407. package/dist/types/components/wm-modal/wm-modal-header.d.ts +8 -10
  408. package/dist/types/components/wm-modal/wm-modal.d.ts +28 -31
  409. package/dist/types/components/wm-modal-pss/wm-modal-pss-footer.d.ts +14 -0
  410. package/dist/types/components/wm-modal-pss/wm-modal-pss-header.d.ts +10 -0
  411. package/dist/types/components/wm-modal-pss/wm-modal-pss.d.ts +35 -0
  412. package/dist/types/components/wm-navigation/wm-navigation-hamburger.d.ts +16 -0
  413. package/dist/types/components/wm-navigation/wm-navigation-item.d.ts +9 -0
  414. package/dist/types/components/wm-navigation/wm-navigation.d.ts +24 -0
  415. package/dist/types/components/wm-navigator/priv-navigator-button/priv-navigator-button.d.ts +6 -7
  416. package/dist/types/components/wm-navigator/priv-navigator-item/priv-navigator-item.d.ts +10 -10
  417. package/dist/types/components/wm-navigator/wm-navigator.d.ts +55 -57
  418. package/dist/types/components/wm-pagination/wm-pagination.d.ts +31 -28
  419. package/dist/types/components/wm-search/wm-search.d.ts +71 -75
  420. package/dist/types/components/wm-snackbar/wm-snackbar.d.ts +27 -28
  421. package/dist/types/components/wm-tabs/wm-tab-item/wm-tab-item.d.ts +30 -31
  422. package/dist/types/components/wm-tabs/wm-tab-list/wm-tab-list.d.ts +32 -48
  423. package/dist/types/components/wm-tabs/wm-tab-panel/wm-tab-panel.d.ts +14 -16
  424. package/dist/types/components/wm-tag-input/wm-tag-input.d.ts +121 -80
  425. package/dist/types/components/wm-tag-input/wm-tag-option/wm-tag-option.d.ts +18 -0
  426. package/dist/types/components/wm-textarea/wm-textarea.d.ts +31 -0
  427. package/dist/types/components/wm-timepicker/wm-timepicker.d.ts +49 -55
  428. package/dist/types/components/wm-toggletip/wm-toggletip.d.ts +36 -23
  429. package/dist/types/components/wm-uploader/wm-uploader.d.ts +64 -72
  430. package/dist/types/components/wm-wrapper/wm-wrapper.d.ts +4 -4
  431. package/dist/types/components.d.ts +1516 -211
  432. package/dist/types/global/__mocks__/functions.d.ts +2 -1
  433. package/dist/types/global/functions.d.ts +67 -11
  434. package/dist/types/global/interfaces.d.ts +152 -23
  435. package/dist/types/global/intl.d.ts +62 -0
  436. package/dist/types/global/services/__mocks__/http-service.d.ts +1 -1
  437. package/dist/types/stencil-public-runtime.d.ts +338 -219
  438. package/package.json +16 -22
  439. package/dist/cjs/app-globals-6b0c6e80.js +0 -110
  440. package/dist/cjs/app-globals-f1dd8fda.js +0 -47
  441. package/dist/cjs/componentlibrary.cjs.js +0 -20
  442. package/dist/cjs/css-shim-a7379e2b.js +0 -6
  443. package/dist/cjs/dom-3e7d9c3b.js +0 -75
  444. package/dist/cjs/functions-65513c61.js +0 -8360
  445. package/dist/cjs/global-6849642d.js +0 -38
  446. package/dist/cjs/http-service-494d81de.js +0 -57
  447. package/dist/cjs/http-service-9e8c4dd5.js +0 -57
  448. package/dist/cjs/index-298ebef1.js +0 -2976
  449. package/dist/cjs/interfaces-a3338581.js +0 -35
  450. package/dist/cjs/interfaces-b2beb752.js +0 -54
  451. package/dist/cjs/priv-chart-popover.cjs.entry.js +0 -89
  452. package/dist/cjs/priv-datepicker.cjs.entry.js +0 -672
  453. package/dist/cjs/shadow-css-09555044.js +0 -391
  454. package/dist/cjs/wm-action-menu.cjs.entry.js +0 -206
  455. package/dist/cjs/wm-menuitem.cjs.entry.js +0 -118
  456. package/dist/cjs/wm-modal-footer.cjs.entry.js +0 -43
  457. package/dist/cjs/wm-modal-header.cjs.entry.js +0 -45
  458. package/dist/cjs/wm-modal.cjs.entry.js +0 -149
  459. package/dist/cjs/wm-network-uploader.cjs.entry.js +0 -431
  460. package/dist/cjs/wm-option.cjs.entry.js +0 -123
  461. package/dist/cjs/wm-select.cjs.entry.js +0 -366
  462. package/dist/cjs/wm-tab-item.cjs.entry.js +0 -82
  463. package/dist/cjs/wm-tab-list.cjs.entry.js +0 -205
  464. package/dist/cjs/wm-tab-panel.cjs.entry.js +0 -42
  465. package/dist/collection/components/wm-chart/priv-chart-popover/priv-chart-popover.css +0 -132
  466. package/dist/collection/components/wm-chart/priv-chart-popover/priv-chart-popover.js +0 -232
  467. package/dist/collection/components/wm-chart/wm-chart-slice.js +0 -64
  468. package/dist/collection/components/wm-chart/wm-chart.css +0 -337
  469. package/dist/collection/components/wm-chart/wm-chart.js +0 -710
  470. package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.css +0 -365
  471. package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.js +0 -1003
  472. package/dist/collection/components/wm-datepicker/wm-datepicker.css +0 -211
  473. package/dist/collection/components/wm-datepicker/wm-datepicker.js +0 -445
  474. package/dist/collection/components/wm-option/wm-option.css +0 -162
  475. package/dist/collection/components/wm-option/wm-option.js +0 -394
  476. package/dist/collection/components/wm-select/wm-select.css +0 -315
  477. package/dist/collection/components/wm-select/wm-select.js +0 -676
  478. package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.css +0 -642
  479. package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.js +0 -753
  480. package/dist/componentlibrary/app-globals-18876ad3.js +0 -45
  481. package/dist/componentlibrary/app-globals-307a1083.js +0 -108
  482. package/dist/componentlibrary/componentlibrary.css +0 -84
  483. package/dist/componentlibrary/componentlibrary.esm.js +0 -1
  484. package/dist/componentlibrary/css-shim-bbdf0cc6.js +0 -4
  485. package/dist/componentlibrary/dom-1f98a75f.js +0 -73
  486. package/dist/componentlibrary/functions-316c1b23.js +0 -8340
  487. package/dist/componentlibrary/http-service-5d037e16.js +0 -52
  488. package/dist/componentlibrary/index-d5997567.js +0 -2938
  489. package/dist/componentlibrary/interfaces-50753346.js +0 -51
  490. package/dist/componentlibrary/p-01bdfed8.js +0 -16
  491. package/dist/componentlibrary/p-0ca70ed4.entry.js +0 -1
  492. package/dist/componentlibrary/p-126bde92.entry.js +0 -1
  493. package/dist/componentlibrary/p-12a67d93.entry.js +0 -1
  494. package/dist/componentlibrary/p-188deaf5.entry.js +0 -1
  495. package/dist/componentlibrary/p-2514df6f.entry.js +0 -1
  496. package/dist/componentlibrary/p-269b8a5f.entry.js +0 -1
  497. package/dist/componentlibrary/p-35e57079.entry.js +0 -1
  498. package/dist/componentlibrary/p-414e20f7.entry.js +0 -1
  499. package/dist/componentlibrary/p-43f1298b.js +0 -1
  500. package/dist/componentlibrary/p-4d387ec6.entry.js +0 -1
  501. package/dist/componentlibrary/p-59ba81d6.entry.js +0 -1
  502. package/dist/componentlibrary/p-5e3cbec8.entry.js +0 -1
  503. package/dist/componentlibrary/p-5e81e830.entry.js +0 -1
  504. package/dist/componentlibrary/p-64ff5040.js +0 -1
  505. package/dist/componentlibrary/p-68a871d3.entry.js +0 -1
  506. package/dist/componentlibrary/p-996a7395.entry.js +0 -1
  507. package/dist/componentlibrary/p-9b460452.entry.js +0 -1
  508. package/dist/componentlibrary/p-a416e410.entry.js +0 -1
  509. package/dist/componentlibrary/p-d550a94f.entry.js +0 -1
  510. package/dist/componentlibrary/p-e4735c23.entry.js +0 -1
  511. package/dist/componentlibrary/p-e725f388.entry.js +0 -1
  512. package/dist/componentlibrary/p-e9532ae5.entry.js +0 -1
  513. package/dist/componentlibrary/p-edf6f848.entry.js +0 -1
  514. package/dist/componentlibrary/p-fd8070fb.js +0 -1
  515. package/dist/componentlibrary/priv-chart-popover.entry.js +0 -85
  516. package/dist/componentlibrary/priv-datepicker.entry.js +0 -668
  517. package/dist/componentlibrary/priv-navigator-button.entry.js +0 -25
  518. package/dist/componentlibrary/priv-navigator-item.entry.js +0 -30
  519. package/dist/componentlibrary/shadow-css-67b66845.js +0 -389
  520. package/dist/componentlibrary/wm-action-menu.entry.js +0 -202
  521. package/dist/componentlibrary/wm-button.entry.js +0 -148
  522. package/dist/componentlibrary/wm-chart-slice.entry.js +0 -18
  523. package/dist/componentlibrary/wm-chart.entry.js +0 -504
  524. package/dist/componentlibrary/wm-datepicker.entry.js +0 -258
  525. package/dist/componentlibrary/wm-input.entry.js +0 -106
  526. package/dist/componentlibrary/wm-menuitem.entry.js +0 -114
  527. package/dist/componentlibrary/wm-modal-footer.entry.js +0 -39
  528. package/dist/componentlibrary/wm-modal-header.entry.js +0 -41
  529. package/dist/componentlibrary/wm-modal.entry.js +0 -145
  530. package/dist/componentlibrary/wm-navigator.entry.js +0 -275
  531. package/dist/componentlibrary/wm-network-uploader.entry.js +0 -427
  532. package/dist/componentlibrary/wm-option.entry.js +0 -119
  533. package/dist/componentlibrary/wm-pagination.entry.js +0 -172
  534. package/dist/componentlibrary/wm-search.entry.js +0 -227
  535. package/dist/componentlibrary/wm-select.entry.js +0 -362
  536. package/dist/componentlibrary/wm-snackbar.entry.js +0 -156
  537. package/dist/componentlibrary/wm-tab-item.entry.js +0 -78
  538. package/dist/componentlibrary/wm-tab-list.entry.js +0 -201
  539. package/dist/componentlibrary/wm-tab-panel.entry.js +0 -38
  540. package/dist/componentlibrary/wm-tag-input.entry.js +0 -509
  541. package/dist/componentlibrary/wm-timepicker.entry.js +0 -382
  542. package/dist/componentlibrary/wm-toggletip.entry.js +0 -124
  543. package/dist/componentlibrary/wm-uploader.entry.js +0 -338
  544. package/dist/componentlibrary/wm-wrapper.entry.js +0 -17
  545. package/dist/esm/app-globals-18876ad3.js +0 -45
  546. package/dist/esm/app-globals-307a1083.js +0 -108
  547. package/dist/esm/componentlibrary.js +0 -18
  548. package/dist/esm/css-shim-bbdf0cc6.js +0 -4
  549. package/dist/esm/dom-1f98a75f.js +0 -73
  550. package/dist/esm/functions-316c1b23.js +0 -8340
  551. package/dist/esm/global-430cb201.js +0 -36
  552. package/dist/esm/http-service-3dc3b3e7.js +0 -52
  553. package/dist/esm/http-service-5d037e16.js +0 -52
  554. package/dist/esm/index-d5997567.js +0 -2938
  555. package/dist/esm/interfaces-2b97fab2.js +0 -32
  556. package/dist/esm/interfaces-50753346.js +0 -51
  557. package/dist/esm/polyfills/css-shim.js +0 -1
  558. package/dist/esm/priv-chart-popover.entry.js +0 -85
  559. package/dist/esm/priv-datepicker.entry.js +0 -668
  560. package/dist/esm/shadow-css-67b66845.js +0 -389
  561. package/dist/esm/wm-action-menu.entry.js +0 -202
  562. package/dist/esm/wm-menuitem.entry.js +0 -114
  563. package/dist/esm/wm-modal-footer.entry.js +0 -39
  564. package/dist/esm/wm-modal-header.entry.js +0 -41
  565. package/dist/esm/wm-modal.entry.js +0 -145
  566. package/dist/esm/wm-network-uploader.entry.js +0 -427
  567. package/dist/esm/wm-option.entry.js +0 -119
  568. package/dist/esm/wm-select.entry.js +0 -362
  569. package/dist/esm/wm-tab-item.entry.js +0 -78
  570. package/dist/esm/wm-tab-list.entry.js +0 -201
  571. package/dist/esm/wm-tab-panel.entry.js +0 -38
  572. package/dist/types/components/wm-chart/priv-chart-popover/priv-chart-popover.d.ts +0 -23
  573. package/dist/types/components/wm-chart/wm-chart-slice.d.ts +0 -8
  574. package/dist/types/components/wm-chart/wm-chart.d.ts +0 -77
  575. package/dist/types/components/wm-datepicker/priv-datepicker/priv-datepicker.d.ts +0 -75
  576. package/dist/types/components/wm-datepicker/wm-datepicker.d.ts +0 -39
  577. package/dist/types/components/wm-option/wm-option.d.ts +0 -28
  578. package/dist/types/components/wm-select/wm-select.d.ts +0 -63
  579. package/dist/types/components/wm-uploader/wm-network-uploader/wm-network-uploader.d.ts +0 -85
  580. /package/dist/{componentlibrary/index.esm.js → collection/dev/button.js} +0 -0
@@ -1,707 +1,1288 @@
1
- import { h, Component, Host, Element, Prop, Listen, State, Event, Watch } from "@stencil/core";
2
- import { generateId, shouldOpenUp, intl } from "../../global/functions";
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";
3
4
  export class TagInput {
4
- constructor() {
5
- this.labelPosition = "top";
6
- this.options = ""; // csv
7
- this.selectedTags = ""; // csv
8
- this.addNew = true;
9
- this.characterLimit = 50;
10
- this.uid = this.el.id ? this.el.id : generateId();
11
- this.openUp = false;
12
- this.isExpanded = false;
13
- this.tagsList = this.csvToArray(this.selectedTags);
14
- this.optionsList = this.csvToArray(this.options);
15
- this.charCount = 0;
16
- this.liveRegionMessage = "";
17
- this.tagAreaInstructions = intl.formatMessage({
18
- id: "tagInput.tagAreaInstructions",
19
- defaultMessage: "tag selection. Press Backspace or Delete to remove a tag.",
20
- });
21
- }
22
- get focusedElement() {
23
- return this.el.shadowRoot.activeElement;
24
- }
25
- get listItemEls() {
26
- return Array.from(this.dropdownEl.querySelectorAll("li"));
27
- }
28
- get tagEls() {
29
- return Array.from(this.tagAreaEl.querySelectorAll(".tag"));
30
- }
31
- get optionEls() {
32
- return Array.from(this.dropdownEl.querySelectorAll(".option"));
33
- }
34
- generateTagAddedMessage(tag) {
35
- return intl.formatMessage({
36
- id: "tagInput.tagAdded",
37
- defaultMessage: "{tagName} added.",
38
- description: "A confirmation for adding a tag.",
39
- }, { tagName: tag });
40
- }
41
- generateTagAlreadyAddedMessage(tag) {
42
- return intl.formatMessage({
43
- id: "tagInput.tagAlreadyAdded",
44
- defaultMessage: "{tagName} has already been added.",
45
- description: "An alert for adding a tag that is already present.",
46
- }, { tagName: tag });
47
- }
48
- componentWillLoad() {
49
- if (!this.placeholder) {
50
- this.placeholder = this.createPlaceholderDefault(this.addNew, !!this.options);
51
- }
52
- if (!this.label) {
53
- console.error("wm-tag-input must have a label property");
54
- }
55
- this.consolidateSelectedTags();
56
- }
57
- componentDidLoad() {
58
- // prevent highlighting of pre-selected tags
59
- this.tagEls.forEach((el) => el.classList.remove("highlight"));
60
- }
61
- consolidateSelectedTags() {
62
- this.tagsList.forEach((tag) => {
63
- if (!this.includesCaseInsensitive(this.optionsList, tag)) {
64
- this.options += `${this.options.length > 0 ? "," : ""}${tag}`;
65
- }
66
- });
67
- this.optionsList = this.csvToArray(this.options);
68
- }
69
- createPlaceholderDefault(addNew, hasOptions) {
70
- const addAndSearchPlaceholder = intl.formatMessage({
71
- id: "tagInput.placeholderAddAndSearch",
72
- defaultMessage: "Add or search for a tag",
73
- });
74
- const searchPlaceholder = intl.formatMessage({
75
- id: "tagInput.placeholderSearch",
76
- defaultMessage: "Search and select a tag",
77
- });
78
- const addPlaceholder = intl.formatMessage({
79
- id: "tagInput.placeholderAdd",
80
- defaultMessage: "Add a new tag",
81
- });
82
- let placeholder = "";
83
- if (addNew && hasOptions) {
84
- placeholder = addAndSearchPlaceholder;
85
- }
86
- else if (!addNew && hasOptions) {
87
- placeholder = searchPlaceholder;
88
- }
89
- else if (addNew) {
90
- placeholder = addPlaceholder;
91
- }
92
- return placeholder;
93
- }
94
- reflectSelectedTags() {
95
- this.selectedTags = this.listToCSV(this.tagsList);
96
- this.wmTagInputChanged.emit({ value: this.tagsList });
97
- }
98
- closeIfNotElOrChild(ev) {
99
- const isntElOrChild = ev.target !== this.el && !this.el.shadowRoot.contains(ev.target);
100
- if (isntElOrChild && this.isExpanded) {
101
- this.closeDropdown();
102
- }
103
- }
104
- handleInputKeyDown(ev) {
105
- if (/^.$/.test(ev.key) && this.inputEl.value.length >= this.characterLimit) {
106
- this.announceCharacterLimitWarning(this.inputEl.value.length, this.characterLimit);
107
- }
108
- // prevent keydown triggering on tag area
109
- ev.stopPropagation();
110
- switch (ev.key) {
111
- case "Enter":
112
- case ",":
113
- ev.preventDefault();
114
- this.submitInput(this.addNew, this.inputEl.value.trim());
115
- break;
116
- case "ArrowDown":
117
- ev.preventDefault();
118
- this.handleInputArrowDown();
119
- break;
120
- case "ArrowUp":
121
- ev.preventDefault();
122
- this.handleInputArrowUp();
123
- break;
124
- case "Escape":
125
- if (this.isExpanded) {
126
- this.closeDropdown();
127
- }
128
- break;
129
- case "ArrowLeft":
130
- case "Backspace":
131
- this.handleInputBackspace();
132
- break;
133
- }
134
- }
135
- handleInputChanged(value) {
136
- this.charCount = value.length;
137
- if (this.charCount >= this.characterLimit - 5) {
138
- this.announceCharacterLimitWarning(this.charCount, this.characterLimit);
139
- }
140
- this.announceExistingOptions();
141
- if (!this.isExpanded) {
142
- this.openDropdown();
143
- }
144
- }
145
- submitInput(canAddNew, value) {
146
- if (canAddNew && value) {
147
- this.tagsList = this.addTag(value);
148
- this.optionsList = this.addOption(value);
149
- this.resetInput();
150
- }
151
- }
152
- handleInputArrowDown() {
153
- if (this.isExpanded) {
154
- this.moveDownListItem();
155
- }
156
- else {
157
- this.openDropdown();
158
- }
159
- }
160
- handleInputArrowUp() {
161
- if (this.isExpanded) {
162
- this.moveUpListItem();
163
- }
164
- else {
165
- this.openDropdown();
166
- }
167
- }
168
- handleInputBackspace() {
169
- if (this.inputEl.value === "" && this.tagsList.length > 0) {
170
- // wait for events to finish firing before redirecting focus
171
- // prevents double input in input area and tag area
172
- window.requestAnimationFrame(() => {
173
- this.tagAreaEl.focus();
174
- this.focusTag(this.tagEls[this.tagEls.length - 1]);
175
- });
176
- }
177
- }
178
- handleListItemKeyDown(ev) {
179
- const typedEvTarget = ev.target;
180
- switch (ev.key) {
181
- case "Enter":
182
- case " ":
183
- ev.preventDefault();
184
- typedEvTarget.click();
185
- break;
186
- case "ArrowDown":
187
- ev.preventDefault();
188
- this.moveDownListItem();
189
- break;
190
- case "ArrowUp":
191
- ev.preventDefault();
192
- this.moveUpListItem();
193
- break;
194
- case "Escape":
195
- if (this.focusedElement !== this.inputEl) {
196
- this.inputEl.focus();
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.debouncedUpdate = debounce(() => forceUpdate(this.el), 30);
37
+ this.label = undefined;
38
+ this.errorMessage = undefined;
39
+ this.info = undefined;
40
+ this.labelPosition = "top";
41
+ this.maxTags = undefined;
42
+ this.placeholder = undefined;
43
+ this.requiredField = false;
44
+ this.tagInputType = "dropdown";
45
+ this.helpText = undefined;
46
+ this.addNew = true;
47
+ this.characterLimit = 50;
48
+ this.colHeaders = undefined;
49
+ this.colWidths = undefined;
50
+ this.colWrap = undefined;
51
+ this.isKeying = false;
52
+ this.isExpanded = false;
53
+ this.liveRegionMessage = "";
54
+ this.focusedOption = undefined;
55
+ this.focusedColumn = 0;
56
+ this.focusedTagIndex = undefined;
57
+ this.tagsList = [];
58
+ }
59
+ addNewTagMessage(newTagName) {
60
+ return intl.formatMessage({
61
+ id: "tagInput.addNewTag",
62
+ defaultMessage: "Add {newTagName}",
63
+ description: "Button text to add a new tag to a list of tags",
64
+ }, { newTagName: newTagName });
65
+ }
66
+ toggleKeyingOn() {
67
+ this.isKeying = true;
68
+ }
69
+ toggleKeyingOff() {
70
+ this.isKeying = false;
71
+ }
72
+ get isDropdown() {
73
+ return this.tagInputType === "dropdown";
74
+ }
75
+ get isTable() {
76
+ return this.tagInputType === "table";
77
+ }
78
+ get charCount() {
79
+ return this.inputEl ? this.inputEl.value.length : 0;
80
+ }
81
+ get tooltipVisible() {
82
+ return document.getElementById("wm-tooltip").classList.contains("show");
83
+ }
84
+ get optionEls() {
85
+ return Array.from(this.el.querySelectorAll("wm-tag-option"));
86
+ }
87
+ // list of options matching user query
88
+ get filteredOptionEls() {
89
+ const query = this.inputEl ? this.inputEl.value.toLowerCase() : "";
90
+ const list = Array.from(this.optionEls).filter((o) => {
91
+ let values = "";
92
+ if (this.isDropdown) {
93
+ values = o.textContent.toLowerCase();
94
+ }
95
+ else if (this.isTable) {
96
+ values = [o.col1, o.col2, o.col3, o.col4].join("").toLowerCase();
97
+ }
98
+ return values.includes(query);
99
+ });
100
+ return list;
101
+ }
102
+ // the ones that should be rendered as tags
103
+ get taggedOptions() {
104
+ return this.optionEls.filter((o) => o.selected || o.locked);
105
+ }
106
+ // for visual stuff (measuring, truncating...)
107
+ get _tagEls() {
108
+ return this.tagAreaEl ? Array.from(this.tagAreaEl.querySelectorAll(".tag")) : [];
109
+ }
110
+ get focusedTag() {
111
+ if (this.focusedTagIndex !== undefined && this.focusedTagIndex >= 0) {
112
+ return this._tagEls[this.focusedTagIndex];
113
+ }
114
+ }
115
+ // get the wm-tag-option, given the internal representation (dropdown li or table tr)
116
+ tagOptionFromEl(el) {
117
+ return el.id === "add-new-btn" ? undefined : this.el.querySelector("#" + el.id);
118
+ }
119
+ // get the wm-tag-option, given the internal representation of a tag
120
+ tagOptionFromTag(el) {
121
+ const id = el.id.replace("tag-", "");
122
+ return this.el.querySelector("#" + id);
123
+ }
124
+ // get the internal representation of a wm-tag-option
125
+ elFromTagOption(el) {
126
+ return this.el.shadowRoot.querySelector("#" + el.id);
127
+ }
128
+ // focusedOption state refers to the wm-tag-option. This gets the corresponding element in the shadow DOM, or the "Add New" button.
129
+ get _focusedOption() {
130
+ if (!!this.focusedOption) {
131
+ return this.elFromTagOption(this.focusedOption);
132
+ }
133
+ else if (this.addNewButton && this.addNewButton.classList.contains("focused")) {
134
+ return this.addNewButton;
135
+ }
136
+ }
137
+ get _focusedCell() {
138
+ if (!!this._focusedOption) {
139
+ const allCells = Array.from(this._focusedOption.querySelectorAll("td"));
140
+ const index = this.focusedColumn || 0;
141
+ return allCells[index];
142
+ }
143
+ }
144
+ get inputActiveDescendantId() {
145
+ if (this._focusedOption) {
146
+ if (this.isTable) {
147
+ const cells = Array.from(this._focusedOption.querySelectorAll("td"));
148
+ return cells[this.focusedColumn].id;
149
+ }
150
+ return this._focusedOption.id;
151
+ }
152
+ return null;
153
+ }
154
+ get tagLimitReached() {
155
+ return !!(this.maxTags && this.taggedOptions.length >= this.maxTags);
156
+ }
157
+ get inputMinimumWidth() {
158
+ if (this._tagEls) {
159
+ // 150px is the minimum width of the input field, or the length of the placeholder text
160
+ const inputElStyles = getComputedStyle(this.inputEl);
161
+ const tagElStyles = getComputedStyle(this._tagEls[this._tagEls.length - 1]);
162
+ const inputElBuffer = [
163
+ inputElStyles.paddingLeft,
164
+ inputElStyles.paddingRight,
165
+ inputElStyles.marginLeft,
166
+ inputElStyles.marginRight,
167
+ tagElStyles.marginRight,
168
+ ].reduce((prev, curr) => prev + parseInt(curr.replace("px", "")), 0);
169
+ const minimumWidth = Math.max(150, measureText(this.inputEl, this.placeholder).width + inputElBuffer);
170
+ return minimumWidth;
197
171
  }
198
172
  else {
199
- this.closeDropdown();
200
- }
201
- break;
202
- }
203
- }
204
- handleListItemClick(ev) {
205
- const typedEvTarget = ev.target;
206
- const tag = typedEvTarget.dataset.option.trim() || "";
207
- if (this.includesCaseInsensitive(this.tagsList, tag)) {
208
- this.announce(this.generateTagAlreadyAddedMessage(tag));
209
- }
210
- else {
211
- this.announce(this.generateTagAddedMessage(tag));
212
- this.resetInput();
213
- this.tagsList = this.addTag(tag);
214
- this.optionsList = this.addOption(tag);
215
- this.focusedListItem = null;
216
- this.inputEl.focus();
217
- }
218
- }
219
- handleTagAreaKeyDown(ev) {
220
- switch (ev.key) {
221
- case "ArrowLeft":
222
- case "ArrowUp":
223
- ev.preventDefault();
224
- this.moveLeftTag();
225
- break;
226
- case "ArrowRight":
227
- case "ArrowDown":
173
+ return 150;
174
+ }
175
+ }
176
+ getTagName(o) {
177
+ // 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)
178
+ return this.isDropdown ? o.textContent : o.col1;
179
+ }
180
+ isExistingTag(tag) {
181
+ const list = this.optionEls.map((o) => this.getTagName(o).toLowerCase());
182
+ return list.includes(tag.toLowerCase());
183
+ }
184
+ tagAddedMessage(tag) {
185
+ return intl.formatMessage({
186
+ id: "tagInput.tagAdded",
187
+ defaultMessage: "{tagName} added.",
188
+ description: "Confirmation for adding a tag UI element to a list of tags.",
189
+ }, { tagName: tag });
190
+ }
191
+ tagRemovedMessage(tag) {
192
+ return intl.formatMessage({
193
+ id: "tagInput.tagRemoved",
194
+ defaultMessage: "{tagName} removed.",
195
+ description: "Confirmation for removing a tag UI element from a list of tags.",
196
+ }, { tagName: tag });
197
+ }
198
+ tagAlreadyAddedMessage(tag) {
199
+ return intl.formatMessage({
200
+ id: "tagInput.tagAlreadyAdded",
201
+ defaultMessage: "{tagName} has already been added.",
202
+ description: "Alert for adding a tag UI element that is already included in the list.",
203
+ }, { tagName: tag });
204
+ }
205
+ tagLockedMessage(tag) {
206
+ return intl.formatMessage({
207
+ id: "tagInput.tagLocked",
208
+ defaultMessage: "{tagName} is locked and cannot be removed.",
209
+ description: "Alert indicating a tag UI element cannot be removed from its list.",
210
+ }, { tagName: tag });
211
+ }
212
+ isElOrChild(el) {
213
+ return el === this.el || this.el.shadowRoot.contains(el) || this.el.contains(el);
214
+ }
215
+ componentWillLoad() {
216
+ if (!this.placeholder) {
217
+ this.placeholder = this.createPlaceholderDefault(this.addNew, this.optionEls.length > 0);
218
+ }
219
+ if (!this.label) {
220
+ console.error("wm-tag-input must have a label property");
221
+ }
222
+ this.el.focus = () => {
223
+ const firstFocusableTag = this._tagEls[0];
224
+ if (firstFocusableTag) {
225
+ this.tagAreaEl.focus();
226
+ this.focusTag(firstFocusableTag);
227
+ }
228
+ else {
229
+ this.inputEl.focus();
230
+ }
231
+ };
232
+ // on resize of component, trigger componentDidRender -> positionInput
233
+ const resizeObserver = new ResizeObserver(() => this.debouncedUpdate());
234
+ resizeObserver.observe(this.el);
235
+ const lockedTags = [];
236
+ const regularTags = [];
237
+ this.optionEls.forEach((o) => {
238
+ if (o.locked) {
239
+ lockedTags.push(o);
240
+ }
241
+ else if (o.selected) {
242
+ regularTags.push(o);
243
+ }
244
+ });
245
+ this.tagsList = [...lockedTags, ...regularTags];
246
+ }
247
+ componentDidLoad() {
248
+ // Set up observer to announce changes in selected tags, or removed user-added tags
249
+ const observerAnnouncer = new MutationObserver((optionListMutations) => optionListMutations.forEach((mutationRecord) => this.handleChangeAnnouncement(mutationRecord)));
250
+ observerAnnouncer.observe(this.el, {
251
+ subtree: true,
252
+ attributes: true,
253
+ attributeFilter: ["selected"],
254
+ childList: true,
255
+ });
256
+ // Set up observer that ensures parent reload
257
+ // when children wm-tag-options are removed
258
+ const optionListObserver = new MutationObserver((optionListMutations) => optionListMutations.forEach((mutationRecord) => this.handleOptionListChange(mutationRecord)));
259
+ optionListObserver.observe(this.el, {
260
+ childList: true,
261
+ });
262
+ // Set up the observer that will handle focus
263
+ // when tag list changes
264
+ if (!!this.tagAreaEl) {
265
+ const tagListObserver = new MutationObserver((tagListMutations) => tagListMutations.forEach((mutationRecord) => this.handleTagListChange(mutationRecord)));
266
+ tagListObserver.observe(this.tagAreaEl, {
267
+ childList: true,
268
+ });
269
+ }
270
+ }
271
+ handleChangeAnnouncement(mutationRecord) {
272
+ const tagOptionEl = mutationRecord.target;
273
+ if (mutationRecord.type == "childList" && mutationRecord.removedNodes.length > 0) {
274
+ // announce deselection of user-added tag, whose element removal is picked up
275
+ this.announce(this.tagRemovedMessage(mutationRecord.removedNodes[0].textContent));
276
+ }
277
+ else if (mutationRecord.type == "attributes") {
278
+ const tagName = this.getTagName(tagOptionEl);
279
+ // announce selection or deselection of all kinds of tags
280
+ if (tagOptionEl.selected) {
281
+ let changeAnnouncement = this.tagAddedMessage(tagName);
282
+ if (this.tagLimitReached) {
283
+ changeAnnouncement += ` ${this.maxTagsReachedMessage}`;
284
+ }
285
+ this.announce(changeAnnouncement);
286
+ }
287
+ else {
288
+ this.announce(this.tagRemovedMessage(tagName));
289
+ }
290
+ }
291
+ }
292
+ handleOptionListChange(record) {
293
+ const addedNodes = Array.from(record.addedNodes);
294
+ if (addedNodes.length > 0) {
295
+ addedNodes.forEach((n) => !this.tagsList.includes(n) && this.tagsList.push(n));
296
+ }
297
+ const removedNodes = Array.from(record.removedNodes);
298
+ if (removedNodes.length > 0) {
299
+ this.tagsList = this.tagsList.filter((t) => !removedNodes.includes(t));
300
+ }
301
+ }
302
+ handleTagOptionSelected(ev) {
303
+ const selOption = ev.target;
304
+ this.tagsList = this.tagsList.concat(selOption);
305
+ }
306
+ handleTagOptionDeselected(ev) {
307
+ const deselOption = ev.target;
308
+ this.tagsList = this.tagsList.filter((t) => t != deselOption);
309
+ }
310
+ handleTagListChange(mutationRecord) {
311
+ const addedTags = Array.from(mutationRecord.addedNodes);
312
+ if (!!addedTags) {
313
+ addedTags.forEach((t) => {
314
+ t.classList.add("highlight");
315
+ });
316
+ }
317
+ // there are 2 cases: the option still exists but is no longer selected,
318
+ // or it was removed altogether
319
+ const removedTag = mutationRecord.removedNodes[0];
320
+ if (!!removedTag) {
321
+ removedTag.classList.remove("highlight");
322
+ // this is a trick. focusedTag gets the ref from an index. When an element
323
+ // is removed it will fall back on the new element with that index if it exists
324
+ if (this.focusedTag) {
325
+ this.focusTag(this.focusedTag);
326
+ }
327
+ else if (this._tagEls.length > 0) {
328
+ // Otherwise the last tag was deleted and we reassign to the new last tag.
329
+ const tagToFocus = this._tagEls[this._tagEls.length - 1];
330
+ this.focusTag(tagToFocus);
331
+ }
332
+ else {
333
+ // unless there are no more tags...
334
+ this.inputEl.focus();
335
+ }
336
+ }
337
+ }
338
+ componentDidRender() {
339
+ this.positionInput();
340
+ // check each tag if truncation is needed
341
+ this._tagEls.forEach((tag) => {
342
+ const textEl = tag.querySelector(".tag-text");
343
+ const wrapper = this.el.shadowRoot.querySelector(".tags-and-input-wrapper");
344
+ const leftBound = textEl.getBoundingClientRect().left;
345
+ // the numbers represent spacing values for padding, margin, and delete icon
346
+ const rightBound = wrapper.getBoundingClientRect().right - 10 - 8 - 28;
347
+ const id = tag.id.replace("tag-", "");
348
+ const optionEl = id && this.el.querySelector("#" + id);
349
+ if (optionEl) {
350
+ // tag text for table variant is first column text
351
+ textEl.textContent = truncateText(textEl, this.getTagName(optionEl), rightBound - leftBound, 5);
352
+ }
353
+ });
354
+ }
355
+ createPlaceholderDefault(addNew, hasOptions) {
356
+ const addAndSearchPlaceholder = intl.formatMessage({
357
+ id: "tagInput.placeholderAddAndSearch",
358
+ defaultMessage: "Add or search for a tag",
359
+ description: "Placeholder text. Use imperative",
360
+ });
361
+ const searchPlaceholder = intl.formatMessage({
362
+ id: "tagInput.placeholderSearch",
363
+ defaultMessage: "Search and select a tag",
364
+ description: "Placeholder text. Use imperative",
365
+ });
366
+ const addPlaceholder = intl.formatMessage({
367
+ id: "tagInput.placeholderAdd",
368
+ defaultMessage: "Add a new tag",
369
+ description: "Placeholder text. Use imperative",
370
+ });
371
+ let placeholder = "";
372
+ if (addNew && hasOptions) {
373
+ placeholder = addAndSearchPlaceholder;
374
+ }
375
+ else if (!addNew && hasOptions) {
376
+ placeholder = searchPlaceholder;
377
+ }
378
+ else if (addNew) {
379
+ placeholder = addPlaceholder;
380
+ }
381
+ return placeholder;
382
+ }
383
+ handleClick(ev) {
384
+ const el = ev.target;
385
+ if (this.isDropdown && !this.el.contains(el) && this.isExpanded) {
386
+ this.closeDropdown();
387
+ }
388
+ }
389
+ announceError() {
390
+ if (this.errorMessage) {
391
+ setTimeout(() => this.announce(this.errorMessage), 100);
392
+ }
393
+ }
394
+ handleOptionClick(ev) {
228
395
  ev.preventDefault();
229
- this.moveRightTag();
230
- break;
231
- case "Backspace":
232
- case "Delete":
233
- this.handleTagAreaDelete();
234
- break;
235
- }
236
- }
237
- handleTagAreaDelete() {
238
- if (this.focusedTag && this.focusedTag.dataset.tag) {
239
- this.removeTag(this.focusedTag.dataset.tag);
240
- if (this.tagsList.length === 0) {
241
- // focus input if no tags are left
242
- this.inputEl.focus();
243
- }
244
- else if (this.focusedTag === this.tagEls[this.tagEls.length - 1]) {
245
- // reassign focus if removing the last tag but there are still tags remaining
246
- this.focusedTag = this.tagEls[this.tagEls.length - 2];
247
- this.focusTag(this.focusedTag);
248
- }
249
- }
250
- }
251
- handleBlur(ev, component) {
252
- const isntElOrChild = ev.relatedTarget !== component && !this.el.shadowRoot.contains(ev.relatedTarget);
253
- if (isntElOrChild) {
254
- this.closeDropdown();
255
- this.fieldWrapperEl.classList.remove("focused");
256
- }
257
- }
258
- handleTagAreaFocus() {
259
- this.closeDropdown();
260
- if (!this.focusedTag) {
261
- this.focusedTag = this.tagEls[0];
262
- }
263
- this.focusTag(this.focusedTag);
264
- }
265
- handleRemoveButtonClick(tag) {
266
- this.moveLeftTag();
267
- this.removeTag(tag);
268
- }
269
- moveDownListItem() {
270
- if (this.listItemEls.length > 0) {
271
- const firstListItem = this.listItemEls[0];
272
- if (!this.focusedListItem) {
273
- this.focusListItem(firstListItem);
274
- }
275
- else if (this.focusedListItem.nextElementSibling) {
276
- this.focusListItem(this.focusedListItem.nextElementSibling);
277
- }
278
- else {
279
- this.focusListItem(firstListItem);
280
- }
281
- }
282
- }
283
- moveUpListItem() {
284
- if (this.listItemEls.length > 0) {
285
- const lastListItem = this.listItemEls[this.listItemEls.length - 1];
286
- if (!this.focusedListItem) {
287
- this.focusListItem(lastListItem);
288
- }
289
- else if (this.focusedListItem.previousElementSibling) {
290
- this.focusListItem(this.focusedListItem.previousElementSibling);
291
- }
292
- else {
293
- this.focusedListItem = null;
294
- this.inputEl.focus();
295
- }
296
- }
297
- }
298
- moveLeftTag() {
299
- const lastTag = this.tagEls[this.tagEls.length - 1];
300
- if (this.focusedTag && this.tagEls.includes(this.focusedTag.previousElementSibling)) {
301
- this.focusedTag = this.focusedTag.previousElementSibling;
302
- }
303
- else {
304
- this.focusedTag = lastTag;
305
- }
306
- this.focusTag(this.focusedTag);
307
- }
308
- moveRightTag() {
309
- const firstTag = this.tagEls[0];
310
- if (this.focusedTag && this.tagEls.includes(this.focusedTag.nextElementSibling)) {
311
- this.focusedTag = this.focusedTag.nextElementSibling;
312
- }
313
- else {
314
- this.focusedTag = firstTag;
315
- }
316
- this.focusTag(this.focusedTag);
317
- }
318
- addOption(option) {
319
- let newOptionsList = this.optionsList;
320
- const optionAlreadyExists = this.includesCaseInsensitive(this.optionsList, option);
321
- if (!optionAlreadyExists) {
322
- newOptionsList = newOptionsList.concat(option);
323
- }
324
- return newOptionsList;
325
- }
326
- removeOption(option) {
327
- this.optionsList = this.filterCaseInsensitive(this.optionsList, option);
328
- }
329
- addTag(tag) {
330
- let newTagsList = this.tagsList;
331
- const tagAlreadyAdded = this.includesCaseInsensitive(this.tagsList, tag);
332
- const tagExistsAsOption = this.optionsList.filter((x) => x.toLowerCase() === tag.toLowerCase())[0];
333
- if (!tagAlreadyAdded) {
334
- this.announce(this.generateTagAddedMessage(tag));
335
- newTagsList = newTagsList.concat(tagExistsAsOption || tag);
336
- }
337
- return newTagsList;
338
- }
339
- removeTag(tag) {
340
- const tagRemovedMessage = intl.formatMessage({ id: "tagInput.tagRemoved", defaultMessage: "{tag} removed" }, { tag: tag });
341
- this.announce(tagRemovedMessage);
342
- this.tagsList = this.filterCaseInsensitive(this.tagsList, tag);
343
- const devOptionsList = this.csvToArray(this.options);
344
- if (this.includesCaseInsensitive(this.optionsList, tag) && !this.includesCaseInsensitive(devOptionsList, tag)) {
345
- this.removeOption(tag);
346
- }
347
- }
348
- focusListItem(item) {
349
- this.focusedListItem = item;
350
- item.focus();
351
- }
352
- focusTag(element) {
353
- this.focusedTag = element;
354
- this.tagAreaEl.setAttribute("aria-activedescendant", this.focusedTag.id);
355
- }
356
- clearTagFocus() {
357
- this.tagAreaEl.removeAttribute("aria-activedescendant");
358
- this.focusedTag = null;
359
- }
360
- openDropdown() {
361
- this.openUp = shouldOpenUp(this.el, this.dropdownEl, this.el.clientHeight);
362
- this.isExpanded = true;
363
- }
364
- closeDropdown() {
365
- this.focusedListItem = null;
366
- this.isExpanded = false;
367
- }
368
- clearListItemFocus() {
369
- this.focusedListItem = null;
370
- this.listItemEls.forEach((el) => {
371
- el.tabIndex = -1;
372
- el.classList.remove("focused");
373
- });
374
- }
375
- resetInput() {
376
- this.charCount = 0;
377
- this.inputEl.value = "";
378
- }
379
- announce(message) {
380
- // \u00A0 is a non-breaking space character, which causes the message to be read as a new one
381
- if (this.liveRegionEl.textContent === message) {
382
- message += "\u00A0";
383
- }
384
- this.liveRegionMessage = message;
385
- }
386
- announceExistingOptions() {
387
- // request animation frame to wait for re-rendering of filtered options
388
- window.requestAnimationFrame(() => {
389
- const existingOptionsMessage = intl.formatMessage({
390
- id: "tagInput.existingOptions",
391
- defaultMessage: "{num, plural, one {1 existing option.} other {# existing options.}}",
392
- }, { num: this.optionEls.length });
393
- if (this.optionEls.length > 0) {
394
- this.announce(existingOptionsMessage);
395
- }
396
- });
397
- }
398
- announceCharacterLimitWarning(charCount, charLimit) {
399
- const charactersEnteredMessage = intl.formatMessage({
400
- id: "tagInput.charactersEntered",
401
- defaultMessage: "{x, number} of {y, number} characters entered.",
402
- }, { x: charCount, y: charLimit });
403
- const characterLimitReachedMessage = intl.formatMessage({
404
- id: "tagInput.characterLimitReached",
405
- defaultMessage: "No additional characters will be entered.",
406
- });
407
- this.announce(`${charactersEnteredMessage}${charCount >= charLimit ? " " + characterLimitReachedMessage : ""}`);
408
- }
409
- /// Helpers
410
- listToCSV(list) {
411
- return list.join(",");
412
- }
413
- csvToArray(csv) {
414
- return csv ? csv.split(/, ?/) : [];
415
- }
416
- includesCaseInsensitive(list, element) {
417
- const lowercaseList = list.map((str) => str.toLowerCase());
418
- return lowercaseList.includes(element.toLowerCase());
419
- }
420
- filterCaseInsensitive(list, element) {
421
- return list.filter((x) => x.toLowerCase() !== element.toLowerCase());
422
- }
423
- sortCaseInsensitive(list) {
424
- // The vanilla .sort method places words that start with capital letters above others (ASCII order)
425
- // so we need to pass in our own compare function to sort case-insensitive
426
- return list.sort((a, b) => {
427
- a = a.toLowerCase();
428
- b = b.toLowerCase();
429
- return a > b ? 1 : a < b ? -1 : 0;
430
- });
431
- }
432
- /// Renders
433
- renderTags() {
434
- return this.tagsList.map((tag, idx) => {
435
- const id = `tag${idx + 1}`;
436
- return (h("li", { id: id, class: `tag highlight ${this.focusedTag && this.focusedTag.id === id ? "focused" : ""}`, "data-tag": tag, role: "option" },
437
- tag,
438
- h("button", { class: "remove-btn", tabIndex: -1, onClick: () => this.handleRemoveButtonClick(tag) })));
439
- });
440
- }
441
- renderListItems(optionsList) {
442
- optionsList = this.sortCaseInsensitive(optionsList);
443
- // filter by input
444
- if (this.inputEl && this.inputEl.value) {
445
- optionsList = this.optionsList.filter((option) => option.toLowerCase().includes(this.inputEl.value.toLowerCase()));
446
- }
447
- return optionsList.map((option, idx) => {
448
- const id = `option${idx + 1}`;
449
- const isFocused = this.focusedListItem && this.focusedListItem.id === id;
450
- const isSelected = this.includesCaseInsensitive(this.tagsList, option);
451
- return (h("li", { class: `option ${isFocused ? "focused" : ""}`, role: "option", id: id, "data-option": option, tabIndex: isFocused ? 0 : -1, "aria-selected": isSelected ? "true" : "false", "aria-disabled": isSelected ? "true" : "false", onKeyDown: (ev) => this.handleListItemKeyDown(ev), onBlur: (ev) => this.handleBlur(ev, this.el), onClick: (ev) => this.handleListItemClick(ev) }, option));
452
- });
453
- }
454
- renderAddNewButton() {
455
- if (this.inputEl.value.length > 0 &&
456
- this.addNew &&
457
- !this.includesCaseInsensitive(this.optionsList, this.inputEl.value)) {
458
- const id = `add-new-btn`;
459
- const isFocused = this.focusedListItem && this.focusedListItem.id === id;
460
- return (h("li", { role: "option", class: `add-new-btn ${isFocused ? "focused" : ""}`, id: id, "data-option": this.inputEl.value, onKeyDown: (ev) => this.handleListItemKeyDown(ev), onBlur: (ev) => this.handleBlur(ev, this.el), onClick: (ev) => this.handleListItemClick(ev), tabIndex: isFocused ? 0 : -1 }, `Add "${this.inputEl.value}"`));
461
- }
462
- else
463
- return "";
464
- }
465
- renderHelpText() {
466
- const helpTextHasOptions = intl.formatMessage({
467
- id: "tagInput.helpTextCanSelect",
468
- defaultMessage: "Search and select a tag.",
469
- });
470
- const helpTextEditable = intl.formatMessage({
471
- id: "tagInput.helpTextEditable",
472
- defaultMessage: "Press the Enter or Comma key to add a new tag.",
473
- });
474
- let helpText = "";
475
- if (this.optionsList.length > 0) {
476
- helpText += helpTextHasOptions;
477
- }
478
- if (this.addNew) {
479
- helpText += " " + helpTextEditable;
480
- }
481
- return helpText;
482
- }
483
- render() {
484
- const isFocused = this.focusedElement &&
485
- (this.focusedElement === this.inputEl ||
486
- this.focusedElement === this.tagAreaEl ||
487
- this.focusedElement.classList.contains("add-new-btn") ||
488
- (this.optionsList.length > 0 && this.listItemEls.includes(this.focusedElement)));
489
- return (h(Host, { id: this.uid },
490
- h("div", { class: `wrapper label-${this.labelPosition}` },
491
- h("div", { class: "label-wrapper" },
492
- h("label", { class: "label", htmlFor: `input${this.uid}` }, this.label)),
493
- h("div", { class: `field-wrapper ${isFocused ? "focused" : ""}`, ref: (el) => (this.fieldWrapperEl = el) },
494
- h("div", { class: "inner-wrapper" },
495
- h("ul", { ref: (el) => (this.tagAreaEl = el), class: "tag-area", role: "listbox", "aria-horizontal": "true", "aria-label": this.tagsList.length > 0 && `${this.label} ${this.tagAreaInstructions}`, tabindex: this.tagsList.length > 0 ? 0 : -1, "aria-describedby": "info", onFocus: () => this.handleTagAreaFocus(), onBlur: (ev) => {
496
- this.clearTagFocus();
497
- this.handleBlur(ev, this.el);
498
- }, onKeyDown: (ev) => this.handleTagAreaKeyDown(ev) },
499
- this.renderTags(),
500
- h("div", { class: "input-wrapper", role: "none" },
501
- h("input", { id: `input${this.uid}`, role: "combobox", ref: (el) => (this.inputEl = el), autocomplete: "off", "aria-controls": "dropdown", "aria-describedby": "help-text", "aria-label": this.label, placeholder: this.placeholder, maxLength: this.characterLimit, onInput: () => this.handleInputChanged(this.inputEl.value), onBlur: (ev) => {
502
- this.handleBlur(ev, this.el);
503
- }, onFocus: () => {
504
- this.openDropdown();
505
- this.clearListItemFocus();
506
- }, onKeyDown: (ev) => this.handleInputKeyDown(ev) })))),
507
- h("div", { class: "character-count" },
508
- this.charCount,
509
- "/",
510
- this.characterLimit),
511
- h("div", { class: `dropdown-wrapper ${this.isExpanded ? "open" : ""} ${this.openUp ? "upwards" : ""}` },
512
- h("div", { id: "help-text", class: "help-text" }, this.renderHelpText()),
513
- h("ul", { class: "dropdown", ref: (el) => (this.dropdownEl = el), id: "dropdown", role: "listbox", "aria-multiselectable": "true", "aria-expanded": this.isExpanded ? "true" : false, "aria-label": this.label, tabindex: -1 },
514
- this.inputEl && this.renderAddNewButton(),
515
- this.renderListItems(this.optionsList)))),
516
- this.info ? (h("div", { id: "info", class: "info-text" }, this.info)) : (""),
517
- h("div", { class: "sr-only", "aria-live": "assertive", ref: (el) => (this.liveRegionEl = el), "aria-atomic": "true" }, this.liveRegionMessage))));
518
- }
519
- static get is() { return "wm-tag-input"; }
520
- static get encapsulation() { return "shadow"; }
521
- static get originalStyleUrls() { return {
522
- "$": ["wm-tag-input.scss"]
523
- }; }
524
- static get styleUrls() { return {
525
- "$": ["wm-tag-input.css"]
526
- }; }
527
- static get properties() { return {
528
- "label": {
529
- "type": "string",
530
- "mutable": false,
531
- "complexType": {
532
- "original": "string",
533
- "resolved": "string",
534
- "references": {}
535
- },
536
- "required": true,
537
- "optional": false,
538
- "docs": {
539
- "tags": [],
540
- "text": ""
541
- },
542
- "attribute": "label",
543
- "reflect": false
544
- },
545
- "labelPosition": {
546
- "type": "string",
547
- "mutable": false,
548
- "complexType": {
549
- "original": "\"top\" | \"left\" | \"none\"",
550
- "resolved": "\"left\" | \"none\" | \"top\"",
551
- "references": {}
552
- },
553
- "required": false,
554
- "optional": false,
555
- "docs": {
556
- "tags": [],
557
- "text": ""
558
- },
559
- "attribute": "label-position",
560
- "reflect": false,
561
- "defaultValue": "\"top\""
562
- },
563
- "options": {
564
- "type": "string",
565
- "mutable": true,
566
- "complexType": {
567
- "original": "string",
568
- "resolved": "string",
569
- "references": {}
570
- },
571
- "required": false,
572
- "optional": false,
573
- "docs": {
574
- "tags": [],
575
- "text": ""
576
- },
577
- "attribute": "options",
578
- "reflect": false,
579
- "defaultValue": "\"\""
580
- },
581
- "selectedTags": {
582
- "type": "string",
583
- "mutable": true,
584
- "complexType": {
585
- "original": "string",
586
- "resolved": "string",
587
- "references": {}
588
- },
589
- "required": false,
590
- "optional": false,
591
- "docs": {
592
- "tags": [],
593
- "text": ""
594
- },
595
- "attribute": "selected-tags",
596
- "reflect": true,
597
- "defaultValue": "\"\""
598
- },
599
- "info": {
600
- "type": "string",
601
- "mutable": false,
602
- "complexType": {
603
- "original": "string",
604
- "resolved": "string | undefined",
605
- "references": {}
606
- },
607
- "required": false,
608
- "optional": true,
609
- "docs": {
610
- "tags": [],
611
- "text": ""
612
- },
613
- "attribute": "info",
614
- "reflect": false
615
- },
616
- "addNew": {
617
- "type": "boolean",
618
- "mutable": false,
619
- "complexType": {
620
- "original": "boolean",
621
- "resolved": "boolean",
622
- "references": {}
623
- },
624
- "required": false,
625
- "optional": false,
626
- "docs": {
627
- "tags": [],
628
- "text": ""
629
- },
630
- "attribute": "add-new",
631
- "reflect": false,
632
- "defaultValue": "true"
633
- },
634
- "placeholder": {
635
- "type": "string",
636
- "mutable": true,
637
- "complexType": {
638
- "original": "string",
639
- "resolved": "string | undefined",
640
- "references": {}
641
- },
642
- "required": false,
643
- "optional": true,
644
- "docs": {
645
- "tags": [],
646
- "text": ""
647
- },
648
- "attribute": "placeholder",
649
- "reflect": false
650
- },
651
- "characterLimit": {
652
- "type": "number",
653
- "mutable": false,
654
- "complexType": {
655
- "original": "number",
656
- "resolved": "number",
657
- "references": {}
658
- },
659
- "required": false,
660
- "optional": false,
661
- "docs": {
662
- "tags": [],
663
- "text": ""
664
- },
665
- "attribute": "character-limit",
666
- "reflect": false,
667
- "defaultValue": "50"
668
- }
669
- }; }
670
- static get states() { return {
671
- "focusedListItem": {},
672
- "focusedTag": {},
673
- "isExpanded": {},
674
- "tagsList": {},
675
- "optionsList": {},
676
- "charCount": {},
677
- "liveRegionMessage": {}
678
- }; }
679
- static get events() { return [{
680
- "method": "wmTagInputChanged",
681
- "name": "wmTagInputChanged",
682
- "bubbles": true,
683
- "cancelable": true,
684
- "composed": true,
685
- "docs": {
686
- "tags": [],
687
- "text": ""
688
- },
689
- "complexType": {
690
- "original": "{ value: string[] }",
691
- "resolved": "{ value: string[]; }",
692
- "references": {}
693
- }
694
- }]; }
695
- static get elementRef() { return "el"; }
696
- static get watchers() { return [{
697
- "propName": "tagsList",
698
- "methodName": "reflectSelectedTags"
699
- }]; }
700
- static get listeners() { return [{
701
- "name": "click",
702
- "method": "closeIfNotElOrChild",
703
- "target": "document",
704
- "capture": false,
705
- "passive": false
706
- }]; }
396
+ this.resetInput();
397
+ let option;
398
+ if (this.isTable) {
399
+ option = ev.target;
400
+ option = this.tagOptionFromEl(option.closest("tr"));
401
+ }
402
+ else {
403
+ option = this.tagOptionFromEl(ev.target);
404
+ }
405
+ // if someone wants to attach a click event listener on wm-tag-option
406
+ option.click();
407
+ if (option.locked) {
408
+ this.announce(this.tagLockedMessage(this.getTagName(option)));
409
+ }
410
+ else {
411
+ option.selected
412
+ ? this.isTable && option.emitDeselectedEvent() // dropdown doesn't deselect on option click
413
+ : option.emitSelectedEvent();
414
+ }
415
+ }
416
+ // From wm-button
417
+ // we need to listen for scroll events during the capture phase because they do not bubble up
418
+ // there can be layouts where the main content has 100vh and overflows
419
+ // in these cases window will register no scroll events unless we catch on they way down
420
+ dismissTooltip() {
421
+ if (this.tooltipVisible) {
422
+ hideTooltip();
423
+ }
424
+ }
425
+ handleInputKeyDown(ev) {
426
+ if (/^.$/.test(ev.key) && this.charCount >= this.characterLimit) {
427
+ this.announce(this.generateCharacterLimitWarning(this.charCount, this.characterLimit));
428
+ }
429
+ switch (ev.key) {
430
+ case "Enter":
431
+ ev.preventDefault();
432
+ this.handleInputEnter();
433
+ break;
434
+ case "ArrowDown":
435
+ ev.preventDefault();
436
+ this.handleInputArrowDown();
437
+ break;
438
+ case "ArrowUp":
439
+ ev.preventDefault();
440
+ this.handleInputArrowUp();
441
+ break;
442
+ case "ArrowLeft":
443
+ if (this.isTable) {
444
+ ev.preventDefault();
445
+ this.focusPrevCell();
446
+ }
447
+ break;
448
+ case "ArrowRight":
449
+ if (this.isTable) {
450
+ ev.preventDefault();
451
+ this.focusNextCell();
452
+ }
453
+ break;
454
+ case "Escape":
455
+ if (this.isDropdown && this.isExpanded) {
456
+ ev.preventDefault();
457
+ ev.stopPropagation();
458
+ this.closeDropdown();
459
+ }
460
+ break;
461
+ case "ArrowLeft":
462
+ case "Backspace":
463
+ this.handleInputBackspace();
464
+ break;
465
+ }
466
+ }
467
+ handleInputFocus() {
468
+ this.clearOptionFocus();
469
+ if (this.isDropdown) {
470
+ this.openDropdown();
471
+ }
472
+ }
473
+ handleInputChanged(ev) {
474
+ this.clearOptionFocus();
475
+ if (this.isDropdown) {
476
+ if (this.charCount >= this.characterLimit - 5) {
477
+ this.announce(this.generateCharacterLimitWarning(this.charCount, this.characterLimit));
478
+ }
479
+ if (!this.isExpanded) {
480
+ this.openDropdown();
481
+ }
482
+ }
483
+ const val = ev.target.value;
484
+ if (val.includes(",") && this.addNew) {
485
+ this.addTags(val);
486
+ }
487
+ else {
488
+ this.announceExistingOptions();
489
+ }
490
+ }
491
+ handleInputEnter() {
492
+ // user has selected an option in the list
493
+ if (this.focusedOption) {
494
+ if (this.focusedOption.locked) {
495
+ this.announce(this.tagLockedMessage(this.getTagName(this.focusedOption)));
496
+ }
497
+ else {
498
+ this.focusedOption.click();
499
+ this.focusedOption.selected
500
+ ? this.isTable && this.focusedOption.emitDeselectedEvent()
501
+ : this.focusedOption.emitSelectedEvent();
502
+ this.resetInput();
503
+ }
504
+ }
505
+ else if (this.isDropdown) {
506
+ // user is adding a new tag
507
+ const tagName = this.inputEl.value;
508
+ if (!!tagName) {
509
+ this.isExistingTag(tagName) ? this.announce(this.tagAlreadyAddedMessage(tagName)) : this.addTags(tagName);
510
+ this.resetInput();
511
+ }
512
+ }
513
+ }
514
+ handleInputArrowDown() {
515
+ if (this.isDropdown) {
516
+ if (!this.isExpanded) {
517
+ this.openDropdown();
518
+ }
519
+ else {
520
+ let items = [];
521
+ // 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)
522
+ if (this.addNewButton && this.addNewButton.id === "add-new-btn") {
523
+ items.push(this.addNewButton);
524
+ }
525
+ this.filteredOptionEls.forEach((o) => {
526
+ items.push(this.elFromTagOption(o));
527
+ });
528
+ const next = findNext(items, this._focusedOption, true);
529
+ this.focusOption(next);
530
+ }
531
+ }
532
+ else {
533
+ const items = this.filteredOptionEls.map((o) => this.elFromTagOption(o));
534
+ const next = findNext(items, this._focusedOption, true);
535
+ this.focusOption(next);
536
+ }
537
+ }
538
+ handleInputArrowUp() {
539
+ if (this.isDropdown) {
540
+ if (!this.isExpanded) {
541
+ this.openDropdown();
542
+ }
543
+ else {
544
+ let items = [];
545
+ if (this.addNewButton) {
546
+ items.push(this.addNewButton);
547
+ }
548
+ this.filteredOptionEls.forEach((o) => {
549
+ items.push(this.elFromTagOption(o));
550
+ });
551
+ const prev = findPrev(items, this._focusedOption, true);
552
+ this.focusOption(prev);
553
+ }
554
+ }
555
+ else {
556
+ const items = this.filteredOptionEls.map((o) => this.elFromTagOption(o));
557
+ const prev = findPrev(items, this._focusedOption, true);
558
+ this.focusOption(prev);
559
+ }
560
+ }
561
+ handleInputBackspace() {
562
+ if (this.inputEl.value === "" && this._tagEls.length > 0) {
563
+ this.isKeying = true;
564
+ // wait for events to finish firing before redirecting focus
565
+ // prevents double input in input area and tag area
566
+ window.requestAnimationFrame(() => {
567
+ this.tagAreaEl.focus();
568
+ this.focusTag(this._tagEls[this._tagEls.length - 1]);
569
+ });
570
+ }
571
+ }
572
+ handleTagAreaKeyDown(ev) {
573
+ switch (ev.key) {
574
+ case "ArrowLeft":
575
+ case "ArrowUp":
576
+ ev.preventDefault();
577
+ if (this.focusedTag) {
578
+ const prev = findPrev(this._tagEls, this.focusedTag, true);
579
+ this.focusTag(prev);
580
+ }
581
+ break;
582
+ case "ArrowRight":
583
+ case "ArrowDown":
584
+ ev.preventDefault();
585
+ if (this.focusedTag) {
586
+ const next = findNext(this._tagEls, this.focusedTag, true);
587
+ this.focusTag(next);
588
+ }
589
+ break;
590
+ case "Backspace":
591
+ case "Delete":
592
+ if (this.focusedTag) {
593
+ const option = this.tagOptionFromTag(this.focusedTag);
594
+ if (option.locked) {
595
+ this.announce(this.tagLockedMessage(this.getTagName(option)));
596
+ }
597
+ else {
598
+ option.emitDeselectedEvent();
599
+ }
600
+ }
601
+ break;
602
+ }
603
+ }
604
+ handleBlur(ev) {
605
+ this.dismissTooltip();
606
+ this.clearOptionFocus();
607
+ const relTarget = ev.relatedTarget;
608
+ if (!this.isElOrChild(relTarget)) {
609
+ this.fieldWrapperEl.classList.remove("focused");
610
+ if (this.isDropdown) {
611
+ this.closeDropdown();
612
+ }
613
+ }
614
+ }
615
+ handleLabelMouseEnter(ev) {
616
+ const labelEl = ev.target;
617
+ if (labelEl.scrollWidth > labelEl.clientWidth) {
618
+ showTooltip("right", ev.target, this.label);
619
+ }
620
+ }
621
+ handleTagAreaFocus(ev) {
622
+ if (this.isDropdown) {
623
+ this.closeDropdown();
624
+ }
625
+ if (this._tagEls.length > 0) {
626
+ const relTarget = ev.relatedTarget;
627
+ if (relTarget && relTarget.id === "input") {
628
+ const lastFocusableTag = this._tagEls[this._tagEls.length - 1];
629
+ this.focusTag(lastFocusableTag);
630
+ }
631
+ else {
632
+ const firstFocusableTag = this._tagEls[0];
633
+ this.focusTag(firstFocusableTag);
634
+ }
635
+ }
636
+ }
637
+ handleTableFocus() {
638
+ // Forward focus to first focusable table row when container receives focus
639
+ // First try filtered options, then fall back to all options
640
+ let targetOptions = this.filteredOptionEls;
641
+ if (targetOptions.length === 0) {
642
+ targetOptions = this.optionEls;
643
+ }
644
+ if (targetOptions.length > 0) {
645
+ const firstOption = targetOptions[0];
646
+ const firstRow = this.elFromTagOption(firstOption);
647
+ if (firstRow) {
648
+ this.focusOption(firstRow);
649
+ return;
650
+ }
651
+ }
652
+ }
653
+ handleTableWrapperKeyDown(ev) {
654
+ // Override browser's default scrolling behavior and delegate to our navigation
655
+ switch (ev.key) {
656
+ case "ArrowDown":
657
+ ev.preventDefault();
658
+ this.handleInputArrowDown();
659
+ break;
660
+ case "ArrowUp":
661
+ ev.preventDefault();
662
+ this.handleInputArrowUp();
663
+ break;
664
+ case "ArrowLeft":
665
+ ev.preventDefault();
666
+ this.focusPrevCell();
667
+ break;
668
+ case "ArrowRight":
669
+ ev.preventDefault();
670
+ this.focusNextCell();
671
+ break;
672
+ case "Enter":
673
+ ev.preventDefault();
674
+ this.handleInputEnter();
675
+ break;
676
+ case "Escape":
677
+ ev.preventDefault();
678
+ ev.stopPropagation();
679
+ // Focus back to input as a safe fallback
680
+ if (this.inputEl) {
681
+ this.inputEl.focus();
682
+ }
683
+ break;
684
+ }
685
+ }
686
+ focusPrevCell() {
687
+ if (this.focusedOption) {
688
+ if (this.focusedColumn > 0) {
689
+ this.focusedColumn -= 1;
690
+ }
691
+ }
692
+ }
693
+ focusNextCell() {
694
+ if (this._focusedOption) {
695
+ const lastCellIdx = this._focusedOption.querySelectorAll("td").length - 1;
696
+ if (this.focusedColumn < lastCellIdx) {
697
+ this.focusedColumn += 1;
698
+ }
699
+ }
700
+ }
701
+ focusOption(optionToFocus) {
702
+ if (optionToFocus) {
703
+ // will be undefined for the "Add New" button
704
+ this.focusedOption = this.tagOptionFromEl(optionToFocus);
705
+ if (optionToFocus === this.addNewButton) {
706
+ this.addNewButton.classList.add("focused");
707
+ }
708
+ else {
709
+ this.addNewButton && this.addNewButton.classList.remove("focused");
710
+ }
711
+ if (this.isTable) {
712
+ // tooltip
713
+ const contentWrapper = this._focusedOption.querySelector(".cell-content-wrapper");
714
+ const isTruncated = contentWrapper.scrollWidth > contentWrapper.clientWidth;
715
+ this.dismissTooltip();
716
+ if (isTruncated) {
717
+ // innerText is necessary vs textContent, as innerText ignores sr-only / display: none text
718
+ showTooltip("bottom", this._focusedOption, this._focusedOption.innerText);
719
+ }
720
+ const tableEl = this.el.shadowRoot.querySelector("#table");
721
+ if (!(this.el.shadowRoot.activeElement == tableEl)) {
722
+ tableEl.focus();
723
+ }
724
+ if (this.filteredOptionEls.length > 0 && this.focusedOption == this.filteredOptionEls[0]) {
725
+ // When the focused option is the first option, scroll to the top of the table so headers are visible
726
+ this.el.shadowRoot.querySelector(".table-wrapper").scrollTop = 0;
727
+ }
728
+ }
729
+ optionToFocus.scrollIntoView({ block: "nearest" });
730
+ }
731
+ }
732
+ showTooltipIfTruncated(el) {
733
+ const displayedText = el.querySelector(".tag-text").textContent;
734
+ const id = el.id.replace("tag-", "");
735
+ if (id) {
736
+ const tagEl = this.el.querySelector("#" + id);
737
+ const fullText = this.getTagName(tagEl);
738
+ if (displayedText !== fullText && displayedText.includes("...")) {
739
+ showTooltip("bottom", el, fullText);
740
+ }
741
+ }
742
+ }
743
+ focusTag(element) {
744
+ // technically it's the tag area that has focus. This function handles the aria-activedescendant value within that parent
745
+ this.focusedTagIndex = this._tagEls.indexOf(element);
746
+ element.scrollIntoView({ block: "nearest" });
747
+ window.requestAnimationFrame(() => {
748
+ hideTooltip();
749
+ this.showTooltipIfTruncated(element);
750
+ });
751
+ }
752
+ clearOptionFocus() {
753
+ this.focusedOption = undefined;
754
+ this.focusedColumn = 0;
755
+ }
756
+ openDropdown() {
757
+ // offset of -2px to avoid overlapping the focus border
758
+ this.openUp = shouldOpenUp(this.el, this.dropdownEl.clientHeight, this.el.clientHeight, -2);
759
+ this.isExpanded = true;
760
+ }
761
+ closeDropdown() {
762
+ this.clearOptionFocus();
763
+ this.isExpanded = false;
764
+ }
765
+ resetInput() {
766
+ this.inputEl.value = "";
767
+ }
768
+ announce(message) {
769
+ // \u00A0 is a non-breaking space character, which causes the message to be read as a new one
770
+ if (this.liveRegionEl.textContent === message) {
771
+ message += "\u00A0";
772
+ }
773
+ this.liveRegionMessage = message;
774
+ }
775
+ addTags(tagNames) {
776
+ // covers both typing "," and pasting in text that includes ","
777
+ // if tag added without "," (typing enter), split puts the whole string in an array
778
+ const addedTags = tagNames.split(",").filter((t) => t.match(/\S/));
779
+ addedTags.forEach((tag) => {
780
+ this.wmTagInputTagAdded.emit(tag);
781
+ });
782
+ this.announce(this.tagAddedMessage(addedTags.join(", ")));
783
+ this.resetInput();
784
+ }
785
+ announceExistingOptions() {
786
+ // request animation frame to wait for re-rendering of filtered options
787
+ window.requestAnimationFrame(() => {
788
+ const numResults = this.filteredOptionEls.length;
789
+ const existingOptionsMessage = intl.formatMessage({
790
+ id: "tagInput.existingOptions",
791
+ defaultMessage: "{num, plural, one {1 existing option.} other {# existing options.}}",
792
+ }, { num: numResults });
793
+ this.announce(existingOptionsMessage);
794
+ });
795
+ }
796
+ generateCharacterLimitWarning(charCount, charLimit) {
797
+ let message = globalMessages.getCharactersEntered(charCount, charLimit);
798
+ if (charCount >= charLimit) {
799
+ message += ` ${globalMessages.characterLimitReached}`;
800
+ }
801
+ return message;
802
+ }
803
+ positionInput() {
804
+ if (this.tagAreaEl) {
805
+ const lastTag = this._tagEls[this._tagEls.length - 1];
806
+ // default placement to fall back to when no tags are present, or not enough space is available
807
+ this.inputEl.style.position = "static";
808
+ this.inputEl.style.width = "100%";
809
+ this.inputEl.classList.add("extended");
810
+ if (lastTag) {
811
+ const spaceAvailable = this.tagAreaEl.getBoundingClientRect().right - lastTag.getBoundingClientRect().right;
812
+ if (spaceAvailable >= this.inputMinimumWidth) {
813
+ // because the input has right: 0px
814
+ // all thats needed to properly place it is setting position: absolute, top, and width
815
+ this.inputEl.style.position = "absolute";
816
+ this.inputEl.style.top = lastTag.offsetTop.toString() + "px";
817
+ this.inputEl.style.width = (spaceAvailable - 8).toString() + "px";
818
+ this.inputEl.classList.remove("extended");
819
+ }
820
+ }
821
+ }
822
+ }
823
+ handleTagMouseEnter(ev) {
824
+ this.showTooltipIfTruncated(ev.target);
825
+ }
826
+ renderDropdownInput() {
827
+ return (h("input", { id: "input", class: "input", role: "combobox", ref: (el) => (this.inputEl = el), autocomplete: "off", "aria-required": this.requiredField ? "true" : null, "aria-controls": "dropdown", "aria-describedby": `help-text ${this.errorMessage ? "error " : ""} max-tags`, "aria-label": `${this.label} ${globalMessages.getCharacterLimit(this.characterLimit)}`, "aria-expanded": this.isExpanded.toString(), "aria-activedescendant": this.inputActiveDescendantId, placeholder: this.placeholder, maxLength: this.characterLimit, onInput: (ev) => this.handleInputChanged(ev), onBlur: (ev) => this.handleBlur(ev), onFocus: () => this.handleInputFocus(), onKeyDown: (ev) => this.handleInputKeyDown(ev) }));
828
+ }
829
+ renderTableInput() {
830
+ return (h("input", { id: "input", class: "input", ref: (el) => (this.inputEl = el), autocomplete: "off", "aria-required": this.requiredField ? "true" : null, "aria-controls": "table", "aria-describedby": `help-text ${this.errorMessage ? "error " : ""} max-tags`, "aria-label": this.label, placeholder: this.placeholder, onInput: (ev) => this.handleInputChanged(ev), onBlur: (ev) => this.handleBlur(ev), onFocus: () => this.handleInputFocus(), onKeyDown: (ev) => this.handleInputKeyDown(ev) }));
831
+ }
832
+ renderDropdown() {
833
+ 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)))));
834
+ }
835
+ renderHelpText() {
836
+ if (this.helpText)
837
+ return this.helpText;
838
+ let helpText = "";
839
+ if (this.optionEls.length > 0) {
840
+ helpText = this.selectionHelpText;
841
+ }
842
+ if (this.addNew) {
843
+ helpText += " " + this.addNewHelpText;
844
+ }
845
+ return helpText;
846
+ }
847
+ renderAddNewButton() {
848
+ const inputValue = this.inputEl.value.trim();
849
+ const hasNonWhiteSpaceCharacters = this.inputEl.value.match(/\S/);
850
+ const optionAlreadyExists = this.isExistingTag(this.inputEl.value.trim());
851
+ return (this.addNew &&
852
+ hasNonWhiteSpaceCharacters &&
853
+ !optionAlreadyExists && (h("li", { ref: (el) => (this.addNewButton = el), id: "add-new-btn", class: "add-new-btn", onClick: () => this.addTags(inputValue) }, this.addNewTagMessage(inputValue))));
854
+ }
855
+ renderTable() {
856
+ return (h("div", { class: `table-wrapper ${this.isKeying ? "user-is-keying" : ""}`, onScroll: () => this.dismissTooltip(),
857
+ // browsers will make this container tabbable if it scrolls
858
+ // we need to proactively set tabindex to -1 to avoid user focus. This is okay, because the table provides behavior that allows scrolling its content
859
+ tabindex: -1, onKeyDown: (ev) => this.handleTableWrapperKeyDown(ev) }, h("table", { id: "table", role: "grid", class: `${this.colWidths ? "fixed-widths" : ""}`, "aria-label": this.label, "aria-multiselectable": "true", onFocus: () => this.handleTableFocus(), "aria-activedescendant": this._focusedCell ? this._focusedCell.id : undefined, tabindex: this.filteredOptionEls.length ? "0" : undefined }, this.renderTableHeaders(), this.filteredOptionEls.length ? (this.filteredOptionEls.map((o) => this.renderTableRow(o))) : (h("div", { class: "no-results" }, this.noResultsMessage)))));
860
+ }
861
+ renderTableHeaders() {
862
+ return (h("tr", { class: "headers", role: "row" }, csvToArray(this.colHeaders).map((header, idx) => (h("th", { class: "header-cell", role: "columnheader",
863
+ // @ts-ignore
864
+ width: this.colWidths ? csvToArray(this.colWidths)[idx] : "" }, header)))));
865
+ }
866
+ renderTag(o) {
867
+ const focused = this.focusedTag && this.focusedTag.id === "tag-" + o.id ? "focused" : "";
868
+ const tagName = this.getTagName(o);
869
+ 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, onClick: () => o.emitDeselectedEvent() }, h("span", { class: "sr-only" }, tagName), h("div", { class: "description", id: `tag-${o.id}-description` }, o.locked ? globalMessages.locked : ""), h("span", { class: "tag-text", "aria-hidden": "true" }, tagName), o.locked ? h("div", { class: "svg-icon svg-locked" }) : h("div", { class: "icon remove-btn svg-icon svg-close" })));
870
+ }
871
+ renderTags() {
872
+ return this.tagsList.map((o) => this.renderTag(o));
873
+ }
874
+ renderTagCounter() {
875
+ if (this.maxTags) {
876
+ return (h("div", { class: "lower-row" }, h("div", { id: "max-tags" }, this.renderMaxTags())));
877
+ }
878
+ }
879
+ renderMaxTags() {
880
+ if (this.helpText) {
881
+ return this.helpText;
882
+ }
883
+ else {
884
+ let msg = `${this.tagsAddedMessage}: ${this.taggedOptions.length}/${this.maxTags}`;
885
+ if (this.tagLimitReached) {
886
+ msg += `- ${this.maxTagsReachedMessage}`;
887
+ }
888
+ return msg;
889
+ }
890
+ }
891
+ handleCellMouseEnter(ev) {
892
+ const cell = ev.target;
893
+ const contentWrapper = cell.querySelector(".cell-content-wrapper");
894
+ const isTruncated = contentWrapper.scrollWidth > contentWrapper.clientWidth;
895
+ if (isTruncated) {
896
+ // innerText is necessary vs textContent, as innerText ignores sr-only / display: none text
897
+ showTooltip("bottom", cell, cell.innerText);
898
+ }
899
+ }
900
+ renderTableCells(o) {
901
+ const colValues = [o.col1, o.col2, o.col3, o.col4].filter((val) => !!val);
902
+ const colHeaders = csvToArray(this.colHeaders);
903
+ return colValues.map((val, idx) => {
904
+ const cellId = `${o.id}-col${idx + 1}`;
905
+ let overflowRule = "wrap";
906
+ if (this.colWrap && csvToArray(this.colWrap)[idx]) {
907
+ overflowRule = csvToArray(this.colWrap)[idx];
908
+ }
909
+ const classes = {
910
+ focused: !!this._focusedCell && cellId === this._focusedCell.id,
911
+ };
912
+ 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: "column-label" }, colHeaders[idx] || `Column ${idx + 1}`), 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 : "")));
913
+ });
914
+ }
915
+ renderTableRow(o) {
916
+ const classes = {
917
+ selected: o.selected,
918
+ locked: o.locked,
919
+ focused: this.focusedOption && o === this.focusedOption ? true : false,
920
+ };
921
+ return (h("tr", { id: o.id, class: classes, onClick: (ev) => this.handleOptionClick(ev) }, this.renderTableCells(o)));
922
+ }
923
+ renderListItem(o) {
924
+ if (!!this.inputEl) {
925
+ const isFocused = this.focusedOption && o === this.focusedOption;
926
+ 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));
927
+ }
928
+ }
929
+ render() {
930
+ return (h("div", { key: '487a89339ede599f379c58bafeae76469d21a780', class: `wrapper label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { key: 'f849489b81e37460b4aefeec16624e246d2c8a2d', class: "label-wrapper" }, h("label", { key: '66ba79dc7d47e3cf8e0621a648d5488147a4e8a7', class: "label", htmlFor: "input", onMouseEnter: (ev) => this.handleLabelMouseEnter(ev), onMouseLeave: () => hideTooltip() }, this.label), this.labelPosition !== "none" && this.requiredField && (h("div", { key: 'e56bff146fb718718892ec3ef65080a676d98330', class: "required", "aria-hidden": "true" }, "*"))), h("div", { key: 'c8f254c41f21d6e6b6a64269999177984b53c421', class: `field-wrapper ${this.el.shadowRoot.activeElement === this.inputEl ? "focused" : ""} ${this.errorMessage ? "invalid" : ""}`, ref: (el) => (this.fieldWrapperEl = el) }, h("div", { key: '7e20617627c57bbe0257a521e8d320e8a29af3c7', class: "upper-row" }, h("div", { key: '5ac0239866d948162dffab70b585baa987809229', class: "svg-icon svg-search" }), h("div", { key: 'a2118423ae068f8c8cf6ebc98bad2d257176fbed', class: `tags-and-input-wrapper` }, h("ul", { key: '58ecf075c9e6fb08094f8d7f28d537bc9dec9997', 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-labelledby": "sr-instructions", tabindex: this._tagEls.length > 0 ? 0 : -1, "aria-describedby": `info max-tags`, onFocus: (ev) => this.handleTagAreaFocus(ev), onBlur: (ev) => {
931
+ this.focusedTagIndex = undefined;
932
+ this.handleBlur(ev);
933
+ }, onKeyDown: (ev) => this.handleTagAreaKeyDown(ev) }, this.renderTags()), h("div", { key: '34790567a401667fefd54928235c5e22cafcf2bc', class: "sr-only", id: "sr-instructions" }, this.label, ". ", this.tagAreaInstructions), this.isDropdown && this.renderDropdownInput(), this.isTable && this.renderTableInput()), this.isDropdown && (h("div", { key: '3ad6fa7ae961b16bfaf28e0e2da722bafde7ed0c', class: "character-count" }, this.charCount, "/", this.characterLimit))), this.renderTagCounter(), this.isDropdown && this.renderDropdown()), this.info && (h("div", { key: '00d080279460ffadcc1fdb265bc54b2b0a64c0f8', id: "info", class: "info-text" }, this.info)), h("div", { key: '694d807ce12dd203bb7e30bb4f742a395dee9caa', id: "error" }, this.errorMessage), h("div", { key: 'd02caba6dc7cdfc7f458cece08fa5170158125f2', class: "sr-only", "aria-live": "polite", ref: (el) => (this.liveRegionEl = el), "aria-atomic": "true" }, this.liveRegionMessage), this.isTable && this.renderTable()));
934
+ }
935
+ static get is() { return "wm-tag-input"; }
936
+ static get encapsulation() { return "shadow"; }
937
+ static get delegatesFocus() { return true; }
938
+ static get originalStyleUrls() {
939
+ return {
940
+ "$": ["wm-tag-input.scss"]
941
+ };
942
+ }
943
+ static get styleUrls() {
944
+ return {
945
+ "$": ["wm-tag-input.css"]
946
+ };
947
+ }
948
+ static get properties() {
949
+ return {
950
+ "label": {
951
+ "type": "string",
952
+ "mutable": false,
953
+ "complexType": {
954
+ "original": "string",
955
+ "resolved": "string",
956
+ "references": {}
957
+ },
958
+ "required": true,
959
+ "optional": false,
960
+ "docs": {
961
+ "tags": [],
962
+ "text": ""
963
+ },
964
+ "attribute": "label",
965
+ "reflect": false
966
+ },
967
+ "errorMessage": {
968
+ "type": "string",
969
+ "mutable": false,
970
+ "complexType": {
971
+ "original": "string",
972
+ "resolved": "string | undefined",
973
+ "references": {}
974
+ },
975
+ "required": false,
976
+ "optional": true,
977
+ "docs": {
978
+ "tags": [],
979
+ "text": ""
980
+ },
981
+ "attribute": "error-message",
982
+ "reflect": false
983
+ },
984
+ "info": {
985
+ "type": "string",
986
+ "mutable": false,
987
+ "complexType": {
988
+ "original": "string",
989
+ "resolved": "string | undefined",
990
+ "references": {}
991
+ },
992
+ "required": false,
993
+ "optional": true,
994
+ "docs": {
995
+ "tags": [],
996
+ "text": ""
997
+ },
998
+ "attribute": "info",
999
+ "reflect": false
1000
+ },
1001
+ "labelPosition": {
1002
+ "type": "string",
1003
+ "mutable": false,
1004
+ "complexType": {
1005
+ "original": "\"top\" | \"left\" | \"none\"",
1006
+ "resolved": "\"left\" | \"none\" | \"top\"",
1007
+ "references": {}
1008
+ },
1009
+ "required": false,
1010
+ "optional": false,
1011
+ "docs": {
1012
+ "tags": [],
1013
+ "text": ""
1014
+ },
1015
+ "attribute": "label-position",
1016
+ "reflect": false,
1017
+ "defaultValue": "\"top\""
1018
+ },
1019
+ "maxTags": {
1020
+ "type": "number",
1021
+ "mutable": false,
1022
+ "complexType": {
1023
+ "original": "number",
1024
+ "resolved": "number | undefined",
1025
+ "references": {}
1026
+ },
1027
+ "required": false,
1028
+ "optional": true,
1029
+ "docs": {
1030
+ "tags": [],
1031
+ "text": ""
1032
+ },
1033
+ "attribute": "max-tags",
1034
+ "reflect": false
1035
+ },
1036
+ "placeholder": {
1037
+ "type": "string",
1038
+ "mutable": true,
1039
+ "complexType": {
1040
+ "original": "string",
1041
+ "resolved": "string | undefined",
1042
+ "references": {}
1043
+ },
1044
+ "required": false,
1045
+ "optional": true,
1046
+ "docs": {
1047
+ "tags": [],
1048
+ "text": ""
1049
+ },
1050
+ "attribute": "placeholder",
1051
+ "reflect": false
1052
+ },
1053
+ "requiredField": {
1054
+ "type": "boolean",
1055
+ "mutable": false,
1056
+ "complexType": {
1057
+ "original": "boolean",
1058
+ "resolved": "boolean",
1059
+ "references": {}
1060
+ },
1061
+ "required": false,
1062
+ "optional": false,
1063
+ "docs": {
1064
+ "tags": [],
1065
+ "text": ""
1066
+ },
1067
+ "attribute": "required-field",
1068
+ "reflect": false,
1069
+ "defaultValue": "false"
1070
+ },
1071
+ "tagInputType": {
1072
+ "type": "string",
1073
+ "mutable": false,
1074
+ "complexType": {
1075
+ "original": "\"dropdown\" | \"table\"",
1076
+ "resolved": "\"dropdown\" | \"table\"",
1077
+ "references": {}
1078
+ },
1079
+ "required": false,
1080
+ "optional": false,
1081
+ "docs": {
1082
+ "tags": [],
1083
+ "text": ""
1084
+ },
1085
+ "attribute": "tag-input-type",
1086
+ "reflect": false,
1087
+ "defaultValue": "\"dropdown\""
1088
+ },
1089
+ "helpText": {
1090
+ "type": "string",
1091
+ "mutable": false,
1092
+ "complexType": {
1093
+ "original": "string",
1094
+ "resolved": "string | undefined",
1095
+ "references": {}
1096
+ },
1097
+ "required": false,
1098
+ "optional": true,
1099
+ "docs": {
1100
+ "tags": [],
1101
+ "text": ""
1102
+ },
1103
+ "attribute": "help-text",
1104
+ "reflect": false
1105
+ },
1106
+ "addNew": {
1107
+ "type": "boolean",
1108
+ "mutable": false,
1109
+ "complexType": {
1110
+ "original": "boolean",
1111
+ "resolved": "boolean",
1112
+ "references": {}
1113
+ },
1114
+ "required": false,
1115
+ "optional": false,
1116
+ "docs": {
1117
+ "tags": [],
1118
+ "text": ""
1119
+ },
1120
+ "attribute": "add-new",
1121
+ "reflect": false,
1122
+ "defaultValue": "true"
1123
+ },
1124
+ "characterLimit": {
1125
+ "type": "number",
1126
+ "mutable": false,
1127
+ "complexType": {
1128
+ "original": "number",
1129
+ "resolved": "number",
1130
+ "references": {}
1131
+ },
1132
+ "required": false,
1133
+ "optional": false,
1134
+ "docs": {
1135
+ "tags": [],
1136
+ "text": ""
1137
+ },
1138
+ "attribute": "character-limit",
1139
+ "reflect": false,
1140
+ "defaultValue": "50"
1141
+ },
1142
+ "colHeaders": {
1143
+ "type": "string",
1144
+ "mutable": false,
1145
+ "complexType": {
1146
+ "original": "string",
1147
+ "resolved": "string",
1148
+ "references": {}
1149
+ },
1150
+ "required": true,
1151
+ "optional": false,
1152
+ "docs": {
1153
+ "tags": [],
1154
+ "text": ""
1155
+ },
1156
+ "attribute": "col-headers",
1157
+ "reflect": false
1158
+ },
1159
+ "colWidths": {
1160
+ "type": "string",
1161
+ "mutable": false,
1162
+ "complexType": {
1163
+ "original": "string",
1164
+ "resolved": "string | undefined",
1165
+ "references": {}
1166
+ },
1167
+ "required": false,
1168
+ "optional": true,
1169
+ "docs": {
1170
+ "tags": [],
1171
+ "text": ""
1172
+ },
1173
+ "attribute": "col-widths",
1174
+ "reflect": false
1175
+ },
1176
+ "colWrap": {
1177
+ "type": "string",
1178
+ "mutable": false,
1179
+ "complexType": {
1180
+ "original": "string",
1181
+ "resolved": "string | undefined",
1182
+ "references": {}
1183
+ },
1184
+ "required": false,
1185
+ "optional": true,
1186
+ "docs": {
1187
+ "tags": [],
1188
+ "text": ""
1189
+ },
1190
+ "attribute": "col-wrap",
1191
+ "reflect": false
1192
+ }
1193
+ };
1194
+ }
1195
+ static get states() {
1196
+ return {
1197
+ "isKeying": {},
1198
+ "isExpanded": {},
1199
+ "liveRegionMessage": {},
1200
+ "focusedOption": {},
1201
+ "focusedColumn": {},
1202
+ "focusedTagIndex": {},
1203
+ "tagsList": {}
1204
+ };
1205
+ }
1206
+ static get events() {
1207
+ return [{
1208
+ "method": "wmTagInputTagAdded",
1209
+ "name": "wmTagInputTagAdded",
1210
+ "bubbles": true,
1211
+ "cancelable": true,
1212
+ "composed": true,
1213
+ "docs": {
1214
+ "tags": [],
1215
+ "text": ""
1216
+ },
1217
+ "complexType": {
1218
+ "original": "any",
1219
+ "resolved": "any",
1220
+ "references": {}
1221
+ }
1222
+ }];
1223
+ }
1224
+ static get elementRef() { return "el"; }
1225
+ static get watchers() {
1226
+ return [{
1227
+ "propName": "errorMessage",
1228
+ "methodName": "announceError"
1229
+ }];
1230
+ }
1231
+ static get listeners() {
1232
+ return [{
1233
+ "name": "wmUserIsKeying",
1234
+ "method": "toggleKeyingOn",
1235
+ "target": "window",
1236
+ "capture": false,
1237
+ "passive": false
1238
+ }, {
1239
+ "name": "wmUserIsTabbing",
1240
+ "method": "toggleKeyingOn",
1241
+ "target": "window",
1242
+ "capture": false,
1243
+ "passive": false
1244
+ }, {
1245
+ "name": "wmUserIsNotKeying",
1246
+ "method": "toggleKeyingOff",
1247
+ "target": "window",
1248
+ "capture": false,
1249
+ "passive": false
1250
+ }, {
1251
+ "name": "wmUserIsNotTabbing",
1252
+ "method": "toggleKeyingOff",
1253
+ "target": "window",
1254
+ "capture": false,
1255
+ "passive": false
1256
+ }, {
1257
+ "name": "privTagOptionSelected",
1258
+ "method": "handleTagOptionSelected",
1259
+ "target": undefined,
1260
+ "capture": false,
1261
+ "passive": false
1262
+ }, {
1263
+ "name": "privTagOptionDeselected",
1264
+ "method": "handleTagOptionDeselected",
1265
+ "target": undefined,
1266
+ "capture": false,
1267
+ "passive": false
1268
+ }, {
1269
+ "name": "click",
1270
+ "method": "handleClick",
1271
+ "target": "document",
1272
+ "capture": false,
1273
+ "passive": false
1274
+ }, {
1275
+ "name": "scroll",
1276
+ "method": "dismissTooltip",
1277
+ "target": "window",
1278
+ "capture": true,
1279
+ "passive": true
1280
+ }, {
1281
+ "name": "blur",
1282
+ "method": "handleBlur",
1283
+ "target": undefined,
1284
+ "capture": false,
1285
+ "passive": false
1286
+ }];
1287
+ }
707
1288
  }