@watermarkinsights/ripple 3.26.0-9 → 3.26.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 (278) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/{chartFunctions-d746b939.js → chartFunctions-b7452189.js} +596 -596
  3. package/dist/cjs/{functions-68f637b4.js → functions-a047a8ea.js} +503 -503
  4. package/dist/cjs/{global-0f60d748.js → global-21ae6c78.js} +72 -72
  5. package/dist/cjs/{http-service-9e8c4dd5.js → http-service-494d81de.js} +49 -49
  6. package/dist/cjs/{interfaces-30a74c1f.js → interfaces-a3338581.js} +29 -29
  7. package/dist/cjs/{intl-d9ffc76c.js → intl-47d63c8f.js} +131 -131
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/priv-chart-popover.cjs.entry.js +91 -91
  10. package/dist/cjs/priv-datepicker.cjs.entry.js +657 -657
  11. package/dist/cjs/priv-navigator-button.cjs.entry.js +19 -19
  12. package/dist/cjs/priv-navigator-item.cjs.entry.js +23 -23
  13. package/dist/cjs/ripple.cjs.js +1 -1
  14. package/dist/cjs/wm-action-menu_2.cjs.entry.js +334 -334
  15. package/dist/cjs/wm-button.cjs.entry.js +260 -260
  16. package/dist/cjs/wm-chart-slice.cjs.entry.js +18 -18
  17. package/dist/cjs/wm-chart.cjs.entry.js +183 -183
  18. package/dist/cjs/wm-datepicker.cjs.entry.js +263 -263
  19. package/dist/cjs/wm-file-list.cjs.entry.js +35 -35
  20. package/dist/cjs/wm-file.cjs.entry.js +181 -181
  21. package/dist/cjs/wm-input.cjs.entry.js +137 -137
  22. package/dist/cjs/wm-modal-footer.cjs.entry.js +33 -33
  23. package/dist/cjs/wm-modal-header.cjs.entry.js +32 -32
  24. package/dist/cjs/wm-modal.cjs.entry.js +152 -152
  25. package/dist/cjs/wm-navigation_3.cjs.entry.js +225 -225
  26. package/dist/cjs/wm-navigator.cjs.entry.js +264 -264
  27. package/dist/cjs/wm-network-uploader.cjs.entry.js +465 -465
  28. package/dist/cjs/wm-option_2.cjs.entry.js +768 -768
  29. package/dist/cjs/wm-pagination.cjs.entry.js +179 -179
  30. package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +155 -155
  31. package/dist/cjs/wm-search.cjs.entry.js +184 -184
  32. package/dist/cjs/wm-snackbar.cjs.entry.js +155 -155
  33. package/dist/cjs/wm-tab-item_3.cjs.entry.js +264 -264
  34. package/dist/cjs/wm-tag-input-row.cjs.entry.js +14 -14
  35. package/dist/cjs/wm-tag-input.cjs.entry.js +939 -939
  36. package/dist/cjs/wm-timepicker.cjs.entry.js +385 -385
  37. package/dist/cjs/wm-toggletip.cjs.entry.js +130 -130
  38. package/dist/cjs/wm-uploader.cjs.entry.js +441 -441
  39. package/dist/cjs/wm-wrapper.cjs.entry.js +12 -12
  40. package/dist/collection/components/charts/chartFunctions.js +562 -562
  41. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +267 -267
  42. package/dist/collection/components/charts/wm-chart/wm-chart-slice.js +125 -125
  43. package/dist/collection/components/charts/wm-chart/wm-chart.js +450 -450
  44. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +207 -207
  45. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +143 -143
  46. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-slice.js +121 -121
  47. package/dist/collection/components/wm-action-menu/wm-action-menu.js +472 -472
  48. package/dist/collection/components/wm-button/wm-button.js +575 -575
  49. package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.js +983 -983
  50. package/dist/collection/components/wm-datepicker/wm-datepicker.js +491 -491
  51. package/dist/collection/components/wm-file/wm-file.js +313 -313
  52. package/dist/collection/components/wm-file-list/wm-file-list.js +152 -152
  53. package/dist/collection/components/wm-input/wm-input.css +5 -1
  54. package/dist/collection/components/wm-input/wm-input.js +509 -509
  55. package/dist/collection/components/wm-menuitem/wm-menuitem.js +454 -454
  56. package/dist/collection/components/wm-modal/wm-modal-footer.js +138 -138
  57. package/dist/collection/components/wm-modal/wm-modal-header.js +82 -82
  58. package/dist/collection/components/wm-modal/wm-modal.js +462 -462
  59. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +176 -176
  60. package/dist/collection/components/wm-navigation/wm-navigation-item.js +130 -130
  61. package/dist/collection/components/wm-navigation/wm-navigation.js +217 -217
  62. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +106 -106
  63. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +123 -123
  64. package/dist/collection/components/wm-navigator/wm-navigator.js +467 -467
  65. package/dist/collection/components/wm-option/wm-option.js +435 -435
  66. package/dist/collection/components/wm-pagination/wm-pagination.js +370 -370
  67. package/dist/collection/components/wm-search/wm-search.js +439 -439
  68. package/dist/collection/components/wm-select/wm-select.js +1054 -1054
  69. package/dist/collection/components/wm-snackbar/wm-snackbar.js +282 -282
  70. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +211 -211
  71. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +327 -327
  72. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +108 -108
  73. package/dist/collection/components/wm-tag-input/wm-tag-input-row/wm-tag-input-row.js +122 -122
  74. package/dist/collection/components/wm-tag-input/wm-tag-input.js +1294 -1294
  75. package/dist/collection/components/wm-timepicker/wm-timepicker.js +605 -605
  76. package/dist/collection/components/wm-toggletip/wm-toggletip.js +253 -253
  77. package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.js +772 -772
  78. package/dist/collection/components/wm-uploader/wm-uploader.js +964 -964
  79. package/dist/collection/components/wm-wrapper/wm-wrapper.js +28 -28
  80. package/dist/collection/dev/scripts.js +20 -20
  81. package/dist/collection/global/__mocks__/functions.js +6 -6
  82. package/dist/collection/global/functions.js +546 -546
  83. package/dist/collection/global/global.js +79 -79
  84. package/dist/collection/global/interfaces.js +49 -49
  85. package/dist/collection/global/intl.js +132 -132
  86. package/dist/collection/global/services/__mocks__/http-service.js +130 -130
  87. package/dist/collection/global/services/http-service.js +50 -50
  88. package/dist/collection/lang/lang.js +5 -5
  89. package/dist/collection/lang/missing.js +43 -43
  90. package/dist/collection/lang/piglatin.js +93 -93
  91. package/dist/esm/{chartFunctions-5c1ad085.js → chartFunctions-9d629e09.js} +596 -596
  92. package/dist/esm/{functions-b2582352.js → functions-3b813e0c.js} +503 -503
  93. package/dist/esm/{global-86bf0ca6.js → global-c7bb5530.js} +72 -72
  94. package/dist/esm/{http-service-5d037e16.js → http-service-3dc3b3e7.js} +49 -49
  95. package/dist/esm/{interfaces-61c6305b.js → interfaces-2b97fab2.js} +29 -29
  96. package/dist/esm/{intl-6732dd5b.js → intl-d544f922.js} +131 -131
  97. package/dist/esm/loader.js +1 -1
  98. package/dist/esm/polyfills/core-js.js +0 -0
  99. package/dist/esm/polyfills/dom.js +0 -0
  100. package/dist/esm/polyfills/es5-html-element.js +0 -0
  101. package/dist/esm/polyfills/index.js +0 -0
  102. package/dist/esm/polyfills/system.js +0 -0
  103. package/dist/esm/priv-chart-popover.entry.js +91 -91
  104. package/dist/esm/priv-datepicker.entry.js +657 -657
  105. package/dist/esm/priv-navigator-button.entry.js +19 -19
  106. package/dist/esm/priv-navigator-item.entry.js +23 -23
  107. package/dist/esm/ripple.js +1 -1
  108. package/dist/esm/wm-action-menu_2.entry.js +334 -334
  109. package/dist/esm/wm-button.entry.js +260 -260
  110. package/dist/esm/wm-chart-slice.entry.js +18 -18
  111. package/dist/esm/wm-chart.entry.js +183 -183
  112. package/dist/esm/wm-datepicker.entry.js +263 -263
  113. package/dist/esm/wm-file-list.entry.js +35 -35
  114. package/dist/esm/wm-file.entry.js +181 -181
  115. package/dist/esm/wm-input.entry.js +137 -137
  116. package/dist/esm/wm-modal-footer.entry.js +33 -33
  117. package/dist/esm/wm-modal-header.entry.js +32 -32
  118. package/dist/esm/wm-modal.entry.js +152 -152
  119. package/dist/esm/wm-navigation_3.entry.js +225 -225
  120. package/dist/esm/wm-navigator.entry.js +264 -264
  121. package/dist/esm/wm-network-uploader.entry.js +465 -465
  122. package/dist/esm/wm-option_2.entry.js +768 -768
  123. package/dist/esm/wm-pagination.entry.js +179 -179
  124. package/dist/esm/wm-progress-indicator_3.entry.js +155 -155
  125. package/dist/esm/wm-search.entry.js +184 -184
  126. package/dist/esm/wm-snackbar.entry.js +155 -155
  127. package/dist/esm/wm-tab-item_3.entry.js +264 -264
  128. package/dist/esm/wm-tag-input-row.entry.js +14 -14
  129. package/dist/esm/wm-tag-input.entry.js +939 -939
  130. package/dist/esm/wm-timepicker.entry.js +385 -385
  131. package/dist/esm/wm-toggletip.entry.js +130 -130
  132. package/dist/esm/wm-uploader.entry.js +441 -441
  133. package/dist/esm/wm-wrapper.entry.js +12 -12
  134. package/dist/esm-es5/{chartFunctions-5c1ad085.js → chartFunctions-9d629e09.js} +1 -1
  135. package/dist/esm-es5/global-c7bb5530.js +1 -0
  136. package/dist/esm-es5/{intl-6732dd5b.js → intl-d544f922.js} +1 -1
  137. package/dist/esm-es5/loader.js +1 -1
  138. package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
  139. package/dist/esm-es5/priv-datepicker.entry.js +1 -1
  140. package/dist/esm-es5/ripple.js +1 -1
  141. package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
  142. package/dist/esm-es5/wm-button.entry.js +1 -1
  143. package/dist/esm-es5/wm-chart.entry.js +1 -1
  144. package/dist/esm-es5/wm-datepicker.entry.js +1 -1
  145. package/dist/esm-es5/wm-file.entry.js +1 -1
  146. package/dist/esm-es5/wm-input.entry.js +1 -1
  147. package/dist/esm-es5/wm-modal-header.entry.js +1 -1
  148. package/dist/esm-es5/wm-modal.entry.js +1 -1
  149. package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
  150. package/dist/esm-es5/wm-navigator.entry.js +1 -1
  151. package/dist/esm-es5/wm-network-uploader.entry.js +1 -1
  152. package/dist/esm-es5/wm-option_2.entry.js +1 -1
  153. package/dist/esm-es5/wm-pagination.entry.js +1 -1
  154. package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
  155. package/dist/esm-es5/wm-search.entry.js +1 -1
  156. package/dist/esm-es5/wm-snackbar.entry.js +1 -1
  157. package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
  158. package/dist/esm-es5/wm-tag-input.entry.js +1 -1
  159. package/dist/esm-es5/wm-timepicker.entry.js +1 -1
  160. package/dist/esm-es5/wm-toggletip.entry.js +1 -1
  161. package/dist/esm-es5/wm-uploader.entry.js +1 -1
  162. package/dist/ripple/{p-d5a420fa.entry.js → p-05563588.entry.js} +1 -1
  163. package/dist/ripple/{p-061914bf.system.entry.js → p-09a04f55.system.entry.js} +1 -1
  164. package/dist/ripple/{p-a2f10a77.entry.js → p-09bc0aa7.entry.js} +1 -1
  165. package/dist/ripple/{p-0414179c.entry.js → p-0cfc0d13.entry.js} +1 -1
  166. package/dist/ripple/{p-a9080b82.entry.js → p-0ef638b7.entry.js} +1 -1
  167. package/dist/ripple/{p-f740c48c.system.entry.js → p-12c70659.system.entry.js} +1 -1
  168. package/dist/ripple/p-169606b9.system.js +1 -0
  169. package/dist/ripple/{p-7ee31208.js → p-18c2f4fe.js} +1 -1
  170. package/dist/ripple/{p-462e7cf8.system.entry.js → p-236dab05.system.entry.js} +1 -1
  171. package/dist/ripple/{p-9baf62ae.entry.js → p-2cd5477a.entry.js} +1 -1
  172. package/dist/ripple/{p-2cef256c.system.entry.js → p-2cde4ade.system.entry.js} +1 -1
  173. package/dist/ripple/{p-076a8729.entry.js → p-2d46dbea.entry.js} +1 -1
  174. package/dist/ripple/{p-3313df40.system.entry.js → p-2dd5f5c3.system.entry.js} +1 -1
  175. package/dist/ripple/{p-64b64f40.system.entry.js → p-35790e4e.system.entry.js} +1 -1
  176. package/dist/ripple/{p-4e7489a3.system.entry.js → p-38819b27.system.entry.js} +1 -1
  177. package/dist/ripple/{p-926aab51.entry.js → p-3aa8e5f5.entry.js} +1 -1
  178. package/dist/ripple/{p-42739dba.entry.js → p-42f8f3ff.entry.js} +1 -1
  179. package/dist/ripple/{p-c1d814f8.system.entry.js → p-4444add0.system.entry.js} +1 -1
  180. package/dist/ripple/{p-0648aa61.system.entry.js → p-4f5a48dd.system.entry.js} +1 -1
  181. package/dist/ripple/{p-2948bf33.system.entry.js → p-4fb81a33.system.entry.js} +1 -1
  182. package/dist/ripple/{p-22b74491.entry.js → p-51b38033.entry.js} +1 -1
  183. package/dist/ripple/{p-9706537b.system.js → p-54a2b7d6.system.js} +1 -1
  184. package/dist/ripple/{p-00edfbc8.system.entry.js → p-56ba575c.system.entry.js} +1 -1
  185. package/dist/ripple/{p-b7f204e6.entry.js → p-5708349e.entry.js} +1 -1
  186. package/dist/ripple/{p-7dafc84b.system.entry.js → p-630bd6f5.system.entry.js} +1 -1
  187. package/dist/ripple/{p-b7982fab.system.js → p-6eb2c2d5.system.js} +1 -1
  188. package/dist/ripple/{p-a966a18c.entry.js → p-72b9b986.entry.js} +1 -1
  189. package/dist/ripple/p-76015762.js +1 -0
  190. package/dist/ripple/{p-3aaf86e4.entry.js → p-7f15df83.entry.js} +1 -1
  191. package/dist/ripple/{p-5ddb1660.entry.js → p-832910a0.entry.js} +1 -1
  192. package/dist/ripple/{p-66bb46e5.system.entry.js → p-84ce9b67.system.entry.js} +1 -1
  193. package/dist/ripple/{p-e6fde200.system.entry.js → p-8775e10b.system.entry.js} +1 -1
  194. package/dist/ripple/{p-6f96c28d.entry.js → p-8b23f32b.entry.js} +1 -1
  195. package/dist/ripple/{p-17490d32.entry.js → p-8c853762.entry.js} +1 -1
  196. package/dist/ripple/{p-81b26d3a.system.entry.js → p-8ff578ad.system.entry.js} +1 -1
  197. package/dist/ripple/{p-9b9e60aa.system.entry.js → p-95aa793b.system.entry.js} +1 -1
  198. package/dist/ripple/{p-9b28a31f.entry.js → p-95f4e5a1.entry.js} +1 -1
  199. package/dist/ripple/{p-accdf91c.system.entry.js → p-a006968b.system.entry.js} +1 -1
  200. package/dist/ripple/{p-2d33df00.system.js → p-a48e4f1a.system.js} +1 -1
  201. package/dist/ripple/{p-094388f1.entry.js → p-ae1e1db8.entry.js} +1 -1
  202. package/dist/ripple/{p-3b582301.entry.js → p-b3d97de8.entry.js} +1 -1
  203. package/dist/ripple/{p-f8418ac9.entry.js → p-bdecbb63.entry.js} +1 -1
  204. package/dist/ripple/{p-b805612a.system.entry.js → p-c3665c9f.system.entry.js} +1 -1
  205. package/dist/ripple/{p-d7f77b2c.js → p-d96b86c9.js} +1 -1
  206. package/dist/ripple/p-d973fe13.system.entry.js +1 -0
  207. package/dist/ripple/{p-0503e614.system.entry.js → p-ea99fb58.system.entry.js} +1 -1
  208. package/dist/ripple/{p-bd94e7c3.entry.js → p-eeeec290.entry.js} +1 -1
  209. package/dist/ripple/{p-a5662a2c.system.entry.js → p-f2bb38d0.system.entry.js} +1 -1
  210. package/dist/ripple/{p-043b4874.entry.js → p-f6c9c95f.entry.js} +1 -1
  211. package/dist/ripple/{p-731beaab.system.entry.js → p-f6f80b8d.system.entry.js} +1 -1
  212. package/dist/ripple/{p-49f7f1da.entry.js → p-fe76e568.entry.js} +1 -1
  213. package/dist/ripple/{p-60f58a39.system.entry.js → p-fea37751.system.entry.js} +1 -1
  214. package/dist/ripple/{p-5b7e1b5d.entry.js → p-ffb83b6f.entry.js} +1 -1
  215. package/dist/ripple/ripple.esm.js +1 -1
  216. package/dist/ripple/ripple.js +1 -1
  217. package/dist/types/components/charts/chartFunctions.d.ts +37 -37
  218. package/dist/types/components/charts/priv-chart-popover/priv-chart-popover.d.ts +27 -27
  219. package/dist/types/components/charts/wm-chart/wm-chart-slice.d.ts +11 -11
  220. package/dist/types/components/charts/wm-chart/wm-chart.d.ts +47 -47
  221. package/dist/types/components/charts/wm-progress-monitor/wm-progress-indicator.d.ts +29 -29
  222. package/dist/types/components/charts/wm-progress-monitor/wm-progress-monitor.d.ts +20 -20
  223. package/dist/types/components/charts/wm-progress-monitor/wm-progress-slice.d.ts +10 -10
  224. package/dist/types/components/wm-action-menu/wm-action-menu.d.ts +49 -49
  225. package/dist/types/components/wm-button/wm-button.d.ts +49 -49
  226. package/dist/types/components/wm-datepicker/priv-datepicker/priv-datepicker.d.ts +80 -80
  227. package/dist/types/components/wm-datepicker/wm-datepicker.d.ts +42 -42
  228. package/dist/types/components/wm-file/wm-file.d.ts +40 -40
  229. package/dist/types/components/wm-file-list/wm-file-list.d.ts +16 -16
  230. package/dist/types/components/wm-input/wm-input.d.ts +57 -57
  231. package/dist/types/components/wm-menuitem/wm-menuitem.d.ts +34 -34
  232. package/dist/types/components/wm-modal/wm-modal-footer.d.ts +14 -14
  233. package/dist/types/components/wm-modal/wm-modal-header.d.ts +10 -10
  234. package/dist/types/components/wm-modal/wm-modal.d.ts +40 -40
  235. package/dist/types/components/wm-navigation/wm-navigation-hamburger.d.ts +21 -21
  236. package/dist/types/components/wm-navigation/wm-navigation-item.d.ts +13 -13
  237. package/dist/types/components/wm-navigation/wm-navigation.d.ts +26 -26
  238. package/dist/types/components/wm-navigator/priv-navigator-button/priv-navigator-button.d.ts +10 -10
  239. package/dist/types/components/wm-navigator/priv-navigator-item/priv-navigator-item.d.ts +13 -13
  240. package/dist/types/components/wm-navigator/wm-navigator.d.ts +61 -61
  241. package/dist/types/components/wm-option/wm-option.d.ts +34 -34
  242. package/dist/types/components/wm-pagination/wm-pagination.d.ts +32 -32
  243. package/dist/types/components/wm-search/wm-search.d.ts +77 -77
  244. package/dist/types/components/wm-select/wm-select.d.ts +101 -101
  245. package/dist/types/components/wm-snackbar/wm-snackbar.d.ts +31 -31
  246. package/dist/types/components/wm-tabs/wm-tab-item/wm-tab-item.d.ts +37 -37
  247. package/dist/types/components/wm-tabs/wm-tab-list/wm-tab-list.d.ts +52 -52
  248. package/dist/types/components/wm-tabs/wm-tab-panel/wm-tab-panel.d.ts +20 -20
  249. package/dist/types/components/wm-tag-input/wm-tag-input-row/wm-tag-input-row.d.ts +11 -11
  250. package/dist/types/components/wm-tag-input/wm-tag-input.d.ts +136 -136
  251. package/dist/types/components/wm-timepicker/wm-timepicker.d.ts +62 -62
  252. package/dist/types/components/wm-toggletip/wm-toggletip.d.ts +28 -28
  253. package/dist/types/components/wm-uploader/wm-network-uploader/wm-network-uploader.d.ts +85 -85
  254. package/dist/types/components/wm-uploader/wm-uploader.d.ts +99 -99
  255. package/dist/types/components/wm-wrapper/wm-wrapper.d.ts +7 -7
  256. package/dist/types/components.d.ts +27 -27
  257. package/dist/types/global/__mocks__/functions.d.ts +6 -6
  258. package/dist/types/global/functions.d.ts +49 -49
  259. package/dist/types/global/global.d.ts +1 -1
  260. package/dist/types/global/interfaces.d.ts +74 -74
  261. package/dist/types/global/intl.d.ts +29 -29
  262. package/dist/types/global/services/__mocks__/http-service.d.ts +6 -6
  263. package/dist/types/global/services/http-service.d.ts +4 -4
  264. package/dist/types/lang/lang.d.ts +5 -5
  265. package/package.json +46 -46
  266. package/dist/esm-es5/global-86bf0ca6.js +0 -1
  267. package/dist/ripple/p-233c8059.js +0 -1
  268. package/dist/ripple/p-9f9a5a1f.system.js +0 -1
  269. package/dist/ripple/p-e4cef02b.system.entry.js +0 -1
  270. /package/dist/esm-es5/{functions-b2582352.js → functions-3b813e0c.js} +0 -0
  271. /package/dist/esm-es5/{http-service-5d037e16.js → http-service-3dc3b3e7.js} +0 -0
  272. /package/dist/esm-es5/{interfaces-61c6305b.js → interfaces-2b97fab2.js} +0 -0
  273. /package/dist/ripple/{p-9e94ae94.system.js → p-190afa40.system.js} +0 -0
  274. /package/dist/ripple/{p-888bec42.js → p-43f1298b.js} +0 -0
  275. /package/dist/ripple/{p-5384856b.js → p-4a0e1d2d.js} +0 -0
  276. /package/dist/ripple/{p-313b6073.system.js → p-9d02957d.system.js} +0 -0
  277. /package/dist/ripple/{p-08b7ec08.system.js → p-f5df5903.system.js} +0 -0
  278. /package/dist/ripple/{p-a6d6eae7.js → p-fd8070fb.js} +0 -0
@@ -8601,509 +8601,509 @@ function createIntl(config, cache) {
8601
8601
  $t: formatMessage.bind(null, resolvedConfig, formatters), formatList: formatList.bind(null, resolvedConfig, formatters.getListFormat), formatListToParts: formatListToParts.bind(null, resolvedConfig, formatters.getListFormat), formatDisplayName: formatDisplayName.bind(null, resolvedConfig, formatters.getDisplayNames) });
8602
8602
  }
8603
8603
 
8604
- const DEFAULT_LANGUAGE = "en";
8605
- function getBrowserLang() {
8606
- const langAttr = document.documentElement.getAttribute("lang");
8607
- if (!!langAttr) {
8608
- return langAttr;
8609
- }
8610
- else if (window.navigator && window.navigator.language) {
8611
- const lang = window.navigator.languages ? window.navigator.languages[0] : window.navigator.language;
8612
- return lang.slice(0, 2);
8613
- }
8614
- else {
8615
- return DEFAULT_LANGUAGE;
8616
- }
8617
- }
8618
- // prevents memory leak
8619
- const cache = createIntlCache();
8620
- const locale = getBrowserLang();
8621
- const intl = createIntl({
8622
- locale: locale,
8623
- defaultLocale: "en",
8624
- messages: lang[locale] || en,
8625
- }, cache);
8626
- function generateId() {
8627
- return "wmcl-" + Math.random().toString(36).substr(2, 10);
8628
- }
8629
- // limits how many times a function fires
8630
- // use when the function should run periodically, but not too often (e.g. window resize)
8631
- function throttle(fn, wait) {
8632
- let timeout;
8633
- let shouldWait = false;
8634
- return function () {
8635
- const context = this;
8636
- if (!shouldWait) {
8637
- fn.apply(context, arguments);
8638
- shouldWait = true;
8639
- clearTimeout(timeout);
8640
- timeout = setTimeout(function () {
8641
- shouldWait = false;
8642
- }, wait);
8643
- }
8644
- };
8645
- }
8646
- // waits until it hasn't been called for [timeout] ms.
8647
- // use when the function should run only after something (event) is done firing
8648
- function debounce(fn, wait) {
8649
- let timeout;
8650
- return function () {
8651
- const context = this;
8652
- const functionCall = () => fn.apply(context, arguments);
8653
- clearTimeout(timeout);
8654
- timeout = setTimeout(functionCall, wait);
8655
- };
8656
- }
8657
- function getTextDir() {
8658
- const dir = document.querySelector("html").getAttribute("dir");
8659
- return dir ? dir.toLowerCase() : "";
8660
- }
8661
- function getPosition(el) {
8662
- const coords = el.getBoundingClientRect();
8663
- let x = coords.x;
8664
- let y = coords.y;
8665
- // Edge doesn't have x and y
8666
- if (!x) {
8667
- if (getTextDir() === "rtl") {
8668
- x = coords.right;
8669
- }
8670
- else {
8671
- x = coords.left;
8672
- }
8673
- y = coords.top;
8674
- }
8675
- return { x, y };
8676
- }
8677
- function findParentWithScrollbar(el) {
8678
- while (!!el) {
8679
- if (el.scrollHeight > el.clientHeight && ["scroll", "auto"].includes(window.getComputedStyle(el).overflowY)) {
8680
- return el;
8681
- }
8682
- el = el.parentElement;
8683
- }
8684
- }
8685
- function findParentWithHiddenOverflow(el) {
8686
- while (!!el) {
8687
- if (window.getComputedStyle(el).overflowY !== "visible") {
8688
- return el;
8689
- }
8690
- el = el.parentElement;
8691
- }
8692
- }
8693
- function getClosableElementMeasurements(fixedEl, closableEl) {
8694
- const parent = findParentWithHiddenOverflow(fixedEl);
8695
- // if parent is not found, measurements are checked against the viewport
8696
- return {
8697
- closableElHeight: closableEl.clientHeight,
8698
- closableElWidth: closableEl.clientWidth,
8699
- // NB boundingClientRect.bottom is space from top of viewport to bottom of el
8700
- // to get space below the el -> height of viewport minus boundingClientRect.bottom
8701
- spaceAbove: parent
8702
- ? fixedEl.getBoundingClientRect().top - parent.getBoundingClientRect().top
8703
- : fixedEl.getBoundingClientRect().top,
8704
- // NB boundingClientRect.bottom is space from top of viewport to bottom of el
8705
- // to get space below the el -> height of viewport minus boundingClientRect.bottom
8706
- spaceBelow: parent
8707
- ? parent.getBoundingClientRect().bottom - fixedEl.getBoundingClientRect().bottom
8708
- : document.documentElement.clientHeight - fixedEl.getBoundingClientRect().bottom,
8709
- spaceLeft: parent
8710
- ? fixedEl.getBoundingClientRect().left - parent.getBoundingClientRect().left
8711
- : fixedEl.getBoundingClientRect().left,
8712
- spaceRight: parent
8713
- ? parent.getBoundingClientRect().right - fixedEl.getBoundingClientRect().right
8714
- : document.documentElement.clientWidth - fixedEl.getBoundingClientRect().right,
8715
- };
8716
- }
8717
- function shouldOpenUp(fixedEl, //the element visible on the page when the component is closed
8718
- closableEl, //the dropdown/popup/etc that becomes visible when the component is open
8719
- offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
8720
- offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
8721
- ) {
8722
- const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
8723
- //we want to open up only if there's not enough space below AND there is enough space above
8724
- const openUp = closableElHeight > spaceBelow + offsetBelow && closableElHeight <= spaceAbove + offsetAbove;
8725
- return openUp;
8726
- }
8727
- function shouldOpenDown(fixedEl, //the element visible on the page when the component is closed
8728
- closableEl, //the dropdown/popup/etc that becomes visible when the component is open
8729
- offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
8730
- offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
8731
- ) {
8732
- const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
8733
- //we want to open up only if there's not enough space below AND there is enough space above
8734
- const openDown = closableElHeight > spaceAbove + offsetAbove && closableElHeight <= spaceBelow + offsetBelow;
8735
- return openDown;
8736
- }
8737
- function shouldShiftRight(fixedEl, closableEl) {
8738
- const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
8739
- const needsSpaceLeft = closableElWidth > spaceLeft && spaceRight > spaceLeft;
8740
- return needsSpaceLeft;
8741
- }
8742
- function shouldShiftLeft(fixedEl, closableEl) {
8743
- const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
8744
- const needsSpaceRight = closableElWidth > spaceRight && spaceLeft > spaceRight;
8745
- return needsSpaceRight;
8746
- }
8747
- function adjustTooltipPlacement(tPos, el, tooltipEl) {
8748
- const { spaceLeft, spaceRight, spaceBelow, spaceAbove } = getClosableElementMeasurements(el, tooltipEl);
8749
- const tooltipWidth = tooltipEl.getBoundingClientRect().width;
8750
- const tooltipHeight = tooltipEl.getBoundingClientRect().height;
8751
- const enoughSpaceAbove = spaceAbove > tooltipHeight;
8752
- const enoughSpaceBelow = spaceBelow > tooltipHeight;
8753
- // a tooltip should never be closer than 24px to the edge of a screen
8754
- const enoughSpaceLeft = spaceLeft - 24 > tooltipWidth;
8755
- const enoughSpaceRight = spaceRight - 24 > tooltipWidth;
8756
- const swapAbove = (position) => {
8757
- return !enoughSpaceAbove ? position.replace("top", "bottom") : position;
8758
- };
8759
- const swapBelow = (position) => {
8760
- return !enoughSpaceBelow && enoughSpaceAbove ? position.replace("bottom", "top") : position;
8761
- };
8762
- const swapLeft = (position, centeredPosition) => {
8763
- if (!enoughSpaceLeft && enoughSpaceRight) {
8764
- position = position.replace("left", "right");
8765
- }
8766
- else if (!enoughSpaceLeft && !enoughSpaceRight) {
8767
- position = centeredPosition;
8768
- }
8769
- return position;
8770
- };
8771
- const swapRight = (position, centeredPosition) => {
8772
- if (!enoughSpaceRight && enoughSpaceLeft) {
8773
- position = position.replace("right", "left");
8774
- }
8775
- else if (!enoughSpaceRight && !enoughSpaceLeft) {
8776
- position = centeredPosition;
8777
- }
8778
- return position;
8779
- };
8780
- // horizontal checks must occur before vertical checks, because horizontal can affect vertical positioning but not vice versa
8781
- switch (tPos) {
8782
- case "left":
8783
- tPos = swapLeft(tPos, "bottom");
8784
- case "right":
8785
- tPos = swapRight(tPos, "bottom");
8786
- case "top-left":
8787
- tPos = swapLeft(tPos, "top");
8788
- tPos = swapAbove(tPos);
8789
- case "top-right":
8790
- tPos = swapRight(tPos, "top");
8791
- tPos = swapAbove(tPos);
8792
- case "bottom-left":
8793
- tPos = swapLeft(tPos, "bottom");
8794
- tPos = swapBelow(tPos);
8795
- case "bottom-right":
8796
- tPos = swapRight(tPos, "bottom");
8797
- tPos = swapBelow(tPos);
8798
- case "top":
8799
- tPos = swapAbove(tPos);
8800
- case "bottom":
8801
- tPos = swapBelow(tPos);
8802
- }
8803
- return tPos;
8804
- }
8805
- function showTooltip(position, anchorEl, tooltipText) {
8806
- const tooltipEl = document.getElementById("wm-tooltip");
8807
- tooltipEl.textContent = tooltipText;
8808
- // tooltip only has a maxWidth if it contains whitespace and can break
8809
- const hasNoWhitespace = tooltipText.match(/^[^\s]+$/);
8810
- if (hasNoWhitespace) {
8811
- tooltipEl.classList.add("single-word");
8812
- tooltipEl.style.setProperty("--wmTooltipMaxWidth", "none");
8813
- }
8814
- else {
8815
- tooltipEl.classList.remove("single-word");
8816
- tooltipEl.style.removeProperty("--wmTooltipMaxWidth");
8817
- }
8818
- positionTooltip(position, anchorEl, tooltipEl);
8819
- tooltipEl.classList.add("open");
8820
- }
8821
- function hideTooltip() {
8822
- const tooltipEl = document.getElementById("wm-tooltip");
8823
- tooltipEl.classList.remove("open");
8824
- }
8825
- function positionTooltip(tPos, anchorEl, tooltipEl) {
8826
- const tooltipHeight = tooltipEl.getBoundingClientRect().height;
8827
- const tooltipWidth = tooltipEl.getBoundingClientRect().width;
8828
- // to get the center positions, calculate the difference between the button width and the tooltip width
8829
- const verticalDiff = (anchorEl.getBoundingClientRect().height - tooltipHeight) / 2;
8830
- const horizontalDiff = (anchorEl.getBoundingClientRect().width - tooltipWidth) / 2;
8831
- // the naming convention defaults to center in the absence of a value
8832
- // "top" and "bottom" imply centering horizontally; "right" and "left" imply centering vertically
8833
- // therefore we first set to center and adjust accordingly
8834
- let verticalPos = anchorEl.getBoundingClientRect().top + verticalDiff;
8835
- let horizontalPos = anchorEl.getBoundingClientRect().left + horizontalDiff;
8836
- if (tPos.includes("top")) {
8837
- verticalPos = anchorEl.getBoundingClientRect().top - tooltipHeight - 8;
8838
- }
8839
- if (tPos.includes("bottom")) {
8840
- verticalPos = anchorEl.getBoundingClientRect().bottom + 8;
8841
- }
8842
- if (tPos.includes("left")) {
8843
- horizontalPos = anchorEl.getBoundingClientRect().left - tooltipWidth - 8;
8844
- }
8845
- if (tPos.includes("right")) {
8846
- horizontalPos = anchorEl.getBoundingClientRect().right + 8;
8847
- }
8848
- // after all positioning has been calculated, if tooltip is off-screen or closer than 24px it is readjusted
8849
- // this only occurs when the tooltip is overflowing to the left and is positioned top or bottom
8850
- // (button placed too far left, or screen size under 268px)
8851
- horizontalPos = Math.max(horizontalPos, 24);
8852
- tooltipEl.style.setProperty("--wmTooltipTop", verticalPos + "px");
8853
- tooltipEl.style.setProperty("--wmTooltipLeft", horizontalPos + "px");
8854
- }
8855
- function hasRoomRight(x, spaceNeeded) {
8856
- let horizOffset = 0;
8857
- // if (getTextDir() === "ltr") {
8858
- if (x.type === "click") {
8859
- // if it's a mouse event, deal with mouse coords
8860
- horizOffset = x.clientX;
8861
- // if it's a focus event, the offset is 0
8862
- }
8863
- else if (x.type === "focus") {
8864
- horizOffset = 0;
8865
- }
8866
- else {
8867
- // otherwise an element was passed, calculate how far it is from the edge of the window
8868
- let el = x; // re-assignment is for clarity
8869
- while (el) {
8870
- if (el.tagName == "BODY") {
8871
- // deal with browser quirks with body/window/document and page scroll
8872
- var xScroll = el.scrollLeft || document.documentElement.scrollLeft;
8873
- horizOffset += el.offsetLeft - xScroll + el.clientLeft;
8874
- }
8875
- else {
8876
- // for all other non-BODY elements
8877
- horizOffset += el.offsetLeft - el.scrollLeft + el.clientLeft;
8878
- }
8879
- el = el.offsetParent;
8880
- }
8881
- // }
8882
- }
8883
- return window.innerWidth - horizOffset >= spaceNeeded;
8884
- }
8885
- function checkForActiveElInShadow(element) {
8886
- while (element && element.shadowRoot) {
8887
- element = element.shadowRoot.activeElement;
8888
- }
8889
- return element;
8890
- }
8891
- function checkForFocusableElInShadow(element) {
8892
- const selectors = [
8893
- "button",
8894
- "a",
8895
- "input",
8896
- "select",
8897
- "textarea",
8898
- "wm-button",
8899
- "wm-search",
8900
- "wm-select",
8901
- "wm-action-menu",
8902
- "wm-tab-item",
8903
- "wm-datepicker",
8904
- ];
8905
- let focusableEl = element;
8906
- selectors.forEach((selector) => {
8907
- if (focusableEl && focusableEl.shadowRoot) {
8908
- let elInShadow = focusableEl.shadowRoot.querySelector(selector);
8909
- if (elInShadow) {
8910
- if (selector.startsWith("wm-")) {
8911
- focusableEl = checkForFocusableElInShadow(elInShadow);
8912
- }
8913
- else {
8914
- focusableEl = elInShadow;
8915
- }
8916
- }
8917
- }
8918
- });
8919
- return focusableEl;
8920
- }
8921
- function hasValidType(file, types) {
8922
- const acceptedExtensions = types.split(" ");
8923
- const parts = file.name && file.name.split(".");
8924
- const ext = parts && parts.length > 1 && parts[parts.length - 1];
8925
- return ext
8926
- ? acceptedExtensions.includes(ext.toLowerCase())
8927
- : // fallback: if we couldn't obtain an extension,
8928
- // validate based on MIME type...
8929
- !!file.type
8930
- ? getAcceptedMimeTypesList(acceptedExtensions).includes(file.type)
8931
- : // ...and if that failed too, accept the file
8932
- // as it's preferable to accept an invalid file
8933
- // than refusing a valid one (back-end will take care of what slips through)
8934
- true;
8935
- }
8936
- // takes a string (space separated list of extensions), returns an array of strings (corresponding MIME types)
8937
- function getAcceptedMimeTypesList(acceptedExtensions) {
8938
- // this is just a list of common file types (regardless of whether they are/can be valid or not)
8939
- // front end checks are just a convenience to users, independent of security.
8940
- // it allows users to be notified of an invalid type as soon as they select the file, rather than when it gets uploaded
8941
- const lookupTable = {
8942
- aac: ["audio/aac"],
8943
- abw: ["application/x-abiword"],
8944
- arc: ["application/x-freearc"],
8945
- avi: ["video/x-msvideo"],
8946
- azw: ["application/vnd.amazon.ebook"],
8947
- bin: ["application/octet-stream"],
8948
- bmp: ["image/bmp"],
8949
- bz: ["application/x-bzip"],
8950
- bz2: ["application/x-bzip2"],
8951
- csh: ["application/x-csh"],
8952
- css: ["text/css"],
8953
- csv: ["text/csv"],
8954
- doc: ["application/msword"],
8955
- docx: ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
8956
- eot: ["application/vnd.ms-fontobject"],
8957
- epub: ["application/epub+zip"],
8958
- gz: ["application/gzip"],
8959
- gif: ["image/gif"],
8960
- htm: ["text/html"],
8961
- html: ["text/html"],
8962
- ico: ["image/vnd.microsoft.icon"],
8963
- ics: ["text/calendar"],
8964
- jar: ["application/java-archive"],
8965
- jpeg: ["image/jpeg"],
8966
- jpg: ["image/jpeg"],
8967
- js: ["text/javascript"],
8968
- json: ["application/json"],
8969
- jsonld: ["application/ld+json"],
8970
- log: ["text/plain"],
8971
- mid: ["audio/x-midi"],
8972
- midi: ["audio/x-midi"],
8973
- mjs: ["text/javascript"],
8974
- mp3: ["audio/mpeg"],
8975
- mpeg: ["video/mpeg"],
8976
- mpkg: ["application/vnd.apple.installer+xml"],
8977
- odp: ["application/vnd.oasis.opendocument.presentation"],
8978
- ods: ["application/vnd.oasis.opendocument.spreadsheet"],
8979
- odt: ["application/vnd.oasis.opendocument.text"],
8980
- oga: ["audio/ogg"],
8981
- ogv: ["video/ogg"],
8982
- ogx: ["application/ogg"],
8983
- opus: ["audio/opus"],
8984
- otf: ["font/otf"],
8985
- png: ["image/png"],
8986
- pdf: ["application/pdf"],
8987
- php: ["application/php"],
8988
- ppt: ["application/vnd.ms-powerpoint"],
8989
- pptx: ["application/vnd.openxmlformats-officedocument.presentationml.presentation"],
8990
- rar: ["application/vnd.rar", "application/x-rar", "application/x-rar-compressed"],
8991
- rtf: ["application/rtf"],
8992
- sh: ["application/x-sh"],
8993
- svg: ["image/svg+xml"],
8994
- swf: ["application/x-shockwave-flash"],
8995
- tar: ["application/x-tar"],
8996
- tif: ["image/tiff"],
8997
- tiff: ["image/tiff"],
8998
- ts: ["video/mp2t"],
8999
- ttf: ["font/ttf"],
9000
- txt: ["text/plain"],
9001
- vsd: ["application/vnd.visio"],
9002
- wav: ["audio/wav"],
9003
- weba: ["audio/webm"],
9004
- webm: ["video/webm"],
9005
- webp: ["image/webp"],
9006
- woff: ["font/woff"],
9007
- woff2: ["font/woff2"],
9008
- xhtml: ["application/xhtml+xml"],
9009
- xls: ["application/vnd.ms-excel"],
9010
- xlsx: ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
9011
- xml: ["application/xml", "text/xml"],
9012
- xul: ["application/vnd.mozilla.xul+xml"],
9013
- zip: ["application/zip", "application/x-zip-compressed", "multipart/x-zip"],
9014
- "3gp": ["video/3gpp", "audio/3gpp"],
9015
- "3g2": ["video/3gpp2", "audio/3gpp2"],
9016
- "7z": ["application/x-7z-compressed"],
9017
- };
9018
- return acceptedExtensions.reduce((acc, ext) => acc.concat(lookupTable[ext]), []);
9019
- }
9020
- function snakeCaseToCamelCase(str) {
9021
- const snakeCaseRegexp = /^([a-z0-9]*)(_[a-z0-9]*)*$/g;
9022
- if (snakeCaseRegexp.test(str)) {
9023
- let camelCase = "";
9024
- let arr = str.split("_");
9025
- arr.forEach((word, idx) => {
9026
- camelCase += idx === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1);
9027
- });
9028
- return camelCase;
9029
- }
9030
- else {
9031
- return str;
9032
- }
9033
- }
9034
- function csvToArray(csv) {
9035
- return csv ? csv.split(/, ?/) : [];
9036
- }
9037
- function getNewIndexToFocus(currentIndex, direction, listLength) {
9038
- let newIndex = currentIndex;
9039
- if (direction === "ArrowDown") {
9040
- newIndex = (currentIndex + 1) % listLength;
9041
- }
9042
- if (direction === "ArrowUp") {
9043
- newIndex = currentIndex === 0 ? listLength - 1 : currentIndex - 1;
9044
- }
9045
- return newIndex;
9046
- }
9047
- function isRelatedTarget(ev, id) {
9048
- // used for onBlur events to check the element that has been clicked
9049
- const ids = id.split(" ");
9050
- return ev.relatedTarget && ids.includes(ev.relatedTarget.id);
9051
- }
9052
- function toBool(val) {
9053
- // string "false" needs to be treated as bool False because react wrappers convert bool to string.
9054
- return val == "false" ? false : !!val;
9055
- }
9056
- function measureText(originEl, placeholderText) {
9057
- const measurementEl = document.createElement("div");
9058
- const originStyles = getComputedStyle(originEl);
9059
- measurementEl.style.position = "absolute";
9060
- measurementEl.style.top = "-100vh";
9061
- measurementEl.style.fontFamily = originStyles.fontFamily;
9062
- measurementEl.style.fontWeight = originStyles.fontWeight;
9063
- measurementEl.style.fontSize = originStyles.fontSize;
9064
- measurementEl.textContent = placeholderText;
9065
- document.body.appendChild(measurementEl);
9066
- const boundingClientRect = measurementEl.getBoundingClientRect();
9067
- document.body.removeChild(measurementEl);
9068
- return boundingClientRect;
9069
- }
9070
- function safeParseJSON(toParse) {
9071
- // JSON.parse will throw an exception if the string provided is not in the proper format
9072
- // instead of the exception, just return null and let other logic check
9073
- try {
9074
- return JSON.parse(toParse);
9075
- }
9076
- catch (e) {
9077
- return null;
9078
- }
9079
- }
9080
- function truncateText(textEl, text, availableSpace, endAmt) {
9081
- const cloneEl = document.createElement("div");
9082
- cloneEl.style.visibility = "hidden";
9083
- cloneEl.style.position = "absolute";
9084
- cloneEl.style.top = "-200vh";
9085
- cloneEl.style.left = "-200vh";
9086
- cloneEl.textContent = text;
9087
- textEl.appendChild(cloneEl);
9088
- const ellipses = "...";
9089
- const minimumLength = 2 + ellipses.length + endAmt;
9090
- let canFitText = availableSpace > cloneEl.clientWidth;
9091
- if (!canFitText && text.length > minimumLength) {
9092
- let frontChars = text.slice(0, text.length - endAmt - ellipses.length).trim();
9093
- let endChars = text.slice(-endAmt).trim();
9094
- let truncatedText = frontChars + ellipses + endChars;
9095
- cloneEl.textContent = truncatedText;
9096
- canFitText = availableSpace > cloneEl.clientWidth;
9097
- while (!canFitText && truncatedText.length > minimumLength) {
9098
- frontChars = frontChars.slice(0, -1).trim();
9099
- truncatedText = frontChars + ellipses + endChars;
9100
- cloneEl.textContent = truncatedText;
9101
- canFitText = availableSpace > cloneEl.clientWidth;
9102
- }
9103
- }
9104
- const truncatedText = cloneEl.textContent;
9105
- cloneEl.remove();
9106
- return truncatedText;
8604
+ const DEFAULT_LANGUAGE = "en";
8605
+ function getBrowserLang() {
8606
+ const langAttr = document.documentElement.getAttribute("lang");
8607
+ if (!!langAttr) {
8608
+ return langAttr;
8609
+ }
8610
+ else if (window.navigator && window.navigator.language) {
8611
+ const lang = window.navigator.languages ? window.navigator.languages[0] : window.navigator.language;
8612
+ return lang.slice(0, 2);
8613
+ }
8614
+ else {
8615
+ return DEFAULT_LANGUAGE;
8616
+ }
8617
+ }
8618
+ // prevents memory leak
8619
+ const cache = createIntlCache();
8620
+ const locale = getBrowserLang();
8621
+ const intl = createIntl({
8622
+ locale: locale,
8623
+ defaultLocale: "en",
8624
+ messages: lang[locale] || en,
8625
+ }, cache);
8626
+ function generateId() {
8627
+ return "wmcl-" + Math.random().toString(36).substr(2, 10);
8628
+ }
8629
+ // limits how many times a function fires
8630
+ // use when the function should run periodically, but not too often (e.g. window resize)
8631
+ function throttle(fn, wait) {
8632
+ let timeout;
8633
+ let shouldWait = false;
8634
+ return function () {
8635
+ const context = this;
8636
+ if (!shouldWait) {
8637
+ fn.apply(context, arguments);
8638
+ shouldWait = true;
8639
+ clearTimeout(timeout);
8640
+ timeout = setTimeout(function () {
8641
+ shouldWait = false;
8642
+ }, wait);
8643
+ }
8644
+ };
8645
+ }
8646
+ // waits until it hasn't been called for [timeout] ms.
8647
+ // use when the function should run only after something (event) is done firing
8648
+ function debounce(fn, wait) {
8649
+ let timeout;
8650
+ return function () {
8651
+ const context = this;
8652
+ const functionCall = () => fn.apply(context, arguments);
8653
+ clearTimeout(timeout);
8654
+ timeout = setTimeout(functionCall, wait);
8655
+ };
8656
+ }
8657
+ function getTextDir() {
8658
+ const dir = document.querySelector("html").getAttribute("dir");
8659
+ return dir ? dir.toLowerCase() : "";
8660
+ }
8661
+ function getPosition(el) {
8662
+ const coords = el.getBoundingClientRect();
8663
+ let x = coords.x;
8664
+ let y = coords.y;
8665
+ // Edge doesn't have x and y
8666
+ if (!x) {
8667
+ if (getTextDir() === "rtl") {
8668
+ x = coords.right;
8669
+ }
8670
+ else {
8671
+ x = coords.left;
8672
+ }
8673
+ y = coords.top;
8674
+ }
8675
+ return { x, y };
8676
+ }
8677
+ function findParentWithScrollbar(el) {
8678
+ while (!!el) {
8679
+ if (el.scrollHeight > el.clientHeight && ["scroll", "auto"].includes(window.getComputedStyle(el).overflowY)) {
8680
+ return el;
8681
+ }
8682
+ el = el.parentElement;
8683
+ }
8684
+ }
8685
+ function findParentWithHiddenOverflow(el) {
8686
+ while (!!el) {
8687
+ if (window.getComputedStyle(el).overflowY !== "visible") {
8688
+ return el;
8689
+ }
8690
+ el = el.parentElement;
8691
+ }
8692
+ }
8693
+ function getClosableElementMeasurements(fixedEl, closableEl) {
8694
+ const parent = findParentWithHiddenOverflow(fixedEl);
8695
+ // if parent is not found, measurements are checked against the viewport
8696
+ return {
8697
+ closableElHeight: closableEl.clientHeight,
8698
+ closableElWidth: closableEl.clientWidth,
8699
+ // NB boundingClientRect.bottom is space from top of viewport to bottom of el
8700
+ // to get space below the el -> height of viewport minus boundingClientRect.bottom
8701
+ spaceAbove: parent
8702
+ ? fixedEl.getBoundingClientRect().top - parent.getBoundingClientRect().top
8703
+ : fixedEl.getBoundingClientRect().top,
8704
+ // NB boundingClientRect.bottom is space from top of viewport to bottom of el
8705
+ // to get space below the el -> height of viewport minus boundingClientRect.bottom
8706
+ spaceBelow: parent
8707
+ ? parent.getBoundingClientRect().bottom - fixedEl.getBoundingClientRect().bottom
8708
+ : document.documentElement.clientHeight - fixedEl.getBoundingClientRect().bottom,
8709
+ spaceLeft: parent
8710
+ ? fixedEl.getBoundingClientRect().left - parent.getBoundingClientRect().left
8711
+ : fixedEl.getBoundingClientRect().left,
8712
+ spaceRight: parent
8713
+ ? parent.getBoundingClientRect().right - fixedEl.getBoundingClientRect().right
8714
+ : document.documentElement.clientWidth - fixedEl.getBoundingClientRect().right,
8715
+ };
8716
+ }
8717
+ function shouldOpenUp(fixedEl, //the element visible on the page when the component is closed
8718
+ closableEl, //the dropdown/popup/etc that becomes visible when the component is open
8719
+ offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
8720
+ offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
8721
+ ) {
8722
+ const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
8723
+ //we want to open up only if there's not enough space below AND there is enough space above
8724
+ const openUp = closableElHeight > spaceBelow + offsetBelow && closableElHeight <= spaceAbove + offsetAbove;
8725
+ return openUp;
8726
+ }
8727
+ function shouldOpenDown(fixedEl, //the element visible on the page when the component is closed
8728
+ closableEl, //the dropdown/popup/etc that becomes visible when the component is open
8729
+ offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
8730
+ offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
8731
+ ) {
8732
+ const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
8733
+ //we want to open up only if there's not enough space below AND there is enough space above
8734
+ const openDown = closableElHeight > spaceAbove + offsetAbove && closableElHeight <= spaceBelow + offsetBelow;
8735
+ return openDown;
8736
+ }
8737
+ function shouldShiftRight(fixedEl, closableEl) {
8738
+ const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
8739
+ const needsSpaceLeft = closableElWidth > spaceLeft && spaceRight > spaceLeft;
8740
+ return needsSpaceLeft;
8741
+ }
8742
+ function shouldShiftLeft(fixedEl, closableEl) {
8743
+ const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
8744
+ const needsSpaceRight = closableElWidth > spaceRight && spaceLeft > spaceRight;
8745
+ return needsSpaceRight;
8746
+ }
8747
+ function adjustTooltipPlacement(tPos, el, tooltipEl) {
8748
+ const { spaceLeft, spaceRight, spaceBelow, spaceAbove } = getClosableElementMeasurements(el, tooltipEl);
8749
+ const tooltipWidth = tooltipEl.getBoundingClientRect().width;
8750
+ const tooltipHeight = tooltipEl.getBoundingClientRect().height;
8751
+ const enoughSpaceAbove = spaceAbove > tooltipHeight;
8752
+ const enoughSpaceBelow = spaceBelow > tooltipHeight;
8753
+ // a tooltip should never be closer than 24px to the edge of a screen
8754
+ const enoughSpaceLeft = spaceLeft - 24 > tooltipWidth;
8755
+ const enoughSpaceRight = spaceRight - 24 > tooltipWidth;
8756
+ const swapAbove = (position) => {
8757
+ return !enoughSpaceAbove ? position.replace("top", "bottom") : position;
8758
+ };
8759
+ const swapBelow = (position) => {
8760
+ return !enoughSpaceBelow && enoughSpaceAbove ? position.replace("bottom", "top") : position;
8761
+ };
8762
+ const swapLeft = (position, centeredPosition) => {
8763
+ if (!enoughSpaceLeft && enoughSpaceRight) {
8764
+ position = position.replace("left", "right");
8765
+ }
8766
+ else if (!enoughSpaceLeft && !enoughSpaceRight) {
8767
+ position = centeredPosition;
8768
+ }
8769
+ return position;
8770
+ };
8771
+ const swapRight = (position, centeredPosition) => {
8772
+ if (!enoughSpaceRight && enoughSpaceLeft) {
8773
+ position = position.replace("right", "left");
8774
+ }
8775
+ else if (!enoughSpaceRight && !enoughSpaceLeft) {
8776
+ position = centeredPosition;
8777
+ }
8778
+ return position;
8779
+ };
8780
+ // horizontal checks must occur before vertical checks, because horizontal can affect vertical positioning but not vice versa
8781
+ switch (tPos) {
8782
+ case "left":
8783
+ tPos = swapLeft(tPos, "bottom");
8784
+ case "right":
8785
+ tPos = swapRight(tPos, "bottom");
8786
+ case "top-left":
8787
+ tPos = swapLeft(tPos, "top");
8788
+ tPos = swapAbove(tPos);
8789
+ case "top-right":
8790
+ tPos = swapRight(tPos, "top");
8791
+ tPos = swapAbove(tPos);
8792
+ case "bottom-left":
8793
+ tPos = swapLeft(tPos, "bottom");
8794
+ tPos = swapBelow(tPos);
8795
+ case "bottom-right":
8796
+ tPos = swapRight(tPos, "bottom");
8797
+ tPos = swapBelow(tPos);
8798
+ case "top":
8799
+ tPos = swapAbove(tPos);
8800
+ case "bottom":
8801
+ tPos = swapBelow(tPos);
8802
+ }
8803
+ return tPos;
8804
+ }
8805
+ function showTooltip(position, anchorEl, tooltipText) {
8806
+ const tooltipEl = document.getElementById("wm-tooltip");
8807
+ tooltipEl.textContent = tooltipText;
8808
+ // tooltip only has a maxWidth if it contains whitespace and can break
8809
+ const hasNoWhitespace = tooltipText.match(/^[^\s]+$/);
8810
+ if (hasNoWhitespace) {
8811
+ tooltipEl.classList.add("single-word");
8812
+ tooltipEl.style.setProperty("--wmTooltipMaxWidth", "none");
8813
+ }
8814
+ else {
8815
+ tooltipEl.classList.remove("single-word");
8816
+ tooltipEl.style.removeProperty("--wmTooltipMaxWidth");
8817
+ }
8818
+ positionTooltip(position, anchorEl, tooltipEl);
8819
+ tooltipEl.classList.add("open");
8820
+ }
8821
+ function hideTooltip() {
8822
+ const tooltipEl = document.getElementById("wm-tooltip");
8823
+ tooltipEl.classList.remove("open");
8824
+ }
8825
+ function positionTooltip(tPos, anchorEl, tooltipEl) {
8826
+ const tooltipHeight = tooltipEl.getBoundingClientRect().height;
8827
+ const tooltipWidth = tooltipEl.getBoundingClientRect().width;
8828
+ // to get the center positions, calculate the difference between the button width and the tooltip width
8829
+ const verticalDiff = (anchorEl.getBoundingClientRect().height - tooltipHeight) / 2;
8830
+ const horizontalDiff = (anchorEl.getBoundingClientRect().width - tooltipWidth) / 2;
8831
+ // the naming convention defaults to center in the absence of a value
8832
+ // "top" and "bottom" imply centering horizontally; "right" and "left" imply centering vertically
8833
+ // therefore we first set to center and adjust accordingly
8834
+ let verticalPos = anchorEl.getBoundingClientRect().top + verticalDiff;
8835
+ let horizontalPos = anchorEl.getBoundingClientRect().left + horizontalDiff;
8836
+ if (tPos.includes("top")) {
8837
+ verticalPos = anchorEl.getBoundingClientRect().top - tooltipHeight - 8;
8838
+ }
8839
+ if (tPos.includes("bottom")) {
8840
+ verticalPos = anchorEl.getBoundingClientRect().bottom + 8;
8841
+ }
8842
+ if (tPos.includes("left")) {
8843
+ horizontalPos = anchorEl.getBoundingClientRect().left - tooltipWidth - 8;
8844
+ }
8845
+ if (tPos.includes("right")) {
8846
+ horizontalPos = anchorEl.getBoundingClientRect().right + 8;
8847
+ }
8848
+ // after all positioning has been calculated, if tooltip is off-screen or closer than 24px it is readjusted
8849
+ // this only occurs when the tooltip is overflowing to the left and is positioned top or bottom
8850
+ // (button placed too far left, or screen size under 268px)
8851
+ horizontalPos = Math.max(horizontalPos, 24);
8852
+ tooltipEl.style.setProperty("--wmTooltipTop", verticalPos + "px");
8853
+ tooltipEl.style.setProperty("--wmTooltipLeft", horizontalPos + "px");
8854
+ }
8855
+ function hasRoomRight(x, spaceNeeded) {
8856
+ let horizOffset = 0;
8857
+ // if (getTextDir() === "ltr") {
8858
+ if (x.type === "click") {
8859
+ // if it's a mouse event, deal with mouse coords
8860
+ horizOffset = x.clientX;
8861
+ // if it's a focus event, the offset is 0
8862
+ }
8863
+ else if (x.type === "focus") {
8864
+ horizOffset = 0;
8865
+ }
8866
+ else {
8867
+ // otherwise an element was passed, calculate how far it is from the edge of the window
8868
+ let el = x; // re-assignment is for clarity
8869
+ while (el) {
8870
+ if (el.tagName == "BODY") {
8871
+ // deal with browser quirks with body/window/document and page scroll
8872
+ var xScroll = el.scrollLeft || document.documentElement.scrollLeft;
8873
+ horizOffset += el.offsetLeft - xScroll + el.clientLeft;
8874
+ }
8875
+ else {
8876
+ // for all other non-BODY elements
8877
+ horizOffset += el.offsetLeft - el.scrollLeft + el.clientLeft;
8878
+ }
8879
+ el = el.offsetParent;
8880
+ }
8881
+ // }
8882
+ }
8883
+ return window.innerWidth - horizOffset >= spaceNeeded;
8884
+ }
8885
+ function checkForActiveElInShadow(element) {
8886
+ while (element && element.shadowRoot) {
8887
+ element = element.shadowRoot.activeElement;
8888
+ }
8889
+ return element;
8890
+ }
8891
+ function checkForFocusableElInShadow(element) {
8892
+ const selectors = [
8893
+ "button",
8894
+ "a",
8895
+ "input",
8896
+ "select",
8897
+ "textarea",
8898
+ "wm-button",
8899
+ "wm-search",
8900
+ "wm-select",
8901
+ "wm-action-menu",
8902
+ "wm-tab-item",
8903
+ "wm-datepicker",
8904
+ ];
8905
+ let focusableEl = element;
8906
+ selectors.forEach((selector) => {
8907
+ if (focusableEl && focusableEl.shadowRoot) {
8908
+ let elInShadow = focusableEl.shadowRoot.querySelector(selector);
8909
+ if (elInShadow) {
8910
+ if (selector.startsWith("wm-")) {
8911
+ focusableEl = checkForFocusableElInShadow(elInShadow);
8912
+ }
8913
+ else {
8914
+ focusableEl = elInShadow;
8915
+ }
8916
+ }
8917
+ }
8918
+ });
8919
+ return focusableEl;
8920
+ }
8921
+ function hasValidType(file, types) {
8922
+ const acceptedExtensions = types.split(" ");
8923
+ const parts = file.name && file.name.split(".");
8924
+ const ext = parts && parts.length > 1 && parts[parts.length - 1];
8925
+ return ext
8926
+ ? acceptedExtensions.includes(ext.toLowerCase())
8927
+ : // fallback: if we couldn't obtain an extension,
8928
+ // validate based on MIME type...
8929
+ !!file.type
8930
+ ? getAcceptedMimeTypesList(acceptedExtensions).includes(file.type)
8931
+ : // ...and if that failed too, accept the file
8932
+ // as it's preferable to accept an invalid file
8933
+ // than refusing a valid one (back-end will take care of what slips through)
8934
+ true;
8935
+ }
8936
+ // takes a string (space separated list of extensions), returns an array of strings (corresponding MIME types)
8937
+ function getAcceptedMimeTypesList(acceptedExtensions) {
8938
+ // this is just a list of common file types (regardless of whether they are/can be valid or not)
8939
+ // front end checks are just a convenience to users, independent of security.
8940
+ // it allows users to be notified of an invalid type as soon as they select the file, rather than when it gets uploaded
8941
+ const lookupTable = {
8942
+ aac: ["audio/aac"],
8943
+ abw: ["application/x-abiword"],
8944
+ arc: ["application/x-freearc"],
8945
+ avi: ["video/x-msvideo"],
8946
+ azw: ["application/vnd.amazon.ebook"],
8947
+ bin: ["application/octet-stream"],
8948
+ bmp: ["image/bmp"],
8949
+ bz: ["application/x-bzip"],
8950
+ bz2: ["application/x-bzip2"],
8951
+ csh: ["application/x-csh"],
8952
+ css: ["text/css"],
8953
+ csv: ["text/csv"],
8954
+ doc: ["application/msword"],
8955
+ docx: ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
8956
+ eot: ["application/vnd.ms-fontobject"],
8957
+ epub: ["application/epub+zip"],
8958
+ gz: ["application/gzip"],
8959
+ gif: ["image/gif"],
8960
+ htm: ["text/html"],
8961
+ html: ["text/html"],
8962
+ ico: ["image/vnd.microsoft.icon"],
8963
+ ics: ["text/calendar"],
8964
+ jar: ["application/java-archive"],
8965
+ jpeg: ["image/jpeg"],
8966
+ jpg: ["image/jpeg"],
8967
+ js: ["text/javascript"],
8968
+ json: ["application/json"],
8969
+ jsonld: ["application/ld+json"],
8970
+ log: ["text/plain"],
8971
+ mid: ["audio/x-midi"],
8972
+ midi: ["audio/x-midi"],
8973
+ mjs: ["text/javascript"],
8974
+ mp3: ["audio/mpeg"],
8975
+ mpeg: ["video/mpeg"],
8976
+ mpkg: ["application/vnd.apple.installer+xml"],
8977
+ odp: ["application/vnd.oasis.opendocument.presentation"],
8978
+ ods: ["application/vnd.oasis.opendocument.spreadsheet"],
8979
+ odt: ["application/vnd.oasis.opendocument.text"],
8980
+ oga: ["audio/ogg"],
8981
+ ogv: ["video/ogg"],
8982
+ ogx: ["application/ogg"],
8983
+ opus: ["audio/opus"],
8984
+ otf: ["font/otf"],
8985
+ png: ["image/png"],
8986
+ pdf: ["application/pdf"],
8987
+ php: ["application/php"],
8988
+ ppt: ["application/vnd.ms-powerpoint"],
8989
+ pptx: ["application/vnd.openxmlformats-officedocument.presentationml.presentation"],
8990
+ rar: ["application/vnd.rar", "application/x-rar", "application/x-rar-compressed"],
8991
+ rtf: ["application/rtf"],
8992
+ sh: ["application/x-sh"],
8993
+ svg: ["image/svg+xml"],
8994
+ swf: ["application/x-shockwave-flash"],
8995
+ tar: ["application/x-tar"],
8996
+ tif: ["image/tiff"],
8997
+ tiff: ["image/tiff"],
8998
+ ts: ["video/mp2t"],
8999
+ ttf: ["font/ttf"],
9000
+ txt: ["text/plain"],
9001
+ vsd: ["application/vnd.visio"],
9002
+ wav: ["audio/wav"],
9003
+ weba: ["audio/webm"],
9004
+ webm: ["video/webm"],
9005
+ webp: ["image/webp"],
9006
+ woff: ["font/woff"],
9007
+ woff2: ["font/woff2"],
9008
+ xhtml: ["application/xhtml+xml"],
9009
+ xls: ["application/vnd.ms-excel"],
9010
+ xlsx: ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
9011
+ xml: ["application/xml", "text/xml"],
9012
+ xul: ["application/vnd.mozilla.xul+xml"],
9013
+ zip: ["application/zip", "application/x-zip-compressed", "multipart/x-zip"],
9014
+ "3gp": ["video/3gpp", "audio/3gpp"],
9015
+ "3g2": ["video/3gpp2", "audio/3gpp2"],
9016
+ "7z": ["application/x-7z-compressed"],
9017
+ };
9018
+ return acceptedExtensions.reduce((acc, ext) => acc.concat(lookupTable[ext]), []);
9019
+ }
9020
+ function snakeCaseToCamelCase(str) {
9021
+ const snakeCaseRegexp = /^([a-z0-9]*)(_[a-z0-9]*)*$/g;
9022
+ if (snakeCaseRegexp.test(str)) {
9023
+ let camelCase = "";
9024
+ let arr = str.split("_");
9025
+ arr.forEach((word, idx) => {
9026
+ camelCase += idx === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1);
9027
+ });
9028
+ return camelCase;
9029
+ }
9030
+ else {
9031
+ return str;
9032
+ }
9033
+ }
9034
+ function csvToArray(csv) {
9035
+ return csv ? csv.split(/, ?/) : [];
9036
+ }
9037
+ function getNewIndexToFocus(currentIndex, direction, listLength) {
9038
+ let newIndex = currentIndex;
9039
+ if (direction === "ArrowDown") {
9040
+ newIndex = (currentIndex + 1) % listLength;
9041
+ }
9042
+ if (direction === "ArrowUp") {
9043
+ newIndex = currentIndex === 0 ? listLength - 1 : currentIndex - 1;
9044
+ }
9045
+ return newIndex;
9046
+ }
9047
+ function isRelatedTarget(ev, id) {
9048
+ // used for onBlur events to check the element that has been clicked
9049
+ const ids = id.split(" ");
9050
+ return ev.relatedTarget && ids.includes(ev.relatedTarget.id);
9051
+ }
9052
+ function toBool(val) {
9053
+ // string "false" needs to be treated as bool False because react wrappers convert bool to string.
9054
+ return val == "false" ? false : !!val;
9055
+ }
9056
+ function measureText(originEl, placeholderText) {
9057
+ const measurementEl = document.createElement("div");
9058
+ const originStyles = getComputedStyle(originEl);
9059
+ measurementEl.style.position = "absolute";
9060
+ measurementEl.style.top = "-100vh";
9061
+ measurementEl.style.fontFamily = originStyles.fontFamily;
9062
+ measurementEl.style.fontWeight = originStyles.fontWeight;
9063
+ measurementEl.style.fontSize = originStyles.fontSize;
9064
+ measurementEl.textContent = placeholderText;
9065
+ document.body.appendChild(measurementEl);
9066
+ const boundingClientRect = measurementEl.getBoundingClientRect();
9067
+ document.body.removeChild(measurementEl);
9068
+ return boundingClientRect;
9069
+ }
9070
+ function safeParseJSON(toParse) {
9071
+ // JSON.parse will throw an exception if the string provided is not in the proper format
9072
+ // instead of the exception, just return null and let other logic check
9073
+ try {
9074
+ return JSON.parse(toParse);
9075
+ }
9076
+ catch (e) {
9077
+ return null;
9078
+ }
9079
+ }
9080
+ function truncateText(textEl, text, availableSpace, endAmt) {
9081
+ const cloneEl = document.createElement("div");
9082
+ cloneEl.style.visibility = "hidden";
9083
+ cloneEl.style.position = "absolute";
9084
+ cloneEl.style.top = "-200vh";
9085
+ cloneEl.style.left = "-200vh";
9086
+ cloneEl.textContent = text;
9087
+ textEl.appendChild(cloneEl);
9088
+ const ellipses = "...";
9089
+ const minimumLength = 2 + ellipses.length + endAmt;
9090
+ let canFitText = availableSpace > cloneEl.clientWidth;
9091
+ if (!canFitText && text.length > minimumLength) {
9092
+ let frontChars = text.slice(0, text.length - endAmt - ellipses.length).trim();
9093
+ let endChars = text.slice(-endAmt).trim();
9094
+ let truncatedText = frontChars + ellipses + endChars;
9095
+ cloneEl.textContent = truncatedText;
9096
+ canFitText = availableSpace > cloneEl.clientWidth;
9097
+ while (!canFitText && truncatedText.length > minimumLength) {
9098
+ frontChars = frontChars.slice(0, -1).trim();
9099
+ truncatedText = frontChars + ellipses + endChars;
9100
+ cloneEl.textContent = truncatedText;
9101
+ canFitText = availableSpace > cloneEl.clientWidth;
9102
+ }
9103
+ }
9104
+ const truncatedText = cloneEl.textContent;
9105
+ cloneEl.remove();
9106
+ return truncatedText;
9107
9107
  }
9108
9108
 
9109
9109
  exports.adjustTooltipPlacement = adjustTooltipPlacement;