@ironsource/shared-ui 2.1.12-rc.0 → 2.1.12-rc.10

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