@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.
- package/dist/DropdownFooter-B63OOZOS.js +96 -0
- package/dist/assets/{DropdownFooter-JrU15UnN.css → DropdownFooter-tfY7sg47.css} +1 -1
- package/dist/assets/index-DyCyrZSK.css +1 -0
- package/dist/assets/styles-B53zsrbG.css +1 -0
- package/dist/components/FusionChart/_config/builders.d.ts.map +1 -1
- package/dist/components/FusionChart/_config/builders.js +120 -113
- package/dist/components/FusionChart/_config/events.d.ts.map +1 -1
- package/dist/components/FusionChart/_config/events.js +37 -23
- package/dist/components/FusionChart/_types/fusionChart.types.d.ts +5 -0
- package/dist/components/FusionChart/_types/fusionChart.types.d.ts.map +1 -1
- package/dist/components/FusionChart/index.d.ts.map +1 -1
- package/dist/components/FusionChart/index.js +733 -711
- package/dist/components/MultiSelect/SimpleMultiSelect.js +1 -1
- package/dist/components/MultiSelect/_helpers/DropdownFooter.js +1 -1
- package/dist/components/MultiSelect/_helpers/OptionRow.js +1 -1
- package/dist/components/MultiSelect/_helpers/OverflowMenu.d.ts.map +1 -1
- package/dist/components/MultiSelect/_helpers/OverflowMenu.js +33 -5
- package/dist/components/MultiSelect/_helpers/OverflowMenuItem.js +1 -1
- package/dist/components/MultiSelect/_helpers/SearchResult.js +1 -1
- package/dist/components/MultiSelect/_helpers/TagContent.js +1 -1
- package/dist/components/MultiSelect/_helpers/TriggerButton.js +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/SingleSelectDropdown/_helpers/DropdownFooter.js +1 -1
- package/dist/components/SingleSelectDropdown/index.js +1 -1
- package/dist/components/Table/_types/table.types.d.ts +10 -0
- package/dist/components/Table/_types/table.types.d.ts.map +1 -1
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js +266 -252
- package/dist/styles.module-Ck6QqhF4.js +55 -0
- package/package.json +1 -1
- package/dist/DropdownFooter-CsDll1Tj.js +0 -96
- package/dist/assets/index-CDtSVOTj.css +0 -1
- package/dist/assets/styles-CEyiQgVQ.css +0 -1
- package/dist/styles.module-yIHBMSTk.js +0 -53
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { EXTENDED_PALETTE as
|
|
2
|
-
import { getBaseConfig as h, getStackedColumnChartShell as
|
|
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
|
|
5
|
-
const t = e.plotSpacePercent ?? (e.plotSpacePercent === 0 ? e.plotSpacePercent : 60), a = Array.isArray(e.graphData) ? e.graphData : [], s = a.some((
|
|
6
|
-
const
|
|
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
|
-
...
|
|
9
|
-
color:
|
|
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'>${
|
|
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
|
-
}),
|
|
13
|
-
...
|
|
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
|
-
},
|
|
32
|
-
chart:
|
|
33
|
-
categories:
|
|
34
|
-
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:
|
|
38
|
+
width: x,
|
|
39
39
|
height: e.height || "300",
|
|
40
|
-
dataSource:
|
|
40
|
+
dataSource: c
|
|
41
41
|
});
|
|
42
42
|
}, X = (e = {}) => h({
|
|
43
43
|
type: "area2d",
|
|
44
|
-
width:
|
|
44
|
+
width: x,
|
|
45
45
|
height: "550",
|
|
46
46
|
dataSource: {
|
|
47
47
|
chart: {
|
|
48
|
-
...
|
|
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((
|
|
58
|
-
...
|
|
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'>${
|
|
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 ||
|
|
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:
|
|
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,
|
|
80
|
-
|
|
81
|
-
|
|
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 ||
|
|
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((
|
|
107
|
-
...
|
|
108
|
-
plotToolText: e.plotToolText || (
|
|
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 ||
|
|
120
|
+
width: e.width || x,
|
|
114
121
|
height: e.height || "400",
|
|
115
122
|
dataSource: {
|
|
116
123
|
chart: {
|
|
117
|
-
...
|
|
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 ||
|
|
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 ||
|
|
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((
|
|
170
|
-
const
|
|
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
|
-
...
|
|
173
|
-
color:
|
|
174
|
-
plotBorderColor:
|
|
179
|
+
...c,
|
|
180
|
+
color: g,
|
|
181
|
+
plotBorderColor: g,
|
|
175
182
|
plotBorderThickness: "2",
|
|
176
183
|
plotBorderAlpha: "100",
|
|
177
|
-
anchorBgColor:
|
|
178
|
-
anchorBorderColor:
|
|
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 (
|
|
192
|
+
if (i > 0)
|
|
186
193
|
return {
|
|
187
194
|
...b,
|
|
188
195
|
alpha: "60",
|
|
189
196
|
toolText: " "
|
|
190
197
|
};
|
|
191
|
-
const f =
|
|
192
|
-
const
|
|
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:${
|
|
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 ||
|
|
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:
|
|
230
|
+
dataset: d
|
|
224
231
|
}
|
|
225
232
|
});
|
|
226
233
|
}, te = (e = {}) => {
|
|
227
|
-
const t = y(e.numberPrefix), s = (e?.palettecolors || "#8ECFFF").split(",").map((
|
|
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
|
|
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,
|
|
240
|
-
const $ =
|
|
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
|
|
246
|
-
const I = (
|
|
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:${
|
|
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>${
|
|
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 ||
|
|
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:
|
|
275
|
+
categories: [{ category: g }],
|
|
269
276
|
dataset: b
|
|
270
277
|
}
|
|
271
278
|
});
|
|
272
279
|
}
|
|
273
|
-
const
|
|
274
|
-
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'>${
|
|
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 ||
|
|
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:
|
|
296
|
+
categories: [{ category: d }],
|
|
290
297
|
dataset: [
|
|
291
298
|
{
|
|
292
|
-
seriesname:
|
|
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:
|
|
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:
|
|
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:
|
|
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((
|
|
351
|
-
if (!
|
|
352
|
-
|
|
353
|
-
else if (
|
|
354
|
-
const [
|
|
355
|
-
|
|
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
|
|
358
|
-
const
|
|
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,
|
|
361
|
-
...
|
|
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}${
|
|
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(
|
|
373
|
-
data:
|
|
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 ||
|
|
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
|
|
404
|
-
t =
|
|
410
|
+
const o = e.graphData;
|
|
411
|
+
t = o.map((d) => ({ label: d.label || "" })), a = [
|
|
405
412
|
{
|
|
406
413
|
seriesname: "Series 1",
|
|
407
|
-
data:
|
|
414
|
+
data: o.map((d) => ({ value: d.value }))
|
|
408
415
|
}
|
|
409
416
|
];
|
|
410
417
|
} else {
|
|
411
|
-
const
|
|
412
|
-
t =
|
|
413
|
-
...
|
|
414
|
-
seriesname:
|
|
415
|
-
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((
|
|
419
|
-
...
|
|
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 ||
|
|
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((
|
|
458
|
-
...
|
|
459
|
-
plotToolText: e.plotToolText || (
|
|
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 ||
|
|
471
|
+
width: e.width || x,
|
|
465
472
|
height: e.height || "400",
|
|
466
473
|
dataSource: {
|
|
467
474
|
chart: {
|
|
468
|
-
...
|
|
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 ||
|
|
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((
|
|
495
|
-
const
|
|
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
|
-
...
|
|
498
|
-
color:
|
|
504
|
+
...c,
|
|
505
|
+
color: r,
|
|
499
506
|
...e.plotToolText ? { plotToolText: e.plotToolText } : {},
|
|
500
|
-
data:
|
|
507
|
+
data: g.map((u, b) => {
|
|
501
508
|
const m = n[b]?.label || "";
|
|
502
509
|
if (e.plotToolText)
|
|
503
510
|
return { ...u };
|
|
504
|
-
if (
|
|
511
|
+
if (i > 0)
|
|
505
512
|
return { ...u, toolText: " " };
|
|
506
|
-
const C =
|
|
507
|
-
const v = f.color || l[T % l.length], $ = (f.data || [])[b]?.value ?? "",
|
|
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:${
|
|
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 ||
|
|
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 ||
|
|
539
|
+
palettecolors: s ? void 0 : e.palettecolors || B
|
|
533
540
|
},
|
|
534
541
|
categories: [{ category: n }],
|
|
535
|
-
dataset:
|
|
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 ||
|
|
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:
|
|
571
|
-
column2d:
|
|
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,
|
|
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
|
|
2
|
-
import { adjustMultiAxisValueLabels as
|
|
3
|
-
import { adjustMultiLineValueLabels as
|
|
4
|
-
const
|
|
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:
|
|
8
|
-
manageMultiAxisLineLabels:
|
|
9
|
-
manageMultiLineLabels:
|
|
7
|
+
manageDoughnutLabels: r,
|
|
8
|
+
manageMultiAxisLineLabels: m = !1,
|
|
9
|
+
manageMultiLineLabels: c = !1
|
|
10
10
|
} = e;
|
|
11
|
-
if (t === "doughnutChart" &&
|
|
11
|
+
if (t === "doughnutChart" && r)
|
|
12
12
|
return {
|
|
13
|
-
renderComplete:
|
|
14
|
-
legendItemClicked:
|
|
15
|
-
dataPlotClick:
|
|
16
|
-
dataPlotRollOver:
|
|
17
|
-
dataPlotRollOut:
|
|
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 === "
|
|
24
|
+
if (t === "multiAxisLineChart" && m)
|
|
20
25
|
return {
|
|
21
26
|
renderComplete: i,
|
|
22
|
-
legendItemClicked:
|
|
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
|
-
|
|
27
|
-
|
|
39
|
+
dataPlotRollOver: (l) => o(g(l)),
|
|
40
|
+
dataPlotRollOut: () => o(null)
|
|
28
41
|
};
|
|
29
|
-
}
|
|
42
|
+
}
|
|
43
|
+
}, b = (e = {}) => {
|
|
30
44
|
if (e.chartType !== "groupChart" || !e.chartRef)
|
|
31
45
|
return;
|
|
32
46
|
const t = e.chartRef;
|
|
33
|
-
return (
|
|
34
|
-
t.current =
|
|
47
|
+
return (r) => {
|
|
48
|
+
t.current = r;
|
|
35
49
|
};
|
|
36
50
|
};
|
|
37
51
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
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
|