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

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/{collection/global/global.js → ripple/app-globals-a0922f84.js} +60 -2
  2. package/dist/{esm/chartFunctions-6749593d.js → ripple/chartFunctions-021607da.js} +3 -3
  3. package/dist/{esm/functions-dabfd76f.js → ripple/functions-3eaaa7c4.js} +7766 -147
  4. package/dist/ripple/index-3d0f1864.js +3017 -0
  5. package/dist/ripple/index.esm.js +1 -0
  6. package/dist/{collection/global/interfaces.js → ripple/interfaces-382e0566.js} +6 -4
  7. package/dist/{esm/intl-43676e71.js → ripple/intl-14fae6dd.js} +1 -1
  8. package/dist/ripple/priv-calendar.entry.js +569 -0
  9. package/dist/ripple/{p-30236be3.system.entry.js → priv-chart-popover.entry.js} +140 -1
  10. package/dist/{esm-es5/priv-chart-popover.entry.js → ripple/priv-navigator-button.entry.js} +24 -1
  11. package/dist/ripple/{p-97ffaa7d.entry.js → priv-navigator-item.entry.js} +30 -1
  12. package/dist/ripple/{p-b01f9572.system.entry.js → priv-option-list.entry.js} +388 -1
  13. package/dist/ripple/ripple.esm.js +47 -1
  14. package/dist/ripple/shadow-css-7ad5caf8.js +332 -0
  15. package/dist/{cjs/wm-button.cjs.entry.js → ripple/wm-action-menu.entry.js} +162 -229
  16. package/dist/{esm-es5/priv-option-list.entry.js → ripple/wm-button.entry.js} +268 -1
  17. package/dist/{esm → ripple}/wm-chart-slice.entry.js +1 -1
  18. package/dist/{esm/wm-file.entry.js → ripple/wm-chart.entry.js} +137 -169
  19. package/dist/ripple/wm-date-range.entry.js +479 -0
  20. package/dist/ripple/wm-datepicker.entry.js +249 -0
  21. package/dist/ripple/{p-c53f5914.entry.js → wm-file-list.entry.js} +18 -1
  22. package/dist/ripple/{p-f9fa1506.system.entry.js → wm-file.entry.js} +189 -1
  23. package/dist/ripple/{p-89479d02.system.entry.js → wm-flyout.entry.js} +175 -1
  24. package/dist/{esm-es5/wm-flyout.entry.js → ripple/wm-input.entry.js} +120 -1
  25. package/dist/ripple/wm-line-chart.entry.js +456 -0
  26. package/dist/{esm/priv-chart-popover.entry.js → ripple/wm-menuitem.entry.js} +98 -114
  27. package/dist/{cjs/priv-navigator-button.cjs.entry.js → ripple/wm-modal-footer.entry.js} +35 -20
  28. package/dist/{esm/priv-navigator-button.entry.js → ripple/wm-modal-header.entry.js} +25 -14
  29. package/dist/ripple/{p-091fbc50.system.entry.js → wm-modal-pss-footer.entry.js} +40 -1
  30. package/dist/ripple/{p-92cb12d3.entry.js → wm-modal-pss-header.entry.js} +39 -1
  31. package/dist/ripple/wm-modal-pss.entry.js +136 -0
  32. package/dist/ripple/{p-1955c66a.system.entry.js → wm-modal.entry.js} +135 -1
  33. package/dist/ripple/wm-navigation-hamburger.entry.js +49 -0
  34. package/dist/ripple/{p-8f987f71.entry.js → wm-navigation-item.entry.js} +21 -1
  35. package/dist/ripple/wm-navigation.entry.js +116 -0
  36. package/dist/{esm/priv-navigator-item.entry.js → ripple/wm-navigator.entry.js} +351 -19
  37. package/dist/ripple/{p-fe93b6b9.system.entry.js → wm-nested-select.entry.js} +310 -1
  38. package/dist/ripple/wm-optgroup.entry.js +69 -0
  39. package/dist/{esm/priv-option-list.entry.js → ripple/wm-option.entry.js} +130 -347
  40. package/dist/ripple/wm-pagination.entry.js +223 -0
  41. package/dist/ripple/wm-progress-indicator.entry.js +112 -0
  42. package/dist/{esm-es5/priv-navigator-item.entry.js → ripple/wm-progress-monitor.entry.js} +74 -1
  43. package/dist/ripple/wm-progress-slice.entry.js +18 -0
  44. package/dist/{cjs/priv-option-list.cjs.entry.js → ripple/wm-search.entry.js} +162 -364
  45. package/dist/{esm/wm-nested-select.entry.js → ripple/wm-select.entry.js} +134 -194
  46. package/dist/ripple/wm-snackbar.entry.js +184 -0
  47. package/dist/{esm-es5/wm-file-list.entry.js → ripple/wm-tab-item.entry.js} +57 -1
  48. package/dist/ripple/wm-tab-list.entry.js +178 -0
  49. package/dist/ripple/wm-tab-panel.entry.js +26 -0
  50. package/dist/ripple/wm-tag-input.entry.js +947 -0
  51. package/dist/{esm → ripple}/wm-tag-option.entry.js +2 -2
  52. package/dist/{cjs/priv-chart-popover.cjs.entry.js → ripple/wm-textarea.entry.js} +60 -122
  53. package/dist/{esm/wm-button.entry.js → ripple/wm-timepicker.entry.js} +251 -218
  54. package/dist/{cjs/priv-navigator-item.cjs.entry.js → ripple/wm-toggletip.entry.js} +227 -25
  55. package/dist/ripple/wm-uploader.entry.js +320 -0
  56. package/dist/{esm → ripple}/wm-wrapper.entry.js +1 -1
  57. package/package.json +2 -2
  58. package/dist/cjs/app-globals-f56991b7.js +0 -92
  59. package/dist/cjs/chartFunctions-439c6fd4.js +0 -742
  60. package/dist/cjs/functions-dd27bda3.js +0 -10618
  61. package/dist/cjs/index-788526f5.js +0 -1863
  62. package/dist/cjs/index.cjs.js +0 -2
  63. package/dist/cjs/interfaces-85d78ae9.js +0 -37
  64. package/dist/cjs/intl-6d72b4a0.js +0 -283
  65. package/dist/cjs/loader.cjs.js +0 -15
  66. package/dist/cjs/priv-calendar.cjs.entry.js +0 -574
  67. package/dist/cjs/ripple.cjs.js +0 -25
  68. package/dist/cjs/wm-action-menu_2.cjs.entry.js +0 -335
  69. package/dist/cjs/wm-chart-slice.cjs.entry.js +0 -27
  70. package/dist/cjs/wm-chart.cjs.entry.js +0 -163
  71. package/dist/cjs/wm-date-range.cjs.entry.js +0 -484
  72. package/dist/cjs/wm-datepicker.cjs.entry.js +0 -254
  73. package/dist/cjs/wm-file-list.cjs.entry.js +0 -23
  74. package/dist/cjs/wm-file.cjs.entry.js +0 -194
  75. package/dist/cjs/wm-flyout.cjs.entry.js +0 -180
  76. package/dist/cjs/wm-input.cjs.entry.js +0 -125
  77. package/dist/cjs/wm-line-chart.cjs.entry.js +0 -461
  78. package/dist/cjs/wm-modal-pss_3.cjs.entry.js +0 -217
  79. package/dist/cjs/wm-modal_3.cjs.entry.js +0 -217
  80. package/dist/cjs/wm-navigation_3.cjs.entry.js +0 -188
  81. package/dist/cjs/wm-navigator.cjs.entry.js +0 -327
  82. package/dist/cjs/wm-nested-select.cjs.entry.js +0 -315
  83. package/dist/cjs/wm-optgroup.cjs.entry.js +0 -74
  84. package/dist/cjs/wm-option_2.cjs.entry.js +0 -427
  85. package/dist/cjs/wm-pagination.cjs.entry.js +0 -228
  86. package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +0 -204
  87. package/dist/cjs/wm-search.cjs.entry.js +0 -196
  88. package/dist/cjs/wm-snackbar.cjs.entry.js +0 -189
  89. package/dist/cjs/wm-tab-item_3.cjs.entry.js +0 -263
  90. package/dist/cjs/wm-tag-input.cjs.entry.js +0 -947
  91. package/dist/cjs/wm-tag-option.cjs.entry.js +0 -43
  92. package/dist/cjs/wm-textarea.cjs.entry.js +0 -88
  93. package/dist/cjs/wm-timepicker.cjs.entry.js +0 -307
  94. package/dist/cjs/wm-toggletip.cjs.entry.js +0 -242
  95. package/dist/cjs/wm-uploader.cjs.entry.js +0 -325
  96. package/dist/cjs/wm-wrapper.cjs.entry.js +0 -21
  97. package/dist/collection/collection-manifest.json +0 -197
  98. package/dist/collection/components/charts/chartFunctions.js +0 -675
  99. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.css +0 -948
  100. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +0 -262
  101. package/dist/collection/components/charts/wm-chart/wm-chart-slice.js +0 -125
  102. package/dist/collection/components/charts/wm-chart/wm-chart.css +0 -1314
  103. package/dist/collection/components/charts/wm-chart/wm-chart.js +0 -422
  104. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.css +0 -1106
  105. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.js +0 -723
  106. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.css +0 -1314
  107. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +0 -264
  108. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.css +0 -948
  109. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +0 -151
  110. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-slice.js +0 -121
  111. package/dist/collection/components/datepickers/datepicker.css +0 -1083
  112. package/dist/collection/components/datepickers/priv-calendar/priv-calendar.css +0 -1318
  113. package/dist/collection/components/datepickers/priv-calendar/priv-calendar.js +0 -840
  114. package/dist/collection/components/datepickers/wm-date-range.js +0 -849
  115. package/dist/collection/components/datepickers/wm-datepicker.js +0 -524
  116. package/dist/collection/components/selects/priv-option-list/priv-option-list.css +0 -958
  117. package/dist/collection/components/selects/priv-option-list/priv-option-list.js +0 -780
  118. package/dist/collection/components/selects/wm-nested-select/wm-nested-select.css +0 -1229
  119. package/dist/collection/components/selects/wm-nested-select/wm-nested-select.js +0 -620
  120. package/dist/collection/components/selects/wm-optgroup/wm-optgroup.css +0 -869
  121. package/dist/collection/components/selects/wm-optgroup/wm-optgroup.js +0 -258
  122. package/dist/collection/components/selects/wm-option/wm-option.css +0 -970
  123. package/dist/collection/components/selects/wm-option/wm-option.js +0 -530
  124. package/dist/collection/components/selects/wm-select/wm-select.css +0 -1143
  125. package/dist/collection/components/selects/wm-select/wm-select.js +0 -584
  126. package/dist/collection/components/wm-action-menu/wm-action-menu.css +0 -930
  127. package/dist/collection/components/wm-action-menu/wm-action-menu.js +0 -435
  128. package/dist/collection/components/wm-button/wm-button.css +0 -1580
  129. package/dist/collection/components/wm-button/wm-button.js +0 -555
  130. package/dist/collection/components/wm-file/wm-file.css +0 -966
  131. package/dist/collection/components/wm-file/wm-file.js +0 -412
  132. package/dist/collection/components/wm-file-list/wm-file-list.css +0 -859
  133. package/dist/collection/components/wm-file-list/wm-file-list.js +0 -45
  134. package/dist/collection/components/wm-flyout/wm-flyout.css +0 -1053
  135. package/dist/collection/components/wm-flyout/wm-flyout.js +0 -448
  136. package/dist/collection/components/wm-input/wm-input.css +0 -1043
  137. package/dist/collection/components/wm-input/wm-input.js +0 -471
  138. package/dist/collection/components/wm-menuitem/wm-menuitem.css +0 -930
  139. package/dist/collection/components/wm-menuitem/wm-menuitem.js +0 -419
  140. package/dist/collection/components/wm-modal/wm-modal-footer.css +0 -884
  141. package/dist/collection/components/wm-modal/wm-modal-footer.js +0 -142
  142. package/dist/collection/components/wm-modal/wm-modal-header.css +0 -883
  143. package/dist/collection/components/wm-modal/wm-modal-header.js +0 -79
  144. package/dist/collection/components/wm-modal/wm-modal.css +0 -931
  145. package/dist/collection/components/wm-modal/wm-modal.js +0 -350
  146. package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.css +0 -891
  147. package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.js +0 -138
  148. package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.css +0 -885
  149. package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.js +0 -82
  150. package/dist/collection/components/wm-modal-pss/wm-modal-pss.css +0 -967
  151. package/dist/collection/components/wm-modal-pss/wm-modal-pss.js +0 -362
  152. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.css +0 -886
  153. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +0 -119
  154. package/dist/collection/components/wm-navigation/wm-navigation-item.css +0 -895
  155. package/dist/collection/components/wm-navigation/wm-navigation-item.js +0 -98
  156. package/dist/collection/components/wm-navigation/wm-navigation.css +0 -937
  157. package/dist/collection/components/wm-navigation/wm-navigation.js +0 -190
  158. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.css +0 -889
  159. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +0 -86
  160. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.css +0 -869
  161. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +0 -124
  162. package/dist/collection/components/wm-navigator/wm-navigator.css +0 -942
  163. package/dist/collection/components/wm-navigator/wm-navigator.js +0 -496
  164. package/dist/collection/components/wm-pagination/wm-pagination.css +0 -1010
  165. package/dist/collection/components/wm-pagination/wm-pagination.js +0 -363
  166. package/dist/collection/components/wm-search/wm-search.css +0 -935
  167. package/dist/collection/components/wm-search/wm-search.js +0 -429
  168. package/dist/collection/components/wm-snackbar/wm-snackbar.css +0 -1117
  169. package/dist/collection/components/wm-snackbar/wm-snackbar.js +0 -276
  170. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.css +0 -908
  171. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +0 -175
  172. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.css +0 -880
  173. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +0 -273
  174. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.css +0 -864
  175. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +0 -87
  176. package/dist/collection/components/wm-tag-input/wm-tag-input.css +0 -1318
  177. package/dist/collection/components/wm-tag-input/wm-tag-input.js +0 -1282
  178. package/dist/collection/components/wm-tag-input/wm-tag-option/wm-tag-option.js +0 -243
  179. package/dist/collection/components/wm-textarea/wm-textarea.css +0 -1019
  180. package/dist/collection/components/wm-textarea/wm-textarea.js +0 -313
  181. package/dist/collection/components/wm-timepicker/wm-timepicker.css +0 -1133
  182. package/dist/collection/components/wm-timepicker/wm-timepicker.js +0 -547
  183. package/dist/collection/components/wm-toggletip/wm-toggletip.css +0 -1256
  184. package/dist/collection/components/wm-toggletip/wm-toggletip.js +0 -366
  185. package/dist/collection/components/wm-uploader/wm-uploader.css +0 -1882
  186. package/dist/collection/components/wm-uploader/wm-uploader.js +0 -603
  187. package/dist/collection/components/wm-wrapper/wm-wrapper.js +0 -28
  188. package/dist/collection/dev/action-menu.js +0 -0
  189. package/dist/collection/dev/button.js +0 -0
  190. package/dist/collection/dev/chart-small.js +0 -56
  191. package/dist/collection/dev/chart.js +0 -18
  192. package/dist/collection/dev/date-range.js +0 -6
  193. package/dist/collection/dev/datepicker.js +0 -46
  194. package/dist/collection/dev/file-list.js +0 -16
  195. package/dist/collection/dev/file.js +0 -0
  196. package/dist/collection/dev/flyout.js +0 -194
  197. package/dist/collection/dev/input.js +0 -6
  198. package/dist/collection/dev/line-chart.js +0 -0
  199. package/dist/collection/dev/modal.js +0 -48
  200. package/dist/collection/dev/navigation.js +0 -13
  201. package/dist/collection/dev/navigator.js +0 -34
  202. package/dist/collection/dev/nested-select.js +0 -36
  203. package/dist/collection/dev/pagination.js +0 -7
  204. package/dist/collection/dev/progress-monitor.js +0 -0
  205. package/dist/collection/dev/pss-modal.js +0 -8
  206. package/dist/collection/dev/scripts.js +0 -49
  207. package/dist/collection/dev/search.js +0 -72
  208. package/dist/collection/dev/select.js +0 -57
  209. package/dist/collection/dev/snackbar.js +0 -60
  210. package/dist/collection/dev/tabs.js +0 -44
  211. package/dist/collection/dev/tag-input.js +0 -32
  212. package/dist/collection/dev/textarea.js +0 -28
  213. package/dist/collection/dev/timepicker.js +0 -32
  214. package/dist/collection/dev/toggletip.js +0 -9
  215. package/dist/collection/dev/uploader.js +0 -139
  216. package/dist/collection/global/__mocks__/functions.js +0 -6
  217. package/dist/collection/global/functions.js +0 -927
  218. package/dist/collection/global/intl.js +0 -274
  219. package/dist/collection/global/services/__mocks__/http-service.js +0 -130
  220. package/dist/collection/global/services/http-service.js +0 -50
  221. package/dist/collection/lang/lang.js +0 -5
  222. package/dist/collection/lang/missing.js +0 -43
  223. package/dist/collection/lang/piglatin.js +0 -101
  224. package/dist/esm/app-globals-cc7a1bd5.js +0 -90
  225. package/dist/esm/index-130e07bb.js +0 -1832
  226. package/dist/esm/index.js +0 -1
  227. package/dist/esm/interfaces-cc5b177f.js +0 -34
  228. package/dist/esm/loader.js +0 -11
  229. package/dist/esm/polyfills/core-js.js +0 -11
  230. package/dist/esm/polyfills/dom.js +0 -79
  231. package/dist/esm/polyfills/es5-html-element.js +0 -1
  232. package/dist/esm/polyfills/index.js +0 -34
  233. package/dist/esm/polyfills/system.js +0 -6
  234. package/dist/esm/priv-calendar.entry.js +0 -570
  235. package/dist/esm/ripple.js +0 -20
  236. package/dist/esm/wm-action-menu_2.entry.js +0 -330
  237. package/dist/esm/wm-chart.entry.js +0 -159
  238. package/dist/esm/wm-date-range.entry.js +0 -480
  239. package/dist/esm/wm-datepicker.entry.js +0 -250
  240. package/dist/esm/wm-file-list.entry.js +0 -19
  241. package/dist/esm/wm-flyout.entry.js +0 -176
  242. package/dist/esm/wm-input.entry.js +0 -121
  243. package/dist/esm/wm-line-chart.entry.js +0 -457
  244. package/dist/esm/wm-modal-pss_3.entry.js +0 -211
  245. package/dist/esm/wm-modal_3.entry.js +0 -211
  246. package/dist/esm/wm-navigation_3.entry.js +0 -182
  247. package/dist/esm/wm-navigator.entry.js +0 -323
  248. package/dist/esm/wm-optgroup.entry.js +0 -70
  249. package/dist/esm/wm-option_2.entry.js +0 -422
  250. package/dist/esm/wm-pagination.entry.js +0 -224
  251. package/dist/esm/wm-progress-indicator_3.entry.js +0 -198
  252. package/dist/esm/wm-search.entry.js +0 -192
  253. package/dist/esm/wm-snackbar.entry.js +0 -185
  254. package/dist/esm/wm-tab-item_3.entry.js +0 -257
  255. package/dist/esm/wm-tag-input.entry.js +0 -943
  256. package/dist/esm/wm-textarea.entry.js +0 -84
  257. package/dist/esm/wm-timepicker.entry.js +0 -303
  258. package/dist/esm/wm-toggletip.entry.js +0 -238
  259. package/dist/esm/wm-uploader.entry.js +0 -321
  260. package/dist/esm-es5/app-globals-cc7a1bd5.js +0 -1
  261. package/dist/esm-es5/chartFunctions-6749593d.js +0 -1
  262. package/dist/esm-es5/functions-dabfd76f.js +0 -1
  263. package/dist/esm-es5/index-130e07bb.js +0 -1
  264. package/dist/esm-es5/index.js +0 -0
  265. package/dist/esm-es5/interfaces-cc5b177f.js +0 -1
  266. package/dist/esm-es5/intl-43676e71.js +0 -1
  267. package/dist/esm-es5/loader.js +0 -1
  268. package/dist/esm-es5/priv-calendar.entry.js +0 -1
  269. package/dist/esm-es5/priv-navigator-button.entry.js +0 -1
  270. package/dist/esm-es5/ripple.js +0 -1
  271. package/dist/esm-es5/wm-action-menu_2.entry.js +0 -1
  272. package/dist/esm-es5/wm-button.entry.js +0 -1
  273. package/dist/esm-es5/wm-chart-slice.entry.js +0 -1
  274. package/dist/esm-es5/wm-chart.entry.js +0 -1
  275. package/dist/esm-es5/wm-date-range.entry.js +0 -1
  276. package/dist/esm-es5/wm-datepicker.entry.js +0 -1
  277. package/dist/esm-es5/wm-file.entry.js +0 -1
  278. package/dist/esm-es5/wm-input.entry.js +0 -1
  279. package/dist/esm-es5/wm-line-chart.entry.js +0 -1
  280. package/dist/esm-es5/wm-modal-pss_3.entry.js +0 -1
  281. package/dist/esm-es5/wm-modal_3.entry.js +0 -1
  282. package/dist/esm-es5/wm-navigation_3.entry.js +0 -1
  283. package/dist/esm-es5/wm-navigator.entry.js +0 -1
  284. package/dist/esm-es5/wm-nested-select.entry.js +0 -1
  285. package/dist/esm-es5/wm-optgroup.entry.js +0 -1
  286. package/dist/esm-es5/wm-option_2.entry.js +0 -1
  287. package/dist/esm-es5/wm-pagination.entry.js +0 -1
  288. package/dist/esm-es5/wm-progress-indicator_3.entry.js +0 -1
  289. package/dist/esm-es5/wm-search.entry.js +0 -1
  290. package/dist/esm-es5/wm-snackbar.entry.js +0 -1
  291. package/dist/esm-es5/wm-tab-item_3.entry.js +0 -1
  292. package/dist/esm-es5/wm-tag-input.entry.js +0 -1
  293. package/dist/esm-es5/wm-tag-option.entry.js +0 -1
  294. package/dist/esm-es5/wm-textarea.entry.js +0 -1
  295. package/dist/esm-es5/wm-timepicker.entry.js +0 -1
  296. package/dist/esm-es5/wm-toggletip.entry.js +0 -1
  297. package/dist/esm-es5/wm-uploader.entry.js +0 -1
  298. package/dist/esm-es5/wm-wrapper.entry.js +0 -1
  299. package/dist/index.cjs.js +0 -1
  300. package/dist/index.js +0 -1
  301. package/dist/loader/cdn.js +0 -2
  302. package/dist/loader/index.cjs.js +0 -2
  303. package/dist/loader/index.d.ts +0 -24
  304. package/dist/loader/index.es2017.js +0 -2
  305. package/dist/loader/index.js +0 -3
  306. package/dist/loader/package.json +0 -11
  307. package/dist/ripple/p-0189929d.entry.js +0 -1
  308. package/dist/ripple/p-043901ab.system.entry.js +0 -1
  309. package/dist/ripple/p-0bb576c5.system.entry.js +0 -1
  310. package/dist/ripple/p-0c89b82c.entry.js +0 -1
  311. package/dist/ripple/p-12ac8f93.js +0 -1
  312. package/dist/ripple/p-12d6ab73.system.entry.js +0 -1
  313. package/dist/ripple/p-13b1d775.entry.js +0 -1
  314. package/dist/ripple/p-144ce232.entry.js +0 -1
  315. package/dist/ripple/p-1497ccfc.entry.js +0 -1
  316. package/dist/ripple/p-1a3037aa.entry.js +0 -1
  317. package/dist/ripple/p-22b55b6f.entry.js +0 -1
  318. package/dist/ripple/p-257d2d5c.entry.js +0 -1
  319. package/dist/ripple/p-2732bddd.js +0 -1
  320. package/dist/ripple/p-2823d02b.system.entry.js +0 -1
  321. package/dist/ripple/p-2f7ca1a7.system.entry.js +0 -1
  322. package/dist/ripple/p-30201dc9.entry.js +0 -1
  323. package/dist/ripple/p-36d2b888.entry.js +0 -1
  324. package/dist/ripple/p-36fd8aed.system.entry.js +0 -1
  325. package/dist/ripple/p-3f98056c.js +0 -1
  326. package/dist/ripple/p-41120a33.system.js +0 -1
  327. package/dist/ripple/p-42fa7a77.system.js +0 -1
  328. package/dist/ripple/p-492aa9fe.system.entry.js +0 -1
  329. package/dist/ripple/p-49a347e1.js +0 -1
  330. package/dist/ripple/p-4a29bb8c.entry.js +0 -1
  331. package/dist/ripple/p-4c2a044d.system.entry.js +0 -1
  332. package/dist/ripple/p-4cebf2d7.entry.js +0 -1
  333. package/dist/ripple/p-4e6b0a6e.system.entry.js +0 -1
  334. package/dist/ripple/p-4fb4deb9.entry.js +0 -1
  335. package/dist/ripple/p-50ea2036.system.js +0 -1
  336. package/dist/ripple/p-56d54fe6.system.entry.js +0 -1
  337. package/dist/ripple/p-57c25b63.entry.js +0 -1
  338. package/dist/ripple/p-59591401.entry.js +0 -1
  339. package/dist/ripple/p-5cff41e0.entry.js +0 -1
  340. package/dist/ripple/p-5ef786db.system.entry.js +0 -1
  341. package/dist/ripple/p-61f9987d.system.entry.js +0 -1
  342. package/dist/ripple/p-6a03a172.entry.js +0 -1
  343. package/dist/ripple/p-6a082957.entry.js +0 -1
  344. package/dist/ripple/p-6abc1227.entry.js +0 -1
  345. package/dist/ripple/p-6d12cfb7.system.entry.js +0 -1
  346. package/dist/ripple/p-72ed488e.system.entry.js +0 -1
  347. package/dist/ripple/p-74f103dd.entry.js +0 -1
  348. package/dist/ripple/p-81ce2697.entry.js +0 -1
  349. package/dist/ripple/p-823d7b4e.system.entry.js +0 -1
  350. package/dist/ripple/p-89316785.system.js +0 -1
  351. package/dist/ripple/p-8a569d3b.entry.js +0 -1
  352. package/dist/ripple/p-8ec2e944.system.entry.js +0 -1
  353. package/dist/ripple/p-92a50b38.system.entry.js +0 -1
  354. package/dist/ripple/p-9328023c.entry.js +0 -1
  355. package/dist/ripple/p-94f776eb.entry.js +0 -1
  356. package/dist/ripple/p-9b2281e2.system.entry.js +0 -1
  357. package/dist/ripple/p-a2c8937d.js +0 -1
  358. package/dist/ripple/p-a5fb4171.system.entry.js +0 -1
  359. package/dist/ripple/p-b23c6351.system.entry.js +0 -1
  360. package/dist/ripple/p-b34552b0.system.entry.js +0 -1
  361. package/dist/ripple/p-b39ab477.entry.js +0 -1
  362. package/dist/ripple/p-ba399879.system.js +0 -1
  363. package/dist/ripple/p-bb9f6920.entry.js +0 -1
  364. package/dist/ripple/p-bc4976e6.entry.js +0 -1
  365. package/dist/ripple/p-bd48c50a.entry.js +0 -1
  366. package/dist/ripple/p-c1aa877a.system.js +0 -1
  367. package/dist/ripple/p-c31e1379.entry.js +0 -1
  368. package/dist/ripple/p-c4896784.system.entry.js +0 -1
  369. package/dist/ripple/p-c699aec8.system.entry.js +0 -1
  370. package/dist/ripple/p-c7d71181.system.entry.js +0 -1
  371. package/dist/ripple/p-cd0cc88d.entry.js +0 -1
  372. package/dist/ripple/p-ceac4dea.system.entry.js +0 -1
  373. package/dist/ripple/p-cef8a45b.system.js +0 -2
  374. package/dist/ripple/p-d333d851.system.entry.js +0 -1
  375. package/dist/ripple/p-d9da0502.js +0 -2
  376. package/dist/ripple/p-e59a48a6.system.js +0 -1
  377. package/dist/ripple/p-f3df715f.entry.js +0 -1
  378. package/dist/ripple/p-f8995a5e.system.entry.js +0 -1
  379. package/dist/ripple/p-fe71ec64.system.entry.js +0 -1
  380. package/dist/ripple/ripple.js +0 -127
@@ -1,927 +0,0 @@
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
- ];