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