@watermarkinsights/ripple 0.0.1 → 0.1.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (496) hide show
  1. package/dist/cjs/app-globals-f836e216.js +103 -0
  2. package/dist/cjs/chartFunctions-608adb05.js +908 -0
  3. package/dist/{ripple/functions-DVLl0rH_.js → cjs/functions-b188d5b3.js} +403 -7835
  4. package/dist/cjs/index-786066a1.js +1880 -0
  5. package/dist/cjs/index.cjs.js +2 -0
  6. package/dist/cjs/interfaces-8419be91.js +59 -0
  7. package/dist/cjs/intl-01531391.js +283 -0
  8. package/dist/cjs/loader.cjs.js +15 -0
  9. package/dist/cjs/priv-calendar.cjs.entry.js +608 -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 +194 -0
  12. package/dist/{ripple/wm-modal-footer.entry.js → cjs/priv-navigator-button.cjs.entry.js} +20 -35
  13. package/dist/{ripple/wm-navigator.entry.js → cjs/priv-navigator-item.cjs.entry.js} +24 -357
  14. package/dist/{ripple/wm-search.entry.js → cjs/priv-option-list.cjs.entry.js} +363 -180
  15. package/dist/cjs/ripple.cjs.js +25 -0
  16. package/dist/cjs/wm-action-menu_2.cjs.entry.js +487 -0
  17. package/dist/cjs/wm-button.cjs.entry.js +273 -0
  18. package/dist/cjs/wm-chart-bar.cjs.entry.js +441 -0
  19. package/dist/cjs/wm-chart-column.cjs.entry.js +544 -0
  20. package/dist/cjs/wm-chart-slice.cjs.entry.js +27 -0
  21. package/dist/cjs/wm-chart.cjs.entry.js +163 -0
  22. package/dist/cjs/wm-date-range.cjs.entry.js +526 -0
  23. package/dist/cjs/wm-datepicker.cjs.entry.js +323 -0
  24. package/dist/cjs/wm-file-list.cjs.entry.js +23 -0
  25. package/dist/cjs/wm-file.cjs.entry.js +210 -0
  26. package/dist/cjs/wm-flyout.cjs.entry.js +181 -0
  27. package/dist/cjs/wm-input.cjs.entry.js +131 -0
  28. package/dist/cjs/wm-line-chart.cjs.entry.js +541 -0
  29. package/dist/cjs/wm-modal-pss_3.cjs.entry.js +220 -0
  30. package/dist/cjs/wm-modal_3.cjs.entry.js +223 -0
  31. package/dist/cjs/wm-navigation_3.cjs.entry.js +188 -0
  32. package/dist/cjs/wm-navigator.cjs.entry.js +334 -0
  33. package/dist/cjs/wm-nested-select.cjs.entry.js +320 -0
  34. package/dist/cjs/wm-optgroup.cjs.entry.js +74 -0
  35. package/dist/cjs/wm-option_2.cjs.entry.js +535 -0
  36. package/dist/cjs/wm-pagination.cjs.entry.js +229 -0
  37. package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +204 -0
  38. package/dist/cjs/wm-search.cjs.entry.js +196 -0
  39. package/dist/cjs/wm-snackbar.cjs.entry.js +176 -0
  40. package/dist/cjs/wm-tab-item_3.cjs.entry.js +357 -0
  41. package/dist/cjs/wm-tag-input.cjs.entry.js +953 -0
  42. package/dist/cjs/wm-tag-option.cjs.entry.js +43 -0
  43. package/dist/cjs/wm-textarea.cjs.entry.js +94 -0
  44. package/dist/cjs/wm-timepicker.cjs.entry.js +313 -0
  45. package/dist/cjs/wm-toggletip.cjs.entry.js +252 -0
  46. package/dist/cjs/wm-uploader.cjs.entry.js +341 -0
  47. package/dist/cjs/wm-wrapper.cjs.entry.js +21 -0
  48. package/dist/collection/collection-manifest.json +201 -0
  49. package/dist/collection/components/charts/chartFunctions.js +833 -0
  50. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.css +995 -0
  51. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +340 -0
  52. package/dist/collection/components/charts/priv-chart-popover-old/priv-chart-popover-old.css +990 -0
  53. package/dist/collection/components/charts/priv-chart-popover-old/priv-chart-popover-old.js +263 -0
  54. package/dist/collection/components/charts/wm-chart/wm-chart-slice.js +125 -0
  55. package/dist/collection/components/charts/wm-chart/wm-chart.css +1326 -0
  56. package/dist/collection/components/charts/wm-chart/wm-chart.js +422 -0
  57. package/dist/collection/components/charts/wm-chart-bar/wm-chart-bar.css +1116 -0
  58. package/dist/collection/components/charts/wm-chart-bar/wm-chart-bar.js +579 -0
  59. package/dist/collection/components/charts/wm-chart-column/wm-chart-column.css +1169 -0
  60. package/dist/collection/components/charts/wm-chart-column/wm-chart-column.js +688 -0
  61. package/dist/collection/components/charts/wm-chart-legend/wm-chart-legend.css +932 -0
  62. package/dist/collection/components/charts/wm-chart-legend/wm-chart-legend.js +194 -0
  63. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.css +1208 -0
  64. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.js +862 -0
  65. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.css +1326 -0
  66. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +264 -0
  67. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.css +967 -0
  68. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +151 -0
  69. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-slice.js +121 -0
  70. package/dist/collection/components/datepickers/datepicker.css +1137 -0
  71. package/dist/collection/components/datepickers/priv-calendar/priv-calendar.css +1403 -0
  72. package/dist/collection/components/datepickers/priv-calendar/priv-calendar.js +881 -0
  73. package/dist/collection/components/datepickers/wm-date-range.js +870 -0
  74. package/dist/collection/components/datepickers/wm-datepicker.js +579 -0
  75. package/dist/collection/components/selects/priv-option-list/priv-option-list.css +999 -0
  76. package/dist/collection/components/selects/priv-option-list/priv-option-list.js +778 -0
  77. package/dist/collection/components/selects/wm-nested-select/wm-nested-select.css +1259 -0
  78. package/dist/collection/components/selects/wm-nested-select/wm-nested-select.js +626 -0
  79. package/dist/collection/components/selects/wm-optgroup/wm-optgroup.css +909 -0
  80. package/dist/collection/components/selects/wm-optgroup/wm-optgroup.js +258 -0
  81. package/dist/collection/components/selects/wm-option/wm-option.css +1033 -0
  82. package/dist/collection/components/selects/wm-option/wm-option.js +530 -0
  83. package/dist/collection/components/selects/wm-select/wm-select.css +1187 -0
  84. package/dist/collection/components/selects/wm-select/wm-select.js +705 -0
  85. package/dist/collection/components/wm-action-menu/wm-action-menu.css +1686 -0
  86. package/dist/collection/components/wm-action-menu/wm-action-menu.js +610 -0
  87. package/dist/collection/components/wm-button/wm-button.css +1627 -0
  88. package/dist/collection/components/wm-button/wm-button.js +555 -0
  89. package/dist/collection/components/wm-file/wm-file.css +1086 -0
  90. package/dist/collection/components/wm-file/wm-file.js +428 -0
  91. package/dist/collection/components/wm-file-list/wm-file-list.css +899 -0
  92. package/dist/collection/components/wm-file-list/wm-file-list.js +45 -0
  93. package/dist/collection/components/wm-flyout/wm-flyout.css +1117 -0
  94. package/dist/collection/components/wm-flyout/wm-flyout.js +449 -0
  95. package/dist/collection/components/wm-input/wm-input.css +1089 -0
  96. package/dist/collection/components/wm-input/wm-input.js +477 -0
  97. package/dist/collection/components/wm-menuitem/wm-menuitem.css +982 -0
  98. package/dist/collection/components/wm-menuitem/wm-menuitem.js +416 -0
  99. package/dist/collection/components/wm-modal/wm-modal-footer.css +927 -0
  100. package/dist/collection/components/wm-modal/wm-modal-footer.js +142 -0
  101. package/dist/collection/components/wm-modal/wm-modal-header.css +926 -0
  102. package/dist/collection/components/wm-modal/wm-modal-header.js +79 -0
  103. package/dist/collection/components/wm-modal/wm-modal.css +983 -0
  104. package/dist/collection/components/wm-modal/wm-modal.js +356 -0
  105. package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.css +931 -0
  106. package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.js +138 -0
  107. package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.css +925 -0
  108. package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.js +82 -0
  109. package/dist/collection/components/wm-modal-pss/wm-modal-pss.css +1007 -0
  110. package/dist/collection/components/wm-modal-pss/wm-modal-pss.js +365 -0
  111. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.css +926 -0
  112. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +119 -0
  113. package/dist/collection/components/wm-navigation/wm-navigation-item.css +935 -0
  114. package/dist/collection/components/wm-navigation/wm-navigation-item.js +98 -0
  115. package/dist/collection/components/wm-navigation/wm-navigation.css +977 -0
  116. package/dist/collection/components/wm-navigation/wm-navigation.js +190 -0
  117. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.css +929 -0
  118. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +86 -0
  119. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.css +918 -0
  120. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +124 -0
  121. package/dist/collection/components/wm-navigator/wm-navigator.css +990 -0
  122. package/dist/collection/components/wm-navigator/wm-navigator.js +503 -0
  123. package/dist/collection/components/wm-pagination/wm-pagination.css +1044 -0
  124. package/dist/collection/components/wm-pagination/wm-pagination.js +382 -0
  125. package/dist/collection/components/wm-search/wm-search.css +977 -0
  126. package/dist/collection/components/wm-search/wm-search.js +429 -0
  127. package/dist/collection/components/wm-snackbar/wm-snackbar.css +1150 -0
  128. package/dist/collection/components/wm-snackbar/wm-snackbar.js +263 -0
  129. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.css +958 -0
  130. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +166 -0
  131. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.css +966 -0
  132. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +357 -0
  133. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.css +906 -0
  134. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +87 -0
  135. package/dist/collection/components/wm-tag-input/wm-tag-input.css +1420 -0
  136. package/dist/collection/components/wm-tag-input/wm-tag-input.js +1288 -0
  137. package/dist/collection/components/wm-tag-input/wm-tag-option/wm-tag-option.js +243 -0
  138. package/dist/collection/components/wm-textarea/wm-textarea.css +1065 -0
  139. package/dist/collection/components/wm-textarea/wm-textarea.js +319 -0
  140. package/dist/collection/components/wm-timepicker/wm-timepicker.css +1164 -0
  141. package/dist/collection/components/wm-timepicker/wm-timepicker.js +553 -0
  142. package/dist/collection/components/wm-toggletip/wm-toggletip.css +1296 -0
  143. package/dist/collection/components/wm-toggletip/wm-toggletip.js +376 -0
  144. package/dist/collection/components/wm-uploader/wm-uploader.css +1984 -0
  145. package/dist/collection/components/wm-uploader/wm-uploader.js +619 -0
  146. package/dist/collection/components/wm-wrapper/wm-wrapper.js +28 -0
  147. package/dist/collection/dev/action-menu.js +18 -0
  148. package/dist/collection/dev/button.js +0 -0
  149. package/dist/collection/dev/chart-bar.js +423 -0
  150. package/dist/collection/dev/chart-column.js +437 -0
  151. package/dist/collection/dev/chart-small.js +56 -0
  152. package/dist/collection/dev/chart.js +18 -0
  153. package/dist/collection/dev/date-range.js +6 -0
  154. package/dist/collection/dev/datepicker.js +46 -0
  155. package/dist/collection/dev/file-list.js +16 -0
  156. package/dist/collection/dev/file.js +0 -0
  157. package/dist/collection/dev/flyout.js +194 -0
  158. package/dist/collection/dev/input.js +6 -0
  159. package/dist/collection/dev/line-chart.js +45 -0
  160. package/dist/collection/dev/modal.js +48 -0
  161. package/dist/collection/dev/navigation.js +13 -0
  162. package/dist/collection/dev/navigator.js +34 -0
  163. package/dist/collection/dev/nested-select.js +36 -0
  164. package/dist/collection/dev/pagination.js +7 -0
  165. package/dist/collection/dev/progress-monitor.js +0 -0
  166. package/dist/collection/dev/pss-modal.js +8 -0
  167. package/dist/collection/dev/scripts.js +49 -0
  168. package/dist/collection/dev/search.js +72 -0
  169. package/dist/collection/dev/select.js +57 -0
  170. package/dist/collection/dev/snackbar.js +68 -0
  171. package/dist/collection/dev/tabs.js +44 -0
  172. package/dist/collection/dev/tag-input.js +32 -0
  173. package/dist/collection/dev/textarea.js +28 -0
  174. package/dist/collection/dev/timepicker.js +32 -0
  175. package/dist/collection/dev/toggletip.js +9 -0
  176. package/dist/collection/dev/uploader.js +139 -0
  177. package/dist/collection/global/__mocks__/functions.js +6 -0
  178. package/dist/collection/global/functions.js +902 -0
  179. package/dist/{ripple/app-globals-B7cOtGhY.js → collection/global/global.js} +16 -87
  180. package/dist/{ripple/interfaces-CrANcZM9.js → collection/global/interfaces.js} +25 -6
  181. package/dist/collection/global/intl.js +274 -0
  182. package/dist/collection/global/services/__mocks__/http-service.js +130 -0
  183. package/dist/collection/global/services/http-service.js +50 -0
  184. package/dist/collection/lang/lang.js +5 -0
  185. package/dist/collection/lang/missing.js +43 -0
  186. package/dist/collection/lang/piglatin.js +101 -0
  187. package/dist/esm/app-globals-d0ca31a6.js +101 -0
  188. package/dist/{ripple/chartFunctions-CmeM8Tyx.js → esm/chartFunctions-4bc77b76.js} +161 -3
  189. package/dist/esm/functions-de887809.js +10635 -0
  190. package/dist/esm/index-ef50bc01.js +1849 -0
  191. package/dist/esm/index.js +1 -0
  192. package/dist/esm/interfaces-7e50d034.js +55 -0
  193. package/dist/{ripple/intl-7p27BJSM.js → esm/intl-56b47a7b.js} +3 -3
  194. package/dist/esm/loader.js +11 -0
  195. package/dist/esm/polyfills/core-js.js +11 -0
  196. package/dist/esm/polyfills/dom.js +79 -0
  197. package/dist/esm/polyfills/es5-html-element.js +1 -0
  198. package/dist/esm/polyfills/index.js +34 -0
  199. package/dist/esm/polyfills/system.js +6 -0
  200. package/dist/esm/priv-calendar.entry.js +604 -0
  201. package/dist/esm/priv-chart-popover-old.entry.js +142 -0
  202. package/dist/esm/priv-chart-popover_2.entry.js +189 -0
  203. package/dist/{ripple/wm-modal-header.entry.js → esm/priv-navigator-button.entry.js} +14 -25
  204. package/dist/{ripple/wm-toggletip.entry.js → esm/priv-navigator-item.entry.js} +19 -164
  205. package/dist/{ripple/wm-option.entry.js → esm/priv-option-list.entry.js} +345 -129
  206. package/dist/esm/ripple.js +20 -0
  207. package/dist/esm/wm-action-menu_2.entry.js +482 -0
  208. package/dist/esm/wm-button.entry.js +269 -0
  209. package/dist/esm/wm-chart-bar.entry.js +437 -0
  210. package/dist/esm/wm-chart-column.entry.js +540 -0
  211. package/dist/{ripple → esm}/wm-chart-slice.entry.js +6 -1
  212. package/dist/esm/wm-chart.entry.js +159 -0
  213. package/dist/esm/wm-date-range.entry.js +522 -0
  214. package/dist/esm/wm-datepicker.entry.js +319 -0
  215. package/dist/esm/wm-file-list.entry.js +19 -0
  216. package/dist/esm/wm-file.entry.js +206 -0
  217. package/dist/esm/wm-flyout.entry.js +177 -0
  218. package/dist/esm/wm-input.entry.js +127 -0
  219. package/dist/esm/wm-line-chart.entry.js +537 -0
  220. package/dist/esm/wm-modal-pss_3.entry.js +214 -0
  221. package/dist/esm/wm-modal_3.entry.js +217 -0
  222. package/dist/esm/wm-navigation_3.entry.js +182 -0
  223. package/dist/esm/wm-navigator.entry.js +330 -0
  224. package/dist/{ripple/wm-flyout.entry.js → esm/wm-nested-select.entry.js} +281 -132
  225. package/dist/esm/wm-optgroup.entry.js +70 -0
  226. package/dist/esm/wm-option_2.entry.js +530 -0
  227. package/dist/esm/wm-pagination.entry.js +225 -0
  228. package/dist/esm/wm-progress-indicator_3.entry.js +198 -0
  229. package/dist/esm/wm-search.entry.js +192 -0
  230. package/dist/esm/wm-snackbar.entry.js +172 -0
  231. package/dist/esm/wm-tab-item_3.entry.js +351 -0
  232. package/dist/esm/wm-tag-input.entry.js +949 -0
  233. package/dist/{ripple → esm}/wm-tag-option.entry.js +6 -2
  234. package/dist/esm/wm-textarea.entry.js +90 -0
  235. package/dist/esm/wm-timepicker.entry.js +309 -0
  236. package/dist/esm/wm-toggletip.entry.js +248 -0
  237. package/dist/esm/wm-uploader.entry.js +337 -0
  238. package/dist/{ripple → esm}/wm-wrapper.entry.js +1 -1
  239. package/dist/esm-es5/app-globals-d0ca31a6.js +1 -0
  240. package/dist/esm-es5/chartFunctions-4bc77b76.js +1 -0
  241. package/dist/esm-es5/functions-de887809.js +1 -0
  242. package/dist/esm-es5/index-ef50bc01.js +1 -0
  243. package/dist/esm-es5/index.js +0 -0
  244. package/dist/esm-es5/interfaces-7e50d034.js +1 -0
  245. package/dist/esm-es5/intl-56b47a7b.js +1 -0
  246. package/dist/esm-es5/loader.js +1 -0
  247. package/dist/esm-es5/priv-calendar.entry.js +1 -0
  248. package/dist/esm-es5/priv-chart-popover-old.entry.js +1 -0
  249. package/dist/esm-es5/priv-chart-popover_2.entry.js +1 -0
  250. package/dist/esm-es5/priv-navigator-button.entry.js +1 -0
  251. package/dist/esm-es5/priv-navigator-item.entry.js +1 -0
  252. package/dist/esm-es5/priv-option-list.entry.js +1 -0
  253. package/dist/esm-es5/ripple.js +1 -0
  254. package/dist/esm-es5/wm-action-menu_2.entry.js +1 -0
  255. package/dist/esm-es5/wm-button.entry.js +1 -0
  256. package/dist/esm-es5/wm-chart-bar.entry.js +1 -0
  257. package/dist/esm-es5/wm-chart-column.entry.js +1 -0
  258. package/dist/esm-es5/wm-chart-slice.entry.js +1 -0
  259. package/dist/esm-es5/wm-chart.entry.js +1 -0
  260. package/dist/esm-es5/wm-date-range.entry.js +1 -0
  261. package/dist/esm-es5/wm-datepicker.entry.js +1 -0
  262. package/dist/{ripple/wm-tab-item.entry.js → esm-es5/wm-file-list.entry.js} +1 -63
  263. package/dist/esm-es5/wm-file.entry.js +1 -0
  264. package/dist/esm-es5/wm-flyout.entry.js +1 -0
  265. package/dist/esm-es5/wm-input.entry.js +1 -0
  266. package/dist/esm-es5/wm-line-chart.entry.js +1 -0
  267. package/dist/esm-es5/wm-modal-pss_3.entry.js +1 -0
  268. package/dist/esm-es5/wm-modal_3.entry.js +1 -0
  269. package/dist/esm-es5/wm-navigation_3.entry.js +1 -0
  270. package/dist/esm-es5/wm-navigator.entry.js +1 -0
  271. package/dist/esm-es5/wm-nested-select.entry.js +1 -0
  272. package/dist/{ripple/wm-chart.entry.js → esm-es5/wm-optgroup.entry.js} +1 -157
  273. package/dist/esm-es5/wm-option_2.entry.js +1 -0
  274. package/dist/esm-es5/wm-pagination.entry.js +1 -0
  275. package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -0
  276. package/dist/esm-es5/wm-search.entry.js +1 -0
  277. package/dist/esm-es5/wm-snackbar.entry.js +1 -0
  278. package/dist/esm-es5/wm-tab-item_3.entry.js +1 -0
  279. package/dist/esm-es5/wm-tag-input.entry.js +1 -0
  280. package/dist/esm-es5/wm-tag-option.entry.js +1 -0
  281. package/dist/esm-es5/wm-textarea.entry.js +1 -0
  282. package/dist/esm-es5/wm-timepicker.entry.js +1 -0
  283. package/dist/esm-es5/wm-toggletip.entry.js +1 -0
  284. package/dist/esm-es5/wm-uploader.entry.js +1 -0
  285. package/dist/esm-es5/wm-wrapper.entry.js +1 -0
  286. package/dist/index.cjs.js +1 -0
  287. package/dist/index.js +1 -0
  288. package/dist/loader/cdn.js +2 -0
  289. package/dist/loader/index.cjs.js +2 -0
  290. package/dist/loader/index.d.ts +24 -0
  291. package/dist/loader/index.es2017.js +2 -0
  292. package/dist/loader/index.js +3 -0
  293. package/dist/loader/package.json +11 -0
  294. package/dist/ripple/index.esm.js +0 -1
  295. package/dist/ripple/p-03a6850a.entry.js +1 -0
  296. package/dist/ripple/{wm-select.entry.js → p-0c3162d5.system.entry.js} +1 -249
  297. package/dist/ripple/{wm-file.entry.js → p-0ec71f08.system.entry.js} +1 -182
  298. package/dist/ripple/p-1032c0db.system.entry.js +1 -0
  299. package/dist/ripple/p-117c3d78.system.js +2 -0
  300. package/dist/ripple/p-12024d3b.system.entry.js +1 -0
  301. package/dist/ripple/p-13152ac1.system.entry.js +1 -0
  302. package/dist/ripple/p-1318ae67.entry.js +1 -0
  303. package/dist/ripple/p-137bf0c0.system.entry.js +1 -0
  304. package/dist/ripple/{priv-navigator-item.entry.js → p-13bb6faf.entry.js} +1 -30
  305. package/dist/ripple/p-16ff8110.entry.js +1 -0
  306. package/dist/ripple/{wm-navigation-item.entry.js → p-1825d519.system.entry.js} +1 -18
  307. package/dist/ripple/p-18417851.entry.js +1 -0
  308. package/dist/ripple/p-1c655f6b.entry.js +1 -0
  309. package/dist/ripple/p-1ce77857.system.entry.js +1 -0
  310. package/dist/ripple/p-1d76061a.entry.js +1 -0
  311. package/dist/ripple/p-22b57f73.system.entry.js +1 -0
  312. package/dist/ripple/p-24dfbf1d.system.entry.js +1 -0
  313. package/dist/ripple/p-28996d67.system.entry.js +1 -0
  314. package/dist/ripple/p-30118d12.system.entry.js +1 -0
  315. package/dist/ripple/p-32f3581a.entry.js +1 -0
  316. package/dist/ripple/p-334d8711.system.js +1 -0
  317. package/dist/ripple/p-3c8c5933.js +1 -0
  318. package/dist/ripple/{wm-uploader.entry.js → p-436bf381.system.entry.js} +1 -313
  319. package/dist/ripple/p-43843597.system.entry.js +1 -0
  320. package/dist/ripple/p-45999149.system.js +1 -0
  321. package/dist/ripple/p-48b596ae.entry.js +1 -0
  322. package/dist/ripple/p-4bab5360.system.js +1 -0
  323. package/dist/ripple/{wm-progress-monitor.entry.js → p-4ff0db4d.entry.js} +1 -71
  324. package/dist/ripple/p-50ea2036.system.js +1 -0
  325. package/dist/ripple/p-57f1bafd.system.entry.js +1 -0
  326. package/dist/ripple/p-5b0e9165.entry.js +1 -0
  327. package/dist/ripple/p-6266fcbf.system.entry.js +1 -0
  328. package/dist/ripple/p-646e22d3.system.entry.js +1 -0
  329. package/dist/ripple/p-6950e8ed.system.js +1 -0
  330. package/dist/ripple/p-6c6da5db.entry.js +1 -0
  331. package/dist/ripple/p-6d2af8d9.system.entry.js +1 -0
  332. package/dist/ripple/p-6d46f775.system.entry.js +1 -0
  333. package/dist/ripple/p-6de0efee.entry.js +1 -0
  334. package/dist/ripple/p-7833db63.entry.js +1 -0
  335. package/dist/ripple/p-7b7c32af.entry.js +1 -0
  336. package/dist/ripple/p-817aa29c.entry.js +1 -0
  337. package/dist/ripple/p-82c9bd47.entry.js +1 -0
  338. package/dist/ripple/p-8480138d.entry.js +1 -0
  339. package/dist/ripple/p-85ef702d.entry.js +1 -0
  340. package/dist/ripple/{priv-calendar.entry.js → p-86bcd942.system.entry.js} +1 -566
  341. package/dist/ripple/p-8799bce9.entry.js +1 -0
  342. package/dist/ripple/p-8ac14bb1.system.js +1 -0
  343. package/dist/ripple/p-8dcc8c0c.entry.js +1 -0
  344. package/dist/ripple/p-8fa572a8.entry.js +1 -0
  345. package/dist/ripple/p-904545cc.js +1 -0
  346. package/dist/ripple/p-90cb5d27.system.entry.js +1 -0
  347. package/dist/ripple/{wm-datepicker.entry.js → p-9202ef69.system.entry.js} +1 -247
  348. package/dist/ripple/p-9f971522.system.entry.js +1 -0
  349. package/dist/ripple/p-a5dc49c1.system.entry.js +1 -0
  350. package/dist/ripple/p-a73fb160.system.entry.js +1 -0
  351. package/dist/ripple/p-a9580e7a.system.entry.js +1 -0
  352. package/dist/ripple/p-b04a6351.entry.js +1 -0
  353. package/dist/ripple/p-b09998e1.entry.js +1 -0
  354. package/dist/ripple/{priv-option-list.entry.js → p-b3a86ec4.system.entry.js} +1 -385
  355. package/dist/ripple/p-b501f06c.entry.js +1 -0
  356. package/dist/ripple/p-b957033b.entry.js +1 -0
  357. package/dist/ripple/p-c2258438.entry.js +1 -0
  358. package/dist/ripple/p-ca3abcc0.system.entry.js +1 -0
  359. package/dist/ripple/p-cc455a6c.system.entry.js +1 -0
  360. package/dist/ripple/p-cda66d45.js +1 -0
  361. package/dist/ripple/p-cde2ca4d.system.entry.js +1 -0
  362. package/dist/ripple/p-cdf9c0e9.entry.js +1 -0
  363. package/dist/ripple/p-d0858afa.js +2 -0
  364. package/dist/ripple/p-d37f8f66.js +1 -0
  365. package/dist/ripple/p-d4ae193e.js +1 -0
  366. package/dist/ripple/p-d4d769a7.system.js +1 -0
  367. package/dist/ripple/p-d6a9000f.system.entry.js +1 -0
  368. package/dist/ripple/{wm-navigation-hamburger.entry.js → p-d6cd9f79.entry.js} +1 -48
  369. package/dist/ripple/p-d9e4335e.entry.js +1 -0
  370. package/dist/ripple/p-dadf3ed3.entry.js +1 -0
  371. package/dist/ripple/p-dc3684b5.entry.js +1 -0
  372. package/dist/ripple/p-dca94e24.entry.js +1 -0
  373. package/dist/ripple/p-dcd6acc5.system.entry.js +1 -0
  374. package/dist/ripple/p-dd81e308.entry.js +1 -0
  375. package/dist/ripple/p-e11d9b06.system.entry.js +1 -0
  376. package/dist/ripple/{wm-nested-select.entry.js → p-e36e71dc.system.entry.js} +1 -308
  377. package/dist/ripple/p-e6a81600.entry.js +1 -0
  378. package/dist/ripple/p-ef7d84da.system.entry.js +1 -0
  379. package/dist/ripple/p-f1de3153.entry.js +1 -0
  380. package/dist/ripple/p-f3e84476.system.entry.js +1 -0
  381. package/dist/ripple/{wm-snackbar.entry.js → p-f4d27fea.system.entry.js} +1 -185
  382. package/dist/ripple/p-fcf4bd61.system.entry.js +1 -0
  383. package/dist/ripple/p-fd02c124.entry.js +1 -0
  384. package/dist/ripple/p-ffa20853.entry.js +1 -0
  385. package/dist/ripple/ripple.esm.js +1 -48
  386. package/dist/ripple/ripple.js +127 -0
  387. package/dist/types/components/charts/chartFunctions.d.ts +15 -2
  388. package/dist/types/components/charts/priv-chart-popover/priv-chart-popover.d.ts +20 -11
  389. package/dist/types/components/charts/priv-chart-popover-old/priv-chart-popover-old.d.ts +26 -0
  390. package/dist/types/components/charts/wm-chart/wm-chart.d.ts +1 -1
  391. package/dist/types/components/charts/wm-chart-bar/wm-chart-bar.d.ts +62 -0
  392. package/dist/types/components/charts/wm-chart-column/wm-chart-column.d.ts +73 -0
  393. package/dist/types/components/charts/wm-chart-legend/wm-chart-legend.d.ts +26 -0
  394. package/dist/types/components/charts/wm-line-chart/wm-line-chart.d.ts +21 -11
  395. package/dist/types/components/charts/wm-progress-monitor/wm-progress-indicator.d.ts +1 -1
  396. package/dist/types/components/datepickers/priv-calendar/priv-calendar.d.ts +13 -1
  397. package/dist/types/components/datepickers/wm-date-range.d.ts +13 -13
  398. package/dist/types/components/datepickers/wm-datepicker.d.ts +14 -9
  399. package/dist/types/components/selects/wm-nested-select/wm-nested-select.d.ts +2 -1
  400. package/dist/types/components/selects/wm-select/wm-select.d.ts +23 -12
  401. package/dist/types/components/wm-action-menu/wm-action-menu.d.ts +16 -2
  402. package/dist/types/components/wm-button/wm-button.d.ts +5 -0
  403. package/dist/types/components/wm-file/wm-file.d.ts +4 -1
  404. package/dist/types/components/wm-flyout/wm-flyout.d.ts +1 -0
  405. package/dist/types/components/wm-input/wm-input.d.ts +2 -1
  406. package/dist/types/components/wm-modal/wm-modal.d.ts +1 -0
  407. package/dist/types/components/wm-modal-pss/wm-modal-pss.d.ts +2 -0
  408. package/dist/types/components/wm-navigation/wm-navigation.d.ts +1 -0
  409. package/dist/types/components/wm-navigator/wm-navigator.d.ts +1 -1
  410. package/dist/types/components/wm-pagination/wm-pagination.d.ts +2 -1
  411. package/dist/types/components/wm-search/wm-search.d.ts +1 -1
  412. package/dist/types/components/wm-snackbar/wm-snackbar.d.ts +0 -1
  413. package/dist/types/components/wm-tabs/wm-tab-item/wm-tab-item.d.ts +3 -1
  414. package/dist/types/components/wm-tabs/wm-tab-list/wm-tab-list.d.ts +15 -22
  415. package/dist/types/components/wm-tag-input/wm-tag-input.d.ts +5 -1
  416. package/dist/types/components/wm-textarea/wm-textarea.d.ts +1 -0
  417. package/dist/types/components/wm-timepicker/wm-timepicker.d.ts +1 -0
  418. package/dist/types/components/wm-toggletip/wm-toggletip.d.ts +14 -2
  419. package/dist/types/components/wm-uploader/wm-uploader.d.ts +4 -3
  420. package/dist/types/components.d.ts +181 -33
  421. package/dist/types/global/functions.d.ts +6 -2
  422. package/dist/types/global/interfaces.d.ts +59 -2
  423. package/dist/types/stencil-public-runtime.d.ts +0 -28
  424. package/package.json +6 -31
  425. package/dist/components/index.d.ts +0 -33
  426. package/dist/components/priv-calendar.d.ts +0 -11
  427. package/dist/components/priv-chart-popover.d.ts +0 -11
  428. package/dist/components/priv-navigator-button.d.ts +0 -11
  429. package/dist/components/priv-navigator-item.d.ts +0 -11
  430. package/dist/components/priv-option-list.d.ts +0 -11
  431. package/dist/components/wm-action-menu.d.ts +0 -11
  432. package/dist/components/wm-button.d.ts +0 -11
  433. package/dist/components/wm-chart-slice.d.ts +0 -11
  434. package/dist/components/wm-chart.d.ts +0 -11
  435. package/dist/components/wm-date-range.d.ts +0 -11
  436. package/dist/components/wm-datepicker.d.ts +0 -11
  437. package/dist/components/wm-file-list.d.ts +0 -11
  438. package/dist/components/wm-file.d.ts +0 -11
  439. package/dist/components/wm-flyout.d.ts +0 -11
  440. package/dist/components/wm-input.d.ts +0 -11
  441. package/dist/components/wm-line-chart.d.ts +0 -11
  442. package/dist/components/wm-menuitem.d.ts +0 -11
  443. package/dist/components/wm-modal-footer.d.ts +0 -11
  444. package/dist/components/wm-modal-header.d.ts +0 -11
  445. package/dist/components/wm-modal-pss-footer.d.ts +0 -11
  446. package/dist/components/wm-modal-pss-header.d.ts +0 -11
  447. package/dist/components/wm-modal-pss.d.ts +0 -11
  448. package/dist/components/wm-modal.d.ts +0 -11
  449. package/dist/components/wm-navigation-hamburger.d.ts +0 -11
  450. package/dist/components/wm-navigation-item.d.ts +0 -11
  451. package/dist/components/wm-navigation.d.ts +0 -11
  452. package/dist/components/wm-navigator.d.ts +0 -11
  453. package/dist/components/wm-nested-select.d.ts +0 -11
  454. package/dist/components/wm-optgroup.d.ts +0 -11
  455. package/dist/components/wm-option.d.ts +0 -11
  456. package/dist/components/wm-pagination.d.ts +0 -11
  457. package/dist/components/wm-progress-indicator.d.ts +0 -11
  458. package/dist/components/wm-progress-monitor.d.ts +0 -11
  459. package/dist/components/wm-progress-slice.d.ts +0 -11
  460. package/dist/components/wm-search.d.ts +0 -11
  461. package/dist/components/wm-select.d.ts +0 -11
  462. package/dist/components/wm-snackbar.d.ts +0 -11
  463. package/dist/components/wm-tab-item.d.ts +0 -11
  464. package/dist/components/wm-tab-list.d.ts +0 -11
  465. package/dist/components/wm-tab-panel.d.ts +0 -11
  466. package/dist/components/wm-tag-input.d.ts +0 -11
  467. package/dist/components/wm-tag-option.d.ts +0 -11
  468. package/dist/components/wm-textarea.d.ts +0 -11
  469. package/dist/components/wm-timepicker.d.ts +0 -11
  470. package/dist/components/wm-toggletip.d.ts +0 -11
  471. package/dist/components/wm-uploader.d.ts +0 -11
  472. package/dist/components/wm-wrapper.d.ts +0 -11
  473. package/dist/ripple/index-CU5QNCKv.js +0 -4167
  474. package/dist/ripple/priv-chart-popover.entry.js +0 -134
  475. package/dist/ripple/priv-navigator-button.entry.js +0 -24
  476. package/dist/ripple/wm-action-menu.entry.js +0 -201
  477. package/dist/ripple/wm-button.entry.js +0 -197
  478. package/dist/ripple/wm-date-range.entry.js +0 -477
  479. package/dist/ripple/wm-file-list.entry.js +0 -18
  480. package/dist/ripple/wm-input.entry.js +0 -111
  481. package/dist/ripple/wm-line-chart.entry.js +0 -449
  482. package/dist/ripple/wm-menuitem.entry.js +0 -125
  483. package/dist/ripple/wm-modal-pss-footer.entry.js +0 -40
  484. package/dist/ripple/wm-modal-pss-header.entry.js +0 -39
  485. package/dist/ripple/wm-modal-pss.entry.js +0 -135
  486. package/dist/ripple/wm-modal.entry.js +0 -133
  487. package/dist/ripple/wm-navigation.entry.js +0 -116
  488. package/dist/ripple/wm-optgroup.entry.js +0 -68
  489. package/dist/ripple/wm-pagination.entry.js +0 -223
  490. package/dist/ripple/wm-progress-indicator.entry.js +0 -107
  491. package/dist/ripple/wm-progress-slice.entry.js +0 -13
  492. package/dist/ripple/wm-tab-list.entry.js +0 -175
  493. package/dist/ripple/wm-tab-panel.entry.js +0 -32
  494. package/dist/ripple/wm-tag-input.entry.js +0 -877
  495. package/dist/ripple/wm-textarea.entry.js +0 -79
  496. package/dist/ripple/wm-timepicker.entry.js +0 -300
@@ -0,0 +1,908 @@
1
+ 'use strict';
2
+
3
+ const index = require('./index-786066a1.js');
4
+ const functions = require('./functions-b188d5b3.js');
5
+
6
+ const colors = {
7
+ salmon: "#ff5f4e",
8
+ cyan: "#19a1a9",
9
+ forest: "#088000",
10
+ sleet: "#7f97ad",
11
+ midnight: "#2e1b46",
12
+ lavender: "#8b86ca",
13
+ periwinkle: "#575195",
14
+ gray: "#6b6b6b",
15
+ };
16
+ const allChartsDetails = {
17
+ // for progress monitor
18
+ doughnut: {
19
+ size: 155,
20
+ colors: [colors.forest, colors.gray],
21
+ thickness: 0.73,
22
+ padding: 25,
23
+ category: "doughnut",
24
+ },
25
+ doughnut1: {
26
+ size: 130,
27
+ colors: [colors.lavender, colors.midnight, colors.gray],
28
+ thickness: 0.5,
29
+ padding: 90,
30
+ category: "doughnut",
31
+ },
32
+ doughnut2: {
33
+ size: 130,
34
+ colors: [colors.periwinkle, colors.cyan, colors.midnight, colors.salmon, colors.gray],
35
+ thickness: 0.5,
36
+ padding: 90,
37
+ category: "doughnut",
38
+ },
39
+ doughnut3: {
40
+ size: 130,
41
+ colors: [colors.lavender, colors.midnight, "#0089e4", colors.forest, "#ea8500", "#d54f41", "#146ca9"],
42
+ thickness: 0.5,
43
+ padding: 90,
44
+ category: "doughnut",
45
+ },
46
+ // for progress monitor
47
+ bar: {
48
+ size: 350,
49
+ colors: [colors.forest, colors.gray],
50
+ padding: 0,
51
+ category: "stackedBar",
52
+ },
53
+ bar2: {
54
+ size: 400,
55
+ colors: [colors.gray, colors.lavender, colors.periwinkle, colors.midnight, colors.cyan, colors.salmon],
56
+ padding: 0,
57
+ category: "stackedBar",
58
+ },
59
+ bar3: {
60
+ size: 300,
61
+ colors: ["#0d696e", colors.cyan, "#8e4129", colors.salmon],
62
+ padding: 0,
63
+ category: "stackedBar",
64
+ },
65
+ bar4: {
66
+ size: 400,
67
+ colors: [colors.salmon, colors.cyan, colors.periwinkle],
68
+ padding: 0,
69
+ category: "stackedBar",
70
+ },
71
+ bar5: {
72
+ size: 400,
73
+ colors: [
74
+ colors.gray, // this is only used if prop notStartedColor is set
75
+ colors.lavender,
76
+ colors.midnight,
77
+ "#0089e4",
78
+ colors.forest,
79
+ "#ea8500",
80
+ "#d54f41",
81
+ "#146ca9",
82
+ ],
83
+ padding: 0,
84
+ category: "stackedBar",
85
+ },
86
+ bar6: {
87
+ size: 400,
88
+ colors: [colors.lavender],
89
+ padding: 0,
90
+ category: "simpleBar",
91
+ },
92
+ bar7: {
93
+ size: 400,
94
+ colors: [colors.periwinkle, colors.cyan, colors.salmon, colors.gray],
95
+ padding: 0,
96
+ category: "simpleBar",
97
+ },
98
+ };
99
+ function showValue(valueFormat) {
100
+ return valueFormat === "percentage" || valueFormat === "amount" ? "show-values" : "";
101
+ }
102
+ const textHiddenMessage = functions.intl.formatMessage({
103
+ id: "chart.hiddenValues",
104
+ defaultMessage: "Values are hidden when too close together.",
105
+ description: "Text displayed when a chart has some values hidden",
106
+ });
107
+ const seeDetailsMessage = functions.intl.formatMessage({
108
+ id: "chart.clickToSeeDetails",
109
+ defaultMessage: "Click or use arrow keys to see details.",
110
+ description: "Text displayed, guiding user to interact to see more details.",
111
+ });
112
+ function abbrNumber(num) {
113
+ return num > 999 || num < -999 ? Math.round(num / 100) / 10 + "K" : num;
114
+ }
115
+ function amountToPercent(val, total, asInt) {
116
+ return asInt ? Math.round((val * 100) / total) : Math.round((val * 10000) / total) / 100; // with 2 decimals
117
+ }
118
+ function amountToDegree(val, total) {
119
+ // In a circle of {total}, determine degrees of slice {val}
120
+ return (val * 360) / total;
121
+ }
122
+ function toFixed(number) {
123
+ return parseFloat((Math.floor(number * 100) / 100).toFixed(2));
124
+ }
125
+ function polarToCartesian(half, radius, startAngle, endAngle) {
126
+ var x = toFixed(half + half * radius * Math.cos((Math.PI * startAngle) / 180));
127
+ var y = toFixed(half + half * radius * Math.sin((Math.PI * startAngle) / 180));
128
+ if (endAngle !== undefined) {
129
+ // if a 2nd angle value was passed, return 2 pairs of coords
130
+ var x2 = toFixed(half + half * radius * Math.cos((Math.PI * endAngle) / 180));
131
+ var y2 = toFixed(half + half * radius * Math.sin((Math.PI * endAngle) / 180));
132
+ return { x1: x, y1: y, x2, y2 };
133
+ }
134
+ return { x, y };
135
+ }
136
+ function getArc(radius, largeArcFlag, x, y, chartSize) {
137
+ var z = toFixed((chartSize / 2) * radius);
138
+ return `A ${z}, ${z} 0 ${largeArcFlag} ${toFixed(x)}, ${toFixed(y)}`;
139
+ }
140
+ function scale(val, inMin, inMax, outMin, outMax) {
141
+ let scaled = ((val - inMin) * (outMax - outMin)) / (inMax - inMin) + outMin;
142
+ // clip the values so that whatever is passed in the output is never smaller than outMin or greater than outMax
143
+ return scaled < outMin ? outMin : scaled > outMax ? outMax : scaled;
144
+ }
145
+ function minSpacing(width) {
146
+ // minimum spacing between 2 ticks, in px
147
+ return scale(width, 300, 900, 70, 150);
148
+ }
149
+ function getMaxTicks(width) {
150
+ return Math.round(width / minSpacing(width));
151
+ }
152
+ function getInterval(largest, maxticks) {
153
+ const minimum = largest / maxticks;
154
+ const magnitude = 10 ** Math.floor(Math.log10(minimum));
155
+ const residual = minimum / magnitude;
156
+ let interval;
157
+ if (residual > 5) {
158
+ interval = 10 * magnitude;
159
+ }
160
+ else if (residual > 3) {
161
+ interval = 5 * magnitude;
162
+ }
163
+ else if (residual > 2) {
164
+ interval = 3 * magnitude;
165
+ }
166
+ else if (residual > 1.5) {
167
+ interval = 2 * magnitude;
168
+ }
169
+ else if (residual > 1) {
170
+ interval = 1.5 * magnitude;
171
+ }
172
+ else {
173
+ interval = magnitude;
174
+ }
175
+ return interval;
176
+ }
177
+ function handleSliceKeyDown(ev) {
178
+ if (this.popoverEl && this.popoverEl.open && ev.key === "Enter") {
179
+ const popoverBtn = this.popoverEl.querySelector("button");
180
+ popoverBtn && popoverBtn.click();
181
+ }
182
+ }
183
+ function handleSliceClick(ev, s) {
184
+ if (this.popoverEl && !this.isTabbing) {
185
+ this.componentWrapperEl.classList.toggle("interactive-popover", !!s.buttonText);
186
+ s.coords = { x: ev.clientX, y: ev.clientY };
187
+ openPopover(this.popoverEl, s);
188
+ highlightSegmentInfo(Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex")), s);
189
+ }
190
+ }
191
+ function handleSliceFocus(ev, s) {
192
+ if (this.popoverEl && this.isTabbing) {
193
+ this.componentWrapperEl.classList.toggle("interactive-popover", !!s.buttonText);
194
+ this.focusedSliceId = s.id;
195
+ s.coords = functions.getPosition(ev.target);
196
+ s.coords.x = s.coords.x + 30;
197
+ s.coords.y = s.coords.y + 30;
198
+ openPopover(this.popoverEl, s);
199
+ highlightSegmentInfo(Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex")), s);
200
+ }
201
+ }
202
+ function handleChartKeydown(ev) {
203
+ switch (ev.key) {
204
+ // arrow up / left
205
+ case "ArrowUp":
206
+ case "ArrowLeft":
207
+ ev.preventDefault();
208
+ this.isTabbing = true; // shd already be true. just in case user clicked on chart then pressed an arrow key
209
+ focusPrevious.call(this);
210
+ break;
211
+ // arrow right / down
212
+ case "ArrowRight":
213
+ case "ArrowDown":
214
+ ev.preventDefault();
215
+ this.isTabbing = true; // shd already be true. just in case user clicked on chart then pressed an arrow key
216
+ focusNext.call(this);
217
+ break;
218
+ // tab
219
+ case "Tab":
220
+ exitChart.call(this);
221
+ break;
222
+ case "Escape":
223
+ this.popoverEl.open = false;
224
+ this.userIsNavigating = false;
225
+ break;
226
+ }
227
+ }
228
+ function openPopover(popoverEl, s) {
229
+ popoverEl.open = false;
230
+ if (s.title && s.text) {
231
+ popoverEl.sliceDetails = Object.assign({}, s);
232
+ window.setTimeout(() => (popoverEl.open = true), 30);
233
+ }
234
+ }
235
+ function focusNext() {
236
+ const activeEl = functions.checkForActiveElInShadow(document.activeElement);
237
+ const index =
238
+ // if the active el is not in the array the first element gets focused
239
+ (this.sliceEls.indexOf(activeEl) + 1) % this.sliceEls.length;
240
+ focusSlice.call(this, index);
241
+ }
242
+ function focusPrevious() {
243
+ if (this.sliceEls) {
244
+ const activeEl = functions.checkForActiveElInShadow(document.activeElement);
245
+ let index = this.sliceEls.indexOf(activeEl);
246
+ if (index === -1) {
247
+ // not in the array : focus the first slice
248
+ index = 0;
249
+ }
250
+ else if (index === 0) {
251
+ // first slice : focus the last slice
252
+ index = this.sliceEls.length - 1;
253
+ }
254
+ else {
255
+ // anything else: focus previous
256
+ index -= 1;
257
+ }
258
+ focusSlice.call(this, index);
259
+ }
260
+ }
261
+ function focusSlice(index) {
262
+ if (this.sliceEls && this.el) {
263
+ this.userIsNavigating = true;
264
+ // set tabindex of the wrapper to -1 while slices are being focused, to allow for shft-tabbing out of the component directly
265
+ this.componentWrapperEl.tabIndex = -1;
266
+ // @ts-ignore
267
+ this.el.focusable = false; // for Edge
268
+ this.sliceEls.map((p) => {
269
+ p.tabIndex = -1;
270
+ // @ts-ignore
271
+ p.focusable = false; // for Edge
272
+ });
273
+ this.sliceEls[index].tabIndex = 0;
274
+ // @ts-ignore
275
+ this.sliceEls[index].focusable = true; // for Edge
276
+ this.sliceEls[index].focus();
277
+ // for keyboard focus on doughnuts
278
+ this.focusedSliceId = this.sliceEls[index].id;
279
+ window.setTimeout(() => {
280
+ if (this.popoverEl) {
281
+ this.popoverEl.open = true;
282
+ }
283
+ }, 10);
284
+ }
285
+ }
286
+ function exitChart() {
287
+ this.focusedSliceId = undefined;
288
+ this.sliceEls &&
289
+ this.sliceEls.map((p) => {
290
+ p.tabIndex = -1;
291
+ // @ts-ignore
292
+ p.focusable = false; // for Edge
293
+ });
294
+ this.userIsNavigating = false;
295
+ // delay so that we can tab out of component before chart becomes focusable again
296
+ // and in case user was still pressing an arrow key when they pressed tab
297
+ window.setTimeout(() => {
298
+ this.componentWrapperEl.tabIndex = 0;
299
+ // @ts-ignore
300
+ this.el.focusable = true; // for Edge
301
+ if (this.popoverEl) {
302
+ this.popoverEl.open = false;
303
+ }
304
+ }, 100);
305
+ }
306
+ async function getDetails(chartType) {
307
+ this.slicesDetails = [];
308
+ let acc = 0;
309
+ const children = Array.from(this.el.children);
310
+ this.total = children.reduce((total, slice) => {
311
+ const sliceAmount = parseInt(slice.getAttribute("amount") || "0");
312
+ return total + sliceAmount;
313
+ }, 0);
314
+ let chartColors = [...allChartsDetails[chartType].colors];
315
+ if (this.chartType === "bar2") {
316
+ if (children.length <= 5) {
317
+ // remove lavender
318
+ chartColors.splice(1, 1);
319
+ }
320
+ if (children.length <= 4) {
321
+ // remove midnight
322
+ chartColors.splice(2, 1);
323
+ }
324
+ }
325
+ // Set colors when bar3 has only 2 slices
326
+ if (chartType === "bar3" && children.length === 2) {
327
+ chartColors = [chartColors[1], chartColors[3]];
328
+ }
329
+ // Set colors when doughnut2 has less than 5 slices
330
+ // (rm 2nd neutral color midnight)
331
+ if (chartType === "doughnut2" && children.length < 5) {
332
+ chartColors.splice(2, 1);
333
+ // with 3 slices or less, also remove first color
334
+ // (only pos, neg and unknown remain)
335
+ if (children.length < 4) {
336
+ chartColors.shift();
337
+ }
338
+ }
339
+ // for bar5, first color should be skipped unless notStartedColor is set to true
340
+ if (chartType === "bar5" && !this.notStartedColor) {
341
+ chartColors.shift();
342
+ }
343
+ let visibleIndex = 0;
344
+ children.forEach((c, i) => {
345
+ const amountAttr = c.getAttribute("amount");
346
+ // Ignored slices are not added to slice data, but do occupy a color slot
347
+ if (amountAttr == null)
348
+ return;
349
+ const amount = parseInt(amountAttr || "0");
350
+ const perc = amountToPercent(amount, this.total, true);
351
+ // Use original index for color assignment to preserve color order, despite ignored slices
352
+ let colorIndex = i;
353
+ // bars in bar6 are all the same color
354
+ if (chartType === "bar6") {
355
+ colorIndex = 0;
356
+ }
357
+ const sliceDetails = {
358
+ amount: amount,
359
+ visualAmount: amount,
360
+ perc: perc,
361
+ legend: c.getAttribute("legend"),
362
+ color: chartColors[colorIndex] || colors.gray,
363
+ offset: acc,
364
+ id: `${this.uid}-${visibleIndex + 1}`,
365
+ title: c.getAttribute("popover-title"),
366
+ text: c.getAttribute("popover-text"),
367
+ buttonText: c.getAttribute("popover-button-text"),
368
+ sliceRef: c,
369
+ inSmallCluster: false,
370
+ index: visibleIndex,
371
+ };
372
+ acc += amount;
373
+ this.slicesDetails.push(sliceDetails);
374
+ visibleIndex++;
375
+ });
376
+ }
377
+ function sortSlicesDetails(slicesDetails, total) {
378
+ // sort slices by decreasing amount
379
+ let sortedSlicesDetails = [...slicesDetails].sort((a, b) => a.amount === b.amount ? 0 : a.amount > b.amount ? -1 : 1);
380
+ let acc = 0;
381
+ sortedSlicesDetails
382
+ .filter((s) => s.amount > 0)
383
+ .forEach((s, idx) => {
384
+ const prev = sortedSlicesDetails[idx === 0 ? sortedSlicesDetails.length - 1 : idx - 1];
385
+ const next = sortedSlicesDetails[idx === sortedSlicesDetails.length - 1 ? 0 : idx + 1];
386
+ const prevPerc = amountToPercent(prev.amount, total, true);
387
+ const nextPerc = amountToPercent(next.amount, total, true);
388
+ // determine whether the slice is in a cluster of small values
389
+ // to avoid percentage text overlap for small values
390
+ // because <1% slice percentage text has an additional character
391
+ // the inSmallCluster threshold needs to be widened for that slice only
392
+ const neighborLimit = s.perc === 0 ? 8 : 5;
393
+ const isSmall = s.perc < 4;
394
+ const prevIsSmall = prevPerc < neighborLimit;
395
+ const nextIsSmall = nextPerc < neighborLimit;
396
+ let inSmallCluster = isSmall && (prevIsSmall || nextIsSmall);
397
+ s.inSmallCluster = inSmallCluster;
398
+ s.offset = acc;
399
+ acc += s.amount;
400
+ });
401
+ return sortedSlicesDetails;
402
+ }
403
+ function getPathData(amount, offset, chartType) {
404
+ const startAngle = amountToDegree(offset, this.total) - 90; // start at noon, not at 3 o'clock
405
+ const activeAngle = (amount / this.total) * 360;
406
+ let endAngle = startAngle + activeAngle;
407
+ const largeArcFlagOuter = activeAngle > 180 ? "1 1" : "0 1";
408
+ const largeArcFlagInner = activeAngle > 180 ? "1 0" : "0 0";
409
+ const half = this.chartDetails.size / 2;
410
+ const innerRadius = this.chartDetails.thickness;
411
+ const outerRadius = 1;
412
+ const isProgressIndicator = chartType === "doughnut";
413
+ const outerSeparatorOffset = 1.5;
414
+ const innerSeparatorOffset = isProgressIndicator ? 2.25 : 3;
415
+ if (activeAngle === 360) {
416
+ // fix to avoid bad svg shape when the path goes all around (100%)
417
+ endAngle -= 0.01;
418
+ }
419
+ const outerCoords = polarToCartesian(half, outerRadius, startAngle + outerSeparatorOffset, // Addition for slice separator
420
+ endAngle);
421
+ const innerCoords = polarToCartesian(half, innerRadius, startAngle + innerSeparatorOffset, // Addition for slice separator
422
+ endAngle);
423
+ const moveTo = `M ${outerCoords.x1}, ${outerCoords.y1} `;
424
+ const arc1 = getArc(outerRadius, largeArcFlagOuter, outerCoords.x2, outerCoords.y2, this.chartDetails.size);
425
+ const line = ` L ${innerCoords.x2}, ${innerCoords.y2} `;
426
+ const arc2 = getArc(innerRadius, largeArcFlagInner, innerCoords.x1, innerCoords.y1, this.chartDetails.size);
427
+ return moveTo + arc1 + line + arc2 + " z";
428
+ }
429
+ function renderInstructionsText() {
430
+ const chartInstructions = functions.intl.formatMessage({
431
+ id: "chart.instructions",
432
+ defaultMessage: "Use arrow keys to browse elements, press Tab to exit.",
433
+ description: "For screen readers only, instructions on how to interact with the chart component",
434
+ });
435
+ return index.h("div", { id: "chart-instructions" }, chartInstructions);
436
+ }
437
+ function renderFilter() {
438
+ return (index.h("defs", null,
439
+ index.h("filter", { id: "wmHoverDropShadow" },
440
+ index.h("feGaussianBlur", { stdDeviation: "3" }),
441
+ index.h("feOffset", { result: "offsetblur" }),
442
+ index.h("feFlood", { "flood-color": "#333" }),
443
+ index.h("feComposite", { operator: "in", in2: "offsetblur" }),
444
+ index.h("feMerge", null,
445
+ index.h("feMergeNode", null),
446
+ index.h("feMergeNode", { in: "SourceGraphic" })))));
447
+ }
448
+ function applyMinimumAngle(minimumAngle, slicesDetails, total) {
449
+ const allAngles = slicesDetails.map((s) => amountToDegree(s.amount, total));
450
+ const hasTooSmallAngle = allAngles.some((angle) => angle !== 0 && angle < minimumAngle);
451
+ if (hasTooSmallAngle) {
452
+ // all angles initially sum to 360
453
+ // increase all angles below minimum to meet minimum, sum should now exceed 360
454
+ // all unchanged angles should be proportionally reduced, so they sum to (360 - sum of changed angles)
455
+ // For Example:
456
+ // angles: 100 200 5 4 3 48 = 360, increasedAngles: 100 200 7 7 7 48 = 369
457
+ // unchangedAnglesSum = 348, changedAnglesSum = 21
458
+ // unchangedTargetSum: 360 - 21 = 339, targetDifference: 348 - 339 = 9
459
+ // reductionRatio = 9/339
460
+ // adjustedAngles: 97.345 194.69 7 7 7 46.725 = approx 360
461
+ const increasedAngles = allAngles.map((angle) => (angle == 0 ? angle : Math.max(angle, minimumAngle)));
462
+ const unchangedAnglesSum = increasedAngles.reduce((acc, cur) => acc + (cur > minimumAngle && cur !== 0 ? cur : 0), 0);
463
+ const changedAnglesSum = increasedAngles.reduce((acc, cur) => acc + (cur > minimumAngle && cur !== 0 ? 0 : cur), 0);
464
+ const unchangedTargetSum = 360 - changedAnglesSum;
465
+ const targetDifference = unchangedAnglesSum - unchangedTargetSum;
466
+ const reductionRatio = targetDifference / unchangedTargetSum;
467
+ const adjustedAngles = increasedAngles.map((angle) => angle > minimumAngle ? angle - reductionRatio * angle : angle == 0 ? 0 : minimumAngle);
468
+ // apply new amounts based on adjust angles
469
+ let offsetAcc = 0;
470
+ slicesDetails = slicesDetails.map((s, idx) => {
471
+ const visualAmount = (adjustedAngles[idx] / 360) * total;
472
+ const newOffset = offsetAcc;
473
+ offsetAcc += visualAmount;
474
+ return Object.assign(Object.assign({}, s), { visualAmount: visualAmount, offset: newOffset });
475
+ });
476
+ }
477
+ return slicesDetails;
478
+ }
479
+ function renderDoughnut(chartType) {
480
+ const outerSize = this.chartDetails.size + this.chartDetails.padding;
481
+ const isProgressIndicator = chartType === "doughnut";
482
+ // no sorting in progress indicators
483
+ let slicesDetails = isProgressIndicator ? this.slicesDetails : sortSlicesDetails(this.slicesDetails, this.total);
484
+ slicesDetails = applyMinimumAngle(7, slicesDetails, this.total);
485
+ // perc is only for progress indicator
486
+ const amount = slicesDetails[0].amount;
487
+ let perc = amountToPercent(amount, this.total, true);
488
+ if (perc === 0 && amount > 0) {
489
+ perc = "<1%";
490
+ }
491
+ else if (perc === 100 && amount < this.total) {
492
+ perc = ">99%";
493
+ }
494
+ else {
495
+ perc = perc + "%";
496
+ }
497
+ return (index.h("div", { class: "chart-wrapper doughnut-wrapper" },
498
+ index.h("svg", { width: outerSize + "px", height: outerSize + "px", id: `graphic-${this.uid}`, class: "doughnut-svg" },
499
+ renderFilter(),
500
+ slicesDetails.map((s) => renderPath.call(this, s, chartType)),
501
+ renderFocusOutline.call(this),
502
+ isProgressIndicator ? (index.h("text", { class: "value", x: "50%", y: "50%", "font-size": "1.5rem", "font-weight": "500", "text-anchor": "middle", "dominant-baseline": "middle" }, perc)) : (index.h("g", { transform: `translate(${this.chartDetails.padding / 2}, ${this.chartDetails.padding / 2})`, "text-anchor": "middle", "dominant-baseline": "middle" }, slicesDetails.map((s) => s.amount > 0 && !s.inSmallCluster ? renderDoughnutText.call(this, s) : ""))))));
503
+ }
504
+ function highlightSegmentInfo(infoEls, s) {
505
+ infoEls.forEach((el) => {
506
+ if (el.dataset.segmentindex && parseInt(el.dataset.segmentindex) !== s.index) {
507
+ el.classList.add("faded");
508
+ }
509
+ else {
510
+ el.classList.remove("faded");
511
+ }
512
+ });
513
+ }
514
+ function removeSegmentInfoHighlight(infoEls) {
515
+ infoEls.forEach((el) => {
516
+ el.classList.remove("faded");
517
+ });
518
+ }
519
+ function renderPath(s, chartType) {
520
+ const percentageValue = amountToPercent(s.amount, this.total, true) + "%";
521
+ return (!isNaN(s.amount) && (index.h("g", { transform: `translate(${this.chartDetails.padding / 2}, ${this.chartDetails.padding / 2})` },
522
+ index.h("path", { id: s.id, class: "segment doughnut-segment", fill: s.visualAmount ? s.color : "transparent", d: getPathData.call(this, s.visualAmount, s.offset, chartType), onClick: (ev) => handleSliceClick.call(this, ev, s), onFocus: (ev) => handleSliceFocus.call(this, ev, s), onKeyDown: (ev) => handleSliceKeyDown.call(this, ev), role: "img", "aria-label": `${s.legend}, ${percentageValue}`, "data-segmentindex": s.index }))));
523
+ }
524
+ function renderFocusOutline() {
525
+ return this.isTabbing ? (index.h("g", { transform: `translate(${this.chartDetails.padding / 2}, ${this.chartDetails.padding / 2})` },
526
+ index.h("use", { tabindex: -1, id: "kfbg1", xlinkHref: `#${this.focusedSliceId}` }),
527
+ index.h("use", { tabindex: -1, id: "kfstroke", xlinkHref: `#${this.focusedSliceId}` }),
528
+ index.h("use", { tabindex: -1, id: "kfbg2", xlinkHref: `#${this.focusedSliceId}` }))) : ("");
529
+ }
530
+ function renderDoughnutText(s) {
531
+ const arcMiddle = amountToDegree(s.offset + s.visualAmount / 2, this.total);
532
+ let { x, y } = polarToCartesian(this.chartDetails.size / 2, 1.4, arcMiddle - 90);
533
+ let val;
534
+ if (s.perc === 0 && s.amount > 0) {
535
+ val = "<1%";
536
+ }
537
+ else if (s.perc === 100 && s.amount < this.total) {
538
+ val = ">99%";
539
+ }
540
+ else {
541
+ val = s.perc + "%";
542
+ }
543
+ return (index.h("text", { class: "value", x: x + "px", y: y + "px", "data-segmentindex": s.index }, val));
544
+ }
545
+ function renderStackedBar(chartType) {
546
+ const isHybridBar = chartType === "bar";
547
+ // if the text for any value > 0 overlaps with another, hide it and display warning
548
+ const textEls = this.el.shadowRoot.querySelectorAll(".value");
549
+ // if DOM is not ready (no textEls), we need to rerender
550
+ // we don't have to do it here though, because it's already taken care of
551
+ // as a side effect of the observer in componentWillLoad
552
+ // (observers fire on init)
553
+ if (textEls.length > 0) {
554
+ requestAnimationFrame(() => {
555
+ let prevTextEls = [];
556
+ const margin = 4;
557
+ let showMsg = false;
558
+ textEls.forEach((textEl) => {
559
+ textEl.classList.remove("hidden");
560
+ const currentValue = parseInt(textEl.dataset.value);
561
+ // only proceed if there are prevTextEls to check for overlap, and current value is not 0
562
+ if (prevTextEls.length > 0 && currentValue != 0) {
563
+ const currentLeftEdge = textEl.getBoundingClientRect().left - margin;
564
+ // check for overlap with all prevTextEls & hide the smaller value if overlap occurs
565
+ prevTextEls.forEach((prevTextEl) => {
566
+ const prevValue = parseInt(prevTextEl.dataset.value);
567
+ const valuesOverlap = prevTextEl.getBoundingClientRect().right > currentLeftEdge;
568
+ if (valuesOverlap) {
569
+ const smallerValueEl = currentValue < prevValue ? textEl : prevTextEl;
570
+ smallerValueEl.classList.add("hidden");
571
+ showMsg = true;
572
+ }
573
+ });
574
+ }
575
+ // prevTextEls only need to be checked if they are visible and have a non-zero value
576
+ if (!textEl.classList.contains("hidden") && currentValue > 0) {
577
+ prevTextEls.push(textEl);
578
+ }
579
+ });
580
+ // progress monitor doesn't have this message
581
+ (this.isBar || this.isDoughnut) && this.showHiddenValuesMessage(showMsg);
582
+ });
583
+ }
584
+ return (index.h("div", { class: "chart-wrapper bar-wrapper" },
585
+ isHybridBar ? (index.h("div", { class: "single-perc" }, amountToPercent(this.slicesDetails[0].amount, this.total, true) + "%")) : (""),
586
+ this.chartType === "bar3" && this.drawAxis(),
587
+ index.h("div", { class: `inner-stacked-bar-wrapper ${showValue(this.valueFormat)}` },
588
+ !isHybridBar ? (index.h("div", { class: `values ${this.valueFormat}` }, this.slicesDetails.map((s) => this.renderBarText(s, 5)))) : (""),
589
+ index.h("div", { class: "stacked-bar-segments-wrapper" }, this.slicesDetails.map((s) => renderStackedBarSegment.call(this, s, 5))),
590
+ isHybridBar ? renderCompletionMessage.call(this) : ""),
591
+ this.chartType === "bar3" ? (index.h("div", { class: "bar3-axis-label", "aria-hidden": "true" },
592
+ index.h("span", null, "0%"),
593
+ index.h("span", null, "100%"))) : ("")));
594
+ }
595
+ function renderStackedBarSegment(s, minimumWidth) {
596
+ const segmentPercentage = amountToPercent(s.amount, this.total, false);
597
+ const barWrapper = this.el.shadowRoot.querySelector(".stacked-bar-segments-wrapper");
598
+ const availableWidth = barWrapper ? barWrapper.offsetWidth : this.el.offsetWidth;
599
+ const meetsSizeMinimum = (segmentPercentage / 100) * availableWidth >= minimumWidth;
600
+ const renderedWidth = meetsSizeMinimum || s.amount == 0 ? `${segmentPercentage}%` : `${minimumWidth}px`;
601
+ let segmentValue = "";
602
+ if (this.valueFormat == "percentage") {
603
+ segmentValue = `${amountToPercent(s.amount, this.total, true)} %`;
604
+ }
605
+ else if (this.valueFormat == "amount") {
606
+ segmentValue = s.amount.toString();
607
+ }
608
+ return (index.h("div", { class: `segment stacked-bar-segment ${amountToPercent(s.amount, this.total, false) === 0 ? "zero" : ""} ${meetsSizeMinimum ? "" : "fixed-width"}`, style: {
609
+ backgroundColor: s.color,
610
+ width: renderedWidth,
611
+ }, onClick: (ev) => handleSliceClick.call(this, ev, s), onFocus: (ev) => handleSliceFocus.call(this, ev, s), onKeyDown: (ev) => handleSliceKeyDown.call(this, ev), "data-segmentindex": s.index },
612
+ index.h("span", { class: "sr-only" }, `${s.legend} ${segmentValue}`)));
613
+ }
614
+ function renderSimpleBar(chartType) {
615
+ // find largest number and get interval, numTicks, chartMaxVal for all.
616
+ const largest = this.slicesDetails
617
+ .map((s) => s.amount)
618
+ .reduce((a, b) => {
619
+ return a > b ? a : b;
620
+ });
621
+ const labelWidth = parseInt(getComputedStyle(this.el).getPropertyValue("--labelWidth"), 10);
622
+ const chartPadding = 48;
623
+ const componentWidth = this.el.getBoundingClientRect().width;
624
+ const chartWidth = componentWidth - labelWidth - chartPadding;
625
+ let numTicks = getMaxTicks(chartWidth);
626
+ let interval = getInterval(largest, numTicks);
627
+ // after the algorithm finds an interval, remove extra ticks so that the greater number is always between the last tick and the one before that
628
+ const lastTickVal = numTicks * interval;
629
+ const extraTicks = Math.floor((lastTickVal - largest) / interval);
630
+ numTicks -= extraTicks;
631
+ this.el.style.setProperty("--backgroundSize", 100 / numTicks + "%");
632
+ this.el.style.setProperty("--labelWidth", this.labelWidth);
633
+ if (chartType === "bar7" && !this.showBarLegend) {
634
+ this.el.style.setProperty("--labelWidth", "0px");
635
+ }
636
+ // we have to prep the data here rather than iterate directly in the return statement
637
+ // because CSS grid needs a flat structure, and return functions must
638
+ // have a single parent element
639
+ const rows = [];
640
+ this.slicesDetails.forEach((s) => {
641
+ s.legend && rows.push(renderSimpleBarLegend(s.legend, this.showBarLegend, chartType));
642
+ rows.push(renderSimpleBarItem.call(this, s, interval, numTicks, largest));
643
+ });
644
+ const ticks = [];
645
+ for (let i = 1; i <= numTicks; i++) {
646
+ const tickVal = abbrNumber(functions.safeMultiplyFloat(i, interval));
647
+ ticks.push(index.h("div", { class: "tick" },
648
+ index.h("span", null, tickVal)));
649
+ }
650
+ const showGrid = chartType === "bar6" && this.showGrid && this.el.getBoundingClientRect().width > 300;
651
+ return (index.h("div", { class: "chart-wrapper simple-bar-wrapper" },
652
+ index.h("div", { class: `chart ${showValue(this.valueFormat)}` },
653
+ showGrid && index.h("div", { class: "gridlines" }),
654
+ index.h("div", { class: "rows" }, rows)),
655
+ showGrid && (index.h("div", { class: "x-axis", "aria-hidden": "true" },
656
+ index.h("div", { class: "zero" },
657
+ index.h("span", null, "0")),
658
+ ticks))));
659
+ }
660
+ function renderSimpleBarLegend(legend, show, chartType) {
661
+ // not sure how to collapse the left column to 0 width with CSS grid. text should still be available to SR.
662
+ const hidden = chartType === "bar7" && !show ? " hidden" : "";
663
+ return index.h("label", { class: `label${hidden}` }, legend);
664
+ }
665
+ function renderSimpleBarItem(s, interval, ticks, largest) {
666
+ const chartMaxVal = this.currentChartType === "bar6" ? interval * ticks : largest;
667
+ const width = amountToPercent(s.amount, chartMaxVal, false);
668
+ const cssWidth = width ? width + "%" : "1px";
669
+ const amt = abbrNumber(s.amount);
670
+ let displayValue = this.valueFormat === "amount" ? amt : "";
671
+ if (this.currentChartType === "bar6" && this.valueFormat === "percentage") {
672
+ displayValue = s.amount + "%";
673
+ }
674
+ else if (this.currentChartType === "bar7" && this.valueFormat === "percentage") {
675
+ displayValue = (this.total === 0 ? "0" : amountToPercent(s.amount, this.total, true)) + "%";
676
+ }
677
+ return (index.h("div", { class: "bar segment", style: {
678
+ backgroundColor: s.color,
679
+ width: cssWidth,
680
+ }, onClick: (ev) => handleSliceClick.call(this, ev, s), onFocus: (ev) => handleSliceFocus.call(this, ev, s), onKeyDown: (ev) => handleSliceKeyDown.call(this, ev), "data-segmentindex": s.index },
681
+ index.h("div", { class: "value" }, displayValue)));
682
+ }
683
+ function renderLegend(chartType) {
684
+ // legend is hidden for bar1 and bar6 types regardless of showLegend value
685
+ if (this.showLegend) {
686
+ const showMsg = this.slicesDetails.reduce((hasCluster, cur) => (hasCluster = cur.inSmallCluster ? true : hasCluster), false);
687
+ this.isDoughnut && this.showHiddenValuesMessage(showMsg);
688
+ return (index.h("div", { class: "legend-wrapper" },
689
+ index.h("div", { class: `legend ${chartType} ${this.mode === "bar" ? "--top" : "--bottom"}`, "aria-hidden": "true" }, this.slicesDetails.map((s) => {
690
+ const printValue = this.printModeFormat == "amount"
691
+ ? `${s.amount}/${this.total}`
692
+ : `${amountToPercent(s.amount, this.total, true)}%`;
693
+ // when both legend and amount are omitted, the legend is not shown for that particular option (it's been deactivated by the user)
694
+ if (!!s.amount || !!s.legend) {
695
+ return renderLegendItem.call(this, { key: s.legend, color: s.color }, printValue, s);
696
+ }
697
+ })),
698
+ this.isDoughnut && !this.printMode && renderHiddenValuesMessage()));
699
+ }
700
+ }
701
+ function renderLegendItem(legendItem, printValue = "", s = null) {
702
+ const handleLegendItemClick = (ev) => {
703
+ if (s) {
704
+ s.coords = { x: ev.clientX, y: ev.clientY };
705
+ openPopover(this.popoverEl, s);
706
+ highlightSegmentInfo(Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex")), s);
707
+ }
708
+ };
709
+ return (index.h("div", { class: "legend-item", onClick: (ev) => handleLegendItemClick(ev), "data-segmentindex": s ? s.index : null },
710
+ index.h("div", { class: "legend-color", style: { backgroundColor: legendItem.color } }),
711
+ index.h("div", { class: "legend-text" },
712
+ legendItem.key,
713
+ printValue && index.h("span", { class: `print-value ${this.printMode ? "force-visible" : ""}` },
714
+ ": ",
715
+ printValue))));
716
+ }
717
+ function renderCompletionMessage() {
718
+ if (this.completionMessage) {
719
+ return index.h("div", { class: "completion-message" }, this.completionMessage);
720
+ }
721
+ }
722
+ function renderHiddenValuesMessage() {
723
+ return (index.h("div", { class: "hidden-values-warning hidden" },
724
+ textHiddenMessage,
725
+ index.h("br", null),
726
+ seeDetailsMessage));
727
+ }
728
+ function formatDisplayValue(amount, amountTotal, valueFormat, decimalPlaces = 0) {
729
+ switch (valueFormat) {
730
+ case "amount":
731
+ return amount.toFixed(decimalPlaces);
732
+ case "percentage":
733
+ const percentage = (amount / amountTotal) * 100;
734
+ if (amount > 0 && percentage < 1)
735
+ return "<1%";
736
+ if (percentage > 99 && amount !== amountTotal)
737
+ return ">99%";
738
+ return `${Math.round(percentage).toFixed(0)}%`;
739
+ default:
740
+ case "none":
741
+ return "";
742
+ }
743
+ }
744
+ function isNiceInterval(interval, niceValues = [1, 1.5, 2, 2.5, 3, 5, 10]) {
745
+ const magnitude = Math.pow(10, Math.floor(Math.log10(interval)));
746
+ const normalized = interval / magnitude;
747
+ const normalizedComparision = niceValues.some((nice) => Math.abs(normalized - nice) < 0.0001); // check equality with floating point tolerance
748
+ return normalizedComparision;
749
+ }
750
+ function inferDecimalPlacesFromFloat(value) {
751
+ // Trims floating point noise and returns significant decimal places, or return 2 for non-terminating values (2/3)
752
+ if (value === 0 || !Number.isFinite(value))
753
+ return 0;
754
+ const maxPlaces = 15;
755
+ let scaled = Math.abs(value);
756
+ for (let n = 0; n <= maxPlaces; n++) {
757
+ // Each iteration, compare the scaled value to the nearest whole number
758
+ // If the difference is less than the noise margin, return the number of times scaled (decimal places)
759
+ // Otherwise scale up by 10 and loop
760
+ const nearest = Math.round(scaled);
761
+ const noiseMargin = 1e-9;
762
+ if (Math.abs(scaled - nearest) < noiseMargin) {
763
+ return n;
764
+ }
765
+ scaled *= 10;
766
+ }
767
+ return 2;
768
+ }
769
+ function inferDecimalPlacesForUnitValue(value) {
770
+ // Works with units K and M. Returns decimal places taking unit conversion into account
771
+ if (value === 0 || !Number.isFinite(value))
772
+ return 0;
773
+ const abs = Math.abs(value);
774
+ let displayUnitValue = abs;
775
+ if (abs >= 1000000) {
776
+ displayUnitValue = abs / 1000000;
777
+ }
778
+ else if (abs >= 1000) {
779
+ displayUnitValue = abs / 1000;
780
+ }
781
+ return Math.max(inferDecimalPlacesFromFloat(abs), inferDecimalPlacesFromFloat(displayUnitValue));
782
+ }
783
+ function suffixNumber(value, decimalPlaces) {
784
+ const hasDecimalPlaces = decimalPlaces !== undefined;
785
+ if (value >= 1000000) {
786
+ const scaled = value / 1000000;
787
+ if (hasDecimalPlaces) {
788
+ return `${scaled.toFixed(decimalPlaces)}M`;
789
+ }
790
+ return `${scaled.toFixed(value % 1000000 === 0 ? 0 : 1)}M`;
791
+ }
792
+ if (value >= 1000) {
793
+ const scaled = value / 1000;
794
+ if (hasDecimalPlaces) {
795
+ return `${scaled.toFixed(decimalPlaces)}K`;
796
+ }
797
+ return `${scaled.toFixed(value % 1000 === 0 ? 0 : 1)}K`;
798
+ }
799
+ if (hasDecimalPlaces) {
800
+ return value.toFixed(decimalPlaces);
801
+ }
802
+ return value.toString();
803
+ }
804
+ function findLargestNiceInterval(maxIntervals, total) {
805
+ // Given a max number of intervals and a total, iterate down until a nice way to divide the total is found.
806
+ // Otherwise, return 1 interval
807
+ for (let intervals = maxIntervals; intervals >= 1; intervals--) {
808
+ const candidateInterval = total / intervals;
809
+ if (isNiceInterval(candidateInterval)) {
810
+ return { numIntervals: intervals, interval: candidateInterval };
811
+ }
812
+ }
813
+ return { numIntervals: 1, interval: total };
814
+ }
815
+ function findNiceRoundNumber(value) {
816
+ // Given a value, find the next "nice" round number >= that value.
817
+ // Examples: 982 → 1000, 45 → 50, 1234 → 1500, 7 → 10
818
+ if (value <= 0)
819
+ return 0;
820
+ const niceValues = [1, 1.5, 2, 2.5, 3, 5, 10];
821
+ const magnitude = Math.pow(10, Math.floor(Math.log10(value)));
822
+ const normalized = value / magnitude;
823
+ // Find the smallest nice value that is >= the normalized value
824
+ for (const nice of niceValues) {
825
+ if (nice >= normalized) {
826
+ return nice * magnitude;
827
+ }
828
+ }
829
+ // Fallback: next order of magnitude
830
+ return 10 * magnitude;
831
+ }
832
+ function computeLegendData(data) {
833
+ const seen = new Set();
834
+ const result = [];
835
+ data.forEach((groupItems) => {
836
+ groupItems.forEach((item) => {
837
+ if (!seen.has(item.barLegend)) {
838
+ seen.add(item.barLegend);
839
+ result.push(item);
840
+ }
841
+ });
842
+ });
843
+ return result;
844
+ }
845
+ function groupProcessedData(data, defaultGroupName) {
846
+ const groups = new Map();
847
+ data.forEach((item) => {
848
+ let groupName = item.groupName;
849
+ if (!groupName) {
850
+ groupName = defaultGroupName;
851
+ }
852
+ if (!groups.has(groupName)) {
853
+ groups.set(groupName, []);
854
+ }
855
+ groups.get(groupName).push(item);
856
+ });
857
+ return groups;
858
+ }
859
+ function sortGroupedData(data) {
860
+ const barData = [...data];
861
+ // Determine group order and barLegend order by first occurrences
862
+ const groupOrder = [];
863
+ barData.forEach((item) => {
864
+ if (item.groupName && !groupOrder.includes(item.groupName)) {
865
+ groupOrder.push(item.groupName);
866
+ }
867
+ });
868
+ const barLegendOrder = barData
869
+ .filter((item) => item.groupName === groupOrder[0])
870
+ .map((item) => item.barLegend);
871
+ // Two step sorting: sort by group order, then by barLegend order
872
+ const sortedBarData = barData.sort((a, b) => {
873
+ const groupIndexA = groupOrder.indexOf(a.groupName || "");
874
+ const groupIndexB = groupOrder.indexOf(b.groupName || "");
875
+ if (groupIndexA !== groupIndexB) {
876
+ return groupIndexA - groupIndexB;
877
+ }
878
+ const legendIndexA = barLegendOrder.indexOf(a.barLegend);
879
+ const legendIndexB = barLegendOrder.indexOf(b.barLegend);
880
+ return legendIndexA - legendIndexB;
881
+ });
882
+ return sortedBarData;
883
+ }
884
+
885
+ exports.allChartsDetails = allChartsDetails;
886
+ exports.amountToPercent = amountToPercent;
887
+ exports.computeLegendData = computeLegendData;
888
+ exports.exitChart = exitChart;
889
+ exports.findLargestNiceInterval = findLargestNiceInterval;
890
+ exports.findNiceRoundNumber = findNiceRoundNumber;
891
+ exports.formatDisplayValue = formatDisplayValue;
892
+ exports.getDetails = getDetails;
893
+ exports.getInterval = getInterval;
894
+ exports.getMaxTicks = getMaxTicks;
895
+ exports.groupProcessedData = groupProcessedData;
896
+ exports.handleChartKeydown = handleChartKeydown;
897
+ exports.inferDecimalPlacesForUnitValue = inferDecimalPlacesForUnitValue;
898
+ exports.removeSegmentInfoHighlight = removeSegmentInfoHighlight;
899
+ exports.renderCompletionMessage = renderCompletionMessage;
900
+ exports.renderDoughnut = renderDoughnut;
901
+ exports.renderHiddenValuesMessage = renderHiddenValuesMessage;
902
+ exports.renderInstructionsText = renderInstructionsText;
903
+ exports.renderLegend = renderLegend;
904
+ exports.renderLegendItem = renderLegendItem;
905
+ exports.renderSimpleBar = renderSimpleBar;
906
+ exports.renderStackedBar = renderStackedBar;
907
+ exports.sortGroupedData = sortGroupedData;
908
+ exports.suffixNumber = suffixNumber;