sag_components 1.0.975 → 1.0.976
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.
- package/dist/Button.test.js +10 -10
- package/dist/LinkButton.test.js +10 -10
- package/dist/SingleBar.test.js +2 -2
- package/dist/index.js +1 -1
- package/dist/stories/components/AttachedFile/AttachedFile.js +1 -1
- package/dist/stories/components/AttachedFile/AttachedFile.style.js +40 -6
- package/dist/stories/components/BannerEventBox/BannerEventBox.js +33 -23
- package/dist/stories/components/BannerEventBox/BannerEventBox.style.js +71 -15
- package/dist/stories/components/BannerEventBoxList/BannerEventBoxList.js +10 -5
- package/dist/stories/components/BannerEventBoxList/BannerEventBoxList.style.js +182 -16
- package/dist/stories/components/BannersDropdown/BannersDropdown.style.js +91 -10
- package/dist/stories/components/BarChart/BarChart.js +5 -3
- package/dist/stories/components/BarChart/BarChart.stories.js +29 -20
- package/dist/stories/components/BarChart/BarChart.style.js +52 -10
- package/dist/stories/components/BarChartTwoRows/BarChartTwoRows.js +53 -44
- package/dist/stories/components/BarChartTwoRows/BarChartTwoRows.stories.js +166 -40
- package/dist/stories/components/BarChartTwoRows/BarChartTwoRows.style.js +72 -11
- package/dist/stories/components/BarChartsByWeeks/BarChartsByWeeks.js +7 -3
- package/dist/stories/components/BarChartsByWeeks/BarChartsByWeeks.style.js +88 -13
- package/dist/stories/components/Benchmark/Benchmark.style.js +53 -7
- package/dist/stories/components/Button/Button.js +1 -1
- package/dist/stories/components/Button/Button.style.js +82 -7
- package/dist/stories/components/CampaignDemoReport/CampaignDemoReport.style.js +40 -7
- package/dist/stories/components/Card/Card.style.js +57 -10
- package/dist/stories/components/CheckBox/CheckBox.style.js +28 -6
- package/dist/stories/components/CheckBoxButton/CheckBoxButton.style.js +31 -6
- package/dist/stories/components/CodeEditor/CodeEditor.style.js +4 -3
- package/dist/stories/components/CollapseData/CollapseData.js +5 -5
- package/dist/stories/components/CollapseData/CollapseData.style.js +119 -13
- package/dist/stories/components/CollapseHeader/CollapseHeader.js +2 -1
- package/dist/stories/components/CollapseHeader/CollapseHeader.style.js +192 -27
- package/dist/stories/components/CollapseMenuItem/CollapseMenuItem.style.js +53 -9
- package/dist/stories/components/Datepicker/Datepicker.style.js +9 -3
- package/dist/stories/components/DownloadProgress/DownloadProgress.style.js +43 -6
- package/dist/stories/components/Dropdown/Dropdown.style.js +9 -3
- package/dist/stories/components/DropdownMulti/DropdownMulti.js +290 -0
- package/dist/stories/components/DropdownMulti/DropdownMulti.stories.js +220 -0
- package/dist/stories/components/DropdownMulti/DropdownMulti.style.js +11 -0
- package/dist/stories/components/DropdownMultiNew/DropdownMultiNew.js +49 -36
- package/dist/stories/components/DropdownMultiNew/DropdownMultiNew.style.js +204 -16
- package/dist/stories/components/DropdownNew/DropdownNew.js +21 -11
- package/dist/stories/components/DropdownNew/DropdownNew.stories.js +18 -9
- package/dist/stories/components/DropdownNew/DropdownNew.style.js +13 -3
- package/dist/stories/components/DropdownSingleNew/DropdownSingleNew.js +30 -10
- package/dist/stories/components/DropdownSingleNew/DropdownSingleNew.style.js +175 -14
- package/dist/stories/components/EventDetailsCard/EventDetailsCard.style.js +86 -10
- package/dist/stories/components/EventList/EventList.style.js +30 -6
- package/dist/stories/components/EventListItem/EventListItem.style.js +39 -6
- package/dist/stories/components/FilterContainer/FilterContainer.style.js +22 -5
- package/dist/stories/components/FilterPanel/FilterPanel.js +22 -17
- package/dist/stories/components/FilterPanel/FilterPanel.style.js +81 -13
- package/dist/stories/components/FilterPanel.js +4 -0
- package/dist/stories/components/FormattedValue/FormattedValue.style.js +83 -10
- package/dist/stories/components/IconButton/IconButton.style.js +56 -7
- package/dist/stories/components/Input/Input.style.js +122 -9
- package/dist/stories/components/InputOld/InputOld.style.js +61 -8
- package/dist/stories/components/KpiFilter/KpiFilter.js +18 -1
- package/dist/stories/components/KpiFilter/KpiFilter.style.js +124 -18
- package/dist/stories/components/LinkButton/LinkButton.style.js +45 -6
- package/dist/stories/components/LinnerDataBox/LinnerDataBox.js +4 -2
- package/dist/stories/components/LinnerDataBox/LinnerDataBox.stories.js +32 -10
- package/dist/stories/components/LinnerDataBox/LinnerDataBox.style.js +60 -14
- package/dist/stories/components/ListBox/ListBox.style.js +40 -6
- package/dist/stories/components/MarketShareDescription/MarketShareDescription.stories.js +17 -3
- package/dist/stories/components/MarketShareDescription/MarketShareDescription.style.js +207 -19
- package/dist/stories/components/Modal/Modal.style.js +56 -8
- package/dist/stories/components/Modal/ModalTotalBenchmark.js +6 -6
- package/dist/stories/components/MonthPicker/MonthPicker.js +2 -2
- package/dist/stories/components/MonthPicker/MonthPicker.style.js +95 -10
- package/dist/stories/components/MonthPicker/MonthPopupPicker.js +91 -13
- package/dist/stories/components/MultipleCard/MultipleCard.style.js +5 -3
- package/dist/stories/components/NoDataFoundMessage/NoDataFoundMessage.style.js +31 -5
- package/dist/stories/components/OneColumnContainer/OneColumnContainer.style.js +99 -12
- package/dist/stories/components/PageFilterBar/PageFilterBar.style.js +14 -4
- package/dist/stories/components/PerformanceAnalytics/PerformanceAnalytics.js +16 -9
- package/dist/stories/components/PerformanceAnalytics/PerformanceAnalytics.style.js +136 -17
- package/dist/stories/components/PerformanceAnalyticsLegend/PerformanceAnalyticsLegend.js +14 -13
- package/dist/stories/components/PerformanceAnalyticsLegend/PerformanceAnalyticsLegend.style.js +55 -8
- package/dist/stories/components/PerformanceAnalyticsOneColumn/PerformanceAnalyticsOneColumn.js +12 -5
- package/dist/stories/components/PerformanceAnalyticsOneColumn/PerformanceAnalyticsOneColumn.style.js +108 -15
- package/dist/stories/components/PerformanceAnalyticsTotals/PerformanceAnalyticsTotals.js +1 -1
- package/dist/stories/components/PerformanceAnalyticsTotals/PerformanceAnalyticsTotals.style.js +81 -12
- package/dist/stories/components/Popup/Popup.style.js +114 -16
- package/dist/stories/components/PopupCharts/PopupCharts.style.js +100 -15
- package/dist/stories/components/PopupContent/PopupContent.style.js +64 -11
- package/dist/stories/components/ProductsVariety/ProductsVariety.style.js +78 -12
- package/dist/stories/components/ProgressBar/ProgressBar.style.js +15 -4
- package/dist/stories/components/QuarterPicker/QuarterPicker.js +2 -2
- package/dist/stories/components/QuarterPicker/QuarterPicker.style.js +94 -10
- package/dist/stories/components/QuarterPicker/QuarterPopupPicker.js +85 -12
- package/dist/stories/components/QuickFilter/QuickFilter.style.js +13 -3
- package/dist/stories/components/QuickFilter/QuickFilterDropdownMultiSelection.js +2 -2
- package/dist/stories/components/QuickFilter/QuickFilterDropdownMultiSelection.style.js +182 -16
- package/dist/stories/components/QuickFilter/QuickFilterDropdownSingle.js +1 -1
- package/dist/stories/components/QuickFilter/QuickFilterDropdownSingle.style.js +127 -15
- package/dist/stories/components/QuickFilterDropdownMultiSelection.js +1 -1
- package/dist/stories/components/QuickFilterDropdownSingle.js +1 -1
- package/dist/stories/components/RangePicker/RangeDatePicker.js +95 -12
- package/dist/stories/components/RangePicker/RangePicker.js +2 -2
- package/dist/stories/components/RangePicker/RangePicker.style.js +99 -10
- package/dist/stories/components/ReportTable/ReportTable.style.js +123 -14
- package/dist/stories/components/SagButton/SagButton.style.js +39 -5
- package/dist/stories/components/SagIconButton/SagIconButton.style.js +22 -4
- package/dist/stories/components/SagInput/SagInput.style.js +33 -5
- package/dist/stories/components/SalesAndROI/SalesAndROI.style.js +103 -11
- package/dist/stories/components/SearchInput/SearchInput.style.js +29 -4
- package/dist/stories/components/SegmentedButton/SegmentedButton.js +5 -5
- package/dist/stories/components/SegmentedButton/SegmentedButton.style.js +90 -9
- package/dist/stories/components/Select/Select.style.js +92 -9
- package/dist/stories/components/TabMenu/TabMenu.js +19 -7
- package/dist/stories/components/TabMenu/TabMenu.style.js +105 -14
- package/dist/stories/components/Table/Table.js +2 -2
- package/dist/stories/components/Table/Table.style.js +78 -9
- package/dist/stories/components/TextField/TextField.style.js +10 -3
- package/dist/stories/components/TitleDescription/TitleDescription.style.js +214 -28
- package/dist/stories/components/Tooltip/Tooltip.js +1 -1
- package/dist/stories/components/Tooltip/Tooltip.style.js +90 -5
- package/dist/stories/components/TopToggleList/TopToggleList.style.js +43 -8
- package/dist/stories/components/TotalBenchmark/TotalBenchmark.style.js +71 -11
- package/dist/stories/components/TotalBenchmarkAreachart/TotalBenchmarkAreachart.js +3 -3
- package/dist/stories/components/TotalBenchmarkAreachart/TotalBenchmarkAreachart.style.js +163 -22
- package/dist/stories/components/TotalBenchmarkArrows/TotalBenchmarkArrows.style.js +100 -16
- package/dist/stories/components/TotalBenchmarkBarchart/TotalBenchmarkBarchart.style.js +69 -12
- package/dist/stories/components/TotalDoughnutChart/TotalDoughnutChart.js +3 -3
- package/dist/stories/components/TotalDoughnutChart/TotalDoughnutChart.style.js +170 -22
- package/dist/stories/components/TotalHorizontalCharts/TotalHorizontalCharts.js +47 -32
- package/dist/stories/components/TotalHorizontalCharts/TotalHorizontalCharts.stories.js +52 -14
- package/dist/stories/components/TotalHorizontalCharts/TotalHorizontalCharts.style.js +51 -13
- package/dist/stories/components/TspanTooltip/TspanTooltip.js +3 -3
- package/dist/stories/components/TspanTooltip/TspanTooltip.style.js +97 -5
- package/dist/stories/components/TwoBarCharts/TwoBarCharts.js +6 -4
- package/dist/stories/components/TwoBarCharts/TwoBarCharts.stories.js +88 -23
- package/dist/stories/components/TwoBarCharts/TwoBarCharts.style.js +52 -10
- package/dist/stories/utils/CommonFunctions.js +13 -8
- package/package.json +1 -1
- package/dist/stories/components/HaiTooltip.js +0 -71
- package/dist/stories/components/HaiTooltip.style.js +0 -12
- package/dist/stories/components/Rbackup.js +0 -453
- package/dist/stories/components/TableTooltip.js +0 -71
- package/dist/stories/components/TableTooltip.style.js +0 -12
|
@@ -5,26 +5,174 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.TooltipLabel = exports.TooltipDiv = exports.TitleAndValueContainer = exports.Title = exports.TextAfterValue = exports.LegendTitleAndFormatedValueContainer = exports.LegendTitle = exports.LegendFormattedValue = exports.LegendFormatedValueContainer = exports.LegendControlsContainer = exports.LegendContainer = exports.LegendColorRectangle = exports.FormattedValue = exports.DoughnutChartContainer = exports.DoughnutChartAndLegendContainer = exports.CurrencySignAndFormattedValueContainer = exports.CurrencySign = exports.ControlsContainer = exports.Controls = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
9
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
9
|
+
const scrollableStyles = `
|
|
10
|
+
overflow-y: auto;
|
|
11
|
+
|
|
12
|
+
&::-webkit-scrollbar {
|
|
13
|
+
width: 8px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&::-webkit-scrollbar-track {
|
|
17
|
+
background: #E8E8E8;
|
|
18
|
+
border-radius: 5px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&::-webkit-scrollbar-thumb {
|
|
22
|
+
background: #D0D0D0;
|
|
23
|
+
border-radius: 5px;
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
const ControlsContainer = exports.ControlsContainer = _styledComponents.default.div`
|
|
27
|
+
position: relative;
|
|
28
|
+
font-family: "Poppins", sans-serif;
|
|
29
|
+
font-style: normal;
|
|
30
|
+
font-size: ${props => props.rootFont};
|
|
31
|
+
color: ${props => props.textColor};
|
|
32
|
+
width: ${props => props.width};
|
|
33
|
+
height: ${props => props.height};
|
|
34
|
+
border-radius: 12px;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
@media (max-width: 1536px) {
|
|
38
|
+
${scrollableStyles}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
> * {
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
const Controls = exports.Controls = _styledComponents.default.div`
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
width: 100%;
|
|
49
|
+
height: 100%;
|
|
50
|
+
background: white;
|
|
51
|
+
border-radius: 12px;
|
|
52
|
+
`;
|
|
53
|
+
const TooltipDiv = exports.TooltipDiv = _styledComponents.default.div`
|
|
54
|
+
display: flex;
|
|
55
|
+
background: white;
|
|
56
|
+
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);
|
|
57
|
+
border-radius: 5px;
|
|
58
|
+
padding: 6px 10px;
|
|
59
|
+
margin: 0;
|
|
60
|
+
`;
|
|
61
|
+
const TooltipLabel = exports.TooltipLabel = _styledComponents.default.p`
|
|
62
|
+
color: #212121;
|
|
63
|
+
font-family: "Poppins", sans-serif;
|
|
64
|
+
font-size: 12px;
|
|
65
|
+
font-weight: 400;
|
|
66
|
+
font-style: normal;
|
|
67
|
+
width: max-content; // fit-content;
|
|
68
|
+
line-height: normal;
|
|
69
|
+
margin: 0;
|
|
70
|
+
`;
|
|
71
|
+
const TitleAndValueContainer = exports.TitleAndValueContainer = _styledComponents.default.div`
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-direction: column;
|
|
74
|
+
padding: 0 20px;
|
|
75
|
+
`;
|
|
76
|
+
const Title = exports.Title = _styledComponents.default.h4`
|
|
77
|
+
font-weight: 500;
|
|
78
|
+
font-size: 1rem;
|
|
79
|
+
margin: 0;
|
|
80
|
+
@media (max-width: 1536px) {
|
|
81
|
+
font-size: 14px;
|
|
82
|
+
}
|
|
83
|
+
@media (max-width: 1366px) {
|
|
84
|
+
font-size: 12px;
|
|
85
|
+
}
|
|
86
|
+
`;
|
|
87
|
+
const CurrencySignAndFormattedValueContainer = exports.CurrencySignAndFormattedValueContainer = _styledComponents.default.div`
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
gap: 5px;
|
|
91
|
+
align-items: baseline;
|
|
92
|
+
`;
|
|
93
|
+
const CurrencySign = exports.CurrencySign = _styledComponents.default.span`
|
|
94
|
+
font-weight: 500;
|
|
95
|
+
font-size: 16px;
|
|
96
|
+
@media (max-width: 1536px) {
|
|
97
|
+
font-size: 14px;
|
|
98
|
+
}
|
|
99
|
+
@media (max-width: 1366px) {
|
|
100
|
+
font-size: 11px;
|
|
101
|
+
}
|
|
102
|
+
`;
|
|
103
|
+
const FormattedValue = exports.FormattedValue = _styledComponents.default.div`
|
|
104
|
+
font-weight: 500;
|
|
105
|
+
font-size: 40px;
|
|
106
|
+
@media (max-width: 1536px) {
|
|
107
|
+
font-size: 24px;
|
|
108
|
+
}
|
|
109
|
+
@media (max-width: 1366px) {
|
|
110
|
+
font-size: 20px;
|
|
111
|
+
}
|
|
112
|
+
`;
|
|
113
|
+
const TextAfterValue = exports.TextAfterValue = _styledComponents.default.div`
|
|
114
|
+
font-weight: 400;
|
|
115
|
+
font-size: 12px;
|
|
116
|
+
@media (max-width: 1536px) {
|
|
117
|
+
font-size: 11px;
|
|
118
|
+
}
|
|
119
|
+
@media (max-width: 1366px) {
|
|
120
|
+
font-size: 10px;
|
|
121
|
+
}
|
|
122
|
+
`;
|
|
123
|
+
const DoughnutChartAndLegendContainer = exports.DoughnutChartAndLegendContainer = _styledComponents.default.div`
|
|
124
|
+
display: flex;
|
|
125
|
+
justify-content: space-between;
|
|
126
|
+
margin-top: auto;
|
|
127
|
+
padding: 0 20px ;
|
|
128
|
+
margin-bottom: 20px;
|
|
129
|
+
`;
|
|
130
|
+
const DoughnutChartContainer = exports.DoughnutChartContainer = _styledComponents.default.div`
|
|
131
|
+
display: flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
min-width: 90px;
|
|
134
|
+
min-height: 90px;
|
|
135
|
+
`;
|
|
136
|
+
const LegendContainer = exports.LegendContainer = _styledComponents.default.div`
|
|
137
|
+
padding-left: 10px;
|
|
138
|
+
display: flex;
|
|
139
|
+
flex-direction: column;
|
|
140
|
+
justify-content: space-evenly;
|
|
141
|
+
`;
|
|
142
|
+
const LegendControlsContainer = exports.LegendControlsContainer = _styledComponents.default.div`
|
|
143
|
+
display: flex;
|
|
144
|
+
gap: 0.5rem;
|
|
145
|
+
align-items: center;
|
|
146
|
+
margin-bottom: 0.375rem;
|
|
147
|
+
`;
|
|
148
|
+
const LegendTitleAndFormatedValueContainer = exports.LegendTitleAndFormatedValueContainer = _styledComponents.default.div`
|
|
149
|
+
flex-grow: 1;
|
|
150
|
+
`;
|
|
151
|
+
const LegendFormatedValueContainer = exports.LegendFormatedValueContainer = _styledComponents.default.div`
|
|
152
|
+
font-size: 0.875rem;
|
|
153
|
+
`;
|
|
154
|
+
const LegendColorRectangle = exports.LegendColorRectangle = _styledComponents.default.div`
|
|
155
|
+
width: 0.875rem;
|
|
156
|
+
min-width: 0.875rem;
|
|
157
|
+
height: 0.875rem;
|
|
158
|
+
border-radius: 2px;
|
|
159
|
+
background: ${props => props.color};
|
|
160
|
+
`;
|
|
161
|
+
const LegendTitle = exports.LegendTitle = _styledComponents.default.h5`
|
|
162
|
+
font-weight: 400;
|
|
163
|
+
font-size: 16px;
|
|
164
|
+
gap: 5px;
|
|
165
|
+
margin: 0;
|
|
166
|
+
display: flex;
|
|
167
|
+
justify-content: space-between;
|
|
168
|
+
@media (max-width: 1536px) {
|
|
169
|
+
font-size: 11px;
|
|
170
|
+
}
|
|
171
|
+
@media (max-width: 1366px) {
|
|
172
|
+
font-size: 10px;
|
|
173
|
+
}
|
|
174
|
+
`;
|
|
175
|
+
const LegendFormattedValue = exports.LegendFormattedValue = _styledComponents.default.span`
|
|
176
|
+
font-weight: 500;
|
|
177
|
+
white-space: nowrap;
|
|
178
|
+
`;
|
|
@@ -12,6 +12,12 @@ var _TspanTooltip = _interopRequireDefault(require("../TspanTooltip/TspanTooltip
|
|
|
12
12
|
var _NoDataFoundMessage = require("../NoDataFoundMessage/NoDataFoundMessage");
|
|
13
13
|
var _CommonFunctions = require("../../utils/CommonFunctions");
|
|
14
14
|
var _TotalHorizontalCharts = require("./TotalHorizontalCharts.style");
|
|
15
|
+
/* eslint-disable no-unused-vars */
|
|
16
|
+
/* eslint-disable react/prop-types */
|
|
17
|
+
/* eslint-disable react/no-unstable-nested-components */
|
|
18
|
+
/* eslint-disable no-shadow */
|
|
19
|
+
/* eslint-disable react/destructuring-assignment */
|
|
20
|
+
|
|
15
21
|
const TotalHorizontalCharts = props => {
|
|
16
22
|
const {
|
|
17
23
|
title,
|
|
@@ -24,6 +30,7 @@ const TotalHorizontalCharts = props => {
|
|
|
24
30
|
labelLimitedLetters,
|
|
25
31
|
width,
|
|
26
32
|
height,
|
|
33
|
+
barsMargin,
|
|
27
34
|
rightGap,
|
|
28
35
|
textColor,
|
|
29
36
|
noDataText,
|
|
@@ -34,21 +41,32 @@ const TotalHorizontalCharts = props => {
|
|
|
34
41
|
className
|
|
35
42
|
} = props;
|
|
36
43
|
const barBackgrounds = chartsData.map(bg => bg.color);
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const
|
|
44
|
+
const topHeader = (0, _react.useRef)();
|
|
45
|
+
const wrapper = (0, _react.useRef)();
|
|
46
|
+
const [chartHeight, setChartHeight] = (0, _react.useState)('100%');
|
|
47
|
+
const calcHeight = () => {
|
|
48
|
+
if (wrapper.current && topHeader.current) {
|
|
49
|
+
const availableHeight = Math.max(wrapper.current.clientHeight - topHeader.current.clientHeight, 0);
|
|
50
|
+
return availableHeight / wrapper.current.clientHeight * 100;
|
|
51
|
+
}
|
|
52
|
+
return 100;
|
|
53
|
+
};
|
|
54
|
+
const updateChartHeight = () => {
|
|
55
|
+
setChartHeight(`${calcHeight()}%`);
|
|
56
|
+
};
|
|
57
|
+
(0, _react.useEffect)(() => {
|
|
58
|
+
updateChartHeight();
|
|
59
|
+
window.addEventListener('resize', updateChartHeight);
|
|
60
|
+
return () => {
|
|
61
|
+
window.removeEventListener('resize', updateChartHeight);
|
|
62
|
+
};
|
|
63
|
+
}, []);
|
|
40
64
|
const [showLegendTooltip, setShowLegendTooltip] = (0, _react.useState)(false);
|
|
41
65
|
const [tooltipText, setTooltipText] = (0, _react.useState)({
|
|
42
66
|
content: '',
|
|
43
67
|
clientX: 0,
|
|
44
68
|
clientY: 0
|
|
45
69
|
});
|
|
46
|
-
(0, _react.useEffect)(() => {
|
|
47
|
-
if (chartContainerRef.current) {
|
|
48
|
-
setWidthChartContainer(chartContainerRef.current.clientWidth);
|
|
49
|
-
setHeightChartContainer(chartContainerRef.current.clientHeight);
|
|
50
|
-
}
|
|
51
|
-
}, [width, height]);
|
|
52
70
|
const CustomizedLabel = props => showPercentAsideValue ? /*#__PURE__*/_react.default.createElement("text", {
|
|
53
71
|
x: props.x + (props.width <= 0 ? -12 : props.width) + 56,
|
|
54
72
|
y: props.y + 4,
|
|
@@ -60,7 +78,7 @@ const TotalHorizontalCharts = props => {
|
|
|
60
78
|
textAnchor: "middle"
|
|
61
79
|
}, ''.concat((0, _CommonFunctions.getFormattedValue)(props.value), (0, _CommonFunctions.getFormattedUnits)(props.value)), /*#__PURE__*/_react.default.createElement("tspan", {
|
|
62
80
|
fontWeight: 400
|
|
63
|
-
},
|
|
81
|
+
}, ` (${(props.value / value * 100).toFixed(0)}%)`)) : /*#__PURE__*/_react.default.createElement("text", {
|
|
64
82
|
x: props.x + (props.width <= 0 ? -12 : props.width) + 40,
|
|
65
83
|
y: props.y + 4,
|
|
66
84
|
dy: props.height / 2,
|
|
@@ -115,36 +133,34 @@ const TotalHorizontalCharts = props => {
|
|
|
115
133
|
// verticalAnchor="middle"
|
|
116
134
|
,
|
|
117
135
|
fill: fill
|
|
118
|
-
}, payload.value.length > labelLimitedLetters - 1 ?
|
|
136
|
+
}, payload.value.length > labelLimitedLetters - 1 ? `${payload.value.slice(0, labelLimitedLetters)}...` : payload.value));
|
|
119
137
|
}
|
|
120
138
|
return null;
|
|
121
139
|
}
|
|
122
140
|
return null;
|
|
123
141
|
};
|
|
124
142
|
return /*#__PURE__*/_react.default.createElement(_TotalHorizontalCharts.ControlsContainer, {
|
|
143
|
+
ref: wrapper,
|
|
125
144
|
height: height,
|
|
126
145
|
width: width,
|
|
127
146
|
textColor: textColor,
|
|
128
147
|
className: className
|
|
129
|
-
}, (chartsData === null || chartsData === void 0 ? void 0 : chartsData.length) > 0 ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_TotalHorizontalCharts.
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
height: heightChartContainer - 10,
|
|
139
|
-
width: widthChartContainer
|
|
148
|
+
}, (chartsData === null || chartsData === void 0 ? void 0 : chartsData.length) > 0 ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_TotalHorizontalCharts.CardHeader, {
|
|
149
|
+
ref: topHeader,
|
|
150
|
+
className: "CardHeader"
|
|
151
|
+
}, /*#__PURE__*/_react.default.createElement(_TotalHorizontalCharts.Title, null, title), /*#__PURE__*/_react.default.createElement(_TotalHorizontalCharts.TotalValue, {
|
|
152
|
+
className: "TotalValue"
|
|
153
|
+
}, currencySign && /*#__PURE__*/_react.default.createElement(_TotalHorizontalCharts.CurrencySign, {
|
|
154
|
+
className: "CurrencySign"
|
|
155
|
+
}, (0, _CommonFunctions.getCurrencySign)(currencyType, value)), dotCut ? (0, _CommonFunctions.getFormattedValue)(value && Math.abs(value) > 0 && value % 1 !== 0 ? value === null || value === void 0 ? void 0 : value.toFixed(2) : value) : (0, _CommonFunctions.getNumberWithCommas)(value), dotCut ? (0, _CommonFunctions.getFormattedUnits)(value) : '')), /*#__PURE__*/_react.default.createElement(_recharts.ResponsiveContainer, {
|
|
156
|
+
height: chartHeight
|
|
140
157
|
}, /*#__PURE__*/_react.default.createElement(_recharts.ComposedChart, {
|
|
141
|
-
width: widthChartContainer * 0.4,
|
|
142
158
|
layout: "vertical",
|
|
143
159
|
data: chartsData,
|
|
144
160
|
margin: {
|
|
145
161
|
top: 10,
|
|
146
162
|
right: 20,
|
|
147
|
-
bottom:
|
|
163
|
+
bottom: barsMargin,
|
|
148
164
|
left: 10
|
|
149
165
|
}
|
|
150
166
|
}, /*#__PURE__*/_react.default.createElement(_recharts.XAxis, {
|
|
@@ -155,13 +171,11 @@ const TotalHorizontalCharts = props => {
|
|
|
155
171
|
}), /*#__PURE__*/_react.default.createElement(_recharts.YAxis, {
|
|
156
172
|
dataKey: "name",
|
|
157
173
|
type: "category",
|
|
158
|
-
width:
|
|
174
|
+
width: labelLimitedLetters * 10,
|
|
159
175
|
tickLine: false,
|
|
176
|
+
axisLine: false,
|
|
160
177
|
interval: 0,
|
|
161
178
|
allowDataOverflow: true,
|
|
162
|
-
axisLine: false
|
|
163
|
-
// tick={{ fontSize: 12 }}
|
|
164
|
-
,
|
|
165
179
|
tick: CustomizedTickBarChart
|
|
166
180
|
}), /*#__PURE__*/_react.default.createElement(_recharts.Bar, {
|
|
167
181
|
dataKey: "value",
|
|
@@ -176,7 +190,7 @@ const TotalHorizontalCharts = props => {
|
|
|
176
190
|
/*#__PURE__*/
|
|
177
191
|
// eslint-disable-next-line react/no-array-index-key
|
|
178
192
|
_react.default.createElement(_recharts.Cell, {
|
|
179
|
-
key:
|
|
193
|
+
key: `cell-${index}`,
|
|
180
194
|
fill: barBackgrounds[index % 20]
|
|
181
195
|
}))), showLegendTooltip && /*#__PURE__*/_react.default.createElement(_TspanTooltip.default, {
|
|
182
196
|
direction: "top",
|
|
@@ -186,7 +200,7 @@ const TotalHorizontalCharts = props => {
|
|
|
186
200
|
style: {
|
|
187
201
|
pointerEvents: 'none'
|
|
188
202
|
}
|
|
189
|
-
}))))
|
|
203
|
+
})))) : /*#__PURE__*/_react.default.createElement(_NoDataFoundMessage.NoDataFoundMessage, {
|
|
190
204
|
noDataText: noDataText
|
|
191
205
|
}));
|
|
192
206
|
};
|
|
@@ -200,14 +214,15 @@ TotalHorizontalCharts.defaultProps = {
|
|
|
200
214
|
currencySign: false,
|
|
201
215
|
currencyType: 'USD',
|
|
202
216
|
chartsData: [],
|
|
217
|
+
showPercentAsideValue: false,
|
|
203
218
|
labelFontSize: 10,
|
|
204
219
|
labelLimitedLetters: 12,
|
|
205
220
|
width: '100%',
|
|
206
221
|
height: '100%',
|
|
207
|
-
|
|
222
|
+
barsMargin: 0,
|
|
223
|
+
rightGap: 1,
|
|
208
224
|
textColor: '#212121',
|
|
209
225
|
noDataText: 'No Data',
|
|
210
|
-
showPercentAsideValue: false,
|
|
211
226
|
isDollar: true,
|
|
212
227
|
isPercentage: false,
|
|
213
228
|
showDollarSign: true
|
|
@@ -11,6 +11,22 @@ const chartsData1 = [{
|
|
|
11
11
|
name: 'MTN DEW GE-SODA',
|
|
12
12
|
value: 166898.22,
|
|
13
13
|
color: 'rgba(31, 118, 119, 0.6)'
|
|
14
|
+
}, {
|
|
15
|
+
name: 'CHEETOS GE-CHIPS, SNACKS',
|
|
16
|
+
value: 33380.56798,
|
|
17
|
+
color: 'rgba(31, 118, 119, 0.9)'
|
|
18
|
+
}, {
|
|
19
|
+
name: 'CHEETOS SNACKING',
|
|
20
|
+
value: 12940.18567,
|
|
21
|
+
color: 'rgba(31, 118, 119, 0.8)'
|
|
22
|
+
}, {
|
|
23
|
+
name: 'CHEETOS GE-CHIPS, SNACKS',
|
|
24
|
+
value: 33380.98,
|
|
25
|
+
color: 'rgba(31, 118, 119, 0.9)'
|
|
26
|
+
}, {
|
|
27
|
+
name: 'CHEETOS SNACKING',
|
|
28
|
+
value: 12940.18,
|
|
29
|
+
color: 'rgba(31, 118, 119, 0.8)'
|
|
14
30
|
}, {
|
|
15
31
|
name: 'CHEETOS GE-CHIPS, SNACKS',
|
|
16
32
|
value: 33380.98,
|
|
@@ -21,7 +37,7 @@ const chartsData1 = [{
|
|
|
21
37
|
color: 'rgba(31, 118, 119, 0.8)'
|
|
22
38
|
}, {
|
|
23
39
|
name: 'LAMB WESTON FF-POTATOES ONIONS',
|
|
24
|
-
value: -
|
|
40
|
+
value: -6828.24,
|
|
25
41
|
color: 'rgba(31, 118, 119, 0.7)'
|
|
26
42
|
}];
|
|
27
43
|
const chartsData2 = [{
|
|
@@ -94,6 +110,13 @@ var _default = exports.default = {
|
|
|
94
110
|
type: 'select'
|
|
95
111
|
}
|
|
96
112
|
},
|
|
113
|
+
showPercentAsideValue: {
|
|
114
|
+
name: 'Show Percent Aside Value',
|
|
115
|
+
description: 'Show the percentage aside the value',
|
|
116
|
+
control: {
|
|
117
|
+
type: 'boolean'
|
|
118
|
+
}
|
|
119
|
+
},
|
|
97
120
|
width: {
|
|
98
121
|
name: 'Width',
|
|
99
122
|
description: 'Width of the control (in px / %)',
|
|
@@ -108,6 +131,24 @@ var _default = exports.default = {
|
|
|
108
131
|
type: 'text'
|
|
109
132
|
}
|
|
110
133
|
},
|
|
134
|
+
barsMargin: {
|
|
135
|
+
name: 'Bars Margin',
|
|
136
|
+
description: 'Margin between the bars',
|
|
137
|
+
control: {
|
|
138
|
+
type: 'number',
|
|
139
|
+
min: 0,
|
|
140
|
+
max: 10
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
rightGap: {
|
|
144
|
+
name: 'Right Gap',
|
|
145
|
+
description: 'Right gap',
|
|
146
|
+
control: {
|
|
147
|
+
type: 'number',
|
|
148
|
+
min: 0,
|
|
149
|
+
max: 10
|
|
150
|
+
}
|
|
151
|
+
},
|
|
111
152
|
textColor: {
|
|
112
153
|
name: 'Text Color',
|
|
113
154
|
description: 'Sets the text color',
|
|
@@ -144,13 +185,6 @@ var _default = exports.default = {
|
|
|
144
185
|
control: {
|
|
145
186
|
type: 'text'
|
|
146
187
|
}
|
|
147
|
-
},
|
|
148
|
-
showPercentAsideValue: {
|
|
149
|
-
name: 'Show Percent Aside Value',
|
|
150
|
-
description: 'Show the percentage aside the value',
|
|
151
|
-
control: {
|
|
152
|
-
type: 'boolean'
|
|
153
|
-
}
|
|
154
188
|
}
|
|
155
189
|
}
|
|
156
190
|
};
|
|
@@ -162,13 +196,15 @@ const SalesGreenTheme = exports.SalesGreenTheme = {
|
|
|
162
196
|
currencySign: true,
|
|
163
197
|
currencyType: 'USD',
|
|
164
198
|
chartsData: chartsData1,
|
|
199
|
+
showPercentAsideValue: true,
|
|
165
200
|
labelFontSize: 12,
|
|
166
201
|
labelLimitedLetters: 12,
|
|
167
|
-
width: '
|
|
168
|
-
height: '
|
|
202
|
+
width: '600px',
|
|
203
|
+
height: '360px',
|
|
204
|
+
barsMargin: 5,
|
|
205
|
+
rightGap: 1.5,
|
|
169
206
|
textColor: '#212121',
|
|
170
|
-
noDataText: 'The selected event is a TPR or has no offer, therefore there is no redeemers data to display.'
|
|
171
|
-
showPercentAsideValue: true
|
|
207
|
+
noDataText: 'The selected event is a TPR or has no offer, therefore there is no redeemers data to display.'
|
|
172
208
|
}
|
|
173
209
|
};
|
|
174
210
|
const SalesBlueTheme = exports.SalesBlueTheme = {
|
|
@@ -179,12 +215,14 @@ const SalesBlueTheme = exports.SalesBlueTheme = {
|
|
|
179
215
|
currencySign: true,
|
|
180
216
|
currencyType: 'USD',
|
|
181
217
|
chartsData: chartsData2,
|
|
218
|
+
showPercentAsideValue: false,
|
|
182
219
|
labelFontSize: 12,
|
|
183
220
|
labelLimitedLetters: 15,
|
|
184
221
|
width: '100%',
|
|
185
222
|
height: '240px',
|
|
223
|
+
barsMargin: 50,
|
|
224
|
+
rightGap: 1.25,
|
|
186
225
|
textColor: '#212121',
|
|
187
|
-
noDataText: 'The selected event is a TPR or has no offer, therefore there is no redeemers data to display.'
|
|
188
|
-
showPercentAsideValue: false
|
|
226
|
+
noDataText: 'The selected event is a TPR or has no offer, therefore there is no redeemers data to display.'
|
|
189
227
|
}
|
|
190
228
|
};
|
|
@@ -4,17 +4,55 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
7
|
+
exports.TotalValue = exports.Title = exports.CurrencySign = exports.ControlsContainer = exports.CardHeader = void 0;
|
|
9
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
const ControlsContainer = exports.ControlsContainer = _styledComponents.default.div`
|
|
10
|
+
font-family: "Poppins", sans-serif;
|
|
11
|
+
position: relative;
|
|
12
|
+
background-color: white;
|
|
13
|
+
color: ${props => props.textColor};
|
|
14
|
+
width: ${props => props.width};
|
|
15
|
+
height: ${props => props.height};
|
|
16
|
+
`;
|
|
17
|
+
const CardHeader = exports.CardHeader = _styledComponents.default.div`
|
|
18
|
+
padding: 16px;
|
|
19
|
+
position: sticky;
|
|
20
|
+
top: 0;
|
|
21
|
+
z-index: 10;
|
|
22
|
+
background-color: white;
|
|
23
|
+
`;
|
|
24
|
+
const TotalValue = exports.TotalValue = _styledComponents.default.div`
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
font-size: 40px;
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: baseline;
|
|
29
|
+
line-height: 1;
|
|
30
|
+
@media (max-width: 1536px) {
|
|
31
|
+
font-size: 24px;
|
|
32
|
+
}
|
|
33
|
+
@media (max-width: 1366px) {
|
|
34
|
+
font-size: 20px;
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
const Title = exports.Title = _styledComponents.default.h4`
|
|
38
|
+
font-size: 18px;
|
|
39
|
+
font-weight: 400;
|
|
40
|
+
line-height: 1;
|
|
41
|
+
margin: 0 0 8px;
|
|
42
|
+
@media (max-width: 1536px) {
|
|
43
|
+
font-size: 14px;
|
|
44
|
+
}
|
|
45
|
+
@media (max-width: 1366px) {
|
|
46
|
+
font-size: 12px;
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
const CurrencySign = exports.CurrencySign = _styledComponents.default.span`
|
|
50
|
+
font-weight: 500;
|
|
51
|
+
font-size: 16px;
|
|
52
|
+
@media (max-width: 1536px) {
|
|
53
|
+
font-size: 14px;
|
|
54
|
+
}
|
|
55
|
+
@media (max-width: 1366px) {
|
|
56
|
+
font-size: 11px;
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
@@ -17,10 +17,10 @@ const Tooltip = props => {
|
|
|
17
17
|
} = props;
|
|
18
18
|
return /*#__PURE__*/_react.default.createElement(_TspanTooltip.TooltipContainer, {
|
|
19
19
|
className: className,
|
|
20
|
-
top:
|
|
21
|
-
left:
|
|
20
|
+
top: `${top}px`,
|
|
21
|
+
left: `${left}px`
|
|
22
22
|
}, /*#__PURE__*/_react.default.createElement(_TspanTooltip.TooltipWrapper, null, /*#__PURE__*/_react.default.createElement(_TspanTooltip.TooltipTip, {
|
|
23
|
-
className:
|
|
23
|
+
className: `controls ${direction || 'top'}`
|
|
24
24
|
}, content)));
|
|
25
25
|
};
|
|
26
26
|
var _default = exports.default = Tooltip;
|