@ironsource/shared-ui 2.1.12-test.61 → 2.1.12-test.63
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_82f5b24e_lang.css +1 -0
- package/ChartHeader.vue_vue_type_style_index_0_scoped_bd4ef110_lang.css +1 -0
- package/ChartHeaderTrend.vue_vue_type_style_index_0_scoped_78a8c051_lang.css +1 -0
- package/ChartLegend.vue_vue_type_style_index_0_scoped_fd9e4ea2_lang.css +1 -0
- package/ChartPlane.vue_vue_type_style_index_0_scoped_10b18e17_lang.css +1 -0
- package/ChartTooltip.vue_vue_type_style_index_0_scoped_81cdfd5e_lang.css +1 -0
- package/SubHeader.vue_vue_type_style_index_0_scoped_74a5418e_lang.css +1 -0
- package/TooltipHeader.vue_vue_type_style_index_0_scoped_40d98a66_lang.css +1 -0
- package/components/chart/Chart.vue.d.ts +23 -8
- package/components/chart/Chart.vue.js +4 -4
- package/components/chart/Chart.vue2.js +99 -90
- package/components/chart/ChartHeader.vue.d.ts +7 -7
- package/components/chart/ChartHeader.vue.js +3 -3
- package/components/chart/ChartHeader.vue2.js +48 -79
- package/components/chart/ChartHeaderTrend.vue.d.ts +6 -5
- package/components/chart/ChartHeaderTrend.vue.js +3 -3
- package/components/chart/ChartHeaderTrend.vue2.js +15 -14
- package/components/chart/ChartLegend.vue.d.ts +7 -0
- package/components/chart/ChartLegend.vue.js +3 -3
- package/components/chart/ChartLegend.vue2.js +75 -68
- package/components/chart/ChartPlane.vue.d.ts +29 -9
- package/components/chart/ChartPlane.vue.js +3 -3
- package/components/chart/ChartPlane.vue2.js +290 -252
- package/components/chart/ChartStoryArgs.d.ts +27 -2
- package/components/chart/ChartTooltip.vue.d.ts +6 -1
- package/components/chart/ChartTooltip.vue.js +2 -2
- package/components/chart/ChartTooltip.vue2.js +48 -58
- package/components/chart/components/SubHeader.vue.d.ts +52 -0
- package/components/chart/components/SubHeader.vue.js +7 -0
- package/components/chart/components/SubHeader.vue2.js +61 -0
- package/components/chart/components/TooltipHeader.vue.d.ts +45 -0
- package/components/chart/components/TooltipHeader.vue.js +7 -0
- package/components/chart/components/TooltipHeader.vue2.js +59 -0
- package/components/chart/consts.d.ts +12 -6
- package/components/chart/consts.js +31 -21
- package/components/chart/index.d.ts +120 -62
- package/components/chart/mockData.d.ts +11 -0
- package/components/chart/types.d.ts +25 -5
- package/components/chart/types.js +4 -2
- package/components/chart/utils/highlightUtils.d.ts +3 -0
- package/components/chart/utils/highlightUtils.js +18 -0
- package/components/chart/utils/utils.d.ts +2 -1
- package/components/chart/utils/utils.js +23 -8
- package/composables/useFormValidation.d.ts +1 -1
- package/consts/common.d.ts +1 -0
- package/consts/common.js +4 -0
- package/consts/regex.d.ts +1 -0
- package/consts/regex.js +2 -1
- package/index.js +11 -7
- package/package.json +1 -1
- package/utils/text.d.ts +3 -0
- package/utils/text.js +24 -5
- package/utils/utils.d.ts +1 -0
- package/utils/utils.js +4 -0
- package/Chart.vue_vue_type_style_index_0_scoped_de950ffe_lang.css +0 -1
- package/ChartHeader.vue_vue_type_style_index_0_scoped_1ff0e54f_lang.css +0 -1
- package/ChartHeaderTrend.vue_vue_type_style_index_0_scoped_21ce0774_lang.css +0 -1
- package/ChartLegend.vue_vue_type_style_index_0_scoped_da487aba_lang.css +0 -1
- package/ChartPlane.vue_vue_type_style_index_0_scoped_ae87f435_lang.css +0 -1
- package/ChartTooltip.vue_vue_type_style_index_0_scoped_25d0e129_lang.css +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "../../ChartHeader.
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { ChartType as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
1
|
+
import "../../ChartHeader.vue_vue_type_style_index_0_scoped_bd4ef110_lang.css"; import { defineComponent as k, computed as h, openBlock as o, createElementBlock as S, normalizeClass as w, createElementVNode as m, createVNode as p, createSlots as C, withCtx as f, renderSlot as B, unref as a, createTextVNode as g, toDisplayString as x, createBlock as n, normalizeProps as y, mergeProps as T, createCommentVNode as i, isRef as D } from "vue";
|
|
2
|
+
import N from "../typography/v4/Typography.vue.js";
|
|
3
|
+
import P from "../switch/v4/SwitchV4.vue.js";
|
|
4
|
+
import { ChartType as d, TrendDirection as H } from "./types.js";
|
|
5
|
+
import b from "./ChartHeaderTrend.vue.js";
|
|
6
|
+
import L from "./components/SubHeader.vue.js";
|
|
7
|
+
const z = { class: "header-texts" }, E = { class: "header-row" }, A = /* @__PURE__ */ k({
|
|
8
8
|
__name: "ChartHeader",
|
|
9
9
|
props: {
|
|
10
|
-
chartType: { default:
|
|
10
|
+
chartType: { default: d.Line },
|
|
11
11
|
typeSwitcher: { type: Boolean, default: !0 },
|
|
12
12
|
header: { default: "" },
|
|
13
13
|
subheader: { default: "" },
|
|
@@ -15,97 +15,66 @@ const H = { class: "header-texts" }, O = { class: "header-row" }, R = { class: "
|
|
|
15
15
|
trendTooltip: { default: null },
|
|
16
16
|
compact: { type: Boolean, default: !1 },
|
|
17
17
|
trendValue: { default: null },
|
|
18
|
-
trendDirection: { default:
|
|
18
|
+
trendDirection: { default: H.UP }
|
|
19
19
|
},
|
|
20
20
|
emits: ["update:chartType"],
|
|
21
|
-
setup(e, { emit:
|
|
22
|
-
const
|
|
23
|
-
{ id:
|
|
24
|
-
{ id:
|
|
25
|
-
{ id:
|
|
26
|
-
],
|
|
21
|
+
setup(e, { emit: V }) {
|
|
22
|
+
const r = e, c = [
|
|
23
|
+
{ id: d.Line, icon: "chart-line-up" },
|
|
24
|
+
{ id: d.Bar, icon: "chart-bar" },
|
|
25
|
+
{ id: d.StackedLine, icon: "chart-line" }
|
|
26
|
+
], l = h({
|
|
27
27
|
get() {
|
|
28
|
-
return
|
|
28
|
+
return c.find(({ id: t }) => t === r.chartType);
|
|
29
29
|
},
|
|
30
|
-
set(
|
|
31
|
-
|
|
30
|
+
set(t) {
|
|
31
|
+
V("update:chartType", t.id);
|
|
32
32
|
}
|
|
33
|
-
}),
|
|
34
|
-
value:
|
|
35
|
-
direction:
|
|
36
|
-
trendTooltip:
|
|
33
|
+
}), u = h(() => ({
|
|
34
|
+
value: r.trendValue,
|
|
35
|
+
direction: r.trendDirection,
|
|
36
|
+
trendTooltip: r.trendTooltip
|
|
37
37
|
}));
|
|
38
|
-
return (
|
|
39
|
-
class:
|
|
38
|
+
return (t, s) => (o(), S("div", {
|
|
39
|
+
class: w(["chart-header", { "chart-header--compact": e.compact }])
|
|
40
40
|
}, [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
key: 0,
|
|
52
|
-
variant: "h5"
|
|
53
|
-
}, {
|
|
54
|
-
default: o(() => [
|
|
55
|
-
u(c(e.subheaderTooltip.header), 1)
|
|
56
|
-
]),
|
|
57
|
-
_: 1
|
|
58
|
-
})) : i("", !0),
|
|
59
|
-
e.subheaderTooltip?.text ? (r(), d(t(s), {
|
|
60
|
-
key: 1,
|
|
61
|
-
variant: "body2",
|
|
62
|
-
class: "subheader-tooltip__text"
|
|
63
|
-
}, {
|
|
64
|
-
default: o(() => [
|
|
65
|
-
u(c(e.subheaderTooltip.text), 1)
|
|
66
|
-
]),
|
|
67
|
-
_: 1
|
|
68
|
-
})) : i("", !0)
|
|
69
|
-
])
|
|
70
|
-
], !0)
|
|
71
|
-
]),
|
|
72
|
-
default: o(() => [
|
|
73
|
-
f(t(s), {
|
|
74
|
-
class: "subheader",
|
|
75
|
-
variant: "h5"
|
|
76
|
-
}, {
|
|
77
|
-
default: o(() => [
|
|
78
|
-
u(c(e.subheader + (e.compact ? ":" : "")), 1)
|
|
79
|
-
]),
|
|
80
|
-
_: 1
|
|
81
|
-
})
|
|
41
|
+
m("div", z, [
|
|
42
|
+
p(L, {
|
|
43
|
+
subheader: e.subheader,
|
|
44
|
+
"subheader-tooltip": e.subheaderTooltip,
|
|
45
|
+
"show-separator": e.compact && (!!e.header || !!e.trendValue)
|
|
46
|
+
}, C({ _: 2 }, [
|
|
47
|
+
t.$slots["subheader-tooltip"] ? {
|
|
48
|
+
name: "subheader-tooltip",
|
|
49
|
+
fn: f(() => [
|
|
50
|
+
B(t.$slots, "subheader-tooltip", {}, void 0, !0)
|
|
82
51
|
]),
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
]),
|
|
86
|
-
|
|
87
|
-
|
|
52
|
+
key: "0"
|
|
53
|
+
} : void 0
|
|
54
|
+
]), 1032, ["subheader", "subheader-tooltip", "show-separator"]),
|
|
55
|
+
m("div", E, [
|
|
56
|
+
p(a(N), {
|
|
88
57
|
class: "header-text",
|
|
89
58
|
variant: e.compact ? "h5" : "chart2"
|
|
90
59
|
}, {
|
|
91
|
-
default:
|
|
92
|
-
|
|
60
|
+
default: f(() => [
|
|
61
|
+
g(x(e.header), 1)
|
|
93
62
|
]),
|
|
94
63
|
_: 1
|
|
95
64
|
}, 8, ["variant"]),
|
|
96
|
-
!e.compact && e.trendValue !== null ? (
|
|
65
|
+
!e.compact && e.trendValue !== null ? (o(), n(b, y(T({ key: 0 }, a(u))), null, 16)) : i("", !0)
|
|
97
66
|
]),
|
|
98
|
-
e.compact && e.trendValue !== null ? (
|
|
67
|
+
e.compact && e.trendValue !== null ? (o(), n(b, y(T({ key: 0 }, a(u))), null, 16)) : i("", !0)
|
|
99
68
|
]),
|
|
100
|
-
e.typeSwitcher ? (
|
|
69
|
+
e.typeSwitcher ? (o(), n(a(P), {
|
|
101
70
|
key: 0,
|
|
102
|
-
modelValue:
|
|
103
|
-
"onUpdate:modelValue":
|
|
104
|
-
options:
|
|
71
|
+
modelValue: a(l),
|
|
72
|
+
"onUpdate:modelValue": s[0] || (s[0] = (v) => D(l) ? l.value = v : null),
|
|
73
|
+
options: c
|
|
105
74
|
}, null, 8, ["modelValue"])) : i("", !0)
|
|
106
75
|
], 2));
|
|
107
76
|
}
|
|
108
77
|
});
|
|
109
78
|
export {
|
|
110
|
-
|
|
79
|
+
A as default
|
|
111
80
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { TrendDirection } from '@is-ssp/chart/types';
|
|
1
2
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
2
3
|
value?: number | string;
|
|
3
|
-
direction?:
|
|
4
|
+
direction?: TrendDirection;
|
|
4
5
|
trendTooltip?: {
|
|
5
6
|
header?: string;
|
|
6
7
|
rangeCurrent?: string;
|
|
@@ -8,11 +9,11 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
8
9
|
};
|
|
9
10
|
}>, {
|
|
10
11
|
value: any;
|
|
11
|
-
direction:
|
|
12
|
+
direction: TrendDirection;
|
|
12
13
|
trendTooltip: any;
|
|
13
14
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
14
15
|
value?: number | string;
|
|
15
|
-
direction?:
|
|
16
|
+
direction?: TrendDirection;
|
|
16
17
|
trendTooltip?: {
|
|
17
18
|
header?: string;
|
|
18
19
|
rangeCurrent?: string;
|
|
@@ -20,11 +21,11 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
20
21
|
};
|
|
21
22
|
}>, {
|
|
22
23
|
value: any;
|
|
23
|
-
direction:
|
|
24
|
+
direction: TrendDirection;
|
|
24
25
|
trendTooltip: any;
|
|
25
26
|
}>>>, {
|
|
26
27
|
value: number | string;
|
|
27
|
-
direction:
|
|
28
|
+
direction: TrendDirection;
|
|
28
29
|
trendTooltip: any;
|
|
29
30
|
}>;
|
|
30
31
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "./ChartHeaderTrend.vue2.js";
|
|
2
2
|
/* empty css */import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
-
// import "../../ChartHeaderTrend.
|
|
4
|
-
const
|
|
3
|
+
// import "../../ChartHeaderTrend.vue_vue_type_style_index_0_scoped_78a8c051_lang.css"; //*');
|
|
4
|
+
const a = /* @__PURE__ */ o(e, [["__scopeId", "data-v-78a8c051"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import "../../ChartHeaderTrend.
|
|
1
|
+
import "../../ChartHeaderTrend.vue_vue_type_style_index_0_scoped_78a8c051_lang.css"; import { defineComponent as f, computed as T, openBlock as r, createElementBlock as p, normalizeClass as v, createVNode as l, unref as t, withCtx as o, createElementVNode as u, createBlock as s, createTextVNode as a, toDisplayString as d, createCommentVNode as i, pushScopeId as g, popScopeId as y } from "vue";
|
|
2
2
|
import n from "../typography/v4/Typography.vue.js";
|
|
3
3
|
import C from "../icon/v4/IconV4.vue.js";
|
|
4
4
|
import "../icon/v4/IconFlag.vue.js";
|
|
5
5
|
import x from "../tooltip/v4/TooltipV4.vue.js";
|
|
6
|
-
|
|
6
|
+
import { TrendDirection as b } from "./types.js";
|
|
7
|
+
const m = (e) => (g("data-v-78a8c051"), e = e(), y(), e), k = { class: "trend-tooltip" }, _ = {
|
|
7
8
|
key: 2,
|
|
8
9
|
class: "separator"
|
|
9
|
-
},
|
|
10
|
+
}, P = /* @__PURE__ */ m(() => /* @__PURE__ */ u("hr", null, null, -1)), I = /* @__PURE__ */ m(() => /* @__PURE__ */ u("hr", null, null, -1)), $ = /* @__PURE__ */ f({
|
|
10
11
|
__name: "ChartHeaderTrend",
|
|
11
12
|
props: {
|
|
12
13
|
value: { default: null },
|
|
13
|
-
direction: { default:
|
|
14
|
+
direction: { default: b.UP },
|
|
14
15
|
trendTooltip: { default: null }
|
|
15
16
|
},
|
|
16
17
|
setup(e) {
|
|
17
|
-
const c = e,
|
|
18
|
+
const c = e, h = T(
|
|
18
19
|
() => c.trendTooltip?.header || c.trendTooltip?.rangeCurrent || c.trendTooltip?.rangePrevious
|
|
19
20
|
);
|
|
20
|
-
return (N,
|
|
21
|
+
return (N, S) => (r(), p("div", {
|
|
21
22
|
class: v(["chart-trend", [`chart-trend--${e.direction}`]])
|
|
22
23
|
}, [
|
|
23
24
|
l(t(x), {
|
|
24
|
-
disabled: !t(
|
|
25
|
+
disabled: !t(h)
|
|
25
26
|
}, {
|
|
26
27
|
tooltip: o(() => [
|
|
27
|
-
|
|
28
|
-
e.trendTooltip?.header ? (r(),
|
|
28
|
+
u("div", k, [
|
|
29
|
+
e.trendTooltip?.header ? (r(), s(t(n), {
|
|
29
30
|
key: 0,
|
|
30
31
|
class: "trend-tooltip__header",
|
|
31
32
|
variant: "subtitle2"
|
|
@@ -35,7 +36,7 @@ const h = (e) => (g("data-v-21ce0774"), e = e(), y(), e), b = { class: "trend-to
|
|
|
35
36
|
]),
|
|
36
37
|
_: 1
|
|
37
38
|
})) : i("", !0),
|
|
38
|
-
e.trendTooltip?.rangeCurrent ? (r(),
|
|
39
|
+
e.trendTooltip?.rangeCurrent ? (r(), s(t(n), {
|
|
39
40
|
key: 1,
|
|
40
41
|
variant: "body2",
|
|
41
42
|
class: "trend-tooltip__text"
|
|
@@ -45,8 +46,8 @@ const h = (e) => (g("data-v-21ce0774"), e = e(), y(), e), b = { class: "trend-to
|
|
|
45
46
|
]),
|
|
46
47
|
_: 1
|
|
47
48
|
})) : i("", !0),
|
|
48
|
-
e.trendTooltip?.rangeCurrent && e.trendTooltip?.rangePrevious ? (r(), p("div",
|
|
49
|
-
|
|
49
|
+
e.trendTooltip?.rangeCurrent && e.trendTooltip?.rangePrevious ? (r(), p("div", _, [
|
|
50
|
+
P,
|
|
50
51
|
l(t(n), {
|
|
51
52
|
class: "separator__text",
|
|
52
53
|
variant: "caption"
|
|
@@ -58,7 +59,7 @@ const h = (e) => (g("data-v-21ce0774"), e = e(), y(), e), b = { class: "trend-to
|
|
|
58
59
|
}),
|
|
59
60
|
I
|
|
60
61
|
])) : i("", !0),
|
|
61
|
-
e.trendTooltip?.rangePrevious ? (r(),
|
|
62
|
+
e.trendTooltip?.rangePrevious ? (r(), s(t(n), {
|
|
62
63
|
key: 3,
|
|
63
64
|
variant: "body2",
|
|
64
65
|
class: "trend-tooltip__text"
|
|
@@ -90,5 +91,5 @@ const h = (e) => (g("data-v-21ce0774"), e = e(), y(), e), b = { class: "trend-to
|
|
|
90
91
|
}
|
|
91
92
|
});
|
|
92
93
|
export {
|
|
93
|
-
|
|
94
|
+
$ as default
|
|
94
95
|
};
|
|
@@ -2,6 +2,7 @@ import { LegendItem } from '@/components/chart/types';
|
|
|
2
2
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
3
|
items: LegendItem[];
|
|
4
4
|
visibleIds: unknown[];
|
|
5
|
+
highlightedId?: string | number;
|
|
5
6
|
minVisible?: number;
|
|
6
7
|
maxVisible?: number;
|
|
7
8
|
maxLimitTooltipText?: string;
|
|
@@ -11,6 +12,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
11
12
|
}>, {
|
|
12
13
|
items: () => any[];
|
|
13
14
|
visibleIds: () => any[];
|
|
15
|
+
highlightedId: any;
|
|
14
16
|
minVisible: number;
|
|
15
17
|
maxVisible: number;
|
|
16
18
|
maxLimitTooltipText: string;
|
|
@@ -20,9 +22,11 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
20
22
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
21
23
|
"update:visibleIds": (visibleIds: unknown[]) => void;
|
|
22
24
|
"update:sortSelected": (sortOption: unknown) => void;
|
|
25
|
+
"update:highlightedId": (id: string | number) => void;
|
|
23
26
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
24
27
|
items: LegendItem[];
|
|
25
28
|
visibleIds: unknown[];
|
|
29
|
+
highlightedId?: string | number;
|
|
26
30
|
minVisible?: number;
|
|
27
31
|
maxVisible?: number;
|
|
28
32
|
maxLimitTooltipText?: string;
|
|
@@ -32,6 +36,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
32
36
|
}>, {
|
|
33
37
|
items: () => any[];
|
|
34
38
|
visibleIds: () => any[];
|
|
39
|
+
highlightedId: any;
|
|
35
40
|
minVisible: number;
|
|
36
41
|
maxVisible: number;
|
|
37
42
|
maxLimitTooltipText: string;
|
|
@@ -41,9 +46,11 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
41
46
|
}>>> & {
|
|
42
47
|
"onUpdate:visibleIds"?: (visibleIds: unknown[]) => any;
|
|
43
48
|
"onUpdate:sortSelected"?: (sortOption: unknown) => any;
|
|
49
|
+
"onUpdate:highlightedId"?: (id: string | number) => any;
|
|
44
50
|
}, {
|
|
45
51
|
items: LegendItem[];
|
|
46
52
|
visibleIds: unknown[];
|
|
53
|
+
highlightedId: string | number;
|
|
47
54
|
minVisible: number;
|
|
48
55
|
maxVisible: number;
|
|
49
56
|
maxLimitTooltipText: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "./ChartLegend.vue2.js";
|
|
2
2
|
/* empty css */import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
-
// import "../../ChartLegend.
|
|
4
|
-
const
|
|
3
|
+
// import "../../ChartLegend.vue_vue_type_style_index_0_scoped_fd9e4ea2_lang.css"; //*');
|
|
4
|
+
const a = /* @__PURE__ */ o(e, [["__scopeId", "data-v-fd9e4ea2"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,144 +1,151 @@
|
|
|
1
|
-
import "../../ChartLegend.
|
|
2
|
-
import { useVModel as
|
|
1
|
+
import "../../ChartLegend.vue_vue_type_style_index_0_scoped_fd9e4ea2_lang.css"; import { defineComponent as F, ref as H, computed as v, openBlock as s, createElementBlock as u, createElementVNode as r, createVNode as c, unref as o, createBlock as g, isRef as R, createCommentVNode as x, mergeProps as T, withCtx as p, createTextVNode as I, Fragment as $, renderList as z, normalizeClass as K, withModifiers as q, toDisplayString as V } from "vue";
|
|
2
|
+
import { useVModel as C, useVirtualList as G } from "@vueuse/core";
|
|
3
3
|
import k from "../typography/v4/Typography.vue.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { DEFAULT_MIN_VISIBLE as
|
|
7
|
-
import
|
|
4
|
+
import X from "../checkbox/v4/CheckboxV4.vue.js";
|
|
5
|
+
import j from "../search/v4/SearchV4.vue.js";
|
|
6
|
+
import { DEFAULT_MIN_VISIBLE as J, DEFAULT_MAX_VISIBLE as Q } from "./consts.js";
|
|
7
|
+
import W from "../icon/v4/IconV4.vue.js";
|
|
8
8
|
import "../icon/v4/IconFlag.vue.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
const
|
|
9
|
+
import Y from "../tooltip/v4/TooltipV4.vue.js";
|
|
10
|
+
import Z from "./LegendSorting.vue.js";
|
|
11
|
+
const ee = { class: "chart-legend" }, te = { class: "search-box" }, oe = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "empty-list"
|
|
14
|
-
},
|
|
14
|
+
}, le = ["onMouseenter"], ie = ["onClick"], se = { class: "label-container" }, be = /* @__PURE__ */ F({
|
|
15
15
|
__name: "ChartLegend",
|
|
16
16
|
props: {
|
|
17
17
|
items: { default: () => [] },
|
|
18
18
|
visibleIds: { default: () => [] },
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
highlightedId: { default: null },
|
|
20
|
+
minVisible: { default: J },
|
|
21
|
+
maxVisible: { default: Q },
|
|
21
22
|
maxLimitTooltipText: { default: "" },
|
|
22
23
|
sortSelected: { default: null },
|
|
23
24
|
sortOptions: { default: () => [] },
|
|
24
25
|
sortOptionNameKey: { default: "" }
|
|
25
26
|
},
|
|
26
|
-
emits: ["update:visibleIds", "update:sortSelected"],
|
|
27
|
-
setup(a, { emit:
|
|
28
|
-
const
|
|
27
|
+
emits: ["update:visibleIds", "update:sortSelected", "update:highlightedId"],
|
|
28
|
+
setup(a, { emit: m }) {
|
|
29
|
+
const l = a, M = 32, h = C(l, "sortSelected", m), y = C(l, "highlightedId", m), w = (t) => {
|
|
30
|
+
y.value = n(t) ? t.id : null;
|
|
31
|
+
}, E = () => {
|
|
32
|
+
y.value = null;
|
|
33
|
+
}, f = H(""), S = v(() => {
|
|
29
34
|
const t = f.value.toLowerCase();
|
|
30
|
-
return
|
|
31
|
-
(
|
|
35
|
+
return l.items.filter(
|
|
36
|
+
(i) => i.label.toLowerCase().includes(t)
|
|
32
37
|
);
|
|
33
|
-
}), n = (t) =>
|
|
34
|
-
() =>
|
|
35
|
-
),
|
|
36
|
-
() =>
|
|
37
|
-
),
|
|
38
|
-
|
|
38
|
+
}), n = (t) => l.visibleIds.includes(t.id), L = v(
|
|
39
|
+
() => l.visibleIds.length >= l.maxVisible
|
|
40
|
+
), N = v(
|
|
41
|
+
() => l.visibleIds.length <= l.minVisible
|
|
42
|
+
), d = (t) => N.value && n(t) || L.value && !n(t), B = (t) => !l.maxLimitTooltipText || n(t) || !L.value, D = (t, i) => {
|
|
43
|
+
m(
|
|
39
44
|
"update:visibleIds",
|
|
40
|
-
t ? [...
|
|
45
|
+
t ? [...l.visibleIds, i.id] : l.visibleIds.filter((e) => e !== i.id)
|
|
41
46
|
);
|
|
42
|
-
}, { list:
|
|
43
|
-
itemHeight:
|
|
47
|
+
}, { list: _, containerProps: O, wrapperProps: P } = G(S, {
|
|
48
|
+
itemHeight: M,
|
|
44
49
|
overscan: 10
|
|
45
|
-
}),
|
|
46
|
-
|
|
50
|
+
}), U = (t) => {
|
|
51
|
+
d(t) || D(!n(t), t);
|
|
47
52
|
};
|
|
48
|
-
return (t,
|
|
49
|
-
|
|
50
|
-
c(o(
|
|
53
|
+
return (t, i) => (s(), u("div", ee, [
|
|
54
|
+
r("div", te, [
|
|
55
|
+
c(o(j), {
|
|
51
56
|
modelValue: f.value,
|
|
52
|
-
"onUpdate:modelValue":
|
|
57
|
+
"onUpdate:modelValue": i[0] || (i[0] = (e) => f.value = e)
|
|
53
58
|
}, null, 8, ["modelValue"]),
|
|
54
|
-
a.sortOptions?.length > 0 ? (s(),
|
|
59
|
+
a.sortOptions?.length > 0 ? (s(), g(Z, {
|
|
55
60
|
key: 0,
|
|
56
|
-
selected: o(
|
|
57
|
-
"onUpdate:selected":
|
|
61
|
+
selected: o(h),
|
|
62
|
+
"onUpdate:selected": i[1] || (i[1] = (e) => R(h) ? h.value = e : null),
|
|
58
63
|
options: a.sortOptions,
|
|
59
64
|
"option-name-key": a.sortOptionNameKey
|
|
60
|
-
}, null, 8, ["selected", "options", "option-name-key"])) :
|
|
65
|
+
}, null, 8, ["selected", "options", "option-name-key"])) : x("", !0)
|
|
61
66
|
]),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
o(
|
|
67
|
+
r("div", T({ class: "legend" }, o(O)), [
|
|
68
|
+
r("ul", T({ class: "legend__list" }, o(P)), [
|
|
69
|
+
o(_).length === 0 ? (s(), u("li", oe, [
|
|
65
70
|
c(o(k), { variant: "body2" }, {
|
|
66
|
-
default:
|
|
67
|
-
|
|
71
|
+
default: p(() => [
|
|
72
|
+
I("No results")
|
|
68
73
|
]),
|
|
69
74
|
_: 1
|
|
70
75
|
})
|
|
71
|
-
])) : (s(!0),
|
|
72
|
-
key:
|
|
73
|
-
class:
|
|
76
|
+
])) : (s(!0), u($, { key: 1 }, z(o(_), ({ data: e, index: A }) => (s(), u("li", {
|
|
77
|
+
key: A,
|
|
78
|
+
class: K({ "disabled-item": d(e) }),
|
|
79
|
+
onMouseenter: (b) => w(e),
|
|
80
|
+
onMouseleave: E
|
|
74
81
|
}, [
|
|
75
|
-
c(o(
|
|
82
|
+
c(o(Y), {
|
|
76
83
|
text: a.maxLimitTooltipText,
|
|
77
|
-
disabled:
|
|
84
|
+
disabled: B(e),
|
|
78
85
|
class: "disabled-tooltip"
|
|
79
86
|
}, {
|
|
80
|
-
default:
|
|
81
|
-
|
|
87
|
+
default: p(() => [
|
|
88
|
+
r("div", {
|
|
82
89
|
class: "item-wrapper",
|
|
83
|
-
onClick: (
|
|
90
|
+
onClick: (b) => U(e)
|
|
84
91
|
}, [
|
|
85
|
-
c(o(
|
|
92
|
+
c(o(X), {
|
|
86
93
|
color: e.color,
|
|
87
94
|
"is-checked": n(e),
|
|
88
|
-
disabled:
|
|
89
|
-
onClick:
|
|
90
|
-
(
|
|
91
|
-
|
|
95
|
+
disabled: d(e),
|
|
96
|
+
onClick: i[2] || (i[2] = q(
|
|
97
|
+
(b) => {
|
|
98
|
+
b.stopPropagation();
|
|
92
99
|
},
|
|
93
100
|
["stop"]
|
|
94
101
|
))
|
|
95
102
|
}, null, 8, ["color", "is-checked", "disabled"]),
|
|
96
|
-
e.icon ? (s(),
|
|
103
|
+
e.icon ? (s(), g(o(W), {
|
|
97
104
|
key: 0,
|
|
98
105
|
class: "icon-color",
|
|
99
106
|
type: e.iconType,
|
|
100
107
|
name: e.icon,
|
|
101
108
|
size: "16px"
|
|
102
|
-
}, null, 8, ["type", "name"])) :
|
|
103
|
-
|
|
109
|
+
}, null, 8, ["type", "name"])) : x("", !0),
|
|
110
|
+
r("div", se, [
|
|
104
111
|
c(o(k), {
|
|
105
112
|
variant: "body2",
|
|
106
113
|
class: "legend-label",
|
|
107
114
|
"is-truncated": "",
|
|
108
|
-
"with-tooltip": !
|
|
115
|
+
"with-tooltip": !d(e),
|
|
109
116
|
"tooltip-text": e.label,
|
|
110
117
|
"tooltip-placement": "left"
|
|
111
118
|
}, {
|
|
112
|
-
default:
|
|
113
|
-
|
|
119
|
+
default: p(() => [
|
|
120
|
+
I(V(e.label), 1)
|
|
114
121
|
]),
|
|
115
122
|
_: 2
|
|
116
123
|
}, 1032, ["with-tooltip", "tooltip-text"]),
|
|
117
|
-
e.caption ? (s(),
|
|
124
|
+
e.caption ? (s(), g(o(k), {
|
|
118
125
|
key: 0,
|
|
119
126
|
variant: "caption",
|
|
120
127
|
class: "legend-caption legend-label",
|
|
121
128
|
"is-truncated": "",
|
|
122
|
-
"with-tooltip": !
|
|
129
|
+
"with-tooltip": !d(e),
|
|
123
130
|
"tooltip-text": e.caption,
|
|
124
131
|
"tooltip-placement": "left"
|
|
125
132
|
}, {
|
|
126
|
-
default:
|
|
127
|
-
|
|
133
|
+
default: p(() => [
|
|
134
|
+
I(V(e.caption), 1)
|
|
128
135
|
]),
|
|
129
136
|
_: 2
|
|
130
|
-
}, 1032, ["with-tooltip", "tooltip-text"])) :
|
|
137
|
+
}, 1032, ["with-tooltip", "tooltip-text"])) : x("", !0)
|
|
131
138
|
])
|
|
132
|
-
], 8,
|
|
139
|
+
], 8, ie)
|
|
133
140
|
]),
|
|
134
141
|
_: 2
|
|
135
142
|
}, 1032, ["text", "disabled"])
|
|
136
|
-
],
|
|
143
|
+
], 42, le))), 128))
|
|
137
144
|
], 16)
|
|
138
145
|
], 16)
|
|
139
146
|
]));
|
|
140
147
|
}
|
|
141
148
|
});
|
|
142
149
|
export {
|
|
143
|
-
|
|
150
|
+
be as default
|
|
144
151
|
};
|