@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.
Files changed (63) hide show
  1. package/ButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_0123c361_lang.css +1 -0
  2. package/Chart.vue_vue_type_style_index_0_scoped_757e7752_lang.css +1 -0
  3. package/ChartHeader.vue_vue_type_style_index_0_scoped_92052479_lang.css +1 -0
  4. package/ChartHeaderTrend.vue_vue_type_style_index_0_scoped_d61ed404_lang.css +1 -0
  5. package/ChartLegend.vue_vue_type_style_index_0_scoped_da487aba_lang.css +1 -0
  6. package/ChartPlane.vue_vue_type_style_index_0_scoped_bb382dc4_lang.css +1 -0
  7. package/DataGrid.vue_vue_type_style_index_0_scoped_86ea5d2a_lang.css +1 -0
  8. package/IconButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_99e51ecc_lang.css +1 -0
  9. package/SettingsHeader.vue_vue_type_style_index_0_scoped_fba2eaa4_lang.css +1 -0
  10. package/components/chart/Chart.vue.d.ts +56 -2
  11. package/components/chart/Chart.vue.js +4 -4
  12. package/components/chart/Chart.vue2.js +93 -60
  13. package/components/chart/ChartHeader.vue.d.ts +25 -0
  14. package/components/chart/ChartHeader.vue.js +2 -2
  15. package/components/chart/ChartHeader.vue2.js +75 -50
  16. package/components/chart/ChartHeaderTrend.vue.d.ts +15 -0
  17. package/components/chart/ChartHeaderTrend.vue.js +3 -3
  18. package/components/chart/ChartHeaderTrend.vue2.js +83 -19
  19. package/components/chart/ChartLegend.vue.d.ts +17 -0
  20. package/components/chart/ChartLegend.vue.js +3 -3
  21. package/components/chart/ChartLegend.vue2.js +78 -67
  22. package/components/chart/ChartPlane.vue.d.ts +43 -4
  23. package/components/chart/ChartPlane.vue.js +3 -3
  24. package/components/chart/ChartPlane.vue2.js +137 -118
  25. package/components/chart/LegendSorting.vue.d.ts +37 -0
  26. package/components/chart/LegendSorting.vue.js +45 -0
  27. package/components/chart/LegendSorting.vue2.js +4 -0
  28. package/components/chart/SettingsHeader.vue.d.ts +1 -0
  29. package/components/chart/SettingsHeader.vue.js +3 -3
  30. package/components/chart/SettingsHeader.vue2.js +17 -16
  31. package/components/chart/colorPalette.d.ts +4 -0
  32. package/components/chart/colorPalette.js +54 -0
  33. package/components/chart/composables/useColorsMap.d.ts +2 -2
  34. package/components/chart/composables/useColorsMap.js +41 -12
  35. package/components/chart/consts.d.ts +12 -1
  36. package/components/chart/consts.js +31 -26
  37. package/components/chart/index.d.ts +237 -40
  38. package/components/chart/mockData.d.ts +8 -14
  39. package/components/chart/types.d.ts +2 -1
  40. package/components/dropdown/v4/ButtonDropdownTrigger.vue.js +2 -2
  41. package/components/dropdown/v4/ButtonDropdownTrigger.vue2.js +1 -1
  42. package/components/dropdown/v4/IconButtonDropdownTrigger.vue.d.ts +11 -0
  43. package/components/dropdown/v4/IconButtonDropdownTrigger.vue.js +4 -4
  44. package/components/dropdown/v4/IconButtonDropdownTrigger.vue2.js +12 -10
  45. package/components/dropdown/v4/index.d.ts +18 -0
  46. package/components/table/v4/DataGrid.vue.js +3 -3
  47. package/components/table/v4/DataGrid.vue2.js +35 -35
  48. package/index.d.ts +37 -1
  49. package/index.js +1 -1
  50. package/package.json +1 -1
  51. package/utils/formatNumbers.d.ts +1 -1
  52. package/utils/formatNumbers.js +14 -14
  53. package/utils/totals.d.ts +5 -0
  54. package/utils/totals.js +9 -0
  55. package/ButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_604dfc6f_lang.css +0 -1
  56. package/Chart.vue_vue_type_style_index_0_scoped_78d3f5a8_lang.css +0 -1
  57. package/ChartHeader.vue_vue_type_style_index_0_scoped_32001725_lang.css +0 -1
  58. package/ChartHeaderTrend.vue_vue_type_style_index_0_scoped_e4c673e7_lang.css +0 -1
  59. package/ChartLegend.vue_vue_type_style_index_0_scoped_532f23bc_lang.css +0 -1
  60. package/ChartPlane.vue_vue_type_style_index_0_scoped_4396faf6_lang.css +0 -1
  61. package/DataGrid.vue_vue_type_style_index_0_scoped_6b54ac22_lang.css +0 -1
  62. package/IconButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_59fb505a_lang.css +0 -1
  63. package/SettingsHeader.vue_vue_type_style_index_0_scoped_9b6cd9d9_lang.css +0 -1
@@ -1,53 +1,86 @@
1
- import "../../ChartHeader.vue_vue_type_style_index_0_scoped_32001725_lang.css"; import { defineComponent as b, computed as k, openBlock as r, createElementBlock as C, normalizeClass as w, createElementVNode as i, createVNode as n, unref as a, withCtx as d, renderSlot as B, createTextVNode as m, toDisplayString as f, createBlock as c, createCommentVNode as u, isRef as S } from "vue";
2
- import p from "../typography/v4/Typography.vue.js";
3
- import g from "../switch/v4/SwitchV4.vue.js";
4
- import { ChartType as l } from "./types.js";
5
- import x from "../tooltip/v4/TooltipV4.vue.js";
6
- import y from "./ChartHeaderTrend.vue.js";
7
- const D = { class: "header-texts" }, N = { class: "header-row" }, L = { class: "header-row" }, U = /* @__PURE__ */ b({
1
+ import "../../ChartHeader.vue_vue_type_style_index_0_scoped_92052479_lang.css"; import { defineComponent as S, useSlots as R, computed as m, openBlock as r, createElementBlock as w, normalizeClass as B, createElementVNode as i, createVNode as f, unref as t, withCtx as o, renderSlot as P, createBlock as d, createTextVNode as u, toDisplayString as c, createCommentVNode as n, normalizeProps as v, mergeProps as g, isRef as N } from "vue";
2
+ import s from "../typography/v4/Typography.vue.js";
3
+ import D from "../switch/v4/SwitchV4.vue.js";
4
+ import { ChartType as h } from "./types.js";
5
+ import L from "../tooltip/v4/TooltipV4.vue.js";
6
+ import V from "./ChartHeaderTrend.vue.js";
7
+ const z = { class: "header-texts" }, E = { class: "header-row" }, O = { class: "subheader-tooltip" }, U = { class: "header-row" }, I = /* @__PURE__ */ S({
8
8
  __name: "ChartHeader",
9
9
  props: {
10
- chartType: { default: l.Line },
10
+ chartType: { default: h.Line },
11
11
  typeSwitcher: { type: Boolean, default: !0 },
12
12
  header: { default: "" },
13
13
  subheader: { default: "" },
14
+ subheaderTooltipHeader: { default: null },
15
+ subheaderTooltipText: { default: null },
16
+ trendTooltipHeader: { default: null },
17
+ trendTooltipRangeCurrent: { default: null },
18
+ trendTooltipRangePrevious: { default: null },
14
19
  compact: { type: Boolean, default: !1 },
15
20
  trendValue: { default: null },
16
21
  trendDirection: { default: "up" }
17
22
  },
18
23
  emits: ["update:chartType"],
19
- setup(e, { emit: v }) {
20
- const V = e, h = [
21
- { id: l.Line, icon: "chart-line-up" },
22
- { id: l.Bar, icon: "chart-bar" },
23
- { id: l.StackedLine, icon: "chart-line" }
24
- ], o = k({
24
+ setup(e, { emit: x }) {
25
+ const a = e, C = R(), T = [
26
+ { id: h.Line, icon: "chart-line-up" },
27
+ { id: h.Bar, icon: "chart-bar" },
28
+ { id: h.StackedLine, icon: "chart-line" }
29
+ ], p = m({
25
30
  get() {
26
- return h.find(({ id: t }) => t === V.chartType);
31
+ return T.find(({ id: l }) => l === a.chartType);
27
32
  },
28
- set(t) {
29
- v("update:chartType", t.id);
33
+ set(l) {
34
+ x("update:chartType", l.id);
30
35
  }
31
- });
32
- return (t, s) => (r(), C("div", {
33
- class: w(["chart-header", { "chart-header--compact": e.compact }])
36
+ }), k = m(() => C["subheader-tooltip"] || a.subheaderTooltipText || a.subheaderTooltipHeader), b = m(() => ({
37
+ value: a.trendValue,
38
+ direction: a.trendDirection,
39
+ tooltipHeader: a.trendTooltipHeader,
40
+ tooltipRangeCurrent: a.trendTooltipRangeCurrent,
41
+ tooltipRangePrevious: a.trendTooltipRangePrevious
42
+ }));
43
+ return (l, y) => (r(), w("div", {
44
+ class: B(["chart-header", { "chart-header--compact": e.compact }])
34
45
  }, [
35
- i("div", D, [
36
- i("div", N, [
37
- n(a(x), {
46
+ i("div", z, [
47
+ i("div", E, [
48
+ f(t(L), {
38
49
  placement: "right",
39
- disabled: !t.$slots["subheader-tooltip"]
50
+ disabled: !t(k)
40
51
  }, {
41
- tooltip: d(() => [
42
- B(t.$slots, "subheader-tooltip", {}, void 0, !0)
52
+ tooltip: o(() => [
53
+ P(l.$slots, "subheader-tooltip", {}, () => [
54
+ i("div", O, [
55
+ e.subheaderTooltipHeader ? (r(), d(t(s), {
56
+ key: 0,
57
+ variant: "h5"
58
+ }, {
59
+ default: o(() => [
60
+ u(c(e.subheaderTooltipHeader), 1)
61
+ ]),
62
+ _: 1
63
+ })) : n("", !0),
64
+ e.subheaderTooltipText ? (r(), d(t(s), {
65
+ key: 1,
66
+ variant: "body2",
67
+ class: "subheader-tooltip__text"
68
+ }, {
69
+ default: o(() => [
70
+ u(c(e.subheaderTooltipText), 1)
71
+ ]),
72
+ _: 1
73
+ })) : n("", !0)
74
+ ])
75
+ ], !0)
43
76
  ]),
44
- default: d(() => [
45
- n(a(p), {
77
+ default: o(() => [
78
+ f(t(s), {
46
79
  class: "subheader",
47
80
  variant: "h5"
48
81
  }, {
49
- default: d(() => [
50
- m(f(e.subheader + (e.compact ? ":" : "")), 1)
82
+ default: o(() => [
83
+ u(c(e.subheader + (e.compact ? ":" : "")), 1)
51
84
  ]),
52
85
  _: 1
53
86
  })
@@ -55,37 +88,29 @@ const D = { class: "header-texts" }, N = { class: "header-row" }, L = { class: "
55
88
  _: 3
56
89
  }, 8, ["disabled"])
57
90
  ]),
58
- i("div", L, [
59
- n(a(p), {
91
+ i("div", U, [
92
+ f(t(s), {
60
93
  class: "header-text",
61
94
  variant: e.compact ? "h5" : "chart2"
62
95
  }, {
63
- default: d(() => [
64
- m(f(e.header), 1)
96
+ default: o(() => [
97
+ u(c(e.header), 1)
65
98
  ]),
66
99
  _: 1
67
100
  }, 8, ["variant"]),
68
- !e.compact && e.trendValue !== null ? (r(), c(y, {
69
- key: 0,
70
- value: e.trendValue,
71
- direction: e.trendDirection
72
- }, null, 8, ["value", "direction"])) : u("", !0)
101
+ !e.compact && e.trendValue !== null ? (r(), d(V, v(g({ key: 0 }, t(b))), null, 16)) : n("", !0)
73
102
  ]),
74
- e.compact && e.trendValue !== null ? (r(), c(y, {
75
- key: 0,
76
- value: e.trendValue,
77
- direction: e.trendDirection
78
- }, null, 8, ["value", "direction"])) : u("", !0)
103
+ e.compact && e.trendValue !== null ? (r(), d(V, v(g({ key: 0 }, t(b))), null, 16)) : n("", !0)
79
104
  ]),
80
- e.typeSwitcher ? (r(), c(a(g), {
105
+ e.typeSwitcher ? (r(), d(t(D), {
81
106
  key: 0,
82
- modelValue: a(o),
83
- "onUpdate:modelValue": s[0] || (s[0] = (T) => S(o) ? o.value = T : null),
84
- options: h
85
- }, null, 8, ["modelValue"])) : u("", !0)
107
+ modelValue: t(p),
108
+ "onUpdate:modelValue": y[0] || (y[0] = (H) => N(p) ? p.value = H : null),
109
+ options: T
110
+ }, null, 8, ["modelValue"])) : n("", !0)
86
111
  ], 2));
87
112
  }
88
113
  });
89
114
  export {
90
- U as default
115
+ I as default
91
116
  };
@@ -1,18 +1,33 @@
1
1
  declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
2
2
  value?: number | string;
3
3
  direction?: 'up' | 'down';
4
+ tooltipHeader?: string;
5
+ tooltipRangeCurrent?: string;
6
+ tooltipRangePrevious?: string;
4
7
  }>, {
5
8
  value: any;
6
9
  direction: string;
10
+ tooltipHeader: any;
11
+ tooltipRangeCurrent: any;
12
+ tooltipRangePrevious: any;
7
13
  }>, {}, 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<{
8
14
  value?: number | string;
9
15
  direction?: 'up' | 'down';
16
+ tooltipHeader?: string;
17
+ tooltipRangeCurrent?: string;
18
+ tooltipRangePrevious?: string;
10
19
  }>, {
11
20
  value: any;
12
21
  direction: string;
22
+ tooltipHeader: any;
23
+ tooltipRangeCurrent: any;
24
+ tooltipRangePrevious: any;
13
25
  }>>>, {
14
26
  value: number | string;
15
27
  direction: 'up' | 'down';
28
+ tooltipHeader: string;
29
+ tooltipRangeCurrent: string;
30
+ tooltipRangePrevious: string;
16
31
  }>;
17
32
  export default _default;
18
33
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -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_e4c673e7_lang.css"; //*');
4
- const s = /* @__PURE__ */ o(e, [["__scopeId", "data-v-e4c673e7"]]);
3
+ // import "../../ChartHeaderTrend.vue_vue_type_style_index_0_scoped_d61ed404_lang.css"; //*');
4
+ const t = /* @__PURE__ */ o(e, [["__scopeId", "data-v-d61ed404"]]);
5
5
  export {
6
- s as default
6
+ t as default
7
7
  };
@@ -1,32 +1,96 @@
1
- import "../../ChartHeaderTrend.vue_vue_type_style_index_0_scoped_e4c673e7_lang.css"; import { defineComponent as a, openBlock as n, createElementBlock as o, normalizeClass as i, createVNode as t, unref as r, withCtx as c, createTextVNode as l, toDisplayString as d } from "vue";
2
- import m from "../typography/v4/Typography.vue.js";
3
- import p from "../icon/v4/IconV4.vue.js";
1
+ import "../../ChartHeaderTrend.vue_vue_type_style_index_0_scoped_d61ed404_lang.css"; import { defineComponent as h, computed as v, openBlock as a, createElementBlock as p, normalizeClass as g, createVNode as n, unref as e, withCtx as o, createElementVNode as s, createBlock as c, createTextVNode as l, toDisplayString as i, createCommentVNode as d, pushScopeId as y, popScopeId as C } from "vue";
2
+ import r from "../typography/v4/Typography.vue.js";
3
+ import R from "../icon/v4/IconV4.vue.js";
4
4
  import "../icon/v4/IconFlag.vue.js";
5
- const y = /* @__PURE__ */ a({
5
+ import x from "../tooltip/v4/TooltipV4.vue.js";
6
+ const m = (t) => (y("data-v-d61ed404"), t = t(), C(), t), b = { class: "trend-tooltip" }, k = {
7
+ key: 2,
8
+ class: "separator"
9
+ }, _ = /* @__PURE__ */ m(() => /* @__PURE__ */ s("hr", null, null, -1)), H = /* @__PURE__ */ m(() => /* @__PURE__ */ s("hr", null, null, -1)), B = /* @__PURE__ */ h({
6
10
  __name: "ChartHeaderTrend",
7
11
  props: {
8
12
  value: { default: null },
9
- direction: { default: "up" }
13
+ direction: { default: "up" },
14
+ tooltipHeader: { default: null },
15
+ tooltipRangeCurrent: { default: null },
16
+ tooltipRangePrevious: { default: null }
10
17
  },
11
- setup(e) {
12
- return (u, s) => (n(), o("div", {
13
- class: i(["chart-trend", [`chart-trend--${e.direction}`]])
18
+ setup(t) {
19
+ const u = t, f = v(
20
+ () => u.tooltipHeader || u.tooltipRangeCurrent || u.tooltipRangePrevious
21
+ );
22
+ return (P, T) => (a(), p("div", {
23
+ class: g(["chart-trend", [`chart-trend--${t.direction}`]])
14
24
  }, [
15
- t(r(p), {
16
- class: "trend-icon",
17
- type: "bold",
18
- name: `arrow-${e.direction}`,
19
- size: "13px"
20
- }, null, 8, ["name"]),
21
- t(r(m), { variant: "chipLabel" }, {
22
- default: c(() => [
23
- l(d(e.value), 1)
25
+ n(e(x), {
26
+ disabled: !e(f)
27
+ }, {
28
+ tooltip: o(() => [
29
+ s("div", b, [
30
+ t.tooltipHeader ? (a(), c(e(r), {
31
+ key: 0,
32
+ class: "trend-tooltip__header",
33
+ variant: "subtitle2"
34
+ }, {
35
+ default: o(() => [
36
+ l(i(t.tooltipHeader), 1)
37
+ ]),
38
+ _: 1
39
+ })) : d("", !0),
40
+ t.tooltipRangeCurrent ? (a(), c(e(r), {
41
+ key: 1,
42
+ variant: "body2",
43
+ class: "trend-tooltip__text"
44
+ }, {
45
+ default: o(() => [
46
+ l(i(t.tooltipRangeCurrent), 1)
47
+ ]),
48
+ _: 1
49
+ })) : d("", !0),
50
+ t.tooltipRangeCurrent && t.tooltipRangePrevious ? (a(), p("div", k, [
51
+ _,
52
+ n(e(r), {
53
+ class: "separator__text",
54
+ variant: "caption"
55
+ }, {
56
+ default: o(() => [
57
+ l(" vs. ")
58
+ ]),
59
+ _: 1
60
+ }),
61
+ H
62
+ ])) : d("", !0),
63
+ t.tooltipRangePrevious ? (a(), c(e(r), {
64
+ key: 3,
65
+ variant: "body2",
66
+ class: "trend-tooltip__text"
67
+ }, {
68
+ default: o(() => [
69
+ l(i(t.tooltipRangePrevious), 1)
70
+ ]),
71
+ _: 1
72
+ })) : d("", !0)
73
+ ])
74
+ ]),
75
+ default: o(() => [
76
+ n(e(R), {
77
+ class: "trend-icon",
78
+ type: "bold",
79
+ name: `arrow-${t.direction}`,
80
+ size: "13px"
81
+ }, null, 8, ["name"]),
82
+ n(e(r), { variant: "chipLabel" }, {
83
+ default: o(() => [
84
+ l(i(t.value), 1)
85
+ ]),
86
+ _: 1
87
+ })
24
88
  ]),
25
89
  _: 1
26
- })
90
+ }, 8, ["disabled"])
27
91
  ], 2));
28
92
  }
29
93
  });
30
94
  export {
31
- y as default
95
+ B as default
32
96
  };
@@ -5,34 +5,51 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
5
5
  minVisible?: number;
6
6
  maxVisible?: number;
7
7
  maxLimitTooltipText?: string;
8
+ sortSelected?: unknown;
9
+ sortOptions?: unknown[];
10
+ sortOptionNameKey?: string;
8
11
  }>, {
9
12
  items: () => any[];
10
13
  visibleIds: () => any[];
11
14
  minVisible: number;
12
15
  maxVisible: number;
13
16
  maxLimitTooltipText: string;
17
+ sortSelected: any;
18
+ sortOptions: () => any[];
19
+ sortOptionNameKey: string;
14
20
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
21
  "update:visibleIds": (visibleIds: unknown[]) => void;
22
+ "update:sortSelected": (sortOption: unknown) => void;
16
23
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
17
24
  items: LegendItem[];
18
25
  visibleIds: unknown[];
19
26
  minVisible?: number;
20
27
  maxVisible?: number;
21
28
  maxLimitTooltipText?: string;
29
+ sortSelected?: unknown;
30
+ sortOptions?: unknown[];
31
+ sortOptionNameKey?: string;
22
32
  }>, {
23
33
  items: () => any[];
24
34
  visibleIds: () => any[];
25
35
  minVisible: number;
26
36
  maxVisible: number;
27
37
  maxLimitTooltipText: string;
38
+ sortSelected: any;
39
+ sortOptions: () => any[];
40
+ sortOptionNameKey: string;
28
41
  }>>> & {
29
42
  "onUpdate:visibleIds"?: (visibleIds: unknown[]) => any;
43
+ "onUpdate:sortSelected"?: (sortOption: unknown) => any;
30
44
  }, {
31
45
  items: LegendItem[];
32
46
  visibleIds: unknown[];
33
47
  minVisible: number;
34
48
  maxVisible: number;
35
49
  maxLimitTooltipText: string;
50
+ sortSelected: any;
51
+ sortOptions: unknown[];
52
+ sortOptionNameKey: string;
36
53
  }>;
37
54
  export default _default;
38
55
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -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_532f23bc_lang.css"; //*');
4
- const c = /* @__PURE__ */ o(e, [["__scopeId", "data-v-532f23bc"]]);
3
+ // import "../../ChartLegend.vue_vue_type_style_index_0_scoped_da487aba_lang.css"; //*');
4
+ const s = /* @__PURE__ */ o(e, [["__scopeId", "data-v-da487aba"]]);
5
5
  export {
6
- c as default
6
+ s as default
7
7
  };
@@ -1,124 +1,135 @@
1
- import "../../ChartLegend.vue_vue_type_style_index_0_scoped_532f23bc_lang.css"; import { defineComponent as S, ref as P, computed as m, openBlock as s, createElementBlock as c, createElementVNode as r, createVNode as d, unref as o, mergeProps as I, withCtx as p, createTextVNode as b, Fragment as A, renderList as F, normalizeClass as H, withModifiers as U, createBlock as k, createCommentVNode as L, toDisplayString as g } from "vue";
2
- import { useVirtualList as z } from "@vueuse/core";
3
- import f from "../typography/v4/Typography.vue.js";
4
- import R from "../checkbox/v4/CheckboxV4.vue.js";
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";
3
+ import k from "../typography/v4/Typography.vue.js";
4
+ import $ from "../checkbox/v4/CheckboxV4.vue.js";
5
5
  import q from "../search/v4/SearchV4.vue.js";
6
6
  import { DEFAULT_MIN_VISIBLE as G, DEFAULT_MAX_VISIBLE as X } from "./consts.js";
7
- import $ from "../icon/v4/IconV4.vue.js";
7
+ import j from "../icon/v4/IconV4.vue.js";
8
8
  import "../icon/v4/IconFlag.vue.js";
9
- import j from "../tooltip/v4/TooltipV4.vue.js";
10
- const J = { class: "chart-legend" }, K = { class: "search-box" }, O = {
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 = {
11
12
  key: 0,
12
13
  class: "empty-list"
13
- }, Q = ["onClick"], W = { class: "label-container" }, ne = /* @__PURE__ */ S({
14
+ }, ee = ["onClick"], te = { class: "label-container" }, ue = /* @__PURE__ */ O({
14
15
  __name: "ChartLegend",
15
16
  props: {
16
17
  items: { default: () => [] },
17
18
  visibleIds: { default: () => [] },
18
19
  minVisible: { default: G },
19
20
  maxVisible: { default: X },
20
- maxLimitTooltipText: { default: "" }
21
+ maxLimitTooltipText: { default: "" },
22
+ sortSelected: { default: null },
23
+ sortOptions: { default: () => [] },
24
+ sortOptionNameKey: { default: "" }
21
25
  },
22
- emits: ["update:visibleIds"],
23
- setup(h, { emit: T }) {
24
- const l = h, y = 32, u = P(""), C = m(() => {
25
- const t = u.value.toLowerCase();
26
- return l.items.filter(
27
- (i) => i.label.toLowerCase().includes(t)
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(() => {
29
+ const t = f.value.toLowerCase();
30
+ return i.items.filter(
31
+ (l) => l.label.toLowerCase().includes(t)
28
32
  );
29
- }), a = (t) => l.visibleIds.includes(t.id), v = m(
30
- () => l.visibleIds.length >= l.maxVisible
31
- ), V = m(
32
- () => l.visibleIds.length <= l.minVisible
33
- ), n = (t) => V.value && a(t) || v.value && !a(t), w = (t) => !l.maxLimitTooltipText || a(t) || !v.value, E = (t, i) => {
34
- T(
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(
35
39
  "update:visibleIds",
36
- t ? [...l.visibleIds, i.id] : l.visibleIds.filter((e) => e !== i.id)
40
+ t ? [...i.visibleIds, l.id] : i.visibleIds.filter((e) => e !== l.id)
37
41
  );
38
- }, { list: x, containerProps: N, wrapperProps: B } = z(C, {
39
- itemHeight: y,
42
+ }, { list: g, containerProps: N, wrapperProps: M } = K(C, {
43
+ itemHeight: V,
40
44
  overscan: 10
41
- }), D = (t) => {
42
- n(t) || E(!a(t), t);
45
+ }), B = (t) => {
46
+ r(t) || E(!n(t), t);
43
47
  };
44
- return (t, i) => (s(), c("div", J, [
45
- r("div", K, [
46
- d(o(q), {
47
- modelValue: u.value,
48
- "onUpdate:modelValue": i[0] || (i[0] = (e) => u.value = e)
49
- }, null, 8, ["modelValue"])
48
+ return (t, l) => (s(), p("div", W, [
49
+ d("div", Y, [
50
+ c(o(q), {
51
+ modelValue: f.value,
52
+ "onUpdate:modelValue": l[0] || (l[0] = (e) => f.value = e)
53
+ }, null, 8, ["modelValue"]),
54
+ a.sortOptions?.length > 0 ? (s(), v(Q, {
55
+ key: 0,
56
+ selected: o(m),
57
+ "onUpdate:selected": l[1] || (l[1] = (e) => U(m) ? m.value = e : null),
58
+ options: a.sortOptions,
59
+ "option-name-key": a.sortOptionNameKey
60
+ }, null, 8, ["selected", "options", "option-name-key"])) : h("", !0)
50
61
  ]),
51
- r("div", I({ class: "legend" }, o(N)), [
52
- r("ul", I({ class: "legend__list" }, o(B)), [
53
- o(x).length === 0 ? (s(), c("li", O, [
54
- d(o(f), { variant: "body2" }, {
55
- default: p(() => [
56
- b("No results")
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, [
65
+ c(o(k), { variant: "body2" }, {
66
+ default: u(() => [
67
+ x("No results")
57
68
  ]),
58
69
  _: 1
59
70
  })
60
- ])) : (s(!0), c(A, { key: 1 }, F(o(x), ({ data: e, index: M }) => (s(), c("li", {
61
- key: M,
62
- class: H({ "disabled-item": n(e) })
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) })
63
74
  }, [
64
- d(o(j), {
65
- text: h.maxLimitTooltipText,
66
- disabled: w(e),
75
+ c(o(J), {
76
+ text: a.maxLimitTooltipText,
77
+ disabled: S(e),
67
78
  class: "disabled-tooltip"
68
79
  }, {
69
- default: p(() => [
70
- r("div", {
80
+ default: u(() => [
81
+ d("div", {
71
82
  class: "item-wrapper",
72
- onClick: (_) => D(e)
83
+ onClick: (L) => B(e)
73
84
  }, [
74
- d(o(R), {
85
+ c(o($), {
75
86
  color: e.color,
76
- "is-checked": a(e),
77
- disabled: n(e),
78
- onClick: i[1] || (i[1] = U(
79
- (_) => {
80
- _.stopPropagation();
87
+ "is-checked": n(e),
88
+ disabled: r(e),
89
+ onClick: l[2] || (l[2] = R(
90
+ (L) => {
91
+ L.stopPropagation();
81
92
  },
82
93
  ["stop"]
83
94
  ))
84
95
  }, null, 8, ["color", "is-checked", "disabled"]),
85
- e.icon ? (s(), k(o($), {
96
+ e.icon ? (s(), v(o(j), {
86
97
  key: 0,
87
98
  class: "icon-color",
88
99
  type: e.iconType,
89
100
  name: e.icon,
90
101
  size: "16px"
91
- }, null, 8, ["type", "name"])) : L("", !0),
92
- r("div", W, [
93
- d(o(f), {
102
+ }, null, 8, ["type", "name"])) : h("", !0),
103
+ d("div", te, [
104
+ c(o(k), {
94
105
  variant: "body2",
95
106
  class: "legend-label",
96
107
  "is-truncated": "",
97
- "with-tooltip": !n(e),
108
+ "with-tooltip": !r(e),
98
109
  "tooltip-text": e.label,
99
110
  "tooltip-placement": "left"
100
111
  }, {
101
- default: p(() => [
102
- b(g(e.label), 1)
112
+ default: u(() => [
113
+ x(_(e.label), 1)
103
114
  ]),
104
115
  _: 2
105
116
  }, 1032, ["with-tooltip", "tooltip-text"]),
106
- e.caption ? (s(), k(o(f), {
117
+ e.caption ? (s(), v(o(k), {
107
118
  key: 0,
108
119
  variant: "caption",
109
120
  class: "legend-caption legend-label",
110
121
  "is-truncated": "",
111
- "with-tooltip": !n(e),
122
+ "with-tooltip": !r(e),
112
123
  "tooltip-text": e.caption,
113
124
  "tooltip-placement": "left"
114
125
  }, {
115
- default: p(() => [
116
- b(g(e.caption), 1)
126
+ default: u(() => [
127
+ x(_(e.caption), 1)
117
128
  ]),
118
129
  _: 2
119
- }, 1032, ["with-tooltip", "tooltip-text"])) : L("", !0)
130
+ }, 1032, ["with-tooltip", "tooltip-text"])) : h("", !0)
120
131
  ])
121
- ], 8, Q)
132
+ ], 8, ee)
122
133
  ]),
123
134
  _: 2
124
135
  }, 1032, ["text", "disabled"])
@@ -129,5 +140,5 @@ const J = { class: "chart-legend" }, K = { class: "search-box" }, O = {
129
140
  }
130
141
  });
131
142
  export {
132
- ne as default
143
+ ue as default
133
144
  };