@ironsource/shared-ui 2.1.12-rc.4 → 2.1.12-rc.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.
- package/ButtonFilterDropdownTrigger.vue_vue_type_style_index_0_scoped_0198fee8_lang.css +1 -0
- package/Chart.vue_vue_type_style_index_0_scoped_78d3f5a8_lang.css +1 -0
- package/ChartHeader.vue_vue_type_style_index_0_scoped_32001725_lang.css +1 -0
- package/ChartHeaderTrend.vue_vue_type_style_index_0_scoped_e4c673e7_lang.css +1 -0
- package/ChartLegend.vue_vue_type_style_index_0_scoped_532f23bc_lang.css +1 -0
- package/ChartPlane.vue_vue_type_style_index_0_scoped_4396faf6_lang.css +1 -0
- package/ChartTooltip.vue_vue_type_style_index_0_scoped_25d0e129_lang.css +1 -0
- package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_8d5521da_lang.css +1 -0
- package/DateRangeV4.vue_vue_type_style_index_0_scoped_a849128a_lang.css +1 -0
- package/components/chart/Chart.vue.d.ts +57 -39
- package/components/chart/Chart.vue.js +3 -3
- package/components/chart/Chart.vue2.js +97 -296
- package/components/chart/ChartHeader.vue.d.ts +20 -10
- package/components/chart/ChartHeader.vue.js +2 -2
- package/components/chart/ChartHeader.vue2.js +74 -52
- package/components/chart/ChartHeaderTrend.vue.d.ts +34 -0
- package/components/chart/ChartHeaderTrend.vue.js +7 -0
- package/components/chart/ChartHeaderTrend.vue2.js +32 -0
- package/components/chart/ChartLegend.vue.js +2 -2
- package/components/chart/ChartLegend.vue2.js +36 -35
- package/components/chart/ChartPlane.vue.d.ts +143 -0
- package/components/chart/ChartPlane.vue.js +7 -0
- package/components/chart/ChartPlane.vue2.js +306 -0
- package/components/chart/ChartStoryArgs.d.ts +135 -0
- package/components/chart/ChartTooltip.vue.js +2 -2
- package/components/chart/ChartTooltip.vue2.js +36 -35
- package/components/chart/composables/useChartHeight.d.ts +5 -0
- package/components/chart/composables/useChartHeight.js +22 -0
- package/components/chart/composables/useColorsMap.d.ts +10 -0
- package/components/chart/composables/useColorsMap.js +17 -0
- package/components/chart/composables/useTooltipPosition.d.ts +1 -1
- package/components/chart/composables/useTooltipPosition.js +11 -15
- package/components/chart/consts.d.ts +5 -0
- package/components/chart/consts.js +20 -15
- package/components/chart/index.d.ts +189 -113
- package/components/chart/mockData.d.ts +27 -1
- package/components/chart/types.d.ts +4 -0
- package/components/chart/utils/formatNumber.d.ts +0 -1
- package/components/chart/utils/utils.js +5 -5
- package/components/dateRange/v4/DateRangeV4.vue.js +2 -2
- package/components/dateRange/v4/DateRangeV4.vue2.js +1 -1
- package/components/dropdown/v4/ButtonFilterDropdownTrigger.vue.js +2 -2
- package/components/dropdown/v4/ButtonFilterDropdownTrigger.vue2.js +1 -1
- package/components/dropdown/v4/ConditionalDropdown.vue.js +4 -4
- package/components/dropdown/v4/ConditionalDropdown.vue2.js +64 -64
- package/components/emptyState/v4/EmptyStateV4.vue.d.ts +3 -3
- package/components/emptyState/v4/index.d.ts +7 -7
- package/components/table/v4/DataGrid.vue.d.ts +3 -3
- package/components/table/v4/MultipleDataGrid.vue.d.ts +3 -3
- package/components/table/v4/index.d.ts +14 -14
- package/composables/useFullPageHeight.d.ts +10 -0
- package/composables/useFullPageHeight.js +15 -0
- package/index.d.ts +42 -42
- package/index.js +1 -1
- package/package.json +1 -1
- package/utils/formatNumbers.d.ts +1 -1
- package/utils/formatNumbers.js +8 -9
- package/ButtonFilterDropdownTrigger.vue_vue_type_style_index_0_scoped_ea1c4589_lang.css +0 -1
- package/Chart.vue_vue_type_style_index_0_scoped_a641383a_lang.css +0 -1
- package/ChartHeader.vue_vue_type_style_index_0_scoped_b8213498_lang.css +0 -1
- package/ChartLegend.vue_vue_type_style_index_0_scoped_4fe1c7d1_lang.css +0 -1
- package/ChartTooltip.vue_vue_type_style_index_0_scoped_6744325c_lang.css +0 -1
- package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_96c7507e_lang.css +0 -1
- package/DateRangeV4.vue_vue_type_style_index_0_scoped_8a2714eb_lang.css +0 -1
- package/components/chart/utils/formatNumber.js +0 -11
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
import "../../ChartPlane.vue_vue_type_style_index_0_scoped_4396faf6_lang.css"; import { defineComponent as j, useCssVars as q, unref as s, computed as a, ref as C, onMounted as J, watch as g, nextTick as Q, openBlock as f, createElementBlock as X, createElementVNode as h, createVNode as ee, isRef as te, createSlots as ae, withCtx as oe, renderSlot as re, normalizeStyle as le, createBlock as b, createCommentVNode as I } from "vue";
|
|
2
|
+
import { Chart as H, ArcElement as ie, LineElement as ne, BarElement as se, PointElement as ce, LineController as de, BarController as ue, PieController as pe, ScatterController as fe, CategoryScale as he, LinearScale as me, Filler as ve, Tooltip as ye } from "chart.js";
|
|
3
|
+
import { HoverVerticalLine as Ce } from "./plugins/HoverVerticalLine.js";
|
|
4
|
+
import { formatValue as O, calcStepSize as ge } from "./utils/utils.js";
|
|
5
|
+
import { DEFAULT_TICK_COUNT as be, TOTALS_HELPER_KEY as P, POINT_BORDER_COLOR as Te, TICK_LABEL_COLOR as F, TICK_LABEL_FONT as N, GRID_LINE_COLOR as M, HEADER_HEIGHT as ke, COMPACT_HEADER_HEIGHT as xe } from "./consts.js";
|
|
6
|
+
import { ChartType as i } from "./types.js";
|
|
7
|
+
import { useTooltipPosition as Se } from "./composables/useTooltipPosition.js";
|
|
8
|
+
import Le from "./ChartTooltip.vue.js";
|
|
9
|
+
import { hexColorToRgba as Ee } from "../../utils/color.js";
|
|
10
|
+
import { useChartValues as Be } from "./composables/useChartValues.js";
|
|
11
|
+
import Ae from "./ChartHeader.vue.js";
|
|
12
|
+
import { useVModel as Re } from "@vueuse/core";
|
|
13
|
+
import we from "../emptyState/v4/EmptyStateV4.vue.js";
|
|
14
|
+
import Ve from "./ChartLoader.vue.js";
|
|
15
|
+
import { useColorsMap as De } from "./composables/useColorsMap.js";
|
|
16
|
+
const Ie = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "chart-plane"
|
|
19
|
+
}, He = { class: "header-wrapper" }, Oe = { class: "chart" }, Je = /* @__PURE__ */ j({
|
|
20
|
+
__name: "ChartPlane",
|
|
21
|
+
props: {
|
|
22
|
+
dataSets: { default: () => [] },
|
|
23
|
+
visibleIds: { default: () => [] },
|
|
24
|
+
chartType: { default: i.Line },
|
|
25
|
+
parsing: { default: void 0 },
|
|
26
|
+
xAxisFormat: { default: "string" },
|
|
27
|
+
yAxisFormat: { default: "number" },
|
|
28
|
+
tickCount: { default: be },
|
|
29
|
+
header: { default: "" },
|
|
30
|
+
subheader: { default: "" },
|
|
31
|
+
loading: { type: Boolean, default: !1 },
|
|
32
|
+
noDataIcon: { default: "file-search" },
|
|
33
|
+
noDataTitle: { default: "No data to display" },
|
|
34
|
+
noDataSubtitle: { default: "Search again with different filters" },
|
|
35
|
+
withAnimation: { type: Boolean, default: !0 },
|
|
36
|
+
typeSwitcher: { type: Boolean, default: !0 },
|
|
37
|
+
height: { default: "100%" },
|
|
38
|
+
compactHeader: { type: Boolean, default: !1 },
|
|
39
|
+
tooltipRespectsTopEdge: { type: Boolean, default: !0 },
|
|
40
|
+
trendValue: { default: null },
|
|
41
|
+
trendDirection: { default: "up" },
|
|
42
|
+
totalsChart: { type: Boolean, default: !1 }
|
|
43
|
+
},
|
|
44
|
+
emits: ["update:chartType"],
|
|
45
|
+
setup(o, { emit: z }) {
|
|
46
|
+
const e = o;
|
|
47
|
+
q((t) => ({
|
|
48
|
+
"86c5ce4e": s(Z),
|
|
49
|
+
"27543fc4": o.height
|
|
50
|
+
})), H.register(
|
|
51
|
+
ie,
|
|
52
|
+
ne,
|
|
53
|
+
se,
|
|
54
|
+
ce,
|
|
55
|
+
de,
|
|
56
|
+
ue,
|
|
57
|
+
pe,
|
|
58
|
+
fe,
|
|
59
|
+
he,
|
|
60
|
+
me,
|
|
61
|
+
ve,
|
|
62
|
+
ye,
|
|
63
|
+
Ce
|
|
64
|
+
);
|
|
65
|
+
const m = Re(e, "chartType", z), K = a(
|
|
66
|
+
() => e.withAnimation ? "" : "none"
|
|
67
|
+
), c = C(null);
|
|
68
|
+
let n = null;
|
|
69
|
+
const T = a(() => e.dataSets.length === 0), k = a(() => !e.loading && !T.value), v = () => {
|
|
70
|
+
c.value && (n && n.destroy(), n = new H(c.value, A.value));
|
|
71
|
+
}, _ = () => {
|
|
72
|
+
n && (n.data.datasets = E.value, n.options = A.value.options, n.update(K.value));
|
|
73
|
+
};
|
|
74
|
+
J(v), g(() => e.chartType, v), g(k, async (t) => {
|
|
75
|
+
t && (await Q(), v());
|
|
76
|
+
}), g([() => e.visibleIds, () => e.dataSets], _);
|
|
77
|
+
const d = a(() => e.totalsChart), u = a(
|
|
78
|
+
() => e.chartType === i.StackedLine || e.chartType === i.StackedBar || d.value
|
|
79
|
+
), x = a(
|
|
80
|
+
() => e.chartType === i.Line || e.chartType === i.StackedLine
|
|
81
|
+
), S = a(() => d.value ? { ...e.parsing, xAxisKey: P } : e.parsing), L = a(() => d.value ? e.dataSets.map((t) => ({
|
|
82
|
+
...t,
|
|
83
|
+
data: t.data.map((r) => ({
|
|
84
|
+
...r,
|
|
85
|
+
[P]: t.label
|
|
86
|
+
}))
|
|
87
|
+
})) : e.dataSets), U = a(() => e.visibleIds || []), p = a(
|
|
88
|
+
() => L.value.filter((t) => e.visibleIds.includes(t.id))
|
|
89
|
+
), { colorsMap: $ } = De({ dataSets: L, visibleIds: U }), E = a(() => p.value.map((t) => {
|
|
90
|
+
const r = $.value[t.id];
|
|
91
|
+
return {
|
|
92
|
+
...t,
|
|
93
|
+
fill: u.value ? "start" : void 0,
|
|
94
|
+
backgroundColor: Ee(
|
|
95
|
+
r,
|
|
96
|
+
e.chartType === i.StackedLine ? 10 : 70
|
|
97
|
+
),
|
|
98
|
+
borderColor: r,
|
|
99
|
+
pointBackgroundColor: r,
|
|
100
|
+
pointHoverBorderColor: r,
|
|
101
|
+
maxBarThickness: 50,
|
|
102
|
+
clip: 5,
|
|
103
|
+
// draw a bit outside the chart area
|
|
104
|
+
icon: t.icon || null,
|
|
105
|
+
iconType: t.iconType || "branded"
|
|
106
|
+
};
|
|
107
|
+
})), B = a(
|
|
108
|
+
() => p.value.length && p.value.every(
|
|
109
|
+
(t) => t.data.length === 1
|
|
110
|
+
)
|
|
111
|
+
), A = a(
|
|
112
|
+
() => ({
|
|
113
|
+
type: e.chartType == i.Bar || e.chartType === i.StackedBar ? "bar" : "line",
|
|
114
|
+
// Chart Data
|
|
115
|
+
data: {
|
|
116
|
+
datasets: E.value
|
|
117
|
+
},
|
|
118
|
+
// Chart Options
|
|
119
|
+
options: {
|
|
120
|
+
parsing: S.value,
|
|
121
|
+
interaction: {
|
|
122
|
+
intersect: !1,
|
|
123
|
+
mode: d.value ? "point" : "index",
|
|
124
|
+
axis: "x"
|
|
125
|
+
},
|
|
126
|
+
// plugins
|
|
127
|
+
plugins: {
|
|
128
|
+
legend: { display: !1 },
|
|
129
|
+
title: { display: !1 },
|
|
130
|
+
hoverVerticalLine: x.value,
|
|
131
|
+
// tooltip
|
|
132
|
+
tooltip: {
|
|
133
|
+
enabled: !1,
|
|
134
|
+
position: "average",
|
|
135
|
+
external: ({ tooltip: t }) => {
|
|
136
|
+
l.value = { ...t };
|
|
137
|
+
},
|
|
138
|
+
callbacks: {
|
|
139
|
+
footer: (t) => {
|
|
140
|
+
const r = t.reduce((y, Y) => y + (Y.parsed.y || 0), 0);
|
|
141
|
+
return ["Total", String(r)];
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
// chart layout
|
|
147
|
+
responsive: !0,
|
|
148
|
+
maintainAspectRatio: !1,
|
|
149
|
+
layout: {
|
|
150
|
+
padding: {
|
|
151
|
+
left: 18,
|
|
152
|
+
top: 18,
|
|
153
|
+
bottom: 11
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
// basic styles
|
|
157
|
+
elements: {
|
|
158
|
+
line: {
|
|
159
|
+
borderWidth: 2,
|
|
160
|
+
tension: 0.3
|
|
161
|
+
},
|
|
162
|
+
point: {
|
|
163
|
+
radius: B.value ? 3 : 1,
|
|
164
|
+
hitRadius: 8,
|
|
165
|
+
borderWidth: 0,
|
|
166
|
+
hoverRadius: 4,
|
|
167
|
+
hoverBorderWidth: 2,
|
|
168
|
+
pointHoverBackgroundColor: Te
|
|
169
|
+
},
|
|
170
|
+
bar: {
|
|
171
|
+
borderRadius: 4
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
scales: {
|
|
175
|
+
// Horizontal Axis (X)
|
|
176
|
+
x: {
|
|
177
|
+
beginAtZero: !0,
|
|
178
|
+
offset: !x.value || B.value,
|
|
179
|
+
border: { display: !1 },
|
|
180
|
+
stacked: u.value,
|
|
181
|
+
// stack on top of each other
|
|
182
|
+
// ticks
|
|
183
|
+
ticks: {
|
|
184
|
+
color: F,
|
|
185
|
+
font: N,
|
|
186
|
+
padding: 4,
|
|
187
|
+
callback: function(t) {
|
|
188
|
+
return O(
|
|
189
|
+
this.getLabelForValue(t),
|
|
190
|
+
e.xAxisFormat
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
// grid lines
|
|
195
|
+
grid: {
|
|
196
|
+
color: M,
|
|
197
|
+
drawOnChartArea: !1,
|
|
198
|
+
drawTicks: !0,
|
|
199
|
+
drawBorder: !1,
|
|
200
|
+
tickLength: 7
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
// Vertical Axis (Y)
|
|
204
|
+
y: {
|
|
205
|
+
beginAtZero: !0,
|
|
206
|
+
border: { display: !1 },
|
|
207
|
+
// hide left borderline
|
|
208
|
+
stacked: u.value,
|
|
209
|
+
// stack on top of each other
|
|
210
|
+
// ticks
|
|
211
|
+
ticks: {
|
|
212
|
+
color: F,
|
|
213
|
+
font: N,
|
|
214
|
+
padding: 8,
|
|
215
|
+
stepSize: D.value,
|
|
216
|
+
min: V.value,
|
|
217
|
+
max: D.value * e.tickCount,
|
|
218
|
+
callback: (t) => O(t, e.yAxisFormat)
|
|
219
|
+
},
|
|
220
|
+
// grid lines
|
|
221
|
+
grid: {
|
|
222
|
+
color: M,
|
|
223
|
+
drawOnChartArea: !0,
|
|
224
|
+
drawTicks: !1
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
})
|
|
230
|
+
), R = C(null), l = C(null), { position: w } = Se(
|
|
231
|
+
c,
|
|
232
|
+
R,
|
|
233
|
+
l,
|
|
234
|
+
e.tooltipRespectsTopEdge
|
|
235
|
+
), G = a(() => ({
|
|
236
|
+
left: `${w.value.left}px`,
|
|
237
|
+
top: `${w.value.top}px`,
|
|
238
|
+
opacity: l.value?.opacity || 0
|
|
239
|
+
})), { minValue: V, maxValue: W } = Be({
|
|
240
|
+
parsingConfig: S.value,
|
|
241
|
+
dataSets: p,
|
|
242
|
+
isStacked: u
|
|
243
|
+
}), D = a(
|
|
244
|
+
() => ge(V.value, W.value, e.tickCount)
|
|
245
|
+
), Z = a(
|
|
246
|
+
() => (e.compactHeader ? xe : ke) + "px"
|
|
247
|
+
);
|
|
248
|
+
return (t, r) => s(k) ? (f(), X("section", Ie, [
|
|
249
|
+
h("div", He, [
|
|
250
|
+
ee(Ae, {
|
|
251
|
+
"chart-type": s(m),
|
|
252
|
+
"onUpdate:chart-type": r[0] || (r[0] = (y) => te(m) ? m.value = y : null),
|
|
253
|
+
"type-switcher": o.typeSwitcher,
|
|
254
|
+
header: o.header,
|
|
255
|
+
subheader: o.subheader,
|
|
256
|
+
compact: o.compactHeader,
|
|
257
|
+
"trend-value": o.trendValue,
|
|
258
|
+
"trend-direction": o.trendDirection
|
|
259
|
+
}, ae({ _: 2 }, [
|
|
260
|
+
t.$slots["subheader-tooltip"] ? {
|
|
261
|
+
name: "subheader-tooltip",
|
|
262
|
+
fn: oe(() => [
|
|
263
|
+
re(t.$slots, "subheader-tooltip", {}, void 0, !0)
|
|
264
|
+
]),
|
|
265
|
+
key: "0"
|
|
266
|
+
} : void 0
|
|
267
|
+
]), 1032, ["chart-type", "type-switcher", "header", "subheader", "compact", "trend-value", "trend-direction"])
|
|
268
|
+
]),
|
|
269
|
+
h("div", Oe, [
|
|
270
|
+
h("canvas", {
|
|
271
|
+
ref_key: "chartRef",
|
|
272
|
+
ref: c,
|
|
273
|
+
class: "chart__canvas"
|
|
274
|
+
}, null, 512),
|
|
275
|
+
h("div", {
|
|
276
|
+
ref_key: "tooltipRef",
|
|
277
|
+
ref: R,
|
|
278
|
+
class: "chart__tooltip",
|
|
279
|
+
style: le(s(G))
|
|
280
|
+
}, [
|
|
281
|
+
l.value ? (f(), b(Le, {
|
|
282
|
+
key: 0,
|
|
283
|
+
title: String(l.value.title),
|
|
284
|
+
"data-points": l.value.dataPoints,
|
|
285
|
+
"x-axis-format": o.xAxisFormat,
|
|
286
|
+
"y-axis-format": o.yAxisFormat,
|
|
287
|
+
"total-label": l.value.footer[0],
|
|
288
|
+
"total-value": Number(l.value.footer[1])
|
|
289
|
+
}, null, 8, ["title", "data-points", "x-axis-format", "y-axis-format", "total-label", "total-value"])) : I("", !0)
|
|
290
|
+
], 4)
|
|
291
|
+
])
|
|
292
|
+
])) : o.loading ? (f(), b(Ve, {
|
|
293
|
+
key: 1,
|
|
294
|
+
class: "chart-loading"
|
|
295
|
+
})) : s(T) ? (f(), b(s(we), {
|
|
296
|
+
key: 2,
|
|
297
|
+
class: "chart-empty",
|
|
298
|
+
title: o.noDataTitle,
|
|
299
|
+
subtitle: o.noDataSubtitle,
|
|
300
|
+
"icon-name": o.noDataIcon
|
|
301
|
+
}, null, 8, ["title", "subtitle", "icon-name"])) : I("", !0);
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
export {
|
|
305
|
+
Je as default
|
|
306
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { ChartType } from '@/components/chart/types';
|
|
2
|
+
export declare const chartStoryArgs: {
|
|
3
|
+
chartType: {
|
|
4
|
+
control: {
|
|
5
|
+
type: string;
|
|
6
|
+
};
|
|
7
|
+
options: ChartType[];
|
|
8
|
+
};
|
|
9
|
+
dataSets: {
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
xAxisFormat: {
|
|
13
|
+
options: string[];
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
yAxisFormat: {
|
|
17
|
+
options: string[];
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
parsing: {
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
hideLegend: {
|
|
24
|
+
table: {
|
|
25
|
+
category: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
minVisible: {
|
|
29
|
+
table: {
|
|
30
|
+
category: string;
|
|
31
|
+
};
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
maxVisible: {
|
|
35
|
+
table: {
|
|
36
|
+
category: string;
|
|
37
|
+
};
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
40
|
+
maxLimitTooltipText: {
|
|
41
|
+
table: {
|
|
42
|
+
category: string;
|
|
43
|
+
};
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
noDataIcon: {
|
|
47
|
+
table: {
|
|
48
|
+
category: string;
|
|
49
|
+
};
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
noDataTitle: {
|
|
53
|
+
table: {
|
|
54
|
+
category: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
noDataSubtitle: {
|
|
58
|
+
table: {
|
|
59
|
+
category: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
header: {
|
|
63
|
+
table: {
|
|
64
|
+
category: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
subheader: {
|
|
68
|
+
table: {
|
|
69
|
+
category: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
trendValue: {
|
|
73
|
+
table: {
|
|
74
|
+
category: string;
|
|
75
|
+
};
|
|
76
|
+
description: string;
|
|
77
|
+
};
|
|
78
|
+
trendDirection: {
|
|
79
|
+
table: {
|
|
80
|
+
category: string;
|
|
81
|
+
};
|
|
82
|
+
description: string;
|
|
83
|
+
control: {
|
|
84
|
+
type: string;
|
|
85
|
+
options: string[];
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
tickCount: {
|
|
89
|
+
description: string;
|
|
90
|
+
};
|
|
91
|
+
loading: {
|
|
92
|
+
description: string;
|
|
93
|
+
control: {
|
|
94
|
+
type: string;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
withAnimation: {
|
|
98
|
+
control: {
|
|
99
|
+
type: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
totalsChart: {
|
|
103
|
+
description: string;
|
|
104
|
+
control: {
|
|
105
|
+
type: string;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
fullHeight: {
|
|
109
|
+
table: {
|
|
110
|
+
category: string;
|
|
111
|
+
};
|
|
112
|
+
description: string;
|
|
113
|
+
control: {
|
|
114
|
+
type: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
withSettingsHeader: {
|
|
118
|
+
table: {
|
|
119
|
+
category: string;
|
|
120
|
+
};
|
|
121
|
+
description: string;
|
|
122
|
+
control: {
|
|
123
|
+
type: string;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
extraCharts: {
|
|
127
|
+
table: {
|
|
128
|
+
category: string;
|
|
129
|
+
};
|
|
130
|
+
description: string;
|
|
131
|
+
control: {
|
|
132
|
+
type: string;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ChartTooltip.vue2.js";
|
|
2
2
|
/* empty css */import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
-
// import "../../ChartTooltip.
|
|
4
|
-
const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
3
|
+
// import "../../ChartTooltip.vue_vue_type_style_index_0_scoped_25d0e129_lang.css"; //*');
|
|
4
|
+
const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-25d0e129"]]);
|
|
5
5
|
export {
|
|
6
6
|
s as default
|
|
7
7
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import "../../ChartTooltip.
|
|
2
|
-
import
|
|
3
|
-
import { formatValue as
|
|
4
|
-
import
|
|
1
|
+
import "../../ChartTooltip.vue_vue_type_style_index_0_scoped_25d0e129_lang.css"; import { defineComponent as F, computed as x, openBlock as l, createElementBlock as n, createVNode as u, unref as t, withCtx as o, createTextVNode as r, toDisplayString as i, createBlock as y, createCommentVNode as d, createElementVNode as f, Fragment as v, renderList as h, normalizeStyle as k } from "vue";
|
|
2
|
+
import s from "../typography/v4/Typography.vue.js";
|
|
3
|
+
import { formatValue as m } from "./utils/utils.js";
|
|
4
|
+
import g from "../icon/v4/IconV4.vue.js";
|
|
5
5
|
import "../icon/v4/IconFlag.vue.js";
|
|
6
6
|
const A = { class: "chart-tooltip" }, V = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "tooltip-title-wrapper"
|
|
9
|
-
}, C = { class: "list" }, T = { class: "popover-label-wrapper" },
|
|
9
|
+
}, C = { class: "list" }, T = { class: "popover-label-wrapper" }, w = {
|
|
10
10
|
key: 1,
|
|
11
11
|
class: "tooltip-footer"
|
|
12
|
-
}, I = /* @__PURE__ */
|
|
12
|
+
}, I = /* @__PURE__ */ F({
|
|
13
13
|
__name: "ChartTooltip",
|
|
14
14
|
props: {
|
|
15
15
|
title: { default: "" },
|
|
@@ -20,80 +20,81 @@ const A = { class: "chart-tooltip" }, V = {
|
|
|
20
20
|
totalValue: { default: null }
|
|
21
21
|
},
|
|
22
22
|
setup(e) {
|
|
23
|
-
const
|
|
24
|
-
return (
|
|
25
|
-
e.title ? (l(),
|
|
26
|
-
|
|
27
|
-
default:
|
|
28
|
-
i(
|
|
23
|
+
const c = e, p = x(() => c.xAxisFormat === "date" ? "dateLong" : c.xAxisFormat), b = x(() => c.xAxisFormat === "date" ? "day" : c.xAxisFormat);
|
|
24
|
+
return (B, L) => (l(), n("div", A, [
|
|
25
|
+
e.title ? (l(), n("div", V, [
|
|
26
|
+
u(t(s), { variant: "subtitle2" }, {
|
|
27
|
+
default: o(() => [
|
|
28
|
+
r(i(t(m)(e.title, t(p))), 1)
|
|
29
29
|
]),
|
|
30
30
|
_: 1
|
|
31
31
|
}),
|
|
32
|
-
|
|
32
|
+
e.xAxisFormat === "date" ? (l(), y(t(s), {
|
|
33
|
+
key: 0,
|
|
33
34
|
class: "tooltip-sub-title",
|
|
34
35
|
variant: "caption"
|
|
35
36
|
}, {
|
|
36
|
-
default:
|
|
37
|
-
i(
|
|
37
|
+
default: o(() => [
|
|
38
|
+
r(i(t(m)(e.title, t(b))), 1)
|
|
38
39
|
]),
|
|
39
40
|
_: 1
|
|
40
|
-
})
|
|
41
|
-
])) :
|
|
41
|
+
})) : d("", !0)
|
|
42
|
+
])) : d("", !0),
|
|
42
43
|
f("ul", C, [
|
|
43
|
-
(l(!0),
|
|
44
|
+
(l(!0), n(v, null, h(e.dataPoints, (a) => (l(), n("li", {
|
|
44
45
|
key: a.datasetIndex,
|
|
45
46
|
class: "list__item"
|
|
46
47
|
}, [
|
|
47
48
|
f("span", {
|
|
48
49
|
class: "color-box",
|
|
49
|
-
style:
|
|
50
|
+
style: k({
|
|
50
51
|
backgroundColor: String(a.dataset.pointBackgroundColor)
|
|
51
52
|
})
|
|
52
53
|
}, null, 4),
|
|
53
|
-
a.dataset.icon ? (l(),
|
|
54
|
+
a.dataset.icon ? (l(), y(t(g), {
|
|
54
55
|
key: 0,
|
|
55
56
|
class: "platform-icon",
|
|
56
57
|
type: a.dataset.iconType,
|
|
57
58
|
name: a.dataset.icon,
|
|
58
59
|
size: "16px"
|
|
59
|
-
}, null, 8, ["type", "name"])) :
|
|
60
|
+
}, null, 8, ["type", "name"])) : d("", !0),
|
|
60
61
|
f("div", T, [
|
|
61
|
-
|
|
62
|
+
u(t(s), {
|
|
62
63
|
variant: "body2",
|
|
63
64
|
class: "flex-grow truncated-label",
|
|
64
65
|
"is-truncated": ""
|
|
65
66
|
}, {
|
|
66
|
-
default:
|
|
67
|
-
i(
|
|
67
|
+
default: o(() => [
|
|
68
|
+
r(i(a.dataset.label), 1)
|
|
68
69
|
]),
|
|
69
70
|
_: 2
|
|
70
71
|
}, 1024)
|
|
71
72
|
]),
|
|
72
|
-
|
|
73
|
-
default:
|
|
74
|
-
i(
|
|
73
|
+
u(t(s), { variant: "body2" }, {
|
|
74
|
+
default: o(() => [
|
|
75
|
+
r(i(t(m)(a.parsed.y, e.yAxisFormat)), 1)
|
|
75
76
|
]),
|
|
76
77
|
_: 2
|
|
77
78
|
}, 1024)
|
|
78
79
|
]))), 128))
|
|
79
80
|
]),
|
|
80
|
-
e.totalValue !== null ? (l(),
|
|
81
|
-
|
|
81
|
+
e.totalValue !== null ? (l(), n("div", w, [
|
|
82
|
+
u(t(s), {
|
|
82
83
|
variant: "body2",
|
|
83
84
|
class: "flex-grow"
|
|
84
85
|
}, {
|
|
85
|
-
default:
|
|
86
|
-
i(
|
|
86
|
+
default: o(() => [
|
|
87
|
+
r(i(e.totalLabel), 1)
|
|
87
88
|
]),
|
|
88
89
|
_: 1
|
|
89
90
|
}),
|
|
90
|
-
|
|
91
|
-
default:
|
|
92
|
-
i(
|
|
91
|
+
u(t(s), { variant: "body2" }, {
|
|
92
|
+
default: o(() => [
|
|
93
|
+
r(i(t(m)(e.totalValue, e.yAxisFormat)), 1)
|
|
93
94
|
]),
|
|
94
95
|
_: 1
|
|
95
96
|
})
|
|
96
|
-
])) :
|
|
97
|
+
])) : d("", !0)
|
|
97
98
|
]));
|
|
98
99
|
}
|
|
99
100
|
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UseChartHeightArgs } from '@is-ssp/chart/types';
|
|
2
|
+
export declare const useChartHeight: ({ chartPlanesCount, useFullHeight, }: UseChartHeightArgs) => {
|
|
3
|
+
containerProps: import("vue").ComputedRef<Record<string, unknown>>;
|
|
4
|
+
eachPlaneHeight: import("vue").ComputedRef<string>;
|
|
5
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ref as H, computed as o } from "vue";
|
|
2
|
+
import { useElementBounding as g, useWindowScroll as m } from "@vueuse/core";
|
|
3
|
+
import { useFullPageHeight as f } from "../../../composables/useFullPageHeight.js";
|
|
4
|
+
import { DEFAULT_CHART_PLANE_HEIGHT as p, HEADER_HEIGHT as E, MIN_PLANE_HEIGHT as r } from "../consts.js";
|
|
5
|
+
const P = ({
|
|
6
|
+
chartPlanesCount: e,
|
|
7
|
+
useFullHeight: n
|
|
8
|
+
}) => {
|
|
9
|
+
const t = H(), { height: i } = g(t), { cssHeightValue: c } = f({
|
|
10
|
+
elem: t
|
|
11
|
+
}), { y: l } = m(), s = o(() => n && !l.value ? c.value : p + E + "px"), u = o(() => ({
|
|
12
|
+
ref: t,
|
|
13
|
+
style: { height: s.value }
|
|
14
|
+
})), h = o(() => e.value === 1 ? "100%" : i.value / e.value < r ? `${r}px` : 100 / e.value + "%");
|
|
15
|
+
return {
|
|
16
|
+
containerProps: u,
|
|
17
|
+
eachPlaneHeight: h
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
P as useChartHeight
|
|
22
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { ChartDataSet } from '@is-ssp/chart';
|
|
3
|
+
type UseColorsMapArgs = {
|
|
4
|
+
dataSets: Ref<ChartDataSet[]>;
|
|
5
|
+
visibleIds: Ref<unknown[]>;
|
|
6
|
+
};
|
|
7
|
+
export declare const useColorsMap: ({ dataSets, visibleIds }: UseColorsMapArgs) => {
|
|
8
|
+
colorsMap: import("vue").ComputedRef<{}>;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { computed as e } from "vue";
|
|
2
|
+
import { COLOR_PALETTE as a } from "../consts.js";
|
|
3
|
+
const n = ({ dataSets: t, visibleIds: l }) => {
|
|
4
|
+
const c = e(
|
|
5
|
+
() => t.value.filter(
|
|
6
|
+
(o) => l.value.includes(o.id)
|
|
7
|
+
)
|
|
8
|
+
);
|
|
9
|
+
return {
|
|
10
|
+
colorsMap: e(
|
|
11
|
+
() => c.value.reduce((o, r, u) => (o[r.id] = r.color || a[u] || "#000000", o), {})
|
|
12
|
+
)
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
n as useColorsMap
|
|
17
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { TooltipModel } from 'chart.js';
|
|
3
|
-
export declare const useTooltipPosition: (chartRef: Ref<HTMLCanvasElement | null>, tooltipRef: Ref<HTMLDivElement | null>, tooltipModel: Ref<TooltipModel<'line' | 'bar'
|
|
3
|
+
export declare const useTooltipPosition: (chartRef: Ref<HTMLCanvasElement | null>, tooltipRef: Ref<HTMLDivElement | null>, tooltipModel: Ref<TooltipModel<'line' | 'bar'>>, respectTop?: boolean) => {
|
|
4
4
|
position: import("vue").ComputedRef<{
|
|
5
5
|
top: number;
|
|
6
6
|
left: number;
|