@watermarkinsights/ripple 0.0.1 → 0.1.0-alpha.1

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