@ironsource/shared-ui 2.1.12-rc.17 → 2.1.12-rc.18

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 (30) hide show
  1. package/Chart.vue_vue_type_style_index_0_scoped_5525b3bc_lang.css +1 -0
  2. package/ChartPlane.vue_vue_type_style_index_0_scoped_fc79a730_lang.css +1 -0
  3. package/ChartTooltip.vue_vue_type_style_index_0_scoped_cb98e9e3_lang.css +1 -0
  4. package/TooltipHeader.vue_vue_type_style_index_0_scoped_3b15c693_lang.css +1 -0
  5. package/components/chart/Chart.vue.d.ts +11 -1
  6. package/components/chart/Chart.vue.js +4 -4
  7. package/components/chart/Chart.vue2.js +32 -28
  8. package/components/chart/ChartPlane.vue.d.ts +11 -1
  9. package/components/chart/ChartPlane.vue.js +2 -2
  10. package/components/chart/ChartPlane.vue2.js +110 -107
  11. package/components/chart/ChartStoryArgs.d.ts +11 -1
  12. package/components/chart/ChartTooltip.vue.d.ts +6 -1
  13. package/components/chart/ChartTooltip.vue.js +3 -3
  14. package/components/chart/ChartTooltip.vue2.js +25 -23
  15. package/components/chart/TooltipHeader.vue.d.ts +6 -1
  16. package/components/chart/TooltipHeader.vue.js +2 -2
  17. package/components/chart/TooltipHeader.vue2.js +37 -27
  18. package/components/chart/consts.d.ts +2 -1
  19. package/components/chart/consts.js +13 -12
  20. package/components/chart/index.d.ts +39 -1
  21. package/components/chart/mockData.d.ts +8 -0
  22. package/components/chart/types.d.ts +5 -0
  23. package/components/chart/types.js +4 -3
  24. package/components/chart/utils/utils.d.ts +1 -1
  25. package/index.js +1 -1
  26. package/package.json +1 -1
  27. package/Chart.vue_vue_type_style_index_0_scoped_82f5b24e_lang.css +0 -1
  28. package/ChartPlane.vue_vue_type_style_index_0_scoped_5c80d8cd_lang.css +0 -1
  29. package/ChartTooltip.vue_vue_type_style_index_0_scoped_9e521454_lang.css +0 -1
  30. package/TooltipHeader.vue_vue_type_style_index_0_scoped_9f6cf389_lang.css +0 -1
@@ -1,28 +1,28 @@
1
- import "../../ChartPlane.vue_vue_type_style_index_0_scoped_5c80d8cd_lang.css"; import { defineComponent as re, useCssVars as ie, unref as s, computed as l, ref as k, onMounted as ne, watch as T, nextTick as se, openBlock as p, createElementBlock as S, createVNode as ce, isRef as de, createSlots as ue, withCtx as pe, renderSlot as fe, createCommentVNode as A, createElementVNode as x, normalizeStyle as he, createBlock as L } from "vue";
2
- import { Chart as F, ArcElement as me, LineElement as ve, BarElement as ye, PointElement as Te, LineController as Ce, BarController as ge, PieController as be, ScatterController as ke, CategoryScale as Se, LinearScale as Ae, Filler as xe, Tooltip as Le } from "chart.js";
1
+ import "../../ChartPlane.vue_vue_type_style_index_0_scoped_fc79a730_lang.css"; import { defineComponent as re, useCssVars as ie, unref as s, computed as l, ref as k, onMounted as ne, watch as T, nextTick as se, openBlock as p, createElementBlock as x, createVNode as ce, isRef as de, createSlots as ue, withCtx as pe, renderSlot as fe, createCommentVNode as A, createElementVNode as S, normalizeStyle as he, createBlock as L } from "vue";
2
+ import { Chart as F, ArcElement as me, LineElement as ve, BarElement as ye, PointElement as Te, LineController as Ce, BarController as ge, PieController as be, ScatterController as ke, CategoryScale as xe, LinearScale as Ae, Filler as Se, Tooltip as Le } from "chart.js";
3
3
  import { HoverVerticalLine as Ee } from "./plugins/HoverVerticalLine.js";
4
- import { prepareTickLabel as Re, formatValue as Be, calcStepSize as Oe } from "./utils/utils.js";
5
- import { DEFAULT_TICK_COUNT as De, TOTALS_HELPER_KEY as _, BASE_COLOR_KEY as K, CHART_PADDING as E, POINT_BORDER_COLOR as He, TICK_LABEL_COLOR as M, TICK_LABEL_FONT as U, TICKS_EXTRA_PADDING as Ve, GRID_LINE_COLOR as z, HEADER_HEIGHT as we, COMPACT_HEADER_HEIGHT as Ie, HOVER_AREA_TRANSPARENCY as Ne, HOVER_TRANSPARENCY as C } from "./consts.js";
6
- import { ChartType as c, TooltipOrder as G, TrendDirection as Pe } from "./types.js";
7
- import { useTooltipPosition as Fe } from "./composables/useTooltipPosition.js";
8
- import _e from "./ChartTooltip.vue.js";
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 _, BASE_COLOR_KEY as K, CHART_PADDING as E, POINT_BORDER_COLOR as Ie, TICK_LABEL_COLOR as M, TICK_LABEL_FONT as U, TICKS_EXTRA_PADDING as He, 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 c, DateInterval as Pe, TooltipOrder as Y, TrendDirection as Fe } from "./types.js";
7
+ import { useTooltipPosition as _e } from "./composables/useTooltipPosition.js";
8
+ import Ke from "./ChartTooltip.vue.js";
9
9
  import { hexColorToRgba as f } from "../../utils/color.js";
10
- import { useChartValues as Ke } from "./composables/useChartValues.js";
11
- import Me from "./ChartHeader.vue.js";
12
- import { useMemoize as Ue, useVModel as ze } from "@vueuse/core";
10
+ import { useChartValues as Me } from "./composables/useChartValues.js";
11
+ import Ue from "./ChartHeader.vue.js";
12
+ import { useMemoize as ze, useVModel as Ye } from "@vueuse/core";
13
13
  import Ge from "../emptyState/v4/EmptyStateV4.vue.js";
14
- import Ye from "./ChartLoader.vue.js";
15
- import { DEFAULT_CHART_COLOR as $e } from "./colorPalette.js";
16
- import { TotalType as Y, calculateTotal as We } from "../../utils/totals.js";
17
- import { isNullOrUndefined as Ze } from "../../utils/utils.js";
18
- import { storeOriginalDatasetColors as Xe, restoreOriginalDatasetColors as je } from "./utils/highlightUtils.js";
19
- const qe = { class: "chart-plane-container" }, Je = {
14
+ import $e from "./ChartLoader.vue.js";
15
+ import { DEFAULT_CHART_COLOR as We } from "./colorPalette.js";
16
+ import { TotalType as G, calculateTotal as Ze } from "../../utils/totals.js";
17
+ import { isNullOrUndefined as Xe } from "../../utils/utils.js";
18
+ import { storeOriginalDatasetColors as je, restoreOriginalDatasetColors as qe } from "./utils/highlightUtils.js";
19
+ const Je = { class: "chart-plane-container" }, Qe = {
20
20
  key: 0,
21
21
  class: "header-wrapper"
22
- }, Qe = {
22
+ }, et = {
23
23
  key: 1,
24
24
  class: "chart-plane"
25
- }, et = { class: "chart" }, Ct = /* @__PURE__ */ re({
25
+ }, tt = { class: "chart" }, gt = /* @__PURE__ */ re({
26
26
  __name: "ChartPlane",
27
27
  props: {
28
28
  dataSets: { default: () => [] },
@@ -32,13 +32,15 @@ const qe = { class: "chart-plane-container" }, Je = {
32
32
  parsing: { default: void 0 },
33
33
  xAxisFormat: { default: "string" },
34
34
  yAxisFormat: { default: "number" },
35
- tickCount: { default: De },
35
+ xAxisDateInterval: { default: Pe.DAILY },
36
+ tickCount: { default: Oe },
36
37
  truncateTickLabels: { type: Boolean, default: !0 },
37
38
  header: { default: "" },
38
39
  subheader: { default: "" },
39
40
  subheaderTooltip: { default: null },
40
41
  keepSubheaderVisible: { type: Boolean, default: !1 },
41
42
  loading: { type: Boolean, default: !1 },
43
+ empty: { type: Boolean, default: !1 },
42
44
  noDataIcon: { default: "file-search" },
43
45
  noDataTitle: { default: "No data to display" },
44
46
  noDataSubtitle: { default: "Search again with different filters" },
@@ -47,23 +49,23 @@ const qe = { class: "chart-plane-container" }, Je = {
47
49
  height: { default: "100%" },
48
50
  compactHeader: { type: Boolean, default: !1 },
49
51
  tooltipRespectsTopEdge: { type: Boolean, default: !0 },
50
- tooltipTotalType: { default: Y.Total },
51
- tooltipTotalCalcFn: { type: Function, default: We },
52
- tooltipOrder: { default: G.Legend },
52
+ tooltipTotalType: { default: G.Total },
53
+ tooltipTotalCalcFn: { type: Function, default: Ze },
54
+ tooltipOrder: { default: Y.Legend },
53
55
  trendValue: { default: null },
54
- trendDirection: { default: Pe.UP },
56
+ trendDirection: { default: Fe.UP },
55
57
  trendTooltip: { default: null },
56
58
  totalsChart: { type: Boolean, default: !1 },
57
59
  colorsMap: { default: () => ({}) }
58
60
  },
59
61
  emits: ["update:chartType"],
60
62
  setup(o, { emit: $ }) {
61
- const t = o;
62
- ie((e) => ({
63
- "1ae03326": s(te),
64
- "42303d50": o.height
63
+ const e = o;
64
+ ie((t) => ({
65
+ "498cf638": s(te),
66
+ b6d23262: o.height
65
67
  }));
66
- const W = Ue(Re);
68
+ const W = ze(Re);
67
69
  F.register(
68
70
  me,
69
71
  ve,
@@ -73,48 +75,48 @@ const qe = { class: "chart-plane-container" }, Je = {
73
75
  ge,
74
76
  be,
75
77
  ke,
76
- Se,
77
- Ae,
78
78
  xe,
79
+ Ae,
80
+ Se,
79
81
  Le,
80
82
  Ee
81
83
  );
82
- const g = ze(t, "chartType", $), Z = l(
83
- () => t.withAnimation ? "" : "none"
84
+ const g = Ye(e, "chartType", $), Z = l(
85
+ () => e.withAnimation ? "" : "none"
84
86
  ), m = k(null);
85
87
  let n = null;
86
- const R = l(() => t.dataSets.length === 0), u = l(() => !t.loading && !R.value), b = () => {
87
- m.value && (n && n.destroy(), n = new F(m.value, V.value));
88
+ const R = l(() => e.empty || e.dataSets.length === 0), u = l(() => !e.loading && !R.value), b = () => {
89
+ m.value && (n && n.destroy(), n = new F(m.value, H.value));
88
90
  }, X = () => {
89
- n && (n.data.datasets = H.value, n.options = V.value.options, n.update(Z.value));
91
+ n && (n.data.datasets = I.value, n.options = H.value.options, n.update(Z.value));
90
92
  };
91
- ne(b), T(() => t.chartType, b), T(u, async (e) => {
92
- e && (await se(), b());
93
- }), T([() => t.visibleIds, () => t.dataSets], X);
94
- const h = l(() => t.totalsChart), v = l(
95
- () => t.chartType === c.StackedLine || t.chartType === c.StackedBar || h.value
93
+ ne(b), T(() => e.chartType, b), T(u, async (t) => {
94
+ t && (await se(), b());
95
+ }), T([() => e.visibleIds, () => e.dataSets], X);
96
+ const h = l(() => e.totalsChart), v = l(
97
+ () => e.chartType === c.StackedLine || e.chartType === c.StackedBar || h.value
96
98
  ), B = l(
97
- () => t.chartType === c.Line || t.chartType === c.StackedLine
98
- ), O = l(() => h.value && !t.parsing.xAxisKey ? { ...t.parsing, xAxisKey: _ } : t.parsing), j = l(() => h.value ? t.dataSets.map((e) => ({
99
- ...e,
100
- data: e.data.map((i) => ({
99
+ () => e.chartType === c.Line || e.chartType === c.StackedLine
100
+ ), D = l(() => h.value && !e.parsing.xAxisKey ? { ...e.parsing, xAxisKey: _ } : e.parsing), j = l(() => h.value ? e.dataSets.map((t) => ({
101
+ ...t,
102
+ data: t.data.map((i) => ({
101
103
  ...i,
102
- [_]: e.label
104
+ [_]: t.label
103
105
  }))
104
- })) : t.dataSets), y = l(
105
- () => j.value.filter((e) => t.visibleIds.includes(e.id))
106
- ), q = (e) => t.colorsMap[e] || $e, D = l(
106
+ })) : e.dataSets), y = l(
107
+ () => j.value.filter((t) => e.visibleIds.includes(t.id))
108
+ ), q = (t) => e.colorsMap[t] || We, O = l(
107
109
  () => y.value.length && y.value.every(
108
- (e) => e.data.length === 1
110
+ (t) => t.data.length === 1
109
111
  )
110
- ), H = l(() => y.value.map((e, i) => {
111
- const a = q(e.id), r = v.value ? i !== 0 ? "-1" : "start" : void 0;
112
+ ), I = l(() => y.value.map((t, i) => {
113
+ const a = q(t.id), r = v.value ? i !== 0 ? "-1" : "start" : void 0;
112
114
  return {
113
- ...e,
115
+ ...t,
114
116
  fill: r,
115
117
  backgroundColor: f(
116
118
  a,
117
- t.chartType === c.StackedLine ? 10 : 70
119
+ e.chartType === c.StackedLine ? 10 : 70
118
120
  ),
119
121
  borderColor: a,
120
122
  pointBackgroundColor: a,
@@ -122,22 +124,22 @@ const qe = { class: "chart-plane-container" }, Je = {
122
124
  maxBarThickness: 50,
123
125
  clip: 5,
124
126
  // draw a bit outside the chart area
125
- icon: e.icon || null,
126
- iconType: e.iconType || "branded",
127
+ icon: t.icon || null,
128
+ iconType: t.iconType || "branded",
127
129
  [K]: a
128
130
  // store base color for later use
129
131
  };
130
132
  })), J = l(
131
- () => t.tooltipTotalType === Y.Total ? "Total" : "Mean"
132
- ), V = l(() => ({
133
- type: t.chartType == c.Bar || t.chartType === c.StackedBar ? "bar" : "line",
133
+ () => e.tooltipTotalType === G.Total ? "Total" : "Mean"
134
+ ), H = l(() => ({
135
+ type: e.chartType == c.Bar || e.chartType === c.StackedBar ? "bar" : "line",
134
136
  // Chart Data
135
137
  data: {
136
- datasets: H.value
138
+ datasets: I.value
137
139
  },
138
140
  // Chart Options
139
141
  options: {
140
- parsing: O.value,
142
+ parsing: D.value,
141
143
  interaction: {
142
144
  intersect: !1,
143
145
  mode: h.value ? "point" : "index",
@@ -152,21 +154,21 @@ const qe = { class: "chart-plane-container" }, Je = {
152
154
  tooltip: {
153
155
  enabled: !1,
154
156
  position: "average",
155
- external: ({ tooltip: e }) => {
156
- d.value = { ...e };
157
+ external: ({ tooltip: t }) => {
158
+ d.value = { ...t };
157
159
  },
158
160
  callbacks: {
159
- footer: (e) => {
160
- const i = e.map((r) => r.parsed.y || 0), a = t.tooltipTotalCalcFn(
161
+ footer: (t) => {
162
+ const i = t.map((r) => r.parsed.y || 0), a = e.tooltipTotalCalcFn(
161
163
  i,
162
- t.tooltipTotalType
164
+ e.tooltipTotalType
163
165
  );
164
166
  return [J.value, String(a)];
165
167
  }
166
168
  },
167
- itemSort: (e, i) => {
168
- if (t.tooltipOrder === G.YAxis) {
169
- const a = e.parsed.y || 0, r = i.parsed.y || 0;
169
+ itemSort: (t, i) => {
170
+ if (e.tooltipOrder === Y.YAxis) {
171
+ const a = t.parsed.y || 0, r = i.parsed.y || 0;
170
172
  return a === r ? 0 : a > r ? -1 : 1;
171
173
  }
172
174
  return 0;
@@ -186,12 +188,12 @@ const qe = { class: "chart-plane-container" }, Je = {
186
188
  tension: 0.3
187
189
  },
188
190
  point: {
189
- radius: D.value ? 3 : 1,
191
+ radius: O.value ? 3 : 1,
190
192
  hitRadius: 8,
191
193
  borderWidth: 0,
192
194
  hoverRadius: 4,
193
195
  hoverBorderWidth: 2,
194
- pointHoverBackgroundColor: He
196
+ pointHoverBackgroundColor: Ie
195
197
  },
196
198
  bar: {
197
199
  borderRadius: 4
@@ -201,7 +203,7 @@ const qe = { class: "chart-plane-container" }, Je = {
201
203
  // Horizontal Axis (X)
202
204
  x: {
203
205
  beginAtZero: !0,
204
- offset: !B.value || D.value,
206
+ offset: !B.value || O.value,
205
207
  border: { display: !1 },
206
208
  stacked: v.value,
207
209
  // stack on top of each other
@@ -210,13 +212,13 @@ const qe = { class: "chart-plane-container" }, Je = {
210
212
  color: M,
211
213
  font: U,
212
214
  padding: 4,
213
- callback: function(e, i, a) {
214
- const r = this.getLabelForValue(e), le = this.chart.width / a.length - (E.left + E.right + Ve);
215
+ callback: function(t, i, a) {
216
+ const r = this.getLabelForValue(t), le = this.chart.width / a.length - (E.left + E.right + He);
215
217
  return W({
216
218
  label: r,
217
- format: t.xAxisFormat,
219
+ format: e.xAxisFormat,
218
220
  availableSpace: le,
219
- truncate: t.truncateTickLabels
221
+ truncate: e.truncateTickLabels
220
222
  });
221
223
  }
222
224
  },
@@ -243,8 +245,8 @@ const qe = { class: "chart-plane-container" }, Je = {
243
245
  padding: 8,
244
246
  stepSize: P.value,
245
247
  min: N.value,
246
- max: P.value * t.tickCount,
247
- callback: (e) => Be(e, t.yAxisFormat)
248
+ max: P.value * e.tickCount,
249
+ callback: (t) => Be(t, e.yAxisFormat)
248
250
  },
249
251
  // grid lines
250
252
  grid: {
@@ -255,45 +257,45 @@ const qe = { class: "chart-plane-container" }, Je = {
255
257
  }
256
258
  }
257
259
  }
258
- })), w = k(null), d = k(null), { position: I } = Fe(
260
+ })), V = k(null), d = k(null), { position: w } = _e(
259
261
  m,
260
- w,
262
+ V,
261
263
  d,
262
- t.tooltipRespectsTopEdge
264
+ e.tooltipRespectsTopEdge
263
265
  ), Q = l(() => ({
264
- left: `${I.value.left}px`,
265
- top: `${I.value.top}px`,
266
+ left: `${w.value.left}px`,
267
+ top: `${w.value.top}px`,
266
268
  opacity: d.value?.opacity || 0
267
- })), { minValue: N, maxValue: ee } = Ke({
268
- parsingConfig: O.value,
269
+ })), { minValue: N, maxValue: ee } = Me({
270
+ parsingConfig: D.value,
269
271
  dataSets: y,
270
272
  isStacked: v
271
273
  }), P = l(
272
- () => Oe(N.value, ee.value, t.tickCount)
274
+ () => De(N.value, ee.value, e.tickCount)
273
275
  ), te = l(
274
- () => (t.compactHeader ? Ie : we) + "px"
276
+ () => (e.compactHeader ? we : Ve) + "px"
275
277
  );
276
278
  T(
277
- () => t.highlightedId,
278
- (e) => {
279
- n && (Ze(e) ? oe() : ae(e), n.update());
279
+ () => e.highlightedId,
280
+ (t) => {
281
+ n && (Xe(t) ? oe() : ae(t), n.update());
280
282
  }
281
283
  );
282
- const ae = (e) => {
284
+ const ae = (t) => {
283
285
  (n?.data.datasets || []).forEach((a) => {
284
- Xe(a);
286
+ je(a);
285
287
  const r = a[K];
286
- a.id === e ? t.chartType === c.StackedLine && (a.backgroundColor = f(
288
+ a.id === t ? e.chartType === c.StackedLine && (a.backgroundColor = f(
287
289
  r,
288
290
  Ne
289
291
  )) : (a.backgroundColor = f(r, C), a.borderColor = f(r, C), a.pointBackgroundColor = f(r, C), a.pointHoverBorderColor = f(r, C));
290
292
  });
291
293
  }, oe = () => {
292
- (n?.data.datasets || []).forEach(je);
294
+ (n?.data.datasets || []).forEach(qe);
293
295
  };
294
- return (e, i) => (p(), S("div", qe, [
295
- s(u) || o.keepSubheaderVisible ? (p(), S("div", Je, [
296
- ce(Me, {
296
+ return (t, i) => (p(), x("div", Je, [
297
+ s(u) || o.keepSubheaderVisible ? (p(), x("div", Qe, [
298
+ ce(Ue, {
297
299
  "chart-type": s(g),
298
300
  "onUpdate:chart-type": i[0] || (i[0] = (a) => de(g) ? g.value = a : null),
299
301
  "type-switcher": s(u) ? o.typeSwitcher : !1,
@@ -305,41 +307,42 @@ const qe = { class: "chart-plane-container" }, Je = {
305
307
  "trend-value": s(u) ? o.trendValue : null,
306
308
  "trend-direction": o.trendDirection
307
309
  }, ue({ _: 2 }, [
308
- e.$slots["subheader-tooltip"] ? {
310
+ t.$slots["subheader-tooltip"] ? {
309
311
  name: "subheader-tooltip",
310
312
  fn: pe(() => [
311
- fe(e.$slots, "subheader-tooltip", {}, void 0, !0)
313
+ fe(t.$slots, "subheader-tooltip", {}, void 0, !0)
312
314
  ]),
313
315
  key: "0"
314
316
  } : void 0
315
317
  ]), 1032, ["chart-type", "type-switcher", "header", "subheader", "subheader-tooltip", "trend-tooltip", "compact", "trend-value", "trend-direction"])
316
318
  ])) : A("", !0),
317
- s(u) ? (p(), S("section", Qe, [
318
- x("div", et, [
319
- x("canvas", {
319
+ s(u) ? (p(), x("section", et, [
320
+ S("div", tt, [
321
+ S("canvas", {
320
322
  ref_key: "chartRef",
321
323
  ref: m,
322
324
  class: "chart__canvas"
323
325
  }, null, 512),
324
- x("div", {
326
+ S("div", {
325
327
  ref_key: "tooltipRef",
326
- ref: w,
328
+ ref: V,
327
329
  class: "chart__tooltip",
328
330
  style: he(s(Q))
329
331
  }, [
330
- d.value ? (p(), L(_e, {
332
+ d.value ? (p(), L(Ke, {
331
333
  key: 0,
332
334
  "totals-chart": s(h),
333
335
  title: String(d.value.title),
334
336
  "data-points": d.value.dataPoints,
335
337
  "x-axis-format": o.xAxisFormat,
336
338
  "y-axis-format": o.yAxisFormat,
339
+ "x-axis-date-interval": o.xAxisDateInterval,
337
340
  "total-label": d.value.footer?.[0],
338
341
  "total-value": Number(d.value.footer?.[1])
339
- }, null, 8, ["totals-chart", "title", "data-points", "x-axis-format", "y-axis-format", "total-label", "total-value"])) : A("", !0)
342
+ }, null, 8, ["totals-chart", "title", "data-points", "x-axis-format", "y-axis-format", "x-axis-date-interval", "total-label", "total-value"])) : A("", !0)
340
343
  ], 4)
341
344
  ])
342
- ])) : o.loading ? (p(), L(Ye, {
345
+ ])) : o.loading ? (p(), L($e, {
343
346
  key: 2,
344
347
  class: "chart-loading"
345
348
  })) : s(R) ? (p(), L(s(Ge), {
@@ -353,5 +356,5 @@ const qe = { class: "chart-plane-container" }, Je = {
353
356
  }
354
357
  });
355
358
  export {
356
- Ct as default
359
+ gt as default
357
360
  };
@@ -1,4 +1,4 @@
1
- import { ChartType, TooltipOrder, TrendDirection } from '@/components/chart/types';
1
+ import { ChartType, DateInterval, TooltipOrder, TrendDirection } from '@/components/chart/types';
2
2
  export declare const chartStoryArgs: {
3
3
  chartType: {
4
4
  control: {
@@ -17,6 +17,10 @@ export declare const chartStoryArgs: {
17
17
  options: string[];
18
18
  description: string;
19
19
  };
20
+ xAxisDateInterval: {
21
+ options: DateInterval[];
22
+ description: string;
23
+ };
20
24
  parsing: {
21
25
  description: string;
22
26
  };
@@ -112,6 +116,12 @@ export declare const chartStoryArgs: {
112
116
  type: string;
113
117
  };
114
118
  };
119
+ empty: {
120
+ description: string;
121
+ control: {
122
+ type: string;
123
+ };
124
+ };
115
125
  withAnimation: {
116
126
  control: {
117
127
  type: string;
@@ -1,9 +1,10 @@
1
- import { MyTooltipItem, ValueFormat } from '@/components/chart/types';
1
+ import { DateInterval, MyTooltipItem, ValueFormat } from '@/components/chart/types';
2
2
  declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
3
3
  title?: string;
4
4
  dataPoints: MyTooltipItem<'line'>[];
5
5
  xAxisFormat?: ValueFormat;
6
6
  yAxisFormat?: ValueFormat;
7
+ xAxisDateInterval?: DateInterval;
7
8
  totalLabel?: string;
8
9
  totalValue?: number;
9
10
  totalsChart?: boolean;
@@ -12,6 +13,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
12
13
  dataPoints: () => any[];
13
14
  xAxisFormat: any;
14
15
  yAxisFormat: any;
16
+ xAxisDateInterval: any;
15
17
  totalLabel: string;
16
18
  totalValue: any;
17
19
  totalsChart: boolean;
@@ -20,6 +22,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
20
22
  dataPoints: MyTooltipItem<'line'>[];
21
23
  xAxisFormat?: ValueFormat;
22
24
  yAxisFormat?: ValueFormat;
25
+ xAxisDateInterval?: DateInterval;
23
26
  totalLabel?: string;
24
27
  totalValue?: number;
25
28
  totalsChart?: boolean;
@@ -28,12 +31,14 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
28
31
  dataPoints: () => any[];
29
32
  xAxisFormat: any;
30
33
  yAxisFormat: any;
34
+ xAxisDateInterval: any;
31
35
  totalLabel: string;
32
36
  totalValue: any;
33
37
  totalsChart: boolean;
34
38
  }>>>, {
35
39
  title: string;
36
40
  xAxisFormat: ValueFormat;
41
+ xAxisDateInterval: DateInterval;
37
42
  dataPoints: MyTooltipItem<'line'>[];
38
43
  totalsChart: boolean;
39
44
  yAxisFormat: ValueFormat;
@@ -1,7 +1,7 @@
1
1
  import o from "./ChartTooltip.vue2.js";
2
- /* empty css */import t from "../../_virtual/_plugin-vue_export-helper.js";
3
- // import "../../ChartTooltip.vue_vue_type_style_index_0_scoped_9e521454_lang.css"; //*');
4
- const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9e521454"]]);
2
+ /* empty css */import e from "../../_virtual/_plugin-vue_export-helper.js";
3
+ // import "../../ChartTooltip.vue_vue_type_style_index_0_scoped_cb98e9e3_lang.css"; //*');
4
+ const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-cb98e9e3"]]);
5
5
  export {
6
6
  s as default
7
7
  };
@@ -1,67 +1,69 @@
1
- import "../../ChartTooltip.vue_vue_type_style_index_0_scoped_9e521454_lang.css"; import { defineComponent as y, openBlock as a, createElementBlock as o, createBlock as u, createCommentVNode as r, Fragment as x, renderList as h, createElementVNode as m, normalizeStyle as p, unref as l, createVNode as s, withCtx as i, createTextVNode as n, toDisplayString as d } from "vue";
2
- import c from "../typography/v4/Typography.vue.js";
1
+ import "../../ChartTooltip.vue_vue_type_style_index_0_scoped_cb98e9e3_lang.css"; import { defineComponent as x, openBlock as a, createElementBlock as o, createBlock as c, createCommentVNode as r, Fragment as y, renderList as h, createElementVNode as m, normalizeStyle as v, unref as l, createVNode as i, withCtx as s, createTextVNode as n, toDisplayString as d } from "vue";
2
+ import u from "../typography/v4/Typography.vue.js";
3
3
  import b from "../icon/v4/IconV4.vue.js";
4
4
  import "../icon/v4/IconFlag.vue.js";
5
5
  import { formatValue as f } from "./utils/utils.js";
6
6
  import k from "./TooltipHeader.vue.js";
7
- const C = { class: "chart-tooltip" }, g = {
7
+ const p = { class: "chart-tooltip" }, C = {
8
8
  key: 1,
9
9
  class: "list"
10
- }, v = { class: "popover-label-wrapper" }, V = {
10
+ }, g = { class: "popover-label-wrapper" }, V = {
11
11
  key: 2,
12
12
  class: "tooltip-footer"
13
- }, z = /* @__PURE__ */ y({
13
+ }, L = /* @__PURE__ */ x({
14
14
  __name: "ChartTooltip",
15
15
  props: {
16
16
  title: { default: "" },
17
17
  dataPoints: { default: () => [] },
18
18
  xAxisFormat: { default: null },
19
19
  yAxisFormat: { default: null },
20
+ xAxisDateInterval: { default: null },
20
21
  totalLabel: { default: "Total" },
21
22
  totalValue: { default: null },
22
23
  totalsChart: { type: Boolean, default: !1 }
23
24
  },
24
25
  setup(t) {
25
- return (F, T) => (a(), o("div", C, [
26
- t.title ? (a(), u(k, {
26
+ return (A, F) => (a(), o("div", p, [
27
+ t.title ? (a(), c(k, {
27
28
  key: 0,
28
29
  title: t.title,
29
30
  "data-points": t.dataPoints,
30
31
  "totals-chart": t.totalsChart,
31
- "x-axis-format": t.xAxisFormat
32
- }, null, 8, ["title", "data-points", "totals-chart", "x-axis-format"])) : r("", !0),
33
- t.totalsChart ? r("", !0) : (a(), o("ul", g, [
34
- (a(!0), o(x, null, h(t.dataPoints, (e) => (a(), o("li", {
32
+ "x-axis-format": t.xAxisFormat,
33
+ "x-axis-date-interval": t.xAxisDateInterval
34
+ }, null, 8, ["title", "data-points", "totals-chart", "x-axis-format", "x-axis-date-interval"])) : r("", !0),
35
+ t.totalsChart ? r("", !0) : (a(), o("ul", C, [
36
+ (a(!0), o(y, null, h(t.dataPoints, (e) => (a(), o("li", {
35
37
  key: e.datasetIndex,
36
38
  class: "list__item"
37
39
  }, [
38
40
  m("span", {
39
41
  class: "color-box",
40
- style: p({
42
+ style: v({
41
43
  backgroundColor: String(e.dataset.pointBackgroundColor)
42
44
  })
43
45
  }, null, 4),
44
- e.dataset.icon ? (a(), u(l(b), {
46
+ e.dataset.icon ? (a(), c(l(b), {
45
47
  key: 0,
46
48
  class: "platform-icon",
47
49
  type: e.dataset.iconType,
48
50
  name: e.dataset.icon,
49
51
  size: "16px"
50
52
  }, null, 8, ["type", "name"])) : r("", !0),
51
- m("div", v, [
52
- s(l(c), {
53
+ m("div", g, [
54
+ i(l(u), {
53
55
  variant: "body2",
54
56
  class: "flex-grow truncated-label",
55
57
  "is-truncated": ""
56
58
  }, {
57
- default: i(() => [
59
+ default: s(() => [
58
60
  n(d(e.dataset.label), 1)
59
61
  ]),
60
62
  _: 2
61
63
  }, 1024)
62
64
  ]),
63
- s(l(c), { variant: "body2" }, {
64
- default: i(() => [
65
+ i(l(u), { variant: "body2" }, {
66
+ default: s(() => [
65
67
  n(d(l(f)(e.parsed.y, t.yAxisFormat)), 1)
66
68
  ]),
67
69
  _: 2
@@ -69,17 +71,17 @@ const C = { class: "chart-tooltip" }, g = {
69
71
  ]))), 128))
70
72
  ])),
71
73
  t.totalValue !== null ? (a(), o("div", V, [
72
- s(l(c), {
74
+ i(l(u), {
73
75
  variant: "body2",
74
76
  class: "flex-grow"
75
77
  }, {
76
- default: i(() => [
78
+ default: s(() => [
77
79
  n(d(t.totalLabel), 1)
78
80
  ]),
79
81
  _: 1
80
82
  }),
81
- s(l(c), { variant: "body2" }, {
82
- default: i(() => [
83
+ i(l(u), { variant: "body2" }, {
84
+ default: s(() => [
83
85
  n(d(l(f)(t.totalValue, t.yAxisFormat)), 1)
84
86
  ]),
85
87
  _: 1
@@ -89,5 +91,5 @@ const C = { class: "chart-tooltip" }, g = {
89
91
  }
90
92
  });
91
93
  export {
92
- z as default
94
+ L as default
93
95
  };
@@ -1,27 +1,32 @@
1
- import { MyTooltipItem, ValueFormat } from '@/components/chart/types';
1
+ import { DateInterval, MyTooltipItem, ValueFormat } from '@/components/chart/types';
2
2
  declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
3
3
  title?: string;
4
4
  xAxisFormat?: ValueFormat;
5
+ xAxisDateInterval?: DateInterval;
5
6
  dataPoints: MyTooltipItem<'line'>[];
6
7
  totalsChart?: boolean;
7
8
  }>, {
8
9
  title: string;
9
10
  xAxisFormat: any;
11
+ xAxisDateInterval: any;
10
12
  dataPoints: () => any[];
11
13
  totalsChart: boolean;
12
14
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
13
15
  title?: string;
14
16
  xAxisFormat?: ValueFormat;
17
+ xAxisDateInterval?: DateInterval;
15
18
  dataPoints: MyTooltipItem<'line'>[];
16
19
  totalsChart?: boolean;
17
20
  }>, {
18
21
  title: string;
19
22
  xAxisFormat: any;
23
+ xAxisDateInterval: any;
20
24
  dataPoints: () => any[];
21
25
  totalsChart: boolean;
22
26
  }>>>, {
23
27
  title: string;
24
28
  xAxisFormat: ValueFormat;
29
+ xAxisDateInterval: DateInterval;
25
30
  dataPoints: MyTooltipItem<'line'>[];
26
31
  totalsChart: boolean;
27
32
  }>;
@@ -1,7 +1,7 @@
1
1
  import o from "./TooltipHeader.vue2.js";
2
2
  /* empty css */import e from "../../_virtual/_plugin-vue_export-helper.js";
3
- // import "../../TooltipHeader.vue_vue_type_style_index_0_scoped_9f6cf389_lang.css"; //*');
4
- const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-9f6cf389"]]);
3
+ // import "../../TooltipHeader.vue_vue_type_style_index_0_scoped_3b15c693_lang.css"; //*');
4
+ const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-3b15c693"]]);
5
5
  export {
6
6
  s as default
7
7
  };