@ironsource/shared-ui 2.1.12-rc.11 → 2.1.12-rc.13
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/Chart.vue_vue_type_style_index_0_scoped_a0b89669_lang.css +1 -0
- package/ChartLegend.vue_vue_type_style_index_0_scoped_da487aba_lang.css +1 -0
- package/ChartPlane.vue_vue_type_style_index_0_scoped_0f3a67d5_lang.css +1 -0
- package/IconButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_99e51ecc_lang.css +1 -0
- package/SettingsHeader.vue_vue_type_style_index_0_scoped_0875167b_lang.css +1 -0
- package/components/chart/Chart.vue.d.ts +19 -2
- package/components/chart/Chart.vue.js +2 -2
- package/components/chart/Chart.vue2.js +69 -57
- package/components/chart/ChartLegend.vue.d.ts +17 -0
- package/components/chart/ChartLegend.vue.js +3 -3
- package/components/chart/ChartLegend.vue2.js +78 -67
- package/components/chart/ChartPlane.vue.d.ts +7 -2
- package/components/chart/ChartPlane.vue.js +2 -2
- package/components/chart/ChartPlane.vue2.js +128 -127
- package/components/chart/LegendSorting.vue.d.ts +37 -0
- package/components/chart/LegendSorting.vue.js +45 -0
- package/components/chart/LegendSorting.vue2.js +4 -0
- package/components/chart/SettingsHeader.vue.js +3 -3
- package/components/chart/SettingsHeader.vue2.js +1 -1
- package/components/chart/colorPalette.d.ts +4 -0
- package/components/chart/colorPalette.js +54 -0
- package/components/chart/composables/useColorsMap.d.ts +2 -2
- package/components/chart/composables/useColorsMap.js +41 -12
- package/components/chart/consts.d.ts +12 -1
- package/components/chart/consts.js +31 -26
- package/components/chart/index.d.ts +103 -40
- package/components/chart/mockData.d.ts +8 -14
- package/components/chart/types.d.ts +2 -1
- package/components/dropdown/v4/IconButtonDropdownTrigger.vue.d.ts +11 -0
- package/components/dropdown/v4/IconButtonDropdownTrigger.vue.js +4 -4
- package/components/dropdown/v4/IconButtonDropdownTrigger.vue2.js +12 -10
- package/components/dropdown/v4/index.d.ts +18 -0
- package/index.d.ts +37 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/utils/formatNumbers.d.ts +1 -1
- package/utils/formatNumbers.js +14 -14
- package/Chart.vue_vue_type_style_index_0_scoped_78d3f5a8_lang.css +0 -1
- package/ChartLegend.vue_vue_type_style_index_0_scoped_532f23bc_lang.css +0 -1
- package/ChartPlane.vue_vue_type_style_index_0_scoped_4396faf6_lang.css +0 -1
- package/IconButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_59fb505a_lang.css +0 -1
- package/SettingsHeader.vue_vue_type_style_index_0_scoped_9b6cd9d9_lang.css +0 -1
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import "../../ChartPlane.
|
|
2
|
-
import { Chart as
|
|
3
|
-
import { HoverVerticalLine as
|
|
4
|
-
import { formatValue as
|
|
5
|
-
import { DEFAULT_TICK_COUNT as
|
|
6
|
-
import { ChartType as
|
|
7
|
-
import { useTooltipPosition as
|
|
8
|
-
import
|
|
9
|
-
import { hexColorToRgba as
|
|
10
|
-
import { useChartValues as
|
|
1
|
+
import "../../ChartPlane.vue_vue_type_style_index_0_scoped_0f3a67d5_lang.css"; import { defineComponent as Y, useCssVars as j, unref as c, computed as a, ref as g, onMounted as q, watch as T, nextTick as J, openBlock as h, createElementBlock as Q, createElementVNode as m, createVNode as X, isRef as ee, createSlots as te, withCtx as ae, renderSlot as oe, normalizeStyle as re, createBlock as b, createCommentVNode as H } from "vue";
|
|
2
|
+
import { Chart as O, ArcElement as le, LineElement as ie, BarElement as ne, PointElement as se, LineController as ce, BarController as de, PieController as ue, ScatterController as pe, CategoryScale as fe, LinearScale as he, Filler as me, Tooltip as ve } from "chart.js";
|
|
3
|
+
import { HoverVerticalLine as ye } from "./plugins/HoverVerticalLine.js";
|
|
4
|
+
import { formatValue as I, calcStepSize as Ce } from "./utils/utils.js";
|
|
5
|
+
import { DEFAULT_TICK_COUNT as ge, TOTALS_HELPER_KEY as F, POINT_BORDER_COLOR as Te, TICK_LABEL_COLOR as P, TICK_LABEL_FONT as N, GRID_LINE_COLOR as _, HEADER_HEIGHT as be, COMPACT_HEADER_HEIGHT as ke } from "./consts.js";
|
|
6
|
+
import { ChartType as n } from "./types.js";
|
|
7
|
+
import { useTooltipPosition as xe } from "./composables/useTooltipPosition.js";
|
|
8
|
+
import Se from "./ChartTooltip.vue.js";
|
|
9
|
+
import { hexColorToRgba as Le } from "../../utils/color.js";
|
|
10
|
+
import { useChartValues as Ee } from "./composables/useChartValues.js";
|
|
11
11
|
import Ae from "./ChartHeader.vue.js";
|
|
12
|
-
import { useVModel as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
const
|
|
12
|
+
import { useVModel as Be } from "@vueuse/core";
|
|
13
|
+
import Re from "../emptyState/v4/EmptyStateV4.vue.js";
|
|
14
|
+
import we from "./ChartLoader.vue.js";
|
|
15
|
+
import { DEFAULT_CHART_COLOR as De } from "./colorPalette.js";
|
|
16
|
+
const Ve = {
|
|
17
17
|
key: 0,
|
|
18
18
|
class: "chart-plane"
|
|
19
|
-
}, He = { class: "header-wrapper" }, Oe = { class: "chart" },
|
|
19
|
+
}, He = { class: "header-wrapper" }, Oe = { class: "chart" }, qe = /* @__PURE__ */ Y({
|
|
20
20
|
__name: "ChartPlane",
|
|
21
21
|
props: {
|
|
22
22
|
dataSets: { default: () => [] },
|
|
23
23
|
visibleIds: { default: () => [] },
|
|
24
|
-
chartType: { default:
|
|
24
|
+
chartType: { default: n.Line },
|
|
25
25
|
parsing: { default: void 0 },
|
|
26
26
|
xAxisFormat: { default: "string" },
|
|
27
27
|
yAxisFormat: { default: "number" },
|
|
28
|
-
tickCount: { default:
|
|
28
|
+
tickCount: { default: ge },
|
|
29
29
|
header: { default: "" },
|
|
30
30
|
subheader: { default: "" },
|
|
31
31
|
loading: { type: Boolean, default: !1 },
|
|
@@ -39,15 +39,17 @@ const Ie = {
|
|
|
39
39
|
tooltipRespectsTopEdge: { type: Boolean, default: !0 },
|
|
40
40
|
trendValue: { default: null },
|
|
41
41
|
trendDirection: { default: "up" },
|
|
42
|
-
totalsChart: { type: Boolean, default: !1 }
|
|
42
|
+
totalsChart: { type: Boolean, default: !1 },
|
|
43
|
+
colorsMap: { default: () => ({}) }
|
|
43
44
|
},
|
|
44
45
|
emits: ["update:chartType"],
|
|
45
|
-
setup(o, { emit:
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
})),
|
|
46
|
+
setup(o, { emit: M }) {
|
|
47
|
+
const t = o;
|
|
48
|
+
j((e) => ({
|
|
49
|
+
"0e9a8448": c(Z),
|
|
50
|
+
"5ae0eb9a": o.height
|
|
51
|
+
})), O.register(
|
|
52
|
+
le,
|
|
51
53
|
ie,
|
|
52
54
|
ne,
|
|
53
55
|
se,
|
|
@@ -59,86 +61,85 @@ const Ie = {
|
|
|
59
61
|
he,
|
|
60
62
|
me,
|
|
61
63
|
ve,
|
|
62
|
-
ye
|
|
63
|
-
Ce
|
|
64
|
+
ye
|
|
64
65
|
);
|
|
65
|
-
const
|
|
66
|
-
() =>
|
|
67
|
-
),
|
|
68
|
-
let
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
},
|
|
72
|
-
|
|
66
|
+
const v = Be(t, "chartType", M), z = a(
|
|
67
|
+
() => t.withAnimation ? "" : "none"
|
|
68
|
+
), d = g(null);
|
|
69
|
+
let s = null;
|
|
70
|
+
const k = a(() => t.dataSets.length === 0), x = a(() => !t.loading && !k.value), y = () => {
|
|
71
|
+
d.value && (s && s.destroy(), s = new O(d.value, B.value));
|
|
72
|
+
}, K = () => {
|
|
73
|
+
s && (s.data.datasets = A.value, s.options = B.value.options, s.update(z.value));
|
|
73
74
|
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}),
|
|
77
|
-
const
|
|
78
|
-
() =>
|
|
79
|
-
),
|
|
80
|
-
() =>
|
|
81
|
-
),
|
|
82
|
-
...
|
|
83
|
-
data:
|
|
84
|
-
...
|
|
85
|
-
[
|
|
75
|
+
q(y), T(() => t.chartType, y), T(x, async (e) => {
|
|
76
|
+
e && (await J(), y());
|
|
77
|
+
}), T([() => t.visibleIds, () => t.dataSets], K);
|
|
78
|
+
const u = a(() => t.totalsChart), p = a(
|
|
79
|
+
() => t.chartType === n.StackedLine || t.chartType === n.StackedBar || u.value
|
|
80
|
+
), S = a(
|
|
81
|
+
() => t.chartType === n.Line || t.chartType === n.StackedLine
|
|
82
|
+
), L = a(() => u.value ? { ...t.parsing, xAxisKey: F } : t.parsing), U = a(() => u.value ? t.dataSets.map((e) => ({
|
|
83
|
+
...e,
|
|
84
|
+
data: e.data.map((l) => ({
|
|
85
|
+
...l,
|
|
86
|
+
[F]: e.label
|
|
86
87
|
}))
|
|
87
|
-
})) :
|
|
88
|
-
() =>
|
|
89
|
-
),
|
|
90
|
-
|
|
88
|
+
})) : t.dataSets), f = a(
|
|
89
|
+
() => U.value.filter((e) => t.visibleIds.includes(e.id))
|
|
90
|
+
), $ = (e) => t.colorsMap[e] || De, E = a(
|
|
91
|
+
() => f.value.length && f.value.every(
|
|
92
|
+
(e) => e.data.length === 1
|
|
93
|
+
)
|
|
94
|
+
), A = a(() => f.value.map((e, l) => {
|
|
95
|
+
const i = $(e.id), C = p.value ? l !== 0 ? "-1" : "start" : void 0;
|
|
91
96
|
return {
|
|
92
|
-
...
|
|
93
|
-
fill:
|
|
94
|
-
backgroundColor:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
+
...e,
|
|
98
|
+
fill: C,
|
|
99
|
+
backgroundColor: Le(
|
|
100
|
+
i,
|
|
101
|
+
t.chartType === n.StackedLine ? 10 : 70
|
|
97
102
|
),
|
|
98
|
-
borderColor:
|
|
99
|
-
pointBackgroundColor:
|
|
100
|
-
pointHoverBorderColor:
|
|
103
|
+
borderColor: i,
|
|
104
|
+
pointBackgroundColor: i,
|
|
105
|
+
pointHoverBorderColor: i,
|
|
101
106
|
maxBarThickness: 50,
|
|
102
107
|
clip: 5,
|
|
103
108
|
// draw a bit outside the chart area
|
|
104
|
-
icon:
|
|
105
|
-
iconType:
|
|
109
|
+
icon: e.icon || null,
|
|
110
|
+
iconType: e.iconType || "branded"
|
|
106
111
|
};
|
|
107
112
|
})), B = a(
|
|
108
|
-
() => p.value.length && p.value.every(
|
|
109
|
-
(t) => t.data.length === 1
|
|
110
|
-
)
|
|
111
|
-
), A = a(
|
|
112
113
|
() => ({
|
|
113
|
-
type:
|
|
114
|
+
type: t.chartType == n.Bar || t.chartType === n.StackedBar ? "bar" : "line",
|
|
114
115
|
// Chart Data
|
|
115
116
|
data: {
|
|
116
|
-
datasets:
|
|
117
|
+
datasets: A.value
|
|
117
118
|
},
|
|
118
119
|
// Chart Options
|
|
119
120
|
options: {
|
|
120
|
-
parsing:
|
|
121
|
+
parsing: L.value,
|
|
121
122
|
interaction: {
|
|
122
123
|
intersect: !1,
|
|
123
|
-
mode:
|
|
124
|
+
mode: u.value ? "point" : "index",
|
|
124
125
|
axis: "x"
|
|
125
126
|
},
|
|
126
127
|
// plugins
|
|
127
128
|
plugins: {
|
|
128
129
|
legend: { display: !1 },
|
|
129
130
|
title: { display: !1 },
|
|
130
|
-
hoverVerticalLine:
|
|
131
|
+
hoverVerticalLine: S.value,
|
|
131
132
|
// tooltip
|
|
132
133
|
tooltip: {
|
|
133
134
|
enabled: !1,
|
|
134
135
|
position: "average",
|
|
135
|
-
external: ({ tooltip:
|
|
136
|
-
|
|
136
|
+
external: ({ tooltip: e }) => {
|
|
137
|
+
r.value = { ...e };
|
|
137
138
|
},
|
|
138
139
|
callbacks: {
|
|
139
|
-
footer: (
|
|
140
|
-
const
|
|
141
|
-
return ["Total", String(
|
|
140
|
+
footer: (e) => {
|
|
141
|
+
const l = e.reduce((i, C) => i + (C.parsed.y || 0), 0);
|
|
142
|
+
return ["Total", String(l)];
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
145
|
}
|
|
@@ -160,7 +161,7 @@ const Ie = {
|
|
|
160
161
|
tension: 0.3
|
|
161
162
|
},
|
|
162
163
|
point: {
|
|
163
|
-
radius:
|
|
164
|
+
radius: E.value ? 3 : 1,
|
|
164
165
|
hitRadius: 8,
|
|
165
166
|
borderWidth: 0,
|
|
166
167
|
hoverRadius: 4,
|
|
@@ -175,25 +176,25 @@ const Ie = {
|
|
|
175
176
|
// Horizontal Axis (X)
|
|
176
177
|
x: {
|
|
177
178
|
beginAtZero: !0,
|
|
178
|
-
offset: !
|
|
179
|
+
offset: !S.value || E.value,
|
|
179
180
|
border: { display: !1 },
|
|
180
|
-
stacked:
|
|
181
|
+
stacked: p.value,
|
|
181
182
|
// stack on top of each other
|
|
182
183
|
// ticks
|
|
183
184
|
ticks: {
|
|
184
|
-
color:
|
|
185
|
+
color: P,
|
|
185
186
|
font: N,
|
|
186
187
|
padding: 4,
|
|
187
|
-
callback: function(
|
|
188
|
-
return
|
|
189
|
-
this.getLabelForValue(
|
|
190
|
-
|
|
188
|
+
callback: function(e) {
|
|
189
|
+
return I(
|
|
190
|
+
this.getLabelForValue(e),
|
|
191
|
+
t.xAxisFormat
|
|
191
192
|
);
|
|
192
193
|
}
|
|
193
194
|
},
|
|
194
195
|
// grid lines
|
|
195
196
|
grid: {
|
|
196
|
-
color:
|
|
197
|
+
color: _,
|
|
197
198
|
drawOnChartArea: !1,
|
|
198
199
|
drawTicks: !0,
|
|
199
200
|
drawBorder: !1,
|
|
@@ -205,21 +206,21 @@ const Ie = {
|
|
|
205
206
|
beginAtZero: !0,
|
|
206
207
|
border: { display: !1 },
|
|
207
208
|
// hide left borderline
|
|
208
|
-
stacked:
|
|
209
|
+
stacked: p.value,
|
|
209
210
|
// stack on top of each other
|
|
210
211
|
// ticks
|
|
211
212
|
ticks: {
|
|
212
|
-
color:
|
|
213
|
+
color: P,
|
|
213
214
|
font: N,
|
|
214
215
|
padding: 8,
|
|
215
|
-
stepSize:
|
|
216
|
-
min:
|
|
217
|
-
max:
|
|
218
|
-
callback: (
|
|
216
|
+
stepSize: V.value,
|
|
217
|
+
min: D.value,
|
|
218
|
+
max: V.value * t.tickCount,
|
|
219
|
+
callback: (e) => I(e, t.yAxisFormat)
|
|
219
220
|
},
|
|
220
221
|
// grid lines
|
|
221
222
|
grid: {
|
|
222
|
-
color:
|
|
223
|
+
color: _,
|
|
223
224
|
drawOnChartArea: !0,
|
|
224
225
|
drawTicks: !1
|
|
225
226
|
}
|
|
@@ -227,80 +228,80 @@ const Ie = {
|
|
|
227
228
|
}
|
|
228
229
|
}
|
|
229
230
|
})
|
|
230
|
-
), R =
|
|
231
|
-
|
|
231
|
+
), R = g(null), r = g(null), { position: w } = xe(
|
|
232
|
+
d,
|
|
232
233
|
R,
|
|
233
|
-
|
|
234
|
-
|
|
234
|
+
r,
|
|
235
|
+
t.tooltipRespectsTopEdge
|
|
235
236
|
), G = a(() => ({
|
|
236
237
|
left: `${w.value.left}px`,
|
|
237
238
|
top: `${w.value.top}px`,
|
|
238
|
-
opacity:
|
|
239
|
-
})), { minValue:
|
|
240
|
-
parsingConfig:
|
|
241
|
-
dataSets:
|
|
242
|
-
isStacked:
|
|
243
|
-
}),
|
|
244
|
-
() =>
|
|
239
|
+
opacity: r.value?.opacity || 0
|
|
240
|
+
})), { minValue: D, maxValue: W } = Ee({
|
|
241
|
+
parsingConfig: L.value,
|
|
242
|
+
dataSets: f,
|
|
243
|
+
isStacked: p
|
|
244
|
+
}), V = a(
|
|
245
|
+
() => Ce(D.value, W.value, t.tickCount)
|
|
245
246
|
), Z = a(
|
|
246
|
-
() => (
|
|
247
|
+
() => (t.compactHeader ? ke : be) + "px"
|
|
247
248
|
);
|
|
248
|
-
return (
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
"chart-type":
|
|
252
|
-
"onUpdate:chart-type":
|
|
249
|
+
return (e, l) => c(x) ? (h(), Q("section", Ve, [
|
|
250
|
+
m("div", He, [
|
|
251
|
+
X(Ae, {
|
|
252
|
+
"chart-type": c(v),
|
|
253
|
+
"onUpdate:chart-type": l[0] || (l[0] = (i) => ee(v) ? v.value = i : null),
|
|
253
254
|
"type-switcher": o.typeSwitcher,
|
|
254
255
|
header: o.header,
|
|
255
256
|
subheader: o.subheader,
|
|
256
257
|
compact: o.compactHeader,
|
|
257
258
|
"trend-value": o.trendValue,
|
|
258
259
|
"trend-direction": o.trendDirection
|
|
259
|
-
},
|
|
260
|
-
|
|
260
|
+
}, te({ _: 2 }, [
|
|
261
|
+
e.$slots["subheader-tooltip"] ? {
|
|
261
262
|
name: "subheader-tooltip",
|
|
262
|
-
fn:
|
|
263
|
-
|
|
263
|
+
fn: ae(() => [
|
|
264
|
+
oe(e.$slots, "subheader-tooltip", {}, void 0, !0)
|
|
264
265
|
]),
|
|
265
266
|
key: "0"
|
|
266
267
|
} : void 0
|
|
267
268
|
]), 1032, ["chart-type", "type-switcher", "header", "subheader", "compact", "trend-value", "trend-direction"])
|
|
268
269
|
]),
|
|
269
|
-
|
|
270
|
-
|
|
270
|
+
m("div", Oe, [
|
|
271
|
+
m("canvas", {
|
|
271
272
|
ref_key: "chartRef",
|
|
272
|
-
ref:
|
|
273
|
+
ref: d,
|
|
273
274
|
class: "chart__canvas"
|
|
274
275
|
}, null, 512),
|
|
275
|
-
|
|
276
|
+
m("div", {
|
|
276
277
|
ref_key: "tooltipRef",
|
|
277
278
|
ref: R,
|
|
278
279
|
class: "chart__tooltip",
|
|
279
|
-
style:
|
|
280
|
+
style: re(c(G))
|
|
280
281
|
}, [
|
|
281
|
-
|
|
282
|
+
r.value ? (h(), b(Se, {
|
|
282
283
|
key: 0,
|
|
283
|
-
title: String(
|
|
284
|
-
"data-points":
|
|
284
|
+
title: String(r.value.title),
|
|
285
|
+
"data-points": r.value.dataPoints,
|
|
285
286
|
"x-axis-format": o.xAxisFormat,
|
|
286
287
|
"y-axis-format": o.yAxisFormat,
|
|
287
|
-
"total-label":
|
|
288
|
-
"total-value": Number(
|
|
289
|
-
}, null, 8, ["title", "data-points", "x-axis-format", "y-axis-format", "total-label", "total-value"])) :
|
|
288
|
+
"total-label": r.value.footer[0],
|
|
289
|
+
"total-value": Number(r.value.footer[1])
|
|
290
|
+
}, null, 8, ["title", "data-points", "x-axis-format", "y-axis-format", "total-label", "total-value"])) : H("", !0)
|
|
290
291
|
], 4)
|
|
291
292
|
])
|
|
292
|
-
])) : o.loading ? (
|
|
293
|
+
])) : o.loading ? (h(), b(we, {
|
|
293
294
|
key: 1,
|
|
294
295
|
class: "chart-loading"
|
|
295
|
-
})) :
|
|
296
|
+
})) : c(k) ? (h(), b(c(Re), {
|
|
296
297
|
key: 2,
|
|
297
298
|
class: "chart-empty",
|
|
298
299
|
title: o.noDataTitle,
|
|
299
300
|
subtitle: o.noDataSubtitle,
|
|
300
301
|
"icon-name": o.noDataIcon
|
|
301
|
-
}, null, 8, ["title", "subtitle", "icon-name"])) :
|
|
302
|
+
}, null, 8, ["title", "subtitle", "icon-name"])) : H("", !0);
|
|
302
303
|
}
|
|
303
304
|
});
|
|
304
305
|
export {
|
|
305
|
-
|
|
306
|
+
qe as default
|
|
306
307
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
+
selected: unknown;
|
|
3
|
+
options: unknown[];
|
|
4
|
+
optionNameKey: string;
|
|
5
|
+
}>, {
|
|
6
|
+
options: () => any[];
|
|
7
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
"update:selected": (option: unknown) => void;
|
|
9
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
10
|
+
selected: unknown;
|
|
11
|
+
options: unknown[];
|
|
12
|
+
optionNameKey: string;
|
|
13
|
+
}>, {
|
|
14
|
+
options: () => any[];
|
|
15
|
+
}>>> & {
|
|
16
|
+
"onUpdate:selected"?: (option: unknown) => any;
|
|
17
|
+
}, {
|
|
18
|
+
options: unknown[];
|
|
19
|
+
}>;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
22
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
23
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
24
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
25
|
+
} : {
|
|
26
|
+
type: import('vue').PropType<T[K]>;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
type __VLS_WithDefaults<P, D> = {
|
|
31
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
32
|
+
default: D[K];
|
|
33
|
+
}> : P[K];
|
|
34
|
+
};
|
|
35
|
+
type __VLS_Prettify<T> = {
|
|
36
|
+
[K in keyof T]: T[K];
|
|
37
|
+
} & {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineComponent as l, openBlock as m, createElementBlock as s, createVNode as r, unref as n, isRef as d, withCtx as a, mergeProps as c } from "vue";
|
|
2
|
+
import u from "../dropdown/v4/DropdownV4.vue.js";
|
|
3
|
+
import "../dropdown/v4/DefaultDropdownTrigger.vue.js";
|
|
4
|
+
import f from "../dropdown/v4/IconButtonDropdownTrigger.vue.js";
|
|
5
|
+
import "../dropdown/v4/ChipDropdownTrigger.vue.js";
|
|
6
|
+
import "../dropdown/v4/AppDropdownTrigger.vue.js";
|
|
7
|
+
import "../dropdown/v4/ButtonDropdownTrigger.vue.js";
|
|
8
|
+
import "../dropdown/v4/ButtonFilterDropdownTrigger.vue.js";
|
|
9
|
+
import "../dropdown/v4/TreeDropdown.vue.js";
|
|
10
|
+
import "../dropdown/v4/OptionV4.vue.js";
|
|
11
|
+
import "../dropdown/v4/ConditionalDropdown.vue.js";
|
|
12
|
+
import { useVModel as g } from "@vueuse/core";
|
|
13
|
+
const y = { class: "legend-sorting" }, L = /* @__PURE__ */ l({
|
|
14
|
+
__name: "LegendSorting",
|
|
15
|
+
props: {
|
|
16
|
+
selected: null,
|
|
17
|
+
options: { default: () => [] },
|
|
18
|
+
optionNameKey: null
|
|
19
|
+
},
|
|
20
|
+
emits: ["update:selected"],
|
|
21
|
+
setup(o, { emit: p }) {
|
|
22
|
+
const t = g(o, "selected", p);
|
|
23
|
+
return (v, i) => (m(), s("div", y, [
|
|
24
|
+
r(n(u), {
|
|
25
|
+
selected: n(t),
|
|
26
|
+
"onUpdate:selected": i[0] || (i[0] = (e) => d(t) ? t.value = e : null),
|
|
27
|
+
"display-value": (e) => e[o.optionNameKey],
|
|
28
|
+
options: o.options,
|
|
29
|
+
"option-name-key": o.optionNameKey,
|
|
30
|
+
placement: "bottom-end"
|
|
31
|
+
}, {
|
|
32
|
+
"dropdown-trigger": a(({ buttonTriggerProps: e }) => [
|
|
33
|
+
r(n(f), c(e, {
|
|
34
|
+
"icon-name": "funnel-simple",
|
|
35
|
+
"icon-type": "regular"
|
|
36
|
+
}), null, 16)
|
|
37
|
+
]),
|
|
38
|
+
_: 1
|
|
39
|
+
}, 8, ["selected", "display-value", "options", "option-name-key"])
|
|
40
|
+
]));
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
export {
|
|
44
|
+
L as default
|
|
45
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "./SettingsHeader.vue2.js";
|
|
2
2
|
/* empty css */import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
-
// import "../../SettingsHeader.
|
|
4
|
-
const
|
|
3
|
+
// import "../../SettingsHeader.vue_vue_type_style_index_0_scoped_0875167b_lang.css"; //*');
|
|
4
|
+
const p = /* @__PURE__ */ o(e, [["__scopeId", "data-v-0875167b"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../SettingsHeader.
|
|
1
|
+
import "../../SettingsHeader.vue_vue_type_style_index_0_scoped_0875167b_lang.css"; import { defineComponent as h, computed as g, openBlock as y, createElementBlock as f, createElementVNode as r, normalizeClass as a, createVNode as l, unref as t, isRef as v, withCtx as T, mergeProps as w, renderSlot as p } from "vue";
|
|
2
2
|
import b from "../dropdown/v4/DropdownV4.vue.js";
|
|
3
3
|
import "../dropdown/v4/DefaultDropdownTrigger.vue.js";
|
|
4
4
|
import "../dropdown/v4/IconButtonDropdownTrigger.vue.js";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { BIDDING_PREFIX as F, NETWORK_ID_UNITY_ADS as N, NETWORK_ID_AD_MOB as R, NETWORK_ID_IRON_SOURCE as $, NON_BIDDING_PREFIX as E, NETWORK_ID_MINTEGRAL as B, NETWORK_ID_APPLOVIN as _, NETWORK_ID_FACEBOOK_META as D, NETWORK_ID_LIFTOFF as A, NETWORK_ID_PANGLE as O, NETWORK_ID_INMOBI as I, NETWORK_ID_DT_EXCHANGE as C } from "./consts.js";
|
|
2
|
+
const t = "#c9c9c9", K = [
|
|
3
|
+
"#80BCFE",
|
|
4
|
+
"#9999FF",
|
|
5
|
+
"#5883E4",
|
|
6
|
+
"#80CBC4",
|
|
7
|
+
"#FFC670",
|
|
8
|
+
"#FF7557",
|
|
9
|
+
"#0D7EA0",
|
|
10
|
+
"#673AFF",
|
|
11
|
+
"#CA80DC",
|
|
12
|
+
"#FEBBB2"
|
|
13
|
+
], W = {
|
|
14
|
+
total: "#646464",
|
|
15
|
+
// AB tests
|
|
16
|
+
A: "#FFC134",
|
|
17
|
+
B: "#4F4FF5",
|
|
18
|
+
// Countries
|
|
19
|
+
US: "#272EC4",
|
|
20
|
+
CN: "#F52E1E",
|
|
21
|
+
GB: "#0082FF",
|
|
22
|
+
DE: "#FFD600",
|
|
23
|
+
JP: "#BA0029",
|
|
24
|
+
AU: "#009BCB",
|
|
25
|
+
FR: "#34A853",
|
|
26
|
+
// Ad formats
|
|
27
|
+
Rewarded: "#0082FF",
|
|
28
|
+
Interstitial: "#009BCB",
|
|
29
|
+
Banner: "#9668FF",
|
|
30
|
+
Native: "#FF35A2",
|
|
31
|
+
// Ad sources
|
|
32
|
+
[`${F}-${N}`]: "#9668FF",
|
|
33
|
+
[`${F}-${R}`]: "#34A853",
|
|
34
|
+
[`${F}-${$}`]: "#272EC4",
|
|
35
|
+
[`${E}-${$}`]: "#5C63E7",
|
|
36
|
+
[`${F}-${B}`]: "#00D8B2",
|
|
37
|
+
[`${F}-${_}`]: "#009BCB",
|
|
38
|
+
[`${E}-${_}`]: "#80CDE5",
|
|
39
|
+
[`${F}-${D}`]: "#0082FF",
|
|
40
|
+
[`${E}-${D}`]: "#52AAFF",
|
|
41
|
+
[`${F}-${A}`]: "#FF35A2",
|
|
42
|
+
[`${E}-${A}`]: "#FF9AD1",
|
|
43
|
+
[`${F}-${O}`]: "#F52E1E",
|
|
44
|
+
[`${E}-${O}`]: "#FA9F97",
|
|
45
|
+
[`${F}-${I}`]: "#FFD600",
|
|
46
|
+
[`${E}-${I}`]: "#FFEC8A",
|
|
47
|
+
[`${F}-${C}`]: "#BA0029",
|
|
48
|
+
[`${E}-${C}`]: "#DD8094"
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
K as COLOR_PALETTE,
|
|
52
|
+
t as DEFAULT_CHART_COLOR,
|
|
53
|
+
W as RESERVED_COLORS_MAP
|
|
54
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
import { ChartDataSet } from '
|
|
2
|
+
import { ChartDataSet } from '@/components/chart';
|
|
3
3
|
type UseColorsMapArgs = {
|
|
4
4
|
dataSets: Ref<ChartDataSet[]>;
|
|
5
5
|
visibleIds: Ref<unknown[]>;
|
|
6
6
|
};
|
|
7
7
|
export declare const useColorsMap: ({ dataSets, visibleIds }: UseColorsMapArgs) => {
|
|
8
|
-
colorsMap:
|
|
8
|
+
colorsMap: Ref<Record<string, `#${string}`>>;
|
|
9
9
|
};
|
|
10
10
|
export {};
|
|
@@ -1,17 +1,46 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { COLOR_PALETTE as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
() =>
|
|
6
|
-
(o) =>
|
|
7
|
-
)
|
|
8
|
-
);
|
|
9
|
-
return {
|
|
10
|
-
colorsMap: e(
|
|
11
|
-
() => c.value.reduce((o, r, u) => (o[r.id] = r.color || a[u] || "#000000", o), {})
|
|
1
|
+
import { computed as n, ref as r, watch as E } from "vue";
|
|
2
|
+
import { RESERVED_COLORS_MAP as c, COLOR_PALETTE as O, DEFAULT_CHART_COLOR as R } from "../colorPalette.js";
|
|
3
|
+
const T = ({ dataSets: u, visibleIds: i }) => {
|
|
4
|
+
const a = n(
|
|
5
|
+
() => u.value.filter(
|
|
6
|
+
(o) => i.value.includes(o.id)
|
|
12
7
|
)
|
|
8
|
+
), l = r({
|
|
9
|
+
...c
|
|
10
|
+
// destructuring is important to avoid mutating the reserved colors object
|
|
11
|
+
}), s = r([]), v = n(
|
|
12
|
+
() => O.filter((o) => !s.value.includes(o))
|
|
13
|
+
), d = () => {
|
|
14
|
+
a.value.forEach((o) => {
|
|
15
|
+
const e = String(o.id);
|
|
16
|
+
if (!l.value[e]) {
|
|
17
|
+
const t = o.color || v.value[0] || R;
|
|
18
|
+
C(e, t);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}, f = () => {
|
|
22
|
+
Object.keys(l.value).forEach((o) => {
|
|
23
|
+
const e = a.value.find((m) => String(m.id) === o), t = !!c[o];
|
|
24
|
+
!e && !t && p(o);
|
|
25
|
+
});
|
|
26
|
+
}, C = (o, e) => {
|
|
27
|
+
l.value[String(o)] = e, s.value.push(e);
|
|
28
|
+
}, p = (o) => {
|
|
29
|
+
const e = l.value[o];
|
|
30
|
+
delete l.value[o];
|
|
31
|
+
const t = s.value.indexOf(e);
|
|
32
|
+
t > -1 && s.value.splice(t, 1);
|
|
33
|
+
};
|
|
34
|
+
return E(
|
|
35
|
+
a,
|
|
36
|
+
() => {
|
|
37
|
+
f(), d();
|
|
38
|
+
},
|
|
39
|
+
{ immediate: !0 }
|
|
40
|
+
), {
|
|
41
|
+
colorsMap: l
|
|
13
42
|
};
|
|
14
43
|
};
|
|
15
44
|
export {
|
|
16
|
-
|
|
45
|
+
T as useColorsMap
|
|
17
46
|
};
|