@ironsource/shared-ui 2.1.12-rc.3 → 2.1.12-rc.30

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 (237) hide show
  1. package/ButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_adb49e50_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_852be7ec_lang.css +1 -0
  4. package/Chart.vue_vue_type_style_index_0_scoped_fa533a3d_lang.css +1 -0
  5. package/ChartHeader.vue_vue_type_style_index_0_scoped_af520313_lang.css +1 -0
  6. package/ChartHeaderTrend.vue_vue_type_style_index_0_scoped_db8a902c_lang.css +1 -0
  7. package/ChartLegend.vue_vue_type_style_index_0_scoped_6103d8bd_lang.css +1 -0
  8. package/ChartPlane.vue_vue_type_style_index_0_scoped_4f67d41d_lang.css +1 -0
  9. package/ChartTooltip.vue_vue_type_style_index_0_scoped_3315b68f_lang.css +1 -0
  10. package/ChipDropdownTrigger.vue_vue_type_style_index_0_scoped_38354f10_lang.css +1 -0
  11. package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_f5204c04_lang.css +1 -0
  12. package/DataGrid.vue_vue_type_style_index_0_scoped_8e8df067_lang.css +1 -0
  13. package/DateRangeV4.vue_vue_type_style_index_0_scoped_a849128a_lang.css +1 -0
  14. package/DialogV4.vue_vue_type_style_index_0_scoped_eb226e31_lang.css +1 -0
  15. package/DropdownV4.vue_vue_type_style_index_0_scoped_55dd36a7_lang.css +1 -0
  16. package/FieldLabel.vue_vue_type_style_index_0_scoped_921d4087_lang.css +1 -0
  17. package/FormRow.vue_vue_type_style_index_0_scoped_2d5a3057_lang.css +1 -0
  18. package/IconButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_99e51ecc_lang.css +1 -0
  19. package/Link.vue_vue_type_style_index_0_scoped_ad98fe7b_lang.css +1 -0
  20. package/OptionV4.vue_vue_type_style_index_0_scoped_0287cebf_lang.css +1 -0
  21. package/SettingsHeader.vue_vue_type_style_index_0_scoped_01f78cd7_lang.css +1 -0
  22. package/SubHeader.vue_vue_type_style_index_0_scoped_e6008b6c_lang.css +1 -0
  23. package/SwitchV4.vue_vue_type_style_index_0_scoped_cd6621a7_lang.css +1 -0
  24. package/ToggleButtonGroupAB.vue_vue_type_style_index_0_scoped_2076b5ab_lang.css +1 -0
  25. package/Tooltip.vue_vue_type_style_index_0_scoped_20630944_lang.css +1 -0
  26. package/TooltipHeader.vue_vue_type_style_index_0_scoped_3b15c693_lang.css +1 -0
  27. package/TooltipV4.vue_vue_type_style_index_0_scoped_bcb40ed4_lang.css +1 -0
  28. package/TreeDropdown.vue_vue_type_style_index_0_scoped_4ba9e4bd_lang.css +1 -0
  29. package/components/appIcon/index.d.ts +3 -3
  30. package/components/banner/Banner.vue.d.ts +3 -3
  31. package/components/banner/index.d.ts +7 -7
  32. package/components/button/common/consts.d.ts +1 -0
  33. package/components/button/v3/Button.vue.d.ts +3 -3
  34. package/components/button/v3/ButtonBase.vue.d.ts +3 -3
  35. package/components/button/v3/IconButton.vue.d.ts +3 -3
  36. package/components/button/v3/index.d.ts +14 -14
  37. package/components/button/v4/ButtonV4.vue.d.ts +5 -3
  38. package/components/button/v4/ButtonV4.vue.js +4 -4
  39. package/components/button/v4/ButtonV4.vue2.js +28 -27
  40. package/components/button/v4/ToggleButtonGroupAB.vue.js +3 -3
  41. package/components/button/v4/ToggleButtonGroupAB.vue2.js +40 -44
  42. package/components/chart/Chart.vue.d.ts +158 -37
  43. package/components/chart/Chart.vue.js +2 -2
  44. package/components/chart/Chart.vue2.js +150 -297
  45. package/components/chart/ChartHeader.vue.d.ts +50 -11
  46. package/components/chart/ChartHeader.vue.js +3 -3
  47. package/components/chart/ChartHeader.vue2.js +73 -54
  48. package/components/chart/ChartHeaderTrend.vue.d.ts +48 -0
  49. package/components/chart/ChartHeaderTrend.vue.js +7 -0
  50. package/components/chart/ChartHeaderTrend.vue2.js +96 -0
  51. package/components/chart/ChartLegend.vue.d.ts +24 -0
  52. package/components/chart/ChartLegend.vue.js +3 -3
  53. package/components/chart/ChartLegend.vue2.js +82 -63
  54. package/components/chart/ChartPlane.vue.d.ts +226 -0
  55. package/components/chart/ChartPlane.vue.js +7 -0
  56. package/components/chart/ChartPlane.vue2.js +370 -0
  57. package/components/chart/ChartStoryArgs.d.ts +184 -0
  58. package/components/chart/ChartTooltip.vue.d.ts +22 -2
  59. package/components/chart/ChartTooltip.vue.js +2 -2
  60. package/components/chart/ChartTooltip.vue2.js +50 -55
  61. package/components/chart/LegendSorting.vue.d.ts +37 -0
  62. package/components/chart/LegendSorting.vue.js +45 -0
  63. package/components/chart/LegendSorting.vue2.js +4 -0
  64. package/components/chart/SettingsHeader.vue.d.ts +1 -0
  65. package/components/chart/SettingsHeader.vue.js +3 -3
  66. package/components/chart/SettingsHeader.vue2.js +17 -16
  67. package/components/chart/SubHeader.vue.d.ts +52 -0
  68. package/components/chart/SubHeader.vue.js +7 -0
  69. package/components/chart/SubHeader.vue2.js +61 -0
  70. package/components/chart/TooltipHeader.vue.d.ts +50 -0
  71. package/components/chart/TooltipHeader.vue.js +7 -0
  72. package/components/chart/TooltipHeader.vue2.js +69 -0
  73. package/components/chart/colorPalette.d.ts +5 -0
  74. package/components/chart/colorPalette.js +68 -0
  75. package/components/chart/composables/useChartHeight.d.ts +5 -0
  76. package/components/chart/composables/useChartHeight.js +24 -0
  77. package/components/chart/composables/useColorsMap.d.ts +12 -0
  78. package/components/chart/composables/useColorsMap.js +48 -0
  79. package/components/chart/composables/useTooltipPosition.d.ts +1 -1
  80. package/components/chart/composables/useTooltipPosition.js +11 -15
  81. package/components/chart/consts.d.ts +29 -7
  82. package/components/chart/consts.js +41 -21
  83. package/components/chart/index.d.ts +554 -119
  84. package/components/chart/mockData.d.ts +44 -5
  85. package/components/chart/types.d.ts +38 -6
  86. package/components/chart/types.js +5 -2
  87. package/components/chart/utils/formatNumber.d.ts +0 -1
  88. package/components/chart/utils/highlightUtils.d.ts +3 -0
  89. package/components/chart/utils/highlightUtils.js +18 -0
  90. package/components/chart/utils/utils.d.ts +3 -3
  91. package/components/chart/utils/utils.js +19 -10
  92. package/components/checkbox/v3/Checkbox.vue.d.ts +3 -3
  93. package/components/checkbox/v3/index.d.ts +7 -7
  94. package/components/dateRange/common/DateRange.common.js +81 -75
  95. package/components/dateRange/common/DateServices.common.d.ts +7 -1
  96. package/components/dateRange/common/DateServices.common.js +88 -92
  97. package/components/dateRange/common/consts.common.d.ts +5 -0
  98. package/components/dateRange/common/consts.common.js +9 -3
  99. package/components/dateRange/v3/DateRange.vue.d.ts +3 -3
  100. package/components/dateRange/v3/DateRangePicker.vue.d.ts +3 -3
  101. package/components/dateRange/v3/index.d.ts +7 -7
  102. package/components/dateRange/v4/DateRangePickerV4.vue.d.ts +3 -3
  103. package/components/dateRange/v4/DateRangeV4.vue.d.ts +3 -3
  104. package/components/dateRange/v4/DateRangeV4.vue.js +2 -2
  105. package/components/dateRange/v4/DateRangeV4.vue2.js +1 -1
  106. package/components/dateRange/v4/index.d.ts +7 -7
  107. package/components/dialog/v4/DialogV4.vue.d.ts +4 -3
  108. package/components/dialog/v4/DialogV4.vue.js +4 -4
  109. package/components/dialog/v4/DialogV4.vue2.js +1 -1
  110. package/components/dialog/v4/index.d.ts +7 -7
  111. package/components/dropdown/common/Dropdown.common.d.ts +1 -0
  112. package/components/dropdown/common/Dropdown.common.js +172 -160
  113. package/components/dropdown/v3/Dropdown.vue.d.ts +1 -1
  114. package/components/dropdown/v3/index.d.ts +20 -20
  115. package/components/dropdown/v4/ButtonDropdownTrigger.vue.d.ts +1 -0
  116. package/components/dropdown/v4/ButtonDropdownTrigger.vue.js +3 -3
  117. package/components/dropdown/v4/ButtonDropdownTrigger.vue2.js +16 -13
  118. package/components/dropdown/v4/ButtonFilterDropdownTrigger.vue.js +2 -2
  119. package/components/dropdown/v4/ButtonFilterDropdownTrigger.vue2.js +1 -1
  120. package/components/dropdown/v4/ChipDropdownTrigger.vue.d.ts +5 -0
  121. package/components/dropdown/v4/ChipDropdownTrigger.vue.js +3 -3
  122. package/components/dropdown/v4/ChipDropdownTrigger.vue2.js +64 -54
  123. package/components/dropdown/v4/ConditionalDropdown.vue.d.ts +22 -9
  124. package/components/dropdown/v4/ConditionalDropdown.vue.js +4 -4
  125. package/components/dropdown/v4/ConditionalDropdown.vue2.js +151 -129
  126. package/components/dropdown/v4/DropdownV4.vue.d.ts +34 -1
  127. package/components/dropdown/v4/DropdownV4.vue.js +2 -2
  128. package/components/dropdown/v4/DropdownV4.vue2.js +241 -189
  129. package/components/dropdown/v4/IconButtonDropdownTrigger.vue.d.ts +11 -0
  130. package/components/dropdown/v4/IconButtonDropdownTrigger.vue.js +4 -4
  131. package/components/dropdown/v4/IconButtonDropdownTrigger.vue2.js +12 -10
  132. package/components/dropdown/v4/OptionV4.vue.d.ts +18 -5
  133. package/components/dropdown/v4/OptionV4.vue.js +2 -2
  134. package/components/dropdown/v4/OptionV4.vue2.js +140 -108
  135. package/components/dropdown/v4/TreeDropdown.vue.d.ts +1 -1
  136. package/components/dropdown/v4/TreeDropdown.vue.js +2 -2
  137. package/components/dropdown/v4/TreeDropdown.vue2.js +68 -73
  138. package/components/dropdown/v4/dropdownStoryArgs.d.ts +8 -0
  139. package/components/dropdown/v4/index.d.ts +682 -162
  140. package/components/emptyState/v4/EmptyStateV4.vue.d.ts +3 -3
  141. package/components/emptyState/v4/index.d.ts +7 -7
  142. package/components/forms/FormRow.vue.d.ts +9 -2
  143. package/components/forms/FormRow.vue.js +3 -3
  144. package/components/forms/FormRow.vue2.js +25 -14
  145. package/components/forms/index.d.ts +25 -5
  146. package/components/includeExclude/IncludeExclude.vue.d.ts +1 -1
  147. package/components/includeExclude/IncludeExcludeDragDrop.vue.d.ts +1 -1
  148. package/components/includeExclude/index.d.ts +40 -40
  149. package/components/link/Link.vue.d.ts +70 -0
  150. package/components/link/Link.vue.js +7 -0
  151. package/components/link/Link.vue2.js +43 -0
  152. package/components/link/index.d.ts +201 -0
  153. package/components/link/index.js +6 -0
  154. package/components/search/v3/index.d.ts +3 -3
  155. package/components/shared/FieldLabel.vue.d.ts +19 -7
  156. package/components/shared/FieldLabel.vue.js +3 -3
  157. package/components/shared/FieldLabel.vue2.js +50 -37
  158. package/components/switch/v4/SwitchV4.vue.d.ts +16 -0
  159. package/components/switch/v4/SwitchV4.vue.js +3 -3
  160. package/components/switch/v4/SwitchV4.vue2.js +39 -24
  161. package/components/switch/v4/index.d.ts +29 -0
  162. package/components/table/common/Table.common.d.ts +0 -1
  163. package/components/table/common/Table.common.js +38 -39
  164. package/components/table/common/Table.types.d.ts +2 -0
  165. package/components/table/common/consts.d.ts +1 -0
  166. package/components/table/common/consts.js +2 -1
  167. package/components/table/v4/DataGrid.vue.d.ts +15 -4
  168. package/components/table/v4/DataGrid.vue.js +4 -4
  169. package/components/table/v4/DataGrid.vue2.js +288 -230
  170. package/components/table/v4/MultipleDataGrid.vue.d.ts +3 -3
  171. package/components/table/v4/index.d.ts +50 -15
  172. package/components/table/v4/storyUtils.d.ts +2 -0
  173. package/components/tabs/v3/Tabs.vue.d.ts +3 -3
  174. package/components/tabs/v3/index.d.ts +7 -7
  175. package/components/tooltip/common/Tooltip.types.d.ts +1 -0
  176. package/components/tooltip/v3/Tooltip.vue.d.ts +4 -4
  177. package/components/tooltip/v3/Tooltip.vue.js +2 -2
  178. package/components/tooltip/v3/Tooltip.vue2.js +1 -1
  179. package/components/tooltip/v3/index.d.ts +7 -7
  180. package/components/tooltip/v4/TooltipV4.vue.d.ts +4 -4
  181. package/components/tooltip/v4/TooltipV4.vue.js +2 -2
  182. package/components/tooltip/v4/TooltipV4.vue2.js +1 -1
  183. package/components/tooltip/v4/index.d.ts +7 -7
  184. package/components/typography/Text.vue.d.ts +3 -3
  185. package/components/typography/index.d.ts +7 -7
  186. package/composables/useDateService.d.ts +7 -0
  187. package/composables/useDateService.js +10 -0
  188. package/composables/useFormValidation.d.ts +1 -0
  189. package/composables/useFormValidation.js +32 -27
  190. package/composables/useFullPageHeight.d.ts +10 -0
  191. package/composables/useFullPageHeight.js +15 -0
  192. package/consts/common.d.ts +1 -0
  193. package/consts/common.js +4 -0
  194. package/consts/regex.d.ts +1 -0
  195. package/consts/regex.js +2 -1
  196. package/index.d.ts +1601 -425
  197. package/index.js +148 -136
  198. package/mocks/apps.d.ts +1 -0
  199. package/mocks/optionsWithIcons.d.ts +2 -0
  200. package/package.json +9 -1
  201. package/testids/index.d.ts +4 -0
  202. package/testids/index.js +31 -30
  203. package/utils/formatNumbers.d.ts +1 -1
  204. package/utils/formatNumbers.js +19 -6
  205. package/utils/index.js +7 -0
  206. package/utils/text.d.ts +3 -0
  207. package/utils/text.js +24 -5
  208. package/utils/totals.d.ts +5 -0
  209. package/utils/totals.js +9 -0
  210. package/utils/utils.d.ts +1 -0
  211. package/utils/utils.js +4 -0
  212. package/ButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_604dfc6f_lang.css +0 -1
  213. package/ButtonFilterDropdownTrigger.vue_vue_type_style_index_0_scoped_ea1c4589_lang.css +0 -1
  214. package/ButtonV4.vue_vue_type_style_index_0_scoped_bdfce3aa_lang.css +0 -1
  215. package/Chart.vue_vue_type_style_index_0_scoped_a641383a_lang.css +0 -1
  216. package/ChartHeader.vue_vue_type_style_index_0_scoped_b8213498_lang.css +0 -1
  217. package/ChartLegend.vue_vue_type_style_index_0_scoped_4fe1c7d1_lang.css +0 -1
  218. package/ChartTooltip.vue_vue_type_style_index_0_scoped_6744325c_lang.css +0 -1
  219. package/ChipDropdownTrigger.vue_vue_type_style_index_0_scoped_e43ac1c9_lang.css +0 -1
  220. package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_3a2aeea3_lang.css +0 -1
  221. package/DataGrid.vue_vue_type_style_index_0_scoped_6b54ac22_lang.css +0 -1
  222. package/DateRangeV4.vue_vue_type_style_index_0_scoped_8a2714eb_lang.css +0 -1
  223. package/DialogV4.vue_vue_type_style_index_0_scoped_37da643b_lang.css +0 -1
  224. package/DropdownV4.vue_vue_type_style_index_0_scoped_d154c5da_lang.css +0 -1
  225. package/FieldLabel.vue_vue_type_style_index_0_scoped_96ee1c98_lang.css +0 -1
  226. package/FormRow.vue_vue_type_style_index_0_scoped_fc3897fd_lang.css +0 -1
  227. package/IconButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_59fb505a_lang.css +0 -1
  228. package/OptionV4.vue_vue_type_style_index_0_scoped_1e8837dc_lang.css +0 -1
  229. package/SettingsHeader.vue_vue_type_style_index_0_scoped_9b6cd9d9_lang.css +0 -1
  230. package/SwitchV4.vue_vue_type_style_index_0_scoped_c2e356f5_lang.css +0 -1
  231. package/ToggleButtonGroupAB.vue_vue_type_style_index_0_scoped_c81a7d3e_lang.css +0 -1
  232. package/Tooltip.vue_vue_type_style_index_0_scoped_9020a179_lang.css +0 -1
  233. package/TooltipV4.vue_vue_type_style_index_0_scoped_66eab856_lang.css +0 -1
  234. package/TreeDropdown.vue_vue_type_style_index_0_scoped_b883d1fa_lang.css +0 -1
  235. package/components/chart/composables/useChartValues.d.ts +0 -12
  236. package/components/chart/composables/useChartValues.js +0 -32
  237. package/components/chart/utils/formatNumber.js +0 -11
@@ -0,0 +1,226 @@
1
+ import { ChartDataSet, ChartParsingConfig, ChartType, DateInterval, TooltipOrder, TrendDirection, ValueFormat } from './types';
2
+ import { TotalType } from '@/utils/totals';
3
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
4
+ dataSets: ChartDataSet[];
5
+ visibleIds: unknown[];
6
+ highlightedId?: string | number;
7
+ chartType?: ChartType;
8
+ parsing?: ChartParsingConfig;
9
+ xAxisFormat?: ValueFormat;
10
+ yAxisFormat?: ValueFormat;
11
+ xAxisDateInterval?: DateInterval;
12
+ tickCount?: number;
13
+ truncateTickLabels?: boolean;
14
+ header?: string;
15
+ subheader?: string;
16
+ subheaderTooltip?: {
17
+ header?: string;
18
+ text?: string;
19
+ };
20
+ keepSubheaderVisible?: boolean;
21
+ loading?: boolean;
22
+ empty?: boolean;
23
+ noDataIcon?: string;
24
+ noDataTitle?: string;
25
+ noDataSubtitle?: string;
26
+ withAnimation?: boolean;
27
+ typeSwitcher?: boolean;
28
+ height?: string;
29
+ compactHeader?: boolean;
30
+ noteText?: string;
31
+ tooltipRespectsTopEdge?: boolean;
32
+ tooltipTotalType?: TotalType;
33
+ tooltipTotalCalcFn?: (values: number[], totalType: TotalType) => number;
34
+ tooltipOrder?: TooltipOrder;
35
+ trendValue?: string | number;
36
+ trendDirection?: TrendDirection;
37
+ trendTooltip?: {
38
+ header?: string;
39
+ rangeCurrent?: string;
40
+ rangePrevious?: string;
41
+ };
42
+ totalsChart?: boolean;
43
+ colorsMap: Record<string, string>;
44
+ valueSuffix?: string;
45
+ valuePrefix?: string;
46
+ }>, {
47
+ chartType: ChartType;
48
+ dataSets: () => any[];
49
+ visibleIds: () => any[];
50
+ highlightedId: any;
51
+ xAxisFormat: string;
52
+ yAxisFormat: string;
53
+ xAxisDateInterval: DateInterval;
54
+ parsing: any;
55
+ tickCount: number;
56
+ truncateTickLabels: boolean;
57
+ header: string;
58
+ subheader: string;
59
+ subheaderTooltip: any;
60
+ keepSubheaderVisible: boolean;
61
+ loading: boolean;
62
+ empty: boolean;
63
+ noDataIcon: string;
64
+ noDataTitle: string;
65
+ noDataSubtitle: string;
66
+ withAnimation: boolean;
67
+ typeSwitcher: boolean;
68
+ height: string;
69
+ compactHeader: boolean;
70
+ noteText: string;
71
+ tooltipRespectsTopEdge: boolean;
72
+ tooltipTotalType: TotalType;
73
+ tooltipTotalCalcFn: (values: number[], totalType: TotalType) => number;
74
+ tooltipOrder: TooltipOrder;
75
+ trendValue: any;
76
+ trendDirection: TrendDirection;
77
+ trendTooltip: any;
78
+ totalsChart: boolean;
79
+ colorsMap: () => {};
80
+ valueSuffix: string;
81
+ valuePrefix: string;
82
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
83
+ "update:chartType": (chartType: ChartType) => void;
84
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
85
+ dataSets: ChartDataSet[];
86
+ visibleIds: unknown[];
87
+ highlightedId?: string | number;
88
+ chartType?: ChartType;
89
+ parsing?: ChartParsingConfig;
90
+ xAxisFormat?: ValueFormat;
91
+ yAxisFormat?: ValueFormat;
92
+ xAxisDateInterval?: DateInterval;
93
+ tickCount?: number;
94
+ truncateTickLabels?: boolean;
95
+ header?: string;
96
+ subheader?: string;
97
+ subheaderTooltip?: {
98
+ header?: string;
99
+ text?: string;
100
+ };
101
+ keepSubheaderVisible?: boolean;
102
+ loading?: boolean;
103
+ empty?: boolean;
104
+ noDataIcon?: string;
105
+ noDataTitle?: string;
106
+ noDataSubtitle?: string;
107
+ withAnimation?: boolean;
108
+ typeSwitcher?: boolean;
109
+ height?: string;
110
+ compactHeader?: boolean;
111
+ noteText?: string;
112
+ tooltipRespectsTopEdge?: boolean;
113
+ tooltipTotalType?: TotalType;
114
+ tooltipTotalCalcFn?: (values: number[], totalType: TotalType) => number;
115
+ tooltipOrder?: TooltipOrder;
116
+ trendValue?: string | number;
117
+ trendDirection?: TrendDirection;
118
+ trendTooltip?: {
119
+ header?: string;
120
+ rangeCurrent?: string;
121
+ rangePrevious?: string;
122
+ };
123
+ totalsChart?: boolean;
124
+ colorsMap: Record<string, string>;
125
+ valueSuffix?: string;
126
+ valuePrefix?: string;
127
+ }>, {
128
+ chartType: ChartType;
129
+ dataSets: () => any[];
130
+ visibleIds: () => any[];
131
+ highlightedId: any;
132
+ xAxisFormat: string;
133
+ yAxisFormat: string;
134
+ xAxisDateInterval: DateInterval;
135
+ parsing: any;
136
+ tickCount: number;
137
+ truncateTickLabels: boolean;
138
+ header: string;
139
+ subheader: string;
140
+ subheaderTooltip: any;
141
+ keepSubheaderVisible: boolean;
142
+ loading: boolean;
143
+ empty: boolean;
144
+ noDataIcon: string;
145
+ noDataTitle: string;
146
+ noDataSubtitle: string;
147
+ withAnimation: boolean;
148
+ typeSwitcher: boolean;
149
+ height: string;
150
+ compactHeader: boolean;
151
+ noteText: string;
152
+ tooltipRespectsTopEdge: boolean;
153
+ tooltipTotalType: TotalType;
154
+ tooltipTotalCalcFn: (values: number[], totalType: TotalType) => number;
155
+ tooltipOrder: TooltipOrder;
156
+ trendValue: any;
157
+ trendDirection: TrendDirection;
158
+ trendTooltip: any;
159
+ totalsChart: boolean;
160
+ colorsMap: () => {};
161
+ valueSuffix: string;
162
+ valuePrefix: string;
163
+ }>>> & {
164
+ "onUpdate:chartType"?: (chartType: ChartType) => any;
165
+ }, {
166
+ header: string;
167
+ height: string;
168
+ loading: boolean;
169
+ visibleIds: unknown[];
170
+ highlightedId: string | number;
171
+ chartType: ChartType;
172
+ xAxisFormat: ValueFormat;
173
+ xAxisDateInterval: DateInterval;
174
+ totalsChart: boolean;
175
+ parsing: ChartParsingConfig;
176
+ yAxisFormat: ValueFormat;
177
+ valueSuffix: string;
178
+ valuePrefix: string;
179
+ trendTooltip: any;
180
+ subheader: string;
181
+ subheaderTooltip: any;
182
+ typeSwitcher: boolean;
183
+ trendValue: string | number;
184
+ trendDirection: TrendDirection;
185
+ noteText: string;
186
+ dataSets: ChartDataSet[];
187
+ tickCount: number;
188
+ truncateTickLabels: boolean;
189
+ keepSubheaderVisible: boolean;
190
+ empty: boolean;
191
+ noDataIcon: string;
192
+ noDataTitle: string;
193
+ noDataSubtitle: string;
194
+ withAnimation: boolean;
195
+ compactHeader: boolean;
196
+ tooltipRespectsTopEdge: boolean;
197
+ tooltipTotalType: TotalType;
198
+ tooltipTotalCalcFn: (values: number[], totalType: TotalType) => number;
199
+ tooltipOrder: TooltipOrder;
200
+ colorsMap: Record<string, string>;
201
+ }>, {
202
+ "subheader-tooltip"?(_: {}): any;
203
+ }>;
204
+ export default _default;
205
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
206
+ type __VLS_TypePropsToRuntimeProps<T> = {
207
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
208
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
209
+ } : {
210
+ type: import('vue').PropType<T[K]>;
211
+ required: true;
212
+ };
213
+ };
214
+ type __VLS_WithDefaults<P, D> = {
215
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
216
+ default: D[K];
217
+ }> : P[K];
218
+ };
219
+ type __VLS_Prettify<T> = {
220
+ [K in keyof T]: T[K];
221
+ } & {};
222
+ type __VLS_WithTemplateSlots<T, S> = T & {
223
+ new (): {
224
+ $slots: S;
225
+ };
226
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./ChartPlane.vue2.js";
2
+ /* empty css */import e from "../../_virtual/_plugin-vue_export-helper.js";
3
+ // import "../../ChartPlane.vue_vue_type_style_index_0_scoped_4f67d41d_lang.css"; //*');
4
+ const a = /* @__PURE__ */ e(o, [["__scopeId", "data-v-4f67d41d"]]);
5
+ export {
6
+ a as default
7
+ };
@@ -0,0 +1,370 @@
1
+ import "../../ChartPlane.vue_vue_type_style_index_0_scoped_4f67d41d_lang.css"; import { defineComponent as ae, useCssVars as oe, unref as s, computed as l, ref as k, onMounted as le, watch as v, nextTick as re, openBlock as p, createElementBlock as A, createVNode as ie, isRef as ne, createSlots as se, withCtx as ue, renderSlot as de, createCommentVNode as S, createElementVNode as L, normalizeStyle as ce, createBlock as E } from "vue";
2
+ import { Chart as P, ArcElement as fe, LineElement as pe, BarElement as he, PointElement as me, LineController as ve, BarController as ye, PieController as Te, ScatterController as Ce, CategoryScale as be, LinearScale as ge, Filler as xe, Tooltip as ke } from "chart.js";
3
+ import { HoverVerticalLine as Ae } from "./plugins/HoverVerticalLine.js";
4
+ import { prepareTickLabel as Se, formatValue as Le } from "./utils/utils.js";
5
+ import { DEFAULT_TICK_COUNT as Ee, TOTALS_HELPER_KEY as w, BASE_COLOR_KEY as V, CHART_PADDING as Re, POINT_BORDER_COLOR as Be, TICK_LABEL_COLOR as N, TICK_LABEL_FONT as F, TICKS_EXTRA_PADDING as De, GRID_LINE_COLOR as K, HEADER_HEIGHT as Oe, COMPACT_HEADER_HEIGHT as Ie, HOVER_AREA_TRANSPARENCY as He, HOVER_TRANSPARENCY as y } from "./consts.js";
6
+ import { ChartType as u, DateInterval as Pe, TooltipOrder as M, TrendDirection as we } from "./types.js";
7
+ import { useTooltipPosition as Ve } from "./composables/useTooltipPosition.js";
8
+ import Ne from "./ChartTooltip.vue.js";
9
+ import { hexColorToRgba as h } from "../../utils/color.js";
10
+ import Fe from "./ChartHeader.vue.js";
11
+ import { useMemoize as Ke, useVModel as Me } from "@vueuse/core";
12
+ import Ue from "../emptyState/v4/EmptyStateV4.vue.js";
13
+ import Ye from "./ChartLoader.vue.js";
14
+ import { DEFAULT_CHART_COLOR as Ge } from "./colorPalette.js";
15
+ import { TotalType as U, calculateTotal as _e } from "../../utils/totals.js";
16
+ import { isNullOrUndefined as $e } from "../../utils/utils.js";
17
+ import { storeOriginalDatasetColors as ze, restoreOriginalDatasetColors as We } from "./utils/highlightUtils.js";
18
+ const Ze = { class: "chart-plane-container" }, Xe = {
19
+ key: 0,
20
+ class: "header-wrapper"
21
+ }, je = {
22
+ key: 1,
23
+ class: "chart-plane"
24
+ }, qe = { class: "chart" }, mt = /* @__PURE__ */ ae({
25
+ __name: "ChartPlane",
26
+ props: {
27
+ dataSets: { default: () => [] },
28
+ visibleIds: { default: () => [] },
29
+ highlightedId: { default: null },
30
+ chartType: { default: u.Line },
31
+ parsing: { default: void 0 },
32
+ xAxisFormat: { default: "string" },
33
+ yAxisFormat: { default: "number" },
34
+ xAxisDateInterval: { default: Pe.DAILY },
35
+ tickCount: { default: Ee },
36
+ truncateTickLabels: { type: Boolean, default: !1 },
37
+ header: { default: "" },
38
+ subheader: { default: "" },
39
+ subheaderTooltip: { default: null },
40
+ keepSubheaderVisible: { type: Boolean, default: !1 },
41
+ loading: { type: Boolean, default: !1 },
42
+ empty: { type: Boolean, default: !1 },
43
+ noDataIcon: { default: "file-search" },
44
+ noDataTitle: { default: "No data to display" },
45
+ noDataSubtitle: { default: "Search again with different filters" },
46
+ withAnimation: { type: Boolean, default: !0 },
47
+ typeSwitcher: { type: Boolean, default: !0 },
48
+ height: { default: "100%" },
49
+ compactHeader: { type: Boolean, default: !1 },
50
+ noteText: { default: "" },
51
+ tooltipRespectsTopEdge: { type: Boolean, default: !0 },
52
+ tooltipTotalType: { default: U.Total },
53
+ tooltipTotalCalcFn: { type: Function, default: _e },
54
+ tooltipOrder: { default: M.Legend },
55
+ trendValue: { default: null },
56
+ trendDirection: { default: we.UP },
57
+ trendTooltip: { default: null },
58
+ totalsChart: { type: Boolean, default: !1 },
59
+ colorsMap: { default: () => ({}) },
60
+ valueSuffix: { default: "" },
61
+ valuePrefix: { default: "" }
62
+ },
63
+ emits: ["update:chartType"],
64
+ setup(o, { emit: Y }) {
65
+ const e = o;
66
+ oe((t) => ({
67
+ "11153e48": s(q),
68
+ 30644433: o.height
69
+ }));
70
+ const G = Ke(Se);
71
+ P.register(
72
+ fe,
73
+ pe,
74
+ he,
75
+ me,
76
+ ve,
77
+ ye,
78
+ Te,
79
+ Ce,
80
+ be,
81
+ ge,
82
+ xe,
83
+ ke,
84
+ Ae
85
+ );
86
+ const T = Me(e, "chartType", Y), _ = l(
87
+ () => e.withAnimation ? "" : "none"
88
+ ), m = k(null);
89
+ let n = null;
90
+ const R = l(() => e.empty || e.dataSets.length === 0), c = l(() => !e.loading && !R.value), C = () => {
91
+ m.value && (n && n.destroy(), n = new P(m.value, O.value));
92
+ }, $ = () => {
93
+ n && (n.data.datasets = D.value, n.options = O.value.options, n.update(_.value));
94
+ };
95
+ le(C), v(() => e.chartType, C), v(c, async (t) => {
96
+ t && (await re(), C());
97
+ }), v(
98
+ [
99
+ () => e.visibleIds,
100
+ () => e.dataSets,
101
+ () => e.valuePrefix,
102
+ () => e.valueSuffix
103
+ ],
104
+ $
105
+ );
106
+ const f = l(() => e.totalsChart), b = l(
107
+ () => e.chartType === u.StackedLine || e.chartType === u.StackedBar || f.value
108
+ ), g = l(
109
+ () => e.chartType === u.Line || e.chartType === u.StackedLine
110
+ ), z = l(() => f.value && !e.parsing.xAxisKey ? { ...e.parsing, xAxisKey: w } : e.parsing), W = l(() => f.value ? e.dataSets.map((t) => ({
111
+ ...t,
112
+ data: t.data.map((i) => ({
113
+ ...i,
114
+ [w]: t.label
115
+ }))
116
+ })) : e.dataSets), x = l(
117
+ () => W.value.filter((t) => e.visibleIds.includes(t.id))
118
+ ), Z = (t) => e.colorsMap[t] || Ge, B = l(
119
+ () => x.value.length && x.value.every(
120
+ (t) => t.data.length === 1
121
+ )
122
+ ), D = l(() => x.value.map((t, i) => {
123
+ const a = Z(t.id), r = b.value ? i !== 0 ? "-1" : "start" : void 0;
124
+ return {
125
+ ...t,
126
+ fill: r,
127
+ backgroundColor: h(
128
+ a,
129
+ e.chartType === u.StackedLine ? 10 : 70
130
+ ),
131
+ borderColor: a,
132
+ pointBackgroundColor: a,
133
+ pointHoverBorderColor: a,
134
+ maxBarThickness: 50,
135
+ clip: 5,
136
+ // draw a bit outside the chart area
137
+ icon: t.icon || null,
138
+ iconType: t.iconType || "branded",
139
+ [V]: a
140
+ // store base color for later use
141
+ };
142
+ })), X = l(
143
+ () => e.tooltipTotalType === U.Total ? "Total" : "Mean"
144
+ ), O = l(() => ({
145
+ type: e.chartType == u.Bar || e.chartType === u.StackedBar ? "bar" : "line",
146
+ // Chart Data
147
+ data: {
148
+ datasets: D.value
149
+ },
150
+ // Chart Options
151
+ options: {
152
+ parsing: z.value,
153
+ interaction: {
154
+ intersect: !1,
155
+ mode: f.value ? "point" : "index",
156
+ axis: "x"
157
+ },
158
+ // plugins
159
+ plugins: {
160
+ legend: { display: !1 },
161
+ title: { display: !1 },
162
+ hoverVerticalLine: g.value,
163
+ // tooltip
164
+ tooltip: {
165
+ enabled: !1,
166
+ position: "average",
167
+ external: ({ tooltip: t }) => {
168
+ d.value = { ...t };
169
+ },
170
+ callbacks: {
171
+ footer: (t) => {
172
+ const i = t.map((r) => r.parsed.y || 0), a = e.tooltipTotalCalcFn(
173
+ i,
174
+ e.tooltipTotalType
175
+ );
176
+ return [X.value, String(a)];
177
+ }
178
+ },
179
+ itemSort: (t, i) => {
180
+ if (e.tooltipOrder === M.YAxis) {
181
+ const a = t.parsed.y || 0, r = i.parsed.y || 0;
182
+ return a === r ? 0 : a > r ? -1 : 1;
183
+ }
184
+ return 0;
185
+ }
186
+ }
187
+ },
188
+ // chart layout
189
+ responsive: !0,
190
+ maintainAspectRatio: !1,
191
+ layout: {
192
+ padding: Re
193
+ },
194
+ // basic styles
195
+ elements: {
196
+ line: {
197
+ borderWidth: 2,
198
+ tension: 0.3
199
+ },
200
+ point: {
201
+ radius: B.value ? 3 : 1,
202
+ hitRadius: 8,
203
+ borderWidth: 0,
204
+ hoverRadius: 4,
205
+ hoverBorderWidth: 2,
206
+ pointHoverBackgroundColor: Be
207
+ },
208
+ bar: {
209
+ borderRadius: 4
210
+ }
211
+ },
212
+ scales: {
213
+ // Horizontal Axis (X)
214
+ x: {
215
+ beginAtZero: !0,
216
+ offset: !g.value || B.value,
217
+ border: { display: !1 },
218
+ stacked: b.value,
219
+ // stack on top of each other
220
+ // ticks
221
+ ticks: {
222
+ color: N,
223
+ font: F,
224
+ padding: 4,
225
+ maxRotation: 0,
226
+ autoSkip: !e.truncateTickLabels,
227
+ autoSkipPadding: 8,
228
+ callback: function(t, i, a) {
229
+ const r = this.getLabelForValue(t), ee = g.value && !f.value ? a.length - 1 : a.length, te = this.chart.scales?.x?.width / ee - De;
230
+ return G({
231
+ label: r,
232
+ format: e.xAxisFormat,
233
+ availableSpace: te,
234
+ truncate: e.truncateTickLabels
235
+ });
236
+ }
237
+ },
238
+ // grid lines
239
+ grid: {
240
+ color: K,
241
+ drawOnChartArea: !1,
242
+ drawTicks: !0,
243
+ drawBorder: !1,
244
+ tickLength: 7
245
+ }
246
+ },
247
+ // Vertical Axis (Y)
248
+ y: {
249
+ beginAtZero: !0,
250
+ border: { display: !1 },
251
+ // hide left borderline
252
+ stacked: b.value,
253
+ // stack on top of each other
254
+ // ticks
255
+ ticks: {
256
+ color: N,
257
+ font: F,
258
+ count: e.tickCount + 1,
259
+ padding: 8,
260
+ min: 0,
261
+ callback: (t) => e.valuePrefix + Le(t, e.yAxisFormat) + e.valueSuffix
262
+ },
263
+ // grid lines
264
+ grid: {
265
+ color: K,
266
+ drawOnChartArea: !0,
267
+ drawTicks: !1
268
+ }
269
+ }
270
+ }
271
+ }
272
+ })), I = k(null), d = k(null), { position: H } = Ve(
273
+ m,
274
+ I,
275
+ d,
276
+ e.tooltipRespectsTopEdge
277
+ ), j = l(() => ({
278
+ left: `${H.value.left}px`,
279
+ top: `${H.value.top}px`,
280
+ opacity: d.value?.opacity || 0
281
+ })), q = l(
282
+ () => (e.compactHeader ? Ie : Oe) + "px"
283
+ );
284
+ v(
285
+ () => e.highlightedId,
286
+ (t) => {
287
+ n && ($e(t) ? Q() : J(t), n.update());
288
+ }
289
+ );
290
+ const J = (t) => {
291
+ (n?.data.datasets || []).forEach((a) => {
292
+ ze(a);
293
+ const r = a[V];
294
+ a.id === t ? e.chartType === u.StackedLine && (a.backgroundColor = h(
295
+ r,
296
+ He
297
+ )) : (a.backgroundColor = h(r, y), a.borderColor = h(r, y), a.pointBackgroundColor = h(r, y), a.pointHoverBorderColor = h(r, y));
298
+ });
299
+ }, Q = () => {
300
+ (n?.data.datasets || []).forEach(We);
301
+ };
302
+ return (t, i) => (p(), A("div", Ze, [
303
+ s(c) || o.keepSubheaderVisible ? (p(), A("div", Xe, [
304
+ ie(Fe, {
305
+ "chart-type": s(T),
306
+ "onUpdate:chart-type": i[0] || (i[0] = (a) => ne(T) ? T.value = a : null),
307
+ "type-switcher": s(c) ? o.typeSwitcher : !1,
308
+ header: s(c) ? o.header : null,
309
+ subheader: o.subheader,
310
+ "subheader-tooltip": o.subheaderTooltip,
311
+ "trend-tooltip": o.trendTooltip,
312
+ compact: o.compactHeader,
313
+ "trend-value": s(c) ? o.trendValue : null,
314
+ "trend-direction": o.trendDirection,
315
+ "note-text": o.noteText
316
+ }, se({ _: 2 }, [
317
+ t.$slots["subheader-tooltip"] ? {
318
+ name: "subheader-tooltip",
319
+ fn: ue(() => [
320
+ de(t.$slots, "subheader-tooltip", {}, void 0, !0)
321
+ ]),
322
+ key: "0"
323
+ } : void 0
324
+ ]), 1032, ["chart-type", "type-switcher", "header", "subheader", "subheader-tooltip", "trend-tooltip", "compact", "trend-value", "trend-direction", "note-text"])
325
+ ])) : S("", !0),
326
+ s(c) ? (p(), A("section", je, [
327
+ L("div", qe, [
328
+ L("canvas", {
329
+ ref_key: "chartRef",
330
+ ref: m,
331
+ class: "chart__canvas"
332
+ }, null, 512),
333
+ L("div", {
334
+ ref_key: "tooltipRef",
335
+ ref: I,
336
+ class: "chart__tooltip",
337
+ style: ce(s(j))
338
+ }, [
339
+ d.value ? (p(), E(Ne, {
340
+ key: 0,
341
+ "totals-chart": s(f),
342
+ title: String(d.value.title),
343
+ "data-points": d.value.dataPoints,
344
+ "x-axis-format": o.xAxisFormat,
345
+ "y-axis-format": o.yAxisFormat,
346
+ "x-axis-date-interval": o.xAxisDateInterval,
347
+ "total-label": d.value.footer?.[0],
348
+ "total-value": Number(d.value.footer?.[1]),
349
+ "value-suffix": o.valueSuffix,
350
+ "value-prefix": o.valuePrefix
351
+ }, null, 8, ["totals-chart", "title", "data-points", "x-axis-format", "y-axis-format", "x-axis-date-interval", "total-label", "total-value", "value-suffix", "value-prefix"])) : S("", !0)
352
+ ], 4)
353
+ ])
354
+ ])) : o.loading ? (p(), E(Ye, {
355
+ key: 2,
356
+ class: "chart-loading"
357
+ })) : s(R) ? (p(), E(s(Ue), {
358
+ key: 3,
359
+ class: "chart-empty",
360
+ variant: null,
361
+ title: o.noDataTitle,
362
+ subtitle: o.noDataSubtitle,
363
+ "icon-name": o.noDataIcon
364
+ }, null, 8, ["title", "subtitle", "icon-name"])) : S("", !0)
365
+ ]));
366
+ }
367
+ });
368
+ export {
369
+ mt as default
370
+ };