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
|
@@ -1,453 +0,0 @@
|
|
|
1
|
-
// import React, { useState, useRef, useEffect } from 'react';
|
|
2
|
-
// import { createPortal } from 'react-dom';
|
|
3
|
-
// import { TooltipWrapper, TooltipText } from './HaiTooltip.style';
|
|
4
|
-
|
|
5
|
-
// const HaiTooltip = ({ text, children }) => {
|
|
6
|
-
// const [isVisible, setIsVisible] = useState(false);
|
|
7
|
-
// const [position, setPosition] = useState({ top: 0, left: 0 });
|
|
8
|
-
// const wrapperRef = useRef(null);
|
|
9
|
-
|
|
10
|
-
// const handleMouseEnter = () => {
|
|
11
|
-
// const rect = wrapperRef.current.getBoundingClientRect();
|
|
12
|
-
// setPosition({
|
|
13
|
-
// bottom: rect.bottom + 460,
|
|
14
|
-
// left: rect.left + rect.width / 2,
|
|
15
|
-
// });
|
|
16
|
-
// setIsVisible(true);
|
|
17
|
-
// };
|
|
18
|
-
// const handleMouseLeave = () => {
|
|
19
|
-
// setIsVisible(false);
|
|
20
|
-
// };
|
|
21
|
-
|
|
22
|
-
// return (
|
|
23
|
-
// <TooltipWrapper
|
|
24
|
-
// ref={wrapperRef}
|
|
25
|
-
// onMouseEnter={handleMouseEnter}
|
|
26
|
-
// onMouseLeave={handleMouseLeave}
|
|
27
|
-
// >
|
|
28
|
-
// {children}
|
|
29
|
-
// {isVisible &&
|
|
30
|
-
// createPortal(
|
|
31
|
-
// <TooltipText style={{ bottom: `${position.bottom}px`, left: `${position.left}px` }}>
|
|
32
|
-
// {text}
|
|
33
|
-
// </TooltipText>,
|
|
34
|
-
// document.body
|
|
35
|
-
// )}
|
|
36
|
-
// </TooltipWrapper>
|
|
37
|
-
// );
|
|
38
|
-
// };
|
|
39
|
-
|
|
40
|
-
// export default HaiTooltip;
|
|
41
|
-
|
|
42
|
-
// import styled from "styled-components";
|
|
43
|
-
|
|
44
|
-
// export const TooltipWrapper = styled.div`
|
|
45
|
-
// display: inline-block;
|
|
46
|
-
// cursor: pointer;
|
|
47
|
-
// position: relative;
|
|
48
|
-
// `;
|
|
49
|
-
|
|
50
|
-
// export const TooltipText = styled.div`
|
|
51
|
-
// position: absolute;
|
|
52
|
-
// background-color: white;
|
|
53
|
-
// font-family: "Poppins";
|
|
54
|
-
// font-size: 14px;
|
|
55
|
-
// font-style: normal;
|
|
56
|
-
// font-weight: 400;
|
|
57
|
-
// color: black;
|
|
58
|
-
// padding: 5px;
|
|
59
|
-
// box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.10);
|
|
60
|
-
// border-radius: 4px;
|
|
61
|
-
// white-space: normal;
|
|
62
|
-
// word-wrap: break-word; // Handle long words
|
|
63
|
-
// max-width: 200px;
|
|
64
|
-
|
|
65
|
-
// z-index: 9999;
|
|
66
|
-
// transform: translateX(-50%);
|
|
67
|
-
// visibility: visible;
|
|
68
|
-
// opacity: 1;
|
|
69
|
-
// transition: opacity 0.3s ease;
|
|
70
|
-
|
|
71
|
-
// &::after {
|
|
72
|
-
// content: "";
|
|
73
|
-
// position: absolute;
|
|
74
|
-
// top: 100%;
|
|
75
|
-
// left: 50%;
|
|
76
|
-
// margin-left: -5px;
|
|
77
|
-
// border-width: 5px;
|
|
78
|
-
// border-style: solid;
|
|
79
|
-
// border-color: black transparent transparent transparent;
|
|
80
|
-
// }
|
|
81
|
-
// `;
|
|
82
|
-
|
|
83
|
-
// /* eslint-disable import/no-unresolved */
|
|
84
|
-
// /* eslint-disable import/extensions */
|
|
85
|
-
// import React, { useState, useEffect } from "react";
|
|
86
|
-
// import PropTypes from "prop-types";
|
|
87
|
-
// import TspanTooltip from "./TspanTooltip";
|
|
88
|
-
// import HaiTooltip from "./HaiTooltip";
|
|
89
|
-
// import { CheckBoxCheckedIcon } from "./icons/CheckBoxCheckedIcon";
|
|
90
|
-
// import { CheckBoxNotCheckedIcon } from "./icons/CheckBoxNotCheckedIcon";
|
|
91
|
-
// import { createPortal } from "react-dom";
|
|
92
|
-
// import LinkButton from "./LinkButton";
|
|
93
|
-
// import {
|
|
94
|
-
// Table,
|
|
95
|
-
// Th,
|
|
96
|
-
// Td,
|
|
97
|
-
// Tr,
|
|
98
|
-
// InfoText,
|
|
99
|
-
// InfoBlock,
|
|
100
|
-
// TableWrapper,
|
|
101
|
-
// SelectButtonContainer,
|
|
102
|
-
// SelectButtonSubContainer,
|
|
103
|
-
// SelectCheckboxContainer,
|
|
104
|
-
// SelectCheckboxSubContainer,
|
|
105
|
-
// } from "./ReportTable.style";
|
|
106
|
-
// import { InfoIcon } from "./icons/InfoIcon";
|
|
107
|
-
|
|
108
|
-
// export const ReportTable = (props) => {
|
|
109
|
-
// const {
|
|
110
|
-
// tableData,
|
|
111
|
-
// maxColumnsNumber,
|
|
112
|
-
// useColorLinearGradient,
|
|
113
|
-
// useSelectButtons,
|
|
114
|
-
// disableSelectButtons,
|
|
115
|
-
// disableInfo,
|
|
116
|
-
// selectTextColor,
|
|
117
|
-
// onSelectRowClick,
|
|
118
|
-
// onAllRowsCheckBoxClick,
|
|
119
|
-
// onCheckRowClick,
|
|
120
|
-
// buttonText,
|
|
121
|
-
// buttonIconName,
|
|
122
|
-
// useCheckBoxes,
|
|
123
|
-
// } = props;
|
|
124
|
-
|
|
125
|
-
// const [FormattedTableData, setFormattedTableData] = useState(tableData);
|
|
126
|
-
// const [AllRowsChecked, setAllRowsChecked] = useState(false);
|
|
127
|
-
|
|
128
|
-
// useEffect(() => {
|
|
129
|
-
// if (!tableData || !tableData.columnsHeadings || !tableData.rowsValues) {
|
|
130
|
-
// return;
|
|
131
|
-
// }
|
|
132
|
-
|
|
133
|
-
// const newTableData = { columnsHeadings: [], rowsValues: [] };
|
|
134
|
-
|
|
135
|
-
// // column heading - checkbox
|
|
136
|
-
// if (
|
|
137
|
-
// useCheckBoxes &&
|
|
138
|
-
// !newTableData.columnsHeadings?.some(
|
|
139
|
-
// (item) => item.label === "checkbox" && item.key === "checkbox"
|
|
140
|
-
// )
|
|
141
|
-
// ) {
|
|
142
|
-
// newTableData.columnsHeadings.push({ label: "checkbox", key: "checkbox" });
|
|
143
|
-
// }
|
|
144
|
-
|
|
145
|
-
// // columnsHeadings - regular columns
|
|
146
|
-
// tableData?.columnsHeadings?.forEach((item) => {
|
|
147
|
-
// newTableData.columnsHeadings.push(item);
|
|
148
|
-
// });
|
|
149
|
-
|
|
150
|
-
// // column heading - select button
|
|
151
|
-
// if (
|
|
152
|
-
// useSelectButtons &&
|
|
153
|
-
// !newTableData.columnsHeadings?.some(
|
|
154
|
-
// (item) => item.label === "button" && item.key === "button"
|
|
155
|
-
// )
|
|
156
|
-
// ) {
|
|
157
|
-
// newTableData.columnsHeadings.push({ label: "button", key: "button" });
|
|
158
|
-
// }
|
|
159
|
-
|
|
160
|
-
// // rowsValues
|
|
161
|
-
// const newRowValues = tableData.rowsValues?.map((item) =>
|
|
162
|
-
// useCheckBoxes ? { checkbox: "checkbox", ...item } : item
|
|
163
|
-
// );
|
|
164
|
-
// const newRowValuesStep2 = newRowValues?.map((item) =>
|
|
165
|
-
// useSelectButtons ? { ...item, button: "button" } : item
|
|
166
|
-
// );
|
|
167
|
-
// const newRowValuesStep3 = newRowValuesStep2?.map((item) =>
|
|
168
|
-
// useCheckBoxes ? { ...item, checkboxState: false } : item
|
|
169
|
-
// );
|
|
170
|
-
// const newRowValuesStep4 = newRowValuesStep3?.map((item, index) => ({
|
|
171
|
-
// ...item,
|
|
172
|
-
// index,
|
|
173
|
-
// }));
|
|
174
|
-
// newTableData.rowsValues = newRowValuesStep4;
|
|
175
|
-
|
|
176
|
-
// setFormattedTableData(newTableData);
|
|
177
|
-
// }, [tableData, useSelectButtons, useCheckBoxes]);
|
|
178
|
-
|
|
179
|
-
// const columnsNumber = tableData.columnsHeadings.length;
|
|
180
|
-
// const tableWidthSize =
|
|
181
|
-
// (100 / (useSelectButtons ? maxColumnsNumber + 1 : maxColumnsNumber)) *
|
|
182
|
-
// (useSelectButtons ? columnsNumber + 1 : columnsNumber);
|
|
183
|
-
|
|
184
|
-
// const handleSelectButtonRowClick = (row) => {
|
|
185
|
-
// const { checkbox: propToRemove, ...rest } = row;
|
|
186
|
-
// const { button: propToRemove2, ...rest2 } = rest;
|
|
187
|
-
// const { checkboxState: propToRemove3, ...rest3 } = rest2;
|
|
188
|
-
|
|
189
|
-
// onSelectRowClick(rest3);
|
|
190
|
-
// };
|
|
191
|
-
|
|
192
|
-
// const handleHeaderCheckBoxClick = () => {
|
|
193
|
-
// setAllRowsChecked(!AllRowsChecked);
|
|
194
|
-
|
|
195
|
-
// const updatedTableHeaderRowsData = FormattedTableData?.rowsValues?.map(
|
|
196
|
-
// (item) => ({ ...item, checkboxState: !AllRowsChecked })
|
|
197
|
-
// );
|
|
198
|
-
|
|
199
|
-
// setFormattedTableData({
|
|
200
|
-
// ...FormattedTableData,
|
|
201
|
-
// rowsValues: updatedTableHeaderRowsData,
|
|
202
|
-
// });
|
|
203
|
-
|
|
204
|
-
// onAllRowsCheckBoxClick({ AllRowsChecked: !AllRowsChecked });
|
|
205
|
-
// };
|
|
206
|
-
|
|
207
|
-
// const handleRowCheckBoxClick = (row) => {
|
|
208
|
-
// if (!row) return;
|
|
209
|
-
|
|
210
|
-
// const updatedRow = { ...row, checkboxState: !row?.checkboxState };
|
|
211
|
-
|
|
212
|
-
// const updatedTableRowsData = FormattedTableData?.rowsValues?.map((item) =>
|
|
213
|
-
// item.index === row.index ? updatedRow : item
|
|
214
|
-
// );
|
|
215
|
-
|
|
216
|
-
// setFormattedTableData({
|
|
217
|
-
// ...FormattedTableData,
|
|
218
|
-
// rowsValues: updatedTableRowsData,
|
|
219
|
-
// });
|
|
220
|
-
|
|
221
|
-
// const { checkbox: propToRemove, ...rest } = updatedRow;
|
|
222
|
-
// const { button: propToRemove2, ...rest2 } = rest;
|
|
223
|
-
|
|
224
|
-
// onCheckRowClick(rest2);
|
|
225
|
-
// };
|
|
226
|
-
|
|
227
|
-
// const displaySelectButton = (rowData) => (
|
|
228
|
-
// <LinkButton
|
|
229
|
-
// disabled={disableSelectButtons}
|
|
230
|
-
// onClick={(e) => handleSelectButtonRowClick(rowData)}
|
|
231
|
-
// rightIcon={buttonIconName}
|
|
232
|
-
// size="medium"
|
|
233
|
-
// text={buttonText || "Select"}
|
|
234
|
-
// textColor={selectTextColor}
|
|
235
|
-
// />
|
|
236
|
-
// );
|
|
237
|
-
|
|
238
|
-
// const displayCheckBox = (rowData, isHeader) => (
|
|
239
|
-
// <SelectCheckboxContainer className="SelectCheckboxContainer">
|
|
240
|
-
// <SelectCheckboxSubContainer
|
|
241
|
-
// className="SelectCheckboxSubContainer"
|
|
242
|
-
// selectTextColor={selectTextColor}
|
|
243
|
-
// onClick={() =>
|
|
244
|
-
// isHeader
|
|
245
|
-
// ? handleHeaderCheckBoxClick()
|
|
246
|
-
// : handleRowCheckBoxClick(rowData)
|
|
247
|
-
// }
|
|
248
|
-
// >
|
|
249
|
-
// {(!isHeader && rowData?.checkboxState) ||
|
|
250
|
-
// (isHeader && AllRowsChecked) ? (
|
|
251
|
-
// <CheckBoxCheckedIcon
|
|
252
|
-
// className="CheckBoxCheckedIcon"
|
|
253
|
-
// width="14px"
|
|
254
|
-
// height="14px"
|
|
255
|
-
// color={selectTextColor}
|
|
256
|
-
// />
|
|
257
|
-
// ) : (
|
|
258
|
-
// <CheckBoxNotCheckedIcon
|
|
259
|
-
// className="CheckBoxNotCheckedIcon"
|
|
260
|
-
// width="14px"
|
|
261
|
-
// height="14px"
|
|
262
|
-
// color="#212121"
|
|
263
|
-
// />
|
|
264
|
-
// )}
|
|
265
|
-
// </SelectCheckboxSubContainer>
|
|
266
|
-
// </SelectCheckboxContainer>
|
|
267
|
-
// );
|
|
268
|
-
|
|
269
|
-
// const getMaxColnumber = () => {
|
|
270
|
-
// let colNumber = maxColumnsNumber;
|
|
271
|
-
// if (useSelectButtons) {
|
|
272
|
-
// colNumber = +1;
|
|
273
|
-
// }
|
|
274
|
-
// if (useCheckBoxes) {
|
|
275
|
-
// colNumber = +1;
|
|
276
|
-
// }
|
|
277
|
-
// return colNumber;
|
|
278
|
-
// };
|
|
279
|
-
// const tooltipTexts = {
|
|
280
|
-
// "Event Name":
|
|
281
|
-
// "Product line is a collection of products from the same brand and sub-category, offering consumers a wide range of options or flavors for a similar product",
|
|
282
|
-
// "Retailer":
|
|
283
|
-
// "Package Cost is the price that the CPG company paid to participate.",
|
|
284
|
-
// "Total Cost":
|
|
285
|
-
// "Incremental Sales is the difference between the Actual Sales during the NIC cycle period, compared to actual sales of participating items during pre-cycle period (prior same # of weeks).",
|
|
286
|
-
// "Inc. Baseline Sales":
|
|
287
|
-
// "Incremental Sales ROI is the Return on Investment, which represents how much incremental money is generated for each dollar invested. It is calculated by dividing Incremental Sales by Total Cost.",
|
|
288
|
-
// };
|
|
289
|
-
// return (
|
|
290
|
-
// <>
|
|
291
|
-
// <TableWrapper
|
|
292
|
-
// maxColumnsNumber={getMaxColnumber()}
|
|
293
|
-
// columnsNumber={columnsNumber}
|
|
294
|
-
// >
|
|
295
|
-
// <Table tableWidthSize={tableWidthSize}>
|
|
296
|
-
// <thead>
|
|
297
|
-
// <tr className="headerRow">
|
|
298
|
-
// {FormattedTableData.columnsHeadings.map((headline, index) => {
|
|
299
|
-
// if (headline.label === "checkbox") {
|
|
300
|
-
// return <Th key={index}>{displayCheckBox(headline, true)}</Th>;
|
|
301
|
-
// }
|
|
302
|
-
// if (headline.label === "button") {
|
|
303
|
-
// return <Th key={index} />;
|
|
304
|
-
// }
|
|
305
|
-
// return (
|
|
306
|
-
// <Th key={index}>
|
|
307
|
-
// <div
|
|
308
|
-
// style={{
|
|
309
|
-
// display: "flex",
|
|
310
|
-
// alignItems: "center",
|
|
311
|
-
// gap: "8px",
|
|
312
|
-
// }}
|
|
313
|
-
// >
|
|
314
|
-
// {headline.label}{" "}
|
|
315
|
-
// <div
|
|
316
|
-
// style={{
|
|
317
|
-
// display: "flex",
|
|
318
|
-
// alignItems: "center",
|
|
319
|
-
// position: "relative",
|
|
320
|
-
// }}
|
|
321
|
-
// >
|
|
322
|
-
// <HaiTooltip
|
|
323
|
-
// text={
|
|
324
|
-
// tooltipTexts[headline.label] || "No additional info"
|
|
325
|
-
// }
|
|
326
|
-
// >
|
|
327
|
-
// <InfoIcon width="15px" height="15px" />
|
|
328
|
-
// </HaiTooltip>
|
|
329
|
-
// </div>
|
|
330
|
-
// </div>
|
|
331
|
-
// </Th>
|
|
332
|
-
// );
|
|
333
|
-
// })}
|
|
334
|
-
// </tr>
|
|
335
|
-
// </thead>
|
|
336
|
-
// <tbody>
|
|
337
|
-
// {FormattedTableData.rowsValues.map((rowData, index) => (
|
|
338
|
-
// // eslint-disable-next-line react/no-array-index-key
|
|
339
|
-
// <Tr
|
|
340
|
-
// className="row"
|
|
341
|
-
// key={index}
|
|
342
|
-
// useColorLinearGradient={useColorLinearGradient}
|
|
343
|
-
// >
|
|
344
|
-
// {Object.values(rowData).map((value, dataIndex) =>
|
|
345
|
-
// // eslint-disable-next-line no-nested-ternary
|
|
346
|
-
// value === "checkbox" ? (
|
|
347
|
-
// // eslint-disable-next-line react/no-array-index-key
|
|
348
|
-
// <Td className="checkbox" key={index}>
|
|
349
|
-
// {displayCheckBox(rowData, false)}
|
|
350
|
-
// </Td>
|
|
351
|
-
// ) : value === "button" ? (
|
|
352
|
-
// // eslint-disable-next-line react/no-array-index-key
|
|
353
|
-
// <Td className="button" key={index}>
|
|
354
|
-
// {displaySelectButton(rowData)}
|
|
355
|
-
// </Td>
|
|
356
|
-
// ) : (
|
|
357
|
-
// // eslint-disable-next-line react/no-array-index-key
|
|
358
|
-
// <Td className="cell" key={dataIndex}>
|
|
359
|
-
// {value}
|
|
360
|
-
// </Td>
|
|
361
|
-
// )
|
|
362
|
-
// )}
|
|
363
|
-
// </Tr>
|
|
364
|
-
// ))}
|
|
365
|
-
// </tbody>
|
|
366
|
-
// </Table>
|
|
367
|
-
// </TableWrapper>
|
|
368
|
-
// {!disableInfo ? (
|
|
369
|
-
// <InfoBlock>
|
|
370
|
-
// <InfoIcon color="#1B30AA" />
|
|
371
|
-
// <InfoText>Download table to get the full data</InfoText>
|
|
372
|
-
// </InfoBlock>
|
|
373
|
-
// ) : (
|
|
374
|
-
// ""
|
|
375
|
-
// )}
|
|
376
|
-
// </>
|
|
377
|
-
// );
|
|
378
|
-
// };
|
|
379
|
-
|
|
380
|
-
// export default ReportTable;
|
|
381
|
-
|
|
382
|
-
// ReportTable.propTypes = {
|
|
383
|
-
// buttonText: PropTypes.string,
|
|
384
|
-
// buttonIconName: PropTypes.string,
|
|
385
|
-
// tableData: PropTypes.shape({
|
|
386
|
-
// columnsHeadings: PropTypes.arrayOf(
|
|
387
|
-
// PropTypes.shape({
|
|
388
|
-
// label: PropTypes.string,
|
|
389
|
-
// key: PropTypes.string,
|
|
390
|
-
// })
|
|
391
|
-
// ),
|
|
392
|
-
// rowsValues: PropTypes.arrayOf(PropTypes.objectOf(PropTypes.string)),
|
|
393
|
-
// }),
|
|
394
|
-
// maxColumnsNumber: PropTypes.number,
|
|
395
|
-
// useColorLinearGradient: PropTypes.bool,
|
|
396
|
-
// useSelectButtons: PropTypes.bool,
|
|
397
|
-
// disableSelectButtons: PropTypes.bool,
|
|
398
|
-
// disableInfo: PropTypes.bool,
|
|
399
|
-
// selectTextColor: PropTypes.string,
|
|
400
|
-
// onSelectRowClick: PropTypes.func,
|
|
401
|
-
// onCheckRowClick: PropTypes.func,
|
|
402
|
-
// onAllRowsCheckBoxClick: PropTypes.func,
|
|
403
|
-
// useCheckBoxes: PropTypes.bool,
|
|
404
|
-
// };
|
|
405
|
-
|
|
406
|
-
// ReportTable.defaultProps = {
|
|
407
|
-
// buttonText: "Select",
|
|
408
|
-
// buttonIconName: "select",
|
|
409
|
-
// tableData: {
|
|
410
|
-
// columnsHeadings: [
|
|
411
|
-
// { label: "Event Name", key: "eventName" },
|
|
412
|
-
// { label: "Retailer", key: "retailer" },
|
|
413
|
-
// { label: "Total Cost", key: "totalCost" },
|
|
414
|
-
// { label: "Inc. Baseline Sales", key: "incBaselineSales" },
|
|
415
|
-
// ],
|
|
416
|
-
// rowsValues: [
|
|
417
|
-
// {
|
|
418
|
-
// retailer: "Large Selling Event P2 2023",
|
|
419
|
-
// eventDescription: "Food",
|
|
420
|
-
// totalCost: "Food Lion",
|
|
421
|
-
// incBaselineSales: "50K",
|
|
422
|
-
// },
|
|
423
|
-
// {
|
|
424
|
-
// retailer: "Large Selling Event P2 2023",
|
|
425
|
-
// eventDescription: "Food",
|
|
426
|
-
// totalCost: "$500K",
|
|
427
|
-
// incBaselineSales: "50K",
|
|
428
|
-
// },
|
|
429
|
-
// {
|
|
430
|
-
// retailer: "Large Selling Event P2 2023",
|
|
431
|
-
// eventDescription: "Food",
|
|
432
|
-
// totalCost: "$500K",
|
|
433
|
-
// incBaselineSales: "50K",
|
|
434
|
-
// },
|
|
435
|
-
// {
|
|
436
|
-
// retailer: "Large Selling Event P2 2023",
|
|
437
|
-
// eventDescription: "Food",
|
|
438
|
-
// totalCost: "$500K",
|
|
439
|
-
// incBaselineSales: "50K",
|
|
440
|
-
// },
|
|
441
|
-
// ],
|
|
442
|
-
// },
|
|
443
|
-
// maxColumnsNumber: 4,
|
|
444
|
-
// useColorLinearGradient: true,
|
|
445
|
-
// useSelectButtons: false,
|
|
446
|
-
// disableSelectButtons: false,
|
|
447
|
-
// disableInfo: false,
|
|
448
|
-
// selectTextColor: "#229E38",
|
|
449
|
-
// onSelectRowClick: () => {},
|
|
450
|
-
// onCheckRowClick: () => {},
|
|
451
|
-
// onAllRowsCheckBoxClick: () => {},
|
|
452
|
-
// useCheckBoxes: false,
|
|
453
|
-
// };
|
|
@@ -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 _TableTooltip = require("./TableTooltip.style");
|
|
11
|
-
const TableTooltip = _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(_TableTooltip.TooltipWrapper, {
|
|
60
|
-
ref: wrapperRef,
|
|
61
|
-
onMouseEnter: handleMouseEnter,
|
|
62
|
-
onMouseLeave: handleMouseLeave
|
|
63
|
-
}, children, isVisible && /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/_react.default.createElement(_TableTooltip.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 = TableTooltip;
|
|
@@ -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.1);\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 transparent transparent transparent;\n }\n"])));
|