@ck-ui/component-library 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/DropdownFooter-B63OOZOS.js +96 -0
  2. package/dist/assets/{DropdownFooter-JrU15UnN.css → DropdownFooter-tfY7sg47.css} +1 -1
  3. package/dist/assets/index-DyCyrZSK.css +1 -0
  4. package/dist/assets/styles-B53zsrbG.css +1 -0
  5. package/dist/components/FusionChart/_config/builders.d.ts.map +1 -1
  6. package/dist/components/FusionChart/_config/builders.js +120 -113
  7. package/dist/components/FusionChart/_config/events.d.ts.map +1 -1
  8. package/dist/components/FusionChart/_config/events.js +37 -23
  9. package/dist/components/FusionChart/_types/fusionChart.types.d.ts +5 -0
  10. package/dist/components/FusionChart/_types/fusionChart.types.d.ts.map +1 -1
  11. package/dist/components/FusionChart/index.d.ts.map +1 -1
  12. package/dist/components/FusionChart/index.js +733 -711
  13. package/dist/components/MultiSelect/SimpleMultiSelect.js +1 -1
  14. package/dist/components/MultiSelect/_helpers/DropdownFooter.js +1 -1
  15. package/dist/components/MultiSelect/_helpers/OptionRow.js +1 -1
  16. package/dist/components/MultiSelect/_helpers/OverflowMenu.d.ts.map +1 -1
  17. package/dist/components/MultiSelect/_helpers/OverflowMenu.js +33 -5
  18. package/dist/components/MultiSelect/_helpers/OverflowMenuItem.js +1 -1
  19. package/dist/components/MultiSelect/_helpers/SearchResult.js +1 -1
  20. package/dist/components/MultiSelect/_helpers/TagContent.js +1 -1
  21. package/dist/components/MultiSelect/_helpers/TriggerButton.js +1 -1
  22. package/dist/components/MultiSelect/index.js +1 -1
  23. package/dist/components/SingleSelectDropdown/_helpers/DropdownFooter.js +1 -1
  24. package/dist/components/SingleSelectDropdown/index.js +1 -1
  25. package/dist/components/Table/_types/table.types.d.ts +10 -0
  26. package/dist/components/Table/_types/table.types.d.ts.map +1 -1
  27. package/dist/components/Table/index.d.ts +1 -1
  28. package/dist/components/Table/index.d.ts.map +1 -1
  29. package/dist/components/Table/index.js +266 -252
  30. package/dist/styles.module-Ck6QqhF4.js +55 -0
  31. package/package.json +1 -1
  32. package/dist/DropdownFooter-CsDll1Tj.js +0 -96
  33. package/dist/assets/index-CDtSVOTj.css +0 -1
  34. package/dist/assets/styles-CEyiQgVQ.css +0 -1
  35. package/dist/styles.module-yIHBMSTk.js +0 -53
@@ -1,16 +1,16 @@
1
- import { EXTENDED_PALETTE as p, DEFAULT_WIDTH as g, STACKED_AREA_PALETTE as H } from "../_constant/constants.js";
2
- import { getBaseConfig as h, getStackedColumnChartShell as F, getStackedAreaChartShell as R, getStackedBarChartShell as O, getLineChartShell as j, getCommonChartShell as P, getScrollAreaChartShell as V, getMultipleLineChartShell as W, getMsCombiDy2dChartShell as Y, getGroupChartShell as _, getDoughnutChartShell as G } from "./helpers.js";
1
+ import { EXTENDED_PALETTE as B, DEFAULT_WIDTH as x, STACKED_AREA_PALETTE as H } from "../_constant/constants.js";
2
+ import { getBaseConfig as h, getStackedColumnChartShell as M, getStackedAreaChartShell as R, getStackedBarChartShell as O, getLineChartShell as j, getCommonChartShell as k, getScrollAreaChartShell as V, getMultipleLineChartShell as W, getMsCombiDy2dChartShell as Y, getGroupChartShell as _, getDoughnutChartShell as G } from "./helpers.js";
3
3
  import { getCurrencyPrefix as y, getLabelStep as w, getCartesianPalette as L, getCurrencySymbol as E, getGraphDataLength as U, getBarType as K } from "../_utils/chartHelpers.js";
4
- const M = (e = {}) => {
5
- const t = e.plotSpacePercent ?? (e.plotSpacePercent === 0 ? e.plotSpacePercent : 60), a = Array.isArray(e.graphData) ? e.graphData : [], s = a.some((o) => !!o.color), l = L(e?.palettecolors)?.split(",")?.map((o) => o?.trim()), n = a?.map((o, c) => {
6
- const x = o?.color || l[c % l.length];
4
+ const F = (e = {}) => {
5
+ const t = e.plotSpacePercent ?? (e.plotSpacePercent === 0 ? e.plotSpacePercent : 60), a = Array.isArray(e.graphData) ? e.graphData : [], s = a.some((i) => !!i.color), l = L(e?.palettecolors)?.split(",")?.map((i) => i?.trim()), n = a?.map((i, r) => {
6
+ const g = i?.color || l[r % l.length];
7
7
  return {
8
- ...o,
9
- color: x,
10
- toolText: e.plotToolText || `<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>${o.label || ""}</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>${o.label || ""}</label><b style='text-align:right;'>${y(e.numberPrefix)}${o.value || ""}</b></div>`
8
+ ...i,
9
+ color: g,
10
+ toolText: e.plotToolText || `<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>${i.label || ""}</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><span style='display:flex;align-items:center;gap:6px'><span style='width:10px;height:10px;border-radius:2px;background-color:${g};display:inline-block;flex-shrink:0'></span><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>${i.label || ""}</label></span><b style='text-align:right;'>${y(e.numberPrefix)}${i.value || ""}</b></div>`
11
11
  };
12
- }), i = {
13
- ...P(e),
12
+ }), o = {
13
+ ...k(e),
14
14
  bgColor: e.bgColor || "#ffffff",
15
15
  labelStep: w(U(e), e.labelStep),
16
16
  xAxisName: e.xAxisName,
@@ -28,24 +28,24 @@ const M = (e = {}) => {
28
28
  palettecolors: s ? void 0 : L(e.palettecolors),
29
29
  maxLabelHeight: e.maxLabelHeight,
30
30
  numbersuffix: e.numbersuffix || ""
31
- }, r = e.graphData, d = e?.hideScroll ? { chart: i, data: n?.length > 0 ? n : e?.graphData || [] } : {
32
- chart: i,
33
- categories: r?.categories,
34
- dataset: r?.dataset
31
+ }, d = e.graphData, c = e?.hideScroll ? { chart: o, data: n?.length > 0 ? n : e?.graphData || [] } : {
32
+ chart: o,
33
+ categories: d?.categories,
34
+ dataset: d?.dataset
35
35
  };
36
36
  return h({
37
37
  type: K(e),
38
- width: g,
38
+ width: x,
39
39
  height: e.height || "300",
40
- dataSource: d
40
+ dataSource: c
41
41
  });
42
42
  }, X = (e = {}) => h({
43
43
  type: "area2d",
44
- width: g,
44
+ width: x,
45
45
  height: "550",
46
46
  dataSource: {
47
47
  chart: {
48
- ...P({ ...e, decimals: "2" }),
48
+ ...k({ ...e, decimals: "2" }),
49
49
  xAxisName: e.xAxisName,
50
50
  yAxisName: e.yAxisName,
51
51
  labelFontSize: 12,
@@ -54,13 +54,13 @@ const M = (e = {}) => {
54
54
  data: e.graphData || []
55
55
  }
56
56
  }), q = (e = {}) => {
57
- const t = Array.isArray(e?.graphData) ? e.graphData : [], a = y(e?.numberPrefix), s = t?.map((l) => ({
58
- ...l,
59
- toolText: e?.plotToolText || `<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>${l?.label || ""}</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>${l?.label || ""}</label><b style='text-align:right;'>${a}${l?.value || ""}</b></div>`
57
+ const t = Array.isArray(e?.graphData) ? e.graphData : [], a = y(e?.numberPrefix), s = (e?.palettecolors || "#8ECFFF").split(",")[0].trim(), l = t?.map((n) => ({
58
+ ...n,
59
+ toolText: e?.plotToolText || `<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>${n?.label || ""}</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><span style='display:flex;align-items:center;gap:6px'><span style='width:10px;height:10px;border-radius:2px;background-color:${s};display:inline-block;flex-shrink:0'></span><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>${n?.label || ""}</label></span><b style='text-align:right;'>${a}${n?.value || ""}</b></div>`
60
60
  }));
61
61
  return h({
62
62
  type: "line",
63
- width: e?.width || g,
63
+ width: e?.width || x,
64
64
  height: e?.height || "300",
65
65
  dataSource: {
66
66
  chart: {
@@ -70,20 +70,27 @@ const M = (e = {}) => {
70
70
  labelStep: w(t.length, void 0),
71
71
  ...e?.chartConfig || {}
72
72
  },
73
- data: s.length > 0 ? s : e?.graphData || []
73
+ data: l.length > 0 ? l : e?.graphData || []
74
74
  }
75
75
  });
76
76
  }, J = (e = {}) => {
77
77
  let t = E();
78
78
  e.numberPrefix === "" ? t = "" : e.numberPrefix !== null && e.numberPrefix !== void 0 && (t = e.numberPrefix);
79
- const a = e.graphData, s = (a?.dataset || []).some((n) => !!n.color), l = (a?.dataset || []).map((n, i) => ({
80
- ...n,
81
- plotToolText: e.plotToolText || (i === 0 ? "<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>$label</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>$seriesName</label><b style='text-align:right;'>$dataValue</b></div>" : "<div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>$seriesName</label><b style='text-align:right;'>$dataValue</b></div>")
82
- }));
79
+ const a = e.graphData, s = (a?.dataset || []).some((n) => !!n.color), l = (a?.dataset || []).map((n, o) => {
80
+ const c = n.data?.map((i) => {
81
+ const r = i.value;
82
+ return r == null || Number(r) === 0 || typeof r == "string" && r.trim() === "" ? { ...i, value: 0 } : i;
83
+ });
84
+ return {
85
+ ...n,
86
+ ...c ? { data: c } : {},
87
+ plotToolText: e.plotToolText || (o === 0 ? "<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>$label</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>$seriesName</label><b style='text-align:right;'>$dataValue</b></div>" : "<div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>$seriesName</label><b style='text-align:right;'>$dataValue</b></div>")
88
+ };
89
+ });
83
90
  return h({
84
91
  type: "mscolumn2d",
85
92
  key: e.key,
86
- width: e.width || g,
93
+ width: e.width || x,
87
94
  height: e.height || "400",
88
95
  dataSource: {
89
96
  chart: {
@@ -103,18 +110,18 @@ const M = (e = {}) => {
103
110
  }
104
111
  });
105
112
  }, Q = (e = {}) => {
106
- const t = e.graphLabel ? "" : y(e.numberPrefix), a = e.graphData, s = (a?.dataset || []).some((i) => !!i.color), l = "<div class='stacked-tooltip-total' style='display:flex;justify-content:space-between;align-items:center;padding:8px 0 0;margin-top:4px;border-top:1px solid #eee;min-width:180px'><span style='color:#2B2B2B;font-weight:600'>Total</span><b style='color:#2B2B2B'>$sum</b></div>", n = (a?.dataset || []).map((i, r) => ({
107
- ...i,
108
- plotToolText: e.plotToolText || (r === 0 ? "<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>$label</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>$seriesName</label><b style='text-align:right;'>$dataValue</b></div>" + l : "<div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>$seriesName</label><b style='text-align:right;'>$dataValue</b></div>" + l)
113
+ const t = e.graphLabel ? "" : y(e.numberPrefix), a = e.graphData, s = (a?.dataset || []).some((o) => !!o.color), l = "<div class='stacked-tooltip-total' style='display:flex;justify-content:space-between;align-items:center;padding:8px 0 0;margin-top:4px;border-top:1px solid #eee;min-width:180px'><span style='color:#2B2B2B;font-weight:600'>Total</span><b style='color:#2B2B2B'>$sum</b></div>", n = (a?.dataset || []).map((o, d) => ({
114
+ ...o,
115
+ plotToolText: e.plotToolText || (d === 0 ? "<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>$label</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>$seriesName</label><b style='text-align:right;'>$dataValue</b></div>" + l : "<div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>$seriesName</label><b style='text-align:right;'>$dataValue</b></div>" + l)
109
116
  }));
110
117
  return h({
111
118
  type: e.hideScroll ? "stackedcolumn2d" : "scrollstackedcolumn2d",
112
119
  key: e.key,
113
- width: e.width || g,
120
+ width: e.width || x,
114
121
  height: e.height || "400",
115
122
  dataSource: {
116
123
  chart: {
117
- ...F(e),
124
+ ...M(e),
118
125
  yAxisMaxValue: e.yAxisMaxValue,
119
126
  xAxisName: e.xAxisName,
120
127
  yAxisName: e.yAxisName,
@@ -123,7 +130,7 @@ const M = (e = {}) => {
123
130
  interactiveLegend: e.interactiveLegend || "1",
124
131
  drawCrossLine: e.drawCrossLine || "1",
125
132
  bgColor: e.bgColor || "#ffffff",
126
- palettecolors: s ? void 0 : e.palettecolors || p,
133
+ palettecolors: s ? void 0 : e.palettecolors || B,
127
134
  numberPrefix: t,
128
135
  labelStep: w(a?.category?.length, e.labelStep),
129
136
  showSum: e.showSum ? "1" : void 0
@@ -146,7 +153,7 @@ const M = (e = {}) => {
146
153
  return h({
147
154
  type: "msline",
148
155
  key: e.key,
149
- width: e.width || g,
156
+ width: e.width || x,
150
157
  height: e.height || "400",
151
158
  dataSource: {
152
159
  chart: {
@@ -166,31 +173,31 @@ const M = (e = {}) => {
166
173
  }
167
174
  });
168
175
  }, ee = (e = {}) => {
169
- const t = e.graphLabel ? "" : y(e.numberPrefix), a = e.graphData, l = (e.palettecolors || H).split(",").map((d) => d.trim()), n = a?.category || [], i = a?.dataset || [], r = i.map((d, o) => {
170
- const x = d.color || l[o % l.length], u = d.data || [];
176
+ const t = e.graphLabel ? "" : y(e.numberPrefix), a = e.graphData, l = (e.palettecolors || H).split(",").map((c) => c.trim()), n = a?.category || [], o = a?.dataset || [], d = o.map((c, i) => {
177
+ const g = c.color || l[i % l.length], u = c.data || [];
171
178
  return {
172
- ...d,
173
- color: x,
174
- plotBorderColor: x,
179
+ ...c,
180
+ color: g,
181
+ plotBorderColor: g,
175
182
  plotBorderThickness: "2",
176
183
  plotBorderAlpha: "100",
177
- anchorBgColor: x,
178
- anchorBorderColor: x,
184
+ anchorBgColor: g,
185
+ anchorBorderColor: g,
179
186
  showPlotBorder: "1",
180
187
  ...e.plotToolText ? { plotToolText: e.plotToolText } : {},
181
188
  data: u.map((b, m) => {
182
189
  const C = n[m]?.label || "";
183
190
  if (e.plotToolText)
184
191
  return { ...b, alpha: "60" };
185
- if (o > 0)
192
+ if (i > 0)
186
193
  return {
187
194
  ...b,
188
195
  alpha: "60",
189
196
  toolText: " "
190
197
  };
191
- const f = i.map((T, v) => {
192
- const A = T.color || l[v % l.length], B = (T.data || [])[m]?.value ?? "", S = T.seriesname || "", N = v === o ? "#2B2B2B" : "#666";
193
- return `<div style='display:flex;justify-content:space-between;align-items:center;padding:2px 0;min-width:200px'><span style='display:flex;align-items:center;gap:6px;color:${N}'><span style='width:10px;height:10px;border-radius:2px;background-color:${A};display:inline-block'></span>${S}</span><b style='color:${N}'>${t}${B}</b></div>`;
198
+ const f = o.map((T, v) => {
199
+ const S = T.color || l[v % l.length], A = (T.data || [])[m]?.value ?? "", p = T.seriesname || "", N = v === i ? "#2B2B2B" : "#666";
200
+ return `<div style='display:flex;justify-content:space-between;align-items:center;padding:2px 0;min-width:200px'><span style='display:flex;align-items:center;gap:6px;color:${N}'><span style='width:10px;height:10px;border-radius:2px;background-color:${S};display:inline-block'></span>${p}</span><b style='color:${N}'>${t}${A}</b></div>`;
194
201
  }).join("");
195
202
  return {
196
203
  ...b,
@@ -203,7 +210,7 @@ const M = (e = {}) => {
203
210
  return h({
204
211
  type: "stackedarea2d",
205
212
  key: e.key,
206
- width: e.width || g,
213
+ width: e.width || x,
207
214
  height: e.height || "400",
208
215
  dataSource: {
209
216
  chart: {
@@ -220,13 +227,13 @@ const M = (e = {}) => {
220
227
  labelStep: w(a?.category?.length, e.labelStep)
221
228
  },
222
229
  categories: [{ category: a?.category || [] }],
223
- dataset: r
230
+ dataset: d
224
231
  }
225
232
  });
226
233
  }, te = (e = {}) => {
227
- const t = y(e.numberPrefix), s = (e?.palettecolors || "#8ECFFF").split(",").map((c) => c.trim()), l = s[0];
234
+ const t = y(e.numberPrefix), s = (e?.palettecolors || "#8ECFFF").split(",").map((r) => r.trim()), l = s[0];
228
235
  if (!Array.isArray(e?.graphData) && e?.graphData?.dataset) {
229
- const c = e.graphData, x = c?.category || [], u = c?.dataset || [], b = u.map((m, C) => {
236
+ const r = e.graphData, g = r?.category || [], u = r?.dataset || [], b = u.map((m, C) => {
230
237
  const f = m.color || s[C % s.length], T = m.data || [];
231
238
  return {
232
239
  ...m,
@@ -236,26 +243,26 @@ const M = (e = {}) => {
236
243
  anchorBorderColor: f,
237
244
  anchorBorderThickness: "1",
238
245
  ...e.plotToolText ? { plotToolText: e.plotToolText } : {},
239
- data: T.map((v, A) => {
240
- const $ = x[A]?.label || "";
246
+ data: T.map((v, S) => {
247
+ const $ = g[S]?.label || "";
241
248
  if (e.plotToolText)
242
249
  return { ...v };
243
250
  if (C > 0)
244
251
  return { ...v, toolText: " " };
245
- const B = u.map((S, D) => {
246
- const I = (S.data || [])[A]?.value ?? "", z = S.seriesname || "", k = D === C ? "#2B2B2B" : "#666";
247
- return `<div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:${k}'>${z}</label><b style='text-align:right;color:${k}'>${t}${I}</b></div>`;
252
+ const A = u.map((p, D) => {
253
+ const I = (p.data || [])[S]?.value ?? "", z = p.seriesname || "", P = D === C ? "#2B2B2B" : "#666";
254
+ return `<div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:${P}'>${z}</label><b style='text-align:right;color:${P}'>${t}${I}</b></div>`;
248
255
  }).join("");
249
256
  return {
250
257
  ...v,
251
- toolText: `<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>${$}</div>${B}`
258
+ toolText: `<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>${$}</div>${A}`
252
259
  };
253
260
  })
254
261
  };
255
262
  });
256
263
  return h({
257
264
  type: "scrollarea2d",
258
- width: e?.width || g,
265
+ width: e?.width || x,
259
266
  height: e?.height || "400",
260
267
  dataSource: {
261
268
  chart: {
@@ -265,18 +272,18 @@ const M = (e = {}) => {
265
272
  numberPrefix: t,
266
273
  ...e?.chartConfig || {}
267
274
  },
268
- categories: [{ category: x }],
275
+ categories: [{ category: g }],
269
276
  dataset: b
270
277
  }
271
278
  });
272
279
  }
273
- const i = Array.isArray(e?.graphData) ? e.graphData : [], r = i.map((c) => ({ label: c?.label || "" })), d = e.legendLabel || "Spend", o = i.map((c) => ({
274
- value: c?.value,
275
- toolText: e?.plotToolText || `<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>${c?.label || ""}</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>${d}</label><b style='text-align:right;'>${t}${c?.value || ""}</b></div>`
280
+ const o = Array.isArray(e?.graphData) ? e.graphData : [], d = o.map((r) => ({ label: r?.label || "" })), c = e.legendLabel || "Spend", i = o.map((r) => ({
281
+ value: r?.value,
282
+ toolText: e?.plotToolText || `<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px'>${r?.label || ""}</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>${c}</label><b style='text-align:right;'>${t}${r?.value || ""}</b></div>`
276
283
  }));
277
284
  return h({
278
285
  type: "scrollarea2d",
279
- width: e?.width || g,
286
+ width: e?.width || x,
280
287
  height: e?.height || "400",
281
288
  dataSource: {
282
289
  chart: {
@@ -286,16 +293,16 @@ const M = (e = {}) => {
286
293
  numberPrefix: t,
287
294
  ...e?.chartConfig || {}
288
295
  },
289
- categories: [{ category: r }],
296
+ categories: [{ category: d }],
290
297
  dataset: [
291
298
  {
292
- seriesname: d,
299
+ seriesname: c,
293
300
  color: l,
294
301
  anchorRadius: "3",
295
302
  anchorBgColor: "#FFFFFF",
296
303
  anchorBorderColor: l,
297
304
  anchorBorderThickness: "1",
298
- data: o
305
+ data: i
299
306
  }
300
307
  ]
301
308
  }
@@ -304,7 +311,7 @@ const M = (e = {}) => {
304
311
  const t = e.graphData;
305
312
  return h({
306
313
  type: "stackedbar2d",
307
- width: g,
314
+ width: x,
308
315
  height: e.height || "400",
309
316
  dataSource: {
310
317
  chart: {
@@ -321,7 +328,7 @@ const M = (e = {}) => {
321
328
  const t = e.graphData;
322
329
  return h({
323
330
  type: "sankey",
324
- width: g,
331
+ width: x,
325
332
  height: e.height || "600",
326
333
  dataSource: {
327
334
  chart: {
@@ -347,20 +354,20 @@ const M = (e = {}) => {
347
354
  }
348
355
  });
349
356
  }, ie = (e = {}) => {
350
- const a = e.graphData?.data || [], s = a.reduce((o, c) => o + (Number(c.value) || 0), 0), l = Math.round(s * 100) / 100, n = e.numberPrefix ?? "$", i = { ...e };
351
- if (!i.defaultCenterLabel)
352
- i.defaultCenterLabel = `Total{br}${n}${l}`;
353
- else if (i.defaultCenterLabel.includes("{br}")) {
354
- const [o] = i.defaultCenterLabel.split("{br}");
355
- i.defaultCenterLabel = `${o}{br}${n}${l}`;
357
+ const a = e.graphData?.data || [], s = a.reduce((i, r) => i + (Number(r.value) || 0), 0), l = Math.round(s * 100) / 100, n = e.numberPrefix ?? "$", o = { ...e };
358
+ if (!o.defaultCenterLabel)
359
+ o.defaultCenterLabel = `Total{br}${n}${l}`;
360
+ else if (o.defaultCenterLabel.includes("{br}")) {
361
+ const [i] = o.defaultCenterLabel.split("{br}");
362
+ o.defaultCenterLabel = `${i}{br}${n}${l}`;
356
363
  }
357
- const r = (e.palettecolors || p).split(",").map((o) => o.trim()), d = a.map((o, c) => {
358
- const x = Number(o.value) || 0, u = l > 0 ? (x / l * 100).toFixed(2) : "0", b = o.color || r[c % r.length];
364
+ const d = (e.palettecolors || B).split(",").map((i) => i.trim()), c = a.map((i, r) => {
365
+ const g = Number(i.value) || 0, u = l > 0 ? (g / l * 100).toFixed(2) : "0", b = i.color || d[r % d.length];
359
366
  let m;
360
- return e.plotToolText ? m = e.plotToolText.replace(/\$plotFillColor/g, b).replace(/\$color/g, b).replace(/\$label/g, o.label || "").replace(/\$value/g, String(o.value ?? "")).replace(/\$dataValue/g, `${n}${x}`).replace(/\$percentValue/g, u).replace(/\$unformattedSum/g, String(l)).replace(/\$sum/g, `${n}${l}`) : m = `<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>${o.label}</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'><span style='width:8px;height:8px;border-radius:2px;background-color:${b};display:inline-block;margin-right:5px'></span>${o.label}</label><b style='text-align:right;'>${n}${x}</b></div>`, {
361
- ...o,
367
+ return e.plotToolText ? m = e.plotToolText.replace(/\$plotFillColor/g, b).replace(/\$color/g, b).replace(/\$label/g, i.label || "").replace(/\$value/g, String(i.value ?? "")).replace(/\$dataValue/g, `${n}${g}`).replace(/\$percentValue/g, u).replace(/\$unformattedSum/g, String(l)).replace(/\$sum/g, `${n}${l}`) : m = `<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>${i.label}</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'><span style='width:8px;height:8px;border-radius:2px;background-color:${b};display:inline-block;margin-right:5px'></span>${i.label}</label><b style='text-align:right;'>${n}${g}</b></div>`, {
368
+ ...i,
362
369
  color: b,
363
- displayValue: `${n}${o.value} (${u}%){br}${o.label}`,
370
+ displayValue: `${n}${i.value} (${u}%){br}${i.label}`,
364
371
  toolText: m
365
372
  };
366
373
  });
@@ -369,8 +376,8 @@ const M = (e = {}) => {
369
376
  width: e.width || "136",
370
377
  height: e.height || "136",
371
378
  dataSource: {
372
- chart: G(i),
373
- data: d
379
+ chart: G(o),
380
+ data: c
374
381
  }
375
382
  });
376
383
  }, oe = (e = {}) => {
@@ -378,7 +385,7 @@ const M = (e = {}) => {
378
385
  return h({
379
386
  type: "multiaxisline",
380
387
  key: e.key,
381
- width: e.width || g,
388
+ width: e.width || x,
382
389
  height: e.height || "400",
383
390
  dataSource: {
384
391
  chart: { ...t?.chart || {}, ...e.plotToolText ? { plotToolText: e.plotToolText } : {} },
@@ -400,23 +407,23 @@ const M = (e = {}) => {
400
407
  }, se = (e = {}) => {
401
408
  let t = [], a = [];
402
409
  if (Array.isArray(e.graphData)) {
403
- const i = e.graphData;
404
- t = i.map((r) => ({ label: r.label || "" })), a = [
410
+ const o = e.graphData;
411
+ t = o.map((d) => ({ label: d.label || "" })), a = [
405
412
  {
406
413
  seriesname: "Series 1",
407
- data: i.map((r) => ({ value: r.value }))
414
+ data: o.map((d) => ({ value: d.value }))
408
415
  }
409
416
  ];
410
417
  } else {
411
- const i = e.graphData;
412
- t = i?.category || [], a = (i?.dataset || []).map((r) => ({
413
- ...r,
414
- seriesname: r.seriesname || "Series",
415
- data: r.data || []
418
+ const o = e.graphData;
419
+ t = o?.category || [], a = (o?.dataset || []).map((d) => ({
420
+ ...d,
421
+ seriesname: d.seriesname || "Series",
422
+ data: d.data || []
416
423
  }));
417
424
  }
418
- const s = y(e.numberPrefix), l = a.some((i) => !!i.color), n = {
419
- ...P(e),
425
+ const s = y(e.numberPrefix), l = a.some((o) => !!o.color), n = {
426
+ ...k(e),
420
427
  bgColor: e.bgColor || "#ffffff",
421
428
  xAxisName: e.xAxisName,
422
429
  yAxisName: e.yAxisName,
@@ -445,7 +452,7 @@ const M = (e = {}) => {
445
452
  };
446
453
  return h({
447
454
  type: "scrollcolumn2d",
448
- width: e.width || g,
455
+ width: e.width || x,
449
456
  height: e.height || "400",
450
457
  dataSource: {
451
458
  chart: n,
@@ -454,18 +461,18 @@ const M = (e = {}) => {
454
461
  }
455
462
  });
456
463
  }, re = (e = {}) => {
457
- const t = e.graphLabel ? "" : y(e.numberPrefix), a = e.graphData, s = (a?.dataset || []).some((i) => !!i.color), l = "<div class='stacked-tooltip-total' style='display:flex;justify-content:space-between;align-items:center;padding:8px 0 0;margin-top:4px;border-top:1px solid #eee;min-width:180px'><span style='color:#2B2B2B;font-weight:600'>Total</span><b style='color:#2B2B2B'>$sum</b></div>", n = (a?.dataset || []).map((i, r) => ({
458
- ...i,
459
- plotToolText: e.plotToolText || (r === 0 ? "<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>$label</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>$seriesName</label><b style='text-align:right;'>$dataValue</b></div>" + l : "<div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>$seriesName</label><b style='text-align:right;'>$dataValue</b></div>" + l)
464
+ const t = e.graphLabel ? "" : y(e.numberPrefix), a = e.graphData, s = (a?.dataset || []).some((o) => !!o.color), l = "<div class='stacked-tooltip-total' style='display:flex;justify-content:space-between;align-items:center;padding:8px 0 0;margin-top:4px;border-top:1px solid #eee;min-width:180px'><span style='color:#2B2B2B;font-weight:600'>Total</span><b style='color:#2B2B2B'>$sum</b></div>", n = (a?.dataset || []).map((o, d) => ({
465
+ ...o,
466
+ plotToolText: e.plotToolText || (d === 0 ? "<div style='font-size:14px;font-weight:600;color:#2B2B2B;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:8px'>$label</div><div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>$seriesName</label><b style='text-align:right;'>$dataValue</b></div>" + l : "<div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px 0;min-width:180px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;'>$seriesName</label><b style='text-align:right;'>$dataValue</b></div>" + l)
460
467
  }));
461
468
  return h({
462
469
  type: "scrollstackedcolumn2d",
463
470
  key: e.key,
464
- width: e.width || g,
471
+ width: e.width || x,
465
472
  height: e.height || "400",
466
473
  dataSource: {
467
474
  chart: {
468
- ...F(e),
475
+ ...M(e),
469
476
  yAxisMaxValue: e.yAxisMaxValue,
470
477
  xAxisName: e.xAxisName,
471
478
  yAxisName: e.yAxisName,
@@ -474,7 +481,7 @@ const M = (e = {}) => {
474
481
  interactiveLegend: e.interactiveLegend || "1",
475
482
  drawCrossLine: e.drawCrossLine || "1",
476
483
  bgColor: e.bgColor || "#ffffff",
477
- palettecolors: s ? void 0 : e.palettecolors || p,
484
+ palettecolors: s ? void 0 : e.palettecolors || B,
478
485
  numberPrefix: t,
479
486
  numVDivLines: e.numVDivLines || "5",
480
487
  labelStep: w(a?.category?.length, e.labelStep),
@@ -491,21 +498,21 @@ const M = (e = {}) => {
491
498
  }
492
499
  });
493
500
  }, de = (e = {}) => {
494
- const t = e.graphLabel ? "" : y(e.numberPrefix), a = e.graphData, s = (a?.dataset || []).some((d) => !!d.color), l = (e.palettecolors || p).split(",").map((d) => d.trim()), n = a?.category || [], i = a?.dataset || [], r = i.map((d, o) => {
495
- const c = d.color || l[o % l.length], x = d.data || [];
501
+ const t = e.graphLabel ? "" : y(e.numberPrefix), a = e.graphData, s = (a?.dataset || []).some((c) => !!c.color), l = (e.palettecolors || B).split(",").map((c) => c.trim()), n = a?.category || [], o = a?.dataset || [], d = o.map((c, i) => {
502
+ const r = c.color || l[i % l.length], g = c.data || [];
496
503
  return {
497
- ...d,
498
- color: c,
504
+ ...c,
505
+ color: r,
499
506
  ...e.plotToolText ? { plotToolText: e.plotToolText } : {},
500
- data: x.map((u, b) => {
507
+ data: g.map((u, b) => {
501
508
  const m = n[b]?.label || "";
502
509
  if (e.plotToolText)
503
510
  return { ...u };
504
- if (o > 0)
511
+ if (i > 0)
505
512
  return { ...u, toolText: " " };
506
- const C = i.map((f, T) => {
507
- const v = f.color || l[T % l.length], $ = (f.data || [])[b]?.value ?? "", B = f.seriesname || "", S = "#2B2B2B", D = f.tooltipPrefix !== void 0 ? f.tooltipPrefix : t;
508
- return `<div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:${S}'><span style='width:8px;height:8px;border-radius:2px;background-color:${v};display:inline-block;margin-right:5px;'></span>${B}</label><b style='text-align:right;color:${S}'>${D}${$}</b></div>`;
513
+ const C = o.map((f, T) => {
514
+ const v = f.color || l[T % l.length], $ = (f.data || [])[b]?.value ?? "", A = f.seriesname || "", p = "#2B2B2B", D = f.tooltipPrefix !== void 0 ? f.tooltipPrefix : t;
515
+ return `<div style='display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 0;min-width:200px'><label style='display:inline-block;width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:${p}'><span style='width:8px;height:8px;border-radius:2px;background-color:${v};display:inline-block;margin-right:5px;'></span>${A}</label><b style='text-align:right;color:${p}'>${D}${$}</b></div>`;
509
516
  }).join("");
510
517
  return {
511
518
  ...u,
@@ -517,7 +524,7 @@ const M = (e = {}) => {
517
524
  return h({
518
525
  type: "mscombidy2d",
519
526
  key: e.key,
520
- width: e.width || g,
527
+ width: e.width || x,
521
528
  height: e.height || "400",
522
529
  dataSource: {
523
530
  chart: {
@@ -529,17 +536,17 @@ const M = (e = {}) => {
529
536
  sYAxisName: e.sYAxisName,
530
537
  numberPrefix: t,
531
538
  labelStep: w(n.length, e.labelStep),
532
- palettecolors: s ? void 0 : e.palettecolors || p
539
+ palettecolors: s ? void 0 : e.palettecolors || B
533
540
  },
534
541
  categories: [{ category: n }],
535
- dataset: r
542
+ dataset: d
536
543
  }
537
544
  });
538
545
  }, ce = (e = {}) => {
539
546
  const t = e.graphLabel ? "" : y(e.numberPrefix), a = e.graphData, s = a?.category || [], l = a?.dataset || [];
540
547
  return h({
541
548
  type: "scrollline2d",
542
- width: e?.width || g,
549
+ width: e?.width || x,
543
550
  height: e?.height || "400",
544
551
  dataSource: {
545
552
  chart: {
@@ -567,8 +574,8 @@ const M = (e = {}) => {
567
574
  });
568
575
  }, he = {
569
576
  area: X,
570
- bar2d: M,
571
- column2d: M,
577
+ bar2d: F,
578
+ column2d: F,
572
579
  doughnutChart: ie,
573
580
  groupChart: J,
574
581
  line: q,
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../lib/components/FusionChart/_config/events.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,KAAK,UAAU,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;AAE3D,QAAA,MAAM,mBAAmB,GACtB,SAAS,UAAU,EAAE,cAAS,MAC9B,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,mBACU,CAAC;AAE5C,eAAO,MAAM,cAAc,GACzB,QAAO,OAAO,CAAC,gBAAgB,CAAM,KACpC,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,GAAG,SAiCxE,CAAC;AAEF,eAAO,MAAM,WAAW,GACtB,QAAO,OAAO,CAAC,gBAAgB,CAAM,KACpC,CAAC,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAS/B,CAAC"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../lib/components/FusionChart/_config/events.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAoB,MAAM,6BAA6B,CAAC;AAEtF,KAAK,UAAU,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;AAE3D,QAAA,MAAM,mBAAmB,GACtB,SAAS,UAAU,EAAE,cAAS,MAC5B,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,mBACU,CAAC;AAE9C,eAAO,MAAM,cAAc,GACzB,QAAO,OAAO,CAAC,gBAAgB,CAAM,KACpC,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,GAAG,SAwDxE,CAAC;AAEF,eAAO,MAAM,WAAW,GACtB,QAAO,OAAO,CAAC,gBAAgB,CAAM,KACpC,CAAC,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAS/B,CAAC"}
@@ -1,40 +1,54 @@
1
- import { adjustDoughnutLabels as l } from "../_helpers/doughnutHelper.js";
2
- import { adjustMultiAxisValueLabels as n } from "../_helpers/multiAxisHelper.js";
3
- import { adjustMultiLineValueLabels as i } from "../_helpers/multiLineHelper.js";
4
- const r = (e, t = 0) => (a) => setTimeout(() => e(a), t), c = (e = {}) => {
1
+ import { adjustDoughnutLabels as n } from "../_helpers/doughnutHelper.js";
2
+ import { adjustMultiAxisValueLabels as i } from "../_helpers/multiAxisHelper.js";
3
+ import { adjustMultiLineValueLabels as u } from "../_helpers/multiLineHelper.js";
4
+ const a = (e, t = 0) => (r) => setTimeout(() => e(r), t), R = (e = {}) => {
5
5
  const {
6
6
  chartType: t,
7
- manageDoughnutLabels: a,
8
- manageMultiAxisLineLabels: u = !1,
9
- manageMultiLineLabels: o = !1
7
+ manageDoughnutLabels: r,
8
+ manageMultiAxisLineLabels: m = !1,
9
+ manageMultiLineLabels: c = !1
10
10
  } = e;
11
- if (t === "doughnutChart" && a)
11
+ if (t === "doughnutChart" && r)
12
12
  return {
13
- renderComplete: l,
14
- legendItemClicked: r(l),
15
- dataPlotClick: r(l),
16
- dataPlotRollOver: r(l, 50),
17
- dataPlotRollOut: r(l, 50)
13
+ renderComplete: n,
14
+ legendItemClicked: a(n),
15
+ dataPlotClick: a(n),
16
+ dataPlotRollOver: a(n, 50),
17
+ dataPlotRollOut: a(n, 50)
18
+ };
19
+ if (t === "multipleLineChart" && c)
20
+ return {
21
+ renderComplete: u,
22
+ legendItemClicked: a(u, 50)
18
23
  };
19
- if (t === "multipleLineChart" && o)
24
+ if (t === "multiAxisLineChart" && m)
20
25
  return {
21
26
  renderComplete: i,
22
- legendItemClicked: r(i, 50)
27
+ legendItemClicked: a(i, 50)
28
+ };
29
+ if (t === "msCombiDy2d" && e.onPlotHover) {
30
+ const { onPlotHover: o } = e, f = e.graphData?.dataset || [], g = (l) => {
31
+ const s = l.data?.datasetIndex ?? 0, d = f[s];
32
+ return {
33
+ renderAs: d?.renderAs || "column",
34
+ seriesName: d?.seriesname,
35
+ datasetIndex: s
36
+ };
23
37
  };
24
- if (t === "multiAxisLineChart" && u)
25
38
  return {
26
- renderComplete: n,
27
- legendItemClicked: r(n, 50)
39
+ dataPlotRollOver: (l) => o(g(l)),
40
+ dataPlotRollOut: () => o(null)
28
41
  };
29
- }, f = (e = {}) => {
42
+ }
43
+ }, b = (e = {}) => {
30
44
  if (e.chartType !== "groupChart" || !e.chartRef)
31
45
  return;
32
46
  const t = e.chartRef;
33
- return (a) => {
34
- t.current = a;
47
+ return (r) => {
48
+ t.current = r;
35
49
  };
36
50
  };
37
51
  export {
38
- c as getChartEvents,
39
- f as getOnRender
52
+ R as getChartEvents,
53
+ b as getOnRender
40
54
  };
@@ -128,5 +128,10 @@ export interface FusionChartProps {
128
128
  pYAxisName?: string;
129
129
  sYAxisName?: string;
130
130
  enableSlicing?: string;
131
+ onPlotHover?: (info: {
132
+ renderAs: string;
133
+ seriesName?: string;
134
+ datasetIndex: number;
135
+ } | null) => void;
131
136
  }
132
137
  //# sourceMappingURL=fusionChart.types.d.ts.map