@ironsource/shared-ui 2.1.8-rc.6 → 2.1.8-rc.8
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/ButtonGroup.vue_vue_type_style_index_0_scoped_5497abe6_lang.css +1 -0
- package/ButtonV4.vue_vue_type_style_index_0_scoped_bdfce3aa_lang.css +1 -0
- package/Chart.vue_vue_type_style_index_0_scoped_df85e0af_lang.css +1 -0
- package/ChartHeader.vue_vue_type_style_index_0_scoped_2e3de9c5_lang.css +1 -0
- package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_fd7a490e_lang.css +1 -0
- package/SettingsHeader.vue_vue_type_style_index_0_scoped_1791e4fe_lang.css +1 -0
- package/components/alert/Alert.vue2.js +3 -2
- package/components/button/v4/ButtonGroup.vue.d.ts +46 -0
- package/components/button/v4/ButtonGroup.vue.js +7 -0
- package/components/button/v4/ButtonGroup.vue2.js +19 -0
- package/components/button/v4/ButtonV4.vue.js +3 -3
- package/components/button/v4/ButtonV4.vue2.js +1 -1
- package/components/button/v4/index.d.ts +72 -224
- package/components/button/v4/index.js +4 -2
- package/components/chart/Chart.vue.d.ts +15 -2
- package/components/chart/Chart.vue.js +3 -3
- package/components/chart/Chart.vue2.js +160 -141
- package/components/chart/ChartHeader.vue.d.ts +5 -0
- package/components/chart/ChartHeader.vue.js +2 -2
- package/components/chart/ChartHeader.vue2.js +31 -29
- package/components/chart/SettingsHeader.vue.d.ts +30 -0
- package/components/chart/SettingsHeader.vue.js +7 -0
- package/components/chart/SettingsHeader.vue2.js +57 -0
- package/components/chart/consts.d.ts +2 -0
- package/components/chart/consts.js +17 -11
- package/components/chart/index.d.ts +320 -74
- package/components/chart/types.d.ts +4 -0
- package/components/dateRange/v4/CalendarMonthV4.vue2.js +21 -20
- package/components/dateRange/v4/DateRangeV4.vue2.js +3 -2
- package/components/dialog/v4/DialogV4.vue2.js +9 -8
- package/components/dropdown/v4/ButtonDropdownTrigger.vue2.js +5 -4
- package/components/dropdown/v4/DefaultDropdownTrigger.vue.d.ts +1 -0
- package/components/dropdown/v4/DefaultDropdownTrigger.vue.js +2 -2
- package/components/dropdown/v4/DefaultDropdownTrigger.vue2.js +33 -31
- package/components/dropdown/v4/DropdownV4.vue2.js +3 -2
- package/components/dropdown/v4/IconButtonDropdownTrigger.vue2.js +6 -5
- package/components/dropdown/v4/index.d.ts +1 -0
- package/components/emptyState/v4/EmptyStateV4.vue2.js +15 -14
- package/components/forms/FormCard.vue2.js +3 -2
- package/components/loader/v4/index.js +6 -0
- package/components/multibar/MultiBar.vue2.js +19 -18
- package/components/snackbar/v4/SnackbarV4.vue2.js +7 -6
- package/components/switch/v4/SwitchV4.vue2.js +8 -7
- package/components/table/v4/ExpandRowToggle.vue2.js +9 -8
- package/index.d.ts +376 -156
- package/index.js +128 -126
- package/package.json +5 -1
- package/ButtonV4.vue_vue_type_style_index_0_scoped_8c3b0c3f_lang.css +0 -1
- package/Chart.vue_vue_type_style_index_0_scoped_f06a4764_lang.css +0 -1
- package/ChartHeader.vue_vue_type_style_index_0_scoped_88d4532f_lang.css +0 -1
- package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_1726ad49_lang.css +0 -1
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import "../../Chart.
|
|
2
|
-
import { useVModel as
|
|
3
|
-
import { Chart as
|
|
4
|
-
import { HoverVerticalLine as
|
|
5
|
-
import { formatValue as
|
|
6
|
-
import { DEFAULT_TICK_COUNT as
|
|
1
|
+
import "../../Chart.vue_vue_type_style_index_0_scoped_df85e0af_lang.css"; import { defineComponent as X, ref as g, computed as i, onMounted as j, watch as C, nextTick as q, openBlock as d, createElementBlock as k, Fragment as R, createBlock as h, unref as c, isRef as V, withCtx as O, renderSlot as D, createCommentVNode as v, createElementVNode as f, createVNode as F, normalizeStyle as J } from "vue";
|
|
2
|
+
import { useVModel as Q } from "@vueuse/core";
|
|
3
|
+
import { Chart as N, ArcElement as Y, LineElement as ee, BarElement as te, PointElement as ae, LineController as oe, BarController as re, PieController as ie, ScatterController as le, CategoryScale as ne, LinearScale as se, Filler as de, Tooltip as ce } from "chart.js";
|
|
4
|
+
import { HoverVerticalLine as ue } from "./plugins/HoverVerticalLine.js";
|
|
5
|
+
import { formatValue as H, calcStepSize as fe } from "./utils/utils.js";
|
|
6
|
+
import { DEFAULT_TICK_COUNT as pe, DEFAULT_MIN_VISIBLE as me, DEFAULT_MAX_VISIBLE as he, COLOR_PALETTE as ve, POINT_BORDER_COLOR as ye, TICK_LABEL_COLOR as P, TICK_LABEL_FONT as U, GRID_LINE_COLOR as M } from "./consts.js";
|
|
7
7
|
import { ChartType as n } from "./types.js";
|
|
8
|
-
import { useTooltipPosition as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { hexColorToRgba as
|
|
8
|
+
import { useTooltipPosition as be } from "./composables/useTooltipPosition.js";
|
|
9
|
+
import ge from "./ChartTooltip.vue.js";
|
|
10
|
+
import Ce from "./ChartLegend.vue.js";
|
|
11
|
+
import ke from "./ChartHeader.vue.js";
|
|
12
|
+
import { hexColorToRgba as Se } from "../../utils/color.js";
|
|
13
13
|
import { useChartValues as Te } from "./composables/useChartValues.js";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
14
|
+
import Le from "./ChartLoader.vue.js";
|
|
15
|
+
import xe from "../emptyState/v4/EmptyStateV4.vue.js";
|
|
16
|
+
import Be from "./SettingsHeader.vue.js";
|
|
17
|
+
const Ie = { class: "chart-container" }, we = { class: "chart-content" }, Ae = { class: "header-wrapper" }, Ee = { class: "chart" }, Re = {
|
|
17
18
|
key: 0,
|
|
18
19
|
class: "chart-sidebar"
|
|
19
|
-
},
|
|
20
|
+
}, Xe = /* @__PURE__ */ X({
|
|
20
21
|
__name: "Chart",
|
|
21
22
|
props: {
|
|
22
23
|
dataSets: { default: () => [] },
|
|
@@ -25,23 +26,22 @@ const xe = { class: "chart-container" }, Se = { class: "chart-content" }, Ie = {
|
|
|
25
26
|
parsing: { default: void 0 },
|
|
26
27
|
xAxisFormat: { default: "string" },
|
|
27
28
|
yAxisFormat: { default: "number" },
|
|
28
|
-
tickCount: { default:
|
|
29
|
+
tickCount: { default: pe },
|
|
29
30
|
header: { default: "" },
|
|
30
31
|
subheader: { default: "" },
|
|
31
32
|
hideLegend: { type: Boolean, default: !1 },
|
|
32
|
-
minVisible: { default:
|
|
33
|
-
maxVisible: { default:
|
|
33
|
+
minVisible: { default: me },
|
|
34
|
+
maxVisible: { default: he },
|
|
34
35
|
loading: { type: Boolean, default: !1 },
|
|
35
36
|
noDataIcon: { default: "file-x" },
|
|
36
37
|
noDataTitle: { default: "No data to display" },
|
|
37
|
-
noDataSubtitle: { default: "Search again with different filters" }
|
|
38
|
+
noDataSubtitle: { default: "Search again with different filters" },
|
|
39
|
+
withSettingsHeader: { type: Boolean, default: !0 }
|
|
38
40
|
},
|
|
39
41
|
emits: ["update:chartType", "update:visibleIds"],
|
|
40
|
-
setup(a, { emit:
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
J,
|
|
44
|
-
Q,
|
|
42
|
+
setup(a, { emit: S }) {
|
|
43
|
+
const t = a;
|
|
44
|
+
N.register(
|
|
45
45
|
Y,
|
|
46
46
|
ee,
|
|
47
47
|
te,
|
|
@@ -52,50 +52,52 @@ const xe = { class: "chart-container" }, Se = { class: "chart-content" }, Ie = {
|
|
|
52
52
|
le,
|
|
53
53
|
ne,
|
|
54
54
|
se,
|
|
55
|
-
de
|
|
55
|
+
de,
|
|
56
|
+
ce,
|
|
57
|
+
ue
|
|
56
58
|
);
|
|
57
|
-
const
|
|
59
|
+
const u = Q(t, "chartType", S), p = g(null);
|
|
58
60
|
let s = null;
|
|
59
|
-
const
|
|
60
|
-
p.value && (s && s.destroy(), s = new
|
|
61
|
-
},
|
|
62
|
-
s && (s.data.datasets =
|
|
61
|
+
const T = i(() => t.dataSets.length === 0), L = i(() => !t.loading && !T.value), y = () => {
|
|
62
|
+
p.value && (s && s.destroy(), s = new N(p.value, B.value));
|
|
63
|
+
}, z = () => {
|
|
64
|
+
s && (s.data.datasets = b.value, s.options = B.value.options, s.update());
|
|
63
65
|
};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}),
|
|
67
|
-
const
|
|
68
|
-
() =>
|
|
69
|
-
),
|
|
70
|
-
() =>
|
|
71
|
-
),
|
|
72
|
-
() =>
|
|
73
|
-
),
|
|
74
|
-
const
|
|
66
|
+
j(y), C(() => t.chartType, y), C(L, async (e) => {
|
|
67
|
+
e && (await q(), y());
|
|
68
|
+
}), C([() => t.visibleIds, () => t.dataSets], z);
|
|
69
|
+
const m = i(
|
|
70
|
+
() => t.chartType === n.StackedLine || t.chartType === n.StackedBar
|
|
71
|
+
), _ = i(
|
|
72
|
+
() => t.chartType === n.Line || t.chartType === n.StackedLine
|
|
73
|
+
), x = i(
|
|
74
|
+
() => t.dataSets.filter((e) => t.visibleIds.includes(e.id))
|
|
75
|
+
), b = i(() => x.value.map((e, o) => {
|
|
76
|
+
const r = e.color || ve[o] || "#000000";
|
|
75
77
|
return {
|
|
76
|
-
...
|
|
77
|
-
fill:
|
|
78
|
-
backgroundColor:
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
...e,
|
|
79
|
+
fill: m.value ? "start" : void 0,
|
|
80
|
+
backgroundColor: Se(
|
|
81
|
+
r,
|
|
82
|
+
t.chartType === n.StackedLine ? 10 : 70
|
|
81
83
|
),
|
|
82
|
-
borderColor:
|
|
83
|
-
pointBackgroundColor:
|
|
84
|
-
pointHoverBorderColor:
|
|
84
|
+
borderColor: r,
|
|
85
|
+
pointBackgroundColor: r,
|
|
86
|
+
pointHoverBorderColor: r,
|
|
85
87
|
maxBarThickness: 50,
|
|
86
88
|
clip: 5
|
|
87
89
|
// draw a bit outside the chart area
|
|
88
90
|
};
|
|
89
|
-
})),
|
|
91
|
+
})), B = i(
|
|
90
92
|
() => ({
|
|
91
|
-
type:
|
|
93
|
+
type: t.chartType == n.Bar || t.chartType === n.StackedBar ? "bar" : "line",
|
|
92
94
|
// Chart Data
|
|
93
95
|
data: {
|
|
94
|
-
datasets:
|
|
96
|
+
datasets: b.value
|
|
95
97
|
},
|
|
96
98
|
// Chart Options
|
|
97
99
|
options: {
|
|
98
|
-
parsing:
|
|
100
|
+
parsing: t.parsing,
|
|
99
101
|
interaction: {
|
|
100
102
|
intersect: !1,
|
|
101
103
|
mode: "index",
|
|
@@ -105,17 +107,17 @@ const xe = { class: "chart-container" }, Se = { class: "chart-content" }, Ie = {
|
|
|
105
107
|
plugins: {
|
|
106
108
|
legend: { display: !1 },
|
|
107
109
|
title: { display: !1 },
|
|
108
|
-
hoverVerticalLine:
|
|
110
|
+
hoverVerticalLine: _.value,
|
|
109
111
|
// tooltip
|
|
110
112
|
tooltip: {
|
|
111
113
|
enabled: !1,
|
|
112
114
|
position: "average",
|
|
113
|
-
external: ({ tooltip:
|
|
114
|
-
l.value = { ...
|
|
115
|
+
external: ({ tooltip: e }) => {
|
|
116
|
+
l.value = { ...e };
|
|
115
117
|
},
|
|
116
118
|
callbacks: {
|
|
117
|
-
footer: (
|
|
118
|
-
const o =
|
|
119
|
+
footer: (e) => {
|
|
120
|
+
const o = e.reduce((r, G) => r + (G.parsed.y || 0), 0);
|
|
119
121
|
return ["Total", String(o)];
|
|
120
122
|
}
|
|
121
123
|
}
|
|
@@ -143,7 +145,7 @@ const xe = { class: "chart-container" }, Se = { class: "chart-content" }, Ie = {
|
|
|
143
145
|
borderWidth: 0,
|
|
144
146
|
hoverRadius: 4,
|
|
145
147
|
hoverBorderWidth: 2,
|
|
146
|
-
pointHoverBackgroundColor:
|
|
148
|
+
pointHoverBackgroundColor: ye
|
|
147
149
|
},
|
|
148
150
|
bar: {
|
|
149
151
|
borderRadius: 4
|
|
@@ -154,23 +156,23 @@ const xe = { class: "chart-container" }, Se = { class: "chart-content" }, Ie = {
|
|
|
154
156
|
x: {
|
|
155
157
|
beginAtZero: !0,
|
|
156
158
|
border: { display: !1 },
|
|
157
|
-
stacked:
|
|
159
|
+
stacked: m.value,
|
|
158
160
|
// stack on top of each other
|
|
159
161
|
// ticks
|
|
160
162
|
ticks: {
|
|
161
|
-
color:
|
|
162
|
-
font:
|
|
163
|
+
color: P,
|
|
164
|
+
font: U,
|
|
163
165
|
padding: 4,
|
|
164
|
-
callback: function(
|
|
165
|
-
return
|
|
166
|
-
this.getLabelForValue(
|
|
167
|
-
|
|
166
|
+
callback: function(e) {
|
|
167
|
+
return H(
|
|
168
|
+
this.getLabelForValue(e),
|
|
169
|
+
t.xAxisFormat
|
|
168
170
|
);
|
|
169
171
|
}
|
|
170
172
|
},
|
|
171
173
|
// grid lines
|
|
172
174
|
grid: {
|
|
173
|
-
color:
|
|
175
|
+
color: M,
|
|
174
176
|
drawOnChartArea: !1,
|
|
175
177
|
drawTicks: !0,
|
|
176
178
|
drawBorder: !1,
|
|
@@ -182,21 +184,21 @@ const xe = { class: "chart-container" }, Se = { class: "chart-content" }, Ie = {
|
|
|
182
184
|
beginAtZero: !0,
|
|
183
185
|
border: { display: !1 },
|
|
184
186
|
// hide left borderline
|
|
185
|
-
stacked:
|
|
187
|
+
stacked: m.value,
|
|
186
188
|
// stack on top of each other
|
|
187
189
|
// ticks
|
|
188
190
|
ticks: {
|
|
189
|
-
color:
|
|
190
|
-
font:
|
|
191
|
+
color: P,
|
|
192
|
+
font: U,
|
|
191
193
|
padding: 8,
|
|
192
|
-
stepSize:
|
|
193
|
-
min:
|
|
194
|
-
max:
|
|
195
|
-
callback: (
|
|
194
|
+
stepSize: E.value,
|
|
195
|
+
min: A.value,
|
|
196
|
+
max: E.value * t.tickCount,
|
|
197
|
+
callback: (e) => H(e, t.yAxisFormat)
|
|
196
198
|
},
|
|
197
199
|
// grid lines
|
|
198
200
|
grid: {
|
|
199
|
-
color:
|
|
201
|
+
color: M,
|
|
200
202
|
drawOnChartArea: !0,
|
|
201
203
|
drawTicks: !1
|
|
202
204
|
}
|
|
@@ -204,78 +206,95 @@ const xe = { class: "chart-container" }, Se = { class: "chart-content" }, Ie = {
|
|
|
204
206
|
}
|
|
205
207
|
}
|
|
206
208
|
})
|
|
207
|
-
),
|
|
208
|
-
() =>
|
|
209
|
-
),
|
|
210
|
-
id:
|
|
211
|
-
label:
|
|
212
|
-
color:
|
|
213
|
-
}))),
|
|
209
|
+
), $ = i(
|
|
210
|
+
() => b.value.reduce((e, o) => (e[o.id] = o.borderColor, e), {})
|
|
211
|
+
), K = i(() => t.dataSets.map((e) => ({
|
|
212
|
+
id: e.id,
|
|
213
|
+
label: e.label,
|
|
214
|
+
color: $.value[e.id] || null
|
|
215
|
+
}))), I = g(null), l = g(null), { position: w } = be(
|
|
214
216
|
p,
|
|
215
|
-
|
|
217
|
+
I,
|
|
216
218
|
l
|
|
217
|
-
),
|
|
218
|
-
left: `${
|
|
219
|
-
top: `${
|
|
219
|
+
), W = i(() => ({
|
|
220
|
+
left: `${w.value.left}px`,
|
|
221
|
+
top: `${w.value.top}px`,
|
|
220
222
|
opacity: l.value?.opacity || 0
|
|
221
|
-
})), { minValue:
|
|
222
|
-
parsingConfig:
|
|
223
|
-
dataSets:
|
|
224
|
-
isStacked:
|
|
225
|
-
}),
|
|
226
|
-
() =>
|
|
223
|
+
})), { minValue: A, maxValue: Z } = Te({
|
|
224
|
+
parsingConfig: t.parsing,
|
|
225
|
+
dataSets: x,
|
|
226
|
+
isStacked: m
|
|
227
|
+
}), E = i(
|
|
228
|
+
() => fe(A.value, Z.value, t.tickCount)
|
|
227
229
|
);
|
|
228
|
-
return (
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
u("canvas", {
|
|
241
|
-
ref_key: "chartRef",
|
|
242
|
-
ref: p,
|
|
243
|
-
class: "chart__canvas"
|
|
244
|
-
}, null, 512),
|
|
245
|
-
u("div", {
|
|
246
|
-
ref_key: "tooltipRef",
|
|
247
|
-
ref: B,
|
|
248
|
-
class: "chart__tooltip",
|
|
249
|
-
style: j(c(z))
|
|
250
|
-
}, [
|
|
251
|
-
l.value ? (d(), g(ye, {
|
|
252
|
-
key: 0,
|
|
253
|
-
title: String(l.value.title),
|
|
254
|
-
"data-points": l.value.dataPoints,
|
|
255
|
-
"x-axis-format": a.xAxisFormat,
|
|
256
|
-
"y-axis-format": a.yAxisFormat,
|
|
257
|
-
"total-label": l.value.footer[0],
|
|
258
|
-
"total-value": Number(l.value.footer[1])
|
|
259
|
-
}, null, 8, ["title", "data-points", "x-axis-format", "y-axis-format", "total-label", "total-value"])) : T("", !0)
|
|
260
|
-
], 4)
|
|
261
|
-
])
|
|
230
|
+
return (e, o) => (d(), k(R, null, [
|
|
231
|
+
a.withSettingsHeader ? (d(), h(Be, {
|
|
232
|
+
key: 0,
|
|
233
|
+
"chart-type": c(u),
|
|
234
|
+
"onUpdate:chart-type": o[0] || (o[0] = (r) => V(u) ? u.value = r : null),
|
|
235
|
+
"hide-legend": a.hideLegend
|
|
236
|
+
}, {
|
|
237
|
+
metric: O(() => [
|
|
238
|
+
D(e.$slots, "metric", {}, void 0, !0)
|
|
239
|
+
]),
|
|
240
|
+
breakdowns: O(() => [
|
|
241
|
+
D(e.$slots, "breakdowns", {}, void 0, !0)
|
|
262
242
|
]),
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
243
|
+
_: 3
|
|
244
|
+
}, 8, ["chart-type", "hide-legend"])) : v("", !0),
|
|
245
|
+
f("div", Ie, [
|
|
246
|
+
c(L) ? (d(), k(R, { key: 0 }, [
|
|
247
|
+
f("section", we, [
|
|
248
|
+
f("div", Ae, [
|
|
249
|
+
F(ke, {
|
|
250
|
+
"chart-type": c(u),
|
|
251
|
+
"onUpdate:chart-type": o[1] || (o[1] = (r) => V(u) ? u.value = r : null),
|
|
252
|
+
"with-settings-header": a.withSettingsHeader,
|
|
253
|
+
header: a.header,
|
|
254
|
+
subheader: a.subheader
|
|
255
|
+
}, null, 8, ["chart-type", "with-settings-header", "header", "subheader"])
|
|
256
|
+
]),
|
|
257
|
+
f("div", Ee, [
|
|
258
|
+
f("canvas", {
|
|
259
|
+
ref_key: "chartRef",
|
|
260
|
+
ref: p,
|
|
261
|
+
class: "chart__canvas"
|
|
262
|
+
}, null, 512),
|
|
263
|
+
f("div", {
|
|
264
|
+
ref_key: "tooltipRef",
|
|
265
|
+
ref: I,
|
|
266
|
+
class: "chart__tooltip",
|
|
267
|
+
style: J(c(W))
|
|
268
|
+
}, [
|
|
269
|
+
l.value ? (d(), h(ge, {
|
|
270
|
+
key: 0,
|
|
271
|
+
title: String(l.value.title),
|
|
272
|
+
"data-points": l.value.dataPoints,
|
|
273
|
+
"x-axis-format": a.xAxisFormat,
|
|
274
|
+
"y-axis-format": a.yAxisFormat,
|
|
275
|
+
"total-label": l.value.footer[0],
|
|
276
|
+
"total-value": Number(l.value.footer[1])
|
|
277
|
+
}, null, 8, ["title", "data-points", "x-axis-format", "y-axis-format", "total-label", "total-value"])) : v("", !0)
|
|
278
|
+
], 4)
|
|
279
|
+
])
|
|
280
|
+
]),
|
|
281
|
+
a.hideLegend ? v("", !0) : (d(), k("section", Re, [
|
|
282
|
+
F(Ce, {
|
|
283
|
+
items: c(K),
|
|
284
|
+
"visible-ids": a.visibleIds,
|
|
285
|
+
"onUpdate:visibleIds": o[2] || (o[2] = (r) => S("update:visibleIds", r))
|
|
286
|
+
}, null, 8, ["items", "visible-ids"])
|
|
287
|
+
]))
|
|
288
|
+
], 64)) : a.loading ? (d(), h(Le, { key: 1 })) : c(T) ? (d(), h(c(xe), {
|
|
289
|
+
key: 2,
|
|
290
|
+
title: a.noDataTitle,
|
|
291
|
+
subtitle: a.noDataSubtitle,
|
|
292
|
+
"icon-name": a.noDataIcon
|
|
293
|
+
}, null, 8, ["title", "subtitle", "icon-name"])) : v("", !0)
|
|
294
|
+
])
|
|
295
|
+
], 64));
|
|
277
296
|
}
|
|
278
297
|
});
|
|
279
298
|
export {
|
|
280
|
-
|
|
299
|
+
Xe as default
|
|
281
300
|
};
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { ChartType } from '@/components/chart/types';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
3
|
chartType: ChartType;
|
|
4
|
+
withSettingsHeader: boolean;
|
|
4
5
|
header?: string;
|
|
5
6
|
subheader?: string;
|
|
6
7
|
}>, {
|
|
7
8
|
chartType: ChartType;
|
|
9
|
+
withSettingsHeader: boolean;
|
|
8
10
|
header: string;
|
|
9
11
|
subheader: string;
|
|
10
12
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
13
|
"update:chartType": (type: ChartType) => void;
|
|
12
14
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
13
15
|
chartType: ChartType;
|
|
16
|
+
withSettingsHeader: boolean;
|
|
14
17
|
header?: string;
|
|
15
18
|
subheader?: string;
|
|
16
19
|
}>, {
|
|
17
20
|
chartType: ChartType;
|
|
21
|
+
withSettingsHeader: boolean;
|
|
18
22
|
header: string;
|
|
19
23
|
subheader: string;
|
|
20
24
|
}>>> & {
|
|
@@ -22,6 +26,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
22
26
|
}, {
|
|
23
27
|
header: string;
|
|
24
28
|
chartType: ChartType;
|
|
29
|
+
withSettingsHeader: boolean;
|
|
25
30
|
subheader: string;
|
|
26
31
|
}>;
|
|
27
32
|
export default _default;
|
|
@@ -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_2e3de9c5_lang.css"; //*');
|
|
4
|
+
const s = /* @__PURE__ */ o(e, [["__scopeId", "data-v-2e3de9c5"]]);
|
|
5
5
|
export {
|
|
6
6
|
s as default
|
|
7
7
|
};
|
|
@@ -1,51 +1,53 @@
|
|
|
1
|
-
import "../../ChartHeader.
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { ChartType as
|
|
5
|
-
const C = { class: "chart-header" },
|
|
1
|
+
import "../../ChartHeader.vue_vue_type_style_index_0_scoped_2e3de9c5_lang.css"; import { defineComponent as y, computed as T, openBlock as i, createElementBlock as V, createElementVNode as g, createVNode as c, unref as a, withCtx as l, createTextVNode as s, toDisplayString as u, createBlock as k, isRef as v, createCommentVNode as x } from "vue";
|
|
2
|
+
import p from "../typography/v4/Typography.vue.js";
|
|
3
|
+
import B from "../switch/v4/SwitchV4.vue.js";
|
|
4
|
+
import { ChartType as r } from "./types.js";
|
|
5
|
+
const C = { class: "chart-header" }, S = { class: "header-texts" }, H = /* @__PURE__ */ y({
|
|
6
6
|
__name: "ChartHeader",
|
|
7
7
|
props: {
|
|
8
|
-
chartType: { default:
|
|
8
|
+
chartType: { default: r.Line },
|
|
9
|
+
withSettingsHeader: { type: Boolean, default: !0 },
|
|
9
10
|
header: { default: "" },
|
|
10
11
|
subheader: { default: "" }
|
|
11
12
|
},
|
|
12
13
|
emits: ["update:chartType"],
|
|
13
|
-
setup(
|
|
14
|
-
const
|
|
15
|
-
{ id:
|
|
16
|
-
{ id:
|
|
17
|
-
{ id:
|
|
18
|
-
], o =
|
|
14
|
+
setup(e, { emit: h }) {
|
|
15
|
+
const m = e, n = [
|
|
16
|
+
{ id: r.Line, icon: "chart-line-up" },
|
|
17
|
+
{ id: r.Bar, icon: "chart-bar" },
|
|
18
|
+
{ id: r.StackedLine, icon: "chart-line" }
|
|
19
|
+
], o = T({
|
|
19
20
|
get() {
|
|
20
|
-
return
|
|
21
|
+
return n.find(({ id: t }) => t === m.chartType);
|
|
21
22
|
},
|
|
22
|
-
set(
|
|
23
|
-
|
|
23
|
+
set(t) {
|
|
24
|
+
h("update:chartType", t.id);
|
|
24
25
|
}
|
|
25
26
|
});
|
|
26
|
-
return (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
default:
|
|
30
|
-
|
|
27
|
+
return (t, d) => (i(), V("div", C, [
|
|
28
|
+
g("div", S, [
|
|
29
|
+
c(a(p), { variant: "chart2" }, {
|
|
30
|
+
default: l(() => [
|
|
31
|
+
s(u(e.header), 1)
|
|
31
32
|
]),
|
|
32
33
|
_: 1
|
|
33
34
|
}),
|
|
34
|
-
|
|
35
|
-
default:
|
|
36
|
-
|
|
35
|
+
c(a(p), { variant: "caption" }, {
|
|
36
|
+
default: l(() => [
|
|
37
|
+
s(u(e.subheader), 1)
|
|
37
38
|
]),
|
|
38
39
|
_: 1
|
|
39
40
|
})
|
|
40
41
|
]),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
e.withSettingsHeader ? x("", !0) : (i(), k(a(B), {
|
|
43
|
+
key: 0,
|
|
44
|
+
modelValue: a(o),
|
|
45
|
+
"onUpdate:modelValue": d[0] || (d[0] = (f) => v(o) ? o.value = f : null),
|
|
46
|
+
options: n
|
|
47
|
+
}, null, 8, ["modelValue"]))
|
|
46
48
|
]));
|
|
47
49
|
}
|
|
48
50
|
});
|
|
49
51
|
export {
|
|
50
|
-
|
|
52
|
+
H as default
|
|
51
53
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ChartType } from './types';
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
chartType: ChartType;
|
|
4
|
+
hideLegend: boolean;
|
|
5
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
"update:chartType": (type: ChartType) => void;
|
|
7
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
8
|
+
chartType: ChartType;
|
|
9
|
+
hideLegend: boolean;
|
|
10
|
+
}>>> & {
|
|
11
|
+
"onUpdate:chartType"?: (type: ChartType) => any;
|
|
12
|
+
}, {}>, {
|
|
13
|
+
metric?(_: {}): any;
|
|
14
|
+
breakdowns?(_: {}): any;
|
|
15
|
+
}>;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
18
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
19
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
20
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
21
|
+
} : {
|
|
22
|
+
type: import('vue').PropType<T[K]>;
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import e from "./SettingsHeader.vue2.js";
|
|
2
|
+
/* empty css */import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
// import "../../SettingsHeader.vue_vue_type_style_index_0_scoped_1791e4fe_lang.css"; //*');
|
|
4
|
+
const p = /* @__PURE__ */ o(e, [["__scopeId", "data-v-1791e4fe"]]);
|
|
5
|
+
export {
|
|
6
|
+
p as default
|
|
7
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import "../../SettingsHeader.vue_vue_type_style_index_0_scoped_1791e4fe_lang.css"; import { defineComponent as u, computed as h, openBlock as y, createElementBlock as f, createElementVNode as t, normalizeClass as i, createVNode as v, unref as r, isRef as g, renderSlot as a } from "vue";
|
|
2
|
+
import T from "../dropdown/v4/DropdownV4.vue.js";
|
|
3
|
+
import "../dropdown/v4/DefaultDropdownTrigger.vue.js";
|
|
4
|
+
import "../dropdown/v4/IconButtonDropdownTrigger.vue.js";
|
|
5
|
+
import "../dropdown/v4/ChipDropdownTrigger.vue.js";
|
|
6
|
+
import "../dropdown/v4/AppDropdownTrigger.vue.js";
|
|
7
|
+
import "../dropdown/v4/ButtonDropdownTrigger.vue.js";
|
|
8
|
+
import "../dropdown/v4/ButtonFilterDropdownTrigger.vue.js";
|
|
9
|
+
import "../dropdown/v4/TreeDropdown.vue.js";
|
|
10
|
+
import "../dropdown/v4/OptionV4.vue.js";
|
|
11
|
+
import { DROPDOWN_TYPE_OPTIONS as d } from "./consts.js";
|
|
12
|
+
const k = { class: "settings-header-container" }, b = { class: "chart-type-selection" }, V = /* @__PURE__ */ u({
|
|
13
|
+
__name: "SettingsHeader",
|
|
14
|
+
props: {
|
|
15
|
+
chartType: null,
|
|
16
|
+
hideLegend: { type: Boolean }
|
|
17
|
+
},
|
|
18
|
+
emits: ["update:chartType"],
|
|
19
|
+
setup(o, { emit: l }) {
|
|
20
|
+
const p = o, s = h({
|
|
21
|
+
get() {
|
|
22
|
+
return d.find(({ id: e }) => e === p.chartType);
|
|
23
|
+
},
|
|
24
|
+
set(e) {
|
|
25
|
+
l("update:chartType", e.id);
|
|
26
|
+
}
|
|
27
|
+
}), c = (e) => `Chart: ${e.name}`;
|
|
28
|
+
return (e, n) => (y(), f("div", k, [
|
|
29
|
+
t("div", {
|
|
30
|
+
class: i(["settings", { "settings-spacer": !o.hideLegend }])
|
|
31
|
+
}, [
|
|
32
|
+
t("div", b, [
|
|
33
|
+
v(r(T), {
|
|
34
|
+
selected: r(s),
|
|
35
|
+
"onUpdate:selected": n[0] || (n[0] = (m) => g(s) ? s.value = m : null),
|
|
36
|
+
options: r(d),
|
|
37
|
+
"option-name-key": "name",
|
|
38
|
+
"display-value": c,
|
|
39
|
+
placeholder: "Select chart type",
|
|
40
|
+
size: "small"
|
|
41
|
+
}, null, 8, ["selected", "options"])
|
|
42
|
+
]),
|
|
43
|
+
t("div", null, [
|
|
44
|
+
a(e.$slots, "metric", {}, void 0, !0)
|
|
45
|
+
])
|
|
46
|
+
], 2),
|
|
47
|
+
t("div", {
|
|
48
|
+
class: i(["breakdowns", { "breakdowns-border": !o.hideLegend }])
|
|
49
|
+
}, [
|
|
50
|
+
a(e.$slots, "breakdowns", {}, void 0, !0)
|
|
51
|
+
], 2)
|
|
52
|
+
]));
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
export {
|
|
56
|
+
V as default
|
|
57
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DropdownTypeOption } from './types';
|
|
1
2
|
export declare const POINT_BORDER_COLOR = "#fcfcfc";
|
|
2
3
|
export declare const GRID_LINE_COLOR = "#E4E4E4";
|
|
3
4
|
export declare const TICK_LABEL_COLOR = "#646464";
|
|
@@ -10,3 +11,4 @@ export declare const COLOR_PALETTE: string[];
|
|
|
10
11
|
export declare const DEFAULT_TICK_COUNT = 4;
|
|
11
12
|
export declare const DEFAULT_MIN_VISIBLE = 1;
|
|
12
13
|
export declare const DEFAULT_MAX_VISIBLE = 5;
|
|
14
|
+
export declare const DROPDOWN_TYPE_OPTIONS: DropdownTypeOption[];
|