@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.
Files changed (42) hide show
  1. package/Chart.vue_vue_type_style_index_0_scoped_a0b89669_lang.css +1 -0
  2. package/ChartLegend.vue_vue_type_style_index_0_scoped_da487aba_lang.css +1 -0
  3. package/ChartPlane.vue_vue_type_style_index_0_scoped_0f3a67d5_lang.css +1 -0
  4. package/IconButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_99e51ecc_lang.css +1 -0
  5. package/SettingsHeader.vue_vue_type_style_index_0_scoped_0875167b_lang.css +1 -0
  6. package/components/chart/Chart.vue.d.ts +19 -2
  7. package/components/chart/Chart.vue.js +2 -2
  8. package/components/chart/Chart.vue2.js +69 -57
  9. package/components/chart/ChartLegend.vue.d.ts +17 -0
  10. package/components/chart/ChartLegend.vue.js +3 -3
  11. package/components/chart/ChartLegend.vue2.js +78 -67
  12. package/components/chart/ChartPlane.vue.d.ts +7 -2
  13. package/components/chart/ChartPlane.vue.js +2 -2
  14. package/components/chart/ChartPlane.vue2.js +128 -127
  15. package/components/chart/LegendSorting.vue.d.ts +37 -0
  16. package/components/chart/LegendSorting.vue.js +45 -0
  17. package/components/chart/LegendSorting.vue2.js +4 -0
  18. package/components/chart/SettingsHeader.vue.js +3 -3
  19. package/components/chart/SettingsHeader.vue2.js +1 -1
  20. package/components/chart/colorPalette.d.ts +4 -0
  21. package/components/chart/colorPalette.js +54 -0
  22. package/components/chart/composables/useColorsMap.d.ts +2 -2
  23. package/components/chart/composables/useColorsMap.js +41 -12
  24. package/components/chart/consts.d.ts +12 -1
  25. package/components/chart/consts.js +31 -26
  26. package/components/chart/index.d.ts +103 -40
  27. package/components/chart/mockData.d.ts +8 -14
  28. package/components/chart/types.d.ts +2 -1
  29. package/components/dropdown/v4/IconButtonDropdownTrigger.vue.d.ts +11 -0
  30. package/components/dropdown/v4/IconButtonDropdownTrigger.vue.js +4 -4
  31. package/components/dropdown/v4/IconButtonDropdownTrigger.vue2.js +12 -10
  32. package/components/dropdown/v4/index.d.ts +18 -0
  33. package/index.d.ts +37 -1
  34. package/index.js +1 -1
  35. package/package.json +1 -1
  36. package/utils/formatNumbers.d.ts +1 -1
  37. package/utils/formatNumbers.js +14 -14
  38. package/Chart.vue_vue_type_style_index_0_scoped_78d3f5a8_lang.css +0 -1
  39. package/ChartLegend.vue_vue_type_style_index_0_scoped_532f23bc_lang.css +0 -1
  40. package/ChartPlane.vue_vue_type_style_index_0_scoped_4396faf6_lang.css +0 -1
  41. package/IconButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_59fb505a_lang.css +0 -1
  42. package/SettingsHeader.vue_vue_type_style_index_0_scoped_9b6cd9d9_lang.css +0 -1
@@ -1,31 +1,31 @@
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";
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 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 = {
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" }, Je = /* @__PURE__ */ j({
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: i.Line },
24
+ chartType: { default: n.Line },
25
25
  parsing: { default: void 0 },
26
26
  xAxisFormat: { default: "string" },
27
27
  yAxisFormat: { default: "number" },
28
- tickCount: { default: be },
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: z }) {
46
- const e = o;
47
- q((t) => ({
48
- "86c5ce4e": s(Z),
49
- "27543fc4": o.height
50
- })), H.register(
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 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));
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
- 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
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
- })) : 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];
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
- ...t,
93
- fill: u.value ? "start" : void 0,
94
- backgroundColor: Ee(
95
- r,
96
- e.chartType === i.StackedLine ? 10 : 70
97
+ ...e,
98
+ fill: C,
99
+ backgroundColor: Le(
100
+ i,
101
+ t.chartType === n.StackedLine ? 10 : 70
97
102
  ),
98
- borderColor: r,
99
- pointBackgroundColor: r,
100
- pointHoverBorderColor: r,
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: t.icon || null,
105
- iconType: t.iconType || "branded"
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: e.chartType == i.Bar || e.chartType === i.StackedBar ? "bar" : "line",
114
+ type: t.chartType == n.Bar || t.chartType === n.StackedBar ? "bar" : "line",
114
115
  // Chart Data
115
116
  data: {
116
- datasets: E.value
117
+ datasets: A.value
117
118
  },
118
119
  // Chart Options
119
120
  options: {
120
- parsing: S.value,
121
+ parsing: L.value,
121
122
  interaction: {
122
123
  intersect: !1,
123
- mode: d.value ? "point" : "index",
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: x.value,
131
+ hoverVerticalLine: S.value,
131
132
  // tooltip
132
133
  tooltip: {
133
134
  enabled: !1,
134
135
  position: "average",
135
- external: ({ tooltip: t }) => {
136
- l.value = { ...t };
136
+ external: ({ tooltip: e }) => {
137
+ r.value = { ...e };
137
138
  },
138
139
  callbacks: {
139
- footer: (t) => {
140
- const r = t.reduce((y, Y) => y + (Y.parsed.y || 0), 0);
141
- return ["Total", String(r)];
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: B.value ? 3 : 1,
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: !x.value || B.value,
179
+ offset: !S.value || E.value,
179
180
  border: { display: !1 },
180
- stacked: u.value,
181
+ stacked: p.value,
181
182
  // stack on top of each other
182
183
  // ticks
183
184
  ticks: {
184
- color: F,
185
+ color: P,
185
186
  font: N,
186
187
  padding: 4,
187
- callback: function(t) {
188
- return O(
189
- this.getLabelForValue(t),
190
- e.xAxisFormat
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: M,
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: u.value,
209
+ stacked: p.value,
209
210
  // stack on top of each other
210
211
  // ticks
211
212
  ticks: {
212
- color: F,
213
+ color: P,
213
214
  font: N,
214
215
  padding: 8,
215
- stepSize: D.value,
216
- min: V.value,
217
- max: D.value * e.tickCount,
218
- callback: (t) => O(t, e.yAxisFormat)
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: M,
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 = C(null), l = C(null), { position: w } = Se(
231
- c,
231
+ ), R = g(null), r = g(null), { position: w } = xe(
232
+ d,
232
233
  R,
233
- l,
234
- e.tooltipRespectsTopEdge
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: 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)
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
- () => (e.compactHeader ? xe : ke) + "px"
247
+ () => (t.compactHeader ? ke : be) + "px"
247
248
  );
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),
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
- }, ae({ _: 2 }, [
260
- t.$slots["subheader-tooltip"] ? {
260
+ }, te({ _: 2 }, [
261
+ e.$slots["subheader-tooltip"] ? {
261
262
  name: "subheader-tooltip",
262
- fn: oe(() => [
263
- re(t.$slots, "subheader-tooltip", {}, void 0, !0)
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
- h("div", Oe, [
270
- h("canvas", {
270
+ m("div", Oe, [
271
+ m("canvas", {
271
272
  ref_key: "chartRef",
272
- ref: c,
273
+ ref: d,
273
274
  class: "chart__canvas"
274
275
  }, null, 512),
275
- h("div", {
276
+ m("div", {
276
277
  ref_key: "tooltipRef",
277
278
  ref: R,
278
279
  class: "chart__tooltip",
279
- style: le(s(G))
280
+ style: re(c(G))
280
281
  }, [
281
- l.value ? (f(), b(Le, {
282
+ r.value ? (h(), b(Se, {
282
283
  key: 0,
283
- title: String(l.value.title),
284
- "data-points": l.value.dataPoints,
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": 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)
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 ? (f(), b(Ve, {
293
+ ])) : o.loading ? (h(), b(we, {
293
294
  key: 1,
294
295
  class: "chart-loading"
295
- })) : s(T) ? (f(), b(s(we), {
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"])) : I("", !0);
302
+ }, null, 8, ["title", "subtitle", "icon-name"])) : H("", !0);
302
303
  }
303
304
  });
304
305
  export {
305
- Je as default
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
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./LegendSorting.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -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.vue_vue_type_style_index_0_scoped_9b6cd9d9_lang.css"; //*');
4
- const d = /* @__PURE__ */ o(e, [["__scopeId", "data-v-9b6cd9d9"]]);
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
- d as default
6
+ p as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import "../../SettingsHeader.vue_vue_type_style_index_0_scoped_9b6cd9d9_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";
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,4 @@
1
+ import { HexColor } from '@is-ssp/chart/types';
2
+ export declare const DEFAULT_CHART_COLOR: HexColor;
3
+ export declare const COLOR_PALETTE: HexColor[];
4
+ export declare const RESERVED_COLORS_MAP: Record<string, HexColor>;
@@ -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 '@is-ssp/chart';
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: import("vue").ComputedRef<{}>;
8
+ colorsMap: Ref<Record<string, `#${string}`>>;
9
9
  };
10
10
  export {};
@@ -1,17 +1,46 @@
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), {})
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
- n as useColorsMap
45
+ T as useColorsMap
17
46
  };