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,9 +5,101 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.TooltipWrapper = exports.TooltipTip = exports.TooltipContainer = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
9
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
const TooltipContainer = exports.TooltipContainer = _styledComponents.default.div`
|
|
10
|
+
--tooltip-text-color: black;
|
|
11
|
+
--tooltip-background-color: white;
|
|
12
|
+
--tooltip-margin: 40px;
|
|
13
|
+
--tooltip-arrow-size: 10px;
|
|
14
|
+
position: absolute;
|
|
15
|
+
z-index: 999999;
|
|
16
|
+
top: ${props => props.top};
|
|
17
|
+
left: ${props => props.left};
|
|
18
|
+
`;
|
|
19
|
+
const TooltipWrapper = exports.TooltipWrapper = _styledComponents.default.div`
|
|
20
|
+
display: inline-block;
|
|
21
|
+
position: relative;
|
|
22
|
+
`;
|
|
23
|
+
const TooltipTip = exports.TooltipTip = _styledComponents.default.div`
|
|
24
|
+
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);
|
|
25
|
+
position: absolute;
|
|
26
|
+
border-radius: 4px;
|
|
27
|
+
left: 50%;
|
|
28
|
+
transform: translateX(-50%);
|
|
29
|
+
padding: 8px 12px;
|
|
30
|
+
color: var(--tooltip-text-color);
|
|
31
|
+
background: var(--tooltip-background-color);
|
|
32
|
+
font-size: 10px;
|
|
33
|
+
z-index: 999;
|
|
34
|
+
white-space: nowrap;
|
|
35
|
+
|
|
36
|
+
/* CSS border triangles */
|
|
37
|
+
&.controls::before {
|
|
38
|
+
content: " ";
|
|
39
|
+
left: 50%;
|
|
40
|
+
border: solid transparent;
|
|
41
|
+
height: 0;
|
|
42
|
+
width: 0;
|
|
43
|
+
position: absolute;
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
border-width: var(--tooltip-arrow-size);
|
|
46
|
+
margin-left: calc(var(--tooltip-arrow-size) * -1);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* Absolute positioning */
|
|
50
|
+
&.controls.top {
|
|
51
|
+
top: calc(var(--tooltip-margin) * -1);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* CSS border triangles */
|
|
55
|
+
&.controls.top::before {
|
|
56
|
+
top: 100%;
|
|
57
|
+
border-top-color: var(--tooltip-background-color);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* Absolute positioning */
|
|
61
|
+
&.controls.right {
|
|
62
|
+
left: calc(70% + var(--tooltip-margin));
|
|
63
|
+
top: 50%;
|
|
64
|
+
transform: translateX(0) translateY(-50%);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* CSS border triangles */
|
|
68
|
+
&.controls.right::before {
|
|
69
|
+
left: calc(var(--tooltip-arrow-size) * -1);
|
|
70
|
+
top: 50%;
|
|
71
|
+
transform: translateX(0) translateY(-50%);
|
|
72
|
+
border-right-color: var(--tooltip-background-color);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Absolute positioning */
|
|
76
|
+
&.controls.bottom {
|
|
77
|
+
bottom: calc(var(--tooltip-margin) * -1);
|
|
78
|
+
}
|
|
79
|
+
/* CSS border triangles */
|
|
80
|
+
&.controls.bottom::before {
|
|
81
|
+
bottom: 100%;
|
|
82
|
+
border-bottom-color: var(--tooltip-background-color);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Absolute positioning */
|
|
86
|
+
&.controls.left {
|
|
87
|
+
left: auto;
|
|
88
|
+
right: calc(70% + var(--tooltip-margin));
|
|
89
|
+
top: 50%;
|
|
90
|
+
transform: translateX(0) translateY(-50%);
|
|
91
|
+
}
|
|
92
|
+
/* CSS border triangles */
|
|
93
|
+
&.controls.left::before {
|
|
94
|
+
left: auto;
|
|
95
|
+
right: calc(var(--tooltip-arrow-size) * -2);
|
|
96
|
+
top: 50%;
|
|
97
|
+
transform: translateX(0) translateY(-50%);
|
|
98
|
+
border-left-color: var(--tooltip-background-color);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
> ul {
|
|
102
|
+
padding-left: 10px;
|
|
103
|
+
margin: 0;
|
|
104
|
+
}
|
|
105
|
+
`;
|
|
@@ -19,6 +19,7 @@ const TwoBarCharts = props => {
|
|
|
19
19
|
title,
|
|
20
20
|
barChartData,
|
|
21
21
|
barSize,
|
|
22
|
+
barFontSizeValue,
|
|
22
23
|
isDollar,
|
|
23
24
|
width,
|
|
24
25
|
height,
|
|
@@ -49,7 +50,7 @@ const TwoBarCharts = props => {
|
|
|
49
50
|
if (!active || !payload || (payload === null || payload === void 0 ? void 0 : payload.length) === 0) return null;
|
|
50
51
|
let currentTooltipValue = 0;
|
|
51
52
|
if ((_payload$0$payload = payload[0].payload) !== null && _payload$0$payload !== void 0 && _payload$0$payload.value) currentTooltipValue = (_payload$0$payload2 = payload[0].payload) === null || _payload$0$payload2 === void 0 ? void 0 : _payload$0$payload2.value;
|
|
52
|
-
return /*#__PURE__*/_react.default.createElement(_TwoBarCharts.TooltipDiv, null, /*#__PURE__*/_react.default.createElement(_TwoBarCharts.TooltipTitle, null,
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement(_TwoBarCharts.TooltipDiv, null, /*#__PURE__*/_react.default.createElement(_TwoBarCharts.TooltipTitle, null, `${label}`), /*#__PURE__*/_react.default.createElement(_TwoBarCharts.TooltipLabel, null, `${displayFormattedValue(currentTooltipValue)}`));
|
|
53
54
|
};
|
|
54
55
|
const CustomizedTickBarChart = props => {
|
|
55
56
|
const {
|
|
@@ -61,7 +62,7 @@ const TwoBarCharts = props => {
|
|
|
61
62
|
const retailerData = barChartData.filter(item => item.title === payload.value);
|
|
62
63
|
if (retailerData && retailerData.length > 0) {
|
|
63
64
|
return /*#__PURE__*/_react.default.createElement("g", {
|
|
64
|
-
transform:
|
|
65
|
+
transform: `translate(${x},${y})`
|
|
65
66
|
}, /*#__PURE__*/_react.default.createElement("text", {
|
|
66
67
|
x: 0,
|
|
67
68
|
y: 0,
|
|
@@ -95,7 +96,7 @@ const TwoBarCharts = props => {
|
|
|
95
96
|
y: y,
|
|
96
97
|
dy: -8,
|
|
97
98
|
fill: stroke,
|
|
98
|
-
fontSize:
|
|
99
|
+
fontSize: barFontSizeValue,
|
|
99
100
|
textAnchor: "middle"
|
|
100
101
|
}, displayFormattedValue(value));
|
|
101
102
|
};
|
|
@@ -185,16 +186,17 @@ TwoBarCharts.defaultProps = {
|
|
|
185
186
|
width: '100%',
|
|
186
187
|
height: '100%',
|
|
187
188
|
barSize: 60,
|
|
189
|
+
barFontSizeValue: '0.6em',
|
|
188
190
|
barChartColorFirst: '#BD9EFF',
|
|
189
191
|
barChartColorSecond: '#5865c8',
|
|
190
192
|
isDollar: true,
|
|
193
|
+
showDollarSign: true,
|
|
191
194
|
showLegend: true,
|
|
192
195
|
legendData: [{
|
|
193
196
|
title: 'Incremental Sales',
|
|
194
197
|
iconType: ICON_TYPE_SQUARE,
|
|
195
198
|
iconColor: '#BD9EFF'
|
|
196
199
|
}],
|
|
197
|
-
showDollarSign: true,
|
|
198
200
|
showReferenceLine: false,
|
|
199
201
|
referenceLinePoint: 0,
|
|
200
202
|
referenceLineColor: '#212121',
|
|
@@ -39,35 +39,42 @@ var _default = exports.default = {
|
|
|
39
39
|
tags: ['autodocs'],
|
|
40
40
|
argTypes: {
|
|
41
41
|
title: {
|
|
42
|
-
name: '
|
|
42
|
+
name: 'Title',
|
|
43
43
|
control: {
|
|
44
44
|
type: 'text'
|
|
45
45
|
},
|
|
46
|
-
description: '
|
|
46
|
+
description: 'Title on top of the component'
|
|
47
47
|
},
|
|
48
48
|
width: {
|
|
49
|
-
name: '
|
|
49
|
+
name: 'Width',
|
|
50
50
|
control: {
|
|
51
51
|
type: 'text'
|
|
52
52
|
},
|
|
53
|
-
description: '
|
|
53
|
+
description: 'Width of the control (in px)'
|
|
54
54
|
},
|
|
55
55
|
height: {
|
|
56
|
-
name: '
|
|
56
|
+
name: 'Height',
|
|
57
57
|
control: {
|
|
58
58
|
type: 'text'
|
|
59
59
|
},
|
|
60
|
-
description: '
|
|
60
|
+
description: 'Height of the control (in px)'
|
|
61
61
|
},
|
|
62
62
|
barSize: {
|
|
63
|
-
name: '
|
|
63
|
+
name: 'Bar Size',
|
|
64
64
|
control: {
|
|
65
65
|
type: 'text'
|
|
66
66
|
},
|
|
67
|
-
description: '
|
|
67
|
+
description: 'Bar size of the control (in number ex: 60)'
|
|
68
|
+
},
|
|
69
|
+
barFontSizeValue: {
|
|
70
|
+
name: 'Top Bar Font Size',
|
|
71
|
+
control: {
|
|
72
|
+
type: 'text'
|
|
73
|
+
},
|
|
74
|
+
description: 'Top bar value font size'
|
|
68
75
|
},
|
|
69
76
|
barChartColorFirst: {
|
|
70
|
-
name: '
|
|
77
|
+
name: 'Bar Chart Color First',
|
|
71
78
|
description: 'Sets the area chart 1 color',
|
|
72
79
|
control: {
|
|
73
80
|
type: 'color',
|
|
@@ -75,29 +82,78 @@ var _default = exports.default = {
|
|
|
75
82
|
}
|
|
76
83
|
},
|
|
77
84
|
barChartColorSecond: {
|
|
78
|
-
name: '
|
|
79
|
-
description: 'Sets the area chart
|
|
85
|
+
name: 'Bar Chart Color Second',
|
|
86
|
+
description: 'Sets the area chart 2 color',
|
|
80
87
|
control: {
|
|
81
88
|
type: 'color',
|
|
82
89
|
presetColors: ['#ffffff', '#ff0000', '#00ff00', '#0000ff']
|
|
83
90
|
}
|
|
84
91
|
},
|
|
85
92
|
barChartData: {
|
|
86
|
-
description: '
|
|
93
|
+
description: 'Array [] of objects: {title: string, value:number } to fill the area data.'
|
|
87
94
|
},
|
|
88
95
|
isDollar: {
|
|
89
|
-
name: '
|
|
96
|
+
name: 'Is Dollar',
|
|
97
|
+
control: {
|
|
98
|
+
type: 'boolean'
|
|
99
|
+
},
|
|
100
|
+
description: 'Show values as Dollar'
|
|
101
|
+
},
|
|
102
|
+
showDollarSign: {
|
|
103
|
+
name: 'Show Dollar Sign',
|
|
90
104
|
control: {
|
|
91
105
|
type: 'boolean'
|
|
92
106
|
},
|
|
93
|
-
description: '
|
|
107
|
+
description: 'Show Dollar sign on top of bar'
|
|
94
108
|
},
|
|
95
109
|
showLegend: {
|
|
96
|
-
name: '
|
|
110
|
+
name: 'Show Legend',
|
|
111
|
+
control: {
|
|
112
|
+
type: 'boolean'
|
|
113
|
+
},
|
|
114
|
+
description: 'Show bottom legend'
|
|
115
|
+
},
|
|
116
|
+
yAxisCounter: {
|
|
117
|
+
name: 'Y Axis Counter',
|
|
118
|
+
control: {
|
|
119
|
+
type: 'number'
|
|
120
|
+
},
|
|
121
|
+
description: 'Number of intervals on the Y axis'
|
|
122
|
+
},
|
|
123
|
+
isPercentValue: {
|
|
124
|
+
name: 'Is Percent Value',
|
|
125
|
+
control: {
|
|
126
|
+
type: 'boolean'
|
|
127
|
+
},
|
|
128
|
+
description: 'Show values as Percent'
|
|
129
|
+
},
|
|
130
|
+
showReferenceLine: {
|
|
131
|
+
name: 'Show Reference Line',
|
|
97
132
|
control: {
|
|
98
133
|
type: 'boolean'
|
|
99
134
|
},
|
|
100
|
-
description: '
|
|
135
|
+
description: 'Show reference line on the chart'
|
|
136
|
+
},
|
|
137
|
+
referenceLinePoint: {
|
|
138
|
+
name: 'Reference Line Point',
|
|
139
|
+
control: {
|
|
140
|
+
type: 'number'
|
|
141
|
+
},
|
|
142
|
+
description: 'Point at which the reference line is drawn'
|
|
143
|
+
},
|
|
144
|
+
referenceLineColor: {
|
|
145
|
+
name: 'Reference Line Color',
|
|
146
|
+
control: {
|
|
147
|
+
type: 'color'
|
|
148
|
+
},
|
|
149
|
+
description: 'Color of the reference line'
|
|
150
|
+
},
|
|
151
|
+
referenceLineDashed: {
|
|
152
|
+
name: 'Reference Line Dashed',
|
|
153
|
+
control: {
|
|
154
|
+
type: 'text'
|
|
155
|
+
},
|
|
156
|
+
description: 'Dashed style of the reference line (e.g., "5" for dashed line)'
|
|
101
157
|
}
|
|
102
158
|
}
|
|
103
159
|
};
|
|
@@ -105,16 +161,25 @@ const SalesDollars = exports.SalesDollars = {
|
|
|
105
161
|
args: {
|
|
106
162
|
title: 'Sales $',
|
|
107
163
|
barChartData: arrData,
|
|
108
|
-
width: '600px',
|
|
109
|
-
height: '200px',
|
|
110
|
-
barChartColor: '#1F7677',
|
|
111
|
-
yAxisCounter: 10,
|
|
112
|
-
isPercentValue: false,
|
|
113
|
-
showLegend: true,
|
|
114
164
|
legendData: [{
|
|
115
165
|
title: 'Incremental Sales',
|
|
116
166
|
iconType: 'Square',
|
|
117
167
|
iconColor: '#1F7677'
|
|
118
|
-
}]
|
|
168
|
+
}],
|
|
169
|
+
width: '900px',
|
|
170
|
+
height: '500px',
|
|
171
|
+
barChartColorFirst: '#1F7677',
|
|
172
|
+
barChartColorSecond: '#FFC20E',
|
|
173
|
+
barSize: 60,
|
|
174
|
+
barFontSizeValue: '12px',
|
|
175
|
+
yAxisCounter: 10,
|
|
176
|
+
isPercentValue: false,
|
|
177
|
+
showLegend: true,
|
|
178
|
+
isDollar: true,
|
|
179
|
+
showDollarSign: false,
|
|
180
|
+
showReferenceLine: false,
|
|
181
|
+
referenceLinePoint: 0,
|
|
182
|
+
referenceLineColor: '#212121',
|
|
183
|
+
referenceLineDashed: '5'
|
|
119
184
|
}
|
|
120
185
|
};
|
|
@@ -5,14 +5,56 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.TooltipTitle = exports.TooltipLabel = exports.TooltipDiv = exports.Title = exports.LabelText = exports.LabelBoldText = 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
|
-
const
|
|
9
|
+
const ControlsContainer = exports.ControlsContainer = _styledComponents.default.div`
|
|
10
|
+
position: relative;
|
|
11
|
+
font-family: "Poppins", sans-serif;
|
|
12
|
+
color: #212121;
|
|
13
|
+
width: ${props => props.width};
|
|
14
|
+
height: ${props => props.height};
|
|
15
|
+
min-width: 250px;
|
|
16
|
+
`;
|
|
17
|
+
const Controls = exports.Controls = _styledComponents.default.div`
|
|
18
|
+
height: 100%;
|
|
19
|
+
width: 100%;
|
|
20
|
+
background: white;
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
`;
|
|
24
|
+
const TooltipDiv = exports.TooltipDiv = _styledComponents.default.div`
|
|
25
|
+
border-radius: 5px;
|
|
26
|
+
padding: 8px 12px;
|
|
27
|
+
background: white;
|
|
28
|
+
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);
|
|
29
|
+
margin: 0;
|
|
30
|
+
`;
|
|
31
|
+
const TooltipLabel = exports.TooltipLabel = _styledComponents.default.div`
|
|
32
|
+
color: #212121;
|
|
33
|
+
font-size: 14px;
|
|
34
|
+
font-weight: 400;
|
|
35
|
+
width: fit-content;
|
|
36
|
+
`;
|
|
37
|
+
const TooltipTitle = exports.TooltipTitle = _styledComponents.default.div`
|
|
38
|
+
color: #212121;
|
|
39
|
+
font-size: 14px;
|
|
40
|
+
font-weight: 600;
|
|
41
|
+
`;
|
|
42
|
+
const Title = exports.Title = _styledComponents.default.h5`
|
|
43
|
+
font-weight: 500;
|
|
44
|
+
font-size: 18px;
|
|
45
|
+
line-height: 20px;
|
|
46
|
+
margin: 0 0 30px;
|
|
47
|
+
@media (max-width: 1536px) {
|
|
48
|
+
font-size: 16px;
|
|
49
|
+
margin: 0 0 20px;
|
|
50
|
+
}
|
|
51
|
+
@media (max-width: 1366px) {
|
|
52
|
+
font-size: 14px;
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
const LabelBoldText = exports.LabelBoldText = _styledComponents.default.tspan`
|
|
56
|
+
font-size: 0.7em;
|
|
57
|
+
`;
|
|
58
|
+
const LabelText = exports.LabelText = _styledComponents.default.tspan`
|
|
59
|
+
font-size: 0.6em;
|
|
60
|
+
`;
|
|
@@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.isNumericValue = exports.getNumberWithCommas = exports.getFormattedValue = exports.getFormattedUnits = exports.getCurrencySign = void 0;
|
|
7
|
+
/* eslint-disable no-restricted-globals */
|
|
8
|
+
/* eslint-disable no-shadow */
|
|
7
9
|
const getCurrencySign = (currencyTypeToConvert, value) => {
|
|
8
10
|
if (value === undefined || value === null) {
|
|
9
11
|
return '';
|
|
@@ -41,22 +43,25 @@ const getFormattedUnits = num => {
|
|
|
41
43
|
};
|
|
42
44
|
exports.getFormattedUnits = getFormattedUnits;
|
|
43
45
|
const getFormattedValue = num => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
if (isNaN(parseFloat(num))) {
|
|
46
|
+
const value = num !== null && num !== void 0 ? num : 0;
|
|
47
|
+
if (isNaN(parseFloat(value))) {
|
|
48
48
|
return null;
|
|
49
49
|
}
|
|
50
|
+
const formatNumber = value => {
|
|
51
|
+
const numValue = Number(value);
|
|
52
|
+
const fixedValue = numValue.toFixed(1);
|
|
53
|
+
return fixedValue.endsWith('.0') ? fixedValue.slice(0, -2) : fixedValue;
|
|
54
|
+
};
|
|
50
55
|
if (Math.abs(num) >= 1000000000) {
|
|
51
|
-
return (num / 1000000000)
|
|
56
|
+
return formatNumber(num / 1000000000);
|
|
52
57
|
}
|
|
53
58
|
if (Math.abs(num) >= 1000000) {
|
|
54
|
-
return (num / 1000000)
|
|
59
|
+
return formatNumber(num / 1000000);
|
|
55
60
|
}
|
|
56
61
|
if (Math.abs(num) >= 1000) {
|
|
57
|
-
return (num / 1000)
|
|
62
|
+
return formatNumber(num / 1000);
|
|
58
63
|
}
|
|
59
|
-
return
|
|
64
|
+
return formatNumber(num);
|
|
60
65
|
};
|
|
61
66
|
exports.getFormattedValue = getFormattedValue;
|
|
62
67
|
const getNumberWithCommas = x => {
|
package/package.json
CHANGED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _reactDom = require("react-dom");
|
|
10
|
-
var _HaiTooltip = require("./HaiTooltip.style");
|
|
11
|
-
const HaiTooltip = _ref => {
|
|
12
|
-
let {
|
|
13
|
-
text,
|
|
14
|
-
children
|
|
15
|
-
} = _ref;
|
|
16
|
-
const [isVisible, setIsVisible] = (0, _react.useState)(false);
|
|
17
|
-
const [position, setPosition] = (0, _react.useState)({
|
|
18
|
-
top: 0,
|
|
19
|
-
left: 0
|
|
20
|
-
});
|
|
21
|
-
const wrapperRef = (0, _react.useRef)(null);
|
|
22
|
-
const tooltipRef = (0, _react.useRef)(null);
|
|
23
|
-
const calculatePosition = () => {
|
|
24
|
-
const rect = wrapperRef.current.getBoundingClientRect();
|
|
25
|
-
if (tooltipRef.current) {
|
|
26
|
-
const tooltipRect = tooltipRef.current.getBoundingClientRect();
|
|
27
|
-
const top = rect.top - tooltipRect.height - 10;
|
|
28
|
-
let left = rect.left + rect.width / 2 - tooltipRect.width / 2 + 67;
|
|
29
|
-
if (left < 0) {
|
|
30
|
-
left = 10;
|
|
31
|
-
}
|
|
32
|
-
if (left + tooltipRect.width > window.innerWidth) {
|
|
33
|
-
left = window.innerWidth - tooltipRect.width - 10;
|
|
34
|
-
}
|
|
35
|
-
setPosition({
|
|
36
|
-
top,
|
|
37
|
-
left
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
const handleMouseEnter = () => {
|
|
42
|
-
setIsVisible(true);
|
|
43
|
-
};
|
|
44
|
-
const handleMouseLeave = () => {
|
|
45
|
-
setIsVisible(false);
|
|
46
|
-
};
|
|
47
|
-
(0, _react.useEffect)(() => {
|
|
48
|
-
if (isVisible) {
|
|
49
|
-
calculatePosition();
|
|
50
|
-
window.addEventListener('resize', calculatePosition);
|
|
51
|
-
window.addEventListener('scroll', calculatePosition);
|
|
52
|
-
setTimeout(calculatePosition, 0);
|
|
53
|
-
}
|
|
54
|
-
return () => {
|
|
55
|
-
window.removeEventListener('resize', calculatePosition);
|
|
56
|
-
window.removeEventListener('scroll', calculatePosition);
|
|
57
|
-
};
|
|
58
|
-
}, [isVisible]);
|
|
59
|
-
return /*#__PURE__*/_react.default.createElement(_HaiTooltip.TooltipWrapper, {
|
|
60
|
-
ref: wrapperRef,
|
|
61
|
-
onMouseEnter: handleMouseEnter,
|
|
62
|
-
onMouseLeave: handleMouseLeave
|
|
63
|
-
}, children, isVisible && /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/_react.default.createElement(_HaiTooltip.TooltipText, {
|
|
64
|
-
ref: tooltipRef,
|
|
65
|
-
style: {
|
|
66
|
-
top: "".concat(position.top, "px"),
|
|
67
|
-
left: "".concat(position.left, "px")
|
|
68
|
-
}
|
|
69
|
-
}, text), document.body));
|
|
70
|
-
};
|
|
71
|
-
var _default = exports.default = HaiTooltip;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.TooltipWrapper = exports.TooltipText = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
9
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
-
var _templateObject, _templateObject2;
|
|
11
|
-
const TooltipWrapper = exports.TooltipWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: inline-block;\n cursor: pointer;\n position: relative;\n"])));
|
|
12
|
-
const TooltipText = exports.TooltipText = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n background-color: white;\n font-family: 'Poppins';\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n color: black;\n padding: 5px;\n box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.10);\n border-radius: 4px;\n white-space: normal;\n word-wrap: break-word;\n max-width: 200px;\n z-index: 9999;\n transform: translateX(-50%);\n visibility: visible;\n opacity: 1;\n transition: opacity 0.3s ease;\n\n &::after {\n content: '';\n position: absolute;\n top: 100%;\n left: 50%;\n margin-left: -5px;\n border-width: 5px;\n border-style: solid;\n border-color: white;\n }\n"])));
|