@watermarkinsights/ripple 5.23.0-alpha.5 → 5.23.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/dist/cjs/{app-globals-7b533418.js → app-globals-3d5b637c.js} +26 -17
  2. package/dist/cjs/{chartFunctions-97471b69.js → chartFunctions-8d17cbb8.js} +19 -1
  3. package/dist/cjs/{functions-71af585d.js → functions-156cc201.js} +2 -2
  4. package/dist/cjs/{interfaces-069f135e.js → interfaces-8419be91.js} +22 -21
  5. package/dist/cjs/{intl-169a8805.js → intl-789e4b6c.js} +1 -1
  6. package/dist/cjs/loader.cjs.js +2 -2
  7. package/dist/cjs/priv-calendar.cjs.entry.js +1 -1
  8. package/dist/cjs/priv-chart-popover-old.cjs.entry.js +1 -1
  9. package/dist/cjs/priv-chart-popover_2.cjs.entry.js +6 -6
  10. package/dist/cjs/priv-option-list.cjs.entry.js +2 -2
  11. package/dist/cjs/ripple.cjs.js +2 -2
  12. package/dist/cjs/wm-action-menu_2.cjs.entry.js +2 -2
  13. package/dist/cjs/wm-button.cjs.entry.js +2 -2
  14. package/dist/cjs/wm-chart-bar.cjs.entry.js +38 -24
  15. package/dist/cjs/wm-chart.cjs.entry.js +3 -3
  16. package/dist/cjs/wm-date-range.cjs.entry.js +1 -1
  17. package/dist/cjs/wm-datepicker.cjs.entry.js +1 -1
  18. package/dist/cjs/wm-file.cjs.entry.js +1 -1
  19. package/dist/cjs/wm-flyout.cjs.entry.js +2 -2
  20. package/dist/cjs/wm-input.cjs.entry.js +2 -2
  21. package/dist/cjs/wm-line-chart.cjs.entry.js +3 -3
  22. package/dist/cjs/wm-modal-pss_3.cjs.entry.js +2 -2
  23. package/dist/cjs/wm-modal_3.cjs.entry.js +6 -8
  24. package/dist/cjs/wm-navigation_3.cjs.entry.js +2 -2
  25. package/dist/cjs/wm-navigator.cjs.entry.js +2 -2
  26. package/dist/cjs/wm-nested-select.cjs.entry.js +2 -2
  27. package/dist/cjs/wm-optgroup.cjs.entry.js +1 -1
  28. package/dist/cjs/wm-option_2.cjs.entry.js +48 -37
  29. package/dist/cjs/wm-pagination.cjs.entry.js +2 -2
  30. package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +2 -2
  31. package/dist/cjs/wm-search.cjs.entry.js +2 -2
  32. package/dist/cjs/wm-snackbar.cjs.entry.js +2 -2
  33. package/dist/cjs/wm-tab-item_3.cjs.entry.js +1 -1
  34. package/dist/cjs/wm-tag-input.cjs.entry.js +2 -2
  35. package/dist/cjs/wm-tag-option.cjs.entry.js +1 -1
  36. package/dist/cjs/wm-textarea.cjs.entry.js +2 -2
  37. package/dist/cjs/wm-timepicker.cjs.entry.js +1 -1
  38. package/dist/cjs/wm-toggletip.cjs.entry.js +1 -1
  39. package/dist/cjs/wm-uploader.cjs.entry.js +2 -2
  40. package/dist/collection/components/charts/chartFunctions.js +17 -0
  41. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.css +13 -13
  42. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +5 -5
  43. package/dist/collection/components/charts/wm-chart-bar/wm-chart-bar.css +1 -6
  44. package/dist/collection/components/charts/wm-chart-bar/wm-chart-bar.js +37 -35
  45. package/dist/collection/components/selects/wm-select/wm-select.js +46 -35
  46. package/dist/collection/components/wm-modal/wm-modal.js +4 -6
  47. package/dist/collection/dev/chart-bar.js +1 -3
  48. package/dist/collection/global/functions.js +2 -2
  49. package/dist/collection/global/global.js +25 -16
  50. package/dist/collection/global/interfaces.js +21 -19
  51. package/dist/esm/{app-globals-e00b1feb.js → app-globals-f57d8c7f.js} +26 -17
  52. package/dist/esm/{chartFunctions-9c95674d.js → chartFunctions-93592f14.js} +19 -2
  53. package/dist/esm/{functions-2cfbd8c7.js → functions-c1d5f184.js} +2 -2
  54. package/dist/esm/{interfaces-30d10bc0.js → interfaces-7e50d034.js} +22 -20
  55. package/dist/esm/{intl-23d21b06.js → intl-8c69d10b.js} +1 -1
  56. package/dist/esm/loader.js +2 -2
  57. package/dist/esm/priv-calendar.entry.js +1 -1
  58. package/dist/esm/priv-chart-popover-old.entry.js +1 -1
  59. package/dist/esm/priv-chart-popover_2.entry.js +6 -6
  60. package/dist/esm/priv-option-list.entry.js +2 -2
  61. package/dist/esm/ripple.js +2 -2
  62. package/dist/esm/wm-action-menu_2.entry.js +2 -2
  63. package/dist/esm/wm-button.entry.js +2 -2
  64. package/dist/esm/wm-chart-bar.entry.js +38 -24
  65. package/dist/esm/wm-chart.entry.js +3 -3
  66. package/dist/esm/wm-date-range.entry.js +1 -1
  67. package/dist/esm/wm-datepicker.entry.js +1 -1
  68. package/dist/esm/wm-file.entry.js +1 -1
  69. package/dist/esm/wm-flyout.entry.js +2 -2
  70. package/dist/esm/wm-input.entry.js +2 -2
  71. package/dist/esm/wm-line-chart.entry.js +3 -3
  72. package/dist/esm/wm-modal-pss_3.entry.js +2 -2
  73. package/dist/esm/wm-modal_3.entry.js +6 -8
  74. package/dist/esm/wm-navigation_3.entry.js +2 -2
  75. package/dist/esm/wm-navigator.entry.js +2 -2
  76. package/dist/esm/wm-nested-select.entry.js +2 -2
  77. package/dist/esm/wm-optgroup.entry.js +1 -1
  78. package/dist/esm/wm-option_2.entry.js +48 -37
  79. package/dist/esm/wm-pagination.entry.js +2 -2
  80. package/dist/esm/wm-progress-indicator_3.entry.js +2 -2
  81. package/dist/esm/wm-search.entry.js +2 -2
  82. package/dist/esm/wm-snackbar.entry.js +2 -2
  83. package/dist/esm/wm-tab-item_3.entry.js +1 -1
  84. package/dist/esm/wm-tag-input.entry.js +2 -2
  85. package/dist/esm/wm-tag-option.entry.js +1 -1
  86. package/dist/esm/wm-textarea.entry.js +2 -2
  87. package/dist/esm/wm-timepicker.entry.js +1 -1
  88. package/dist/esm/wm-toggletip.entry.js +1 -1
  89. package/dist/esm/wm-uploader.entry.js +2 -2
  90. package/dist/esm-es5/app-globals-f57d8c7f.js +1 -0
  91. package/dist/esm-es5/{chartFunctions-9c95674d.js → chartFunctions-93592f14.js} +1 -1
  92. package/dist/esm-es5/{functions-2cfbd8c7.js → functions-c1d5f184.js} +1 -1
  93. package/dist/esm-es5/interfaces-7e50d034.js +1 -0
  94. package/dist/esm-es5/{intl-23d21b06.js → intl-8c69d10b.js} +1 -1
  95. package/dist/esm-es5/loader.js +1 -1
  96. package/dist/esm-es5/priv-calendar.entry.js +1 -1
  97. package/dist/esm-es5/priv-chart-popover-old.entry.js +1 -1
  98. package/dist/esm-es5/priv-chart-popover_2.entry.js +1 -1
  99. package/dist/esm-es5/priv-option-list.entry.js +1 -1
  100. package/dist/esm-es5/ripple.js +1 -1
  101. package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
  102. package/dist/esm-es5/wm-button.entry.js +1 -1
  103. package/dist/esm-es5/wm-chart-bar.entry.js +1 -1
  104. package/dist/esm-es5/wm-chart.entry.js +1 -1
  105. package/dist/esm-es5/wm-date-range.entry.js +1 -1
  106. package/dist/esm-es5/wm-datepicker.entry.js +1 -1
  107. package/dist/esm-es5/wm-file.entry.js +1 -1
  108. package/dist/esm-es5/wm-flyout.entry.js +1 -1
  109. package/dist/esm-es5/wm-input.entry.js +1 -1
  110. package/dist/esm-es5/wm-line-chart.entry.js +1 -1
  111. package/dist/esm-es5/wm-modal-pss_3.entry.js +1 -1
  112. package/dist/esm-es5/wm-modal_3.entry.js +1 -1
  113. package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
  114. package/dist/esm-es5/wm-navigator.entry.js +1 -1
  115. package/dist/esm-es5/wm-nested-select.entry.js +1 -1
  116. package/dist/esm-es5/wm-optgroup.entry.js +1 -1
  117. package/dist/esm-es5/wm-option_2.entry.js +1 -1
  118. package/dist/esm-es5/wm-pagination.entry.js +1 -1
  119. package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
  120. package/dist/esm-es5/wm-search.entry.js +1 -1
  121. package/dist/esm-es5/wm-snackbar.entry.js +1 -1
  122. package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
  123. package/dist/esm-es5/wm-tag-input.entry.js +1 -1
  124. package/dist/esm-es5/wm-tag-option.entry.js +1 -1
  125. package/dist/esm-es5/wm-textarea.entry.js +1 -1
  126. package/dist/esm-es5/wm-timepicker.entry.js +1 -1
  127. package/dist/esm-es5/wm-toggletip.entry.js +1 -1
  128. package/dist/esm-es5/wm-uploader.entry.js +1 -1
  129. package/dist/ripple/{p-62cdc8c6.system.entry.js → p-035c3af8.system.entry.js} +1 -1
  130. package/dist/ripple/{p-d5e5c55a.system.entry.js → p-086da1c5.system.entry.js} +1 -1
  131. package/dist/ripple/{p-b939d3cb.system.entry.js → p-0886099f.system.entry.js} +1 -1
  132. package/dist/ripple/{p-5cbbaf69.system.entry.js → p-08ba2a77.system.entry.js} +1 -1
  133. package/dist/ripple/{p-5f50c561.system.entry.js → p-0cdb5b52.system.entry.js} +1 -1
  134. package/dist/ripple/{p-d49676b7.system.entry.js → p-0e418fe4.system.entry.js} +1 -1
  135. package/dist/ripple/{p-278accdb.system.entry.js → p-0efafbd8.system.entry.js} +1 -1
  136. package/dist/ripple/{p-00a9e425.system.entry.js → p-17f3fa47.system.entry.js} +1 -1
  137. package/dist/ripple/{p-842dcfd6.entry.js → p-23f08f5a.entry.js} +1 -1
  138. package/dist/ripple/{p-b3092643.entry.js → p-24598e3e.entry.js} +1 -1
  139. package/dist/ripple/{p-e7615737.entry.js → p-24ce5997.entry.js} +1 -1
  140. package/dist/ripple/{p-828afdbe.entry.js → p-25043b32.entry.js} +1 -1
  141. package/dist/ripple/p-25ce5d58.js +1 -0
  142. package/dist/ripple/{p-10f93b97.system.entry.js → p-262d5bd5.system.entry.js} +1 -1
  143. package/dist/ripple/{p-bc052b23.entry.js → p-26dcc8e6.entry.js} +1 -1
  144. package/dist/ripple/{p-fab7195d.system.entry.js → p-275386c1.system.entry.js} +1 -1
  145. package/dist/ripple/{p-e7988695.system.entry.js → p-2d042b40.system.entry.js} +1 -1
  146. package/dist/ripple/{p-a1f2ce53.system.entry.js → p-2d5bd606.system.entry.js} +1 -1
  147. package/dist/ripple/{p-79ec0bb2.entry.js → p-3410da36.entry.js} +1 -1
  148. package/dist/ripple/{p-02b50251.entry.js → p-3436e819.entry.js} +1 -1
  149. package/dist/ripple/{p-e2a2f3ca.system.entry.js → p-35dfeacb.system.entry.js} +1 -1
  150. package/dist/ripple/{p-7e56aca4.entry.js → p-367df770.entry.js} +1 -1
  151. package/dist/ripple/{p-f63ef9c1.entry.js → p-3b2e7166.entry.js} +1 -1
  152. package/dist/ripple/{p-d522499c.entry.js → p-3de0e2b0.entry.js} +1 -1
  153. package/dist/ripple/p-40334c5f.system.js +1 -0
  154. package/dist/ripple/{p-b200dc04.system.entry.js → p-46c77ecb.system.entry.js} +1 -1
  155. package/dist/ripple/{p-d28816c9.entry.js → p-48950aef.entry.js} +1 -1
  156. package/dist/ripple/{p-b9a55887.entry.js → p-49b75a61.entry.js} +1 -1
  157. package/dist/ripple/{p-30f1afd4.entry.js → p-4b813987.entry.js} +1 -1
  158. package/dist/ripple/{p-0a226179.entry.js → p-6434eacf.entry.js} +1 -1
  159. package/dist/ripple/p-64dcc68f.system.js +1 -0
  160. package/dist/ripple/{p-9246f0dc.js → p-6a2fb1a1.js} +1 -1
  161. package/dist/ripple/{p-79b3dfc8.entry.js → p-724fbe77.entry.js} +1 -1
  162. package/dist/ripple/p-7450be2e.entry.js +1 -0
  163. package/dist/ripple/p-75816848.system.js +1 -0
  164. package/dist/ripple/{p-83a41243.system.entry.js → p-7c103a48.system.entry.js} +1 -1
  165. package/dist/ripple/{p-73f81790.entry.js → p-7f4a409e.entry.js} +1 -1
  166. package/dist/ripple/{p-7616ddda.system.entry.js → p-8a4d79dc.system.entry.js} +1 -1
  167. package/dist/ripple/p-8ac14bb1.system.js +1 -0
  168. package/dist/ripple/{p-acdfbdb8.system.entry.js → p-90f0283c.system.entry.js} +1 -1
  169. package/dist/ripple/{p-01e8cea6.entry.js → p-94842057.entry.js} +1 -1
  170. package/dist/ripple/{p-78524594.entry.js → p-986d1792.entry.js} +1 -1
  171. package/dist/ripple/{p-08063ac2.system.entry.js → p-99a1c382.system.entry.js} +1 -1
  172. package/dist/ripple/{p-8f4fcdf4.system.entry.js → p-a289d92b.system.entry.js} +1 -1
  173. package/dist/ripple/{p-c8c8e85f.system.js → p-a402c6bb.system.js} +1 -1
  174. package/dist/ripple/{p-6a6e4645.system.entry.js → p-af9e6028.system.entry.js} +1 -1
  175. package/dist/ripple/p-b1afda53.entry.js +1 -0
  176. package/dist/ripple/{p-1720b84f.entry.js → p-b37fbb7e.entry.js} +1 -1
  177. package/dist/ripple/{p-95677d9b.entry.js → p-b589b0da.entry.js} +1 -1
  178. package/dist/ripple/{p-6c01961b.system.entry.js → p-bfe3c687.system.entry.js} +1 -1
  179. package/dist/ripple/{p-25c56231.entry.js → p-c04fad73.entry.js} +1 -1
  180. package/dist/ripple/{p-84d41f0e.entry.js → p-c3ba7789.entry.js} +1 -1
  181. package/dist/ripple/{p-07b703b6.system.entry.js → p-c5030fa3.system.entry.js} +1 -1
  182. package/dist/ripple/{p-d404695d.system.entry.js → p-c97b06b5.system.entry.js} +1 -1
  183. package/dist/ripple/{p-d13b78fd.system.entry.js → p-cd5aa832.system.entry.js} +1 -1
  184. package/dist/ripple/p-cda66d45.js +1 -0
  185. package/dist/ripple/{p-a0c4a12e.entry.js → p-d002e65f.entry.js} +1 -1
  186. package/dist/ripple/{p-fda4032a.system.entry.js → p-d4051c50.system.entry.js} +1 -1
  187. package/dist/ripple/{p-dddeb54c.entry.js → p-d9d16c9d.entry.js} +1 -1
  188. package/dist/ripple/{p-79e2e6f0.system.entry.js → p-da88bdfa.system.entry.js} +1 -1
  189. package/dist/ripple/{p-bf42cf44.system.entry.js → p-defdef0c.system.entry.js} +1 -1
  190. package/dist/ripple/{p-d4fe10ec.entry.js → p-e70f1e74.entry.js} +1 -1
  191. package/dist/ripple/{p-719ade3d.system.entry.js → p-eee663f4.system.entry.js} +1 -1
  192. package/dist/ripple/{p-325393da.js → p-f031ced7.js} +1 -1
  193. package/dist/ripple/{p-685863a1.system.entry.js → p-f2b09954.system.entry.js} +1 -1
  194. package/dist/ripple/p-f32ca8fa.entry.js +1 -0
  195. package/dist/ripple/{p-c8d6b61a.system.js → p-f503991a.system.js} +1 -1
  196. package/dist/ripple/{p-8c0ba5b7.entry.js → p-f6844f41.entry.js} +1 -1
  197. package/dist/ripple/{p-5f822c17.system.entry.js → p-f91c86d2.system.entry.js} +1 -1
  198. package/dist/ripple/{p-ff70ddd9.entry.js → p-fc67950d.entry.js} +1 -1
  199. package/dist/ripple/{p-7457705b.system.entry.js → p-fce3ce5c.system.entry.js} +1 -1
  200. package/dist/ripple/{p-4eb3a4a9.system.entry.js → p-fe49bfb7.system.entry.js} +1 -1
  201. package/dist/ripple/{p-56d17ec6.js → p-fe625125.js} +1 -1
  202. package/dist/ripple/{p-5b0fe876.entry.js → p-ff25bdd6.entry.js} +1 -1
  203. package/dist/ripple/{p-a35a0e24.entry.js → p-ffa6f621.entry.js} +1 -1
  204. package/dist/ripple/ripple.esm.js +1 -1
  205. package/dist/ripple/ripple.js +1 -1
  206. package/dist/types/components/charts/chartFunctions.d.ts +1 -0
  207. package/dist/types/components/charts/priv-chart-popover/priv-chart-popover.d.ts +1 -1
  208. package/dist/types/components/charts/wm-chart/wm-chart.d.ts +1 -1
  209. package/dist/types/components/charts/wm-chart-bar/wm-chart-bar.d.ts +7 -16
  210. package/dist/types/components/charts/wm-progress-monitor/wm-progress-indicator.d.ts +1 -1
  211. package/dist/types/components/selects/wm-select/wm-select.d.ts +3 -2
  212. package/dist/types/components.d.ts +2 -2
  213. package/dist/types/global/interfaces.d.ts +13 -4
  214. package/package.json +2 -2
  215. package/dist/esm-es5/app-globals-e00b1feb.js +0 -1
  216. package/dist/esm-es5/interfaces-30d10bc0.js +0 -1
  217. package/dist/ripple/p-1eae5841.entry.js +0 -1
  218. package/dist/ripple/p-30a65553.system.js +0 -1
  219. package/dist/ripple/p-38a6a099.system.js +0 -1
  220. package/dist/ripple/p-7f333b52.entry.js +0 -1
  221. package/dist/ripple/p-98b9e488.js +0 -1
  222. package/dist/ripple/p-b7f12170.entry.js +0 -1
  223. package/dist/ripple/p-c9e6cb3d.system.js +0 -1
  224. package/dist/ripple/p-d6effc35.system.js +0 -1
  225. package/dist/ripple/p-f210f4ff.js +0 -1
@@ -1,6 +1,6 @@
1
1
  import { h, Host } from "@stencil/core";
2
- import { chartPaletteDiscrete, chartPaletteSemantic, } from "../../../global/interfaces";
3
- import { formatDisplayValue, suffixNumber, renderInstructionsText, findLargestNiceInterval, getMaxTicks, } from "../chartFunctions";
2
+ import { chartPalettes, } from "../../../global/interfaces";
3
+ import { formatDisplayValue, suffixNumber, renderInstructionsText, findLargestNiceInterval, getMaxTicks, findNiceRoundNumber, } from "../chartFunctions";
4
4
  import { chartMessages } from "../../../global/intl";
5
5
  import { isElOrChild } from "../../../global/functions";
6
6
  export class ChartBar {
@@ -21,10 +21,10 @@ export class ChartBar {
21
21
  var _a, _b, _c, _d;
22
22
  let palette = ["wmcolor-dataviz-discrete-01"]; // default to single color
23
23
  if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.colors) === "semantic") {
24
- palette = chartPaletteSemantic;
24
+ palette = chartPalettes.semantic;
25
25
  }
26
26
  else if (((_b = this.config) === null || _b === void 0 ? void 0 : _b.colors) == "discrete") {
27
- palette = chartPaletteDiscrete;
27
+ palette = chartPalettes.discrete;
28
28
  }
29
29
  else if ((_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.colors) === null || _d === void 0 ? void 0 : _d.startsWith("wmcolor-")) {
30
30
  palette = [this.config.colors];
@@ -43,6 +43,10 @@ export class ChartBar {
43
43
  var _a;
44
44
  return this.subinfo || ((_a = this.config) === null || _a === void 0 ? void 0 : _a.subinfo) || "";
45
45
  }
46
+ get gridVisible() {
47
+ var _a, _b, _c;
48
+ return !!this.gridInfo && ((_a = this.config) === null || _a === void 0 ? void 0 : _a.gridMax) != undefined && ((_c = (_b = this.config) === null || _b === void 0 ? void 0 : _b.showGrid) !== null && _c !== void 0 ? _c : true);
49
+ }
46
50
  // #endregion getters
47
51
  ////////////////////////////////////////////////////////////
48
52
  // #region Component lifecycle
@@ -63,10 +67,16 @@ export class ChartBar {
63
67
  if (this.config && this.data) {
64
68
  const itemTotal = this.data.reduce((acc, item) => acc + item.amount, 0);
65
69
  const largest = Math.max(...this.data.map((item) => item.amount));
66
- // Use config.gridMax if specified, otherwise calculate from data
67
- // Even when the grid is not displayed (undefined), we need a gridMax to calculate the bar widths
68
- this.gridMax =
69
- this.config.gridMax === "auto" || this.config.gridMax === undefined ? largest : this.config.gridMax;
70
+ if (this.config.gridMax == "auto") {
71
+ this.gridMax = findNiceRoundNumber(largest);
72
+ }
73
+ else if (!!this.config.gridMax) {
74
+ this.gridMax = this.config.gridMax;
75
+ }
76
+ else {
77
+ // fallback to 1 and chart should not render
78
+ this.gridMax = 1;
79
+ }
70
80
  const processedItems = this.processItems(itemTotal);
71
81
  if (this.sort === "ascending") {
72
82
  processedItems.sort((a, b) => a.amount - b.amount);
@@ -80,6 +90,9 @@ export class ChartBar {
80
90
  }
81
91
  processItems(itemTotal) {
82
92
  var _a, _b;
93
+ if (!this.data) {
94
+ return [];
95
+ }
83
96
  const valueFormat = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.valueFormat) || "amount"; // default to amount
84
97
  const printModeFormat = ((_b = this.config) === null || _b === void 0 ? void 0 : _b.printModeFormat) || "amount"; // default to amount
85
98
  const defaultColor = "wmcolor-dataviz-discrete-01";
@@ -170,21 +183,15 @@ export class ChartBar {
170
183
  this.highlightBar(idx);
171
184
  }
172
185
  }
173
- handleExternalLegendItemClick(ev) {
186
+ handleLegendItemClick(ev) {
174
187
  if (ev.target.nodeName === "WM-CHART-LEGEND") {
175
- // Only considers external legends, event target of internal legends is the chart
188
+ // If event from an internal legend bubbles up to the chart, ignore it
176
189
  const legendEl = ev.target;
177
190
  if (legendEl.chartIds.includes(this.el.id)) {
178
191
  this.highlightBar(ev.detail.idx);
179
192
  }
180
193
  }
181
194
  }
182
- handleInternalLegendItemClick(ev) {
183
- const legendEl = ev.target;
184
- if (legendEl.chartIds.includes(this.el.id)) {
185
- this.highlightBar(ev.detail.idx);
186
- }
187
- }
188
195
  handleDocumentClick(_ev) {
189
196
  // Clear highlights when highlight is set from an external legend (not opening a popover)
190
197
  if (!this.popoverEl.open) {
@@ -219,7 +226,7 @@ export class ChartBar {
219
226
  y: barToFocus.getBoundingClientRect().top + cornerOffset,
220
227
  });
221
228
  }
222
- handlePopoverOpenChanged(_ev) {
229
+ handlePopoverToggled(_ev) {
223
230
  setTimeout(() => {
224
231
  // allow time for the popover to reopen if the click that closed it was on a bar, to prevent flash
225
232
  if (this.popoverEl.open) {
@@ -231,6 +238,9 @@ export class ChartBar {
231
238
  }, 30);
232
239
  }
233
240
  openPopover(clickedProcessedData, coords) {
241
+ if (!this.data || !this.config) {
242
+ return;
243
+ }
234
244
  let matchingChartData = this.data.find((item) => item.barLegend === clickedProcessedData.barLegend);
235
245
  if (matchingChartData) {
236
246
  this.popoverEl.chartData = matchingChartData;
@@ -262,7 +272,6 @@ export class ChartBar {
262
272
  clearFocus() {
263
273
  if (this.popoverEl.open) {
264
274
  this.popoverEl.open = false;
265
- console.log("popover closed from clearFocus: ", this.popoverEl.open);
266
275
  }
267
276
  this.clearHighlights();
268
277
  }
@@ -274,6 +283,9 @@ export class ChartBar {
274
283
  return this.processedData.map((item) => (h("div", { key: `legend-${item.barLegend}`, class: "bar-legend" }, item.barLegend)));
275
284
  }
276
285
  renderBars() {
286
+ if (!this.gridInfo || !this.processedData) {
287
+ return;
288
+ }
277
289
  // Use effective grid max (numTicks * interval) for accurate bar sizing
278
290
  const effectiveGridMax = this.gridInfo.numTicks * this.gridInfo.interval;
279
291
  return this.processedData.map((item, idx) => {
@@ -287,17 +299,19 @@ export class ChartBar {
287
299
  _a.tickLabels.map((label) => (h("div", { class: "tick", key: label }, h("span", null, label))))));
288
300
  }
289
301
  renderGrid() {
290
- return h("div", { class: "grid-lines", style: { "--background-size": this.gridInfo.backgroundSize } });
302
+ var _a;
303
+ const backgroundSize = (_a = this.gridInfo) === null || _a === void 0 ? void 0 : _a.backgroundSize;
304
+ return h("div", { class: "grid-lines", style: { "--background-size": backgroundSize } });
291
305
  }
292
306
  renderLegend(orientation) {
293
307
  var _a, _b, _c;
294
- return (h("div", { class: `legend --${orientation} --${this.showLegend}` }, h("wm-chart-legend", { orientation: orientation, chartIds: this.el.id, processedData: this.processedData, printMode: (_c = (_a = this.printMode) !== null && _a !== void 0 ? _a : (_b = this.config) === null || _b === void 0 ? void 0 : _b.printMode) !== null && _c !== void 0 ? _c : false, onWmLegendItemClick: (ev) => this.handleInternalLegendItemClick(ev) })));
308
+ return (h("div", { class: `legend --${orientation} --${this.showLegend}` }, h("wm-chart-legend", { orientation: orientation, chartIds: this.el.id, processedData: this.processedData, printMode: (_c = (_a = this.printMode) !== null && _a !== void 0 ? _a : (_b = this.config) === null || _b === void 0 ? void 0 : _b.printMode) !== null && _c !== void 0 ? _c : false, onWmLegendItemClick: (ev) => this.handleLegendItemClick(ev) })));
295
309
  }
296
310
  // #endregion rendering
297
311
  render() {
298
312
  var _a, _b, _c, _d, _e, _f, _g;
299
313
  const rowCount = this.processedData.length || 1;
300
- return (h(Host, { key: '2fe75003c819b49d5de618eea92bbd2fcfc10723' }, h("div", { key: '48f496b705d9571f9386dfddaaaddbd414836252', class: "component-wrapper", tabindex: "0", role: "application", onKeyDown: (ev) => this.handleChartKeyDown(ev), onBlur: (ev) => this.handleComponentBlur(ev), "aria-roledescription": chartMessages.interactiveChart, "aria-describedby": "chart-instructions", "aria-label": (_a = this.config) === null || _a === void 0 ? void 0 : _a.label }, h("div", { key: '9f78d67d37c8048554127adbd40ee94409dcc575', class: "popover-wrapper" }, h("priv-chart-popover", { key: '9d1f5bf3bb3d1af0a36b2c0e7d53a7e56f23ce9d', ref: (el) => (this.popoverEl = el), onIntChartPopoverOpenChanged: (ev) => this.handlePopoverOpenChanged(ev) })), h("label", { key: 'c111aecf07f21b19422804a21ffeba9632258309', id: "label", class: `label --${(_b = this.config) === null || _b === void 0 ? void 0 : _b.labelPosition}` }, h("span", { key: 'bb866688ed8f54ded76bfdff8ca54437322dc73d', class: "label-text" }, (_c = this.config) === null || _c === void 0 ? void 0 : _c.label), this.subinfoText ? h("span", { class: "subinfo" }, this.subinfoText) : ""), this.showLegend === "top" && this.renderLegend("horizontal"), h("div", { key: '58a8f0c8932fa214311ef73fac64925d2eb1cb74', class: "chart-wrapper" }, h("div", { key: '1ad4c29e26a7d5fb3e23b54d25ce639adbceedd9', class: "chart-left-side" }, this.showLegend === "left" && this.renderLegend("vertical"), h("div", { key: '5f7aeb14ab9101f1fd38c811d9ac17660c5055d5', class: "category-axis-label" }, h("span", { key: 'bc99815352064b5b62efc9634d0f623b29e56c19', class: "axis-label-text" }, (_d = this.config) === null || _d === void 0 ? void 0 : _d.categoryAxisLabel))), h("div", { key: '1b968d3f687215a65ddd3bc6e39bc96dd908c68c', class: "chart-center" }, h("div", { key: '6da38ae08882fed85387427d8c36984160ac805a', class: "chart-area", style: { "--row-count": rowCount.toString() } }, this.processedData && this.renderBarLegends(), h("div", { key: '1413e4f4a62e10cf7236d87b38b96932f3bd713a', class: `bar-area ${this.isKeying ? "user-is-keying" : ""}`, ref: (el) => (this.barAreaEl = el) }, this.gridInfo && ((_e = this.config) === null || _e === void 0 ? void 0 : _e.gridMax) != undefined && this.renderGrid(), this.gridInfo && this.processedData && this.renderBars())), h("div", { key: '5021bad3a65b05b5280a63320dacfab6b560ab88', class: "value-axis-label" }, h("span", { key: 'c2b06b622ef28a16423eaa277c31e7c298ed431d', class: "axis-label-text" }, (_f = this.config) === null || _f === void 0 ? void 0 : _f.valueAxisLabel)), this.gridInfo && ((_g = this.config) === null || _g === void 0 ? void 0 : _g.gridMax) != undefined && this.renderXAxis()), h("div", { key: '49ae3d55b3172a5d98cb26b6bbdd59c277b38b57', class: "chart-right-side" }, this.showLegend === "right" && this.renderLegend("vertical"))), this.showLegend === "bottom" && this.renderLegend("horizontal"), renderInstructionsText())));
314
+ return (h(Host, { key: '778b8642fd4cef3d90949740fce75151aaf44654' }, h("div", { key: 'dbcf9dfb3a3923e4e8fed64cb7f65d09d04192f1', class: "component-wrapper", tabindex: "0", role: "application", onKeyDown: (ev) => this.handleChartKeyDown(ev), onBlur: (ev) => this.handleComponentBlur(ev), "aria-roledescription": chartMessages.interactiveChart, "aria-describedby": "chart-instructions", "aria-label": (_a = this.config) === null || _a === void 0 ? void 0 : _a.label }, h("div", { key: '011f7671bbf2346282582cbcafb5b6e2fc1b2c68', class: "popover-wrapper" }, h("priv-chart-popover", { key: '37073f1f5b48dd11563d614ccd4a39fd0d875926', ref: (el) => (this.popoverEl = el), onIntChartPopoverToggled: (ev) => this.handlePopoverToggled(ev) })), ((_c = (_b = this.config) === null || _b === void 0 ? void 0 : _b.showLabel) !== null && _c !== void 0 ? _c : true) && (h("label", { key: '59ce163b9551a0889a1ab69e00a8ae66f7d153de', id: "label", class: "label" }, h("span", { key: 'f9d24cee45469b072953e6e237ccbe2c740678c4', class: "label-text" }, (_d = this.config) === null || _d === void 0 ? void 0 : _d.label), this.subinfoText ? h("span", { class: "subinfo" }, this.subinfoText) : "")), this.showLegend === "top" && this.renderLegend("horizontal"), h("div", { key: '3f20081198b084e9336cfcca7ca206292446c2d2', class: "chart-wrapper" }, h("div", { key: '71c59296c0af14515241d781e44ff512bfa89cc2', class: "chart-left-side" }, this.showLegend === "left" && this.renderLegend("vertical"), h("div", { key: '11f895eda739c0af71f2f889595dfc35ea96e771', class: "category-axis-label" }, h("span", { key: '79043541f3efbc80ae165ad739af82ed89c51790', class: "axis-label-text" }, (_e = this.config) === null || _e === void 0 ? void 0 : _e.categoryAxisLabel))), h("div", { key: '0e88bfb0103df986f53dd3974adcf8932145a8d8', class: "chart-center" }, h("div", { key: 'eab8dfc1ae2fabb1caa95f4e91e8d901396a44dd', class: "chart-area", style: { "--row-count": rowCount.toString() } }, this.processedData && this.renderBarLegends(), h("div", { key: 'ae7fa3dd860b987af14ee1ffd2a48bb521745ec0', class: `bar-area ${this.isKeying ? "user-is-keying" : ""}`, ref: (el) => (this.barAreaEl = el) }, this.gridVisible && this.renderGrid(), ((_f = this.config) === null || _f === void 0 ? void 0 : _f.gridMax) != undefined && this.renderBars())), h("div", { key: '1e20f60338bbde68234a6315cac9fdecbb36c8ef', class: "value-axis-label" }, h("span", { key: 'a96919a4a6e540bffd0f8f40e8b791888944605e', class: "axis-label-text" }, (_g = this.config) === null || _g === void 0 ? void 0 : _g.valueAxisLabel)), this.gridVisible && this.renderXAxis()), h("div", { key: 'e9f6910f160952676ddf30f90c824277752d20d9', class: "chart-right-side" }, this.showLegend === "right" && this.renderLegend("vertical"))), this.showLegend === "bottom" && this.renderLegend("horizontal"), renderInstructionsText())));
301
315
  }
302
316
  static get is() { return "wm-chart-bar"; }
303
317
  static get encapsulation() { return "shadow"; }
@@ -318,7 +332,7 @@ export class ChartBar {
318
332
  "mutable": false,
319
333
  "complexType": {
320
334
  "original": "ChartConfig",
321
- "resolved": "undefined | { label: string; labelPosition: \"top\" | \"none\"; valueAxisLabel: string; categoryAxisLabel: string; printMode: boolean; printModeFormat: \"amount\" | \"percentage\"; gridMax?: number | \"auto\" | undefined; sort?: \"none\" | \"ascending\" | \"descending\" | undefined; showLegend?: \"top\" | \"bottom\" | \"left\" | \"right\" | \"none\" | undefined; subinfo?: string | undefined; completionMessage?: string | undefined; valueFormat?: \"none\" | \"amount\" | \"percentage\" | undefined; colors?: string | undefined; popoverTitle?: string | undefined; popoverText?: string | undefined; popoverButtonText?: string | undefined; }",
335
+ "resolved": "undefined | { label: string; showLabel: boolean; valueAxisLabel: string; categoryAxisLabel: string; printMode: boolean; printModeFormat: \"amount\" | \"percentage\"; gridMax: number | \"auto\"; sort?: \"ascending\" | \"descending\" | \"none\" | undefined; showLegend?: \"top\" | \"bottom\" | \"left\" | \"right\" | \"none\" | undefined; showGrid?: boolean | undefined; subinfo?: string | undefined; completionMessage?: string | undefined; valueFormat?: \"amount\" | \"percentage\" | \"none\" | undefined; colors?: string | undefined; popoverTitle?: string | undefined; popoverText?: string | undefined; popoverButtonText?: string | undefined; }",
322
336
  "references": {
323
337
  "ChartConfig": {
324
338
  "location": "import",
@@ -432,7 +446,7 @@ export class ChartBar {
432
446
  static get listeners() {
433
447
  return [{
434
448
  "name": "wmLegendItemClick",
435
- "method": "handleExternalLegendItemClick",
449
+ "method": "handleLegendItemClick",
436
450
  "target": "document",
437
451
  "capture": false,
438
452
  "passive": false
@@ -448,24 +462,12 @@ export class ChartBar {
448
462
  "target": "window",
449
463
  "capture": false,
450
464
  "passive": false
451
- }, {
452
- "name": "wmUserIsTabbing",
453
- "method": "handleUserIsKeying",
454
- "target": "window",
455
- "capture": false,
456
- "passive": false
457
465
  }, {
458
466
  "name": "wmUserIsNotKeying",
459
467
  "method": "handleUserIsNotKeying",
460
468
  "target": "window",
461
469
  "capture": false,
462
470
  "passive": false
463
- }, {
464
- "name": "wmUserIsNotTabbing",
465
- "method": "handleUserIsNotKeying",
466
- "target": "window",
467
- "capture": false,
468
- "passive": false
469
471
  }];
470
472
  }
471
473
  }
@@ -7,11 +7,8 @@ export class Select {
7
7
  this.scrollableParents = [];
8
8
  this.returnFocus = false;
9
9
  this.hasAnchor = CSS.supports("top", "anchor(bottom)"); // for FF polyfill
10
- //////////////////////////////////////
11
- // for multiselect button text
12
- this.overflowCount = 0;
13
10
  this.displayedOptions = [];
14
- this.previousDisplayedOptions = [];
11
+ this.oldDisplayText = "";
15
12
  this.debouncedReposition = debounce(() => {
16
13
  this.dropdownPosition();
17
14
  }, 100);
@@ -39,6 +36,9 @@ export class Select {
39
36
  // string "false" needs to be treated as bool False because react wrappers convert bool to string.
40
37
  return toBool(this.disabled);
41
38
  }
39
+ get displayText() {
40
+ return this.displayedOptions.map((x) => x.textContent).join(", ");
41
+ }
42
42
  get selectedOptions() {
43
43
  return Array.from(this.el.querySelectorAll("wm-option")).filter((x) => x.selected);
44
44
  }
@@ -274,22 +274,27 @@ export class Select {
274
274
  this.announcement = message;
275
275
  }
276
276
  handleOverflow() {
277
- // handle overflow + counter for multiselect
278
- // this is a fixed measurement accounting for the max width of a 3 character overflow counter
279
- const overflowCounterWidth = 38;
280
- const computedStyle = window.getComputedStyle(this.buttonEl);
281
- // there seems to be no quick way to get an elements width without padding, except for subtracting padding manually
282
- const paddingLeft = parseInt(computedStyle.getPropertyValue("padding-left").slice(0, -2));
283
- const paddingRight = parseInt(computedStyle.getPropertyValue("padding-right").slice(0, -2));
284
- const availableSpace = this.buttonEl.clientWidth - paddingLeft - paddingRight - overflowCounterWidth;
285
- this.overflowCount = 0;
286
- this.measurementAreaEl.textContent = this.displayedOptions.map((x) => x.textContent).join(", ");
287
- let optionsTotalWidth = this.measurementAreaEl.clientWidth;
288
- while (optionsTotalWidth > availableSpace && this.displayedOptions.length > 1) {
289
- this.overflowCount++;
290
- this.displayedOptions.pop();
291
- this.measurementAreaEl.textContent = this.displayedOptions.map((x) => x.textContent).join(", ");
292
- optionsTotalWidth = this.measurementAreaEl.clientWidth;
277
+ if (!this.buttonEl) {
278
+ forceUpdate(this.el);
279
+ }
280
+ else {
281
+ // handle overflow + counter for multiselect
282
+ // this is a fixed measurement accounting for the max width of a 3 character overflow counter
283
+ const overflowCounterWidth = 38;
284
+ const computedStyle = window.getComputedStyle(this.buttonEl);
285
+ // there seems to be no quick way to get an elements width without padding, except for subtracting padding manually
286
+ const paddingLeft = parseInt(computedStyle.getPropertyValue("padding-left").slice(0, -2));
287
+ const paddingRight = parseInt(computedStyle.getPropertyValue("padding-right").slice(0, -2));
288
+ const availableSpace = this.buttonEl.clientWidth - paddingLeft - paddingRight - overflowCounterWidth;
289
+ this.overflowCount = 0;
290
+ this.measurementAreaEl.textContent = this.displayText;
291
+ let optionsTotalWidth = this.measurementAreaEl.clientWidth;
292
+ while (optionsTotalWidth > availableSpace && this.displayedOptions.length > 1) {
293
+ this.overflowCount++;
294
+ this.displayedOptions.pop();
295
+ this.measurementAreaEl.textContent = this.displayText;
296
+ optionsTotalWidth = this.measurementAreaEl.clientWidth;
297
+ }
293
298
  }
294
299
  }
295
300
  setButtonText() {
@@ -299,28 +304,34 @@ export class Select {
299
304
  }
300
305
  else {
301
306
  this.displayedOptions = this.childOptions.filter((x) => x.selected);
302
- const hasChanged = this.displayedOptions !== this.previousDisplayedOptions;
307
+ const hasChanged = this.displayText !== this.oldDisplayText;
303
308
  const noDisplayedOptions = this.displayedOptions.length < 1;
304
309
  if (noDisplayedOptions) {
310
+ this.overflowCount = 0;
305
311
  return this.placeholder;
306
312
  }
307
- else if (!this.buttonEl) {
308
- forceUpdate(this.el);
309
- return "";
310
- }
311
313
  else if (hasChanged) {
312
314
  this.handleOverflow();
313
- // we need to calc overflowcount as we only want to display allSelected message if there is an overflow...
314
- if (this.overflowCount > 0 && this.allSelected) {
315
- // ...but it should be reset so it isn't displayed in that case
316
- this.overflowCount = 0;
315
+ if (this.allSelected) {
316
+ // we want all selected message only if there's an overflow.
317
+ if (!this.overflowCount) {
318
+ // but on first render we don't know: handleOverflow can't calculate measurements
319
+ // in that case, display all selected message even if there's a chance options could have been shown
320
+ this.buttonText = this.allSelectedMessage;
321
+ }
322
+ else if (this.overflowCount > 0)
323
+ // if calc could be made and there is an overflow, reset it as it shouldn't be shown
324
+ this.overflowCount = 0;
325
+ // then display all selected message
317
326
  this.buttonText = this.allSelectedMessage;
318
327
  }
319
328
  else {
320
- this.buttonText = this.displayedOptions.map((x) => x.textContent).join(", ");
329
+ // otherwise, if handleOverflow was able to calculate, it set the count and the display text
330
+ // if it wasn't able to calculate, the text of all the selected options will be displayed and may truncate (acceptable as fallback)
331
+ this.buttonText = this.displayText;
321
332
  }
322
333
  }
323
- this.previousDisplayedOptions = this.displayedOptions;
334
+ this.oldDisplayText = this.displayText;
324
335
  // the reason for setting a global variable and returning it
325
336
  // is that we need the stored value when displayedOptions haven't changed.
326
337
  return this.buttonText; // multiselect value
@@ -333,14 +344,14 @@ export class Select {
333
344
  }
334
345
  render() {
335
346
  const showSubinfo = !this.multiple && this.selectedOptions.length > 0 && this.selectedOptions[0].subinfo;
336
- return (h(Host, { key: '32eda81294981e2d46b283c469f7373f9984dbdd', onBlur: (ev) => this.handleComponentBlur(ev) }, h("div", { key: 'dc3e7f782326beda2517cf8878516d4d23576bf3', class: `wrapper ${getTextDir()} label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { key: '0ddf3269d861b1d252876b587346739e978117fe', class: "label-wrapper" }, h("label", { key: '78493121ecada1718c1f0de42cdc09289d000bc9', class: "label", id: "label", htmlFor: "selectbtn", onMouseEnter: (ev) => this.handleLabelMouseEnter(ev), onMouseLeave: () => hideTooltip() }, this.label),
347
+ return (h(Host, { key: 'b9e427db71b61d4731a3c8c31826358efb2e71c9', onBlur: (ev) => this.handleComponentBlur(ev) }, h("div", { key: '6a8ad960dfcf56ba23736c5dc7306517a0f4cc61', class: `wrapper ${getTextDir()} label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { key: 'a1829bc5949a9e75629bb645ab63331af4ae71f1', class: "label-wrapper" }, h("label", { key: '329944256ca0c0a76881b03192579849106fc0b8', class: "label", id: "label", htmlFor: "selectbtn", onMouseEnter: (ev) => this.handleLabelMouseEnter(ev), onMouseLeave: () => hideTooltip() }, this.label),
337
348
  // we can't use aria-required because the listbox is in a sub-component and it is not announced
338
- this.requiredField && (h("span", { key: 'dfa3603962893e5fe6542924561fbe31828b694b', class: "required" }, h("span", { key: '478a6d2c7e9bb56dea7165a1e762bc3a136c7c1d', class: "sr-only" }, globalMessages.requiredField), h("span", { key: '8f3115f4a09dc109ed4580be49e3a704bd643ca0', "aria-hidden": "true" }, "*")))), h("div", { key: 'cbe6cc0600f11352dfc81a5a991805e757256906', class: "button-wrapper" }, h("button", { key: 'e943b99068a8822a65d8cc8ae6ab61999ac8a511', id: "selectbtn", disabled: this.isDisabled, "aria-labelledby": "label selectbtn", "aria-describedby": "error", popoverTarget: "dropdown", popoverTargetAction: "toggle", class: "displayedoption", ref: (el) => (this.buttonEl = el) }, h("span", { key: 'e914e5cc9eabfe311e4ed57ee92744b14e3828e4', class: `overflowcontrol ${showSubinfo ? "hassubinfo" : ""}` }, h("span", { key: '095981a63cea28e0dbcdc269401eb511694739f6', class: "button-text" }, this.setButtonText()), showSubinfo && h("span", { key: 'd006aadc9c414abf0dfefc05d8fbff9c0fc1c370', class: "subinfo" }, this.selectedOptions[0].subinfo)), h("div", { key: '77054ec91448bc021ce4a4bacfa5a1a8130e34d3', class: `expand-icon svg-icon ${this.isExpanded ? "svg-expand-less" : "svg-expand-more"}` }), this.renderOverflowCount(), h("div", { key: '1719132ac678c1a8a530e3b7f2fc3c67cd7c73ae', ref: (el) => (this.measurementAreaEl = el), class: "measurement-area", "aria-hidden": "true" })), h("div", { key: 'dc968de113b89cdf848d7a231b097a4d2308b357',
349
+ this.requiredField && (h("span", { key: '5a7d128c99b2eb064c038aecca4097304775b94c', class: "required" }, h("span", { key: 'fea081b4029d61add6f8a1a6743e30eb64329f89', class: "sr-only" }, globalMessages.requiredField), h("span", { key: 'a8f8fd3695883555ccfdf1d63a56aa0b54472ac7', "aria-hidden": "true" }, "*")))), h("div", { key: 'd8c783d92db1f7599ad431ff14069d26f335efee', class: "button-wrapper" }, h("button", { key: '56a36ae5267f5323a595f411d9a4a7257e04ede1', id: "selectbtn", disabled: this.isDisabled, "aria-labelledby": "label selectbtn", "aria-describedby": "error", popoverTarget: "dropdown", popoverTargetAction: "toggle", class: "displayedoption", ref: (el) => (this.buttonEl = el) }, h("span", { key: 'f026cf1c1f331ef84253a55df3308e518e8c38ed', class: `overflowcontrol ${showSubinfo ? "hassubinfo" : ""}` }, h("span", { key: 'c48385d25e0ac06b1faa8b5760949c4e3872a6c1', class: "button-text" }, this.setButtonText()), showSubinfo && h("span", { key: 'd47f6e6ccb3dfda11fdfd74c3880038a3582f593', class: "subinfo" }, this.selectedOptions[0].subinfo)), h("div", { key: 'ec2f38fce7005421341b176bbb9a07a2f4f930f2', class: `expand-icon svg-icon ${this.isExpanded ? "svg-expand-less" : "svg-expand-more"}` }), this.renderOverflowCount(), h("div", { key: '76e51beef029574af384673324937b78631baac0', ref: (el) => (this.measurementAreaEl = el), class: "measurement-area", "aria-hidden": "true" })), h("div", { key: '5ada44373bccb9ff83b8d33d5454f197fdbcece2',
339
350
  // is-open is for the CSS transition in modern browsers
340
351
  // hidden is to wait for position calculations in Firefox
341
352
  class: `dropdown ${this.isExpanded ? "is-open" : ""} ${this.isHidden ? "hidden" : ""} ${this.openUp ? "upward" : ""}`, id: "dropdown", popover: "auto", ref: (el) => (this.dropdownEl = el),
342
353
  // @ts-ignore -- don't tell typescript but we're in the future
343
- onToggle: (ev) => this.handleToggle(ev) }, h("priv-option-list", { key: '64518e2aa66f3373417506a4126fcec27de552f5', ref: (el) => (this.optionListEl = el), multiple: this.multiple, search: this.search, selectAll: this.selectAll, maxHeight: this.maxHeight, searchPlaceholder: this.searchPlaceholder, onOptionListCloseRequested: () => {
354
+ onToggle: (ev) => this.handleToggle(ev) }, h("priv-option-list", { key: '85262c7c088219e1bb7e50953c4fd058d8750a12', ref: (el) => (this.optionListEl = el), multiple: this.multiple, search: this.search, selectAll: this.selectAll, maxHeight: this.maxHeight, searchPlaceholder: this.searchPlaceholder, onOptionListCloseRequested: () => {
344
355
  this.dropdownEl.hidePopover();
345
356
  }, onOptionListAllSelected: () => {
346
357
  this.returnFocus = true;
@@ -348,7 +359,7 @@ export class Select {
348
359
  }, onOptionListAllDeselected: () => {
349
360
  this.returnFocus = true;
350
361
  this.wmSelectAllDeselected.emit();
351
- } }, h("slot", { key: '138d16484638a094fd0664982e30149888cc3270' }))), h("div", { key: 'fc644fe425fc73337558af6dc809893e0574ba9a', id: "error", class: this.errorMessage ? "error-message" : "" }, this.errorMessage), h("div", { key: 'a6f373b32a1dc83a788bfd17ee410e23a6d53001', id: "announcement", "aria-live": "polite", "aria-atomic": "true", class: "sr-only", ref: (el) => (this.liveRegionEl = el) }, this.announcement)))));
362
+ } }, h("slot", { key: '66b4a65b4477b82cb8e0073cc49842e4d2a9e724' }))), h("div", { key: 'a3e19f185805e5ce1818fbc101e8e41ebeda3b8d', id: "error", class: this.errorMessage ? "error-message" : "" }, this.errorMessage), h("div", { key: 'e524c3fdfc16d96750e7ddfa84207fb92803b648', id: "announcement", "aria-live": "polite", "aria-atomic": "true", class: "sr-only", ref: (el) => (this.liveRegionEl = el) }, this.announcement)))));
352
363
  }
353
364
  static get is() { return "wm-select"; }
354
365
  static get encapsulation() { return "shadow"; }
@@ -31,10 +31,8 @@ export class Modal {
31
31
  return customElementToFocus;
32
32
  }
33
33
  get hasBrowserPopoverSupport() {
34
- // for browsers without popover support, render an additional tooltip in the top-layer so that it can be displayed above the dialog element
35
- const tooltipEl = document.getElementById("wm-tooltip");
36
- //@ts-ignore
37
- return tooltipEl ? !!tooltipEl.showPopover : false;
34
+ // For browsers without popover support, render a fallback tooltip inside the dialog so it appears above it
35
+ return typeof HTMLElement.prototype.showPopover === 'function';
38
36
  }
39
37
  toggleModal() {
40
38
  this.open ? this.showModal() : this.hideModal();
@@ -116,11 +114,11 @@ export class Modal {
116
114
  }
117
115
  }
118
116
  render() {
119
- return (h("dialog", { key: '7e79523b945c00909991a3dcfecfda79e92c882b', class: `${"wm-" + this.modalType}`, "aria-labelledby": `wm-modal-heading-text-${this.uid}`, ref: (el) => (this.dialogEl = el), onKeyDown: (ev) => this.handleKeyDown(ev) }, h("div", { key: 'c032006260d0c083a5b796e20705cb99f6fa44b9', class: "tabtrap sr-only", tabindex: "0", onFocus: (ev) => {
117
+ return (h("dialog", { key: '633554a1b1e5df10d410e1c31e2f960642718e57', class: `${"wm-" + this.modalType}`, "aria-labelledby": `wm-modal-heading-text-${this.uid}`, ref: (el) => (this.dialogEl = el), onKeyDown: (ev) => this.handleKeyDown(ev) }, h("div", { key: '3d6d3bbce8760bfb1e642771f534b1d603f6a74b', class: "tabtrap sr-only", tabindex: "0", onFocus: (ev) => {
120
118
  const focusedFromCloseButton = ev.relatedTarget && ev.relatedTarget == this.closeButtonEl;
121
119
  // no related target means we're coming from outside the page (browser chrome), and first element should be focused instead
122
120
  focusedFromCloseButton ? this.focusLastElement.emit() : this.focusFirstElement.emit();
123
- } }), !this.hasBrowserPopoverSupport && h("div", { key: '384ed4e4fa347e50d1f9c78a3c1d84d6dab9f34a', class: "wm-tooltip" }), h("slot", { key: '6ec6ba8b0b90db721ff1e29db8f259d2f1cff6d0' }), h("div", { key: '3795b7025286e5d4f542cfccad9c6851d2f22a8d', class: "tabtrap sr-only", tabindex: "0", onFocus: () => {
121
+ } }), !this.hasBrowserPopoverSupport && h("div", { key: '7c660029e60f4b8df004dd3b830025f047710ccc', class: "wm-tooltip" }), h("slot", { key: '7779d237802e80dd2c7f84516bd1327438813ce2' }), h("div", { key: 'eb2fa33d5fdae1b8c41102380471c593b10e1826', class: "tabtrap sr-only", tabindex: "0", onFocus: () => {
124
122
  this.focusFirstElement.emit();
125
123
  } })));
126
124
  }
@@ -12,13 +12,11 @@ setTimeout(() => {
12
12
  barChart1.config = {
13
13
  label: "Number of Students by Department",
14
14
  subinfo: "University of Education",
15
- labelPosition: "top",
16
- labelWidth: "150px",
17
15
  valueAxisLabel: "Students",
18
16
  categoryAxisLabel: "University Departments",
19
17
  printMode: true,
20
18
  printModeFormat: "percentage",
21
- gridMax: 1000,
19
+ gridMax: 2000,
22
20
  popoverTitle: "Config Title",
23
21
  popoverText: "Description set by the config",
24
22
  popoverButtonText: "View Details",
@@ -289,7 +289,7 @@ export function showTooltip(placement, anchorEl, tooltipText) {
289
289
  // this additional tooltip is only rendered in browsers that do not support popover
290
290
  const tooltipEls = document.querySelectorAll(".wm-tooltip");
291
291
  tooltipEls.length > 0 && tooltipEls.forEach((tooltipEl) => {
292
- if (!!tooltipEl.showPopover) {
292
+ if (!!tooltipEl.showPopover && tooltipEl.hasAttribute('popover')) {
293
293
  tooltipEl.showPopover();
294
294
  }
295
295
  tooltipEl.classList.add("show");
@@ -316,7 +316,7 @@ export function showTooltip(placement, anchorEl, tooltipText) {
316
316
  export function hideTooltip() {
317
317
  const tooltipEls = document.querySelectorAll(".wm-tooltip");
318
318
  tooltipEls.length > 0 && tooltipEls.forEach((tooltipEl) => {
319
- if (!!tooltipEl.hidePopover) {
319
+ if (!!tooltipEl.hidePopover && tooltipEl.hasAttribute('popover')) {
320
320
  tooltipEl.hidePopover();
321
321
  }
322
322
  tooltipEl.classList.remove("show");
@@ -34,20 +34,19 @@ window.addEventListener("mousedown", wmComponentMouseDownOnce);
34
34
  setMode((elm) => {
35
35
  return elm.getAttribute("mode") || document.documentElement.getAttribute("mode") || "planning";
36
36
  });
37
- document.addEventListener("DOMContentLoaded", () => {
38
- // TOOLTIP
39
- // Add a tooltip element
40
- // This allows tooltips to be always at the highest stacking context (always on top)
41
- // Element is added withing a container to avoid performance impact
42
- const tooltipContainer = document.createElement("div");
43
- tooltipContainer.id = "wm-tooltip-container";
44
- const tooltipEl = document.createElement("div");
45
- tooltipEl.id = "wm-tooltip";
46
- tooltipEl.classList.add("wm-tooltip");
47
- tooltipEl.setAttribute("popover", "manual");
48
- tooltipEl.setAttribute("aria-hidden", "true");
49
- const tooltipStyles = document.createElement("style");
50
- tooltipStyles.textContent = `
37
+ // TOOLTIP
38
+ // Add a tooltip element
39
+ // This allows tooltips to be always at the highest stacking context (always on top)
40
+ // Element is added withing a container to avoid performance impact
41
+ const tooltipContainer = document.createElement("div");
42
+ tooltipContainer.id = "wm-tooltip-container";
43
+ const tooltipEl = document.createElement("div");
44
+ tooltipEl.id = "wm-tooltip";
45
+ tooltipEl.classList.add("wm-tooltip");
46
+ tooltipEl.setAttribute("popover", "manual");
47
+ tooltipEl.setAttribute("aria-hidden", "true");
48
+ const tooltipStyles = document.createElement("style");
49
+ tooltipStyles.textContent = `
51
50
  .wm-tooltip {
52
51
  position: fixed;
53
52
  overflow: hidden;
@@ -84,7 +83,17 @@ document.addEventListener("DOMContentLoaded", () => {
84
83
  opacity: 1;
85
84
  }
86
85
  `;
86
+ const body = document.querySelector("body");
87
+ if (body) {
87
88
  document.head.appendChild(tooltipStyles);
88
89
  tooltipContainer.appendChild(tooltipEl);
89
- document.querySelector("body").appendChild(tooltipContainer);
90
- });
90
+ body.appendChild(tooltipContainer);
91
+ }
92
+ else {
93
+ document.addEventListener("DOMContentLoaded", () => {
94
+ const body = document.querySelector("body");
95
+ document.head.appendChild(tooltipStyles);
96
+ tooltipContainer.appendChild(tooltipEl);
97
+ body.appendChild(tooltipContainer);
98
+ });
99
+ }
@@ -49,22 +49,24 @@ export const getWmMode = (ref) => {
49
49
  document.documentElement.getAttribute("mode") ||
50
50
  defaultMode);
51
51
  };
52
- export const chartPaletteDiscrete = [
53
- "wmcolor-dataviz-discrete-01",
54
- "wmcolor-dataviz-discrete-02",
55
- "wmcolor-dataviz-discrete-03",
56
- "wmcolor-dataviz-discrete-04",
57
- "wmcolor-dataviz-discrete-05",
58
- "wmcolor-dataviz-discrete-06",
59
- "wmcolor-dataviz-discrete-07",
60
- ];
61
- export const chartPaletteSemantic = [
62
- "wmcolor-dataviz-semantic-positive-01",
63
- "wmcolor-dataviz-semantic-positive-02",
64
- "wmcolor-dataviz-semantic-negative-01",
65
- "wmcolor-dataviz-semantic-negative-02",
66
- "wmcolor-dataviz-semantic-neutral-01",
67
- "wmcolor-dataviz-semantic-neutral-02",
68
- "wmcolor-dataviz-semantic-neutral-03",
69
- "wmcolor-dataviz-semantic-unspecified",
70
- ];
52
+ export const chartPalettes = {
53
+ discrete: [
54
+ "wmcolor-dataviz-discrete-01",
55
+ "wmcolor-dataviz-discrete-02",
56
+ "wmcolor-dataviz-discrete-03",
57
+ "wmcolor-dataviz-discrete-04",
58
+ "wmcolor-dataviz-discrete-05",
59
+ "wmcolor-dataviz-discrete-06",
60
+ "wmcolor-dataviz-discrete-07",
61
+ ],
62
+ semantic: [
63
+ "wmcolor-dataviz-semantic-positive-01",
64
+ "wmcolor-dataviz-semantic-positive-02",
65
+ "wmcolor-dataviz-semantic-negative-01",
66
+ "wmcolor-dataviz-semantic-negative-02",
67
+ "wmcolor-dataviz-semantic-neutral-01",
68
+ "wmcolor-dataviz-semantic-neutral-02",
69
+ "wmcolor-dataviz-semantic-neutral-03",
70
+ "wmcolor-dataviz-semantic-unspecified",
71
+ ],
72
+ };
@@ -1,6 +1,6 @@
1
1
  import './index-130e07bb.js';
2
2
 
3
- const version = "5.23.0-alpha.5";
3
+ const version = "5.23.0-alpha.6";
4
4
 
5
5
  // PRINT RIPPLE VERSION IN CONSOLE
6
6
  // test envs return 0 for plugin.length
@@ -31,20 +31,19 @@ function wmComponentMouseDownOnce() {
31
31
  }
32
32
  window.addEventListener("keydown", wmComponentKeys);
33
33
  window.addEventListener("mousedown", wmComponentMouseDownOnce);
34
- document.addEventListener("DOMContentLoaded", () => {
35
- // TOOLTIP
36
- // Add a tooltip element
37
- // This allows tooltips to be always at the highest stacking context (always on top)
38
- // Element is added withing a container to avoid performance impact
39
- const tooltipContainer = document.createElement("div");
40
- tooltipContainer.id = "wm-tooltip-container";
41
- const tooltipEl = document.createElement("div");
42
- tooltipEl.id = "wm-tooltip";
43
- tooltipEl.classList.add("wm-tooltip");
44
- tooltipEl.setAttribute("popover", "manual");
45
- tooltipEl.setAttribute("aria-hidden", "true");
46
- const tooltipStyles = document.createElement("style");
47
- tooltipStyles.textContent = `
34
+ // TOOLTIP
35
+ // Add a tooltip element
36
+ // This allows tooltips to be always at the highest stacking context (always on top)
37
+ // Element is added withing a container to avoid performance impact
38
+ const tooltipContainer = document.createElement("div");
39
+ tooltipContainer.id = "wm-tooltip-container";
40
+ const tooltipEl = document.createElement("div");
41
+ tooltipEl.id = "wm-tooltip";
42
+ tooltipEl.classList.add("wm-tooltip");
43
+ tooltipEl.setAttribute("popover", "manual");
44
+ tooltipEl.setAttribute("aria-hidden", "true");
45
+ const tooltipStyles = document.createElement("style");
46
+ tooltipStyles.textContent = `
48
47
  .wm-tooltip {
49
48
  position: fixed;
50
49
  overflow: hidden;
@@ -81,10 +80,20 @@ document.addEventListener("DOMContentLoaded", () => {
81
80
  opacity: 1;
82
81
  }
83
82
  `;
83
+ const body = document.querySelector("body");
84
+ if (body) {
84
85
  document.head.appendChild(tooltipStyles);
85
86
  tooltipContainer.appendChild(tooltipEl);
86
- document.querySelector("body").appendChild(tooltipContainer);
87
- });
87
+ body.appendChild(tooltipContainer);
88
+ }
89
+ else {
90
+ document.addEventListener("DOMContentLoaded", () => {
91
+ const body = document.querySelector("body");
92
+ document.head.appendChild(tooltipStyles);
93
+ tooltipContainer.appendChild(tooltipEl);
94
+ body.appendChild(tooltipContainer);
95
+ });
96
+ }
88
97
  const globalFn = () => { };
89
98
 
90
99
  const globalScripts = globalFn;
@@ -1,5 +1,5 @@
1
1
  import { h } from './index-130e07bb.js';
2
- import { i as intl, c as checkForActiveElInShadow, e as safeMultiplyFloat, f as getPosition } from './functions-2cfbd8c7.js';
2
+ import { i as intl, c as checkForActiveElInShadow, e as safeMultiplyFloat, f as getPosition } from './functions-c1d5f184.js';
3
3
 
4
4
  const colors = {
5
5
  salmon: "#ff5f4e",
@@ -756,5 +756,22 @@ function findLargestNiceInterval(maxIntervals, total) {
756
756
  }
757
757
  return { numIntervals: 1, interval: total };
758
758
  }
759
+ function findNiceRoundNumber(value) {
760
+ // Given a value, find the next "nice" round number >= that value.
761
+ // Examples: 982 → 1000, 45 → 50, 1234 → 1500, 7 → 10
762
+ if (value <= 0)
763
+ return 0;
764
+ const niceValues = [1, 1.5, 2, 2.5, 3, 5, 10];
765
+ const magnitude = Math.pow(10, Math.floor(Math.log10(value)));
766
+ const normalized = value / magnitude;
767
+ // Find the smallest nice value that is >= the normalized value
768
+ for (const nice of niceValues) {
769
+ if (nice >= normalized) {
770
+ return nice * magnitude;
771
+ }
772
+ }
773
+ // Fallback: next order of magnitude
774
+ return 10 * magnitude;
775
+ }
759
776
 
760
- export { allChartsDetails as a, renderSimpleBar as b, renderStackedBar as c, renderDoughnut as d, renderInstructionsText as e, renderLegend as f, getDetails as g, handleChartKeydown as h, renderHiddenValuesMessage as i, exitChart as j, amountToPercent as k, renderCompletionMessage as l, renderLegendItem as m, formatDisplayValue as n, findLargestNiceInterval as o, getMaxTicks as p, abbrNumber as q, removeSegmentInfoHighlight as r, suffixNumber as s, getInterval as t };
777
+ export { allChartsDetails as a, renderSimpleBar as b, renderStackedBar as c, renderDoughnut as d, renderInstructionsText as e, renderLegend as f, getDetails as g, handleChartKeydown as h, renderHiddenValuesMessage as i, exitChart as j, amountToPercent as k, renderCompletionMessage as l, renderLegendItem as m, findNiceRoundNumber as n, formatDisplayValue as o, findLargestNiceInterval as p, getMaxTicks as q, removeSegmentInfoHighlight as r, suffixNumber as s, abbrNumber as t, getInterval as u };