@watermarkinsights/ripple 5.16.0-alpha.2 → 5.16.0-alpha.5

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 (380) hide show
  1. package/dist/cjs/app-globals-409642c7.js +92 -0
  2. package/dist/cjs/chartFunctions-439c6fd4.js +742 -0
  3. package/dist/cjs/functions-dd27bda3.js +10618 -0
  4. package/dist/cjs/index-788526f5.js +1863 -0
  5. package/dist/cjs/index.cjs.js +2 -0
  6. package/dist/cjs/interfaces-85d78ae9.js +37 -0
  7. package/dist/cjs/intl-6d72b4a0.js +283 -0
  8. package/dist/cjs/loader.cjs.js +15 -0
  9. package/dist/cjs/priv-calendar.cjs.entry.js +574 -0
  10. package/dist/{ripple/wm-textarea.entry.js → cjs/priv-chart-popover.cjs.entry.js} +122 -60
  11. package/dist/{ripple/wm-modal-footer.entry.js → cjs/priv-navigator-button.cjs.entry.js} +20 -35
  12. package/dist/{ripple/wm-toggletip.entry.js → cjs/priv-navigator-item.cjs.entry.js} +25 -227
  13. package/dist/{ripple/wm-flyout.entry.js → cjs/priv-option-list.cjs.entry.js} +359 -141
  14. package/dist/cjs/ripple.cjs.js +25 -0
  15. package/dist/cjs/wm-action-menu_2.cjs.entry.js +335 -0
  16. package/dist/{ripple/wm-action-menu.entry.js → cjs/wm-button.cjs.entry.js} +229 -162
  17. package/dist/cjs/wm-chart-slice.cjs.entry.js +27 -0
  18. package/dist/cjs/wm-chart.cjs.entry.js +163 -0
  19. package/dist/cjs/wm-date-range.cjs.entry.js +484 -0
  20. package/dist/cjs/wm-datepicker.cjs.entry.js +254 -0
  21. package/dist/cjs/wm-file-list.cjs.entry.js +23 -0
  22. package/dist/cjs/wm-file.cjs.entry.js +194 -0
  23. package/dist/cjs/wm-flyout.cjs.entry.js +180 -0
  24. package/dist/cjs/wm-input.cjs.entry.js +125 -0
  25. package/dist/cjs/wm-line-chart.cjs.entry.js +461 -0
  26. package/dist/cjs/wm-modal-pss_3.cjs.entry.js +217 -0
  27. package/dist/cjs/wm-modal_3.cjs.entry.js +217 -0
  28. package/dist/cjs/wm-navigation_3.cjs.entry.js +188 -0
  29. package/dist/cjs/wm-navigator.cjs.entry.js +327 -0
  30. package/dist/cjs/wm-nested-select.cjs.entry.js +315 -0
  31. package/dist/cjs/wm-optgroup.cjs.entry.js +74 -0
  32. package/dist/cjs/wm-option_2.cjs.entry.js +427 -0
  33. package/dist/cjs/wm-pagination.cjs.entry.js +228 -0
  34. package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +204 -0
  35. package/dist/cjs/wm-search.cjs.entry.js +196 -0
  36. package/dist/cjs/wm-snackbar.cjs.entry.js +189 -0
  37. package/dist/cjs/wm-tab-item_3.cjs.entry.js +263 -0
  38. package/dist/cjs/wm-tag-input.cjs.entry.js +948 -0
  39. package/dist/cjs/wm-tag-option.cjs.entry.js +43 -0
  40. package/dist/cjs/wm-textarea.cjs.entry.js +88 -0
  41. package/dist/cjs/wm-timepicker.cjs.entry.js +307 -0
  42. package/dist/cjs/wm-toggletip.cjs.entry.js +242 -0
  43. package/dist/cjs/wm-uploader.cjs.entry.js +325 -0
  44. package/dist/cjs/wm-wrapper.cjs.entry.js +21 -0
  45. package/dist/collection/collection-manifest.json +197 -0
  46. package/dist/collection/components/charts/chartFunctions.js +675 -0
  47. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.css +948 -0
  48. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +262 -0
  49. package/dist/collection/components/charts/wm-chart/wm-chart-slice.js +125 -0
  50. package/dist/collection/components/charts/wm-chart/wm-chart.css +1314 -0
  51. package/dist/collection/components/charts/wm-chart/wm-chart.js +422 -0
  52. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.css +1106 -0
  53. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.js +723 -0
  54. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.css +1314 -0
  55. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +264 -0
  56. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.css +948 -0
  57. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +151 -0
  58. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-slice.js +121 -0
  59. package/dist/collection/components/datepickers/datepicker.css +1083 -0
  60. package/dist/collection/components/datepickers/priv-calendar/priv-calendar.css +1318 -0
  61. package/dist/collection/components/datepickers/priv-calendar/priv-calendar.js +840 -0
  62. package/dist/collection/components/datepickers/wm-date-range.js +849 -0
  63. package/dist/collection/components/datepickers/wm-datepicker.js +524 -0
  64. package/dist/collection/components/selects/priv-option-list/priv-option-list.css +958 -0
  65. package/dist/collection/components/selects/priv-option-list/priv-option-list.js +780 -0
  66. package/dist/collection/components/selects/wm-nested-select/wm-nested-select.css +1229 -0
  67. package/dist/collection/components/selects/wm-nested-select/wm-nested-select.js +620 -0
  68. package/dist/collection/components/selects/wm-optgroup/wm-optgroup.css +869 -0
  69. package/dist/collection/components/selects/wm-optgroup/wm-optgroup.js +258 -0
  70. package/dist/collection/components/selects/wm-option/wm-option.css +970 -0
  71. package/dist/collection/components/selects/wm-option/wm-option.js +530 -0
  72. package/dist/collection/components/selects/wm-select/wm-select.css +1143 -0
  73. package/dist/collection/components/selects/wm-select/wm-select.js +584 -0
  74. package/dist/collection/components/wm-action-menu/wm-action-menu.css +930 -0
  75. package/dist/collection/components/wm-action-menu/wm-action-menu.js +435 -0
  76. package/dist/collection/components/wm-button/wm-button.css +1580 -0
  77. package/dist/collection/components/wm-button/wm-button.js +555 -0
  78. package/dist/collection/components/wm-file/wm-file.css +966 -0
  79. package/dist/collection/components/wm-file/wm-file.js +412 -0
  80. package/dist/collection/components/wm-file-list/wm-file-list.css +859 -0
  81. package/dist/collection/components/wm-file-list/wm-file-list.js +45 -0
  82. package/dist/collection/components/wm-flyout/wm-flyout.css +1053 -0
  83. package/dist/collection/components/wm-flyout/wm-flyout.js +448 -0
  84. package/dist/collection/components/wm-input/wm-input.css +1043 -0
  85. package/dist/collection/components/wm-input/wm-input.js +471 -0
  86. package/dist/collection/components/wm-menuitem/wm-menuitem.css +930 -0
  87. package/dist/collection/components/wm-menuitem/wm-menuitem.js +419 -0
  88. package/dist/collection/components/wm-modal/wm-modal-footer.css +884 -0
  89. package/dist/collection/components/wm-modal/wm-modal-footer.js +142 -0
  90. package/dist/collection/components/wm-modal/wm-modal-header.css +883 -0
  91. package/dist/collection/components/wm-modal/wm-modal-header.js +79 -0
  92. package/dist/collection/components/wm-modal/wm-modal.css +931 -0
  93. package/dist/collection/components/wm-modal/wm-modal.js +350 -0
  94. package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.css +891 -0
  95. package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.js +138 -0
  96. package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.css +885 -0
  97. package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.js +82 -0
  98. package/dist/collection/components/wm-modal-pss/wm-modal-pss.css +967 -0
  99. package/dist/collection/components/wm-modal-pss/wm-modal-pss.js +362 -0
  100. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.css +886 -0
  101. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +119 -0
  102. package/dist/collection/components/wm-navigation/wm-navigation-item.css +895 -0
  103. package/dist/collection/components/wm-navigation/wm-navigation-item.js +98 -0
  104. package/dist/collection/components/wm-navigation/wm-navigation.css +937 -0
  105. package/dist/collection/components/wm-navigation/wm-navigation.js +190 -0
  106. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.css +889 -0
  107. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +86 -0
  108. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.css +869 -0
  109. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +124 -0
  110. package/dist/collection/components/wm-navigator/wm-navigator.css +942 -0
  111. package/dist/collection/components/wm-navigator/wm-navigator.js +496 -0
  112. package/dist/collection/components/wm-pagination/wm-pagination.css +1010 -0
  113. package/dist/collection/components/wm-pagination/wm-pagination.js +363 -0
  114. package/dist/collection/components/wm-search/wm-search.css +935 -0
  115. package/dist/collection/components/wm-search/wm-search.js +429 -0
  116. package/dist/collection/components/wm-snackbar/wm-snackbar.css +1117 -0
  117. package/dist/collection/components/wm-snackbar/wm-snackbar.js +276 -0
  118. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.css +908 -0
  119. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +175 -0
  120. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.css +880 -0
  121. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +273 -0
  122. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.css +864 -0
  123. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +87 -0
  124. package/dist/collection/components/wm-tag-input/wm-tag-input.css +1318 -0
  125. package/dist/collection/components/wm-tag-input/wm-tag-input.js +1283 -0
  126. package/dist/collection/components/wm-tag-input/wm-tag-option/wm-tag-option.js +243 -0
  127. package/dist/collection/components/wm-textarea/wm-textarea.css +1019 -0
  128. package/dist/collection/components/wm-textarea/wm-textarea.js +313 -0
  129. package/dist/collection/components/wm-timepicker/wm-timepicker.css +1133 -0
  130. package/dist/collection/components/wm-timepicker/wm-timepicker.js +547 -0
  131. package/dist/collection/components/wm-toggletip/wm-toggletip.css +1256 -0
  132. package/dist/collection/components/wm-toggletip/wm-toggletip.js +366 -0
  133. package/dist/collection/components/wm-uploader/wm-uploader.css +1882 -0
  134. package/dist/collection/components/wm-uploader/wm-uploader.js +603 -0
  135. package/dist/collection/components/wm-wrapper/wm-wrapper.js +28 -0
  136. package/dist/collection/dev/action-menu.js +0 -0
  137. package/dist/collection/dev/button.js +0 -0
  138. package/dist/collection/dev/chart-small.js +56 -0
  139. package/dist/collection/dev/chart.js +18 -0
  140. package/dist/collection/dev/date-range.js +6 -0
  141. package/dist/collection/dev/datepicker.js +46 -0
  142. package/dist/collection/dev/file-list.js +16 -0
  143. package/dist/collection/dev/file.js +0 -0
  144. package/dist/collection/dev/flyout.js +194 -0
  145. package/dist/collection/dev/input.js +6 -0
  146. package/dist/collection/dev/line-chart.js +0 -0
  147. package/dist/collection/dev/modal.js +48 -0
  148. package/dist/collection/dev/navigation.js +13 -0
  149. package/dist/collection/dev/navigator.js +34 -0
  150. package/dist/collection/dev/nested-select.js +36 -0
  151. package/dist/collection/dev/pagination.js +7 -0
  152. package/dist/collection/dev/progress-monitor.js +0 -0
  153. package/dist/collection/dev/pss-modal.js +8 -0
  154. package/dist/collection/dev/scripts.js +49 -0
  155. package/dist/collection/dev/search.js +72 -0
  156. package/dist/collection/dev/select.js +57 -0
  157. package/dist/collection/dev/snackbar.js +60 -0
  158. package/dist/collection/dev/tabs.js +44 -0
  159. package/dist/collection/dev/tag-input.js +32 -0
  160. package/dist/collection/dev/textarea.js +28 -0
  161. package/dist/collection/dev/timepicker.js +32 -0
  162. package/dist/collection/dev/toggletip.js +9 -0
  163. package/dist/collection/dev/uploader.js +139 -0
  164. package/dist/collection/global/__mocks__/functions.js +6 -0
  165. package/dist/collection/global/functions.js +927 -0
  166. package/dist/{ripple/app-globals-a0922f84.js → collection/global/global.js} +2 -60
  167. package/dist/{ripple/interfaces-382e0566.js → collection/global/interfaces.js} +4 -6
  168. package/dist/collection/global/intl.js +274 -0
  169. package/dist/collection/global/services/__mocks__/http-service.js +130 -0
  170. package/dist/collection/global/services/http-service.js +50 -0
  171. package/dist/collection/lang/lang.js +5 -0
  172. package/dist/collection/lang/missing.js +43 -0
  173. package/dist/collection/lang/piglatin.js +101 -0
  174. package/dist/esm/app-globals-1fe6cb7f.js +90 -0
  175. package/dist/{ripple/chartFunctions-021607da.js → esm/chartFunctions-6749593d.js} +3 -3
  176. package/dist/{ripple/functions-3eaaa7c4.js → esm/functions-dabfd76f.js} +145 -7764
  177. package/dist/esm/index-130e07bb.js +1832 -0
  178. package/dist/esm/index.js +1 -0
  179. package/dist/esm/interfaces-cc5b177f.js +34 -0
  180. package/dist/{ripple/intl-14fae6dd.js → esm/intl-43676e71.js} +1 -1
  181. package/dist/esm/loader.js +11 -0
  182. package/dist/esm/polyfills/core-js.js +11 -0
  183. package/dist/esm/polyfills/dom.js +79 -0
  184. package/dist/esm/polyfills/es5-html-element.js +1 -0
  185. package/dist/esm/polyfills/index.js +34 -0
  186. package/dist/esm/polyfills/system.js +6 -0
  187. package/dist/esm/priv-calendar.entry.js +570 -0
  188. package/dist/{ripple/wm-menuitem.entry.js → esm/priv-chart-popover.entry.js} +114 -98
  189. package/dist/{ripple/wm-modal-header.entry.js → esm/priv-navigator-button.entry.js} +14 -25
  190. package/dist/{ripple/wm-navigator.entry.js → esm/priv-navigator-item.entry.js} +19 -351
  191. package/dist/{ripple/wm-option.entry.js → esm/priv-option-list.entry.js} +347 -130
  192. package/dist/esm/ripple.js +20 -0
  193. package/dist/esm/wm-action-menu_2.entry.js +330 -0
  194. package/dist/{ripple/wm-timepicker.entry.js → esm/wm-button.entry.js} +218 -251
  195. package/dist/{ripple → esm}/wm-chart-slice.entry.js +1 -1
  196. package/dist/esm/wm-chart.entry.js +159 -0
  197. package/dist/esm/wm-date-range.entry.js +480 -0
  198. package/dist/esm/wm-datepicker.entry.js +250 -0
  199. package/dist/esm/wm-file-list.entry.js +19 -0
  200. package/dist/{ripple/wm-chart.entry.js → esm/wm-file.entry.js} +169 -137
  201. package/dist/esm/wm-flyout.entry.js +176 -0
  202. package/dist/esm/wm-input.entry.js +121 -0
  203. package/dist/esm/wm-line-chart.entry.js +457 -0
  204. package/dist/esm/wm-modal-pss_3.entry.js +211 -0
  205. package/dist/esm/wm-modal_3.entry.js +211 -0
  206. package/dist/esm/wm-navigation_3.entry.js +182 -0
  207. package/dist/esm/wm-navigator.entry.js +323 -0
  208. package/dist/{ripple/wm-select.entry.js → esm/wm-nested-select.entry.js} +194 -134
  209. package/dist/esm/wm-optgroup.entry.js +70 -0
  210. package/dist/esm/wm-option_2.entry.js +422 -0
  211. package/dist/esm/wm-pagination.entry.js +224 -0
  212. package/dist/esm/wm-progress-indicator_3.entry.js +198 -0
  213. package/dist/esm/wm-search.entry.js +192 -0
  214. package/dist/esm/wm-snackbar.entry.js +185 -0
  215. package/dist/esm/wm-tab-item_3.entry.js +257 -0
  216. package/dist/esm/wm-tag-input.entry.js +944 -0
  217. package/dist/{ripple → esm}/wm-tag-option.entry.js +2 -2
  218. package/dist/esm/wm-textarea.entry.js +84 -0
  219. package/dist/esm/wm-timepicker.entry.js +303 -0
  220. package/dist/esm/wm-toggletip.entry.js +238 -0
  221. package/dist/esm/wm-uploader.entry.js +321 -0
  222. package/dist/{ripple → esm}/wm-wrapper.entry.js +1 -1
  223. package/dist/esm-es5/app-globals-1fe6cb7f.js +1 -0
  224. package/dist/esm-es5/chartFunctions-6749593d.js +1 -0
  225. package/dist/esm-es5/functions-dabfd76f.js +1 -0
  226. package/dist/esm-es5/index-130e07bb.js +1 -0
  227. package/dist/esm-es5/index.js +0 -0
  228. package/dist/esm-es5/interfaces-cc5b177f.js +1 -0
  229. package/dist/esm-es5/intl-43676e71.js +1 -0
  230. package/dist/esm-es5/loader.js +1 -0
  231. package/dist/esm-es5/priv-calendar.entry.js +1 -0
  232. package/dist/{ripple/priv-navigator-button.entry.js → esm-es5/priv-chart-popover.entry.js} +1 -24
  233. package/dist/esm-es5/priv-navigator-button.entry.js +1 -0
  234. package/dist/{ripple/wm-progress-monitor.entry.js → esm-es5/priv-navigator-item.entry.js} +1 -74
  235. package/dist/{ripple/wm-button.entry.js → esm-es5/priv-option-list.entry.js} +1 -268
  236. package/dist/esm-es5/ripple.js +1 -0
  237. package/dist/esm-es5/wm-action-menu_2.entry.js +1 -0
  238. package/dist/esm-es5/wm-button.entry.js +1 -0
  239. package/dist/esm-es5/wm-chart-slice.entry.js +1 -0
  240. package/dist/esm-es5/wm-chart.entry.js +1 -0
  241. package/dist/esm-es5/wm-date-range.entry.js +1 -0
  242. package/dist/esm-es5/wm-datepicker.entry.js +1 -0
  243. package/dist/{ripple/wm-tab-item.entry.js → esm-es5/wm-file-list.entry.js} +1 -57
  244. package/dist/esm-es5/wm-file.entry.js +1 -0
  245. package/dist/{ripple/wm-input.entry.js → esm-es5/wm-flyout.entry.js} +1 -120
  246. package/dist/esm-es5/wm-input.entry.js +1 -0
  247. package/dist/esm-es5/wm-line-chart.entry.js +1 -0
  248. package/dist/esm-es5/wm-modal-pss_3.entry.js +1 -0
  249. package/dist/esm-es5/wm-modal_3.entry.js +1 -0
  250. package/dist/esm-es5/wm-navigation_3.entry.js +1 -0
  251. package/dist/esm-es5/wm-navigator.entry.js +1 -0
  252. package/dist/esm-es5/wm-nested-select.entry.js +1 -0
  253. package/dist/esm-es5/wm-optgroup.entry.js +1 -0
  254. package/dist/esm-es5/wm-option_2.entry.js +1 -0
  255. package/dist/esm-es5/wm-pagination.entry.js +1 -0
  256. package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -0
  257. package/dist/esm-es5/wm-search.entry.js +1 -0
  258. package/dist/esm-es5/wm-snackbar.entry.js +1 -0
  259. package/dist/esm-es5/wm-tab-item_3.entry.js +1 -0
  260. package/dist/esm-es5/wm-tag-input.entry.js +1 -0
  261. package/dist/esm-es5/wm-tag-option.entry.js +1 -0
  262. package/dist/esm-es5/wm-textarea.entry.js +1 -0
  263. package/dist/esm-es5/wm-timepicker.entry.js +1 -0
  264. package/dist/esm-es5/wm-toggletip.entry.js +1 -0
  265. package/dist/esm-es5/wm-uploader.entry.js +1 -0
  266. package/dist/esm-es5/wm-wrapper.entry.js +1 -0
  267. package/dist/index.cjs.js +1 -0
  268. package/dist/index.js +1 -0
  269. package/dist/loader/cdn.js +2 -0
  270. package/dist/loader/index.cjs.js +2 -0
  271. package/dist/loader/index.d.ts +24 -0
  272. package/dist/loader/index.es2017.js +2 -0
  273. package/dist/loader/index.js +3 -0
  274. package/dist/loader/package.json +11 -0
  275. package/dist/ripple/index.esm.js +0 -1
  276. package/dist/ripple/p-0189929d.entry.js +1 -0
  277. package/dist/ripple/p-043901ab.system.entry.js +1 -0
  278. package/dist/ripple/{wm-navigation-item.entry.js → p-091fbc50.system.entry.js} +1 -21
  279. package/dist/ripple/p-0bb576c5.system.entry.js +1 -0
  280. package/dist/ripple/p-0c89b82c.entry.js +1 -0
  281. package/dist/ripple/p-0e4d663a.js +1 -0
  282. package/dist/ripple/p-12d6ab73.system.entry.js +1 -0
  283. package/dist/ripple/p-13b1d775.entry.js +1 -0
  284. package/dist/ripple/p-144ce232.entry.js +1 -0
  285. package/dist/ripple/p-1497ccfc.entry.js +1 -0
  286. package/dist/ripple/{wm-modal.entry.js → p-1955c66a.system.entry.js} +1 -135
  287. package/dist/ripple/p-1a3037aa.entry.js +1 -0
  288. package/dist/ripple/p-1a5a0cd6.entry.js +1 -0
  289. package/dist/ripple/p-22b55b6f.entry.js +1 -0
  290. package/dist/ripple/p-257d2d5c.entry.js +1 -0
  291. package/dist/ripple/p-2732bddd.js +1 -0
  292. package/dist/ripple/p-2823d02b.system.entry.js +1 -0
  293. package/dist/ripple/p-2f2ba62b.system.entry.js +1 -0
  294. package/dist/ripple/p-2f7ca1a7.system.entry.js +1 -0
  295. package/dist/ripple/p-30201dc9.entry.js +1 -0
  296. package/dist/ripple/{wm-modal-pss-footer.entry.js → p-30236be3.system.entry.js} +1 -40
  297. package/dist/ripple/p-36d2b888.entry.js +1 -0
  298. package/dist/ripple/p-36fd8aed.system.entry.js +1 -0
  299. package/dist/ripple/p-3ae8153c.system.js +1 -0
  300. package/dist/ripple/p-3f98056c.js +1 -0
  301. package/dist/ripple/p-41120a33.system.js +1 -0
  302. package/dist/ripple/p-42fa7a77.system.js +1 -0
  303. package/dist/ripple/p-492aa9fe.system.entry.js +1 -0
  304. package/dist/ripple/p-49a347e1.js +1 -0
  305. package/dist/ripple/p-4a29bb8c.entry.js +1 -0
  306. package/dist/ripple/p-4c2a044d.system.entry.js +1 -0
  307. package/dist/ripple/p-4cebf2d7.entry.js +1 -0
  308. package/dist/ripple/p-4e6b0a6e.system.entry.js +1 -0
  309. package/dist/ripple/p-4fb4deb9.entry.js +1 -0
  310. package/dist/ripple/p-50ea2036.system.js +1 -0
  311. package/dist/ripple/p-56d54fe6.system.entry.js +1 -0
  312. package/dist/ripple/p-57c25b63.entry.js +1 -0
  313. package/dist/ripple/p-59591401.entry.js +1 -0
  314. package/dist/ripple/p-5cff41e0.entry.js +1 -0
  315. package/dist/ripple/p-5ef786db.system.entry.js +1 -0
  316. package/dist/ripple/p-61f9987d.system.entry.js +1 -0
  317. package/dist/ripple/p-6a03a172.entry.js +1 -0
  318. package/dist/ripple/p-6a082957.entry.js +1 -0
  319. package/dist/ripple/p-6d12cfb7.system.entry.js +1 -0
  320. package/dist/ripple/p-72ed488e.system.entry.js +1 -0
  321. package/dist/ripple/p-74f103dd.entry.js +1 -0
  322. package/dist/ripple/p-81ce2697.entry.js +1 -0
  323. package/dist/ripple/p-823d7b4e.system.entry.js +1 -0
  324. package/dist/ripple/p-89316785.system.js +1 -0
  325. package/dist/ripple/{wm-search.entry.js → p-89479d02.system.entry.js} +1 -191
  326. package/dist/ripple/p-8a569d3b.entry.js +1 -0
  327. package/dist/ripple/p-8ec2e944.system.entry.js +1 -0
  328. package/dist/ripple/{priv-chart-popover.entry.js → p-8f987f71.entry.js} +1 -140
  329. package/dist/ripple/p-92a50b38.system.entry.js +1 -0
  330. package/dist/ripple/{wm-modal-pss-header.entry.js → p-92cb12d3.entry.js} +1 -39
  331. package/dist/ripple/p-9328023c.entry.js +1 -0
  332. package/dist/ripple/p-94f776eb.entry.js +1 -0
  333. package/dist/ripple/{priv-navigator-item.entry.js → p-97ffaa7d.entry.js} +1 -30
  334. package/dist/ripple/p-9b2281e2.system.entry.js +1 -0
  335. package/dist/ripple/p-a2c8937d.js +1 -0
  336. package/dist/ripple/p-a5fb4171.system.entry.js +1 -0
  337. package/dist/ripple/{priv-option-list.entry.js → p-b01f9572.system.entry.js} +1 -388
  338. package/dist/ripple/p-b23c6351.system.entry.js +1 -0
  339. package/dist/ripple/p-b34552b0.system.entry.js +1 -0
  340. package/dist/ripple/p-b39ab477.entry.js +1 -0
  341. package/dist/ripple/p-ba399879.system.js +1 -0
  342. package/dist/ripple/p-bb9f6920.entry.js +1 -0
  343. package/dist/ripple/p-bc4976e6.entry.js +1 -0
  344. package/dist/ripple/p-bd48c50a.entry.js +1 -0
  345. package/dist/ripple/p-c31e1379.entry.js +1 -0
  346. package/dist/ripple/p-c4896784.system.entry.js +1 -0
  347. package/dist/ripple/{wm-file-list.entry.js → p-c53f5914.entry.js} +1 -18
  348. package/dist/ripple/p-c699aec8.system.entry.js +1 -0
  349. package/dist/ripple/p-c7d71181.system.entry.js +1 -0
  350. package/dist/ripple/p-cd0cc88d.entry.js +1 -0
  351. package/dist/ripple/p-cef8a45b.system.js +2 -0
  352. package/dist/ripple/p-d333d851.system.entry.js +1 -0
  353. package/dist/ripple/p-d9da0502.js +2 -0
  354. package/dist/ripple/p-f3df715f.entry.js +1 -0
  355. package/dist/ripple/p-f8995a5e.system.entry.js +1 -0
  356. package/dist/ripple/{wm-file.entry.js → p-f9fa1506.system.entry.js} +1 -189
  357. package/dist/ripple/p-fc6eeb8f.system.js +1 -0
  358. package/dist/ripple/p-fe71ec64.system.entry.js +1 -0
  359. package/dist/ripple/{wm-nested-select.entry.js → p-fe93b6b9.system.entry.js} +1 -310
  360. package/dist/ripple/ripple.esm.js +1 -47
  361. package/dist/ripple/ripple.js +127 -0
  362. package/package.json +2 -2
  363. package/dist/ripple/index-3d0f1864.js +0 -3017
  364. package/dist/ripple/priv-calendar.entry.js +0 -569
  365. package/dist/ripple/shadow-css-7ad5caf8.js +0 -332
  366. package/dist/ripple/wm-date-range.entry.js +0 -479
  367. package/dist/ripple/wm-datepicker.entry.js +0 -249
  368. package/dist/ripple/wm-line-chart.entry.js +0 -456
  369. package/dist/ripple/wm-modal-pss.entry.js +0 -136
  370. package/dist/ripple/wm-navigation-hamburger.entry.js +0 -49
  371. package/dist/ripple/wm-navigation.entry.js +0 -116
  372. package/dist/ripple/wm-optgroup.entry.js +0 -69
  373. package/dist/ripple/wm-pagination.entry.js +0 -223
  374. package/dist/ripple/wm-progress-indicator.entry.js +0 -112
  375. package/dist/ripple/wm-progress-slice.entry.js +0 -18
  376. package/dist/ripple/wm-snackbar.entry.js +0 -184
  377. package/dist/ripple/wm-tab-list.entry.js +0 -178
  378. package/dist/ripple/wm-tab-panel.entry.js +0 -26
  379. package/dist/ripple/wm-tag-input.entry.js +0 -947
  380. package/dist/ripple/wm-uploader.entry.js +0 -320
@@ -0,0 +1,927 @@
1
+ import * as lang from "../lang/lang";
2
+ import { createIntl, createIntlCache } from "@formatjs/intl";
3
+ const DEFAULT_LANGUAGE = "en";
4
+ function getBrowserLang() {
5
+ const langAttr = document.documentElement.getAttribute("lang");
6
+ if (!!langAttr) {
7
+ return langAttr;
8
+ }
9
+ else if (window.navigator && window.navigator.language) {
10
+ const lang = window.navigator.languages ? window.navigator.languages[0] : window.navigator.language;
11
+ return lang.slice(0, 2);
12
+ }
13
+ else {
14
+ return DEFAULT_LANGUAGE;
15
+ }
16
+ }
17
+ // prevents memory leak
18
+ const cache = createIntlCache();
19
+ const locale = getBrowserLang();
20
+ export const intl = createIntl({
21
+ locale: locale,
22
+ defaultLocale: "en",
23
+ messages: lang[locale] || lang.en,
24
+ }, cache);
25
+ export function generateId() {
26
+ return "wmcl-" + Math.random().toString(36).substr(2, 10);
27
+ }
28
+ // limits how many times a function fires
29
+ // use when the function should run periodically, but not too often (e.g. window resize)
30
+ export function throttle(fn, wait) {
31
+ let timeout;
32
+ let shouldWait = false;
33
+ return function () {
34
+ const context = this;
35
+ if (!shouldWait) {
36
+ fn.apply(context, arguments);
37
+ shouldWait = true;
38
+ clearTimeout(timeout);
39
+ timeout = setTimeout(function () {
40
+ shouldWait = false;
41
+ }, wait);
42
+ }
43
+ };
44
+ }
45
+ // waits until it hasn't been called for [timeout] ms.
46
+ // use when the function should run only after something (event) is done firing
47
+ export function debounce(fn, wait) {
48
+ let timeout;
49
+ return function () {
50
+ const context = this;
51
+ const functionCall = () => fn.apply(context, arguments);
52
+ clearTimeout(timeout);
53
+ timeout = setTimeout(functionCall, wait);
54
+ };
55
+ }
56
+ export function getTextDir() {
57
+ const dir = document.querySelector("html").getAttribute("dir");
58
+ return dir ? dir.toLowerCase() : "";
59
+ }
60
+ export function getPosition(el) {
61
+ const coords = el.getBoundingClientRect();
62
+ let x = coords.x;
63
+ let y = coords.y;
64
+ // Edge doesn't have x and y
65
+ if (!x) {
66
+ if (getTextDir() === "rtl") {
67
+ x = coords.right;
68
+ }
69
+ else {
70
+ x = coords.left;
71
+ }
72
+ y = coords.top;
73
+ }
74
+ return { x, y };
75
+ }
76
+ function getParentOrHost(el) {
77
+ // Handle slot traversal - if element is assigned to a slot, go to the slot first
78
+ if (el.assignedSlot) {
79
+ return el.assignedSlot;
80
+ }
81
+ let nextEl = el.parentElement;
82
+ if (!nextEl) {
83
+ // Check if we're at a shadow root boundary
84
+ const rootNode = el.getRootNode();
85
+ if (rootNode instanceof ShadowRoot && rootNode.host) {
86
+ nextEl = rootNode.host;
87
+ }
88
+ }
89
+ return nextEl;
90
+ }
91
+ function findPositionedAncestor(el) {
92
+ // Used to find the nearest positioned ancestor of an element (typically absolute or fixed)
93
+ let positionedAncestor = getParentOrHost(el);
94
+ while (positionedAncestor && positionedAncestor !== document.documentElement) {
95
+ const ancestorStyle = window.getComputedStyle(positionedAncestor);
96
+ if (["relative", "absolute", "fixed", "sticky"].includes(ancestorStyle.position)) {
97
+ return positionedAncestor;
98
+ }
99
+ positionedAncestor = getParentOrHost(positionedAncestor);
100
+ }
101
+ // If no positioned ancestor found, that ancestor is the document element
102
+ return document.documentElement;
103
+ }
104
+ function findPositioningBoundary(el) {
105
+ // Check for positioned elements that create new positioning contexts
106
+ let current = el;
107
+ while (current && current !== document.documentElement) {
108
+ const currentStyle = window.getComputedStyle(current);
109
+ // Elements with position: fixed are positioned relative to viewport
110
+ if (currentStyle.position === "fixed") {
111
+ return current;
112
+ }
113
+ // Elements with position: absolute are positioned relative to nearest positioned ancestor
114
+ if (currentStyle.position === "absolute") {
115
+ return findPositionedAncestor(current);
116
+ }
117
+ current = getParentOrHost(current);
118
+ }
119
+ return null; // No special positioning context found
120
+ }
121
+ export function findAllScrollableParents(el) {
122
+ const scrollableParents = [];
123
+ let currentEl = getParentOrHost(el);
124
+ // Traverse up to and including the document.documentElement (html element)
125
+ while (currentEl) {
126
+ const style = window.getComputedStyle(currentEl);
127
+ if (["scroll", "auto"].includes(style.overflowY) || ["scroll", "auto"].includes(style.overflowX)) {
128
+ scrollableParents.push(currentEl);
129
+ }
130
+ currentEl = getParentOrHost(currentEl);
131
+ }
132
+ if (document.documentElement && !scrollableParents.includes(document.documentElement)) {
133
+ // Check if the document itself is scrollable (common case for page-level scrolling)
134
+ // Special case: document element can scroll even with overflow: visible when content overflows viewport
135
+ const htmlStyle = window.getComputedStyle(document.documentElement);
136
+ if (["scroll", "auto"].includes(htmlStyle.overflowY) ||
137
+ ["scroll", "auto"].includes(htmlStyle.overflowX) ||
138
+ // For document element only: also check if page content can actually scroll
139
+ document.documentElement.scrollHeight > document.documentElement.clientHeight ||
140
+ document.documentElement.scrollWidth > document.documentElement.clientWidth) {
141
+ scrollableParents.push(document.documentElement);
142
+ }
143
+ }
144
+ return scrollableParents;
145
+ }
146
+ export function getCumulativeScrollOffset(el) {
147
+ const scrollableParents = findAllScrollableParents(el);
148
+ let totalScrollX = 0;
149
+ let totalScrollY = 0;
150
+ // Find the positioning context boundary - this determines which scroll offsets are relevant
151
+ const positioningBoundary = findPositioningBoundary(el);
152
+ scrollableParents.forEach((parent) => {
153
+ // Skip scroll offsets from elements outside the positioning boundary, but include the positioning boundary itself
154
+ if (positioningBoundary && parent !== positioningBoundary && !positioningBoundary.contains(parent)) {
155
+ return;
156
+ }
157
+ if (parent === document.documentElement) {
158
+ // For the document element, use window scroll values
159
+ totalScrollX += window.scrollX || window.pageXOffset || 0;
160
+ totalScrollY += window.scrollY || window.pageYOffset || 0;
161
+ }
162
+ else {
163
+ // For regular elements, use scrollLeft/scrollTop
164
+ totalScrollX += parent.scrollLeft;
165
+ totalScrollY += parent.scrollTop;
166
+ }
167
+ });
168
+ return { x: totalScrollX, y: totalScrollY };
169
+ }
170
+ export function findParentWithHiddenOverflow(el) {
171
+ while (!!el) {
172
+ if (window.getComputedStyle(el).overflowY !== "visible") {
173
+ return el;
174
+ }
175
+ el = getParentOrHost(el);
176
+ }
177
+ }
178
+ export function isElOrChild(componentEl, el) {
179
+ var _a;
180
+ // determines whether or not the element is the component, a child of the component, or exists within the component's shadowroot
181
+ return el === componentEl || componentEl.contains(el) || ((_a = componentEl.shadowRoot) === null || _a === void 0 ? void 0 : _a.contains(el));
182
+ }
183
+ export function getContextMeasurements(el) {
184
+ const fixedRect = el.getBoundingClientRect();
185
+ const parentEl = findParentWithHiddenOverflow(el);
186
+ const parentRect = parentEl && parentEl.getBoundingClientRect();
187
+ // if parentEl is not found, measurements are checked against the viewport
188
+ return {
189
+ // NB boundingClientRect.bottom is space from top of viewport to bottom of el
190
+ // to get space below the el -> height of viewport minus boundingClientRect.bottom
191
+ spaceAbove: parentRect ? fixedRect.top - parentRect.top : fixedRect.top,
192
+ // NB boundingClientRect.bottom is space from top of viewport to bottom of el
193
+ // to get space below the el -> height of viewport minus boundingClientRect.bottom
194
+ spaceBelow: parentRect
195
+ ? parentRect.bottom - fixedRect.bottom
196
+ : document.documentElement.clientHeight - fixedRect.bottom,
197
+ spaceLeft: parentRect ? fixedRect.left - parentRect.left : fixedRect.left,
198
+ spaceRight: parentRect
199
+ ? parentRect.right - fixedRect.right
200
+ : document.documentElement.clientWidth - fixedRect.right,
201
+ };
202
+ }
203
+ export function shouldOpenUp(fixedEl, //the element visible on the page when the component is closed
204
+ closableElHeight, //the dropdown/popup/etc that becomes visible when the component is open
205
+ offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
206
+ offsetBelow = 0) {
207
+ const { spaceAbove, spaceBelow } = getContextMeasurements(fixedEl);
208
+ //we want to open up only if there's not enough space below AND there is enough space above
209
+ const openUp = closableElHeight > spaceBelow + offsetBelow && closableElHeight <= spaceAbove + offsetAbove;
210
+ return openUp;
211
+ }
212
+ export function shouldOpenDown(fixedEl, //the element visible on the page when the component is closed
213
+ closableElHeight, //the dropdown/popup/etc that becomes visible when the component is open
214
+ offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
215
+ offsetBelow = 0) {
216
+ const { spaceAbove, spaceBelow } = getContextMeasurements(fixedEl);
217
+ //we want to open up only if there's not enough space below AND there is enough space above
218
+ const openDown = closableElHeight > spaceAbove + offsetAbove && closableElHeight <= spaceBelow + offsetBelow;
219
+ return openDown;
220
+ }
221
+ export function shouldShiftRight(fixedEl, closableElWidth) {
222
+ const { spaceLeft, spaceRight } = getContextMeasurements(fixedEl);
223
+ const needsSpaceLeft = closableElWidth > spaceLeft && spaceRight > spaceLeft;
224
+ return needsSpaceLeft;
225
+ }
226
+ export function shouldShiftLeft(fixedEl, closableElWidth) {
227
+ const { spaceLeft, spaceRight } = getContextMeasurements(fixedEl);
228
+ const needsSpaceRight = closableElWidth > spaceRight && spaceLeft > spaceRight;
229
+ return needsSpaceRight;
230
+ }
231
+ export function adjustTooltipPlacement(placement, anchorEl, tooltipHeight, tooltipWidth) {
232
+ const { spaceLeft, spaceRight, spaceBelow, spaceAbove } = getContextMeasurements(anchorEl);
233
+ const enoughSpaceAbove = spaceAbove > tooltipHeight;
234
+ const enoughSpaceBelow = spaceBelow > tooltipHeight;
235
+ // a tooltip should never be closer than 24px to the edge of a screen
236
+ const enoughSpaceLeft = spaceLeft - 24 > tooltipWidth;
237
+ const enoughSpaceRight = spaceRight - 24 > tooltipWidth;
238
+ const swapAbove = (placement) => {
239
+ return !enoughSpaceAbove ? placement.replace("top", "bottom") : placement;
240
+ };
241
+ const swapBelow = (placement) => {
242
+ return !enoughSpaceBelow && enoughSpaceAbove ? placement.replace("bottom", "top") : placement;
243
+ };
244
+ const swapLeft = (placement, centeredPosition) => {
245
+ if (!enoughSpaceLeft && enoughSpaceRight) {
246
+ placement = placement.replace("left", "right");
247
+ }
248
+ else if (!enoughSpaceLeft && !enoughSpaceRight) {
249
+ placement = centeredPosition;
250
+ }
251
+ return placement;
252
+ };
253
+ const swapRight = (placement, centeredPosition) => {
254
+ if (!enoughSpaceRight && enoughSpaceLeft) {
255
+ placement = placement.replace("right", "left");
256
+ }
257
+ else if (!enoughSpaceRight && !enoughSpaceLeft) {
258
+ placement = centeredPosition;
259
+ }
260
+ return placement;
261
+ };
262
+ // horizontal checks must occur before vertical checks, because horizontal can affect vertical placement but not vice versa
263
+ switch (placement) {
264
+ case "left":
265
+ placement = swapLeft(placement, "bottom");
266
+ case "right":
267
+ placement = swapRight(placement, "bottom");
268
+ case "top-left":
269
+ placement = swapLeft(placement, "top");
270
+ placement = swapAbove(placement);
271
+ case "top-right":
272
+ placement = swapRight(placement, "top");
273
+ placement = swapAbove(placement);
274
+ case "bottom-left":
275
+ placement = swapLeft(placement, "bottom");
276
+ placement = swapBelow(placement);
277
+ case "bottom-right":
278
+ placement = swapRight(placement, "bottom");
279
+ placement = swapBelow(placement);
280
+ case "top":
281
+ placement = swapAbove(placement);
282
+ case "bottom":
283
+ placement = swapBelow(placement);
284
+ }
285
+ return placement;
286
+ }
287
+ export function showTooltip(placement, anchorEl, tooltipText) {
288
+ // until popover is supported by firefox, we have to check for and position additional tooltip rendered within the modal's dialog element
289
+ // this additional tooltip is only rendered in browsers that do not support popover
290
+ const tooltipEls = document.querySelectorAll(".wm-tooltip");
291
+ tooltipEls.forEach((tooltipEl) => {
292
+ //@ts-ignore
293
+ if (!!tooltipEl.showPopover) {
294
+ //@ts-ignore
295
+ tooltipEl.showPopover();
296
+ }
297
+ tooltipEl.classList.add("show");
298
+ tooltipEl.textContent = tooltipText;
299
+ // tooltip only has a maxWidth if it contains whitespace and can break
300
+ const hasNoWhitespace = tooltipText.match(/^[^\s]+$/);
301
+ if (hasNoWhitespace) {
302
+ tooltipEl.classList.add("single-word");
303
+ tooltipEl.style.setProperty("--wmTooltipMaxWidth", "none");
304
+ }
305
+ else {
306
+ tooltipEl.classList.remove("single-word");
307
+ tooltipEl.style.removeProperty("--wmTooltipMaxWidth");
308
+ }
309
+ const tooltipRect = tooltipEl.getBoundingClientRect();
310
+ const anchorRect = anchorEl.getBoundingClientRect();
311
+ const adjustedPlacement = adjustTooltipPlacement(placement, anchorEl, tooltipRect.height, tooltipRect.width);
312
+ let verticalPos, horizontalPos;
313
+ [verticalPos, horizontalPos] = positionTooltip(adjustedPlacement, anchorRect, tooltipRect.height, tooltipRect.width);
314
+ tooltipEl.style.setProperty("--wmTooltipTop", verticalPos + "px");
315
+ tooltipEl.style.setProperty("--wmTooltipLeft", horizontalPos + "px");
316
+ });
317
+ }
318
+ export function hideTooltip() {
319
+ const tooltipEls = document.querySelectorAll(".wm-tooltip");
320
+ tooltipEls.forEach((tooltipEl) => {
321
+ //@ts-ignore
322
+ if (!!tooltipEl.hidePopover) {
323
+ //@ts-ignore
324
+ tooltipEl.hidePopover();
325
+ }
326
+ tooltipEl.classList.remove("show");
327
+ });
328
+ }
329
+ function positionTooltip(placement, anchorRect, tooltipHeight, tooltipWidth) {
330
+ // to get the center positions, calculate the difference between the button width and the tooltip width
331
+ const verticalDiff = (anchorRect.height - tooltipHeight) / 2;
332
+ const horizontalDiff = (anchorRect.width - tooltipWidth) / 2;
333
+ // the naming convention defaults to center in the absence of a value
334
+ // "top" and "bottom" imply centering horizontally; "right" and "left" imply centering vertically
335
+ // therefore we first set to center and adjust accordingly
336
+ let verticalPos = anchorRect.top + verticalDiff;
337
+ let horizontalPos = anchorRect.left + horizontalDiff;
338
+ if (placement.includes("top")) {
339
+ verticalPos = anchorRect.top - tooltipHeight - 8;
340
+ }
341
+ if (placement.includes("bottom")) {
342
+ verticalPos = anchorRect.bottom + 8;
343
+ }
344
+ if (placement.includes("left")) {
345
+ horizontalPos = anchorRect.left - tooltipWidth - 8;
346
+ }
347
+ if (placement.includes("right")) {
348
+ horizontalPos = anchorRect.right + 8;
349
+ }
350
+ // after all positioning has been calculated, if tooltip is off-screen or closer than 24px it is readjusted
351
+ // this only occurs when the tooltip is overflowing to the left and is placed top or bottom
352
+ // (button placed too far left, or screen size under 268px)
353
+ horizontalPos = Math.max(horizontalPos, 24);
354
+ return [verticalPos, horizontalPos];
355
+ }
356
+ export function hasRoomRight(x, spaceNeeded) {
357
+ let horizOffset = 0;
358
+ // if (getTextDir() === "ltr") {
359
+ if (x.type === "click") {
360
+ // if it's a mouse event, deal with mouse coords
361
+ horizOffset = x.clientX;
362
+ // if it's a focus event, the offset is 0
363
+ }
364
+ else if (x.type === "focus") {
365
+ horizOffset = 0;
366
+ }
367
+ else {
368
+ // otherwise an element was passed, calculate how far it is from the edge of the window
369
+ let el = x; // re-assignment is for clarity
370
+ while (el) {
371
+ if (el.tagName == "BODY") {
372
+ // deal with browser quirks with body/window/document and page scroll
373
+ var xScroll = el.scrollLeft || document.documentElement.scrollLeft;
374
+ horizOffset += el.offsetLeft - xScroll + el.clientLeft;
375
+ }
376
+ else {
377
+ // for all other non-BODY elements
378
+ horizOffset += el.offsetLeft - el.scrollLeft + el.clientLeft;
379
+ }
380
+ el = el.offsetParent;
381
+ }
382
+ // }
383
+ }
384
+ return window.innerWidth - horizOffset >= spaceNeeded;
385
+ }
386
+ export function checkForActiveElInShadow(element) {
387
+ while (element && element.shadowRoot) {
388
+ element = element.shadowRoot.activeElement;
389
+ }
390
+ return element;
391
+ }
392
+ export function checkForFocusableElInShadow(element) {
393
+ const selectors = [
394
+ "button",
395
+ "a",
396
+ "input",
397
+ "select",
398
+ "textarea",
399
+ "wm-button",
400
+ "wm-search",
401
+ "wm-select",
402
+ "wm-action-menu",
403
+ "wm-tab-item",
404
+ "wm-datepicker",
405
+ ];
406
+ let focusableEl = element;
407
+ selectors.forEach((selector) => {
408
+ if (focusableEl && focusableEl.shadowRoot) {
409
+ let elInShadow = focusableEl.shadowRoot.querySelector(selector);
410
+ if (elInShadow) {
411
+ if (selector.startsWith("wm-")) {
412
+ focusableEl = checkForFocusableElInShadow(elInShadow);
413
+ }
414
+ else {
415
+ focusableEl = elInShadow;
416
+ }
417
+ }
418
+ }
419
+ });
420
+ return focusableEl;
421
+ }
422
+ export function isFocusable(element) {
423
+ if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute("tabIndex") !== null)) {
424
+ return true;
425
+ }
426
+ if (element.disabled) {
427
+ return false;
428
+ }
429
+ switch (element.nodeName) {
430
+ case "A":
431
+ return !!element.href && element.rel != "ignore";
432
+ case "INPUT":
433
+ return element.type != "hidden" && element.type != "file";
434
+ case "BUTTON":
435
+ case "SELECT":
436
+ case "TEXTAREA":
437
+ case "WM-BUTTON":
438
+ case "WM-SELECT":
439
+ case "WM-ACTION-MENU":
440
+ case "WM-DATEPICKER":
441
+ case "WM-TIMEPICKER":
442
+ case "WM-INPUT":
443
+ case "WM-TAG-INPUT":
444
+ case "WM-TAB-ITEM":
445
+ case "WM-SEARCH":
446
+ return true;
447
+ default:
448
+ return false;
449
+ }
450
+ }
451
+ export function getFirstFocusableDescendant(element) {
452
+ if (isFocusable(element)) {
453
+ return checkForFocusableElInShadow(element);
454
+ }
455
+ else if (element.childNodes.length > 0) {
456
+ element.childNodes.forEach((i) => {
457
+ const childEl = getFirstFocusableDescendant(i);
458
+ return childEl && checkForFocusableElInShadow(childEl);
459
+ });
460
+ }
461
+ }
462
+ export function getLastFocusableDescendant(element) {
463
+ if (isFocusable(element)) {
464
+ return checkForFocusableElInShadow(element);
465
+ }
466
+ else if (element.childNodes.length > 0) {
467
+ // Convert to array and reverse to process children from last to first
468
+ const children = Array.from(element.childNodes).reverse();
469
+ return children.reduce((focusable, child) => {
470
+ if (focusable)
471
+ return focusable;
472
+ const childEl = getLastFocusableDescendant(child);
473
+ return childEl ? checkForFocusableElInShadow(childEl) : null;
474
+ }, null);
475
+ }
476
+ return null;
477
+ }
478
+ // takes a string (space separated list of extensions), returns an array of strings (corresponding MIME types)
479
+ export function getAcceptedMimeTypesList(acceptedExtensions) {
480
+ // this is just a list of common file types (regardless of whether they are/can be valid or not)
481
+ // front end checks are just a convenience to users, independent of security.
482
+ // it allows users to be notified of an invalid type as soon as they select the file, rather than when it gets uploaded
483
+ const lookupTable = {
484
+ aac: ["audio/aac"],
485
+ abw: ["application/x-abiword"],
486
+ arc: ["application/x-freearc"],
487
+ avi: ["video/x-msvideo"],
488
+ azw: ["application/vnd.amazon.ebook"],
489
+ bin: ["application/octet-stream"],
490
+ bmp: ["image/bmp"],
491
+ bz: ["application/x-bzip"],
492
+ bz2: ["application/x-bzip2"],
493
+ csh: ["application/x-csh"],
494
+ css: ["text/css"],
495
+ csv: ["text/csv"],
496
+ doc: ["application/msword"],
497
+ docx: ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
498
+ eot: ["application/vnd.ms-fontobject"],
499
+ epub: ["application/epub+zip"],
500
+ gz: ["application/gzip"],
501
+ gif: ["image/gif"],
502
+ htm: ["text/html"],
503
+ html: ["text/html"],
504
+ ico: ["image/vnd.microsoft.icon"],
505
+ ics: ["text/calendar"],
506
+ jar: ["application/java-archive"],
507
+ jpeg: ["image/jpeg"],
508
+ jpg: ["image/jpeg"],
509
+ js: ["text/javascript"],
510
+ json: ["application/json"],
511
+ jsonld: ["application/ld+json"],
512
+ log: ["text/plain"],
513
+ mid: ["audio/x-midi"],
514
+ midi: ["audio/x-midi"],
515
+ mjs: ["text/javascript"],
516
+ mp3: ["audio/mpeg"],
517
+ mpeg: ["video/mpeg"],
518
+ mpkg: ["application/vnd.apple.installer+xml"],
519
+ odp: ["application/vnd.oasis.opendocument.presentation"],
520
+ ods: ["application/vnd.oasis.opendocument.spreadsheet"],
521
+ odt: ["application/vnd.oasis.opendocument.text"],
522
+ oga: ["audio/ogg"],
523
+ ogv: ["video/ogg"],
524
+ ogx: ["application/ogg"],
525
+ opus: ["audio/opus"],
526
+ otf: ["font/otf"],
527
+ png: ["image/png"],
528
+ pdf: ["application/pdf"],
529
+ php: ["application/php"],
530
+ ppt: ["application/vnd.ms-powerpoint"],
531
+ pptx: ["application/vnd.openxmlformats-officedocument.presentationml.presentation"],
532
+ rar: ["application/vnd.rar", "application/x-rar", "application/x-rar-compressed"],
533
+ rtf: ["application/rtf"],
534
+ sh: ["application/x-sh"],
535
+ svg: ["image/svg+xml"],
536
+ swf: ["application/x-shockwave-flash"],
537
+ tar: ["application/x-tar"],
538
+ tif: ["image/tiff"],
539
+ tiff: ["image/tiff"],
540
+ ts: ["video/mp2t"],
541
+ ttf: ["font/ttf"],
542
+ txt: ["text/plain"],
543
+ vsd: ["application/vnd.visio"],
544
+ wav: ["audio/wav"],
545
+ weba: ["audio/webm"],
546
+ webm: ["video/webm"],
547
+ webp: ["image/webp"],
548
+ woff: ["font/woff"],
549
+ woff2: ["font/woff2"],
550
+ xhtml: ["application/xhtml+xml"],
551
+ xls: ["application/vnd.ms-excel"],
552
+ xlsx: ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
553
+ xml: ["application/xml", "text/xml"],
554
+ xul: ["application/vnd.mozilla.xul+xml"],
555
+ zip: ["application/zip", "application/x-zip-compressed", "multipart/x-zip"],
556
+ "3gp": ["video/3gpp", "audio/3gpp"],
557
+ "3g2": ["video/3gpp2", "audio/3gpp2"],
558
+ "7z": ["application/x-7z-compressed"],
559
+ };
560
+ return acceptedExtensions.reduce((acc, ext) => acc.concat(lookupTable[ext]), []);
561
+ }
562
+ export function snakeCaseToCamelCase(str) {
563
+ const snakeCaseRegexp = /^([a-z0-9]*)(_[a-z0-9]*)*$/g;
564
+ if (snakeCaseRegexp.test(str)) {
565
+ let camelCase = "";
566
+ let arr = str.split("_");
567
+ arr.forEach((word, idx) => {
568
+ camelCase += idx === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1);
569
+ });
570
+ return camelCase;
571
+ }
572
+ else {
573
+ return str;
574
+ }
575
+ }
576
+ export function csvToArray(csv) {
577
+ return csv ? csv.split(/, ?/) : [];
578
+ }
579
+ export function getNewIndexToFocus(currentIndex, direction, listLength) {
580
+ let newIndex = currentIndex;
581
+ if (direction === "ArrowDown") {
582
+ newIndex = (currentIndex + 1) % listLength;
583
+ }
584
+ if (direction === "ArrowUp") {
585
+ newIndex = currentIndex === 0 ? listLength - 1 : currentIndex - 1;
586
+ }
587
+ return newIndex;
588
+ }
589
+ export function isRelatedTarget(ev, id) {
590
+ // used for onBlur events to check the element that has been clicked
591
+ const ids = id.split(" ");
592
+ return ev.relatedTarget && ids.includes(ev.relatedTarget.id);
593
+ }
594
+ export function toBool(val) {
595
+ // string "false" needs to be treated as bool False because react wrappers convert bool to string.
596
+ return val == "false" ? false : !!val;
597
+ }
598
+ export function measureText(originEl, placeholderText) {
599
+ const measurementEl = document.createElement("div");
600
+ const originStyles = getComputedStyle(originEl);
601
+ measurementEl.style.position = "absolute";
602
+ measurementEl.style.top = "-100vh";
603
+ measurementEl.style.fontFamily = originStyles.fontFamily;
604
+ measurementEl.style.fontWeight = originStyles.fontWeight;
605
+ measurementEl.style.fontSize = originStyles.fontSize;
606
+ measurementEl.textContent = placeholderText;
607
+ document.body.appendChild(measurementEl);
608
+ const boundingClientRect = measurementEl.getBoundingClientRect();
609
+ document.body.removeChild(measurementEl);
610
+ return boundingClientRect;
611
+ }
612
+ export function truncateText(textEl, text, availableSpace, endAmt) {
613
+ const cloneEl = document.createElement("div");
614
+ cloneEl.style.visibility = "hidden";
615
+ cloneEl.style.position = "absolute";
616
+ cloneEl.style.top = "-200vh";
617
+ cloneEl.style.left = "-200vh";
618
+ cloneEl.textContent = text;
619
+ textEl.appendChild(cloneEl);
620
+ const ellipses = "...";
621
+ const minimumLength = 2 + ellipses.length + endAmt;
622
+ let canFitText = availableSpace > cloneEl.clientWidth;
623
+ if (!canFitText && text.length > minimumLength) {
624
+ let frontChars = text.slice(0, text.length - endAmt - ellipses.length).trim();
625
+ let endChars = text.slice(-endAmt).trim();
626
+ let truncatedText = frontChars + ellipses + endChars;
627
+ cloneEl.textContent = truncatedText;
628
+ canFitText = availableSpace > cloneEl.clientWidth;
629
+ while (!canFitText && truncatedText.length > minimumLength) {
630
+ frontChars = frontChars.slice(0, -1).trim();
631
+ truncatedText = frontChars + ellipses + endChars;
632
+ cloneEl.textContent = truncatedText;
633
+ canFitText = availableSpace > cloneEl.clientWidth;
634
+ }
635
+ }
636
+ const truncatedText = cloneEl.textContent;
637
+ cloneEl.remove();
638
+ return truncatedText;
639
+ }
640
+ export function transposeMatrix(originalMatrix) {
641
+ let newMatrix = [];
642
+ for (let i = 0; i < originalMatrix[0].length; i++) {
643
+ let column = [];
644
+ for (let j = 0; j < originalMatrix.length; j++) {
645
+ column.push(originalMatrix[j][i]);
646
+ }
647
+ newMatrix.push(column);
648
+ }
649
+ return newMatrix;
650
+ }
651
+ // wrap around includes 0, so it won't work for something like dates (wrapping around months)
652
+ export function wrapAround(currentIdx, step, endIdx) {
653
+ currentIdx += step;
654
+ if (currentIdx > endIdx) {
655
+ currentIdx = (currentIdx - 1) % endIdx;
656
+ }
657
+ while (currentIdx < 0) {
658
+ currentIdx = endIdx - Math.abs(currentIdx) + 1;
659
+ }
660
+ return currentIdx;
661
+ }
662
+ export function skipByInterval(list, skipInterval) {
663
+ let skippedList = [];
664
+ for (let i = 0; i < list.length; i += 1 + skipInterval) {
665
+ skippedList.push(list[i]);
666
+ }
667
+ return skippedList;
668
+ }
669
+ export function getSmallestSkipInterval(list, maxLength) {
670
+ let skipInterval = 0;
671
+ let skippedList = list;
672
+ while (skipByInterval(list, skipInterval).length > maxLength) {
673
+ skipInterval++;
674
+ skippedList = skipByInterval(list, skipInterval);
675
+ }
676
+ return { skipInterval: skipInterval, skippedList: skippedList };
677
+ }
678
+ export function calcPercentageInRange(value, rangeLowest, rangeHighest) {
679
+ const rangeDistance = rangeHighest - rangeLowest;
680
+ const adjustedValue = Math.abs(value - rangeLowest);
681
+ const percentage = (adjustedValue / rangeDistance) * 100;
682
+ return percentage;
683
+ }
684
+ export function triggerFormSubmit(formEl) {
685
+ // requestSubmit is not supported by Safari v<16, use a polyfill for this
686
+ if (formEl.requestSubmit) {
687
+ formEl.requestSubmit();
688
+ }
689
+ else {
690
+ const submitButton = document.createElement("button");
691
+ submitButton.style.display = "none";
692
+ formEl.appendChild(submitButton);
693
+ submitButton.click();
694
+ document.removeChild(submitButton);
695
+ }
696
+ }
697
+ export function handleDisabledAttribute(el, isDisabled) {
698
+ if (isDisabled == false && el.hasAttribute("disabled")) {
699
+ el.removeAttribute("disabled");
700
+ }
701
+ }
702
+ // get the prev/next element with an option to circle through the list
703
+ export function findPrev(list, item, loop = false) {
704
+ if (!!list && !item)
705
+ return list[list.length - 1]; // if list was passed but no item, get the last item
706
+ if (!list.includes(item))
707
+ return; // if list is empty or doesn't include item
708
+ let current = list.indexOf(item);
709
+ let beforeFirst = loop ? list.length - 1 : 0; // before first item can be first (hard stop) or back to last
710
+ let prev = current > 0 ? current - 1 : beforeFirst;
711
+ return list[prev];
712
+ }
713
+ export function findNext(list, item, loop = false) {
714
+ if (!!list && !item)
715
+ return list[0]; // if list was passed but no item, get the first item
716
+ if (!list.includes(item))
717
+ return; // if list is empty or doesn't include item
718
+ let current = list.indexOf(item);
719
+ const last = list.length - 1;
720
+ let afterLast = loop ? 0 : last; // after last item can be last (hard stop) or back to first
721
+ let next = current !== last ? current + 1 : afterLast;
722
+ return list[next];
723
+ }
724
+ export function safeMultiplyFloat(factor1, factor2) {
725
+ // There can be floating point precision errors when multiplying floats.
726
+ // For example 0.2 * 3 will result in 0.6000000000000001 instead of the expected 0.6
727
+ const factor1DecimalCount = countDecimals(factor1);
728
+ const factor2DecimalCount = countDecimals(factor2);
729
+ const expectedDecimals = factor1DecimalCount + factor2DecimalCount;
730
+ return parseFloat((factor1 * factor2).toFixed(expectedDecimals));
731
+ }
732
+ function countDecimals(num) {
733
+ const asString = num.toString();
734
+ const decimalPointIndex = asString.indexOf(".");
735
+ if (decimalPointIndex == -1) {
736
+ return 0;
737
+ }
738
+ else {
739
+ return asString.split(".")[1].length;
740
+ }
741
+ }
742
+ export function getMonthLength(month, year) {
743
+ const months30 = [4, 6, 9, 11];
744
+ const leapYear = year % 4 === 0;
745
+ return month === 2 ? (leapYear ? 29 : 28) : months30.includes(month) ? 30 : 31;
746
+ }
747
+ export function dateToISO(date) {
748
+ return `${date.getUTCFullYear()}-${(date.getUTCMonth() + 1).toString().padStart(2, "0")}-${date
749
+ .getDate()
750
+ .toString()
751
+ .padStart(2, "0")}`;
752
+ }
753
+ function splitISO(isoDate) {
754
+ const [year, month, day] = isoDate.split("-");
755
+ return {
756
+ year: { asInt: parseInt(year), asString: year },
757
+ month: { asInt: parseInt(month), asString: month },
758
+ day: { asInt: parseInt(day), asString: day },
759
+ };
760
+ }
761
+ export function makeISO(y, m, d) {
762
+ return `${y}-${m.toString().padStart(2, "0")}-${d.toString().padStart(2, "0")}`;
763
+ }
764
+ export const dateFind = {
765
+ year: {
766
+ asString: (date) => splitISO(date).year.asString,
767
+ asInt: (date) => splitISO(date).year.asInt,
768
+ increase: (date, n) => {
769
+ const _date = splitISO(date);
770
+ const y = _date.year.asInt;
771
+ const m = _date.month.asInt;
772
+ const d = _date.day.asInt;
773
+ return makeISO(y + n, m, d);
774
+ },
775
+ decrease: (date, n) => {
776
+ const _date = splitISO(date);
777
+ const y = _date.year.asInt;
778
+ const m = _date.month.asInt;
779
+ const d = _date.day.asInt;
780
+ return makeISO(y - n, m, d);
781
+ },
782
+ },
783
+ month: {
784
+ asString: (date) => splitISO(date).month.asString,
785
+ asInt: (date) => splitISO(date).month.asInt,
786
+ increase: (date, n) => {
787
+ const _date = splitISO(date);
788
+ const yearsToAdd = Math.floor(n / 12);
789
+ const monthsToAdd = n % 12;
790
+ let y = _date.year.asInt;
791
+ let m = _date.month.asInt;
792
+ const d = _date.day.asInt;
793
+ y = m + monthsToAdd > 12 ? y + 1 : y;
794
+ y = y + yearsToAdd;
795
+ m = m + monthsToAdd;
796
+ // modulo requires zero-indexing
797
+ m = ((m - 1) % 12) + 1;
798
+ return makeISO(y, m, d);
799
+ },
800
+ decrease: (date, n) => {
801
+ const _date = splitISO(date);
802
+ const yearsToRemove = Math.floor(n / 12);
803
+ const monthsToRemove = n % 12;
804
+ let y = _date.year.asInt;
805
+ let m = _date.month.asInt;
806
+ const d = _date.day.asInt;
807
+ y = m - monthsToRemove < 1 ? y - 1 : y;
808
+ y = y - yearsToRemove;
809
+ // ensure no negative value by shifting up
810
+ m = m + 12;
811
+ m = m - monthsToRemove;
812
+ // modulo needs zero-indexing
813
+ m = ((m - 1) % 12) + 1;
814
+ return makeISO(y, m, d);
815
+ },
816
+ },
817
+ day: {
818
+ asString: (date) => splitISO(date).day.asString,
819
+ asInt: (date) => splitISO(date).day.asInt,
820
+ increase: (date, n) => {
821
+ if (n > 7)
822
+ throw new Error("this.dateFind.day.increase(): max 7 days");
823
+ const _date = splitISO(date);
824
+ let y = _date.year.asInt;
825
+ let m = _date.month.asInt;
826
+ let d = _date.day.asInt;
827
+ const maxDays = getMonthLength(m, y);
828
+ const goesToNextMonth = d + n > maxDays;
829
+ const goesToNextYear = goesToNextMonth && m === 12;
830
+ m = goesToNextMonth ? (goesToNextYear ? 1 : m + 1) : m;
831
+ y = goesToNextYear ? y + 1 : y;
832
+ d = ((d - 1 + n) % maxDays) + 1;
833
+ return makeISO(y, m, d);
834
+ },
835
+ decrease: (date, n) => {
836
+ if (n > 7)
837
+ throw new Error("this.dateFind.day.decrease(): max 7 days");
838
+ const _date = splitISO(date);
839
+ let y = _date.year.asInt;
840
+ let m = _date.month.asInt;
841
+ let d = _date.day.asInt;
842
+ const prevMonth = m === 1 ? 12 : m - 1;
843
+ const maxDays = getMonthLength(prevMonth, y);
844
+ const goesToPreviousMonth = d - n < 1;
845
+ const goesToPreviousYear = goesToPreviousMonth && m === 1;
846
+ // ensure no negative value by shifting up
847
+ d = d + maxDays;
848
+ d = d - n;
849
+ // modulo needs zero-indexing
850
+ d = ((d - 1) % maxDays) + 1;
851
+ m = goesToPreviousMonth ? (goesToPreviousYear ? 12 : m - 1) : m;
852
+ y = goesToPreviousYear ? y - 1 : y;
853
+ return makeISO(y, m, d);
854
+ },
855
+ },
856
+ };
857
+ export const calendar_months = [
858
+ intl.formatMessage({
859
+ id: "date.january",
860
+ defaultMessage: "January",
861
+ description: "Month of the year",
862
+ }),
863
+ intl.formatMessage({
864
+ id: "date.february",
865
+ defaultMessage: "February",
866
+ description: "Month of the year",
867
+ }),
868
+ intl.formatMessage({
869
+ id: "date.march",
870
+ defaultMessage: "March",
871
+ description: "Month of the year",
872
+ }),
873
+ intl.formatMessage({
874
+ id: "date.april",
875
+ defaultMessage: "April",
876
+ description: "Month of the year",
877
+ }),
878
+ intl.formatMessage({
879
+ id: "date.may",
880
+ defaultMessage: "May",
881
+ description: "Month of the year",
882
+ }),
883
+ intl.formatMessage({
884
+ id: "date.june",
885
+ defaultMessage: "June",
886
+ description: "Month of the year",
887
+ }),
888
+ intl.formatMessage({
889
+ id: "date.july",
890
+ defaultMessage: "July",
891
+ description: "Month of the year",
892
+ }),
893
+ intl.formatMessage({
894
+ id: "date.august",
895
+ defaultMessage: "August",
896
+ description: "Month of the year",
897
+ }),
898
+ intl.formatMessage({
899
+ id: "date.september",
900
+ defaultMessage: "September",
901
+ description: "Month of the year",
902
+ }),
903
+ intl.formatMessage({
904
+ id: "date.october",
905
+ defaultMessage: "October",
906
+ description: "Month of the year",
907
+ }),
908
+ intl.formatMessage({
909
+ id: "date.november",
910
+ defaultMessage: "November",
911
+ description: "Month of the year",
912
+ }),
913
+ intl.formatMessage({
914
+ id: "date.december",
915
+ defaultMessage: "December",
916
+ description: "Month of the year",
917
+ }),
918
+ ];
919
+ export const weekdays = [
920
+ intl.formatMessage({ id: "date.sunday", defaultMessage: "Sunday" }),
921
+ intl.formatMessage({ id: "date.monday", defaultMessage: "Monday" }),
922
+ intl.formatMessage({ id: "date.tuesday", defaultMessage: "Tuesday" }),
923
+ intl.formatMessage({ id: "date.wednesday", defaultMessage: "Wednesday" }),
924
+ intl.formatMessage({ id: "date.thursday", defaultMessage: "Thursday" }),
925
+ intl.formatMessage({ id: "date.friday", defaultMessage: "Friday" }),
926
+ intl.formatMessage({ id: "date.saturday", defaultMessage: "Saturday" }),
927
+ ];