@ironsource/shared-ui 2.1.12-rc.9 → 2.1.12-test.57
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/ButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_0123c361_lang.css +1 -0
- package/Chart.vue_vue_type_style_index_0_scoped_757e7752_lang.css +1 -0
- package/ChartHeader.vue_vue_type_style_index_0_scoped_92052479_lang.css +1 -0
- package/ChartHeaderTrend.vue_vue_type_style_index_0_scoped_d61ed404_lang.css +1 -0
- package/ChartLegend.vue_vue_type_style_index_0_scoped_da487aba_lang.css +1 -0
- package/ChartPlane.vue_vue_type_style_index_0_scoped_bb382dc4_lang.css +1 -0
- package/DataGrid.vue_vue_type_style_index_0_scoped_86ea5d2a_lang.css +1 -0
- package/IconButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_99e51ecc_lang.css +1 -0
- package/SettingsHeader.vue_vue_type_style_index_0_scoped_fba2eaa4_lang.css +1 -0
- package/components/chart/Chart.vue.d.ts +56 -2
- package/components/chart/Chart.vue.js +4 -4
- package/components/chart/Chart.vue2.js +93 -60
- package/components/chart/ChartHeader.vue.d.ts +25 -0
- package/components/chart/ChartHeader.vue.js +2 -2
- package/components/chart/ChartHeader.vue2.js +75 -50
- package/components/chart/ChartHeaderTrend.vue.d.ts +15 -0
- package/components/chart/ChartHeaderTrend.vue.js +3 -3
- package/components/chart/ChartHeaderTrend.vue2.js +83 -19
- package/components/chart/ChartLegend.vue.d.ts +17 -0
- package/components/chart/ChartLegend.vue.js +3 -3
- package/components/chart/ChartLegend.vue2.js +78 -67
- package/components/chart/ChartPlane.vue.d.ts +43 -4
- package/components/chart/ChartPlane.vue.js +3 -3
- package/components/chart/ChartPlane.vue2.js +137 -118
- package/components/chart/LegendSorting.vue.d.ts +37 -0
- package/components/chart/LegendSorting.vue.js +45 -0
- package/components/chart/LegendSorting.vue2.js +4 -0
- package/components/chart/SettingsHeader.vue.d.ts +1 -0
- package/components/chart/SettingsHeader.vue.js +3 -3
- package/components/chart/SettingsHeader.vue2.js +17 -16
- package/components/chart/colorPalette.d.ts +4 -0
- package/components/chart/colorPalette.js +54 -0
- package/components/chart/composables/useColorsMap.d.ts +2 -2
- package/components/chart/composables/useColorsMap.js +41 -12
- package/components/chart/consts.d.ts +12 -1
- package/components/chart/consts.js +31 -26
- package/components/chart/index.d.ts +237 -40
- package/components/chart/mockData.d.ts +8 -14
- package/components/chart/types.d.ts +2 -1
- package/components/dropdown/v4/ButtonDropdownTrigger.vue.js +2 -2
- package/components/dropdown/v4/ButtonDropdownTrigger.vue2.js +1 -1
- package/components/dropdown/v4/IconButtonDropdownTrigger.vue.d.ts +11 -0
- package/components/dropdown/v4/IconButtonDropdownTrigger.vue.js +4 -4
- package/components/dropdown/v4/IconButtonDropdownTrigger.vue2.js +12 -10
- package/components/dropdown/v4/index.d.ts +18 -0
- package/components/table/v4/DataGrid.vue.js +3 -3
- package/components/table/v4/DataGrid.vue2.js +35 -35
- package/index.d.ts +37 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/utils/formatNumbers.d.ts +1 -1
- package/utils/formatNumbers.js +14 -14
- package/utils/totals.d.ts +5 -0
- package/utils/totals.js +9 -0
- package/ButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_604dfc6f_lang.css +0 -1
- package/Chart.vue_vue_type_style_index_0_scoped_78d3f5a8_lang.css +0 -1
- package/ChartHeader.vue_vue_type_style_index_0_scoped_32001725_lang.css +0 -1
- package/ChartHeaderTrend.vue_vue_type_style_index_0_scoped_e4c673e7_lang.css +0 -1
- package/ChartLegend.vue_vue_type_style_index_0_scoped_532f23bc_lang.css +0 -1
- package/ChartPlane.vue_vue_type_style_index_0_scoped_4396faf6_lang.css +0 -1
- package/DataGrid.vue_vue_type_style_index_0_scoped_6b54ac22_lang.css +0 -1
- package/IconButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_59fb505a_lang.css +0 -1
- package/SettingsHeader.vue_vue_type_style_index_0_scoped_9b6cd9d9_lang.css +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ChartDataSet, ChartParsingConfig, ChartType, ValueFormat } from './types';
|
|
2
|
+
import { TotalType } from '@/utils/totals';
|
|
2
3
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
4
|
dataSets: ChartDataSet[];
|
|
4
5
|
visibleIds: unknown[];
|
|
@@ -9,6 +10,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
9
10
|
tickCount?: number;
|
|
10
11
|
header?: string;
|
|
11
12
|
subheader?: string;
|
|
13
|
+
subheaderTooltipHeader?: string;
|
|
14
|
+
subheaderTooltipText?: string;
|
|
12
15
|
loading?: boolean;
|
|
13
16
|
noDataIcon?: string;
|
|
14
17
|
noDataTitle?: string;
|
|
@@ -18,9 +21,15 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
18
21
|
height?: string;
|
|
19
22
|
compactHeader?: boolean;
|
|
20
23
|
tooltipRespectsTopEdge?: boolean;
|
|
24
|
+
tooltipTotalType?: TotalType;
|
|
25
|
+
tooltipTotalCalcFn?: (values: number[], totalType: TotalType) => number;
|
|
21
26
|
trendValue?: string | number;
|
|
22
27
|
trendDirection?: "up" | "down";
|
|
28
|
+
trendTooltipHeader?: string;
|
|
29
|
+
trendTooltipRangeCurrent?: string;
|
|
30
|
+
trendTooltipRangePrevious?: string;
|
|
23
31
|
totalsChart?: boolean;
|
|
32
|
+
colorsMap: Record<string, string>;
|
|
24
33
|
}>, {
|
|
25
34
|
chartType: ChartType;
|
|
26
35
|
dataSets: () => any[];
|
|
@@ -31,7 +40,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
31
40
|
tickCount: number;
|
|
32
41
|
header: string;
|
|
33
42
|
subheader: string;
|
|
34
|
-
|
|
43
|
+
subheaderTooltipHeader: any;
|
|
44
|
+
subheaderTooltipText: any;
|
|
35
45
|
loading: boolean;
|
|
36
46
|
noDataIcon: string;
|
|
37
47
|
noDataTitle: string;
|
|
@@ -41,9 +51,15 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
41
51
|
height: string;
|
|
42
52
|
compactHeader: boolean;
|
|
43
53
|
tooltipRespectsTopEdge: boolean;
|
|
54
|
+
tooltipTotalType: TotalType;
|
|
55
|
+
tooltipTotalCalcFn: (values: number[], totalType: TotalType) => number;
|
|
44
56
|
trendValue: any;
|
|
45
57
|
trendDirection: string;
|
|
58
|
+
trendTooltipHeader: any;
|
|
59
|
+
trendTooltipRangeCurrent: any;
|
|
60
|
+
trendTooltipRangePrevious: any;
|
|
46
61
|
totalsChart: boolean;
|
|
62
|
+
colorsMap: () => {};
|
|
47
63
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
48
64
|
"update:chartType": (chartType: ChartType) => void;
|
|
49
65
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
@@ -56,6 +72,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
56
72
|
tickCount?: number;
|
|
57
73
|
header?: string;
|
|
58
74
|
subheader?: string;
|
|
75
|
+
subheaderTooltipHeader?: string;
|
|
76
|
+
subheaderTooltipText?: string;
|
|
59
77
|
loading?: boolean;
|
|
60
78
|
noDataIcon?: string;
|
|
61
79
|
noDataTitle?: string;
|
|
@@ -65,9 +83,15 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
65
83
|
height?: string;
|
|
66
84
|
compactHeader?: boolean;
|
|
67
85
|
tooltipRespectsTopEdge?: boolean;
|
|
86
|
+
tooltipTotalType?: TotalType;
|
|
87
|
+
tooltipTotalCalcFn?: (values: number[], totalType: TotalType) => number;
|
|
68
88
|
trendValue?: string | number;
|
|
69
89
|
trendDirection?: "up" | "down";
|
|
90
|
+
trendTooltipHeader?: string;
|
|
91
|
+
trendTooltipRangeCurrent?: string;
|
|
92
|
+
trendTooltipRangePrevious?: string;
|
|
70
93
|
totalsChart?: boolean;
|
|
94
|
+
colorsMap: Record<string, string>;
|
|
71
95
|
}>, {
|
|
72
96
|
chartType: ChartType;
|
|
73
97
|
dataSets: () => any[];
|
|
@@ -78,7 +102,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
78
102
|
tickCount: number;
|
|
79
103
|
header: string;
|
|
80
104
|
subheader: string;
|
|
81
|
-
|
|
105
|
+
subheaderTooltipHeader: any;
|
|
106
|
+
subheaderTooltipText: any;
|
|
82
107
|
loading: boolean;
|
|
83
108
|
noDataIcon: string;
|
|
84
109
|
noDataTitle: string;
|
|
@@ -88,9 +113,15 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
88
113
|
height: string;
|
|
89
114
|
compactHeader: boolean;
|
|
90
115
|
tooltipRespectsTopEdge: boolean;
|
|
116
|
+
tooltipTotalType: TotalType;
|
|
117
|
+
tooltipTotalCalcFn: (values: number[], totalType: TotalType) => number;
|
|
91
118
|
trendValue: any;
|
|
92
119
|
trendDirection: string;
|
|
120
|
+
trendTooltipHeader: any;
|
|
121
|
+
trendTooltipRangeCurrent: any;
|
|
122
|
+
trendTooltipRangePrevious: any;
|
|
93
123
|
totalsChart: boolean;
|
|
124
|
+
colorsMap: () => {};
|
|
94
125
|
}>>> & {
|
|
95
126
|
"onUpdate:chartType"?: (chartType: ChartType) => any;
|
|
96
127
|
}, {
|
|
@@ -105,16 +136,24 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
105
136
|
dataSets: ChartDataSet[];
|
|
106
137
|
typeSwitcher: boolean;
|
|
107
138
|
subheader: string;
|
|
139
|
+
subheaderTooltipHeader: string;
|
|
140
|
+
subheaderTooltipText: string;
|
|
141
|
+
trendTooltipHeader: string;
|
|
142
|
+
trendTooltipRangeCurrent: string;
|
|
143
|
+
trendTooltipRangePrevious: string;
|
|
108
144
|
trendValue: string | number;
|
|
109
145
|
trendDirection: "up" | "down";
|
|
110
146
|
tickCount: number;
|
|
111
|
-
withAnimation: boolean;
|
|
112
|
-
totalsChart: boolean;
|
|
113
147
|
noDataIcon: string;
|
|
114
148
|
noDataTitle: string;
|
|
115
149
|
noDataSubtitle: string;
|
|
150
|
+
withAnimation: boolean;
|
|
116
151
|
compactHeader: boolean;
|
|
117
152
|
tooltipRespectsTopEdge: boolean;
|
|
153
|
+
tooltipTotalType: TotalType;
|
|
154
|
+
tooltipTotalCalcFn: (values: number[], totalType: TotalType) => number;
|
|
155
|
+
totalsChart: boolean;
|
|
156
|
+
colorsMap: Record<string, string>;
|
|
118
157
|
}>, {
|
|
119
158
|
"subheader-tooltip"?(_: {}): any;
|
|
120
159
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ChartPlane.vue2.js";
|
|
2
2
|
/* empty css */import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
-
// import "../../ChartPlane.
|
|
4
|
-
const
|
|
3
|
+
// import "../../ChartPlane.vue_vue_type_style_index_0_scoped_bb382dc4_lang.css"; //*');
|
|
4
|
+
const a = /* @__PURE__ */ e(o, [["__scopeId", "data-v-bb382dc4"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,33 +1,36 @@
|
|
|
1
|
-
import "../../ChartPlane.
|
|
2
|
-
import { Chart as
|
|
3
|
-
import { HoverVerticalLine as
|
|
4
|
-
import { formatValue as
|
|
5
|
-
import { DEFAULT_TICK_COUNT as be, TOTALS_HELPER_KEY as
|
|
6
|
-
import { ChartType as
|
|
7
|
-
import { useTooltipPosition as
|
|
8
|
-
import
|
|
1
|
+
import "../../ChartPlane.vue_vue_type_style_index_0_scoped_bb382dc4_lang.css"; import { defineComponent as J, useCssVars as Q, unref as d, computed as o, ref as g, onMounted as X, watch as C, nextTick as _, openBlock as h, createElementBlock as ee, createElementVNode as m, createVNode as te, isRef as ae, createSlots as oe, withCtx as le, renderSlot as re, normalizeStyle as ie, createBlock as b, createCommentVNode as V } from "vue";
|
|
2
|
+
import { Chart as O, ArcElement as ne, LineElement as se, BarElement as de, PointElement as ue, LineController as ce, BarController as pe, PieController as fe, ScatterController as he, CategoryScale as me, LinearScale as ve, Filler as Te, Tooltip as ye } from "chart.js";
|
|
3
|
+
import { HoverVerticalLine as ge } from "./plugins/HoverVerticalLine.js";
|
|
4
|
+
import { formatValue as F, calcStepSize as Ce } from "./utils/utils.js";
|
|
5
|
+
import { DEFAULT_TICK_COUNT as be, TOTALS_HELPER_KEY as I, POINT_BORDER_COLOR as xe, TICK_LABEL_COLOR as P, TICK_LABEL_FONT as N, GRID_LINE_COLOR as M, HEADER_HEIGHT as ke, COMPACT_HEADER_HEIGHT as Se } from "./consts.js";
|
|
6
|
+
import { ChartType as n } from "./types.js";
|
|
7
|
+
import { useTooltipPosition as Le } from "./composables/useTooltipPosition.js";
|
|
8
|
+
import Re from "./ChartTooltip.vue.js";
|
|
9
9
|
import { hexColorToRgba as Ee } from "../../utils/color.js";
|
|
10
|
-
import { useChartValues as
|
|
11
|
-
import
|
|
12
|
-
import { useVModel as
|
|
10
|
+
import { useChartValues as Ae } from "./composables/useChartValues.js";
|
|
11
|
+
import Be from "./ChartHeader.vue.js";
|
|
12
|
+
import { useVModel as He } from "@vueuse/core";
|
|
13
13
|
import we from "../emptyState/v4/EmptyStateV4.vue.js";
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
|
|
14
|
+
import De from "./ChartLoader.vue.js";
|
|
15
|
+
import { DEFAULT_CHART_COLOR as Ve } from "./colorPalette.js";
|
|
16
|
+
import { TotalType as z, calculateTotal as Oe } from "../../utils/totals.js";
|
|
17
|
+
const Fe = {
|
|
17
18
|
key: 0,
|
|
18
19
|
class: "chart-plane"
|
|
19
|
-
},
|
|
20
|
+
}, Ie = { class: "header-wrapper" }, Pe = { class: "chart" }, et = /* @__PURE__ */ J({
|
|
20
21
|
__name: "ChartPlane",
|
|
21
22
|
props: {
|
|
22
23
|
dataSets: { default: () => [] },
|
|
23
24
|
visibleIds: { default: () => [] },
|
|
24
|
-
chartType: { default:
|
|
25
|
+
chartType: { default: n.Line },
|
|
25
26
|
parsing: { default: void 0 },
|
|
26
27
|
xAxisFormat: { default: "string" },
|
|
27
28
|
yAxisFormat: { default: "number" },
|
|
28
29
|
tickCount: { default: be },
|
|
29
30
|
header: { default: "" },
|
|
30
31
|
subheader: { default: "" },
|
|
32
|
+
subheaderTooltipHeader: { default: null },
|
|
33
|
+
subheaderTooltipText: { default: null },
|
|
31
34
|
loading: { type: Boolean, default: !1 },
|
|
32
35
|
noDataIcon: { default: "file-search" },
|
|
33
36
|
noDataTitle: { default: "No data to display" },
|
|
@@ -37,97 +40,105 @@ const Ie = {
|
|
|
37
40
|
height: { default: "100%" },
|
|
38
41
|
compactHeader: { type: Boolean, default: !1 },
|
|
39
42
|
tooltipRespectsTopEdge: { type: Boolean, default: !0 },
|
|
43
|
+
tooltipTotalType: { default: z.Total },
|
|
44
|
+
tooltipTotalCalcFn: { type: Function, default: Oe },
|
|
40
45
|
trendValue: { default: null },
|
|
41
46
|
trendDirection: { default: "up" },
|
|
42
|
-
|
|
47
|
+
trendTooltipHeader: { default: null },
|
|
48
|
+
trendTooltipRangeCurrent: { default: null },
|
|
49
|
+
trendTooltipRangePrevious: { default: null },
|
|
50
|
+
totalsChart: { type: Boolean, default: !1 },
|
|
51
|
+
colorsMap: { default: () => ({}) }
|
|
43
52
|
},
|
|
44
53
|
emits: ["update:chartType"],
|
|
45
|
-
setup(
|
|
46
|
-
const e =
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
})),
|
|
51
|
-
ie,
|
|
54
|
+
setup(a, { emit: K }) {
|
|
55
|
+
const e = a;
|
|
56
|
+
Q((t) => ({
|
|
57
|
+
"1232aefa": d(q),
|
|
58
|
+
"0162f236": a.height
|
|
59
|
+
})), O.register(
|
|
52
60
|
ne,
|
|
53
61
|
se,
|
|
54
|
-
ce,
|
|
55
62
|
de,
|
|
56
63
|
ue,
|
|
64
|
+
ce,
|
|
57
65
|
pe,
|
|
58
66
|
fe,
|
|
59
67
|
he,
|
|
60
68
|
me,
|
|
61
69
|
ve,
|
|
70
|
+
Te,
|
|
62
71
|
ye,
|
|
63
|
-
|
|
72
|
+
ge
|
|
64
73
|
);
|
|
65
|
-
const
|
|
74
|
+
const v = He(e, "chartType", K), U = o(
|
|
66
75
|
() => e.withAnimation ? "" : "none"
|
|
67
|
-
),
|
|
68
|
-
let
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
},
|
|
72
|
-
|
|
76
|
+
), u = g(null);
|
|
77
|
+
let s = null;
|
|
78
|
+
const x = o(() => e.dataSets.length === 0), k = o(() => !e.loading && !x.value), T = () => {
|
|
79
|
+
u.value && (s && s.destroy(), s = new O(u.value, A.value));
|
|
80
|
+
}, $ = () => {
|
|
81
|
+
s && (s.data.datasets = E.value, s.options = A.value.options, s.update(U.value));
|
|
73
82
|
};
|
|
74
|
-
|
|
75
|
-
t && (await
|
|
76
|
-
}),
|
|
77
|
-
const
|
|
78
|
-
() => e.chartType ===
|
|
79
|
-
),
|
|
80
|
-
() => e.chartType ===
|
|
81
|
-
),
|
|
83
|
+
X(T), C(() => e.chartType, T), C(k, async (t) => {
|
|
84
|
+
t && (await _(), T());
|
|
85
|
+
}), C([() => e.visibleIds, () => e.dataSets], $);
|
|
86
|
+
const c = o(() => e.totalsChart), p = o(
|
|
87
|
+
() => e.chartType === n.StackedLine || e.chartType === n.StackedBar || c.value
|
|
88
|
+
), S = o(
|
|
89
|
+
() => e.chartType === n.Line || e.chartType === n.StackedLine
|
|
90
|
+
), L = o(() => c.value ? { ...e.parsing, xAxisKey: I } : e.parsing), G = o(() => c.value ? e.dataSets.map((t) => ({
|
|
82
91
|
...t,
|
|
83
92
|
data: t.data.map((r) => ({
|
|
84
93
|
...r,
|
|
85
|
-
[
|
|
94
|
+
[I]: t.label
|
|
86
95
|
}))
|
|
87
|
-
})) : e.dataSets),
|
|
88
|
-
() =>
|
|
89
|
-
),
|
|
90
|
-
|
|
96
|
+
})) : e.dataSets), f = o(
|
|
97
|
+
() => G.value.filter((t) => e.visibleIds.includes(t.id))
|
|
98
|
+
), W = (t) => e.colorsMap[t] || Ve, R = o(
|
|
99
|
+
() => f.value.length && f.value.every(
|
|
100
|
+
(t) => t.data.length === 1
|
|
101
|
+
)
|
|
102
|
+
), E = o(() => f.value.map((t, r) => {
|
|
103
|
+
const i = W(t.id), y = p.value ? r !== 0 ? "-1" : "start" : void 0;
|
|
91
104
|
return {
|
|
92
105
|
...t,
|
|
93
|
-
fill:
|
|
106
|
+
fill: y,
|
|
94
107
|
backgroundColor: Ee(
|
|
95
|
-
|
|
96
|
-
e.chartType ===
|
|
108
|
+
i,
|
|
109
|
+
e.chartType === n.StackedLine ? 10 : 70
|
|
97
110
|
),
|
|
98
|
-
borderColor:
|
|
99
|
-
pointBackgroundColor:
|
|
100
|
-
pointHoverBorderColor:
|
|
111
|
+
borderColor: i,
|
|
112
|
+
pointBackgroundColor: i,
|
|
113
|
+
pointHoverBorderColor: i,
|
|
101
114
|
maxBarThickness: 50,
|
|
102
115
|
clip: 5,
|
|
103
116
|
// draw a bit outside the chart area
|
|
104
117
|
icon: t.icon || null,
|
|
105
118
|
iconType: t.iconType || "branded"
|
|
106
119
|
};
|
|
107
|
-
})),
|
|
108
|
-
() =>
|
|
109
|
-
|
|
110
|
-
)
|
|
111
|
-
), A = a(
|
|
120
|
+
})), Z = o(
|
|
121
|
+
() => e.tooltipTotalType === z.Total ? "Total" : "Mean"
|
|
122
|
+
), A = o(
|
|
112
123
|
() => ({
|
|
113
|
-
type: e.chartType ==
|
|
124
|
+
type: e.chartType == n.Bar || e.chartType === n.StackedBar ? "bar" : "line",
|
|
114
125
|
// Chart Data
|
|
115
126
|
data: {
|
|
116
127
|
datasets: E.value
|
|
117
128
|
},
|
|
118
129
|
// Chart Options
|
|
119
130
|
options: {
|
|
120
|
-
parsing:
|
|
131
|
+
parsing: L.value,
|
|
121
132
|
interaction: {
|
|
122
133
|
intersect: !1,
|
|
123
|
-
mode:
|
|
134
|
+
mode: c.value ? "point" : "index",
|
|
124
135
|
axis: "x"
|
|
125
136
|
},
|
|
126
137
|
// plugins
|
|
127
138
|
plugins: {
|
|
128
139
|
legend: { display: !1 },
|
|
129
140
|
title: { display: !1 },
|
|
130
|
-
hoverVerticalLine:
|
|
141
|
+
hoverVerticalLine: S.value,
|
|
131
142
|
// tooltip
|
|
132
143
|
tooltip: {
|
|
133
144
|
enabled: !1,
|
|
@@ -137,8 +148,11 @@ const Ie = {
|
|
|
137
148
|
},
|
|
138
149
|
callbacks: {
|
|
139
150
|
footer: (t) => {
|
|
140
|
-
const r = t.
|
|
141
|
-
|
|
151
|
+
const r = t.map((y) => y.parsed.y || 0), i = e.tooltipTotalCalcFn(
|
|
152
|
+
r,
|
|
153
|
+
e.tooltipTotalType
|
|
154
|
+
);
|
|
155
|
+
return [Z.value, String(i)];
|
|
142
156
|
}
|
|
143
157
|
}
|
|
144
158
|
}
|
|
@@ -160,12 +174,12 @@ const Ie = {
|
|
|
160
174
|
tension: 0.3
|
|
161
175
|
},
|
|
162
176
|
point: {
|
|
163
|
-
radius:
|
|
177
|
+
radius: R.value ? 3 : 1,
|
|
164
178
|
hitRadius: 8,
|
|
165
179
|
borderWidth: 0,
|
|
166
180
|
hoverRadius: 4,
|
|
167
181
|
hoverBorderWidth: 2,
|
|
168
|
-
pointHoverBackgroundColor:
|
|
182
|
+
pointHoverBackgroundColor: xe
|
|
169
183
|
},
|
|
170
184
|
bar: {
|
|
171
185
|
borderRadius: 4
|
|
@@ -175,17 +189,17 @@ const Ie = {
|
|
|
175
189
|
// Horizontal Axis (X)
|
|
176
190
|
x: {
|
|
177
191
|
beginAtZero: !0,
|
|
178
|
-
offset: !
|
|
192
|
+
offset: !S.value || R.value,
|
|
179
193
|
border: { display: !1 },
|
|
180
|
-
stacked:
|
|
194
|
+
stacked: p.value,
|
|
181
195
|
// stack on top of each other
|
|
182
196
|
// ticks
|
|
183
197
|
ticks: {
|
|
184
|
-
color:
|
|
198
|
+
color: P,
|
|
185
199
|
font: N,
|
|
186
200
|
padding: 4,
|
|
187
201
|
callback: function(t) {
|
|
188
|
-
return
|
|
202
|
+
return F(
|
|
189
203
|
this.getLabelForValue(t),
|
|
190
204
|
e.xAxisFormat
|
|
191
205
|
);
|
|
@@ -205,17 +219,17 @@ const Ie = {
|
|
|
205
219
|
beginAtZero: !0,
|
|
206
220
|
border: { display: !1 },
|
|
207
221
|
// hide left borderline
|
|
208
|
-
stacked:
|
|
222
|
+
stacked: p.value,
|
|
209
223
|
// stack on top of each other
|
|
210
224
|
// ticks
|
|
211
225
|
ticks: {
|
|
212
|
-
color:
|
|
226
|
+
color: P,
|
|
213
227
|
font: N,
|
|
214
228
|
padding: 8,
|
|
215
229
|
stepSize: D.value,
|
|
216
|
-
min:
|
|
230
|
+
min: w.value,
|
|
217
231
|
max: D.value * e.tickCount,
|
|
218
|
-
callback: (t) =>
|
|
232
|
+
callback: (t) => F(t, e.yAxisFormat)
|
|
219
233
|
},
|
|
220
234
|
// grid lines
|
|
221
235
|
grid: {
|
|
@@ -227,80 +241,85 @@ const Ie = {
|
|
|
227
241
|
}
|
|
228
242
|
}
|
|
229
243
|
})
|
|
230
|
-
),
|
|
231
|
-
|
|
232
|
-
|
|
244
|
+
), B = g(null), l = g(null), { position: H } = Le(
|
|
245
|
+
u,
|
|
246
|
+
B,
|
|
233
247
|
l,
|
|
234
248
|
e.tooltipRespectsTopEdge
|
|
235
|
-
),
|
|
236
|
-
left: `${
|
|
237
|
-
top: `${
|
|
249
|
+
), Y = o(() => ({
|
|
250
|
+
left: `${H.value.left}px`,
|
|
251
|
+
top: `${H.value.top}px`,
|
|
238
252
|
opacity: l.value?.opacity || 0
|
|
239
|
-
})), { minValue:
|
|
240
|
-
parsingConfig:
|
|
241
|
-
dataSets:
|
|
242
|
-
isStacked:
|
|
243
|
-
}), D =
|
|
244
|
-
() =>
|
|
245
|
-
),
|
|
246
|
-
() => (e.compactHeader ?
|
|
253
|
+
})), { minValue: w, maxValue: j } = Ae({
|
|
254
|
+
parsingConfig: L.value,
|
|
255
|
+
dataSets: f,
|
|
256
|
+
isStacked: p
|
|
257
|
+
}), D = o(
|
|
258
|
+
() => Ce(w.value, j.value, e.tickCount)
|
|
259
|
+
), q = o(
|
|
260
|
+
() => (e.compactHeader ? Se : ke) + "px"
|
|
247
261
|
);
|
|
248
|
-
return (t, r) =>
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
"chart-type":
|
|
252
|
-
"onUpdate:chart-type": r[0] || (r[0] = (
|
|
253
|
-
"type-switcher":
|
|
254
|
-
header:
|
|
255
|
-
subheader:
|
|
256
|
-
|
|
257
|
-
"
|
|
258
|
-
"trend-
|
|
259
|
-
|
|
262
|
+
return (t, r) => d(k) ? (h(), ee("section", Fe, [
|
|
263
|
+
m("div", Ie, [
|
|
264
|
+
te(Be, {
|
|
265
|
+
"chart-type": d(v),
|
|
266
|
+
"onUpdate:chart-type": r[0] || (r[0] = (i) => ae(v) ? v.value = i : null),
|
|
267
|
+
"type-switcher": a.typeSwitcher,
|
|
268
|
+
header: a.header,
|
|
269
|
+
subheader: a.subheader,
|
|
270
|
+
"subheader-tooltip-header": a.subheaderTooltipHeader,
|
|
271
|
+
"subheader-tooltip-text": a.subheaderTooltipText,
|
|
272
|
+
"trend-tooltip-header": a.trendTooltipHeader,
|
|
273
|
+
"trend-tooltip-range-current": a.trendTooltipRangeCurrent,
|
|
274
|
+
"trend-tooltip-range-previous": a.trendTooltipRangePrevious,
|
|
275
|
+
compact: a.compactHeader,
|
|
276
|
+
"trend-value": a.trendValue,
|
|
277
|
+
"trend-direction": a.trendDirection
|
|
278
|
+
}, oe({ _: 2 }, [
|
|
260
279
|
t.$slots["subheader-tooltip"] ? {
|
|
261
280
|
name: "subheader-tooltip",
|
|
262
|
-
fn:
|
|
281
|
+
fn: le(() => [
|
|
263
282
|
re(t.$slots, "subheader-tooltip", {}, void 0, !0)
|
|
264
283
|
]),
|
|
265
284
|
key: "0"
|
|
266
285
|
} : void 0
|
|
267
|
-
]), 1032, ["chart-type", "type-switcher", "header", "subheader", "compact", "trend-value", "trend-direction"])
|
|
286
|
+
]), 1032, ["chart-type", "type-switcher", "header", "subheader", "subheader-tooltip-header", "subheader-tooltip-text", "trend-tooltip-header", "trend-tooltip-range-current", "trend-tooltip-range-previous", "compact", "trend-value", "trend-direction"])
|
|
268
287
|
]),
|
|
269
|
-
|
|
270
|
-
|
|
288
|
+
m("div", Pe, [
|
|
289
|
+
m("canvas", {
|
|
271
290
|
ref_key: "chartRef",
|
|
272
|
-
ref:
|
|
291
|
+
ref: u,
|
|
273
292
|
class: "chart__canvas"
|
|
274
293
|
}, null, 512),
|
|
275
|
-
|
|
294
|
+
m("div", {
|
|
276
295
|
ref_key: "tooltipRef",
|
|
277
|
-
ref:
|
|
296
|
+
ref: B,
|
|
278
297
|
class: "chart__tooltip",
|
|
279
|
-
style:
|
|
298
|
+
style: ie(d(Y))
|
|
280
299
|
}, [
|
|
281
|
-
l.value ? (
|
|
300
|
+
l.value ? (h(), b(Re, {
|
|
282
301
|
key: 0,
|
|
283
302
|
title: String(l.value.title),
|
|
284
303
|
"data-points": l.value.dataPoints,
|
|
285
|
-
"x-axis-format":
|
|
286
|
-
"y-axis-format":
|
|
304
|
+
"x-axis-format": a.xAxisFormat,
|
|
305
|
+
"y-axis-format": a.yAxisFormat,
|
|
287
306
|
"total-label": l.value.footer[0],
|
|
288
307
|
"total-value": Number(l.value.footer[1])
|
|
289
|
-
}, null, 8, ["title", "data-points", "x-axis-format", "y-axis-format", "total-label", "total-value"])) :
|
|
308
|
+
}, null, 8, ["title", "data-points", "x-axis-format", "y-axis-format", "total-label", "total-value"])) : V("", !0)
|
|
290
309
|
], 4)
|
|
291
310
|
])
|
|
292
|
-
])) :
|
|
311
|
+
])) : a.loading ? (h(), b(De, {
|
|
293
312
|
key: 1,
|
|
294
313
|
class: "chart-loading"
|
|
295
|
-
})) :
|
|
314
|
+
})) : d(x) ? (h(), b(d(we), {
|
|
296
315
|
key: 2,
|
|
297
316
|
class: "chart-empty",
|
|
298
|
-
title:
|
|
299
|
-
subtitle:
|
|
300
|
-
"icon-name":
|
|
301
|
-
}, null, 8, ["title", "subtitle", "icon-name"])) :
|
|
317
|
+
title: a.noDataTitle,
|
|
318
|
+
subtitle: a.noDataSubtitle,
|
|
319
|
+
"icon-name": a.noDataIcon
|
|
320
|
+
}, null, 8, ["title", "subtitle", "icon-name"])) : V("", !0);
|
|
302
321
|
}
|
|
303
322
|
});
|
|
304
323
|
export {
|
|
305
|
-
|
|
324
|
+
et as default
|
|
306
325
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
+
selected: unknown;
|
|
3
|
+
options: unknown[];
|
|
4
|
+
optionNameKey: string;
|
|
5
|
+
}>, {
|
|
6
|
+
options: () => any[];
|
|
7
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
"update:selected": (option: unknown) => void;
|
|
9
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
10
|
+
selected: unknown;
|
|
11
|
+
options: unknown[];
|
|
12
|
+
optionNameKey: string;
|
|
13
|
+
}>, {
|
|
14
|
+
options: () => any[];
|
|
15
|
+
}>>> & {
|
|
16
|
+
"onUpdate:selected"?: (option: unknown) => any;
|
|
17
|
+
}, {
|
|
18
|
+
options: unknown[];
|
|
19
|
+
}>;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
22
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
23
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
24
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
25
|
+
} : {
|
|
26
|
+
type: import('vue').PropType<T[K]>;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
type __VLS_WithDefaults<P, D> = {
|
|
31
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
32
|
+
default: D[K];
|
|
33
|
+
}> : P[K];
|
|
34
|
+
};
|
|
35
|
+
type __VLS_Prettify<T> = {
|
|
36
|
+
[K in keyof T]: T[K];
|
|
37
|
+
} & {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineComponent as l, openBlock as m, createElementBlock as s, createVNode as r, unref as n, isRef as d, withCtx as a, mergeProps as c } from "vue";
|
|
2
|
+
import u from "../dropdown/v4/DropdownV4.vue.js";
|
|
3
|
+
import "../dropdown/v4/DefaultDropdownTrigger.vue.js";
|
|
4
|
+
import f from "../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/v4/ConditionalDropdown.vue.js";
|
|
12
|
+
import { useVModel as g } from "@vueuse/core";
|
|
13
|
+
const y = { class: "legend-sorting" }, L = /* @__PURE__ */ l({
|
|
14
|
+
__name: "LegendSorting",
|
|
15
|
+
props: {
|
|
16
|
+
selected: null,
|
|
17
|
+
options: { default: () => [] },
|
|
18
|
+
optionNameKey: null
|
|
19
|
+
},
|
|
20
|
+
emits: ["update:selected"],
|
|
21
|
+
setup(o, { emit: p }) {
|
|
22
|
+
const t = g(o, "selected", p);
|
|
23
|
+
return (v, i) => (m(), s("div", y, [
|
|
24
|
+
r(n(u), {
|
|
25
|
+
selected: n(t),
|
|
26
|
+
"onUpdate:selected": i[0] || (i[0] = (e) => d(t) ? t.value = e : null),
|
|
27
|
+
"display-value": (e) => e[o.optionNameKey],
|
|
28
|
+
options: o.options,
|
|
29
|
+
"option-name-key": o.optionNameKey,
|
|
30
|
+
placement: "bottom-end"
|
|
31
|
+
}, {
|
|
32
|
+
"dropdown-trigger": a(({ buttonTriggerProps: e }) => [
|
|
33
|
+
r(n(f), c(e, {
|
|
34
|
+
"icon-name": "funnel-simple",
|
|
35
|
+
"icon-type": "regular"
|
|
36
|
+
}), null, 16)
|
|
37
|
+
]),
|
|
38
|
+
_: 1
|
|
39
|
+
}, 8, ["selected", "display-value", "options", "option-name-key"])
|
|
40
|
+
]));
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
export {
|
|
44
|
+
L as default
|
|
45
|
+
};
|