@ironsource/shared-ui 2.1.12-test.78 → 2.1.12-test.79

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.
@@ -0,0 +1 @@
1
+ .chart-plane-container[data-v-c6aaec38]{--headerHeight: var(--1b72bc70);width:100%;height:var(--e61db09a);position:relative}.header-wrapper[data-v-c6aaec38]{position:absolute;width:100%;height:var(--headerHeight);top:0;z-index:1}.chart-plane[data-v-c6aaec38]{padding-top:var(--headerHeight);height:100%}.chart[data-v-c6aaec38]{width:100%;height:100%;position:relative}.chart__canvas[data-v-c6aaec38]{width:100%;height:100%}.chart__tooltip[data-v-c6aaec38]{position:absolute;pointer-events:none;transition:all .1s ease;min-width:214px;max-width:270px;z-index:1}
@@ -1,7 +1,7 @@
1
1
  import e from "./ChartPlane.vue2.js";
2
2
  /* empty css */import o from "../../_virtual/_plugin-vue_export-helper.js";
3
- // import "../../ChartPlane.vue_vue_type_style_index_0_scoped_e31a8fcd_lang.css"; //*');
4
- const s = /* @__PURE__ */ o(e, [["__scopeId", "data-v-e31a8fcd"]]);
3
+ // import "../../ChartPlane.vue_vue_type_style_index_0_scoped_c6aaec38_lang.css"; //*');
4
+ const c = /* @__PURE__ */ o(e, [["__scopeId", "data-v-c6aaec38"]]);
5
5
  export {
6
- s as default
6
+ c as default
7
7
  };
@@ -1,9 +1,9 @@
1
- import "../../ChartPlane.vue_vue_type_style_index_0_scoped_e31a8fcd_lang.css"; import { defineComponent as re, useCssVars as ie, unref as s, computed as l, ref as S, onMounted as ne, watch as T, nextTick as se, openBlock as f, createElementBlock as A, createVNode as ue, isRef as ce, createSlots as de, withCtx as pe, renderSlot as fe, createCommentVNode as L, createElementVNode as E, normalizeStyle as he, createBlock as R } from "vue";
2
- import { Chart as N, ArcElement as me, LineElement as ve, BarElement as ye, PointElement as Te, LineController as Ce, BarController as ge, PieController as be, ScatterController as xe, CategoryScale as ke, LinearScale as Se, Filler as Ae, Tooltip as Le } from "chart.js";
1
+ import "../../ChartPlane.vue_vue_type_style_index_0_scoped_c6aaec38_lang.css"; import { defineComponent as re, useCssVars as ie, unref as s, computed as l, ref as A, onMounted as ne, watch as C, nextTick as se, openBlock as f, createElementBlock as L, createVNode as ue, isRef as ce, createSlots as de, withCtx as pe, renderSlot as fe, createCommentVNode as E, createElementVNode as R, normalizeStyle as he, createBlock as B } from "vue";
2
+ import { Chart as F, ArcElement as ve, LineElement as me, BarElement as ye, PointElement as Te, LineController as Ce, BarController as be, PieController as ge, ScatterController as xe, CategoryScale as ke, LinearScale as Se, Filler as Ae, Tooltip as Le } from "chart.js";
3
3
  import { HoverVerticalLine as Ee } from "./plugins/HoverVerticalLine.js";
4
4
  import { prepareTickLabel as Re, formatValue as Be, calcStepSize as De } from "./utils/utils.js";
5
- import { DEFAULT_TICK_COUNT as Oe, TOTALS_HELPER_KEY as F, BASE_COLOR_KEY as K, CHART_PADDING as Ie, POINT_BORDER_COLOR as He, TICK_LABEL_COLOR as M, TICK_LABEL_FONT as U, TICKS_EXTRA_PADDING as Pe, GRID_LINE_COLOR as z, HEADER_HEIGHT as Ve, COMPACT_HEADER_HEIGHT as we, HOVER_AREA_TRANSPARENCY as Ne, HOVER_TRANSPARENCY as C } from "./consts.js";
6
- import { ChartType as u, DateInterval as Fe, TooltipOrder as Y, TrendDirection as Ke } from "./types.js";
5
+ import { DEFAULT_TICK_COUNT as Oe, TOTALS_HELPER_KEY as K, BASE_COLOR_KEY as M, CHART_PADDING as Ie, POINT_BORDER_COLOR as He, TICK_LABEL_COLOR as U, TICK_LABEL_FONT as z, TICKS_EXTRA_PADDING as Pe, GRID_LINE_COLOR as Y, HEADER_HEIGHT as Ve, COMPACT_HEADER_HEIGHT as Ne, HOVER_AREA_TRANSPARENCY as we, HOVER_TRANSPARENCY as b } from "./consts.js";
6
+ import { ChartType as u, DateInterval as Fe, TooltipOrder as _, TrendDirection as Ke } from "./types.js";
7
7
  import { useTooltipPosition as Me } from "./composables/useTooltipPosition.js";
8
8
  import Ue from "./ChartTooltip.vue.js";
9
9
  import { hexColorToRgba as h } from "../../utils/color.js";
@@ -13,7 +13,7 @@ import { useMemoize as _e, useVModel as Ge } from "@vueuse/core";
13
13
  import $e from "../emptyState/v4/EmptyStateV4.vue.js";
14
14
  import We from "./ChartLoader.vue.js";
15
15
  import { DEFAULT_CHART_COLOR as Ze } from "./colorPalette.js";
16
- import { TotalType as _, calculateTotal as Xe } from "../../utils/totals.js";
16
+ import { TotalType as G, calculateTotal as Xe } from "../../utils/totals.js";
17
17
  import { isNullOrUndefined as je } from "../../utils/utils.js";
18
18
  import { storeOriginalDatasetColors as qe, restoreOriginalDatasetColors as Je } from "./utils/highlightUtils.js";
19
19
  const Qe = { class: "chart-plane-container" }, et = {
@@ -22,7 +22,7 @@ const Qe = { class: "chart-plane-container" }, et = {
22
22
  }, tt = {
23
23
  key: 1,
24
24
  class: "chart-plane"
25
- }, at = { class: "chart" }, bt = /* @__PURE__ */ re({
25
+ }, at = { class: "chart" }, gt = /* @__PURE__ */ re({
26
26
  __name: "ChartPlane",
27
27
  props: {
28
28
  dataSets: { default: () => [] },
@@ -49,9 +49,9 @@ const Qe = { class: "chart-plane-container" }, et = {
49
49
  height: { default: "100%" },
50
50
  compactHeader: { type: Boolean, default: !1 },
51
51
  tooltipRespectsTopEdge: { type: Boolean, default: !0 },
52
- tooltipTotalType: { default: _.Total },
52
+ tooltipTotalType: { default: G.Total },
53
53
  tooltipTotalCalcFn: { type: Function, default: Xe },
54
- tooltipOrder: { default: Y.Legend },
54
+ tooltipOrder: { default: _.Legend },
55
55
  trendValue: { default: null },
56
56
  trendDirection: { default: Ke.UP },
57
57
  trendTooltip: { default: null },
@@ -61,21 +61,21 @@ const Qe = { class: "chart-plane-container" }, et = {
61
61
  valuePrefix: { default: "" }
62
62
  },
63
63
  emits: ["update:chartType"],
64
- setup(o, { emit: G }) {
64
+ setup(o, { emit: $ }) {
65
65
  const e = o;
66
66
  ie((t) => ({
67
- e6d08782: s(ee),
68
- "7183a92a": o.height
67
+ "1b72bc70": s(ee),
68
+ e61db09a: o.height
69
69
  }));
70
- const $ = _e(Re);
71
- N.register(
72
- me,
70
+ const W = _e(Re);
71
+ F.register(
73
72
  ve,
73
+ me,
74
74
  ye,
75
75
  Te,
76
76
  Ce,
77
- ge,
78
77
  be,
78
+ ge,
79
79
  xe,
80
80
  ke,
81
81
  Se,
@@ -83,44 +83,45 @@ const Qe = { class: "chart-plane-container" }, et = {
83
83
  Le,
84
84
  Ee
85
85
  );
86
- const g = Ge(e, "chartType", G), W = l(
86
+ const g = Ge(e, "chartType", $), Z = l(
87
87
  () => e.withAnimation ? "" : "none"
88
- ), m = S(null);
88
+ ), v = A(null);
89
89
  let n = null;
90
- const B = l(() => e.empty || e.dataSets.length === 0), d = l(() => !e.loading && !B.value), b = () => {
91
- m.value && (n && n.destroy(), n = new N(m.value, H.value));
92
- }, Z = () => {
93
- n && (n.data.datasets = I.value, n.options = H.value.options, n.update(W.value));
90
+ const D = l(() => e.empty || e.dataSets.length === 0), d = l(() => !e.loading && !D.value), x = () => {
91
+ v.value && (n && n.destroy(), n = new F(v.value, P.value));
92
+ }, X = () => {
93
+ n && (n.data.datasets = H.value, n.options = P.value.options, n.update(Z.value));
94
94
  };
95
- ne(b), T(() => e.chartType, b), T(d, async (t) => {
96
- t && (await se(), b());
97
- }), T(
95
+ ne(x), C(() => e.chartType, x), C(d, async (t) => {
96
+ t && (await se(), x());
97
+ }), C(
98
98
  [
99
99
  () => e.visibleIds,
100
100
  () => e.dataSets,
101
101
  () => e.valuePrefix,
102
- () => e.valueSuffix
102
+ () => e.valueSuffix,
103
+ () => T.value
103
104
  ],
104
- Z
105
+ X
105
106
  );
106
- const p = l(() => e.totalsChart), v = l(
107
+ const p = l(() => e.totalsChart), m = l(
107
108
  () => e.chartType === u.StackedLine || e.chartType === u.StackedBar || p.value
108
- ), x = l(
109
+ ), k = l(
109
110
  () => e.chartType === u.Line || e.chartType === u.StackedLine
110
- ), D = l(() => p.value && !e.parsing.xAxisKey ? { ...e.parsing, xAxisKey: F } : e.parsing), X = l(() => p.value ? e.dataSets.map((t) => ({
111
+ ), O = l(() => p.value && !e.parsing.xAxisKey ? { ...e.parsing, xAxisKey: K } : e.parsing), j = l(() => p.value ? e.dataSets.map((t) => ({
111
112
  ...t,
112
113
  data: t.data.map((i) => ({
113
114
  ...i,
114
- [F]: t.label
115
+ [K]: t.label
115
116
  }))
116
117
  })) : e.dataSets), y = l(
117
- () => X.value.filter((t) => e.visibleIds.includes(t.id))
118
- ), j = (t) => e.colorsMap[t] || Ze, O = l(
118
+ () => j.value.filter((t) => e.visibleIds.includes(t.id))
119
+ ), q = (t) => e.colorsMap[t] || Ze, I = l(
119
120
  () => y.value.length && y.value.every(
120
121
  (t) => t.data.length === 1
121
122
  )
122
- ), I = l(() => y.value.map((t, i) => {
123
- const a = j(t.id), r = v.value ? i !== 0 ? "-1" : "start" : void 0;
123
+ ), H = l(() => y.value.map((t, i) => {
124
+ const a = q(t.id), r = m.value ? i !== 0 ? "-1" : "start" : void 0;
124
125
  return {
125
126
  ...t,
126
127
  fill: r,
@@ -136,20 +137,20 @@ const Qe = { class: "chart-plane-container" }, et = {
136
137
  // draw a bit outside the chart area
137
138
  icon: t.icon || null,
138
139
  iconType: t.iconType || "branded",
139
- [K]: a
140
+ [M]: a
140
141
  // store base color for later use
141
142
  };
142
- })), q = l(
143
- () => e.tooltipTotalType === _.Total ? "Total" : "Mean"
144
- ), H = l(() => ({
143
+ })), J = l(
144
+ () => e.tooltipTotalType === G.Total ? "Total" : "Mean"
145
+ ), P = l(() => ({
145
146
  type: e.chartType == u.Bar || e.chartType === u.StackedBar ? "bar" : "line",
146
147
  // Chart Data
147
148
  data: {
148
- datasets: I.value
149
+ datasets: H.value
149
150
  },
150
151
  // Chart Options
151
152
  options: {
152
- parsing: D.value,
153
+ parsing: O.value,
153
154
  interaction: {
154
155
  intersect: !1,
155
156
  mode: p.value ? "point" : "index",
@@ -159,7 +160,7 @@ const Qe = { class: "chart-plane-container" }, et = {
159
160
  plugins: {
160
161
  legend: { display: !1 },
161
162
  title: { display: !1 },
162
- hoverVerticalLine: x.value,
163
+ hoverVerticalLine: k.value,
163
164
  // tooltip
164
165
  tooltip: {
165
166
  enabled: !1,
@@ -173,11 +174,11 @@ const Qe = { class: "chart-plane-container" }, et = {
173
174
  i,
174
175
  e.tooltipTotalType
175
176
  );
176
- return [q.value, String(a)];
177
+ return [J.value, String(a)];
177
178
  }
178
179
  },
179
180
  itemSort: (t, i) => {
180
- if (e.tooltipOrder === Y.YAxis) {
181
+ if (e.tooltipOrder === _.YAxis) {
181
182
  const a = t.parsed.y || 0, r = i.parsed.y || 0;
182
183
  return a === r ? 0 : a > r ? -1 : 1;
183
184
  }
@@ -198,7 +199,7 @@ const Qe = { class: "chart-plane-container" }, et = {
198
199
  tension: 0.3
199
200
  },
200
201
  point: {
201
- radius: O.value ? 3 : 1,
202
+ radius: I.value ? 3 : 1,
202
203
  hitRadius: 8,
203
204
  borderWidth: 0,
204
205
  hoverRadius: 4,
@@ -213,21 +214,21 @@ const Qe = { class: "chart-plane-container" }, et = {
213
214
  // Horizontal Axis (X)
214
215
  x: {
215
216
  beginAtZero: !0,
216
- offset: !x.value || O.value,
217
+ offset: !k.value || I.value,
217
218
  border: { display: !1 },
218
- stacked: v.value,
219
+ stacked: m.value,
219
220
  // stack on top of each other
220
221
  // ticks
221
222
  ticks: {
222
- color: M,
223
- font: U,
223
+ color: U,
224
+ font: z,
224
225
  padding: 4,
225
226
  maxRotation: 0,
226
227
  autoSkip: !e.truncateTickLabels,
227
228
  autoSkipPadding: 8,
228
229
  callback: function(t, i, a) {
229
- const r = this.getLabelForValue(t), oe = x.value && !p.value ? a.length - 1 : a.length, le = this.chart.scales?.x?.width / oe - Pe;
230
- return $({
230
+ const r = this.getLabelForValue(t), oe = k.value && !p.value ? a.length - 1 : a.length, le = this.chart.scales?.x?.width / oe - Pe;
231
+ return W({
231
232
  label: r,
232
233
  format: e.xAxisFormat,
233
234
  availableSpace: le,
@@ -237,7 +238,7 @@ const Qe = { class: "chart-plane-container" }, et = {
237
238
  },
238
239
  // grid lines
239
240
  grid: {
240
- color: z,
241
+ color: Y,
241
242
  drawOnChartArea: !1,
242
243
  drawTicks: !0,
243
244
  drawBorder: !1,
@@ -249,46 +250,50 @@ const Qe = { class: "chart-plane-container" }, et = {
249
250
  beginAtZero: !0,
250
251
  border: { display: !1 },
251
252
  // hide left borderline
252
- stacked: v.value,
253
+ stacked: m.value,
253
254
  // stack on top of each other
254
255
  // ticks
255
256
  ticks: {
256
- color: M,
257
- font: U,
257
+ color: U,
258
+ font: z,
258
259
  padding: 8,
259
- stepSize: k.value,
260
- min: w.value,
261
- max: k.value * e.tickCount,
262
- callback: (t) => e.valuePrefix + Be(t, e.yAxisFormat, k.value < 1) + e.valueSuffix
260
+ stepSize: T.value,
261
+ min: S.value,
262
+ max: T.value * e.tickCount,
263
+ callback: (t) => e.valuePrefix + Be(t, e.yAxisFormat, T.value < 1) + e.valueSuffix
263
264
  },
264
265
  // grid lines
265
266
  grid: {
266
- color: z,
267
+ color: Y,
267
268
  drawOnChartArea: !0,
268
269
  drawTicks: !1
269
270
  }
270
271
  }
271
272
  }
272
273
  }
273
- })), P = S(null), c = S(null), { position: V } = Me(
274
- m,
275
- P,
274
+ })), V = A(null), c = A(null), { position: N } = Me(
275
+ v,
276
+ V,
276
277
  c,
277
278
  e.tooltipRespectsTopEdge
278
- ), J = l(() => ({
279
- left: `${V.value.left}px`,
280
- top: `${V.value.top}px`,
279
+ ), Q = l(() => ({
280
+ left: `${N.value.left}px`,
281
+ top: `${N.value.top}px`,
281
282
  opacity: c.value?.opacity || 0
282
- })), { minValue: w, maxValue: Q } = ze({
283
- parsingConfig: D.value,
283
+ })), { minValue: S, maxValue: w } = ze({
284
+ parsingConfig: O.value,
284
285
  dataSets: y,
285
- isStacked: v
286
- }), k = l(
287
- () => De(w.value, Q.value, e.tickCount)
286
+ isStacked: m
287
+ }), T = l(
288
+ () => De(
289
+ isNaN(S.value) ? 0 : S.value,
290
+ isNaN(w.value) ? 0 : w.value,
291
+ e.tickCount
292
+ )
288
293
  ), ee = l(
289
- () => (e.compactHeader ? we : Ve) + "px"
294
+ () => (e.compactHeader ? Ne : Ve) + "px"
290
295
  );
291
- T(
296
+ C(
292
297
  () => e.highlightedId,
293
298
  (t) => {
294
299
  n && (je(t) ? ae() : te(t), n.update());
@@ -297,17 +302,17 @@ const Qe = { class: "chart-plane-container" }, et = {
297
302
  const te = (t) => {
298
303
  (n?.data.datasets || []).forEach((a) => {
299
304
  qe(a);
300
- const r = a[K];
305
+ const r = a[M];
301
306
  a.id === t ? e.chartType === u.StackedLine && (a.backgroundColor = h(
302
307
  r,
303
- Ne
304
- )) : (a.backgroundColor = h(r, C), a.borderColor = h(r, C), a.pointBackgroundColor = h(r, C), a.pointHoverBorderColor = h(r, C));
308
+ we
309
+ )) : (a.backgroundColor = h(r, b), a.borderColor = h(r, b), a.pointBackgroundColor = h(r, b), a.pointHoverBorderColor = h(r, b));
305
310
  });
306
311
  }, ae = () => {
307
312
  (n?.data.datasets || []).forEach(Je);
308
313
  };
309
- return (t, i) => (f(), A("div", Qe, [
310
- s(d) || o.keepSubheaderVisible ? (f(), A("div", et, [
314
+ return (t, i) => (f(), L("div", Qe, [
315
+ s(d) || o.keepSubheaderVisible ? (f(), L("div", et, [
311
316
  ue(Ye, {
312
317
  "chart-type": s(g),
313
318
  "onUpdate:chart-type": i[0] || (i[0] = (a) => ce(g) ? g.value = a : null),
@@ -328,21 +333,21 @@ const Qe = { class: "chart-plane-container" }, et = {
328
333
  key: "0"
329
334
  } : void 0
330
335
  ]), 1032, ["chart-type", "type-switcher", "header", "subheader", "subheader-tooltip", "trend-tooltip", "compact", "trend-value", "trend-direction"])
331
- ])) : L("", !0),
332
- s(d) ? (f(), A("section", tt, [
333
- E("div", at, [
334
- E("canvas", {
336
+ ])) : E("", !0),
337
+ s(d) ? (f(), L("section", tt, [
338
+ R("div", at, [
339
+ R("canvas", {
335
340
  ref_key: "chartRef",
336
- ref: m,
341
+ ref: v,
337
342
  class: "chart__canvas"
338
343
  }, null, 512),
339
- E("div", {
344
+ R("div", {
340
345
  ref_key: "tooltipRef",
341
- ref: P,
346
+ ref: V,
342
347
  class: "chart__tooltip",
343
- style: he(s(J))
348
+ style: he(s(Q))
344
349
  }, [
345
- c.value ? (f(), R(Ue, {
350
+ c.value ? (f(), B(Ue, {
346
351
  key: 0,
347
352
  "totals-chart": s(p),
348
353
  title: String(c.value.title),
@@ -354,23 +359,23 @@ const Qe = { class: "chart-plane-container" }, et = {
354
359
  "total-value": Number(c.value.footer?.[1]),
355
360
  "value-suffix": o.valueSuffix,
356
361
  "value-prefix": o.valuePrefix
357
- }, null, 8, ["totals-chart", "title", "data-points", "x-axis-format", "y-axis-format", "x-axis-date-interval", "total-label", "total-value", "value-suffix", "value-prefix"])) : L("", !0)
362
+ }, null, 8, ["totals-chart", "title", "data-points", "x-axis-format", "y-axis-format", "x-axis-date-interval", "total-label", "total-value", "value-suffix", "value-prefix"])) : E("", !0)
358
363
  ], 4)
359
364
  ])
360
- ])) : o.loading ? (f(), R(We, {
365
+ ])) : o.loading ? (f(), B(We, {
361
366
  key: 2,
362
367
  class: "chart-loading"
363
- })) : s(B) ? (f(), R(s($e), {
368
+ })) : s(D) ? (f(), B(s($e), {
364
369
  key: 3,
365
370
  class: "chart-empty",
366
371
  variant: null,
367
372
  title: o.noDataTitle,
368
373
  subtitle: o.noDataSubtitle,
369
374
  "icon-name": o.noDataIcon
370
- }, null, 8, ["title", "subtitle", "icon-name"])) : L("", !0)
375
+ }, null, 8, ["title", "subtitle", "icon-name"])) : E("", !0)
371
376
  ]));
372
377
  }
373
378
  });
374
379
  export {
375
- bt as default
380
+ gt as default
376
381
  };
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import './AppTrigger.vue_vue_type_style_index_0_scoped_121aac8b_lang.css';
1
+ import './MenuItem.vue_vue_type_style_index_0_scoped_67e53b85_lang.css';
2
2
  import { AppTriggerTypes as eo } from "./components/appTrigger/index.js";
3
3
  import { AutocompleteDropdownTypes as mo } from "./components/autocompleteDropdown/index.js";
4
4
  import { MenuItemTypes as ao } from "./components/menuItem/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ironsource/shared-ui",
3
- "version": "2.1.12-test.78",
3
+ "version": "2.1.12-test.79",
4
4
  "engines": {
5
5
  "npm": ">=7.0.0",
6
6
  "node": ">=16.0.0"
@@ -1 +0,0 @@
1
- .chart-plane-container[data-v-e31a8fcd]{--headerHeight: var(--e6d08782);width:100%;height:var(--7183a92a);position:relative}.header-wrapper[data-v-e31a8fcd]{position:absolute;width:100%;height:var(--headerHeight);top:0;z-index:1}.chart-plane[data-v-e31a8fcd]{padding-top:var(--headerHeight);height:100%}.chart[data-v-e31a8fcd]{width:100%;height:100%;position:relative}.chart__canvas[data-v-e31a8fcd]{width:100%;height:100%}.chart__tooltip[data-v-e31a8fcd]{position:absolute;pointer-events:none;transition:all .1s ease;min-width:214px;max-width:270px;z-index:1}