@ironsource/shared-ui 2.1.8-rc.7 → 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/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/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/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/index.d.ts +1 -0
- package/components/loader/v4/index.js +6 -0
- package/index.d.ts +262 -0
- package/index.js +128 -126
- package/package.json +4 -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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.chart-container[data-v-df85e0af]{border:1px solid var(--common-divider);background:var(--background-paper);display:flex;height:388px;border-radius:0 0 6px 6px}.header-wrapper[data-v-df85e0af]{height:76px}.chart-content[data-v-df85e0af]{flex:1}.chart-sidebar[data-v-df85e0af]{border-left:1px solid var(--common-divider)}.chart[data-v-df85e0af]{width:100%;height:312px;position:relative}.chart__canvas[data-v-df85e0af]{width:100%;height:100%}.chart__tooltip[data-v-df85e0af]{position:absolute;pointer-events:none;transition:all .1s ease;min-width:214px;max-width:270px}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.chart-header[data-v-2e3de9c5]{display:flex;align-items:center;justify-content:space-between;padding:24px 24px 0}.header-texts[data-v-2e3de9c5]{display:flex;flex-direction:column;color:var(--text-primary);gap:4px}.type-switch[data-v-2e3de9c5]{display:flex;align-items:center;gap:4px}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.default-dropdown-wrapper[data-v-fd7a490e]{position:relative}.dropdown-trigger[data-v-fd7a490e]{width:100%;padding:.3125rem .4375rem;display:flex;column-gap:.25rem;max-width:100%;box-sizing:border-box;border-radius:var(--border-radius-md);border:1px solid var(--action-outlined-border);background:var(--default-main);cursor:pointer;user-select:none;position:relative}.dropdown-trigger[data-v-fd7a490e]:hover{border:1px solid var(--action-active);background:var(--action-hover)}.dropdown-trigger.small[data-v-fd7a490e]{padding:.1875rem .4375rem}.dropdown-trigger.large[data-v-fd7a490e]{padding:.5625rem .4375rem}.dropdown-trigger.disabled[data-v-fd7a490e]{border:1px solid var(--action-outlined-border, #bbb);background:var(--action-disabled-background, #f1f1f1);cursor:not-allowed}.dropdown-trigger.disabled .displayed-value[data-v-fd7a490e],.dropdown-trigger.disabled .caret-down[data-v-fd7a490e]{color:var(--text-disabled)}.dropdown-trigger.open[data-v-fd7a490e]{padding:.25rem .375rem;border:2px solid var(--primary-main)}.dropdown-trigger.open.small[data-v-fd7a490e]{padding:.125rem .375rem}.dropdown-trigger.open.large[data-v-fd7a490e]{padding:.5rem .375rem}.dropdown-trigger.state-error[data-v-fd7a490e],.dropdown-trigger.state-success[data-v-fd7a490e],.dropdown-trigger.state-warning[data-v-fd7a490e]{padding:4px 6px}.dropdown-trigger.state-error.small[data-v-fd7a490e],.dropdown-trigger.state-success.small[data-v-fd7a490e],.dropdown-trigger.state-warning.small[data-v-fd7a490e]{padding:.1875rem .4375rem}.dropdown-trigger.state-error.large[data-v-fd7a490e],.dropdown-trigger.state-success.large[data-v-fd7a490e],.dropdown-trigger.state-warning.large[data-v-fd7a490e]{padding:.5625rem .4375rem}.dropdown-trigger.state-error[data-v-fd7a490e]{border:2px solid var(--error-main)}.dropdown-trigger.state-success[data-v-fd7a490e]{border:2px solid var(--success-main)}.dropdown-trigger.state-warning[data-v-fd7a490e]{border:2px solid var(--warning-dark)}.dropdown-trigger .caret-down[data-v-fd7a490e]{color:var(--action-active)}.content[data-v-fd7a490e]{display:flex;flex:1;gap:.25rem;align-items:center;color:var(--text-primary)}.content .displayed-value[data-v-fd7a490e]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.content .image[data-v-fd7a490e]{width:20px;height:20px;flex:none}.content .image img[data-v-fd7a490e]{border-radius:4px;width:100%;height:100%}.content .start-icon[data-v-fd7a490e]{display:flex;color:var(--action-active)}.content .status-dot[data-v-fd7a490e]{padding-right:.25rem}.content .status-dot>div[data-v-fd7a490e]{position:relative;top:-1px}.dropdown-field-label[data-v-fd7a490e]{color:var(--text-primary)}.dropdown-field-help-text[data-v-fd7a490e]{margin-top:4px;position:absolute}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.settings-header-container[data-v-1791e4fe]{display:flex;border:.0625rem solid var(--common-divider);border-radius:.375rem .375rem 0 0;border-bottom:none;background-color:var(--background-paper-elevation-0, #f9f9f9);justify-content:space-between}.settings-header-container .settings[data-v-1791e4fe]{display:flex;flex-direction:row;justify-content:space-between;height:4rem;padding:.75rem 0 .75rem 1.5rem;align-items:center;gap:.75rem;flex:1}.settings-header-container .settings .chart-type-selection[data-v-1791e4fe]{display:flex;height:1.75rem;max-width:8.125rem}.settings-header-container .settings .chart-type-selection[data-v-1791e4fe] .displayed-value{font-weight:600}.settings-header-container .settings-spacer[data-v-1791e4fe]{padding:.75rem 1.5rem}.settings-header-container .breakdowns[data-v-1791e4fe]{display:flex;width:13.8125rem;height:4rem;padding:0 .75rem;flex-direction:column;justify-content:center;align-items:flex-start;gap:.75rem}.settings-header-container .breakdowns-border[data-v-1791e4fe]{border-left:.0625rem solid var(--common-divider)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChartDataSet, ChartType, ChartParsingConfig, ValueFormat } from './types';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
3
|
dataSets: ChartDataSet[];
|
|
4
4
|
visibleIds: unknown[];
|
|
5
5
|
chartType?: ChartType;
|
|
@@ -16,6 +16,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
16
16
|
noDataIcon?: string;
|
|
17
17
|
noDataTitle?: string;
|
|
18
18
|
noDataSubtitle?: string;
|
|
19
|
+
withSettingsHeader?: boolean;
|
|
19
20
|
}>, {
|
|
20
21
|
chartType: ChartType;
|
|
21
22
|
dataSets: () => any[];
|
|
@@ -33,6 +34,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
33
34
|
noDataIcon: string;
|
|
34
35
|
noDataTitle: string;
|
|
35
36
|
noDataSubtitle: string;
|
|
37
|
+
withSettingsHeader: boolean;
|
|
36
38
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
37
39
|
"update:chartType": (chartType: ChartType) => void;
|
|
38
40
|
"update:visibleIds": (visibleIds: unknown[]) => void;
|
|
@@ -53,6 +55,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
53
55
|
noDataIcon?: string;
|
|
54
56
|
noDataTitle?: string;
|
|
55
57
|
noDataSubtitle?: string;
|
|
58
|
+
withSettingsHeader?: boolean;
|
|
56
59
|
}>, {
|
|
57
60
|
chartType: ChartType;
|
|
58
61
|
dataSets: () => any[];
|
|
@@ -70,6 +73,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
70
73
|
noDataIcon: string;
|
|
71
74
|
noDataTitle: string;
|
|
72
75
|
noDataSubtitle: string;
|
|
76
|
+
withSettingsHeader: boolean;
|
|
73
77
|
}>>> & {
|
|
74
78
|
"onUpdate:visibleIds"?: (visibleIds: unknown[]) => any;
|
|
75
79
|
"onUpdate:chartType"?: (chartType: ChartType) => any;
|
|
@@ -83,13 +87,17 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
83
87
|
minVisible: number;
|
|
84
88
|
maxVisible: number;
|
|
85
89
|
chartType: ChartType;
|
|
90
|
+
withSettingsHeader: boolean;
|
|
86
91
|
subheader: string;
|
|
87
92
|
dataSets: ChartDataSet[];
|
|
88
|
-
tickCount: number;
|
|
89
93
|
hideLegend: boolean;
|
|
94
|
+
tickCount: number;
|
|
90
95
|
noDataIcon: string;
|
|
91
96
|
noDataTitle: string;
|
|
92
97
|
noDataSubtitle: string;
|
|
98
|
+
}>, {
|
|
99
|
+
metric?(_: {}): any;
|
|
100
|
+
breakdowns?(_: {}): any;
|
|
93
101
|
}>;
|
|
94
102
|
export default _default;
|
|
95
103
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -109,3 +117,8 @@ type __VLS_WithDefaults<P, D> = {
|
|
|
109
117
|
type __VLS_Prettify<T> = {
|
|
110
118
|
[K in keyof T]: T[K];
|
|
111
119
|
} & {};
|
|
120
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
121
|
+
new (): {
|
|
122
|
+
$slots: S;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Chart.vue2.js";
|
|
2
|
-
/* empty css */import
|
|
3
|
-
// import "../../Chart.
|
|
4
|
-
const a = /* @__PURE__ */
|
|
2
|
+
/* empty css */import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
// import "../../Chart.vue_vue_type_style_index_0_scoped_df85e0af_lang.css"; //*');
|
|
4
|
+
const a = /* @__PURE__ */ e(o, [["__scopeId", "data-v-df85e0af"]]);
|
|
5
5
|
export {
|
|
6
6
|
a as default
|
|
7
7
|
};
|
|
@@ -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
|
};
|