@ironsource/shared-ui 2.1.12-rc.2 → 2.1.12-rc.20

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 (183) hide show
  1. package/ButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_0123c361_lang.css +1 -0
  2. package/ButtonFilterDropdownTrigger.vue_vue_type_style_index_0_scoped_0198fee8_lang.css +1 -0
  3. package/ButtonV4.vue_vue_type_style_index_0_scoped_d7948c77_lang.css +1 -0
  4. package/Chart.vue_vue_type_style_index_0_scoped_64205c96_lang.css +1 -0
  5. package/ChartHeader.vue_vue_type_style_index_0_scoped_da34b108_lang.css +1 -0
  6. package/ChartHeaderTrend.vue_vue_type_style_index_0_scoped_79dc2883_lang.css +1 -0
  7. package/ChartLegend.vue_vue_type_style_index_0_scoped_fd9e4ea2_lang.css +1 -0
  8. package/ChartPlane.vue_vue_type_style_index_0_scoped_903fc6ae_lang.css +1 -0
  9. package/ChartTooltip.vue_vue_type_style_index_0_scoped_e53c6287_lang.css +1 -0
  10. package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_8d5521da_lang.css +1 -0
  11. package/DataGrid.vue_vue_type_style_index_0_scoped_86ea5d2a_lang.css +1 -0
  12. package/DateRangeV4.vue_vue_type_style_index_0_scoped_a849128a_lang.css +1 -0
  13. package/DialogV4.vue_vue_type_style_index_0_scoped_eb226e31_lang.css +1 -0
  14. package/DropdownV4.vue_vue_type_style_index_0_scoped_08cb822e_lang.css +1 -0
  15. package/FieldLabel.vue_vue_type_style_index_0_scoped_921d4087_lang.css +1 -0
  16. package/FormRow.vue_vue_type_style_index_0_scoped_2d5a3057_lang.css +1 -0
  17. package/IconButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_99e51ecc_lang.css +1 -0
  18. package/OptionV4.vue_vue_type_style_index_0_scoped_9cdf3a94_lang.css +1 -0
  19. package/SettingsHeader.vue_vue_type_style_index_0_scoped_01f78cd7_lang.css +1 -0
  20. package/SubHeader.vue_vue_type_style_index_0_scoped_e6008b6c_lang.css +1 -0
  21. package/Tooltip.vue_vue_type_style_index_0_scoped_20630944_lang.css +1 -0
  22. package/TooltipHeader.vue_vue_type_style_index_0_scoped_3b15c693_lang.css +1 -0
  23. package/TooltipV4.vue_vue_type_style_index_0_scoped_bcb40ed4_lang.css +1 -0
  24. package/TreeDropdown.vue_vue_type_style_index_0_scoped_4ba9e4bd_lang.css +1 -0
  25. package/components/appIcon/index.d.ts +3 -3
  26. package/components/banner/Banner.vue.d.ts +3 -3
  27. package/components/banner/index.d.ts +7 -7
  28. package/components/button/common/consts.d.ts +1 -0
  29. package/components/button/v3/Button.vue.d.ts +3 -3
  30. package/components/button/v3/ButtonBase.vue.d.ts +3 -3
  31. package/components/button/v3/IconButton.vue.d.ts +3 -3
  32. package/components/button/v3/index.d.ts +14 -14
  33. package/components/button/v4/ButtonV4.vue.d.ts +4 -3
  34. package/components/button/v4/ButtonV4.vue.js +3 -3
  35. package/components/button/v4/ButtonV4.vue2.js +1 -1
  36. package/components/chart/Chart.vue.d.ts +149 -38
  37. package/components/chart/Chart.vue.js +3 -3
  38. package/components/chart/Chart.vue2.js +145 -297
  39. package/components/chart/ChartHeader.vue.d.ts +45 -11
  40. package/components/chart/ChartHeader.vue.js +3 -3
  41. package/components/chart/ChartHeader.vue2.js +64 -53
  42. package/components/chart/ChartHeaderTrend.vue.d.ts +48 -0
  43. package/components/chart/ChartHeaderTrend.vue.js +7 -0
  44. package/components/chart/ChartHeaderTrend.vue2.js +95 -0
  45. package/components/chart/ChartLegend.vue.d.ts +24 -0
  46. package/components/chart/ChartLegend.vue.js +3 -3
  47. package/components/chart/ChartLegend.vue2.js +82 -63
  48. package/components/chart/ChartPlane.vue.d.ts +221 -0
  49. package/components/chart/ChartPlane.vue.js +7 -0
  50. package/components/chart/ChartPlane.vue2.js +368 -0
  51. package/components/chart/ChartStoryArgs.d.ts +179 -0
  52. package/components/chart/ChartTooltip.vue.d.ts +22 -2
  53. package/components/chart/ChartTooltip.vue.js +2 -2
  54. package/components/chart/ChartTooltip.vue2.js +50 -55
  55. package/components/chart/LegendSorting.vue.d.ts +37 -0
  56. package/components/chart/LegendSorting.vue.js +45 -0
  57. package/components/chart/LegendSorting.vue2.js +4 -0
  58. package/components/chart/SettingsHeader.vue.d.ts +1 -0
  59. package/components/chart/SettingsHeader.vue.js +3 -3
  60. package/components/chart/SettingsHeader.vue2.js +17 -16
  61. package/components/chart/SubHeader.vue.d.ts +52 -0
  62. package/components/chart/SubHeader.vue.js +7 -0
  63. package/components/chart/SubHeader.vue2.js +61 -0
  64. package/components/chart/TooltipHeader.vue.d.ts +50 -0
  65. package/components/chart/TooltipHeader.vue.js +7 -0
  66. package/components/chart/TooltipHeader.vue2.js +69 -0
  67. package/components/chart/colorPalette.d.ts +4 -0
  68. package/components/chart/colorPalette.js +54 -0
  69. package/components/chart/composables/useChartHeight.d.ts +5 -0
  70. package/components/chart/composables/useChartHeight.js +24 -0
  71. package/components/chart/composables/useColorsMap.d.ts +10 -0
  72. package/components/chart/composables/useColorsMap.js +46 -0
  73. package/components/chart/composables/useTooltipPosition.d.ts +1 -1
  74. package/components/chart/composables/useTooltipPosition.js +11 -15
  75. package/components/chart/consts.d.ts +29 -7
  76. package/components/chart/consts.js +41 -21
  77. package/components/chart/index.d.ts +515 -118
  78. package/components/chart/mockData.d.ts +44 -5
  79. package/components/chart/types.d.ts +37 -6
  80. package/components/chart/types.js +5 -2
  81. package/components/chart/utils/formatNumber.d.ts +0 -1
  82. package/components/chart/utils/highlightUtils.d.ts +3 -0
  83. package/components/chart/utils/highlightUtils.js +18 -0
  84. package/components/chart/utils/utils.d.ts +3 -2
  85. package/components/chart/utils/utils.js +23 -8
  86. package/components/checkbox/v3/Checkbox.vue.d.ts +3 -3
  87. package/components/checkbox/v3/index.d.ts +7 -7
  88. package/components/dateRange/v4/DateRangeV4.vue.js +2 -2
  89. package/components/dateRange/v4/DateRangeV4.vue2.js +1 -1
  90. package/components/dialog/v4/DialogV4.vue.d.ts +4 -3
  91. package/components/dialog/v4/DialogV4.vue.js +4 -4
  92. package/components/dialog/v4/DialogV4.vue2.js +1 -1
  93. package/components/dialog/v4/index.d.ts +7 -7
  94. package/components/dropdown/common/Dropdown.common.js +92 -85
  95. package/components/dropdown/v4/ButtonDropdownTrigger.vue.js +2 -2
  96. package/components/dropdown/v4/ButtonDropdownTrigger.vue2.js +1 -1
  97. package/components/dropdown/v4/ButtonFilterDropdownTrigger.vue.js +2 -2
  98. package/components/dropdown/v4/ButtonFilterDropdownTrigger.vue2.js +1 -1
  99. package/components/dropdown/v4/ConditionalDropdown.vue.js +3 -3
  100. package/components/dropdown/v4/ConditionalDropdown.vue2.js +76 -76
  101. package/components/dropdown/v4/DropdownV4.vue.d.ts +8 -0
  102. package/components/dropdown/v4/DropdownV4.vue.js +4 -4
  103. package/components/dropdown/v4/DropdownV4.vue2.js +105 -95
  104. package/components/dropdown/v4/IconButtonDropdownTrigger.vue.d.ts +11 -0
  105. package/components/dropdown/v4/IconButtonDropdownTrigger.vue.js +4 -4
  106. package/components/dropdown/v4/IconButtonDropdownTrigger.vue2.js +12 -10
  107. package/components/dropdown/v4/OptionV4.vue.d.ts +8 -0
  108. package/components/dropdown/v4/OptionV4.vue.js +3 -3
  109. package/components/dropdown/v4/OptionV4.vue2.js +91 -69
  110. package/components/dropdown/v4/TreeDropdown.vue.js +2 -2
  111. package/components/dropdown/v4/TreeDropdown.vue2.js +68 -73
  112. package/components/dropdown/v4/index.d.ts +64 -2
  113. package/components/emptyState/v4/EmptyStateV4.vue.d.ts +3 -3
  114. package/components/emptyState/v4/index.d.ts +7 -7
  115. package/components/forms/FormRow.vue.d.ts +9 -2
  116. package/components/forms/FormRow.vue.js +3 -3
  117. package/components/forms/FormRow.vue2.js +25 -14
  118. package/components/forms/index.d.ts +25 -5
  119. package/components/search/v3/index.d.ts +3 -3
  120. package/components/shared/FieldLabel.vue.d.ts +19 -7
  121. package/components/shared/FieldLabel.vue.js +3 -3
  122. package/components/shared/FieldLabel.vue2.js +50 -37
  123. package/components/table/v4/DataGrid.vue.d.ts +4 -3
  124. package/components/table/v4/DataGrid.vue.js +4 -4
  125. package/components/table/v4/DataGrid.vue2.js +151 -142
  126. package/components/table/v4/MultipleDataGrid.vue.d.ts +3 -3
  127. package/components/table/v4/index.d.ts +15 -14
  128. package/components/tabs/v3/Tabs.vue.d.ts +3 -3
  129. package/components/tabs/v3/index.d.ts +7 -7
  130. package/components/tooltip/common/Tooltip.types.d.ts +1 -0
  131. package/components/tooltip/v3/Tooltip.vue.d.ts +4 -4
  132. package/components/tooltip/v3/Tooltip.vue.js +2 -2
  133. package/components/tooltip/v3/Tooltip.vue2.js +1 -1
  134. package/components/tooltip/v3/index.d.ts +7 -7
  135. package/components/tooltip/v4/TooltipV4.vue.d.ts +4 -4
  136. package/components/tooltip/v4/TooltipV4.vue.js +2 -2
  137. package/components/tooltip/v4/TooltipV4.vue2.js +1 -1
  138. package/components/tooltip/v4/index.d.ts +7 -7
  139. package/components/typography/Text.vue.d.ts +3 -3
  140. package/components/typography/index.d.ts +7 -7
  141. package/composables/useFormValidation.d.ts +1 -0
  142. package/composables/useFormValidation.js +32 -27
  143. package/composables/useFullPageHeight.d.ts +10 -0
  144. package/composables/useFullPageHeight.js +15 -0
  145. package/consts/common.d.ts +1 -0
  146. package/consts/common.js +4 -0
  147. package/consts/regex.d.ts +1 -0
  148. package/consts/regex.js +2 -1
  149. package/index.d.ts +211 -81
  150. package/index.js +106 -100
  151. package/package.json +1 -1
  152. package/testids/index.d.ts +2 -1
  153. package/testids/index.js +10 -10
  154. package/utils/formatNumbers.d.ts +1 -1
  155. package/utils/formatNumbers.js +19 -6
  156. package/utils/index.js +7 -0
  157. package/utils/text.d.ts +3 -0
  158. package/utils/text.js +24 -5
  159. package/utils/totals.d.ts +5 -0
  160. package/utils/totals.js +9 -0
  161. package/utils/utils.d.ts +1 -0
  162. package/utils/utils.js +4 -0
  163. package/ButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_604dfc6f_lang.css +0 -1
  164. package/ButtonFilterDropdownTrigger.vue_vue_type_style_index_0_scoped_ea1c4589_lang.css +0 -1
  165. package/ButtonV4.vue_vue_type_style_index_0_scoped_bdfce3aa_lang.css +0 -1
  166. package/Chart.vue_vue_type_style_index_0_scoped_a641383a_lang.css +0 -1
  167. package/ChartHeader.vue_vue_type_style_index_0_scoped_b8213498_lang.css +0 -1
  168. package/ChartLegend.vue_vue_type_style_index_0_scoped_4fe1c7d1_lang.css +0 -1
  169. package/ChartTooltip.vue_vue_type_style_index_0_scoped_6744325c_lang.css +0 -1
  170. package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_3a2aeea3_lang.css +0 -1
  171. package/DataGrid.vue_vue_type_style_index_0_scoped_020072b0_lang.css +0 -1
  172. package/DateRangeV4.vue_vue_type_style_index_0_scoped_8a2714eb_lang.css +0 -1
  173. package/DialogV4.vue_vue_type_style_index_0_scoped_37da643b_lang.css +0 -1
  174. package/DropdownV4.vue_vue_type_style_index_0_scoped_d154c5da_lang.css +0 -1
  175. package/FieldLabel.vue_vue_type_style_index_0_scoped_96ee1c98_lang.css +0 -1
  176. package/FormRow.vue_vue_type_style_index_0_scoped_fc3897fd_lang.css +0 -1
  177. package/IconButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_59fb505a_lang.css +0 -1
  178. package/OptionV4.vue_vue_type_style_index_0_scoped_1e8837dc_lang.css +0 -1
  179. package/SettingsHeader.vue_vue_type_style_index_0_scoped_9b6cd9d9_lang.css +0 -1
  180. package/Tooltip.vue_vue_type_style_index_0_scoped_9020a179_lang.css +0 -1
  181. package/TooltipV4.vue_vue_type_style_index_0_scoped_66eab856_lang.css +0 -1
  182. package/TreeDropdown.vue_vue_type_style_index_0_scoped_b883d1fa_lang.css +0 -1
  183. package/components/chart/utils/formatNumber.js +0 -11
@@ -1,324 +1,172 @@
1
- import "../../Chart.vue_vue_type_style_index_0_scoped_a641383a_lang.css"; import { defineComponent as J, computed as i, ref as T, onMounted as Q, watch as C, nextTick as Y, openBlock as d, createElementBlock as k, Fragment as F, createBlock as v, unref as u, isRef as N, withCtx as x, renderSlot as L, createCommentVNode as y, createElementVNode as p, normalizeClass as _, createVNode as H, normalizeStyle as ee } from "vue";
2
- import { useVModel as te } from "@vueuse/core";
3
- import { Chart as P, ArcElement as ae, LineElement as oe, BarElement as ie, PointElement as le, LineController as re, BarController as ne, PieController as se, ScatterController as de, CategoryScale as ue, LinearScale as ce, Filler as pe, Tooltip as he } from "chart.js";
4
- import { HoverVerticalLine as me } from "./plugins/HoverVerticalLine.js";
5
- import { formatValue as U, calcStepSize as fe } from "./utils/utils.js";
6
- import { DEFAULT_TICK_COUNT as ve, DEFAULT_MIN_VISIBLE as ye, DEFAULT_MAX_VISIBLE as be, COLOR_PALETTE as ge, POINT_BORDER_COLOR as Te, TICK_LABEL_COLOR as z, TICK_LABEL_FONT as M, GRID_LINE_COLOR as $ } from "./consts.js";
7
- import { ChartType as n } from "./types.js";
8
- import { useTooltipPosition as Ce } from "./composables/useTooltipPosition.js";
9
- import ke from "./ChartTooltip.vue.js";
10
- import xe from "./ChartLegend.vue.js";
11
- import Le from "./ChartHeader.vue.js";
12
- import { hexColorToRgba as Se } from "../../utils/color.js";
13
- import { useChartValues as we } from "./composables/useChartValues.js";
14
- import Be from "./ChartLoader.vue.js";
15
- import Ie from "../emptyState/v4/EmptyStateV4.vue.js";
16
- import Ae from "./SettingsHeader.vue.js";
17
- const Ee = { class: "chart-container" }, Ve = { class: "header-wrapper" }, Re = { class: "chart" }, De = {
1
+ import "../../Chart.vue_vue_type_style_index_0_scoped_64205c96_lang.css"; import { defineComponent as U, ref as O, computed as n, openBlock as s, createElementBlock as m, Fragment as C, createBlock as I, unref as i, isRef as b, withCtx as d, renderSlot as u, createCommentVNode as D, createElementVNode as k, mergeProps as y, normalizeClass as E, createVNode as L, createSlots as N, renderList as M } from "vue";
2
+ import { useVModel as A } from "@vueuse/core";
3
+ import $ from "./ChartLegend.vue.js";
4
+ import K from "./SettingsHeader.vue.js";
5
+ import V from "./ChartPlane.vue.js";
6
+ import { useColorsMap as z } from "./composables/useColorsMap.js";
7
+ import { DEFAULT_TICK_COUNT as R, DEFAULT_MIN_VISIBLE as X, DEFAULT_MAX_VISIBLE as Y } from "./consts.js";
8
+ import { ChartType as j, DateInterval as q, TooltipOrder as G, TrendDirection as J } from "./types.js";
9
+ import { useChartHeight as Q } from "./composables/useChartHeight.js";
10
+ import { TotalType as W, calculateTotal as Z } from "../../utils/totals.js";
11
+ const _ = {
18
12
  key: 0,
19
13
  class: "chart-sidebar"
20
- }, Je = /* @__PURE__ */ J({
14
+ }, ue = /* @__PURE__ */ U({
21
15
  __name: "Chart",
22
16
  props: {
23
17
  dataSets: { default: () => [] },
24
18
  visibleIds: { default: () => [] },
25
- chartType: { default: n.Line },
19
+ chartType: { default: j.Line },
26
20
  parsing: { default: void 0 },
27
21
  xAxisFormat: { default: "string" },
28
22
  yAxisFormat: { default: "number" },
29
- tickCount: { default: ve },
23
+ xAxisDateInterval: { default: q.DAILY },
24
+ tickCount: { default: R },
25
+ truncateTickLabels: { type: Boolean, default: !1 },
26
+ loading: { type: Boolean, default: !1 },
27
+ empty: { type: Boolean, default: !1 },
28
+ withAnimation: { type: Boolean, default: !0 },
29
+ totalsChart: { type: Boolean, default: !1 },
30
+ tooltipTotalType: { default: W.Total },
31
+ tooltipTotalCalcFn: { type: Function, default: Z },
32
+ tooltipOrder: { default: G.Legend },
33
+ valueSuffix: { default: "" },
34
+ valuePrefix: { default: "" },
30
35
  header: { default: "" },
31
36
  subheader: { default: "" },
32
- withSubheaderTooltip: { type: Boolean, default: !1 },
33
- hideLegend: { type: Boolean, default: !1 },
34
- minVisible: { default: ye },
35
- maxVisible: { default: be },
36
- loading: { type: Boolean, default: !1 },
37
+ subheaderTooltip: { default: null },
38
+ keepSubheaderVisible: { type: Boolean, default: !1 },
39
+ trendValue: { default: null },
40
+ trendDirection: { default: J.UP },
41
+ trendTooltip: { default: null },
37
42
  noDataIcon: { default: "file-search" },
38
43
  noDataTitle: { default: "No data to display" },
39
44
  noDataSubtitle: { default: "Search again with different filters" },
40
- withSettingsHeader: { type: Boolean, default: !0 },
45
+ hideLegend: { type: Boolean, default: !1 },
46
+ minVisible: { default: X },
47
+ maxVisible: { default: Y },
41
48
  maxLimitTooltipText: { default: "" },
42
- withAnimation: { type: Boolean, default: !0 }
49
+ sortSelected: { default: null },
50
+ sortOptions: { default: () => [] },
51
+ sortOptionNameKey: { default: "" },
52
+ fullHeight: { type: Boolean, default: !1 },
53
+ fullHeightBottomSpacing: { default: 50 },
54
+ withSettingsHeader: { type: Boolean, default: !0 },
55
+ extraCharts: { default: () => [] }
43
56
  },
44
- emits: ["update:chartType", "update:visibleIds"],
45
- setup(a, { emit: S }) {
46
- const t = a;
47
- P.register(
48
- ae,
49
- oe,
50
- ie,
51
- le,
52
- re,
53
- ne,
54
- se,
55
- de,
56
- ue,
57
- ce,
58
- pe,
59
- he,
60
- me
61
- );
62
- const c = te(t, "chartType", S), K = i(
63
- () => t.withAnimation ? "" : "none"
64
- ), h = T(null);
65
- let s = null;
66
- const w = i(() => t.dataSets.length === 0), B = i(() => !t.loading && !w.value), b = () => {
67
- h.value && (s && s.destroy(), s = new P(h.value, E.value));
68
- }, W = () => {
69
- s && (s.data.datasets = g.value, s.options = E.value.options, s.update(K.value));
70
- };
71
- Q(b), C(() => t.chartType, b), C(B, async (e) => {
72
- e && (await Y(), b());
73
- }), C([() => t.visibleIds, () => t.dataSets], W);
74
- const m = i(
75
- () => t.chartType === n.StackedLine || t.chartType === n.StackedBar
76
- ), I = i(
77
- () => t.chartType === n.Line || t.chartType === n.StackedLine
78
- ), f = i(
79
- () => t.dataSets.filter((e) => t.visibleIds.includes(e.id))
80
- ), g = i(() => f.value.map((e, o) => {
81
- const l = e.color || ge[o] || "#000000";
82
- return {
83
- ...e,
84
- fill: m.value ? "start" : void 0,
85
- backgroundColor: Se(
86
- l,
87
- t.chartType === n.StackedLine ? 10 : 70
88
- ),
89
- borderColor: l,
90
- pointBackgroundColor: l,
91
- pointHoverBorderColor: l,
92
- maxBarThickness: 50,
93
- clip: 5,
94
- // draw a bit outside the chart area
95
- icon: e.icon || null,
96
- iconType: e.iconType || "branded"
97
- };
98
- })), A = i(
99
- () => f.value.length && f.value.every(
100
- (e) => e.data.length === 1
101
- )
102
- ), E = i(
103
- () => ({
104
- type: t.chartType == n.Bar || t.chartType === n.StackedBar ? "bar" : "line",
105
- // Chart Data
106
- data: {
107
- datasets: g.value
108
- },
109
- // Chart Options
110
- options: {
111
- parsing: t.parsing,
112
- interaction: {
113
- intersect: !1,
114
- mode: "index",
115
- axis: "x"
116
- },
117
- // plugins
118
- plugins: {
119
- legend: { display: !1 },
120
- title: { display: !1 },
121
- hoverVerticalLine: I.value,
122
- // tooltip
123
- tooltip: {
124
- enabled: !1,
125
- position: "average",
126
- external: ({ tooltip: e }) => {
127
- r.value = { ...e };
128
- },
129
- callbacks: {
130
- footer: (e) => {
131
- const o = e.reduce((l, q) => l + (q.parsed.y || 0), 0);
132
- return ["Total", String(o)];
133
- }
134
- }
135
- }
136
- },
137
- // chart layout
138
- responsive: !0,
139
- maintainAspectRatio: !1,
140
- layout: {
141
- padding: {
142
- left: 18,
143
- top: 18,
144
- bottom: 13
145
- }
146
- },
147
- // basic styles
148
- elements: {
149
- line: {
150
- borderWidth: 2,
151
- tension: 0.3
152
- },
153
- point: {
154
- radius: A.value ? 3 : 1,
155
- hitRadius: 8,
156
- borderWidth: 0,
157
- hoverRadius: 4,
158
- hoverBorderWidth: 2,
159
- pointHoverBackgroundColor: Te
160
- },
161
- bar: {
162
- borderRadius: 4
163
- }
164
- },
165
- scales: {
166
- // Horizontal Axis (X)
167
- x: {
168
- beginAtZero: !0,
169
- offset: !I.value || A.value,
170
- border: { display: !1 },
171
- stacked: m.value,
172
- // stack on top of each other
173
- // ticks
174
- ticks: {
175
- color: z,
176
- font: M,
177
- padding: 4,
178
- callback: function(e) {
179
- return U(
180
- this.getLabelForValue(e),
181
- t.xAxisFormat
182
- );
183
- }
184
- },
185
- // grid lines
186
- grid: {
187
- color: $,
188
- drawOnChartArea: !1,
189
- drawTicks: !0,
190
- drawBorder: !1,
191
- tickLength: 7
192
- }
193
- },
194
- // Vertical Axis (Y)
195
- y: {
196
- beginAtZero: !0,
197
- border: { display: !1 },
198
- // hide left borderline
199
- stacked: m.value,
200
- // stack on top of each other
201
- // ticks
202
- ticks: {
203
- color: z,
204
- font: M,
205
- padding: 8,
206
- stepSize: O.value,
207
- min: D.value,
208
- max: O.value * t.tickCount,
209
- callback: (e) => U(e, t.yAxisFormat)
210
- },
211
- // grid lines
212
- grid: {
213
- color: $,
214
- drawOnChartArea: !0,
215
- drawTicks: !1
216
- }
217
- }
218
- }
219
- }
220
- })
221
- ), Z = i(
222
- () => g.value.reduce((e, o) => (e[o.id] = o.borderColor, e), {})
223
- ), G = i(() => t.dataSets.map((e) => ({
224
- id: e.id,
225
- label: e.label,
226
- caption: e.caption || null,
227
- color: Z.value[e.id] || null,
228
- icon: e.icon || null,
229
- iconType: e.iconType || "branded"
230
- }))), V = T(null), r = T(null), { position: R } = Ce(
231
- h,
232
- V,
233
- r
234
- ), X = i(() => ({
235
- left: `${R.value.left}px`,
236
- top: `${R.value.top}px`,
237
- opacity: r.value?.opacity || 0
238
- })), { minValue: D, maxValue: j } = we({
239
- parsingConfig: t.parsing,
240
- dataSets: f,
241
- isStacked: m
242
- }), O = i(
243
- () => fe(D.value, j.value, t.tickCount)
244
- );
245
- return (e, o) => (d(), k(F, null, [
246
- a.withSettingsHeader ? (d(), v(Ae, {
57
+ emits: ["update:chartType", "update:visibleIds", "update:sortSelected"],
58
+ setup(a, { emit: p }) {
59
+ const e = a, r = A(e, "chartType", p), h = A(e, "sortSelected", p), c = O(null), g = n(() => ({
60
+ dataSets: e.dataSets,
61
+ visibleIds: e.visibleIds,
62
+ parsing: e.parsing,
63
+ xAxisFormat: e.xAxisFormat,
64
+ yAxisFormat: e.yAxisFormat,
65
+ xAxisDateInterval: e.xAxisDateInterval,
66
+ tickCount: e.tickCount,
67
+ truncateTickLabels: e.truncateTickLabels,
68
+ header: e.header,
69
+ subheader: e.subheader,
70
+ loading: e.loading,
71
+ empty: e.empty,
72
+ noDataIcon: e.noDataIcon,
73
+ noDataTitle: e.noDataTitle,
74
+ noDataSubtitle: e.noDataSubtitle,
75
+ withAnimation: e.withAnimation,
76
+ typeSwitcher: !e.withSettingsHeader,
77
+ height: P.value,
78
+ compactHeader: x.value > 1,
79
+ trendValue: e.trendValue,
80
+ trendDirection: e.trendDirection,
81
+ trendTooltip: e.trendTooltip,
82
+ totalsChart: e.totalsChart,
83
+ subheaderTooltip: e.subheaderTooltip,
84
+ keepSubheaderVisible: e.keepSubheaderVisible,
85
+ colorsMap: f.value,
86
+ tooltipTotalType: e.tooltipTotalType,
87
+ tooltipTotalCalcFn: e.tooltipTotalCalcFn,
88
+ tooltipOrder: e.tooltipOrder,
89
+ highlightedId: c.value,
90
+ valueSuffix: e.valueSuffix,
91
+ valuePrefix: e.valuePrefix
92
+ })), B = n(() => e.dataSets), v = n(() => e.visibleIds), T = n(() => e.extraCharts.length), x = n(() => 1 + T.value), F = (t) => t === T.value - 1, { colorsMap: f } = z({
93
+ dataSets: B,
94
+ visibleIds: v
95
+ }), w = n(() => e.dataSets.map((t) => ({
96
+ id: t.id,
97
+ label: t.label,
98
+ caption: t.caption || null,
99
+ color: f.value[t.id] || null,
100
+ icon: t.icon || null,
101
+ iconType: t.iconType || "branded"
102
+ }))), { containerProps: H, eachPlaneHeight: P } = Q({
103
+ chartPlanesCount: x,
104
+ useFullHeight: e.fullHeight
105
+ });
106
+ return (t, o) => (s(), m(C, null, [
107
+ a.withSettingsHeader ? (s(), I(K, {
247
108
  key: 0,
248
- "chart-type": u(c),
249
- "onUpdate:chart-type": o[0] || (o[0] = (l) => N(c) ? c.value = l : null),
109
+ "chart-type": i(r),
110
+ "onUpdate:chart-type": o[0] || (o[0] = (l) => b(r) ? r.value = l : null),
250
111
  "hide-legend": a.hideLegend
251
112
  }, {
252
- metric: x(() => [
253
- L(e.$slots, "metric", {}, void 0, !0)
113
+ "before-chart-type": d(() => [
114
+ u(t.$slots, "before-chart-type", {}, void 0, !0)
115
+ ]),
116
+ metric: d(() => [
117
+ u(t.$slots, "metric", {}, void 0, !0)
254
118
  ]),
255
- breakdowns: x(() => [
256
- L(e.$slots, "breakdowns", {}, void 0, !0)
119
+ breakdowns: d(() => [
120
+ u(t.$slots, "breakdowns", {}, void 0, !0)
257
121
  ]),
258
122
  _: 3
259
- }, 8, ["chart-type", "hide-legend"])) : y("", !0),
260
- p("div", Ee, [
261
- u(B) ? (d(), k(F, { key: 0 }, [
262
- p("section", {
263
- class: _(["chart-content", [{ "with-legend": !a.hideLegend }]])
264
- }, [
265
- p("div", Ve, [
266
- H(Le, {
267
- "chart-type": u(c),
268
- "onUpdate:chart-type": o[1] || (o[1] = (l) => N(c) ? c.value = l : null),
269
- "with-settings-header": a.withSettingsHeader,
270
- header: a.header,
271
- subheader: a.subheader,
272
- "with-subheader-tooltip": a.withSubheaderTooltip
273
- }, {
274
- "subheader-tooltip": x(() => [
275
- L(e.$slots, "subheader-tooltip", {}, void 0, !0)
276
- ]),
277
- _: 3
278
- }, 8, ["chart-type", "with-settings-header", "header", "subheader", "with-subheader-tooltip"])
279
- ]),
280
- p("div", Re, [
281
- p("canvas", {
282
- ref_key: "chartRef",
283
- ref: h,
284
- class: "chart__canvas"
285
- }, null, 512),
286
- p("div", {
287
- ref_key: "tooltipRef",
288
- ref: V,
289
- class: "chart__tooltip",
290
- style: ee(u(X))
291
- }, [
292
- r.value ? (d(), v(ke, {
293
- key: 0,
294
- title: String(r.value.title),
295
- "data-points": r.value.dataPoints,
296
- "x-axis-format": a.xAxisFormat,
297
- "y-axis-format": a.yAxisFormat,
298
- "total-label": r.value.footer[0],
299
- "total-value": Number(r.value.footer[1])
300
- }, null, 8, ["title", "data-points", "x-axis-format", "y-axis-format", "total-label", "total-value"])) : y("", !0)
301
- ], 4)
302
- ])
303
- ], 2),
304
- a.hideLegend ? y("", !0) : (d(), k("section", De, [
305
- H(xe, {
306
- items: u(G),
307
- "visible-ids": a.visibleIds,
308
- "max-limit-tooltip-text": a.maxLimitTooltipText,
309
- "onUpdate:visibleIds": o[2] || (o[2] = (l) => S("update:visibleIds", l))
310
- }, null, 8, ["items", "visible-ids", "max-limit-tooltip-text"])
311
- ]))
312
- ], 64)) : a.loading ? (d(), v(Be, { key: 1 })) : u(w) ? (d(), v(u(Ie), {
313
- key: 2,
314
- title: a.noDataTitle,
315
- subtitle: a.noDataSubtitle,
316
- "icon-name": a.noDataIcon
317
- }, null, 8, ["title", "subtitle", "icon-name"])) : y("", !0)
318
- ])
123
+ }, 8, ["chart-type", "hide-legend"])) : D("", !0),
124
+ k("div", y({ class: "chart-container" }, i(H)), [
125
+ k("section", {
126
+ class: E(["chart-planes", [{ "with-legend": !a.hideLegend }]])
127
+ }, [
128
+ L(V, y({
129
+ "chart-type": i(r),
130
+ "onUpdate:chart-type": o[1] || (o[1] = (l) => b(r) ? r.value = l : null)
131
+ }, i(g)), N({ _: 2 }, [
132
+ t.$slots["subheader-tooltip"] ? {
133
+ name: "subheader-tooltip",
134
+ fn: d(() => [
135
+ u(t.$slots, "subheader-tooltip", {}, void 0, !0)
136
+ ]),
137
+ key: "0"
138
+ } : void 0
139
+ ]), 1040, ["chart-type"]),
140
+ (s(!0), m(C, null, M(a.extraCharts, (l, S) => (s(), I(V, y({
141
+ key: S,
142
+ class: "extra-chart-plane"
143
+ }, { ...i(g), ...l }, {
144
+ "chart-type": i(r),
145
+ "colors-map": i(f),
146
+ "type-switcher": !1,
147
+ "tooltip-respects-top-edge": !F(S)
148
+ }), null, 16, ["chart-type", "colors-map", "tooltip-respects-top-edge"]))), 128))
149
+ ], 2),
150
+ a.hideLegend ? D("", !0) : (s(), m("section", _, [
151
+ L($, {
152
+ "sort-selected": i(h),
153
+ "onUpdate:sort-selected": o[2] || (o[2] = (l) => b(h) ? h.value = l : null),
154
+ "highlighted-id": c.value,
155
+ "onUpdate:highlighted-id": o[3] || (o[3] = (l) => c.value = l),
156
+ items: i(w),
157
+ "visible-ids": i(v),
158
+ "max-limit-tooltip-text": a.maxLimitTooltipText,
159
+ "sort-options": a.sortOptions,
160
+ "sort-option-name-key": a.sortOptionNameKey,
161
+ "min-visible": a.minVisible,
162
+ "max-visible": a.maxVisible,
163
+ "onUpdate:visibleIds": o[4] || (o[4] = (l) => p("update:visibleIds", l))
164
+ }, null, 8, ["sort-selected", "highlighted-id", "items", "visible-ids", "max-limit-tooltip-text", "sort-options", "sort-option-name-key", "min-visible", "max-visible"])
165
+ ]))
166
+ ], 16)
319
167
  ], 64));
320
168
  }
321
169
  });
322
170
  export {
323
- Je as default
171
+ ue as default
324
172
  };
@@ -1,38 +1,72 @@
1
- import { ChartType } from '@/components/chart/types';
1
+ import { ChartType, TrendDirection } from '@/components/chart/types';
2
2
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
3
3
  chartType: ChartType;
4
- withSettingsHeader: boolean;
4
+ typeSwitcher: boolean;
5
5
  header?: string;
6
6
  subheader?: string;
7
- withSubheaderTooltip?: boolean;
7
+ subheaderTooltip?: {
8
+ header?: string;
9
+ text?: string;
10
+ };
11
+ trendTooltip?: {
12
+ header?: string;
13
+ rangeCurrent?: string;
14
+ rangePrevious?: string;
15
+ };
16
+ compact: boolean;
17
+ trendValue?: string | number;
18
+ trendDirection?: TrendDirection;
8
19
  }>, {
9
20
  chartType: ChartType;
10
- withSettingsHeader: boolean;
21
+ typeSwitcher: boolean;
11
22
  header: string;
12
23
  subheader: string;
13
- withSubheaderTooltip: boolean;
24
+ subheaderTooltip: any;
25
+ trendTooltip: any;
26
+ compact: boolean;
27
+ trendValue: any;
28
+ trendDirection: TrendDirection;
14
29
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
30
  "update:chartType": (type: ChartType) => void;
16
31
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
17
32
  chartType: ChartType;
18
- withSettingsHeader: boolean;
33
+ typeSwitcher: boolean;
19
34
  header?: string;
20
35
  subheader?: string;
21
- withSubheaderTooltip?: boolean;
36
+ subheaderTooltip?: {
37
+ header?: string;
38
+ text?: string;
39
+ };
40
+ trendTooltip?: {
41
+ header?: string;
42
+ rangeCurrent?: string;
43
+ rangePrevious?: string;
44
+ };
45
+ compact: boolean;
46
+ trendValue?: string | number;
47
+ trendDirection?: TrendDirection;
22
48
  }>, {
23
49
  chartType: ChartType;
24
- withSettingsHeader: boolean;
50
+ typeSwitcher: boolean;
25
51
  header: string;
26
52
  subheader: string;
27
- withSubheaderTooltip: boolean;
53
+ subheaderTooltip: any;
54
+ trendTooltip: any;
55
+ compact: boolean;
56
+ trendValue: any;
57
+ trendDirection: TrendDirection;
28
58
  }>>> & {
29
59
  "onUpdate:chartType"?: (type: ChartType) => any;
30
60
  }, {
31
61
  header: string;
62
+ compact: boolean;
32
63
  chartType: ChartType;
33
- withSettingsHeader: boolean;
64
+ trendTooltip: any;
34
65
  subheader: string;
35
- withSubheaderTooltip: boolean;
66
+ subheaderTooltip: any;
67
+ typeSwitcher: boolean;
68
+ trendValue: string | number;
69
+ trendDirection: TrendDirection;
36
70
  }>, {
37
71
  "subheader-tooltip"?(_: {}): any;
38
72
  }>;
@@ -1,7 +1,7 @@
1
1
  import e from "./ChartHeader.vue2.js";
2
2
  /* empty css */import o from "../../_virtual/_plugin-vue_export-helper.js";
3
- // import "../../ChartHeader.vue_vue_type_style_index_0_scoped_b8213498_lang.css"; //*');
4
- const s = /* @__PURE__ */ o(e, [["__scopeId", "data-v-b8213498"]]);
3
+ // import "../../ChartHeader.vue_vue_type_style_index_0_scoped_da34b108_lang.css"; //*');
4
+ const r = /* @__PURE__ */ o(e, [["__scopeId", "data-v-da34b108"]]);
5
5
  export {
6
- s as default
6
+ r as default
7
7
  };