@watermarkinsights/ripple 3.8.0-3 → 3.8.0-6

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 (333) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/{functions-9b5b7f3c.js → functions-1f0edc61.js} +533 -487
  3. package/dist/cjs/{global-fad306c8.js → global-8a3fc646.js} +65 -65
  4. package/dist/cjs/{http-service-494d81de.js → http-service-9e8c4dd5.js} +49 -49
  5. package/dist/cjs/{index-cd179539.js → index-0e7e3668.js} +96 -64
  6. package/dist/cjs/{interfaces-a3338581.js → interfaces-30a74c1f.js} +29 -29
  7. package/dist/cjs/loader.cjs.js +4 -4
  8. package/dist/cjs/priv-chart-popover.cjs.entry.js +79 -79
  9. package/dist/cjs/priv-datepicker.cjs.entry.js +674 -674
  10. package/dist/cjs/priv-navigator-button.cjs.entry.js +19 -19
  11. package/dist/cjs/priv-navigator-item.cjs.entry.js +24 -24
  12. package/dist/cjs/ripple.cjs.js +4 -4
  13. package/dist/cjs/wm-action-menu_2.cjs.entry.js +342 -342
  14. package/dist/cjs/wm-button.cjs.entry.js +228 -228
  15. package/dist/cjs/wm-chart-slice.cjs.entry.js +14 -14
  16. package/dist/cjs/wm-chart.cjs.entry.js +475 -475
  17. package/dist/cjs/wm-datepicker.cjs.entry.js +273 -273
  18. package/dist/cjs/wm-input.cjs.entry.js +136 -136
  19. package/dist/cjs/wm-modal-footer.cjs.entry.js +32 -32
  20. package/dist/cjs/wm-modal-header.cjs.entry.js +35 -35
  21. package/dist/cjs/wm-modal.cjs.entry.js +164 -164
  22. package/dist/cjs/wm-navigation_3.cjs.entry.js +237 -0
  23. package/dist/cjs/wm-navigator.cjs.entry.js +269 -269
  24. package/dist/cjs/wm-network-uploader.cjs.entry.js +422 -422
  25. package/dist/cjs/wm-option_2.cjs.entry.js +497 -497
  26. package/dist/cjs/wm-pagination.cjs.entry.js +168 -168
  27. package/dist/cjs/wm-search.cjs.entry.js +233 -233
  28. package/dist/cjs/wm-snackbar.cjs.entry.js +172 -172
  29. package/dist/cjs/wm-tab-item_3.cjs.entry.js +297 -297
  30. package/dist/cjs/wm-tag-input.cjs.entry.js +581 -581
  31. package/dist/cjs/wm-timepicker.cjs.entry.js +385 -385
  32. package/dist/cjs/wm-toggletip.cjs.entry.js +126 -126
  33. package/dist/cjs/wm-uploader.cjs.entry.js +348 -348
  34. package/dist/cjs/wm-wrapper.cjs.entry.js +13 -13
  35. package/dist/collection/collection-manifest.json +12 -2
  36. package/dist/collection/components/wm-action-menu/wm-action-menu.css +0 -1
  37. package/dist/collection/components/wm-action-menu/wm-action-menu.js +460 -460
  38. package/dist/collection/components/wm-button/wm-button.css +5 -3
  39. package/dist/collection/components/wm-button/wm-button.js +491 -491
  40. package/dist/collection/components/wm-chart/priv-chart-popover/priv-chart-popover.css +0 -1
  41. package/dist/collection/components/wm-chart/priv-chart-popover/priv-chart-popover.js +232 -232
  42. package/dist/collection/components/wm-chart/wm-chart-slice.js +115 -115
  43. package/dist/collection/components/wm-chart/wm-chart.css +0 -1
  44. package/dist/collection/components/wm-chart/wm-chart.js +718 -718
  45. package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.css +3 -5
  46. package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.js +1039 -1039
  47. package/dist/collection/components/wm-datepicker/wm-datepicker.css +1 -3
  48. package/dist/collection/components/wm-datepicker/wm-datepicker.js +483 -483
  49. package/dist/collection/components/wm-input/wm-input.css +1 -3
  50. package/dist/collection/components/wm-input/wm-input.js +423 -423
  51. package/dist/collection/components/wm-menuitem/wm-menuitem.css +0 -1
  52. package/dist/collection/components/wm-menuitem/wm-menuitem.js +444 -444
  53. package/dist/collection/components/wm-modal/wm-modal-footer.css +0 -1
  54. package/dist/collection/components/wm-modal/wm-modal-footer.js +141 -141
  55. package/dist/collection/components/wm-modal/wm-modal-header.css +0 -1
  56. package/dist/collection/components/wm-modal/wm-modal-header.js +92 -92
  57. package/dist/collection/components/wm-modal/wm-modal.css +0 -1
  58. package/dist/collection/components/wm-modal/wm-modal.js +461 -461
  59. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.css +87 -0
  60. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +162 -0
  61. package/dist/collection/components/wm-navigation/wm-navigation-item.css +85 -0
  62. package/dist/collection/components/wm-navigation/wm-navigation-item.js +105 -0
  63. package/dist/collection/components/wm-navigation/wm-navigation.css +122 -0
  64. package/dist/collection/components/wm-navigation/wm-navigation.js +202 -0
  65. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.css +0 -1
  66. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +97 -97
  67. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.css +0 -1
  68. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +114 -114
  69. package/dist/collection/components/wm-navigator/wm-navigator.css +0 -1
  70. package/dist/collection/components/wm-navigator/wm-navigator.js +468 -468
  71. package/dist/collection/components/wm-option/wm-option.css +2 -4
  72. package/dist/collection/components/wm-option/wm-option.js +422 -422
  73. package/dist/collection/components/wm-pagination/wm-pagination.css +0 -1
  74. package/dist/collection/components/wm-pagination/wm-pagination.js +368 -368
  75. package/dist/collection/components/wm-search/wm-search.css +0 -1
  76. package/dist/collection/components/wm-search/wm-search.js +480 -480
  77. package/dist/collection/components/wm-select/wm-select.css +2 -4
  78. package/dist/collection/components/wm-select/wm-select.js +720 -720
  79. package/dist/collection/components/wm-snackbar/wm-snackbar.css +2 -4
  80. package/dist/collection/components/wm-snackbar/wm-snackbar.js +297 -297
  81. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.css +0 -1
  82. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +216 -216
  83. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.css +0 -1
  84. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +330 -330
  85. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.css +0 -1
  86. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +104 -104
  87. package/dist/collection/components/wm-tag-input/wm-tag-input.css +2 -4
  88. package/dist/collection/components/wm-tag-input/wm-tag-input.js +810 -810
  89. package/dist/collection/components/wm-timepicker/wm-timepicker.css +2 -4
  90. package/dist/collection/components/wm-timepicker/wm-timepicker.js +583 -583
  91. package/dist/collection/components/wm-toggletip/wm-toggletip.css +1 -3
  92. package/dist/collection/components/wm-toggletip/wm-toggletip.js +241 -241
  93. package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.css +1 -3
  94. package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.js +753 -753
  95. package/dist/collection/components/wm-uploader/wm-uploader.css +1 -3
  96. package/dist/collection/components/wm-uploader/wm-uploader.js +748 -748
  97. package/dist/collection/components/wm-wrapper/wm-wrapper.js +27 -27
  98. package/dist/collection/dev/scripts.js +20 -20
  99. package/dist/collection/global/__mocks__/functions.js +6 -6
  100. package/dist/collection/global/functions.js +468 -449
  101. package/dist/collection/global/global.js +72 -72
  102. package/dist/collection/global/interfaces.js +49 -49
  103. package/dist/collection/global/services/__mocks__/http-service.js +130 -130
  104. package/dist/collection/global/services/http-service.js +50 -50
  105. package/dist/collection/lang/lang.js +5 -5
  106. package/dist/collection/lang/missing.js +39 -39
  107. package/dist/collection/lang/piglatin.js +93 -93
  108. package/dist/esm/{functions-a8d1ed3e.js → functions-b130b95f.js} +533 -488
  109. package/dist/esm/{global-191b6775.js → global-828a3282.js} +65 -65
  110. package/dist/esm/{http-service-3dc3b3e7.js → http-service-5d037e16.js} +49 -49
  111. package/dist/esm/{index-66f8130e.js → index-cd8f9ae2.js} +96 -64
  112. package/dist/esm/{interfaces-2b97fab2.js → interfaces-61c6305b.js} +29 -29
  113. package/dist/esm/loader.js +4 -4
  114. package/dist/esm/polyfills/core-js.js +0 -0
  115. package/dist/esm/polyfills/css-shim.js +1 -1
  116. package/dist/esm/polyfills/dom.js +0 -0
  117. package/dist/esm/polyfills/es5-html-element.js +0 -0
  118. package/dist/esm/polyfills/index.js +0 -0
  119. package/dist/esm/polyfills/system.js +0 -0
  120. package/dist/esm/priv-chart-popover.entry.js +79 -79
  121. package/dist/esm/priv-datepicker.entry.js +674 -674
  122. package/dist/esm/priv-navigator-button.entry.js +19 -19
  123. package/dist/esm/priv-navigator-item.entry.js +24 -24
  124. package/dist/esm/ripple.js +4 -4
  125. package/dist/esm/wm-action-menu_2.entry.js +342 -342
  126. package/dist/esm/wm-button.entry.js +228 -228
  127. package/dist/esm/wm-chart-slice.entry.js +14 -14
  128. package/dist/esm/wm-chart.entry.js +475 -475
  129. package/dist/esm/wm-datepicker.entry.js +273 -273
  130. package/dist/esm/wm-input.entry.js +136 -136
  131. package/dist/esm/wm-modal-footer.entry.js +32 -32
  132. package/dist/esm/wm-modal-header.entry.js +35 -35
  133. package/dist/esm/wm-modal.entry.js +164 -164
  134. package/dist/esm/wm-navigation_3.entry.js +231 -0
  135. package/dist/esm/wm-navigator.entry.js +269 -269
  136. package/dist/esm/wm-network-uploader.entry.js +422 -422
  137. package/dist/esm/wm-option_2.entry.js +497 -497
  138. package/dist/esm/wm-pagination.entry.js +168 -168
  139. package/dist/esm/wm-search.entry.js +233 -233
  140. package/dist/esm/wm-snackbar.entry.js +172 -172
  141. package/dist/esm/wm-tab-item_3.entry.js +297 -297
  142. package/dist/esm/wm-tag-input.entry.js +581 -581
  143. package/dist/esm/wm-timepicker.entry.js +385 -385
  144. package/dist/esm/wm-toggletip.entry.js +126 -126
  145. package/dist/esm/wm-uploader.entry.js +348 -348
  146. package/dist/esm/wm-wrapper.entry.js +13 -13
  147. package/dist/esm-es5/functions-b130b95f.js +15 -0
  148. package/dist/esm-es5/{global-191b6775.js → global-828a3282.js} +1 -1
  149. package/dist/esm-es5/{http-service-3dc3b3e7.js → http-service-5d037e16.js} +1 -1
  150. package/dist/esm-es5/index-cd8f9ae2.js +1 -0
  151. package/dist/esm-es5/{interfaces-2b97fab2.js → interfaces-61c6305b.js} +0 -0
  152. package/dist/esm-es5/loader.js +1 -1
  153. package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
  154. package/dist/esm-es5/priv-datepicker.entry.js +1 -1
  155. package/dist/esm-es5/priv-navigator-button.entry.js +1 -1
  156. package/dist/esm-es5/priv-navigator-item.entry.js +1 -1
  157. package/dist/esm-es5/ripple.js +1 -1
  158. package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
  159. package/dist/esm-es5/wm-button.entry.js +1 -1
  160. package/dist/esm-es5/wm-chart-slice.entry.js +1 -1
  161. package/dist/esm-es5/wm-chart.entry.js +1 -1
  162. package/dist/esm-es5/wm-datepicker.entry.js +1 -1
  163. package/dist/esm-es5/wm-input.entry.js +1 -1
  164. package/dist/esm-es5/wm-modal-footer.entry.js +1 -1
  165. package/dist/esm-es5/wm-modal-header.entry.js +1 -1
  166. package/dist/esm-es5/wm-modal.entry.js +1 -1
  167. package/dist/esm-es5/wm-navigation_3.entry.js +1 -0
  168. package/dist/esm-es5/wm-navigator.entry.js +1 -1
  169. package/dist/esm-es5/wm-network-uploader.entry.js +1 -1
  170. package/dist/esm-es5/wm-option_2.entry.js +1 -1
  171. package/dist/esm-es5/wm-pagination.entry.js +1 -1
  172. package/dist/esm-es5/wm-search.entry.js +1 -1
  173. package/dist/esm-es5/wm-snackbar.entry.js +1 -1
  174. package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
  175. package/dist/esm-es5/wm-tag-input.entry.js +1 -1
  176. package/dist/esm-es5/wm-timepicker.entry.js +1 -1
  177. package/dist/esm-es5/wm-toggletip.entry.js +1 -1
  178. package/dist/esm-es5/wm-uploader.entry.js +1 -1
  179. package/dist/esm-es5/wm-wrapper.entry.js +1 -1
  180. package/dist/loader/index.d.ts +0 -1
  181. package/dist/ripple/p-0042d785.entry.js +1 -0
  182. package/dist/ripple/{p-831c3da1.system.entry.js → p-040262af.system.entry.js} +1 -1
  183. package/dist/ripple/{p-cde0c4bd.system.entry.js → p-08987f25.system.entry.js} +1 -1
  184. package/dist/ripple/{p-f5df5903.system.js → p-08b7ec08.system.js} +0 -0
  185. package/dist/ripple/p-08f8a387.system.js +15 -0
  186. package/dist/ripple/{p-7f41b5fc.js → p-11d82639.js} +1 -1
  187. package/dist/ripple/{p-1fa979d7.system.entry.js → p-12bd075c.system.entry.js} +1 -1
  188. package/dist/ripple/p-16b81b95.system.entry.js +1 -0
  189. package/dist/ripple/p-1aa63d75.entry.js +1 -0
  190. package/dist/ripple/p-1bc95574.system.entry.js +1 -0
  191. package/dist/ripple/p-20856a2d.system.js +1 -0
  192. package/dist/ripple/p-244877c8.entry.js +1 -0
  193. package/dist/ripple/p-26193e57.entry.js +1 -0
  194. package/dist/ripple/p-28c23453.system.entry.js +1 -0
  195. package/dist/ripple/p-313b6073.system.js +1 -0
  196. package/dist/ripple/p-38062c39.js +1 -0
  197. package/dist/ripple/p-3b6375d1.system.entry.js +1 -0
  198. package/dist/ripple/p-3ba3afca.entry.js +1 -0
  199. package/dist/ripple/p-3faf2b4d.entry.js +1 -0
  200. package/dist/ripple/p-4372e470.entry.js +1 -0
  201. package/dist/ripple/{p-fd991998.system.entry.js → p-450d329a.system.entry.js} +1 -1
  202. package/dist/ripple/p-4be373bc.entry.js +1 -0
  203. package/dist/ripple/{p-7bc744bf.system.entry.js → p-504579c2.system.entry.js} +1 -1
  204. package/dist/ripple/p-5345ef2c.entry.js +1 -0
  205. package/dist/ripple/p-5866f8c0.entry.js +1 -0
  206. package/dist/ripple/p-64176f58.entry.js +1 -0
  207. package/dist/ripple/p-6aa11b0c.system.entry.js +1 -0
  208. package/dist/ripple/{p-2d63611b.system.entry.js → p-6b8753b3.system.entry.js} +1 -1
  209. package/dist/ripple/p-6c1a8429.system.entry.js +1 -0
  210. package/dist/ripple/{p-f04fb2d2.system.entry.js → p-6eed4845.system.entry.js} +1 -1
  211. package/dist/ripple/p-764fa608.entry.js +1 -0
  212. package/dist/ripple/p-7e118839.entry.js +1 -0
  213. package/dist/ripple/{p-43f1298b.js → p-888bec42.js} +0 -0
  214. package/dist/ripple/p-8a0450fd.entry.js +1 -0
  215. package/dist/ripple/p-8dd28361.entry.js +1 -0
  216. package/dist/ripple/p-91e122c6.entry.js +1 -0
  217. package/dist/ripple/p-97909b0f.entry.js +1 -0
  218. package/dist/ripple/{p-ee93660f.system.js → p-9a95cf99.system.js} +1 -1
  219. package/dist/ripple/{p-2d49a016.system.entry.js → p-9a9743f5.system.entry.js} +1 -1
  220. package/dist/ripple/{p-b3ce2033.system.entry.js → p-a5177480.system.entry.js} +1 -1
  221. package/dist/ripple/p-a6cc08a5.system.entry.js +1 -0
  222. package/dist/ripple/{p-fd8070fb.js → p-a6d6eae7.js} +0 -0
  223. package/dist/ripple/p-a8584619.system.entry.js +1 -0
  224. package/dist/ripple/p-a9dd6fe1.entry.js +1 -0
  225. package/dist/ripple/p-add208d8.entry.js +1 -0
  226. package/dist/ripple/p-b23965b4.system.js +1 -0
  227. package/dist/ripple/p-b3568fc3.system.entry.js +1 -0
  228. package/dist/ripple/p-b635fdfe.system.entry.js +1 -0
  229. package/dist/ripple/p-bfef8d9c.entry.js +1 -0
  230. package/dist/ripple/p-c0fd9e19.system.entry.js +1 -0
  231. package/dist/ripple/{p-261ea633.system.entry.js → p-c19298a5.system.entry.js} +1 -1
  232. package/dist/ripple/p-ce80b46d.entry.js +1 -0
  233. package/dist/ripple/p-d0ab4cf2.entry.js +1 -0
  234. package/dist/ripple/p-d0d3421d.system.entry.js +1 -0
  235. package/dist/ripple/p-d43a4e01.entry.js +1 -0
  236. package/dist/ripple/p-d4e46468.entry.js +1 -0
  237. package/dist/ripple/{p-616d11c9.system.entry.js → p-db4f099c.system.entry.js} +1 -1
  238. package/dist/ripple/{p-7a9aac92.system.entry.js → p-e758db14.system.entry.js} +1 -1
  239. package/dist/ripple/p-ea22b946.js +16 -0
  240. package/dist/ripple/p-ef344252.entry.js +1 -0
  241. package/dist/ripple/p-f44803ff.system.entry.js +1 -0
  242. package/dist/ripple/p-fa35e47b.entry.js +1 -0
  243. package/dist/ripple/p-ffc33d45.system.entry.js +1 -0
  244. package/dist/ripple/ripple.esm.js +1 -1
  245. package/dist/ripple/ripple.js +1 -1
  246. package/dist/types/components/wm-action-menu/wm-action-menu.d.ts +48 -48
  247. package/dist/types/components/wm-button/wm-button.d.ts +43 -43
  248. package/dist/types/components/wm-chart/priv-chart-popover/priv-chart-popover.d.ts +23 -23
  249. package/dist/types/components/wm-chart/wm-chart-slice.d.ts +11 -11
  250. package/dist/types/components/wm-chart/wm-chart.d.ts +82 -82
  251. package/dist/types/components/wm-datepicker/priv-datepicker/priv-datepicker.d.ts +80 -80
  252. package/dist/types/components/wm-datepicker/wm-datepicker.d.ts +42 -42
  253. package/dist/types/components/wm-input/wm-input.d.ts +46 -46
  254. package/dist/types/components/wm-menuitem/wm-menuitem.d.ts +34 -34
  255. package/dist/types/components/wm-modal/wm-modal-footer.d.ts +15 -15
  256. package/dist/types/components/wm-modal/wm-modal-header.d.ts +12 -12
  257. package/dist/types/components/wm-modal/wm-modal.d.ts +41 -41
  258. package/dist/types/components/wm-navigation/wm-navigation-hamburger.d.ts +21 -0
  259. package/dist/types/components/wm-navigation/wm-navigation-item.d.ts +11 -0
  260. package/dist/types/components/wm-navigation/wm-navigation.d.ts +29 -0
  261. package/dist/types/components/wm-navigator/priv-navigator-button/priv-navigator-button.d.ts +10 -10
  262. package/dist/types/components/wm-navigator/priv-navigator-item/priv-navigator-item.d.ts +13 -13
  263. package/dist/types/components/wm-navigator/wm-navigator.d.ts +61 -61
  264. package/dist/types/components/wm-option/wm-option.d.ts +32 -32
  265. package/dist/types/components/wm-pagination/wm-pagination.d.ts +32 -32
  266. package/dist/types/components/wm-search/wm-search.d.ts +86 -86
  267. package/dist/types/components/wm-select/wm-select.d.ts +66 -66
  268. package/dist/types/components/wm-snackbar/wm-snackbar.d.ts +35 -35
  269. package/dist/types/components/wm-tabs/wm-tab-item/wm-tab-item.d.ts +38 -38
  270. package/dist/types/components/wm-tabs/wm-tab-list/wm-tab-list.d.ts +53 -53
  271. package/dist/types/components/wm-tabs/wm-tab-panel/wm-tab-panel.d.ts +20 -20
  272. package/dist/types/components/wm-tag-input/wm-tag-input.d.ts +92 -92
  273. package/dist/types/components/wm-timepicker/wm-timepicker.d.ts +61 -61
  274. package/dist/types/components/wm-toggletip/wm-toggletip.d.ts +27 -27
  275. package/dist/types/components/wm-uploader/wm-network-uploader/wm-network-uploader.d.ts +85 -85
  276. package/dist/types/components/wm-uploader/wm-uploader.d.ts +80 -80
  277. package/dist/types/components/wm-wrapper/wm-wrapper.d.ts +7 -7
  278. package/dist/types/components.d.ts +77 -24
  279. package/dist/types/global/__mocks__/functions.d.ts +6 -6
  280. package/dist/types/global/functions.d.ts +42 -41
  281. package/dist/types/global/global.d.ts +1 -1
  282. package/dist/types/global/interfaces.d.ts +34 -34
  283. package/dist/types/global/services/__mocks__/http-service.d.ts +6 -6
  284. package/dist/types/global/services/http-service.d.ts +4 -4
  285. package/dist/types/lang/lang.d.ts +5 -5
  286. package/dist/types/stencil-public-runtime.d.ts +6 -4
  287. package/package.json +47 -47
  288. package/dist/esm-es5/functions-a8d1ed3e.js +0 -15
  289. package/dist/esm-es5/index-66f8130e.js +0 -1
  290. package/dist/ripple/p-04bd5281.entry.js +0 -1
  291. package/dist/ripple/p-07353b27.system.js +0 -1
  292. package/dist/ripple/p-0b2a9a9a.entry.js +0 -1
  293. package/dist/ripple/p-0c58f50d.entry.js +0 -1
  294. package/dist/ripple/p-0d8bd4ee.entry.js +0 -1
  295. package/dist/ripple/p-0deeb79c.system.entry.js +0 -1
  296. package/dist/ripple/p-2145d012.entry.js +0 -1
  297. package/dist/ripple/p-2544cbd6.system.entry.js +0 -1
  298. package/dist/ripple/p-29a232bc.entry.js +0 -1
  299. package/dist/ripple/p-32733046.entry.js +0 -1
  300. package/dist/ripple/p-39b93119.entry.js +0 -1
  301. package/dist/ripple/p-3fb2fff9.entry.js +0 -1
  302. package/dist/ripple/p-510c5446.system.entry.js +0 -1
  303. package/dist/ripple/p-566a8814.entry.js +0 -1
  304. package/dist/ripple/p-5f3e2db4.entry.js +0 -1
  305. package/dist/ripple/p-639ad0f5.system.entry.js +0 -1
  306. package/dist/ripple/p-6a4cc1e1.system.entry.js +0 -1
  307. package/dist/ripple/p-6facd692.entry.js +0 -1
  308. package/dist/ripple/p-764def28.system.entry.js +0 -1
  309. package/dist/ripple/p-78473c96.system.entry.js +0 -1
  310. package/dist/ripple/p-7a684273.entry.js +0 -1
  311. package/dist/ripple/p-7c879f30.system.entry.js +0 -1
  312. package/dist/ripple/p-7d6552fb.entry.js +0 -1
  313. package/dist/ripple/p-80d598f9.js +0 -16
  314. package/dist/ripple/p-835d8720.system.entry.js +0 -1
  315. package/dist/ripple/p-8b0eb05e.entry.js +0 -1
  316. package/dist/ripple/p-8dab4579.entry.js +0 -1
  317. package/dist/ripple/p-99548d58.system.js +0 -1
  318. package/dist/ripple/p-99db8501.entry.js +0 -1
  319. package/dist/ripple/p-9baa3039.js +0 -1
  320. package/dist/ripple/p-9d02957d.system.js +0 -1
  321. package/dist/ripple/p-a9a28ef6.entry.js +0 -1
  322. package/dist/ripple/p-aa5c6a4a.system.entry.js +0 -1
  323. package/dist/ripple/p-b2f08d3e.system.entry.js +0 -1
  324. package/dist/ripple/p-b6d1ab55.entry.js +0 -1
  325. package/dist/ripple/p-c6ac6f80.entry.js +0 -1
  326. package/dist/ripple/p-d0643c9b.entry.js +0 -1
  327. package/dist/ripple/p-d064dbb9.entry.js +0 -1
  328. package/dist/ripple/p-d0d5fd00.entry.js +0 -1
  329. package/dist/ripple/p-eb446a26.system.entry.js +0 -1
  330. package/dist/ripple/p-f10fbff8.entry.js +0 -1
  331. package/dist/ripple/p-f3c8868c.entry.js +0 -1
  332. package/dist/ripple/p-fc0f044d.system.entry.js +0 -1
  333. package/dist/ripple/p-fe4dd552.system.js +0 -15
@@ -3880,11 +3880,17 @@ function icuUnitToEcma(unit) {
3880
3880
  return unit.replace(/^(.*?)-/, '');
3881
3881
  }
3882
3882
  var FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g;
3883
- var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?$/g;
3883
+ var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g;
3884
3884
  var INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g;
3885
3885
  var CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;
3886
3886
  function parseSignificantPrecision(str) {
3887
3887
  var result = {};
3888
+ if (str[str.length - 1] === 'r') {
3889
+ result.roundingPriority = 'morePrecision';
3890
+ }
3891
+ else if (str[str.length - 1] === 's') {
3892
+ result.roundingPriority = 'lessPrecision';
3893
+ }
3888
3894
  str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {
3889
3895
  // @@@ case
3890
3896
  if (typeof g2 !== 'string') {
@@ -4111,8 +4117,13 @@ function parseNumberSkeleton(tokens) {
4111
4117
  }
4112
4118
  return '';
4113
4119
  });
4114
- if (token.options.length) {
4115
- result = __assign(__assign({}, result), parseSignificantPrecision(token.options[0]));
4120
+ var opt = token.options[0];
4121
+ // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display
4122
+ if (opt === 'w') {
4123
+ result = __assign(__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });
4124
+ }
4125
+ else if (opt) {
4126
+ result = __assign(__assign({}, result), parseSignificantPrecision(opt));
4116
4127
  }
4117
4128
  continue;
4118
4129
  }
@@ -4134,8 +4145,8 @@ function parseNumberSkeleton(tokens) {
4134
4145
  }
4135
4146
 
4136
4147
  var _a;
4137
- var SPACE_SEPARATOR_START_REGEX = new RegExp("^" + SPACE_SEPARATOR_REGEX.source + "*");
4138
- var SPACE_SEPARATOR_END_REGEX = new RegExp(SPACE_SEPARATOR_REGEX.source + "*$");
4148
+ var SPACE_SEPARATOR_START_REGEX = new RegExp("^".concat(SPACE_SEPARATOR_REGEX.source, "*"));
4149
+ var SPACE_SEPARATOR_END_REGEX = new RegExp("".concat(SPACE_SEPARATOR_REGEX.source, "*$"));
4139
4150
  function createLocation(start, end) {
4140
4151
  return { start: start, end: end };
4141
4152
  }
@@ -4382,7 +4393,7 @@ var Parser = /** @class */ (function () {
4382
4393
  return {
4383
4394
  val: {
4384
4395
  type: TYPE.literal,
4385
- value: "<" + tagName + "/>",
4396
+ value: "<".concat(tagName, "/>"),
4386
4397
  location: createLocation(startPosition, this.clonePosition()),
4387
4398
  },
4388
4399
  err: null,
@@ -4987,7 +4998,7 @@ var Parser = /** @class */ (function () {
4987
4998
  }
4988
4999
  var code = codePointAt(this.message, offset);
4989
5000
  if (code === undefined) {
4990
- throw Error("Offset " + offset + " is at invalid UTF-16 code unit boundary");
5001
+ throw Error("Offset ".concat(offset, " is at invalid UTF-16 code unit boundary"));
4991
5002
  }
4992
5003
  return code;
4993
5004
  };
@@ -5055,7 +5066,7 @@ var Parser = /** @class */ (function () {
5055
5066
  */
5056
5067
  Parser.prototype.bumpTo = function (targetOffset) {
5057
5068
  if (this.offset() > targetOffset) {
5058
- throw Error("targetOffset " + targetOffset + " must be greater than or equal to the current offset " + this.offset());
5069
+ throw Error("targetOffset ".concat(targetOffset, " must be greater than or equal to the current offset ").concat(this.offset()));
5059
5070
  }
5060
5071
  targetOffset = Math.min(targetOffset, this.message.length);
5061
5072
  while (true) {
@@ -5064,7 +5075,7 @@ var Parser = /** @class */ (function () {
5064
5075
  break;
5065
5076
  }
5066
5077
  if (offset > targetOffset) {
5067
- throw Error("targetOffset " + targetOffset + " is at invalid UTF-16 code unit boundary");
5078
+ throw Error("targetOffset ".concat(targetOffset, " is at invalid UTF-16 code unit boundary"));
5068
5079
  }
5069
5080
  this.bump();
5070
5081
  if (this.isEOF()) {
@@ -5530,28 +5541,28 @@ var FormatError = /** @class */ (function (_super) {
5530
5541
  return _this;
5531
5542
  }
5532
5543
  FormatError.prototype.toString = function () {
5533
- return "[formatjs Error: " + this.code + "] " + this.message;
5544
+ return "[formatjs Error: ".concat(this.code, "] ").concat(this.message);
5534
5545
  };
5535
5546
  return FormatError;
5536
5547
  }(Error));
5537
5548
  var InvalidValueError = /** @class */ (function (_super) {
5538
5549
  __extends(InvalidValueError, _super);
5539
5550
  function InvalidValueError(variableId, value, options, originalMessage) {
5540
- return _super.call(this, "Invalid values for \"" + variableId + "\": \"" + value + "\". Options are \"" + Object.keys(options).join('", "') + "\"", ErrorCode.INVALID_VALUE, originalMessage) || this;
5551
+ return _super.call(this, "Invalid values for \"".concat(variableId, "\": \"").concat(value, "\". Options are \"").concat(Object.keys(options).join('", "'), "\""), ErrorCode.INVALID_VALUE, originalMessage) || this;
5541
5552
  }
5542
5553
  return InvalidValueError;
5543
5554
  }(FormatError));
5544
5555
  var InvalidValueTypeError = /** @class */ (function (_super) {
5545
5556
  __extends(InvalidValueTypeError, _super);
5546
5557
  function InvalidValueTypeError(value, type, originalMessage) {
5547
- return _super.call(this, "Value for \"" + value + "\" must be of type " + type, ErrorCode.INVALID_VALUE, originalMessage) || this;
5558
+ return _super.call(this, "Value for \"".concat(value, "\" must be of type ").concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this;
5548
5559
  }
5549
5560
  return InvalidValueTypeError;
5550
5561
  }(FormatError));
5551
5562
  var MissingValueError = /** @class */ (function (_super) {
5552
5563
  __extends(MissingValueError, _super);
5553
5564
  function MissingValueError(variableId, originalMessage) {
5554
- return _super.call(this, "The intl string context variable \"" + variableId + "\" was not provided to the string \"" + originalMessage + "\"", ErrorCode.MISSING_VALUE, originalMessage) || this;
5565
+ return _super.call(this, "The intl string context variable \"".concat(variableId, "\" was not provided to the string \"").concat(originalMessage, "\""), ErrorCode.MISSING_VALUE, originalMessage) || this;
5555
5566
  }
5556
5567
  return MissingValueError;
5557
5568
  }(FormatError));
@@ -5712,7 +5723,7 @@ originalMessage) {
5712
5723
  continue;
5713
5724
  }
5714
5725
  if (isPluralElement(el)) {
5715
- var opt = el.options["=" + value];
5726
+ var opt = el.options["=".concat(value)];
5716
5727
  if (!opt) {
5717
5728
  if (!Intl.PluralRules) {
5718
5729
  throw new FormatError("Intl.PluralRules is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-pluralrules\"\n", ErrorCode.MISSING_INTL_API, originalMessage);
@@ -5783,7 +5794,7 @@ function createDefaultFormatters(cache) {
5783
5794
  for (var _i = 0; _i < arguments.length; _i++) {
5784
5795
  args[_i] = arguments[_i];
5785
5796
  }
5786
- return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args)))();
5797
+ return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
5787
5798
  }, {
5788
5799
  cache: createFastMemoizeCache$1(cache.number),
5789
5800
  strategy: strategies.variadic,
@@ -5794,7 +5805,7 @@ function createDefaultFormatters(cache) {
5794
5805
  for (var _i = 0; _i < arguments.length; _i++) {
5795
5806
  args[_i] = arguments[_i];
5796
5807
  }
5797
- return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args)))();
5808
+ return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
5798
5809
  }, {
5799
5810
  cache: createFastMemoizeCache$1(cache.dateTime),
5800
5811
  strategy: strategies.variadic,
@@ -5805,7 +5816,7 @@ function createDefaultFormatters(cache) {
5805
5816
  for (var _i = 0; _i < arguments.length; _i++) {
5806
5817
  args[_i] = arguments[_i];
5807
5818
  }
5808
- return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args)))();
5819
+ return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();
5809
5820
  }, {
5810
5821
  cache: createFastMemoizeCache$1(cache.pluralRules),
5811
5822
  strategy: strategies.variadic,
@@ -5963,7 +5974,13 @@ var IntlErrorCode;
5963
5974
  var IntlError = /** @class */ (function (_super) {
5964
5975
  __extends(IntlError, _super);
5965
5976
  function IntlError(code, message, exception) {
5966
- var _this = _super.call(this, "[@formatjs/intl Error " + code + "] " + message + " \n" + (exception ? "\n" + exception.message + "\n" + exception.stack : '')) || this;
5977
+ var _this = this;
5978
+ var err = exception
5979
+ ? exception instanceof Error
5980
+ ? exception
5981
+ : new Error(String(exception))
5982
+ : undefined;
5983
+ _this = _super.call(this, "[@formatjs/intl Error ".concat(code, "] ").concat(message, " \n").concat(err ? "\n".concat(err.message, "\n").concat(err.stack) : '')) || this;
5967
5984
  _this.code = code;
5968
5985
  // @ts-ignore just so we don't need to declare dep on @types/node
5969
5986
  if (typeof Error.captureStackTrace === 'function') {
@@ -5995,19 +6012,26 @@ var MissingDataError = /** @class */ (function (_super) {
5995
6012
  }
5996
6013
  return MissingDataError;
5997
6014
  }(IntlError));
6015
+ var IntlFormatError = /** @class */ (function (_super) {
6016
+ __extends(IntlFormatError, _super);
6017
+ function IntlFormatError(message, locale, exception) {
6018
+ return _super.call(this, IntlErrorCode.FORMAT_ERROR, "".concat(message, " \nLocale: ").concat(locale, "\n"), exception) || this;
6019
+ }
6020
+ return IntlFormatError;
6021
+ }(IntlError));
5998
6022
  var MessageFormatError = /** @class */ (function (_super) {
5999
6023
  __extends(MessageFormatError, _super);
6000
6024
  function MessageFormatError(message, locale, descriptor, exception) {
6001
- var _this = _super.call(this, IntlErrorCode.FORMAT_ERROR, message + " \nLocale: " + locale + "\nMessageID: " + (descriptor === null || descriptor === void 0 ? void 0 : descriptor.id) + "\nDefault Message: " + (descriptor === null || descriptor === void 0 ? void 0 : descriptor.defaultMessage) + "\nDescription: " + (descriptor === null || descriptor === void 0 ? void 0 : descriptor.description) + " \n", exception) || this;
6025
+ var _this = _super.call(this, "".concat(message, " \nMessageID: ").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.id, "\nDefault Message: ").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.defaultMessage, "\nDescription: ").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.description, " \n"), locale, exception) || this;
6002
6026
  _this.descriptor = descriptor;
6003
6027
  return _this;
6004
6028
  }
6005
6029
  return MessageFormatError;
6006
- }(IntlError));
6030
+ }(IntlFormatError));
6007
6031
  var MissingTranslationError = /** @class */ (function (_super) {
6008
6032
  __extends(MissingTranslationError, _super);
6009
6033
  function MissingTranslationError(descriptor, locale) {
6010
- var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, "Missing message: \"" + descriptor.id + "\" for locale \"" + locale + "\", using " + (descriptor.defaultMessage ? 'default message' : 'id') + " as fallback.") || this;
6034
+ var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, "Missing message: \"".concat(descriptor.id, "\" for locale \"").concat(locale, "\", using ").concat(descriptor.defaultMessage ? 'default message' : 'id', " as fallback.")) || this;
6011
6035
  _this.descriptor = descriptor;
6012
6036
  return _this;
6013
6037
  }
@@ -6034,6 +6058,7 @@ var DEFAULT_INTL_CONFIG = {
6034
6058
  timeZone: undefined,
6035
6059
  defaultLocale: 'en',
6036
6060
  defaultFormats: {},
6061
+ fallbackOnEmptyString: true,
6037
6062
  onError: defaultErrorHandler,
6038
6063
  };
6039
6064
  function createIntlCache() {
@@ -6076,7 +6101,7 @@ function createFormatters(cache) {
6076
6101
  for (var _i = 0; _i < arguments.length; _i++) {
6077
6102
  args[_i] = arguments[_i];
6078
6103
  }
6079
- return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args)))();
6104
+ return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
6080
6105
  }, {
6081
6106
  cache: createFastMemoizeCache(cache.dateTime),
6082
6107
  strategy: strategies.variadic,
@@ -6087,7 +6112,7 @@ function createFormatters(cache) {
6087
6112
  for (var _i = 0; _i < arguments.length; _i++) {
6088
6113
  args[_i] = arguments[_i];
6089
6114
  }
6090
- return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args)))();
6115
+ return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
6091
6116
  }, {
6092
6117
  cache: createFastMemoizeCache(cache.number),
6093
6118
  strategy: strategies.variadic,
@@ -6098,7 +6123,7 @@ function createFormatters(cache) {
6098
6123
  for (var _i = 0; _i < arguments.length; _i++) {
6099
6124
  args[_i] = arguments[_i];
6100
6125
  }
6101
- return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args)))();
6126
+ return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();
6102
6127
  }, {
6103
6128
  cache: createFastMemoizeCache(cache.pluralRules),
6104
6129
  strategy: strategies.variadic,
@@ -6121,7 +6146,7 @@ function createFormatters(cache) {
6121
6146
  for (var _i = 0; _i < arguments.length; _i++) {
6122
6147
  args[_i] = arguments[_i];
6123
6148
  }
6124
- return new (RelativeTimeFormat.bind.apply(RelativeTimeFormat, __spreadArray([void 0], args)))();
6149
+ return new (RelativeTimeFormat.bind.apply(RelativeTimeFormat, __spreadArray([void 0], args, false)))();
6125
6150
  }, {
6126
6151
  cache: createFastMemoizeCache(cache.relativeTime),
6127
6152
  strategy: strategies.variadic,
@@ -6132,7 +6157,7 @@ function createFormatters(cache) {
6132
6157
  for (var _i = 0; _i < arguments.length; _i++) {
6133
6158
  args[_i] = arguments[_i];
6134
6159
  }
6135
- return new (ListFormat.bind.apply(ListFormat, __spreadArray([void 0], args)))();
6160
+ return new (ListFormat.bind.apply(ListFormat, __spreadArray([void 0], args, false)))();
6136
6161
  }, {
6137
6162
  cache: createFastMemoizeCache(cache.list),
6138
6163
  strategy: strategies.variadic,
@@ -6142,7 +6167,7 @@ function createFormatters(cache) {
6142
6167
  for (var _i = 0; _i < arguments.length; _i++) {
6143
6168
  args[_i] = arguments[_i];
6144
6169
  }
6145
- return new (DisplayNames.bind.apply(DisplayNames, __spreadArray([void 0], args)))();
6170
+ return new (DisplayNames.bind.apply(DisplayNames, __spreadArray([void 0], args, false)))();
6146
6171
  }, {
6147
6172
  cache: createFastMemoizeCache(cache.displayNames),
6148
6173
  strategy: strategies.variadic,
@@ -6158,7 +6183,7 @@ function getNamedFormat(formats, type, name, onError) {
6158
6183
  if (format) {
6159
6184
  return format;
6160
6185
  }
6161
- onError(new UnsupportedFormatterError("No " + type + " format named: " + name));
6186
+ onError(new UnsupportedFormatterError("No ".concat(type, " format named: ").concat(name)));
6162
6187
  }
6163
6188
 
6164
6189
  /**
@@ -6193,7 +6218,7 @@ function deepMergeFormatsAndSetTimeZone(f1, timeZone) {
6193
6218
  return __assign(__assign(__assign({}, mfFormats), f1), { date: deepMergeOptions(setTimeZoneInOptions(mfFormats.date, timeZone), setTimeZoneInOptions(f1.date || {}, timeZone)), time: deepMergeOptions(setTimeZoneInOptions(mfFormats.time, timeZone), setTimeZoneInOptions(f1.time || {}, timeZone)) });
6194
6219
  }
6195
6220
  function formatMessage(_a, state, messageDescriptor, values, opts) {
6196
- var locale = _a.locale, formats = _a.formats, messages = _a.messages, defaultLocale = _a.defaultLocale, defaultFormats = _a.defaultFormats, onError = _a.onError, timeZone = _a.timeZone, defaultRichTextElements = _a.defaultRichTextElements;
6221
+ var locale = _a.locale, formats = _a.formats, messages = _a.messages, defaultLocale = _a.defaultLocale, defaultFormats = _a.defaultFormats, fallbackOnEmptyString = _a.fallbackOnEmptyString, onError = _a.onError, timeZone = _a.timeZone, defaultRichTextElements = _a.defaultRichTextElements;
6197
6222
  if (messageDescriptor === void 0) { messageDescriptor = { id: '' }; }
6198
6223
  var msgId = messageDescriptor.id, defaultMessage = messageDescriptor.defaultMessage;
6199
6224
  // `id` is a required field of a Message Descriptor.
@@ -6223,6 +6248,9 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
6223
6248
  formats = deepMergeFormatsAndSetTimeZone(formats, timeZone);
6224
6249
  defaultFormats = deepMergeFormatsAndSetTimeZone(defaultFormats, timeZone);
6225
6250
  if (!message) {
6251
+ if (fallbackOnEmptyString === false && message === '') {
6252
+ return message;
6253
+ }
6226
6254
  if (!defaultMessage ||
6227
6255
  (locale && locale.toLowerCase() !== defaultLocale.toLowerCase())) {
6228
6256
  // This prevents warnings from littering the console in development
@@ -6236,7 +6264,7 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
6236
6264
  return formatter.format(values);
6237
6265
  }
6238
6266
  catch (e) {
6239
- onError(new MessageFormatError("Error formatting default message for: \"" + id + "\", rendering default message verbatim", locale, messageDescriptor, e));
6267
+ onError(new MessageFormatError("Error formatting default message for: \"".concat(id, "\", rendering default message verbatim"), locale, messageDescriptor, e));
6240
6268
  return typeof defaultMessage === 'string' ? defaultMessage : id;
6241
6269
  }
6242
6270
  }
@@ -6248,7 +6276,7 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
6248
6276
  return formatter.format(values);
6249
6277
  }
6250
6278
  catch (e) {
6251
- onError(new MessageFormatError("Error formatting message: \"" + id + "\", using " + (defaultMessage ? 'default message' : 'id') + " as fallback.", locale, messageDescriptor, e));
6279
+ onError(new MessageFormatError("Error formatting message: \"".concat(id, "\", using ").concat(defaultMessage ? 'default message' : 'id', " as fallback."), locale, messageDescriptor, e));
6252
6280
  }
6253
6281
  if (defaultMessage) {
6254
6282
  try {
@@ -6256,7 +6284,7 @@ function formatMessage(_a, state, messageDescriptor, values, opts) {
6256
6284
  return formatter.format(values);
6257
6285
  }
6258
6286
  catch (e) {
6259
- onError(new MessageFormatError("Error formatting the default message for: \"" + id + "\", rendering message verbatim", locale, messageDescriptor, e));
6287
+ onError(new MessageFormatError("Error formatting the default message for: \"".concat(id, "\", rendering message verbatim"), locale, messageDescriptor, e));
6260
6288
  }
6261
6289
  }
6262
6290
  if (typeof message === 'string') {
@@ -6294,9 +6322,7 @@ function getFormatter$2(_a, type, getDateTimeFormat, options) {
6294
6322
  if (options === void 0) { options = {}; }
6295
6323
  var format = options.format;
6296
6324
  var defaults = __assign(__assign({}, (timeZone && { timeZone: timeZone })), (format && getNamedFormat(formats, type, format, onError)));
6297
- var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS,
6298
- // @ts-expect-error es2020 has a lot stuff from es2021 bleed in
6299
- defaults);
6325
+ var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults);
6300
6326
  if (type === 'time' &&
6301
6327
  !filteredOptions.hour &&
6302
6328
  !filteredOptions.minute &&
@@ -6413,7 +6439,7 @@ var LIST_FORMAT_OPTIONS = [
6413
6439
  ];
6414
6440
  var now = Date.now();
6415
6441
  function generateToken(i) {
6416
- return now + "_" + i + "_" + now;
6442
+ return "".concat(now, "_").concat(i, "_").concat(now);
6417
6443
  }
6418
6444
  function formatList(opts, getListFormat, values, options) {
6419
6445
  if (options === void 0) { options = {}; }
@@ -6480,7 +6506,7 @@ function formatPlural(_a, getPluralRules, value, options) {
6480
6506
  return getPluralRules(locale, filteredOptions).select(value);
6481
6507
  }
6482
6508
  catch (e) {
6483
- onError(new MessageFormatError('Error formatting plural.', e));
6509
+ onError(new IntlFormatError('Error formatting plural.', locale, e));
6484
6510
  }
6485
6511
  return 'other';
6486
6512
  }
@@ -6507,7 +6533,7 @@ function formatRelativeTime(config, getRelativeTimeFormat, value, unit, options)
6507
6533
  return getFormatter$1(config, getRelativeTimeFormat, options).format(value, unit);
6508
6534
  }
6509
6535
  catch (e) {
6510
- config.onError(new MessageFormatError('Error formatting relative time.', e));
6536
+ config.onError(new IntlFormatError('Error formatting relative time.', config.locale, e));
6511
6537
  }
6512
6538
  return String(value);
6513
6539
  }
@@ -6587,7 +6613,7 @@ function createIntl(config, cache) {
6587
6613
  var locale = resolvedConfig.locale, defaultLocale = resolvedConfig.defaultLocale, onError = resolvedConfig.onError;
6588
6614
  if (!locale) {
6589
6615
  if (onError) {
6590
- onError(new InvalidConfigError("\"locale\" was not configured, using \"" + defaultLocale + "\" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details"));
6616
+ onError(new InvalidConfigError("\"locale\" was not configured, using \"".concat(defaultLocale, "\" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details")));
6591
6617
  }
6592
6618
  // Since there's no registered locale data for `locale`, this will
6593
6619
  // fallback to the `defaultLocale` to make sure things can render.
@@ -6597,462 +6623,481 @@ function createIntl(config, cache) {
6597
6623
  resolvedConfig.locale = resolvedConfig.defaultLocale || 'en';
6598
6624
  }
6599
6625
  else if (!Intl.NumberFormat.supportedLocalesOf(locale).length && onError) {
6600
- onError(new MissingDataError("Missing locale data for locale: \"" + locale + "\" in Intl.NumberFormat. Using default locale: \"" + defaultLocale + "\" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details"));
6626
+ onError(new MissingDataError("Missing locale data for locale: \"".concat(locale, "\" in Intl.NumberFormat. Using default locale: \"").concat(defaultLocale, "\" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details")));
6601
6627
  }
6602
6628
  else if (!Intl.DateTimeFormat.supportedLocalesOf(locale).length &&
6603
6629
  onError) {
6604
- onError(new MissingDataError("Missing locale data for locale: \"" + locale + "\" in Intl.DateTimeFormat. Using default locale: \"" + defaultLocale + "\" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details"));
6630
+ onError(new MissingDataError("Missing locale data for locale: \"".concat(locale, "\" in Intl.DateTimeFormat. Using default locale: \"").concat(defaultLocale, "\" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details")));
6605
6631
  }
6606
6632
  verifyConfigMessages(resolvedConfig);
6607
6633
  return __assign(__assign({}, resolvedConfig), { formatters: formatters, formatNumber: formatNumber.bind(null, resolvedConfig, formatters.getNumberFormat), formatNumberToParts: formatNumberToParts.bind(null, resolvedConfig, formatters.getNumberFormat), formatRelativeTime: formatRelativeTime.bind(null, resolvedConfig, formatters.getRelativeTimeFormat), formatDate: formatDate.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateToParts: formatDateToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTime: formatTime.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateTimeRange: formatDateTimeRange.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTimeToParts: formatTimeToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatPlural: formatPlural.bind(null, resolvedConfig, formatters.getPluralRules), formatMessage: 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) });
6608
6634
  }
6609
6635
 
6610
- const DEFAULT_LANGUAGE = "en";
6611
- function getBrowserLang() {
6612
- const langAttr = document.documentElement.getAttribute("lang");
6613
- if (!!langAttr) {
6614
- return langAttr;
6615
- }
6616
- else if (window.navigator && window.navigator.language) {
6617
- const lang = window.navigator.languages ? window.navigator.languages[0] : window.navigator.language;
6618
- return lang.slice(0, 2);
6619
- }
6620
- else {
6621
- return DEFAULT_LANGUAGE;
6622
- }
6623
- }
6624
- // prevents memory leak
6625
- const cache = createIntlCache();
6626
- const locale = getBrowserLang();
6627
- const intl = createIntl({
6628
- locale: locale,
6629
- defaultLocale: "en",
6630
- messages: lang[locale] || en,
6631
- }, cache);
6632
- function generateId() {
6633
- return "wmcl-" + Math.random().toString(36).substr(2, 10);
6634
- }
6635
- function debounce(fn, wait) {
6636
- let timeout;
6637
- return function () {
6638
- const context = this;
6639
- const functionCall = () => fn.apply(context, arguments);
6640
- clearTimeout(timeout);
6641
- timeout = setTimeout(functionCall, wait);
6642
- };
6643
- }
6644
- function getTextDir() {
6645
- const dir = document.querySelector("html").getAttribute("dir");
6646
- return dir ? dir.toLowerCase() : "";
6647
- }
6648
- function getPosition(el) {
6649
- const coords = el.getBoundingClientRect();
6650
- let x = coords.x;
6651
- let y = coords.y;
6652
- // Edge doesn't have x and y
6653
- if (!x) {
6654
- if (getTextDir() === "rtl") {
6655
- x = coords.right;
6656
- }
6657
- else {
6658
- x = coords.left;
6659
- }
6660
- y = coords.top;
6661
- }
6662
- return { x, y };
6663
- }
6664
- function findParentWithScrollbar(el) {
6665
- while (!!el) {
6666
- if (el.scrollHeight > el.clientHeight && ["scroll", "auto"].includes(window.getComputedStyle(el).overflowY)) {
6667
- return el;
6668
- }
6669
- el = el.parentElement;
6670
- }
6671
- }
6672
- function findParentWithHiddenOverflow(el) {
6673
- while (!!el) {
6674
- if (window.getComputedStyle(el).overflowY !== "visible") {
6675
- return el;
6676
- }
6677
- el = el.parentElement;
6678
- }
6679
- }
6680
- function getClosableElementMeasurements(fixedEl, closableEl) {
6681
- const parent = findParentWithHiddenOverflow(fixedEl);
6682
- // if parent is not found, measurements are checked against the viewport
6683
- return {
6684
- closableElHeight: closableEl.clientHeight,
6685
- closableElWidth: closableEl.clientWidth,
6686
- // NB boundingClientRect.bottom is space from top of viewport to bottom of el
6687
- // to get space below the el -> height of viewport minus boundingClientRect.bottom
6688
- spaceAbove: parent
6689
- ? fixedEl.getBoundingClientRect().top - parent.getBoundingClientRect().top
6690
- : fixedEl.getBoundingClientRect().top,
6691
- // NB boundingClientRect.bottom is space from top of viewport to bottom of el
6692
- // to get space below the el -> height of viewport minus boundingClientRect.bottom
6693
- spaceBelow: parent
6694
- ? parent.getBoundingClientRect().bottom - fixedEl.getBoundingClientRect().bottom
6695
- : document.documentElement.clientHeight - fixedEl.getBoundingClientRect().bottom,
6696
- spaceLeft: parent
6697
- ? fixedEl.getBoundingClientRect().left - parent.getBoundingClientRect().left
6698
- : fixedEl.getBoundingClientRect().left,
6699
- spaceRight: parent
6700
- ? parent.getBoundingClientRect().right - fixedEl.getBoundingClientRect().right
6701
- : document.documentElement.clientWidth - fixedEl.getBoundingClientRect().right,
6702
- };
6703
- }
6704
- function shouldOpenUp(fixedEl, //the element visible on the page when the component is closed
6705
- closableEl, //the dropdown/popup/etc that becomes visible when the component is open
6706
- offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
6707
- offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
6708
- ) {
6709
- const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
6710
- //we want to open up only if there's not enough space below AND there is enough space above
6711
- const openUp = closableElHeight > spaceBelow + offsetBelow && closableElHeight <= spaceAbove + offsetAbove;
6712
- return openUp;
6713
- }
6714
- function shouldOpenDown(fixedEl, //the element visible on the page when the component is closed
6715
- closableEl, //the dropdown/popup/etc that becomes visible when the component is open
6716
- offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
6717
- offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
6718
- ) {
6719
- const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
6720
- //we want to open up only if there's not enough space below AND there is enough space above
6721
- const openDown = closableElHeight > spaceAbove + offsetAbove && closableElHeight <= spaceBelow + offsetBelow;
6722
- return openDown;
6723
- }
6724
- function shouldShiftRight(fixedEl, closableEl) {
6725
- const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
6726
- const needsSpaceLeft = closableElWidth > spaceLeft && spaceRight > spaceLeft;
6727
- return needsSpaceLeft;
6728
- }
6729
- function shouldShiftLeft(fixedEl, closableEl) {
6730
- const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
6731
- const needsSpaceRight = closableElWidth > spaceRight && spaceLeft > spaceRight;
6732
- return needsSpaceRight;
6733
- }
6734
- function adjustTooltipPosition(tPos, el, tooltipEl) {
6735
- // position must be reset before measurements are taken in adjustTooltipPosition
6736
- // otherwise text-wrapping from previous position makes width measurement inconsistent
6737
- tooltipEl.style.top = "";
6738
- tooltipEl.style.left = "";
6739
- const { spaceLeft, spaceRight, spaceBelow, spaceAbove } = getClosableElementMeasurements(el, tooltipEl);
6740
- const tooltipWidth = tooltipEl.getBoundingClientRect().width;
6741
- const tooltipHeight = tooltipEl.getBoundingClientRect().height;
6742
- const enoughSpaceAbove = spaceAbove > tooltipHeight;
6743
- const enoughSpaceBelow = spaceBelow > tooltipHeight;
6744
- // a tooltip should never be closer than 24px to the edge of a screen
6745
- const enoughSpaceLeft = spaceLeft - 24 > tooltipWidth;
6746
- const enoughSpaceRight = spaceRight - 24 > tooltipWidth;
6747
- const swapAbove = (position) => {
6748
- return !enoughSpaceAbove ? position.replace("top", "bottom") : position;
6749
- };
6750
- const swapBelow = (position) => {
6751
- return !enoughSpaceBelow && enoughSpaceAbove ? position.replace("bottom", "top") : position;
6752
- };
6753
- const swapLeft = (position, centeredPosition) => {
6754
- if (!enoughSpaceLeft && enoughSpaceRight) {
6755
- position = position.replace("left", "right");
6756
- }
6757
- else if (!enoughSpaceLeft && !enoughSpaceRight) {
6758
- position = centeredPosition;
6759
- }
6760
- return position;
6761
- };
6762
- const swapRight = (position, centeredPosition) => {
6763
- if (!enoughSpaceRight && enoughSpaceLeft) {
6764
- position = position.replace("right", "left");
6765
- }
6766
- else if (!enoughSpaceRight && !enoughSpaceLeft) {
6767
- position = centeredPosition;
6768
- }
6769
- return position;
6770
- };
6771
- // horizontal checks must occur before vertical checks, because horizontal can affect vertical positioning but not vice versa
6772
- switch (tPos) {
6773
- case "left":
6774
- tPos = swapLeft(tPos, "bottom");
6775
- case "right":
6776
- tPos = swapRight(tPos, "bottom");
6777
- case "top-left":
6778
- tPos = swapLeft(tPos, "top");
6779
- tPos = swapAbove(tPos);
6780
- case "top-right":
6781
- tPos = swapRight(tPos, "top");
6782
- tPos = swapAbove(tPos);
6783
- case "bottom-left":
6784
- tPos = swapLeft(tPos, "bottom");
6785
- tPos = swapBelow(tPos);
6786
- case "bottom-right":
6787
- tPos = swapRight(tPos, "bottom");
6788
- tPos = swapBelow(tPos);
6789
- case "top":
6790
- tPos = swapAbove(tPos);
6791
- case "bottom":
6792
- tPos = swapBelow(tPos);
6793
- }
6794
- return tPos;
6795
- }
6796
- function hasRoomRight(x, spaceNeeded) {
6797
- let horizOffset = 0;
6798
- // if (getTextDir() === "ltr") {
6799
- if (x.type === "click") {
6800
- // if it's a mouse event, deal with mouse coords
6801
- horizOffset = x.clientX;
6802
- // if it's a focus event, the offset is 0
6803
- }
6804
- else if (x.type === "focus") {
6805
- horizOffset = 0;
6806
- }
6807
- else {
6808
- // otherwise an element was passed, calculate how far it is from the edge of the window
6809
- let el = x; // re-assignment is for clarity
6810
- while (el) {
6811
- if (el.tagName == "BODY") {
6812
- // deal with browser quirks with body/window/document and page scroll
6813
- var xScroll = el.scrollLeft || document.documentElement.scrollLeft;
6814
- horizOffset += el.offsetLeft - xScroll + el.clientLeft;
6815
- }
6816
- else {
6817
- // for all other non-BODY elements
6818
- horizOffset += el.offsetLeft - el.scrollLeft + el.clientLeft;
6819
- }
6820
- el = el.offsetParent;
6821
- }
6822
- // }
6823
- }
6824
- return window.innerWidth - horizOffset >= spaceNeeded;
6825
- }
6826
- function checkForActiveElInShadow(element) {
6827
- while (element && element.shadowRoot) {
6828
- element = element.shadowRoot.activeElement;
6829
- }
6830
- return element;
6831
- }
6832
- function checkForFocusableElInShadow(element) {
6833
- const selectors = [
6834
- "button",
6835
- "a",
6836
- "input",
6837
- "select",
6838
- "textarea",
6839
- "wm-button",
6840
- "wm-search",
6841
- "wm-select",
6842
- "wm-action-menu",
6843
- "wm-tab-item",
6844
- "wm-datepicker",
6845
- ];
6846
- let focusableEl = element;
6847
- selectors.forEach((selector) => {
6848
- if (focusableEl && focusableEl.shadowRoot) {
6849
- let elInShadow = focusableEl.shadowRoot.querySelector(selector);
6850
- if (elInShadow) {
6851
- if (selector.startsWith("wm-")) {
6852
- focusableEl = checkForFocusableElInShadow(elInShadow);
6853
- }
6854
- else {
6855
- focusableEl = elInShadow;
6856
- }
6857
- }
6858
- }
6859
- });
6860
- return focusableEl;
6861
- }
6862
- function isFocusable(element) {
6863
- if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute("tabIndex") !== null)) {
6864
- return true;
6865
- }
6866
- if (element.disabled) {
6867
- return false;
6868
- }
6869
- switch (element.nodeName) {
6870
- case "A":
6871
- return !!element.href && element.rel != "ignore";
6872
- case "INPUT":
6873
- return element.type != "hidden" && element.type != "file";
6874
- case "BUTTON":
6875
- case "SELECT":
6876
- case "TEXTAREA":
6877
- case "WM-BUTTON":
6878
- case "WM-SELECT":
6879
- case "WM-ACTION-MENU":
6880
- case "WM-DATEPICKER":
6881
- case "WM-TIMEPICKER":
6882
- case "WM-INPUT":
6883
- case "WM-TAG-INPUT":
6884
- case "WM-TAB-ITEM":
6885
- case "WM-SEARCH":
6886
- return true;
6887
- default:
6888
- return false;
6889
- }
6890
- }
6891
- function getFirstFocusableDescendant(element) {
6892
- if (isFocusable(element)) {
6893
- return checkForFocusableElInShadow(element);
6894
- }
6895
- else if (element.childNodes.length > 0) {
6896
- element.childNodes.forEach((i) => {
6897
- const childEl = getFirstFocusableDescendant(i);
6898
- return childEl && checkForFocusableElInShadow(childEl);
6899
- });
6900
- }
6901
- }
6902
- function hasValidType(file, types) {
6903
- const acceptedExtensions = types.split(" ");
6904
- const parts = file.name && file.name.split(".");
6905
- const ext = parts && parts.length > 1 && parts[parts.length - 1];
6906
- return ext
6907
- ? acceptedExtensions.includes(ext.toLowerCase())
6908
- : // fallback: if we couldn't obtain an extension,
6909
- // validate based on MIME type...
6910
- !!file.type
6911
- ? getAcceptedMimeTypesList(acceptedExtensions).includes(file.type)
6912
- : // ...and if that failed too, accept the file
6913
- // as it's preferable to accept an invalid file
6914
- // than refusing a valid one (back-end will take care of what slips through)
6915
- true;
6916
- }
6917
- // takes a string (space separated list of extensions), returns an array of strings (corresponding MIME types)
6918
- function getAcceptedMimeTypesList(acceptedExtensions) {
6919
- // this is just a list of common file types (regardless of whether they are/can be valid or not)
6920
- // front end checks are just a convenience to users, independent of security.
6921
- // it allows users to be notified of an invalid type as soon as they select the file, rather than when it gets uploaded
6922
- const lookupTable = {
6923
- aac: ["audio/aac"],
6924
- abw: ["application/x-abiword"],
6925
- arc: ["application/x-freearc"],
6926
- avi: ["video/x-msvideo"],
6927
- azw: ["application/vnd.amazon.ebook"],
6928
- bin: ["application/octet-stream"],
6929
- bmp: ["image/bmp"],
6930
- bz: ["application/x-bzip"],
6931
- bz2: ["application/x-bzip2"],
6932
- csh: ["application/x-csh"],
6933
- css: ["text/css"],
6934
- csv: ["text/csv"],
6935
- doc: ["application/msword"],
6936
- docx: ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
6937
- eot: ["application/vnd.ms-fontobject"],
6938
- epub: ["application/epub+zip"],
6939
- gz: ["application/gzip"],
6940
- gif: ["image/gif"],
6941
- htm: ["text/html"],
6942
- html: ["text/html"],
6943
- ico: ["image/vnd.microsoft.icon"],
6944
- ics: ["text/calendar"],
6945
- jar: ["application/java-archive"],
6946
- jpeg: ["image/jpeg"],
6947
- jpg: ["image/jpeg"],
6948
- js: ["text/javascript"],
6949
- json: ["application/json"],
6950
- jsonld: ["application/ld+json"],
6951
- log: ["text/plain"],
6952
- mid: ["audio/x-midi"],
6953
- midi: ["audio/x-midi"],
6954
- mjs: ["text/javascript"],
6955
- mp3: ["audio/mpeg"],
6956
- mpeg: ["video/mpeg"],
6957
- mpkg: ["application/vnd.apple.installer+xml"],
6958
- odp: ["application/vnd.oasis.opendocument.presentation"],
6959
- ods: ["application/vnd.oasis.opendocument.spreadsheet"],
6960
- odt: ["application/vnd.oasis.opendocument.text"],
6961
- oga: ["audio/ogg"],
6962
- ogv: ["video/ogg"],
6963
- ogx: ["application/ogg"],
6964
- opus: ["audio/opus"],
6965
- otf: ["font/otf"],
6966
- png: ["image/png"],
6967
- pdf: ["application/pdf"],
6968
- php: ["application/php"],
6969
- ppt: ["application/vnd.ms-powerpoint"],
6970
- pptx: ["application/vnd.openxmlformats-officedocument.presentationml.presentation"],
6971
- rar: ["application/vnd.rar", "application/x-rar", "application/x-rar-compressed"],
6972
- rtf: ["application/rtf"],
6973
- sh: ["application/x-sh"],
6974
- svg: ["image/svg+xml"],
6975
- swf: ["application/x-shockwave-flash"],
6976
- tar: ["application/x-tar"],
6977
- tif: ["image/tiff"],
6978
- tiff: ["image/tiff"],
6979
- ts: ["video/mp2t"],
6980
- ttf: ["font/ttf"],
6981
- txt: ["text/plain"],
6982
- vsd: ["application/vnd.visio"],
6983
- wav: ["audio/wav"],
6984
- weba: ["audio/webm"],
6985
- webm: ["video/webm"],
6986
- webp: ["image/webp"],
6987
- woff: ["font/woff"],
6988
- woff2: ["font/woff2"],
6989
- xhtml: ["application/xhtml+xml"],
6990
- xls: ["application/vnd.ms-excel"],
6991
- xlsx: ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
6992
- xml: ["application/xml", "text/xml"],
6993
- xul: ["application/vnd.mozilla.xul+xml"],
6994
- zip: ["application/zip", "application/x-zip-compressed", "multipart/x-zip"],
6995
- "3gp": ["video/3gpp", "audio/3gpp"],
6996
- "3g2": ["video/3gpp2", "audio/3gpp2"],
6997
- "7z": ["application/x-7z-compressed"],
6998
- };
6999
- return acceptedExtensions.reduce((acc, ext) => acc.concat(lookupTable[ext]), []);
7000
- }
7001
- function snakeCaseToCamelCase(str) {
7002
- const snakeCaseRegexp = /^([a-z0-9]*)(_[a-z0-9]*)*$/g;
7003
- if (snakeCaseRegexp.test(str)) {
7004
- let camelCase = "";
7005
- let arr = str.split("_");
7006
- arr.forEach((word, idx) => {
7007
- camelCase += idx === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1);
7008
- });
7009
- return camelCase;
7010
- }
7011
- else {
7012
- return str;
7013
- }
7014
- }
7015
- function getNewIndexToFocus(currentIndex, direction, listLength) {
7016
- let newIndex = currentIndex;
7017
- if (direction === "ArrowDown") {
7018
- newIndex = (currentIndex + 1) % listLength;
7019
- }
7020
- if (direction === "ArrowUp") {
7021
- newIndex = currentIndex === 0 ? listLength - 1 : currentIndex - 1;
7022
- }
7023
- return newIndex;
7024
- }
7025
- function isRelatedTarget(ev, id) {
7026
- // used for onBlur events to check the element that has been clicked
7027
- const ids = id.split(" ");
7028
- return ev.relatedTarget && ids.includes(ev.relatedTarget.id);
7029
- }
7030
- function toBool(val) {
7031
- // string "false" needs to be treated as bool False because react wrappers convert bool to string.
7032
- return val == "false" ? false : !!val;
7033
- }
7034
- /*
7035
- * this is going to be needed to solve the extra tabbing on navigator
7036
- * and for programmatic focus of tabs
7037
- * Here's a draft, not bug proof, see:
7038
- * https://stackoverflow.com/a/10730308/3741713
7039
-
7040
- function getKeyboardFocusableElements(element = document) {
7041
- const els = Array.from(element.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), wm-search, wm-timepicker, wm-tab-list, wm-tab-item, wm-button, wm-action-menu'));
7042
- return els.filter((el: Element) => !el.hasAttribute("disabled")) as HTMLElement[];
7043
- }
7044
-
7045
- export function getPreviousKeyboardFocusableElement(element: HTMLElement) {
7046
- const els = getKeyboardFocusableElements();
7047
- const current = els.indexOf(element);
7048
- return els[current - 1] as HTMLElement;
7049
- }
7050
-
7051
- export function getNextKeyboardFocusableElement(element: HTMLElement) {
7052
- const els = getKeyboardFocusableElements();
7053
- const current = els.indexOf(element);
7054
- return els[current + 1] as HTMLElement;
7055
- }
6636
+ const DEFAULT_LANGUAGE = "en";
6637
+ function getBrowserLang() {
6638
+ const langAttr = document.documentElement.getAttribute("lang");
6639
+ if (!!langAttr) {
6640
+ return langAttr;
6641
+ }
6642
+ else if (window.navigator && window.navigator.language) {
6643
+ const lang = window.navigator.languages ? window.navigator.languages[0] : window.navigator.language;
6644
+ return lang.slice(0, 2);
6645
+ }
6646
+ else {
6647
+ return DEFAULT_LANGUAGE;
6648
+ }
6649
+ }
6650
+ // prevents memory leak
6651
+ const cache = createIntlCache();
6652
+ const locale = getBrowserLang();
6653
+ const intl = createIntl({
6654
+ locale: locale,
6655
+ defaultLocale: "en",
6656
+ messages: lang[locale] || en,
6657
+ }, cache);
6658
+ function generateId() {
6659
+ return "wmcl-" + Math.random().toString(36).substr(2, 10);
6660
+ }
6661
+ // limits how many times a function fires
6662
+ // use when the function should run periodically, but not too often (e.g. window resize)
6663
+ function throttle(fn, wait) {
6664
+ let timeout;
6665
+ let shouldWait = false;
6666
+ return function () {
6667
+ const context = this;
6668
+ if (!shouldWait) {
6669
+ fn.apply(context, arguments);
6670
+ shouldWait = true;
6671
+ clearTimeout(timeout);
6672
+ timeout = setTimeout(function () {
6673
+ shouldWait = false;
6674
+ }, wait);
6675
+ }
6676
+ };
6677
+ }
6678
+ // waits until it hasn't been called for [timeout] ms.
6679
+ // use when the function should run only after something (event) is done firing
6680
+ function debounce(fn, wait) {
6681
+ let timeout;
6682
+ return function () {
6683
+ const context = this;
6684
+ const functionCall = () => fn.apply(context, arguments);
6685
+ clearTimeout(timeout);
6686
+ timeout = setTimeout(functionCall, wait);
6687
+ };
6688
+ }
6689
+ function getTextDir() {
6690
+ const dir = document.querySelector("html").getAttribute("dir");
6691
+ return dir ? dir.toLowerCase() : "";
6692
+ }
6693
+ function getPosition(el) {
6694
+ const coords = el.getBoundingClientRect();
6695
+ let x = coords.x;
6696
+ let y = coords.y;
6697
+ // Edge doesn't have x and y
6698
+ if (!x) {
6699
+ if (getTextDir() === "rtl") {
6700
+ x = coords.right;
6701
+ }
6702
+ else {
6703
+ x = coords.left;
6704
+ }
6705
+ y = coords.top;
6706
+ }
6707
+ return { x, y };
6708
+ }
6709
+ function findParentWithScrollbar(el) {
6710
+ while (!!el) {
6711
+ if (el.scrollHeight > el.clientHeight && ["scroll", "auto"].includes(window.getComputedStyle(el).overflowY)) {
6712
+ return el;
6713
+ }
6714
+ el = el.parentElement;
6715
+ }
6716
+ }
6717
+ function findParentWithHiddenOverflow(el) {
6718
+ while (!!el) {
6719
+ if (window.getComputedStyle(el).overflowY !== "visible") {
6720
+ return el;
6721
+ }
6722
+ el = el.parentElement;
6723
+ }
6724
+ }
6725
+ function getClosableElementMeasurements(fixedEl, closableEl) {
6726
+ const parent = findParentWithHiddenOverflow(fixedEl);
6727
+ // if parent is not found, measurements are checked against the viewport
6728
+ return {
6729
+ closableElHeight: closableEl.clientHeight,
6730
+ closableElWidth: closableEl.clientWidth,
6731
+ // NB boundingClientRect.bottom is space from top of viewport to bottom of el
6732
+ // to get space below the el -> height of viewport minus boundingClientRect.bottom
6733
+ spaceAbove: parent
6734
+ ? fixedEl.getBoundingClientRect().top - parent.getBoundingClientRect().top
6735
+ : fixedEl.getBoundingClientRect().top,
6736
+ // NB boundingClientRect.bottom is space from top of viewport to bottom of el
6737
+ // to get space below the el -> height of viewport minus boundingClientRect.bottom
6738
+ spaceBelow: parent
6739
+ ? parent.getBoundingClientRect().bottom - fixedEl.getBoundingClientRect().bottom
6740
+ : document.documentElement.clientHeight - fixedEl.getBoundingClientRect().bottom,
6741
+ spaceLeft: parent
6742
+ ? fixedEl.getBoundingClientRect().left - parent.getBoundingClientRect().left
6743
+ : fixedEl.getBoundingClientRect().left,
6744
+ spaceRight: parent
6745
+ ? parent.getBoundingClientRect().right - fixedEl.getBoundingClientRect().right
6746
+ : document.documentElement.clientWidth - fixedEl.getBoundingClientRect().right,
6747
+ };
6748
+ }
6749
+ function shouldOpenUp(fixedEl, //the element visible on the page when the component is closed
6750
+ closableEl, //the dropdown/popup/etc that becomes visible when the component is open
6751
+ offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
6752
+ offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
6753
+ ) {
6754
+ const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
6755
+ //we want to open up only if there's not enough space below AND there is enough space above
6756
+ const openUp = closableElHeight > spaceBelow + offsetBelow && closableElHeight <= spaceAbove + offsetAbove;
6757
+ return openUp;
6758
+ }
6759
+ function shouldOpenDown(fixedEl, //the element visible on the page when the component is closed
6760
+ closableEl, //the dropdown/popup/etc that becomes visible when the component is open
6761
+ offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
6762
+ offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
6763
+ ) {
6764
+ const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
6765
+ //we want to open up only if there's not enough space below AND there is enough space above
6766
+ const openDown = closableElHeight > spaceAbove + offsetAbove && closableElHeight <= spaceBelow + offsetBelow;
6767
+ return openDown;
6768
+ }
6769
+ function shouldShiftRight(fixedEl, closableEl) {
6770
+ const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
6771
+ const needsSpaceLeft = closableElWidth > spaceLeft && spaceRight > spaceLeft;
6772
+ return needsSpaceLeft;
6773
+ }
6774
+ function shouldShiftLeft(fixedEl, closableEl) {
6775
+ const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
6776
+ const needsSpaceRight = closableElWidth > spaceRight && spaceLeft > spaceRight;
6777
+ return needsSpaceRight;
6778
+ }
6779
+ function adjustTooltipPosition(tPos, el, tooltipEl) {
6780
+ // position must be reset before measurements are taken in adjustTooltipPosition
6781
+ // otherwise text-wrapping from previous position makes width measurement inconsistent
6782
+ tooltipEl.style.top = "";
6783
+ tooltipEl.style.left = "";
6784
+ const { spaceLeft, spaceRight, spaceBelow, spaceAbove } = getClosableElementMeasurements(el, tooltipEl);
6785
+ const tooltipWidth = tooltipEl.getBoundingClientRect().width;
6786
+ const tooltipHeight = tooltipEl.getBoundingClientRect().height;
6787
+ const enoughSpaceAbove = spaceAbove > tooltipHeight;
6788
+ const enoughSpaceBelow = spaceBelow > tooltipHeight;
6789
+ // a tooltip should never be closer than 24px to the edge of a screen
6790
+ const enoughSpaceLeft = spaceLeft - 24 > tooltipWidth;
6791
+ const enoughSpaceRight = spaceRight - 24 > tooltipWidth;
6792
+ const swapAbove = (position) => {
6793
+ return !enoughSpaceAbove ? position.replace("top", "bottom") : position;
6794
+ };
6795
+ const swapBelow = (position) => {
6796
+ return !enoughSpaceBelow && enoughSpaceAbove ? position.replace("bottom", "top") : position;
6797
+ };
6798
+ const swapLeft = (position, centeredPosition) => {
6799
+ if (!enoughSpaceLeft && enoughSpaceRight) {
6800
+ position = position.replace("left", "right");
6801
+ }
6802
+ else if (!enoughSpaceLeft && !enoughSpaceRight) {
6803
+ position = centeredPosition;
6804
+ }
6805
+ return position;
6806
+ };
6807
+ const swapRight = (position, centeredPosition) => {
6808
+ if (!enoughSpaceRight && enoughSpaceLeft) {
6809
+ position = position.replace("right", "left");
6810
+ }
6811
+ else if (!enoughSpaceRight && !enoughSpaceLeft) {
6812
+ position = centeredPosition;
6813
+ }
6814
+ return position;
6815
+ };
6816
+ // horizontal checks must occur before vertical checks, because horizontal can affect vertical positioning but not vice versa
6817
+ switch (tPos) {
6818
+ case "left":
6819
+ tPos = swapLeft(tPos, "bottom");
6820
+ case "right":
6821
+ tPos = swapRight(tPos, "bottom");
6822
+ case "top-left":
6823
+ tPos = swapLeft(tPos, "top");
6824
+ tPos = swapAbove(tPos);
6825
+ case "top-right":
6826
+ tPos = swapRight(tPos, "top");
6827
+ tPos = swapAbove(tPos);
6828
+ case "bottom-left":
6829
+ tPos = swapLeft(tPos, "bottom");
6830
+ tPos = swapBelow(tPos);
6831
+ case "bottom-right":
6832
+ tPos = swapRight(tPos, "bottom");
6833
+ tPos = swapBelow(tPos);
6834
+ case "top":
6835
+ tPos = swapAbove(tPos);
6836
+ case "bottom":
6837
+ tPos = swapBelow(tPos);
6838
+ }
6839
+ return tPos;
6840
+ }
6841
+ function hasRoomRight(x, spaceNeeded) {
6842
+ let horizOffset = 0;
6843
+ // if (getTextDir() === "ltr") {
6844
+ if (x.type === "click") {
6845
+ // if it's a mouse event, deal with mouse coords
6846
+ horizOffset = x.clientX;
6847
+ // if it's a focus event, the offset is 0
6848
+ }
6849
+ else if (x.type === "focus") {
6850
+ horizOffset = 0;
6851
+ }
6852
+ else {
6853
+ // otherwise an element was passed, calculate how far it is from the edge of the window
6854
+ let el = x; // re-assignment is for clarity
6855
+ while (el) {
6856
+ if (el.tagName == "BODY") {
6857
+ // deal with browser quirks with body/window/document and page scroll
6858
+ var xScroll = el.scrollLeft || document.documentElement.scrollLeft;
6859
+ horizOffset += el.offsetLeft - xScroll + el.clientLeft;
6860
+ }
6861
+ else {
6862
+ // for all other non-BODY elements
6863
+ horizOffset += el.offsetLeft - el.scrollLeft + el.clientLeft;
6864
+ }
6865
+ el = el.offsetParent;
6866
+ }
6867
+ // }
6868
+ }
6869
+ return window.innerWidth - horizOffset >= spaceNeeded;
6870
+ }
6871
+ function checkForActiveElInShadow(element) {
6872
+ while (element && element.shadowRoot) {
6873
+ element = element.shadowRoot.activeElement;
6874
+ }
6875
+ return element;
6876
+ }
6877
+ function checkForFocusableElInShadow(element) {
6878
+ const selectors = [
6879
+ "button",
6880
+ "a",
6881
+ "input",
6882
+ "select",
6883
+ "textarea",
6884
+ "wm-button",
6885
+ "wm-search",
6886
+ "wm-select",
6887
+ "wm-action-menu",
6888
+ "wm-tab-item",
6889
+ "wm-datepicker",
6890
+ ];
6891
+ let focusableEl = element;
6892
+ selectors.forEach((selector) => {
6893
+ if (focusableEl && focusableEl.shadowRoot) {
6894
+ let elInShadow = focusableEl.shadowRoot.querySelector(selector);
6895
+ if (elInShadow) {
6896
+ if (selector.startsWith("wm-")) {
6897
+ focusableEl = checkForFocusableElInShadow(elInShadow);
6898
+ }
6899
+ else {
6900
+ focusableEl = elInShadow;
6901
+ }
6902
+ }
6903
+ }
6904
+ });
6905
+ return focusableEl;
6906
+ }
6907
+ function isFocusable(element) {
6908
+ if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute("tabIndex") !== null)) {
6909
+ return true;
6910
+ }
6911
+ if (element.disabled) {
6912
+ return false;
6913
+ }
6914
+ switch (element.nodeName) {
6915
+ case "A":
6916
+ return !!element.href && element.rel != "ignore";
6917
+ case "INPUT":
6918
+ return element.type != "hidden" && element.type != "file";
6919
+ case "BUTTON":
6920
+ case "SELECT":
6921
+ case "TEXTAREA":
6922
+ case "WM-BUTTON":
6923
+ case "WM-SELECT":
6924
+ case "WM-ACTION-MENU":
6925
+ case "WM-DATEPICKER":
6926
+ case "WM-TIMEPICKER":
6927
+ case "WM-INPUT":
6928
+ case "WM-TAG-INPUT":
6929
+ case "WM-TAB-ITEM":
6930
+ case "WM-SEARCH":
6931
+ return true;
6932
+ default:
6933
+ return false;
6934
+ }
6935
+ }
6936
+ function getFirstFocusableDescendant(element) {
6937
+ if (isFocusable(element)) {
6938
+ return checkForFocusableElInShadow(element);
6939
+ }
6940
+ else if (element.childNodes.length > 0) {
6941
+ element.childNodes.forEach((i) => {
6942
+ const childEl = getFirstFocusableDescendant(i);
6943
+ return childEl && checkForFocusableElInShadow(childEl);
6944
+ });
6945
+ }
6946
+ }
6947
+ function hasValidType(file, types) {
6948
+ const acceptedExtensions = types.split(" ");
6949
+ const parts = file.name && file.name.split(".");
6950
+ const ext = parts && parts.length > 1 && parts[parts.length - 1];
6951
+ return ext
6952
+ ? acceptedExtensions.includes(ext.toLowerCase())
6953
+ : // fallback: if we couldn't obtain an extension,
6954
+ // validate based on MIME type...
6955
+ !!file.type
6956
+ ? getAcceptedMimeTypesList(acceptedExtensions).includes(file.type)
6957
+ : // ...and if that failed too, accept the file
6958
+ // as it's preferable to accept an invalid file
6959
+ // than refusing a valid one (back-end will take care of what slips through)
6960
+ true;
6961
+ }
6962
+ // takes a string (space separated list of extensions), returns an array of strings (corresponding MIME types)
6963
+ function getAcceptedMimeTypesList(acceptedExtensions) {
6964
+ // this is just a list of common file types (regardless of whether they are/can be valid or not)
6965
+ // front end checks are just a convenience to users, independent of security.
6966
+ // it allows users to be notified of an invalid type as soon as they select the file, rather than when it gets uploaded
6967
+ const lookupTable = {
6968
+ aac: ["audio/aac"],
6969
+ abw: ["application/x-abiword"],
6970
+ arc: ["application/x-freearc"],
6971
+ avi: ["video/x-msvideo"],
6972
+ azw: ["application/vnd.amazon.ebook"],
6973
+ bin: ["application/octet-stream"],
6974
+ bmp: ["image/bmp"],
6975
+ bz: ["application/x-bzip"],
6976
+ bz2: ["application/x-bzip2"],
6977
+ csh: ["application/x-csh"],
6978
+ css: ["text/css"],
6979
+ csv: ["text/csv"],
6980
+ doc: ["application/msword"],
6981
+ docx: ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
6982
+ eot: ["application/vnd.ms-fontobject"],
6983
+ epub: ["application/epub+zip"],
6984
+ gz: ["application/gzip"],
6985
+ gif: ["image/gif"],
6986
+ htm: ["text/html"],
6987
+ html: ["text/html"],
6988
+ ico: ["image/vnd.microsoft.icon"],
6989
+ ics: ["text/calendar"],
6990
+ jar: ["application/java-archive"],
6991
+ jpeg: ["image/jpeg"],
6992
+ jpg: ["image/jpeg"],
6993
+ js: ["text/javascript"],
6994
+ json: ["application/json"],
6995
+ jsonld: ["application/ld+json"],
6996
+ log: ["text/plain"],
6997
+ mid: ["audio/x-midi"],
6998
+ midi: ["audio/x-midi"],
6999
+ mjs: ["text/javascript"],
7000
+ mp3: ["audio/mpeg"],
7001
+ mpeg: ["video/mpeg"],
7002
+ mpkg: ["application/vnd.apple.installer+xml"],
7003
+ odp: ["application/vnd.oasis.opendocument.presentation"],
7004
+ ods: ["application/vnd.oasis.opendocument.spreadsheet"],
7005
+ odt: ["application/vnd.oasis.opendocument.text"],
7006
+ oga: ["audio/ogg"],
7007
+ ogv: ["video/ogg"],
7008
+ ogx: ["application/ogg"],
7009
+ opus: ["audio/opus"],
7010
+ otf: ["font/otf"],
7011
+ png: ["image/png"],
7012
+ pdf: ["application/pdf"],
7013
+ php: ["application/php"],
7014
+ ppt: ["application/vnd.ms-powerpoint"],
7015
+ pptx: ["application/vnd.openxmlformats-officedocument.presentationml.presentation"],
7016
+ rar: ["application/vnd.rar", "application/x-rar", "application/x-rar-compressed"],
7017
+ rtf: ["application/rtf"],
7018
+ sh: ["application/x-sh"],
7019
+ svg: ["image/svg+xml"],
7020
+ swf: ["application/x-shockwave-flash"],
7021
+ tar: ["application/x-tar"],
7022
+ tif: ["image/tiff"],
7023
+ tiff: ["image/tiff"],
7024
+ ts: ["video/mp2t"],
7025
+ ttf: ["font/ttf"],
7026
+ txt: ["text/plain"],
7027
+ vsd: ["application/vnd.visio"],
7028
+ wav: ["audio/wav"],
7029
+ weba: ["audio/webm"],
7030
+ webm: ["video/webm"],
7031
+ webp: ["image/webp"],
7032
+ woff: ["font/woff"],
7033
+ woff2: ["font/woff2"],
7034
+ xhtml: ["application/xhtml+xml"],
7035
+ xls: ["application/vnd.ms-excel"],
7036
+ xlsx: ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
7037
+ xml: ["application/xml", "text/xml"],
7038
+ xul: ["application/vnd.mozilla.xul+xml"],
7039
+ zip: ["application/zip", "application/x-zip-compressed", "multipart/x-zip"],
7040
+ "3gp": ["video/3gpp", "audio/3gpp"],
7041
+ "3g2": ["video/3gpp2", "audio/3gpp2"],
7042
+ "7z": ["application/x-7z-compressed"],
7043
+ };
7044
+ return acceptedExtensions.reduce((acc, ext) => acc.concat(lookupTable[ext]), []);
7045
+ }
7046
+ function snakeCaseToCamelCase(str) {
7047
+ const snakeCaseRegexp = /^([a-z0-9]*)(_[a-z0-9]*)*$/g;
7048
+ if (snakeCaseRegexp.test(str)) {
7049
+ let camelCase = "";
7050
+ let arr = str.split("_");
7051
+ arr.forEach((word, idx) => {
7052
+ camelCase += idx === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1);
7053
+ });
7054
+ return camelCase;
7055
+ }
7056
+ else {
7057
+ return str;
7058
+ }
7059
+ }
7060
+ function getNewIndexToFocus(currentIndex, direction, listLength) {
7061
+ let newIndex = currentIndex;
7062
+ if (direction === "ArrowDown") {
7063
+ newIndex = (currentIndex + 1) % listLength;
7064
+ }
7065
+ if (direction === "ArrowUp") {
7066
+ newIndex = currentIndex === 0 ? listLength - 1 : currentIndex - 1;
7067
+ }
7068
+ return newIndex;
7069
+ }
7070
+ function isRelatedTarget(ev, id) {
7071
+ // used for onBlur events to check the element that has been clicked
7072
+ const ids = id.split(" ");
7073
+ return ev.relatedTarget && ids.includes(ev.relatedTarget.id);
7074
+ }
7075
+ function toBool(val) {
7076
+ // string "false" needs to be treated as bool False because react wrappers convert bool to string.
7077
+ return val == "false" ? false : !!val;
7078
+ }
7079
+ /*
7080
+ * this is going to be needed to solve the extra tabbing on navigator
7081
+ * and for programmatic focus of tabs
7082
+ * Here's a draft, not bug proof, see:
7083
+ * https://stackoverflow.com/a/10730308/3741713
7084
+
7085
+ function getKeyboardFocusableElements(element = document) {
7086
+ const els = Array.from(element.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), wm-search, wm-timepicker, wm-tab-list, wm-tab-item, wm-button, wm-action-menu'));
7087
+ return els.filter((el: Element) => !el.hasAttribute("disabled")) as HTMLElement[];
7088
+ }
7089
+
7090
+ export function getPreviousKeyboardFocusableElement(element: HTMLElement) {
7091
+ const els = getKeyboardFocusableElements();
7092
+ const current = els.indexOf(element);
7093
+ return els[current - 1] as HTMLElement;
7094
+ }
7095
+
7096
+ export function getNextKeyboardFocusableElement(element: HTMLElement) {
7097
+ const els = getKeyboardFocusableElements();
7098
+ const current = els.indexOf(element);
7099
+ return els[current + 1] as HTMLElement;
7100
+ }
7056
7101
  */
7057
7102
 
7058
7103
  exports.adjustTooltipPosition = adjustTooltipPosition;
@@ -7074,4 +7119,5 @@ exports.shouldOpenUp = shouldOpenUp;
7074
7119
  exports.shouldShiftLeft = shouldShiftLeft;
7075
7120
  exports.shouldShiftRight = shouldShiftRight;
7076
7121
  exports.snakeCaseToCamelCase = snakeCaseToCamelCase;
7122
+ exports.throttle = throttle;
7077
7123
  exports.toBool = toBool;