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