@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.
- package/ButtonFilterDropdownTrigger.vue_vue_type_style_index_0_scoped_0198fee8_lang.css +1 -0
- package/Chart.vue_vue_type_style_index_0_scoped_78d3f5a8_lang.css +1 -0
- package/ChartHeader.vue_vue_type_style_index_0_scoped_32001725_lang.css +1 -0
- package/ChartHeaderTrend.vue_vue_type_style_index_0_scoped_e4c673e7_lang.css +1 -0
- package/ChartLegend.vue_vue_type_style_index_0_scoped_532f23bc_lang.css +1 -0
- package/ChartPlane.vue_vue_type_style_index_0_scoped_4396faf6_lang.css +1 -0
- package/ChartTooltip.vue_vue_type_style_index_0_scoped_25d0e129_lang.css +1 -0
- package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_8d5521da_lang.css +1 -0
- package/DataGrid.vue_vue_type_style_index_0_scoped_86ea5d2a_lang.css +1 -0
- package/DateRangeV4.vue_vue_type_style_index_0_scoped_a849128a_lang.css +1 -0
- package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_64ae80dd_lang.css +1 -0
- package/DropdownV4.vue_vue_type_style_index_0_scoped_d154c5da_lang.css +1 -0
- package/DropdownV4.vue_vue_type_style_index_1_lang.css +1 -1
- package/TreeDropdown.vue_vue_type_style_index_0_scoped_4ba9e4bd_lang.css +1 -0
- package/components/chart/Chart.vue.d.ts +57 -39
- package/components/chart/Chart.vue.js +3 -3
- package/components/chart/Chart.vue2.js +98 -297
- package/components/chart/ChartHeader.vue.d.ts +20 -10
- package/components/chart/ChartHeader.vue.js +2 -2
- package/components/chart/ChartHeader.vue2.js +74 -52
- package/components/chart/ChartHeaderTrend.vue.d.ts +34 -0
- package/components/chart/ChartHeaderTrend.vue.js +7 -0
- package/components/chart/ChartHeaderTrend.vue2.js +32 -0
- package/components/chart/ChartLegend.vue.js +2 -2
- package/components/chart/ChartLegend.vue2.js +36 -35
- package/components/chart/ChartPlane.vue.d.ts +143 -0
- package/components/chart/ChartPlane.vue.js +7 -0
- package/components/chart/ChartPlane.vue2.js +306 -0
- package/components/chart/ChartStoryArgs.d.ts +135 -0
- package/components/chart/ChartTooltip.vue.js +2 -2
- package/components/chart/ChartTooltip.vue2.js +36 -35
- package/components/chart/composables/useChartHeight.d.ts +5 -0
- package/components/chart/composables/useChartHeight.js +22 -0
- package/components/chart/composables/useColorsMap.d.ts +10 -0
- package/components/chart/composables/useColorsMap.js +17 -0
- package/components/chart/composables/useTooltipPosition.d.ts +1 -1
- package/components/chart/composables/useTooltipPosition.js +11 -15
- package/components/chart/consts.d.ts +5 -0
- package/components/chart/consts.js +20 -15
- package/components/chart/index.d.ts +189 -113
- package/components/chart/mockData.d.ts +27 -1
- package/components/chart/types.d.ts +4 -0
- package/components/chart/utils/formatNumber.d.ts +0 -1
- package/components/chart/utils/utils.js +5 -5
- package/components/dateRange/v4/DateRangeV4.vue.js +2 -2
- package/components/dateRange/v4/DateRangeV4.vue2.js +1 -1
- package/components/dropdown/common/Dropdown.common.js +208 -200
- package/components/dropdown/common/useGroupedOptions.d.ts +1 -0
- package/components/dropdown/common/useGroupedOptions.js +40 -39
- package/components/dropdown/v4/ButtonFilterDropdownTrigger.vue.js +3 -3
- package/components/dropdown/v4/ButtonFilterDropdownTrigger.vue2.js +10 -7
- package/components/dropdown/v4/ConditionalDropdown.vue.js +4 -4
- package/components/dropdown/v4/ConditionalDropdown.vue2.js +80 -80
- package/components/dropdown/v4/DefaultDropdownTrigger.vue.js +3 -3
- package/components/dropdown/v4/DefaultDropdownTrigger.vue2.js +3 -3
- package/components/dropdown/v4/DropdownV4.vue.d.ts +5 -0
- package/components/dropdown/v4/DropdownV4.vue.js +3 -3
- package/components/dropdown/v4/DropdownV4.vue2.js +97 -86
- package/components/dropdown/v4/TreeDropdown.vue.js +2 -2
- package/components/dropdown/v4/TreeDropdown.vue2.js +68 -73
- package/components/dropdown/v4/dropdownStoryArgs.d.ts +30 -0
- package/components/dropdown/v4/index.d.ts +20 -1
- package/components/emptyState/v4/EmptyStateV4.vue.d.ts +3 -3
- package/components/emptyState/v4/index.d.ts +7 -7
- package/components/table/v4/DataGrid.vue.d.ts +4 -3
- package/components/table/v4/DataGrid.vue.js +3 -3
- package/components/table/v4/DataGrid.vue2.js +152 -142
- package/components/table/v4/MultipleDataGrid.vue.d.ts +3 -3
- package/components/table/v4/index.d.ts +15 -14
- package/composables/useFullPageHeight.d.ts +10 -0
- package/composables/useFullPageHeight.js +15 -0
- package/index.d.ts +88 -44
- package/index.js +102 -100
- package/package.json +1 -1
- package/testids/index.d.ts +2 -1
- package/testids/index.js +10 -10
- package/utils/formatNumbers.d.ts +1 -1
- package/utils/formatNumbers.js +18 -5
- package/utils/index.js +7 -0
- package/ButtonFilterDropdownTrigger.vue_vue_type_style_index_0_scoped_1aa6df01_lang.css +0 -1
- package/Chart.vue_vue_type_style_index_0_scoped_026d82c5_lang.css +0 -1
- package/ChartHeader.vue_vue_type_style_index_0_scoped_b8213498_lang.css +0 -1
- package/ChartLegend.vue_vue_type_style_index_0_scoped_4fe1c7d1_lang.css +0 -1
- package/ChartTooltip.vue_vue_type_style_index_0_scoped_6744325c_lang.css +0 -1
- package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_8e026669_lang.css +0 -1
- package/DataGrid.vue_vue_type_style_index_0_scoped_26488faf_lang.css +0 -1
- package/DateRangeV4.vue_vue_type_style_index_0_scoped_8a2714eb_lang.css +0 -1
- package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_73bf9b5b_lang.css +0 -1
- package/DropdownV4.vue_vue_type_style_index_0_scoped_75002075_lang.css +0 -1
- package/TreeDropdown.vue_vue_type_style_index_0_scoped_b883d1fa_lang.css +0 -1
- package/components/chart/utils/formatNumber.js +0 -11
|
@@ -1,324 +1,125 @@
|
|
|
1
|
-
import "../../Chart.
|
|
2
|
-
import { useVModel as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
|
|
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
|
-
},
|
|
13
|
+
}, ee = /* @__PURE__ */ V({
|
|
21
14
|
__name: "Chart",
|
|
22
15
|
props: {
|
|
23
16
|
dataSets: { default: () => [] },
|
|
24
17
|
visibleIds: { default: () => [] },
|
|
25
|
-
chartType: { default:
|
|
18
|
+
chartType: { default: O.Line },
|
|
26
19
|
parsing: { default: void 0 },
|
|
27
20
|
xAxisFormat: { default: "string" },
|
|
28
21
|
yAxisFormat: { default: "number" },
|
|
29
|
-
tickCount: { default:
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
33
|
+
hideLegend: { type: Boolean, default: !1 },
|
|
34
|
+
minVisible: { default: z },
|
|
35
|
+
maxVisible: { default: K },
|
|
41
36
|
maxLimitTooltipText: { default: "" },
|
|
42
|
-
|
|
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(
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
)
|
|
77
|
-
|
|
78
|
-
|
|
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":
|
|
249
|
-
"onUpdate:chart-type":
|
|
250
|
-
"hide-legend":
|
|
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:
|
|
253
|
-
|
|
81
|
+
metric: u(() => [
|
|
82
|
+
c(t.$slots, "metric", {}, void 0, !0)
|
|
254
83
|
]),
|
|
255
|
-
breakdowns:
|
|
256
|
-
|
|
84
|
+
breakdowns: u(() => [
|
|
85
|
+
c(t.$slots, "breakdowns", {}, void 0, !0)
|
|
257
86
|
]),
|
|
258
87
|
_: 3
|
|
259
|
-
}, 8, ["chart-type", "hide-legend"])) :
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
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
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
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
|
-
|
|
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
|
-
|
|
4
|
+
typeSwitcher: boolean;
|
|
5
5
|
header?: string;
|
|
6
6
|
subheader?: string;
|
|
7
|
-
|
|
7
|
+
compact: boolean;
|
|
8
|
+
trendValue?: string | number;
|
|
9
|
+
trendDirection?: "up" | "down";
|
|
8
10
|
}>, {
|
|
9
11
|
chartType: ChartType;
|
|
10
|
-
|
|
12
|
+
typeSwitcher: boolean;
|
|
11
13
|
header: string;
|
|
12
14
|
subheader: string;
|
|
13
|
-
|
|
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
|
-
|
|
22
|
+
typeSwitcher: boolean;
|
|
19
23
|
header?: string;
|
|
20
24
|
subheader?: string;
|
|
21
|
-
|
|
25
|
+
compact: boolean;
|
|
26
|
+
trendValue?: string | number;
|
|
27
|
+
trendDirection?: "up" | "down";
|
|
22
28
|
}>, {
|
|
23
29
|
chartType: ChartType;
|
|
24
|
-
|
|
30
|
+
typeSwitcher: boolean;
|
|
25
31
|
header: string;
|
|
26
32
|
subheader: string;
|
|
27
|
-
|
|
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
|
-
|
|
42
|
+
typeSwitcher: boolean;
|
|
34
43
|
subheader: string;
|
|
35
|
-
|
|
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.
|
|
4
|
-
const s = /* @__PURE__ */ o(e, [["__scopeId", "data-v-
|
|
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.
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { ChartType as
|
|
5
|
-
import
|
|
6
|
-
|
|
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:
|
|
10
|
-
|
|
10
|
+
chartType: { default: l.Line },
|
|
11
|
+
typeSwitcher: { type: Boolean, default: !0 },
|
|
11
12
|
header: { default: "" },
|
|
12
13
|
subheader: { default: "" },
|
|
13
|
-
|
|
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:
|
|
17
|
-
const
|
|
18
|
-
{ id:
|
|
19
|
-
{ id:
|
|
20
|
-
{ id:
|
|
21
|
-
],
|
|
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
|
|
26
|
+
return h.find(({ id: t }) => t === V.chartType);
|
|
24
27
|
},
|
|
25
28
|
set(t) {
|
|
26
|
-
|
|
29
|
+
v("update:chartType", t.id);
|
|
27
30
|
}
|
|
28
31
|
});
|
|
29
|
-
return (t,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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.
|
|
80
|
+
e.typeSwitcher ? (r(), c(a(g), {
|
|
59
81
|
key: 0,
|
|
60
|
-
modelValue: a(
|
|
61
|
-
"onUpdate:modelValue":
|
|
62
|
-
options:
|
|
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
|
-
|
|
90
|
+
U as default
|
|
69
91
|
};
|