@ironsource/shared-ui 2.1.12-rc.11 → 2.1.12-rc.13

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 (42) hide show
  1. package/Chart.vue_vue_type_style_index_0_scoped_a0b89669_lang.css +1 -0
  2. package/ChartLegend.vue_vue_type_style_index_0_scoped_da487aba_lang.css +1 -0
  3. package/ChartPlane.vue_vue_type_style_index_0_scoped_0f3a67d5_lang.css +1 -0
  4. package/IconButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_99e51ecc_lang.css +1 -0
  5. package/SettingsHeader.vue_vue_type_style_index_0_scoped_0875167b_lang.css +1 -0
  6. package/components/chart/Chart.vue.d.ts +19 -2
  7. package/components/chart/Chart.vue.js +2 -2
  8. package/components/chart/Chart.vue2.js +69 -57
  9. package/components/chart/ChartLegend.vue.d.ts +17 -0
  10. package/components/chart/ChartLegend.vue.js +3 -3
  11. package/components/chart/ChartLegend.vue2.js +78 -67
  12. package/components/chart/ChartPlane.vue.d.ts +7 -2
  13. package/components/chart/ChartPlane.vue.js +2 -2
  14. package/components/chart/ChartPlane.vue2.js +128 -127
  15. package/components/chart/LegendSorting.vue.d.ts +37 -0
  16. package/components/chart/LegendSorting.vue.js +45 -0
  17. package/components/chart/LegendSorting.vue2.js +4 -0
  18. package/components/chart/SettingsHeader.vue.js +3 -3
  19. package/components/chart/SettingsHeader.vue2.js +1 -1
  20. package/components/chart/colorPalette.d.ts +4 -0
  21. package/components/chart/colorPalette.js +54 -0
  22. package/components/chart/composables/useColorsMap.d.ts +2 -2
  23. package/components/chart/composables/useColorsMap.js +41 -12
  24. package/components/chart/consts.d.ts +12 -1
  25. package/components/chart/consts.js +31 -26
  26. package/components/chart/index.d.ts +103 -40
  27. package/components/chart/mockData.d.ts +8 -14
  28. package/components/chart/types.d.ts +2 -1
  29. package/components/dropdown/v4/IconButtonDropdownTrigger.vue.d.ts +11 -0
  30. package/components/dropdown/v4/IconButtonDropdownTrigger.vue.js +4 -4
  31. package/components/dropdown/v4/IconButtonDropdownTrigger.vue2.js +12 -10
  32. package/components/dropdown/v4/index.d.ts +18 -0
  33. package/index.d.ts +37 -1
  34. package/index.js +1 -1
  35. package/package.json +1 -1
  36. package/utils/formatNumbers.d.ts +1 -1
  37. package/utils/formatNumbers.js +14 -14
  38. package/Chart.vue_vue_type_style_index_0_scoped_78d3f5a8_lang.css +0 -1
  39. package/ChartLegend.vue_vue_type_style_index_0_scoped_532f23bc_lang.css +0 -1
  40. package/ChartPlane.vue_vue_type_style_index_0_scoped_4396faf6_lang.css +0 -1
  41. package/IconButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_59fb505a_lang.css +0 -1
  42. package/SettingsHeader.vue_vue_type_style_index_0_scoped_9b6cd9d9_lang.css +0 -1
@@ -0,0 +1 @@
1
+ .chart-container[data-v-a0b89669]{border:1px solid var(--common-divider);background:var(--background-paper);display:flex;border-radius:0 0 6px 6px;width:100%}.chart-planes[data-v-a0b89669]{width:100%;height:100%;overflow-y:auto}.chart-planes.with-legend[data-v-a0b89669]{width:calc(100% - 221px)}.chart-planes .extra-chart-plane[data-v-a0b89669]{border-top:1px solid var(--common-divider)}.chart-sidebar[data-v-a0b89669]{border-left:1px solid var(--common-divider)}
@@ -0,0 +1 @@
1
+ .disabled-tooltip[data-v-da487aba],.disabled-tooltip[data-v-da487aba] .container{width:100%}.chart-legend[data-v-da487aba]{display:flex;flex-direction:column;width:240px;height:100%;padding:0 8px 8px 12px}.search-box[data-v-da487aba]{padding:12px 0 4px;display:flex;align-items:center;gap:4px}.legend[data-v-da487aba]{overflow-y:auto;color:var(--text-primary);height:100%;overflow-x:hidden}.legend__list[data-v-da487aba]{list-style:none;padding:0}.legend__list>li[data-v-da487aba]{display:flex;align-items:center;gap:8px;padding:6px 8px}.legend__list>li[data-v-da487aba]:hover{background-color:var(--action-hover);border-radius:8px;cursor:pointer}.legend__list>li.disabled-item[data-v-da487aba]{cursor:not-allowed!important;opacity:.5;background:var(--background-paper)}.legend__list>li.empty-list[data-v-da487aba]{display:flex;align-items:center;justify-content:flex-start;height:32px;color:var(--text-disabled)}.legend__list>li.empty-list[data-v-da487aba]:hover{background-color:transparent;cursor:default}.legend__list>li .item-wrapper[data-v-da487aba]{display:flex;align-items:center;gap:8px;width:100%}.legend__list>li .item-wrapper .legend-label[data-v-da487aba]{width:80%}.legend__list>li .item-wrapper .icon-color[data-v-da487aba]{color:var(--action-active)}.legend__list>li .item-wrapper .label-container[data-v-da487aba]{display:flex;flex-direction:column;width:100%}.legend__list>li .item-wrapper .label-container .legend-caption[data-v-da487aba]{display:flex;color:var(--text-secondary)}
@@ -0,0 +1 @@
1
+ .chart-plane[data-v-0f3a67d5]{--headerHeight: var(--0e9a8448);width:100%}.chart-plane[data-v-0f3a67d5],.chart-loading[data-v-0f3a67d5],.chart-empty[data-v-0f3a67d5]{height:var(--5ae0eb9a)}.header-wrapper[data-v-0f3a67d5]{height:var(--headerHeight)}.chart[data-v-0f3a67d5]{width:100%;height:calc(100% - var(--headerHeight));position:relative}.chart__canvas[data-v-0f3a67d5]{width:100%;height:100%}.chart__tooltip[data-v-0f3a67d5]{position:absolute;pointer-events:none;transition:all .1s ease;min-width:214px;max-width:270px;z-index:1}
@@ -0,0 +1 @@
1
+ div[data-v-99e51ecc]{display:block}
@@ -0,0 +1 @@
1
+ .settings-header-container[data-v-0875167b]{display:flex;border:.0625rem solid var(--common-divider);border-radius:.375rem .375rem 0 0;border-bottom:none;background-color:var(--background-paper-elevation-0, #f9f9f9);justify-content:space-between}.settings-header-container .settings[data-v-0875167b]{display:flex;flex-direction:row;justify-content:space-between;height:3.9375rem;padding:.75rem 0 .75rem 1.5rem;align-items:center;gap:.75rem;flex:1}.settings-header-container .settings .chart-type-selection[data-v-0875167b]{display:flex;height:1.75rem;max-width:8.125rem}.settings-header-container .settings-spacer[data-v-0875167b]{padding:.75rem 1.5rem}.settings-header-container .breakdowns[data-v-0875167b]{display:flex;width:15.0625rem;height:3.9375rem;padding:0 .75rem;flex-direction:column;justify-content:center;align-items:flex-start;gap:.75rem}.settings-header-container .breakdowns-border[data-v-0875167b]{border-left:.0625rem solid var(--common-divider)}
@@ -21,6 +21,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
21
21
  minVisible?: number;
22
22
  maxVisible?: number;
23
23
  maxLimitTooltipText?: string;
24
+ sortSelected?: unknown;
25
+ sortOptions?: unknown[];
26
+ sortOptionNameKey?: string;
24
27
  fullHeight?: boolean;
25
28
  withSettingsHeader?: boolean;
26
29
  extraCharts?: Record<string, unknown>[];
@@ -46,12 +49,16 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
46
49
  minVisible: number;
47
50
  maxVisible: number;
48
51
  maxLimitTooltipText: string;
52
+ sortSelected: any;
53
+ sortOptions: () => any[];
54
+ sortOptionNameKey: string;
49
55
  fullHeight: boolean;
50
56
  withSettingsHeader: boolean;
51
57
  extraCharts: () => any[];
52
58
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
53
59
  "update:chartType": (chartType: ChartType) => void;
54
60
  "update:visibleIds": (visibleIds: unknown[]) => void;
61
+ "update:sortSelected": (sortOption: unknown) => void;
55
62
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
56
63
  dataSets: ChartDataSet[];
57
64
  visibleIds: unknown[];
@@ -74,6 +81,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
74
81
  minVisible?: number;
75
82
  maxVisible?: number;
76
83
  maxLimitTooltipText?: string;
84
+ sortSelected?: unknown;
85
+ sortOptions?: unknown[];
86
+ sortOptionNameKey?: string;
77
87
  fullHeight?: boolean;
78
88
  withSettingsHeader?: boolean;
79
89
  extraCharts?: Record<string, unknown>[];
@@ -99,11 +109,15 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
99
109
  minVisible: number;
100
110
  maxVisible: number;
101
111
  maxLimitTooltipText: string;
112
+ sortSelected: any;
113
+ sortOptions: () => any[];
114
+ sortOptionNameKey: string;
102
115
  fullHeight: boolean;
103
116
  withSettingsHeader: boolean;
104
117
  extraCharts: () => any[];
105
118
  }>>> & {
106
119
  "onUpdate:visibleIds"?: (visibleIds: unknown[]) => any;
120
+ "onUpdate:sortSelected"?: (sortOption: unknown) => any;
107
121
  "onUpdate:chartType"?: (chartType: ChartType) => any;
108
122
  }, {
109
123
  header: string;
@@ -112,6 +126,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
112
126
  minVisible: number;
113
127
  maxVisible: number;
114
128
  maxLimitTooltipText: string;
129
+ sortSelected: any;
130
+ sortOptions: unknown[];
131
+ sortOptionNameKey: string;
115
132
  chartType: ChartType;
116
133
  hideLegend: boolean;
117
134
  xAxisFormat: ValueFormat;
@@ -122,11 +139,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
122
139
  trendValue: string | number;
123
140
  trendDirection: "up" | "down";
124
141
  tickCount: number;
125
- withAnimation: boolean;
126
- totalsChart: boolean;
127
142
  noDataIcon: string;
128
143
  noDataTitle: string;
129
144
  noDataSubtitle: string;
145
+ withAnimation: boolean;
146
+ totalsChart: boolean;
130
147
  fullHeight: boolean;
131
148
  withSettingsHeader: boolean;
132
149
  extraCharts: Record<string, unknown>[];
@@ -1,7 +1,7 @@
1
1
  import o from "./Chart.vue2.js";
2
2
  /* empty css */import _ from "../../_virtual/_plugin-vue_export-helper.js";
3
- // import "../../Chart.vue_vue_type_style_index_0_scoped_78d3f5a8_lang.css"; //*');
4
- const a = /* @__PURE__ */ _(o, [["__scopeId", "data-v-78d3f5a8"]]);
3
+ // import "../../Chart.vue_vue_type_style_index_0_scoped_a0b89669_lang.css"; //*');
4
+ const a = /* @__PURE__ */ _(o, [["__scopeId", "data-v-a0b89669"]]);
5
5
  export {
6
6
  a as default
7
7
  };
@@ -1,25 +1,25 @@
1
- import "../../Chart.vue_vue_type_style_index_0_scoped_78d3f5a8_lang.css"; import { defineComponent as V, computed as n, openBlock as s, createElementBlock as d, Fragment as C, createBlock as x, unref as a, isRef as v, withCtx as u, renderSlot as c, createCommentVNode as T, createElementVNode as I, mergeProps as h, normalizeClass as H, createVNode as S, renderList as E } from "vue";
2
- import { useVModel as U } from "@vueuse/core";
3
- import N from "./ChartLegend.vue.js";
1
+ import "../../Chart.vue_vue_type_style_index_0_scoped_a0b89669_lang.css"; import { defineComponent as E, computed as n, openBlock as s, createElementBlock as c, Fragment as S, createBlock as T, unref as a, isRef as h, withCtx as m, renderSlot as f, createCommentVNode as I, createElementVNode as D, mergeProps as y, normalizeClass as N, createVNode as L, renderList as U } from "vue";
2
+ import { useVModel as k } from "@vueuse/core";
3
+ import M from "./ChartLegend.vue.js";
4
4
  import P from "./SettingsHeader.vue.js";
5
- import D from "./ChartPlane.vue.js";
6
- import { useColorsMap as M } from "./composables/useColorsMap.js";
7
- import { DEFAULT_TICK_COUNT as $, DEFAULT_MIN_VISIBLE as z, DEFAULT_MAX_VISIBLE as K } from "./consts.js";
8
- import { ChartType as O } from "./types.js";
9
- import { useChartHeight as R } from "./composables/useChartHeight.js";
10
- const X = {
5
+ import w from "./ChartPlane.vue.js";
6
+ import { useColorsMap as O } from "./composables/useColorsMap.js";
7
+ import { DEFAULT_TICK_COUNT as K, DEFAULT_MIN_VISIBLE as $, DEFAULT_MAX_VISIBLE as z } from "./consts.js";
8
+ import { ChartType as R } from "./types.js";
9
+ import { useChartHeight as X } from "./composables/useChartHeight.js";
10
+ const j = {
11
11
  key: 0,
12
12
  class: "chart-sidebar"
13
- }, ee = /* @__PURE__ */ V({
13
+ }, te = /* @__PURE__ */ E({
14
14
  __name: "Chart",
15
15
  props: {
16
16
  dataSets: { default: () => [] },
17
17
  visibleIds: { default: () => [] },
18
- chartType: { default: O.Line },
18
+ chartType: { default: R.Line },
19
19
  parsing: { default: void 0 },
20
20
  xAxisFormat: { default: "string" },
21
21
  yAxisFormat: { default: "number" },
22
- tickCount: { default: $ },
22
+ tickCount: { default: K },
23
23
  loading: { type: Boolean, default: !1 },
24
24
  withAnimation: { type: Boolean, default: !0 },
25
25
  totalsChart: { type: Boolean, default: !1 },
@@ -31,16 +31,19 @@ const X = {
31
31
  noDataTitle: { default: "No data to display" },
32
32
  noDataSubtitle: { default: "Search again with different filters" },
33
33
  hideLegend: { type: Boolean, default: !1 },
34
- minVisible: { default: z },
35
- maxVisible: { default: K },
34
+ minVisible: { default: $ },
35
+ maxVisible: { default: z },
36
36
  maxLimitTooltipText: { default: "" },
37
+ sortSelected: { default: null },
38
+ sortOptions: { default: () => [] },
39
+ sortOptionNameKey: { default: "" },
37
40
  fullHeight: { type: Boolean, default: !1 },
38
41
  withSettingsHeader: { type: Boolean, default: !0 },
39
42
  extraCharts: { default: () => [] }
40
43
  },
41
- emits: ["update:chartType", "update:visibleIds"],
42
- setup(i, { emit: p }) {
43
- const e = i, l = U(e, "chartType", p), m = n(() => ({
44
+ emits: ["update:chartType", "update:visibleIds", "update:sortSelected"],
45
+ setup(o, { emit: d }) {
46
+ const e = o, r = k(e, "chartType", d), u = k(e, "sortSelected", d), g = n(() => ({
44
47
  dataSets: e.dataSets,
45
48
  visibleIds: e.visibleIds,
46
49
  parsing: e.parsing,
@@ -55,71 +58,80 @@ const X = {
55
58
  noDataSubtitle: e.noDataSubtitle,
56
59
  withAnimation: e.withAnimation,
57
60
  typeSwitcher: !e.withSettingsHeader,
58
- height: F.value,
59
- compactHeader: y.value > 1,
61
+ height: H.value,
62
+ compactHeader: v.value > 1,
60
63
  trendValue: e.trendValue,
61
64
  trendDirection: e.trendDirection,
62
- totalsChart: e.totalsChart
63
- })), L = n(() => e.dataSets), f = n(() => e.visibleIds), g = n(() => e.extraCharts.length), y = n(() => 1 + g.value), w = (t) => t === g.value - 1, { colorsMap: A } = M({ dataSets: L, visibleIds: f }), k = n(() => e.dataSets.map((t) => ({
65
+ totalsChart: e.totalsChart,
66
+ colorsMap: p.value
67
+ })), A = n(() => e.dataSets), b = n(() => e.visibleIds), C = n(() => e.extraCharts.length), v = n(() => 1 + C.value), B = (t) => t === C.value - 1, { colorsMap: p } = O({
68
+ dataSets: A,
69
+ visibleIds: b
70
+ }), F = n(() => e.dataSets.map((t) => ({
64
71
  id: t.id,
65
72
  label: t.label,
66
73
  caption: t.caption || null,
67
- color: A.value[t.id] || null,
74
+ color: p.value[t.id] || null,
68
75
  icon: t.icon || null,
69
76
  iconType: t.iconType || "branded"
70
- }))), { containerProps: B, eachPlaneHeight: F } = R({
71
- chartPlanesCount: y,
77
+ }))), { containerProps: V, eachPlaneHeight: H } = X({
78
+ chartPlanesCount: v,
72
79
  useFullHeight: e.fullHeight
73
80
  });
74
- return (t, r) => (s(), d(C, null, [
75
- i.withSettingsHeader ? (s(), x(P, {
81
+ return (t, i) => (s(), c(S, null, [
82
+ o.withSettingsHeader ? (s(), T(P, {
76
83
  key: 0,
77
- "chart-type": a(l),
78
- "onUpdate:chart-type": r[0] || (r[0] = (o) => v(l) ? l.value = o : null),
79
- "hide-legend": i.hideLegend
84
+ "chart-type": a(r),
85
+ "onUpdate:chart-type": i[0] || (i[0] = (l) => h(r) ? r.value = l : null),
86
+ "hide-legend": o.hideLegend
80
87
  }, {
81
- metric: u(() => [
82
- c(t.$slots, "metric", {}, void 0, !0)
88
+ metric: m(() => [
89
+ f(t.$slots, "metric", {}, void 0, !0)
83
90
  ]),
84
- breakdowns: u(() => [
85
- c(t.$slots, "breakdowns", {}, void 0, !0)
91
+ breakdowns: m(() => [
92
+ f(t.$slots, "breakdowns", {}, void 0, !0)
86
93
  ]),
87
94
  _: 3
88
- }, 8, ["chart-type", "hide-legend"])) : T("", !0),
89
- I("div", h({ class: "chart-container" }, a(B)), [
90
- I("section", {
91
- class: H(["chart-planes", [{ "with-legend": !i.hideLegend }]])
95
+ }, 8, ["chart-type", "hide-legend"])) : I("", !0),
96
+ D("div", y({ class: "chart-container" }, a(V)), [
97
+ D("section", {
98
+ class: N(["chart-planes", [{ "with-legend": !o.hideLegend }]])
92
99
  }, [
93
- S(D, h({
94
- "chart-type": a(l),
95
- "onUpdate:chart-type": r[1] || (r[1] = (o) => v(l) ? l.value = o : null)
96
- }, a(m)), {
97
- "subheader-tooltip": u(() => [
98
- c(t.$slots, "subheader-tooltip", {}, void 0, !0)
100
+ L(w, y({
101
+ "chart-type": a(r),
102
+ "onUpdate:chart-type": i[1] || (i[1] = (l) => h(r) ? r.value = l : null)
103
+ }, a(g)), {
104
+ "subheader-tooltip": m(() => [
105
+ f(t.$slots, "subheader-tooltip", {}, void 0, !0)
99
106
  ]),
100
107
  _: 3
101
108
  }, 16, ["chart-type"]),
102
- (s(!0), d(C, null, E(i.extraCharts, (o, b) => (s(), x(D, h({
103
- key: b,
109
+ (s(!0), c(S, null, U(o.extraCharts, (l, x) => (s(), T(w, y({
110
+ key: x,
104
111
  class: "extra-chart-plane"
105
- }, { ...a(m), ...o }, {
106
- "chart-type": a(l),
112
+ }, { ...a(g), ...l }, {
113
+ "chart-type": a(r),
114
+ "colors-map": a(p),
107
115
  "type-switcher": !1,
108
- "tooltip-respects-top-edge": !w(b)
109
- }), null, 16, ["chart-type", "tooltip-respects-top-edge"]))), 128))
116
+ "tooltip-respects-top-edge": !B(x)
117
+ }), null, 16, ["chart-type", "colors-map", "tooltip-respects-top-edge"]))), 128))
110
118
  ], 2),
111
- i.hideLegend ? T("", !0) : (s(), d("section", X, [
112
- S(N, {
113
- items: a(k),
114
- "visible-ids": a(f),
115
- "max-limit-tooltip-text": i.maxLimitTooltipText,
116
- "onUpdate:visibleIds": r[2] || (r[2] = (o) => p("update:visibleIds", o))
117
- }, null, 8, ["items", "visible-ids", "max-limit-tooltip-text"])
119
+ o.hideLegend ? I("", !0) : (s(), c("section", j, [
120
+ L(M, {
121
+ "sort-selected": a(u),
122
+ "onUpdate:sort-selected": i[2] || (i[2] = (l) => h(u) ? u.value = l : null),
123
+ items: a(F),
124
+ "visible-ids": a(b),
125
+ "max-limit-tooltip-text": o.maxLimitTooltipText,
126
+ "sort-options": o.sortOptions,
127
+ "sort-option-name-key": o.sortOptionNameKey,
128
+ "onUpdate:visibleIds": i[3] || (i[3] = (l) => d("update:visibleIds", l))
129
+ }, null, 8, ["sort-selected", "items", "visible-ids", "max-limit-tooltip-text", "sort-options", "sort-option-name-key"])
118
130
  ]))
119
131
  ], 16)
120
132
  ], 64));
121
133
  }
122
134
  });
123
135
  export {
124
- ee as default
136
+ te as default
125
137
  };
@@ -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
  };
@@ -21,6 +21,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
21
21
  trendValue?: string | number;
22
22
  trendDirection?: "up" | "down";
23
23
  totalsChart?: boolean;
24
+ colorsMap: Record<string, string>;
24
25
  }>, {
25
26
  chartType: ChartType;
26
27
  dataSets: () => any[];
@@ -44,6 +45,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
44
45
  trendValue: any;
45
46
  trendDirection: string;
46
47
  totalsChart: boolean;
48
+ colorsMap: () => {};
47
49
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
48
50
  "update:chartType": (chartType: ChartType) => void;
49
51
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
@@ -68,6 +70,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
68
70
  trendValue?: string | number;
69
71
  trendDirection?: "up" | "down";
70
72
  totalsChart?: boolean;
73
+ colorsMap: Record<string, string>;
71
74
  }>, {
72
75
  chartType: ChartType;
73
76
  dataSets: () => any[];
@@ -91,6 +94,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
91
94
  trendValue: any;
92
95
  trendDirection: string;
93
96
  totalsChart: boolean;
97
+ colorsMap: () => {};
94
98
  }>>> & {
95
99
  "onUpdate:chartType"?: (chartType: ChartType) => any;
96
100
  }, {
@@ -108,13 +112,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
108
112
  trendValue: string | number;
109
113
  trendDirection: "up" | "down";
110
114
  tickCount: number;
111
- withAnimation: boolean;
112
- totalsChart: boolean;
113
115
  noDataIcon: string;
114
116
  noDataTitle: string;
115
117
  noDataSubtitle: string;
118
+ withAnimation: boolean;
116
119
  compactHeader: boolean;
117
120
  tooltipRespectsTopEdge: boolean;
121
+ totalsChart: boolean;
122
+ colorsMap: Record<string, string>;
118
123
  }>, {
119
124
  "subheader-tooltip"?(_: {}): any;
120
125
  }>;
@@ -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.vue_vue_type_style_index_0_scoped_4396faf6_lang.css"; //*');
4
- const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-4396faf6"]]);
3
+ // import "../../ChartPlane.vue_vue_type_style_index_0_scoped_0f3a67d5_lang.css"; //*');
4
+ const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-0f3a67d5"]]);
5
5
  export {
6
6
  s as default
7
7
  };