sag_components 2.0.0-beta27 → 2.0.0-beta29
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/App.js +56 -0
- package/dist/App.test.js +10 -0
- package/dist/Button.test.js +162 -0
- package/dist/LinkButton.test.js +150 -0
- package/dist/SingleBar.test.js +120 -0
- package/dist/index.esm.js +2208 -544
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2207 -544
- package/dist/index.js.map +1 -1
- package/dist/setupTests.js +15 -0
- package/dist/stories/AttachedFile.stories.js +37 -0
- package/dist/stories/AutocompleteField.stories.js +25 -0
- package/dist/stories/BannerEventBox.stories.js +59 -0
- package/dist/stories/BannerEventBoxList.stories.js +39 -0
- package/dist/stories/BannerEventBoxTest.stories.js +27 -0
- package/dist/stories/BannersDropdown.stories.js +64 -0
- package/dist/stories/BarChart.stories.js +306 -0
- package/dist/stories/BarChartTwoRows.stories.js +259 -0
- package/dist/stories/BarChartWithAreaChart.stories.js +134 -0
- package/dist/stories/BarChartsByWeeks.stories.js +445 -0
- package/dist/stories/Benchmark.stories.js +147 -0
- package/dist/stories/Button.stories.js +255 -0
- package/dist/stories/CampaignDemoReport.stories.js +65 -0
- package/dist/stories/CampaignTool/Card.stories.js +92 -0
- package/dist/stories/CampaignTool/MultipleCard.stories.js +33 -0
- package/dist/stories/CampaignTool/PageFilterBar.stories.js +28 -0
- package/dist/stories/CampaignTool/Popup.stories.js +697 -0
- package/dist/stories/CampaignTool/PopupContent.stories.js +284 -0
- package/dist/stories/CampaignTool/Table.stories.js +104 -0
- package/dist/stories/CheckBox.stories.js +107 -0
- package/dist/stories/CheckBoxButton.stories.js +150 -0
- package/dist/stories/CollapseData.stories.js +125 -0
- package/dist/stories/CollapseHeader.stories.js +123 -0
- package/dist/stories/CollapseMenuItem.stories.js +134 -0
- package/dist/stories/Datepicker.stories.js +85 -0
- package/dist/stories/DialogOverlay.stories.js +39 -0
- package/dist/stories/DoublePanelDataRow.stories.js +116 -0
- package/dist/stories/DownloadProgress.stories.js +109 -0
- package/dist/stories/Dropdown.stories.js +318 -0
- package/dist/stories/DropdownMulti.stories.js +220 -0
- package/dist/stories/DropdownNew.stories.js +407 -0
- package/dist/stories/EventDetailsCard.stories.js +122 -0
- package/dist/stories/EventList.stories.js +84 -0
- package/dist/stories/EventListItem.stories.js +65 -0
- package/dist/stories/FilterButton.stories.js +90 -0
- package/dist/stories/FilterContainer.stories.js +22 -0
- package/dist/stories/FilterPanel.stories.js +967 -0
- package/dist/stories/FormattedValue.stories.js +183 -0
- package/dist/stories/Heatmap.stories.js +118 -0
- package/dist/stories/IconButton.stories.js +126 -0
- package/dist/stories/Input.stories.js +422 -0
- package/dist/stories/InputOld.stories.js +103 -0
- package/dist/stories/KpiFilter.stories.js +401 -0
- package/dist/stories/LinkButton.stories.js +171 -0
- package/dist/stories/LinnerDataBox.stories.js +79 -0
- package/dist/stories/ListBox.stories.js +132 -0
- package/dist/stories/MarketShareDescription.stories.js +196 -0
- package/dist/stories/MonthPicker.stories.js +142 -0
- package/dist/stories/NewInput.stories.js +37 -0
- package/dist/stories/NoDataFoundMessage.stories.js +66 -0
- package/dist/stories/OneColumnContainer.stories.js +119 -0
- package/dist/stories/PerformanceAnalytics.stories.js +263 -0
- package/dist/stories/PerformanceAnalyticsLegend.stories.js +99 -0
- package/dist/stories/PerformanceAnalyticsOneColumn.stories.js +236 -0
- package/dist/stories/PerformanceAnalyticsTotals.stories.js +109 -0
- package/dist/stories/PieChart.stories.js +215 -0
- package/dist/stories/PopupCharts.stories.js +1191 -0
- package/dist/stories/ProductsVariety.stories.js +90 -0
- package/dist/stories/ProgressBar.stories.js +71 -0
- package/dist/stories/QuarterPicker.stories.js +142 -0
- package/dist/stories/QuickFilter.stories.js +275 -0
- package/dist/stories/RangePicker.stories.js +140 -0
- package/dist/stories/ReportTable.stories.js +255 -0
- package/dist/stories/SagButton.stories.js +118 -0
- package/dist/stories/SagIconButton.stories.js +122 -0
- package/dist/stories/SagInput.stories.js +69 -0
- package/dist/stories/SalesAndROI.stories.js +166 -0
- package/dist/stories/SalesSplit.stories.js +122 -0
- package/dist/stories/SearchInput.stories.js +44 -0
- package/dist/stories/SegmentedButton.stories.js +181 -0
- package/dist/stories/Select.stories.js +201 -0
- package/dist/stories/SingleBarLineCharts.stories.js +310 -0
- package/dist/stories/TabMenu.stories.js +224 -0
- package/dist/stories/TextField.stories.js +160 -0
- package/dist/stories/TitleDescription.stories.js +116 -0
- package/dist/stories/TopToggleList.stories.js +52 -0
- package/dist/stories/TotalBenchmark.stories.js +135 -0
- package/dist/stories/TotalBenchmarkAreachart.stories.js +341 -0
- package/dist/stories/TotalBenchmarkArrows.stories.js +170 -0
- package/dist/stories/TotalBenchmarkBarchart.stories.js +183 -0
- package/dist/stories/TotalDoughnutChart.stories.js +301 -0
- package/dist/stories/TotalHorizontalCharts.stories.js +291 -0
- package/dist/stories/TwoBarCharts.stories.js +185 -0
- package/dist/stories/components/AttachedFile.js +60 -0
- package/dist/stories/components/AttachedFile.style.js +48 -0
- package/dist/stories/components/AutocompleteField.js +40 -0
- package/dist/stories/components/AutocompleteField.style.js +55 -0
- package/dist/stories/components/BannerEventBox.js +97 -0
- package/dist/stories/components/BannerEventBox.style.js +78 -0
- package/dist/stories/components/BannerEventBoxList.js +153 -0
- package/dist/stories/components/BannerEventBoxList.style.js +189 -0
- package/dist/stories/components/BannerEventBoxTest.js +42 -0
- package/dist/stories/components/BannerEventBoxTest.style.js +11 -0
- package/dist/stories/components/BannersDropdown.js +119 -0
- package/dist/stories/components/BannersDropdown.style.js +99 -0
- package/dist/stories/components/BarChart.js +258 -0
- package/dist/stories/components/BarChart.style.js +60 -0
- package/dist/stories/components/BarChartTwoRows.js +220 -0
- package/dist/stories/components/BarChartTwoRows.style.js +79 -0
- package/dist/stories/components/BarChartWithAreaChart.js +268 -0
- package/dist/stories/components/BarChartWithAreaChart.style.js +67 -0
- package/dist/stories/components/BarChartsByWeeks.js +306 -0
- package/dist/stories/components/BarChartsByWeeks.style.js +96 -0
- package/dist/stories/components/Benchmark.js +130 -0
- package/dist/stories/components/Benchmark.style.js +61 -0
- package/dist/stories/components/Button.js +255 -0
- package/dist/stories/components/Button.style.js +90 -0
- package/dist/stories/components/CampaignTool/CampaignDemoReport.js +48 -0
- package/dist/stories/components/CampaignTool/CampaignDemoReport.style.js +48 -0
- package/dist/stories/components/CampaignTool/Card.js +72 -0
- package/dist/stories/components/CampaignTool/Card.style.js +65 -0
- package/dist/stories/components/CampaignTool/FormInput.js +41 -0
- package/dist/stories/components/CampaignTool/FormSelect.js +42 -0
- package/dist/stories/components/CampaignTool/MultipleCard.js +26 -0
- package/dist/stories/components/CampaignTool/MultipleCard.style.js +13 -0
- package/dist/stories/components/CampaignTool/PageFilterBar.js +23 -0
- package/dist/stories/components/CampaignTool/PageFilterBar.style.js +22 -0
- package/dist/stories/components/CampaignTool/Popup.js +172 -0
- package/dist/stories/components/CampaignTool/Popup.style.js +122 -0
- package/dist/stories/components/CampaignTool/PopupContent.js +111 -0
- package/dist/stories/components/CampaignTool/PopupContent.style.js +74 -0
- package/dist/stories/components/CampaignTool/PopupFieldsRules.js +168 -0
- package/dist/stories/components/CampaignTool/Table.js +195 -0
- package/dist/stories/components/CampaignTool/Table.style.js +86 -0
- package/dist/stories/components/CheckBox.js +76 -0
- package/dist/stories/components/CheckBox.style.js +36 -0
- package/dist/stories/components/CheckBoxButton.js +69 -0
- package/dist/stories/components/CheckBoxButton.style.js +39 -0
- package/dist/stories/components/CodeEditor.js +43 -0
- package/dist/stories/components/CodeEditor.style.js +13 -0
- package/dist/stories/components/CollapseData.js +66 -0
- package/dist/stories/components/CollapseData.style.js +127 -0
- package/dist/stories/components/CollapseHeader.js +255 -0
- package/dist/stories/components/CollapseHeader.style.js +200 -0
- package/dist/stories/components/CollapseMenuItem.js +61 -0
- package/dist/stories/components/CollapseMenuItem.style.js +61 -0
- package/dist/stories/components/CommonFunctions.js +99 -0
- package/dist/stories/components/Datepicker.js +148 -0
- package/dist/stories/components/Datepicker.style.js +19 -0
- package/dist/stories/components/DialogOverlay.js +44 -0
- package/dist/stories/components/DialogOverlay.style.js +70 -0
- package/dist/stories/components/DoublePanelDataRow.js +70 -0
- package/dist/stories/components/DoublePanelDataRow.style.js +66 -0
- package/dist/stories/components/DownloadProgress.js +97 -0
- package/dist/stories/components/DownloadProgress.style.js +51 -0
- package/dist/stories/components/Dropdown.js +231 -0
- package/dist/stories/components/Dropdown.style.js +17 -0
- package/dist/stories/components/DropdownMulti.js +290 -0
- package/dist/stories/components/DropdownMulti.style.js +17 -0
- package/dist/stories/components/DropdownMultiNew.js +292 -0
- package/dist/stories/components/DropdownMultiNew.style.js +218 -0
- package/dist/stories/components/DropdownNew.js +98 -0
- package/dist/stories/components/DropdownNew.style.js +21 -0
- package/dist/stories/components/DropdownSingleNew.js +256 -0
- package/dist/stories/components/DropdownSingleNew.style.js +189 -0
- package/dist/stories/components/EventDetailsCard.js +142 -0
- package/dist/stories/components/EventDetailsCard.style.js +62 -0
- package/dist/stories/components/EventList.js +61 -0
- package/dist/stories/components/EventList.style.js +38 -0
- package/dist/stories/components/EventListItem.js +50 -0
- package/dist/stories/components/EventListItem.style.js +47 -0
- package/dist/stories/components/FilterButton.js +53 -0
- package/dist/stories/components/FilterButton.style.js +12 -0
- package/dist/stories/components/FilterContainer.js +29 -0
- package/dist/stories/components/FilterContainer.style.js +30 -0
- package/dist/stories/components/FilterPanel.js +614 -0
- package/dist/stories/components/FilterPanel.style.js +89 -0
- package/dist/stories/components/FormattedValue.js +69 -0
- package/dist/stories/components/FormattedValue.style.js +91 -0
- package/dist/stories/components/Heatmap.js +184 -0
- package/dist/stories/components/Heatmap.style.js +151 -0
- package/dist/stories/components/IconButton.js +147 -0
- package/dist/stories/components/IconButton.style.js +64 -0
- package/dist/stories/components/Input.js +186 -0
- package/dist/stories/components/Input.style.js +132 -0
- package/dist/stories/components/InputOld.js +93 -0
- package/dist/stories/components/InputOld.style.js +71 -0
- package/dist/stories/components/KpiFilter.js +345 -0
- package/dist/stories/components/KpiFilter.style.js +132 -0
- package/dist/stories/components/LinkButton.js +225 -0
- package/dist/stories/components/LinkButton.style.js +53 -0
- package/dist/stories/components/LinnerDataBox.js +54 -0
- package/dist/stories/components/LinnerDataBox.style.js +68 -0
- package/dist/stories/components/ListBox.js +82 -0
- package/dist/stories/components/ListBox.style.js +48 -0
- package/dist/stories/components/MarketShareDescription.js +109 -0
- package/dist/stories/components/MarketShareDescription.style.js +215 -0
- package/dist/stories/components/Modal.js +21 -0
- package/dist/stories/components/Modal.style.js +63 -0
- package/dist/stories/components/ModalTotalBenchmark.js +224 -0
- package/dist/stories/components/ModalTotalCost.js +139 -0
- package/dist/stories/components/MonthPicker.js +169 -0
- package/dist/stories/components/MonthPicker.style.js +105 -0
- package/dist/stories/components/MonthPopupPicker.js +206 -0
- package/dist/stories/components/NewInput.js +33 -0
- package/dist/stories/components/NewInput.style.js +13 -0
- package/dist/stories/components/NoDataFoundMessage.js +30 -0
- package/dist/stories/components/NoDataFoundMessage.style.js +39 -0
- package/dist/stories/components/OneColumnContainer.js +121 -0
- package/dist/stories/components/OneColumnContainer.style.js +107 -0
- package/dist/stories/components/PerformanceAnalytics.js +447 -0
- package/dist/stories/components/PerformanceAnalytics.style.js +144 -0
- package/dist/stories/components/PerformanceAnalyticsLegend.js +59 -0
- package/dist/stories/components/PerformanceAnalyticsLegend.style.js +63 -0
- package/dist/stories/components/PerformanceAnalyticsOneColumn.js +327 -0
- package/dist/stories/components/PerformanceAnalyticsOneColumn.style.js +116 -0
- package/dist/stories/components/PerformanceAnalyticsTotals.js +70 -0
- package/dist/stories/components/PerformanceAnalyticsTotals.style.js +89 -0
- package/dist/stories/components/PieChart.js +154 -0
- package/dist/stories/components/PieChart.style.js +154 -0
- package/dist/stories/components/PopupCharts.js +244 -0
- package/dist/stories/components/PopupCharts.style.js +108 -0
- package/dist/stories/components/ProductsVariety.js +94 -0
- package/dist/stories/components/ProductsVariety.style.js +86 -0
- package/dist/stories/components/ProgressBar.js +52 -0
- package/dist/stories/components/ProgressBar.style.js +24 -0
- package/dist/stories/components/QuarterPicker.js +168 -0
- package/dist/stories/components/QuarterPicker.style.js +104 -0
- package/dist/stories/components/QuarterPopupPicker.js +186 -0
- package/dist/stories/components/QuickFilter.js +78 -0
- package/dist/stories/components/QuickFilter.style.js +21 -0
- package/dist/stories/components/QuickFilterDropdownMultiSelection.js +299 -0
- package/dist/stories/components/QuickFilterDropdownMultiSelection.style.js +194 -0
- package/dist/stories/components/QuickFilterDropdownSingle.js +229 -0
- package/dist/stories/components/QuickFilterDropdownSingle.style.js +139 -0
- package/dist/stories/components/RangeDatePicker.js +231 -0
- package/dist/stories/components/RangePicker.js +179 -0
- package/dist/stories/components/RangePicker.style.js +109 -0
- package/dist/stories/components/ReportTable.js +420 -0
- package/dist/stories/components/ReportTable.style.js +306 -0
- package/dist/stories/components/SagButton.js +68 -0
- package/dist/stories/components/SagButton.style.js +47 -0
- package/dist/stories/components/SagIconButton.js +130 -0
- package/dist/stories/components/SagIconButton.style.js +30 -0
- package/dist/stories/components/SagInput.js +53 -0
- package/dist/stories/components/SagInput.style.js +41 -0
- package/dist/stories/components/SalesAndROI.js +89 -0
- package/dist/stories/components/SalesAndROI.style.js +111 -0
- package/dist/stories/components/SalesSplit.js +153 -0
- package/dist/stories/components/SalesSplit.style.js +150 -0
- package/dist/stories/components/SearchInput.js +39 -0
- package/dist/stories/components/SearchInput.style.js +37 -0
- package/dist/stories/components/SegmentedButton.js +124 -0
- package/dist/stories/components/SegmentedButton.style.js +100 -0
- package/dist/stories/components/Select.js +137 -0
- package/dist/stories/components/Select.style.js +104 -0
- package/dist/stories/components/SingleBarLineCharts.js +415 -0
- package/dist/stories/components/SingleBarLineCharts.style.js +101 -0
- package/dist/stories/components/TabMenu.js +241 -0
- package/dist/stories/components/TabMenu.style.js +120 -0
- package/dist/stories/components/TextField.js +209 -0
- package/dist/stories/components/TextField.style.js +18 -0
- package/dist/stories/components/TitleDescription.js +272 -0
- package/dist/stories/components/TitleDescription.style.js +222 -0
- package/dist/stories/components/Tooltip.js +44 -0
- package/dist/stories/components/Tooltip.style.js +103 -0
- package/dist/stories/components/TopToggleList.js +46 -0
- package/dist/stories/components/TopToggleList.style.js +51 -0
- package/dist/stories/components/TotalBenchmark.js +97 -0
- package/dist/stories/components/TotalBenchmark.style.js +79 -0
- package/dist/stories/components/TotalBenchmarkAreachart.js +342 -0
- package/dist/stories/components/TotalBenchmarkAreachart.style.js +171 -0
- package/dist/stories/components/TotalBenchmarkArrows.js +149 -0
- package/dist/stories/components/TotalBenchmarkArrows.style.js +108 -0
- package/dist/stories/components/TotalBenchmarkBarchart.js +165 -0
- package/dist/stories/components/TotalBenchmarkBarchart.style.js +77 -0
- package/dist/stories/components/TotalDoughnutChart.js +187 -0
- package/dist/stories/components/TotalDoughnutChart.style.js +178 -0
- package/dist/stories/components/TotalHorizontalCharts.js +236 -0
- package/dist/stories/components/TotalHorizontalCharts.style.js +93 -0
- package/dist/stories/components/TspanTooltip.js +33 -0
- package/dist/stories/components/TspanTooltip.style.js +105 -0
- package/dist/stories/components/TwoBarCharts.js +211 -0
- package/dist/stories/components/TwoBarCharts.style.js +60 -0
- package/dist/stories/components/icons/ArrowDownIcon.js +27 -0
- package/dist/stories/components/icons/ArrowDropDownIcon.js +27 -0
- package/dist/stories/components/icons/ArrowSelectIcon.js +28 -0
- package/dist/stories/components/icons/ArrowUpIcon.js +27 -0
- package/dist/stories/components/icons/AttachedIcon.js +27 -0
- package/dist/stories/components/icons/BellIcon.js +27 -0
- package/dist/stories/components/icons/ButtonArrowRight.js +27 -0
- package/dist/stories/components/icons/Calendar.js +20 -0
- package/dist/stories/components/icons/CalendarIcon.js +27 -0
- package/dist/stories/components/icons/CalendarInOpen.js +26 -0
- package/dist/stories/components/icons/CheckBoxButtonCheckedIcon.js +28 -0
- package/dist/stories/components/icons/CheckBoxCheckedIcon.js +28 -0
- package/dist/stories/components/icons/CheckBoxNotCheckedIcon.js +28 -0
- package/dist/stories/components/icons/ChervronLeftIcon.js +20 -0
- package/dist/stories/components/icons/ChervronRightIcon.js +20 -0
- package/dist/stories/components/icons/ChevronLeftIcon.js +29 -0
- package/dist/stories/components/icons/ChevronRightIcon.js +29 -0
- package/dist/stories/components/icons/ClockIcon.js +27 -0
- package/dist/stories/components/icons/CloseIcon.js +27 -0
- package/dist/stories/components/icons/CloseXIcon.js +27 -0
- package/dist/stories/components/icons/ComboBoxArrowDownIcon.js +28 -0
- package/dist/stories/components/icons/ComboBoxArrowUpIcon.js +28 -0
- package/dist/stories/components/icons/DocumentIcon.js +48 -0
- package/dist/stories/components/icons/DownloadIcon.js +27 -0
- package/dist/stories/components/icons/Duplicate.js +28 -0
- package/dist/stories/components/icons/ErrorIcon.js +28 -0
- package/dist/stories/components/icons/ExitIcon.js +28 -0
- package/dist/stories/components/icons/ExportIcon.js +28 -0
- package/dist/stories/components/icons/EyeIcon.js +28 -0
- package/dist/stories/components/icons/FileIcon.js +27 -0
- package/dist/stories/components/icons/FilterIcon.js +36 -0
- package/dist/stories/components/icons/FlyIcon.js +28 -0
- package/dist/stories/components/icons/FoodLionChartIcon.js +42 -0
- package/dist/stories/components/icons/FoodLionIcon.js +3076 -0
- package/dist/stories/components/icons/FoodLionNewIcon.js +39 -0
- package/dist/stories/components/icons/GiantFoodChartIcon.js +40 -0
- package/dist/stories/components/icons/GiantFoodIcon.js +1976 -0
- package/dist/stories/components/icons/GiantFoodIcon_new.js +42 -0
- package/dist/stories/components/icons/HannafordChartIcon.js +40 -0
- package/dist/stories/components/icons/HannafordIcon.js +5017 -0
- package/dist/stories/components/icons/HannafordIcon_new.js +41 -0
- package/dist/stories/components/icons/HannafordNewIcon.js +213 -0
- package/dist/stories/components/icons/InfoIcon.js +28 -0
- package/dist/stories/components/icons/LampIcon.js +30 -0
- package/dist/stories/components/icons/LegendLineIcon.js +29 -0
- package/dist/stories/components/icons/LegendUnionIcon.js +29 -0
- package/dist/stories/components/icons/MaintenanceIcon.js +28 -0
- package/dist/stories/components/icons/MenuItemClosedIcon.js +28 -0
- package/dist/stories/components/icons/MenuItemOpenIcon.js +28 -0
- package/dist/stories/components/icons/MenuItemRightIcon.js +28 -0
- package/dist/stories/components/icons/MenuItemUpIcon.js +28 -0
- package/dist/stories/components/icons/NoDataFoundIcon.js +86 -0
- package/dist/stories/components/icons/OptionsIcon.js +27 -0
- package/dist/stories/components/icons/ReselectIcon.js +27 -0
- package/dist/stories/components/icons/SearchIcon.js +27 -0
- package/dist/stories/components/icons/ShoppingCartIcon.js +45 -0
- package/dist/stories/components/icons/ShoutIcon.js +27 -0
- package/dist/stories/components/icons/Sort.js +13 -0
- package/dist/stories/components/icons/SortIcon.js +35 -0
- package/dist/stories/components/icons/SpotlightProductIcon.js +28 -0
- package/dist/stories/components/icons/StopAndShopChartIcon.js +42 -0
- package/dist/stories/components/icons/StopAndShopIcon.js +134 -0
- package/dist/stories/components/icons/StopAndShopNewIcon.js +41 -0
- package/dist/stories/components/icons/SucceededIcon.js +28 -0
- package/dist/stories/components/icons/TheGiantCompanyChartIcon.js +40 -0
- package/dist/stories/components/icons/TheGiantCompanyIcon.js +40 -0
- package/dist/stories/components/icons/TheGiantCompanyIcon_old.js +1831 -0
- package/dist/stories/components/icons/TheGiantCompanyNewIcon.js +39 -0
- package/dist/stories/utils/ComponentFactory.js +65 -0
- package/dist/stories/utils/IconsHandler.js +150 -0
- package/dist/stories/utils/IconsHandler.style.js +16 -0
- package/dist/stories/utils/regex/Email.regex.js +7 -0
- package/dist/stories/utils/regex/LatinWithSpaces.regex.js +7 -0
- package/dist/stories/utils/regex/OnlyEnglishLetters.regex.js +7 -0
- package/dist/stories/utils/regex/Phone.regex.js +7 -0
- package/dist/types/components/LinnerDataBox/LinnerDataBox.data.d.ts +23 -0
- package/dist/vite.config.js +15 -0
- package/package.json +4 -4
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.OneColumnContainer = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _reactLoadingSkeleton = _interopRequireWildcard(require("react-loading-skeleton"));
|
|
12
|
+
var _InfoIcon = require("./icons/InfoIcon");
|
|
13
|
+
var _ExportIcon = require("./icons/ExportIcon");
|
|
14
|
+
var _OneColumnContainer = require("./OneColumnContainer.style");
|
|
15
|
+
require("react-loading-skeleton/dist/skeleton.css");
|
|
16
|
+
const OneColumnContainer = props => {
|
|
17
|
+
const {
|
|
18
|
+
children,
|
|
19
|
+
display,
|
|
20
|
+
isLoading,
|
|
21
|
+
gridTemplateColumns,
|
|
22
|
+
itemClass,
|
|
23
|
+
divStyle,
|
|
24
|
+
overStyle,
|
|
25
|
+
draggingStyle,
|
|
26
|
+
droppedStyle,
|
|
27
|
+
width,
|
|
28
|
+
height,
|
|
29
|
+
overflow,
|
|
30
|
+
infoTitle,
|
|
31
|
+
infoText,
|
|
32
|
+
disableInfo,
|
|
33
|
+
showViewByBannerButton,
|
|
34
|
+
onBannerClick,
|
|
35
|
+
columnTitle
|
|
36
|
+
} = props;
|
|
37
|
+
const [hover, setHover] = (0, _react.useState)(false);
|
|
38
|
+
const [offsetWidth, setOffsetWidth] = (0, _react.useState)(200);
|
|
39
|
+
const nodeRef = (0, _react.useRef)(null);
|
|
40
|
+
const anotherRef = (0, _react.useRef)(null);
|
|
41
|
+
(0, _react.useEffect)(() => {
|
|
42
|
+
var _anotherRef$current;
|
|
43
|
+
setOffsetWidth(anotherRef === null || anotherRef === void 0 ? void 0 : (_anotherRef$current = anotherRef.current) === null || _anotherRef$current === void 0 ? void 0 : _anotherRef$current.offsetWidth);
|
|
44
|
+
}, [anotherRef]);
|
|
45
|
+
return /*#__PURE__*/_react.default.createElement(_OneColumnContainer.StyledContainer, {
|
|
46
|
+
className: (0, _classnames.default)('OneColumnContainer', itemClass, overStyle, draggingStyle, children && droppedStyle, divStyle),
|
|
47
|
+
width: width,
|
|
48
|
+
height: height,
|
|
49
|
+
overflow: overflow
|
|
50
|
+
}, /*#__PURE__*/_react.default.createElement(_OneColumnContainer.OneColumnContainerMainDiv, {
|
|
51
|
+
className: "OneColumnContainerMainDiv",
|
|
52
|
+
width: width,
|
|
53
|
+
height: height,
|
|
54
|
+
display: display,
|
|
55
|
+
gridTemplateColumns: gridTemplateColumns,
|
|
56
|
+
ref: nodeRef
|
|
57
|
+
}, !isLoading && columnTitle && !hover && /*#__PURE__*/_react.default.createElement(_OneColumnContainer.ColumnTitle, {
|
|
58
|
+
className: "ColumnTitle"
|
|
59
|
+
}, columnTitle), !isLoading && showViewByBannerButton && !hover && /*#__PURE__*/_react.default.createElement(_OneColumnContainer.BannerContainer, {
|
|
60
|
+
className: "BannerContainer",
|
|
61
|
+
right: disableInfo ? '20px' : '45px'
|
|
62
|
+
}, /*#__PURE__*/_react.default.createElement(_OneColumnContainer.OutBanner, {
|
|
63
|
+
className: "OutBanner",
|
|
64
|
+
onClick: () => onBannerClick({
|
|
65
|
+
eventName: 'onBannerClick'
|
|
66
|
+
})
|
|
67
|
+
}, /*#__PURE__*/_react.default.createElement(_ExportIcon.ExportIcon, null), "By Banner")), !isLoading && !hover && children, !disableInfo && !isLoading && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_OneColumnContainer.IconContainer, {
|
|
68
|
+
className: "IconContainer",
|
|
69
|
+
onMouseEnter: () => setHover(true),
|
|
70
|
+
onMouseLeave: () => setHover(false)
|
|
71
|
+
}, /*#__PURE__*/_react.default.createElement(_InfoIcon.InfoIcon, null)), hover && /*#__PURE__*/_react.default.createElement(_OneColumnContainer.InfoTextContainer, {
|
|
72
|
+
className: "InfoTextContainer"
|
|
73
|
+
}, infoTitle && /*#__PURE__*/_react.default.createElement(_OneColumnContainer.InfoTitleLabel, {
|
|
74
|
+
className: "InfoTitleLabel",
|
|
75
|
+
dangerouslySetInnerHTML: {
|
|
76
|
+
__html: infoTitle
|
|
77
|
+
}
|
|
78
|
+
}), /*#__PURE__*/_react.default.createElement(_OneColumnContainer.InfoTextLabel, {
|
|
79
|
+
className: "InfoTextLabel",
|
|
80
|
+
dangerouslySetInnerHTML: {
|
|
81
|
+
__html: infoText
|
|
82
|
+
}
|
|
83
|
+
}))), isLoading && /*#__PURE__*/_react.default.createElement(_OneColumnContainer.LoadingDiv, {
|
|
84
|
+
className: "loadingDiv"
|
|
85
|
+
}, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.SkeletonTheme, {
|
|
86
|
+
baseColor: "#EAEAEA"
|
|
87
|
+
}, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
88
|
+
enableAnimation: true,
|
|
89
|
+
width: (offsetWidth !== null && offsetWidth !== void 0 ? offsetWidth : 200) * 0.76,
|
|
90
|
+
height: 45,
|
|
91
|
+
containerClassName: "avatar-skeleton"
|
|
92
|
+
}), /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
93
|
+
enableAnimation: true,
|
|
94
|
+
count: 4,
|
|
95
|
+
width: (offsetWidth !== null && offsetWidth !== void 0 ? offsetWidth : 200) * 0.76,
|
|
96
|
+
height: 10,
|
|
97
|
+
containerClassName: "avatar-skeleton"
|
|
98
|
+
})))));
|
|
99
|
+
};
|
|
100
|
+
exports.OneColumnContainer = OneColumnContainer;
|
|
101
|
+
OneColumnContainer.defaultProps = {
|
|
102
|
+
children: '',
|
|
103
|
+
display: 'block',
|
|
104
|
+
isLoading: '',
|
|
105
|
+
gridTemplateColumns: '',
|
|
106
|
+
itemClass: '',
|
|
107
|
+
divStyle: '',
|
|
108
|
+
overStyle: '',
|
|
109
|
+
draggingStyle: '',
|
|
110
|
+
droppedStyle: '',
|
|
111
|
+
width: '300px',
|
|
112
|
+
height: '300px',
|
|
113
|
+
overflow: 'hidden',
|
|
114
|
+
infoTitle: '',
|
|
115
|
+
infoText: '',
|
|
116
|
+
disableInfo: false,
|
|
117
|
+
showViewByBannerButton: false,
|
|
118
|
+
onBannerClick: () => {},
|
|
119
|
+
columnTitle: ''
|
|
120
|
+
};
|
|
121
|
+
var _default = exports.default = OneColumnContainer;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.StyledContainer = exports.OutBanner = exports.OneColumnContainerMainDiv = exports.LoadingDiv = exports.InfoTitleLabel = exports.InfoTextLabel = exports.InfoTextContainer = exports.IconContainer = exports.ColumnTitle = exports.BannerContainer = void 0;
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
const StyledContainer = exports.StyledContainer = _styledComponents.default.div`
|
|
10
|
+
font-family: "Poppins", sans-serif;
|
|
11
|
+
width: ${props => props.width};
|
|
12
|
+
height: ${props => props.height};
|
|
13
|
+
overflow: ${props => props.overflow};
|
|
14
|
+
display: flex;
|
|
15
|
+
position: relative;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
border-radius: 10px;
|
|
19
|
+
background-color: white;
|
|
20
|
+
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
|
|
21
|
+
`;
|
|
22
|
+
const OneColumnContainerMainDiv = exports.OneColumnContainerMainDiv = _styledComponents.default.div`
|
|
23
|
+
position: relative;
|
|
24
|
+
/* align-items: flex-start; */
|
|
25
|
+
justify-content: center;
|
|
26
|
+
background-color: white;
|
|
27
|
+
width: ${props => props.width};
|
|
28
|
+
height: ${props => props.height};
|
|
29
|
+
display: ${props => props.display};
|
|
30
|
+
grid-template-columns: ${props => props.gridTemplateColumns};
|
|
31
|
+
> * {
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
const InfoTextContainer = exports.InfoTextContainer = _styledComponents.default.div`
|
|
36
|
+
background: white;
|
|
37
|
+
overflow: auto;
|
|
38
|
+
padding: 20px;
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
`;
|
|
41
|
+
const InfoTitleLabel = exports.InfoTitleLabel = _styledComponents.default.div`
|
|
42
|
+
font-weight: 600;
|
|
43
|
+
color: black;
|
|
44
|
+
margin: 0px 0px 10px 0px;
|
|
45
|
+
font-size: 18px;
|
|
46
|
+
line-height: 32px;
|
|
47
|
+
`;
|
|
48
|
+
const InfoTextLabel = exports.InfoTextLabel = _styledComponents.default.div`
|
|
49
|
+
color: black;
|
|
50
|
+
font-size: 14px;
|
|
51
|
+
line-height: 20px;
|
|
52
|
+
font-weight: 400;
|
|
53
|
+
`;
|
|
54
|
+
const ColumnTitle = exports.ColumnTitle = _styledComponents.default.span`
|
|
55
|
+
color: black;
|
|
56
|
+
display: inline-block;
|
|
57
|
+
font-size: 20px;
|
|
58
|
+
font-weight: 500;
|
|
59
|
+
padding: 20px 20px 0;
|
|
60
|
+
`;
|
|
61
|
+
const IconContainer = exports.IconContainer = _styledComponents.default.div`
|
|
62
|
+
width: 20px;
|
|
63
|
+
height: 20px;
|
|
64
|
+
top: 10px;
|
|
65
|
+
right: 10px;
|
|
66
|
+
position: absolute;
|
|
67
|
+
`;
|
|
68
|
+
const LoadingDiv = exports.LoadingDiv = _styledComponents.default.div`
|
|
69
|
+
height: 100%;
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
text-align: center;
|
|
74
|
+
gap: 10px;
|
|
75
|
+
`;
|
|
76
|
+
const BannerContainer = exports.BannerContainer = _styledComponents.default.div`
|
|
77
|
+
position: absolute;
|
|
78
|
+
z-index: 99;
|
|
79
|
+
top: 18px;
|
|
80
|
+
right: ${props => props.right};
|
|
81
|
+
user-select: none;
|
|
82
|
+
`;
|
|
83
|
+
const OutBanner = exports.OutBanner = _styledComponents.default.div`
|
|
84
|
+
display: flex;
|
|
85
|
+
justify-content: flex-end;
|
|
86
|
+
align-items: center;
|
|
87
|
+
gap: 8px;
|
|
88
|
+
font-size: 14px;
|
|
89
|
+
font-weight: 400;
|
|
90
|
+
color: ${props => props.textColor};
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
@media (max-width: 1536px) {
|
|
93
|
+
font-size: 13px;
|
|
94
|
+
}
|
|
95
|
+
> svg {
|
|
96
|
+
width: 14px;
|
|
97
|
+
height: 14px;
|
|
98
|
+
@media (max-width: 1536px) {
|
|
99
|
+
width: 13px;
|
|
100
|
+
height: 13px;
|
|
101
|
+
}
|
|
102
|
+
@media (max-width: 1366px) {
|
|
103
|
+
width: 12px;
|
|
104
|
+
height: 12px;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
`;
|
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.PerformanceAnalytics = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _recharts = require("recharts");
|
|
11
|
+
var _TspanTooltip = _interopRequireDefault(require("./TspanTooltip"));
|
|
12
|
+
var _NoDataFoundMessage = require("./NoDataFoundMessage");
|
|
13
|
+
var _SegmentedButton = require("./SegmentedButton");
|
|
14
|
+
var _PerformanceAnalyticsTotals = require("./PerformanceAnalyticsTotals");
|
|
15
|
+
var _PerformanceAnalyticsLegend = require("./PerformanceAnalyticsLegend");
|
|
16
|
+
var _CommonFunctions = require("./CommonFunctions");
|
|
17
|
+
var _PerformanceAnalytics = require("./PerformanceAnalytics.style");
|
|
18
|
+
/* eslint-disable no-use-before-define */
|
|
19
|
+
/* eslint-disable react/jsx-no-bind */
|
|
20
|
+
/* eslint-disable no-nested-ternary */
|
|
21
|
+
/* eslint-disable camelcase */
|
|
22
|
+
/* eslint-disable react/prop-types */
|
|
23
|
+
/* eslint-disable no-shadow */
|
|
24
|
+
/* eslint-disable no-unsafe-optional-chaining */
|
|
25
|
+
/* eslint-disable react/no-unstable-nested-components */
|
|
26
|
+
|
|
27
|
+
const INDIVIDUAL_PERFORMANCE_STR = 'Individual Performance';
|
|
28
|
+
const PERCENT_INCREMENTAL_GROWTH_STR = '% Incremental Growth';
|
|
29
|
+
const PERCENT_CONTRIBUTION_OF_TOTAL_STR = '% Contribution of Total';
|
|
30
|
+
|
|
31
|
+
/* PerformanceAnalytics */
|
|
32
|
+
const PerformanceAnalytics = props => {
|
|
33
|
+
const {
|
|
34
|
+
currencyType,
|
|
35
|
+
colorGraphROI,
|
|
36
|
+
colorBarchart1,
|
|
37
|
+
colorBarchart2,
|
|
38
|
+
textcolor,
|
|
39
|
+
width,
|
|
40
|
+
height,
|
|
41
|
+
lineChartHeight,
|
|
42
|
+
barChartHeight,
|
|
43
|
+
dotCut,
|
|
44
|
+
noDataText,
|
|
45
|
+
totalsData,
|
|
46
|
+
data,
|
|
47
|
+
legendData,
|
|
48
|
+
tooltipBarchartLabel_ROI,
|
|
49
|
+
tooltipBarchartLabel_IndividualPerformance1,
|
|
50
|
+
tooltipBarchartLabel_IndividualPerformance2,
|
|
51
|
+
tooltipBarchartLabel_IndividualPerformance3,
|
|
52
|
+
tooltipBarchartLabel_ContributionOfTotal1,
|
|
53
|
+
tooltipBarchartLabel_ContributionOfTotal2
|
|
54
|
+
} = props;
|
|
55
|
+
const [segmentedButtonsFilter, setSegmentedButtonsFilter] = (0, _react.useState)(INDIVIDUAL_PERFORMANCE_STR);
|
|
56
|
+
const [showLegendTooltip, setShowLegendTooltip] = (0, _react.useState)(false);
|
|
57
|
+
const [tooltipCouponText, setTooltipCouponText] = (0, _react.useState)({
|
|
58
|
+
content: '',
|
|
59
|
+
clientX: 0,
|
|
60
|
+
clientY: 0
|
|
61
|
+
});
|
|
62
|
+
const displayTotalsData = () => /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsTotals.PerformanceAnalyticsTotals, {
|
|
63
|
+
totalsData: totalsData,
|
|
64
|
+
width: width
|
|
65
|
+
});
|
|
66
|
+
const displaySegmentedButtons = () => /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.SegmentedButtonContainer, {
|
|
67
|
+
id: "SegmentedButtonContainer"
|
|
68
|
+
}, /*#__PURE__*/_react.default.createElement(_SegmentedButton.SegmentedButton, {
|
|
69
|
+
id: "SegmentedButton BaselineSTLY",
|
|
70
|
+
options: [{
|
|
71
|
+
value: INDIVIDUAL_PERFORMANCE_STR
|
|
72
|
+
}, {
|
|
73
|
+
value: PERCENT_INCREMENTAL_GROWTH_STR
|
|
74
|
+
}, {
|
|
75
|
+
value: PERCENT_CONTRIBUTION_OF_TOTAL_STR
|
|
76
|
+
}],
|
|
77
|
+
backgroundcolor: "#F2F2F2",
|
|
78
|
+
controlradius: 8,
|
|
79
|
+
defaultIndex: 0,
|
|
80
|
+
fontSize: 12,
|
|
81
|
+
name: "segmentedDollarsOrUnits",
|
|
82
|
+
onClick: event => {
|
|
83
|
+
setSegmentedButtonsFilter(event.value);
|
|
84
|
+
},
|
|
85
|
+
segmentradius: 8,
|
|
86
|
+
selectedsegmentcolor: "#ffffff",
|
|
87
|
+
selectedtextcolor: "#212121",
|
|
88
|
+
unselectedtextcolor: "#212121",
|
|
89
|
+
width: 490,
|
|
90
|
+
heigth: 14
|
|
91
|
+
}));
|
|
92
|
+
const CustomizedLabelROI = props => {
|
|
93
|
+
const {
|
|
94
|
+
x,
|
|
95
|
+
y,
|
|
96
|
+
stroke,
|
|
97
|
+
value
|
|
98
|
+
} = props;
|
|
99
|
+
return /*#__PURE__*/_react.default.createElement("text", {
|
|
100
|
+
x: x,
|
|
101
|
+
y: y,
|
|
102
|
+
dy: -8,
|
|
103
|
+
fill: stroke,
|
|
104
|
+
fontSize: 14,
|
|
105
|
+
textAnchor: "middle"
|
|
106
|
+
}, value);
|
|
107
|
+
};
|
|
108
|
+
const CustomTooltipROI = _ref => {
|
|
109
|
+
let {
|
|
110
|
+
active,
|
|
111
|
+
payload
|
|
112
|
+
} = _ref;
|
|
113
|
+
if (active && payload && payload.length > 0) {
|
|
114
|
+
var _payload$0$payload;
|
|
115
|
+
return /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.TooltipContainer, null, /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.TooltipTitle, null, `${(_payload$0$payload = payload[0].payload) === null || _payload$0$payload === void 0 ? void 0 : _payload$0$payload.retailer}`), /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.ToolTipLabelAndValueContainer, null, /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.TooltipLabel, null, tooltipBarchartLabel_ROI), /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.TooltipValue, null, `${(0, _CommonFunctions.getFormattedValue)(payload[0].value)}${(0, _CommonFunctions.getFormattedUnits)(payload[0].value)}`)));
|
|
116
|
+
}
|
|
117
|
+
return null;
|
|
118
|
+
};
|
|
119
|
+
const CustomTooltipBarChart = _ref2 => {
|
|
120
|
+
var _payload$0$payload$In, _payload$0$payload$co, _payload$0$payload$co2;
|
|
121
|
+
let {
|
|
122
|
+
active,
|
|
123
|
+
payload
|
|
124
|
+
} = _ref2;
|
|
125
|
+
if (active && payload && payload.length > 0) {
|
|
126
|
+
var _payload$0$payload2, _payload$0$payload3, _payload$0$payload4, _payload$0$payload5;
|
|
127
|
+
const totalCostValue = ((_payload$0$payload2 = payload[0].payload) === null || _payload$0$payload2 === void 0 ? void 0 : _payload$0$payload2.packageCostValue) + ((_payload$0$payload3 = payload[0].payload) === null || _payload$0$payload3 === void 0 ? void 0 : _payload$0$payload3.redemptionCostValue);
|
|
128
|
+
const packageCostPercent = totalCostValue ? ((_payload$0$payload4 = payload[0].payload) === null || _payload$0$payload4 === void 0 ? void 0 : _payload$0$payload4.packageCostValue) / totalCostValue * 100 : 0;
|
|
129
|
+
const redemptionCostPercent = totalCostValue ? ((_payload$0$payload5 = payload[0].payload) === null || _payload$0$payload5 === void 0 ? void 0 : _payload$0$payload5.redemptionCostValue) / totalCostValue * 100 : 0;
|
|
130
|
+
switch (segmentedButtonsFilter) {
|
|
131
|
+
case INDIVIDUAL_PERFORMANCE_STR:
|
|
132
|
+
return /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.TooltipContainer, {
|
|
133
|
+
id: "TooltipContainer"
|
|
134
|
+
}, /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.ToolTipBarchart1Container, {
|
|
135
|
+
id: "ToolTipBarchart1Container"
|
|
136
|
+
}, /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.LegendColorRectangle, {
|
|
137
|
+
id: "LegendColorRectangle",
|
|
138
|
+
color: colorBarchart1
|
|
139
|
+
}), /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.ToolTipBarchart1LabelAndValueContainer, {
|
|
140
|
+
id: "ToolTipBarchart1LabelAndValueContainer"
|
|
141
|
+
}, /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.ToolTipLabelAndValueContainer, {
|
|
142
|
+
id: "ToolTipLabelAndValueContainer"
|
|
143
|
+
}, /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.TooltipLabel, {
|
|
144
|
+
id: "TooltipLabel"
|
|
145
|
+
}, tooltipBarchartLabel_IndividualPerformance1), /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.TooltipValue, {
|
|
146
|
+
id: "TooltipValue"
|
|
147
|
+
}, `${(0, _CommonFunctions.getCurrencySign)(currencyType)}${(0, _CommonFunctions.getFormattedValue)(payload[0].payload.packageCostValue)}
|
|
148
|
+
${(0, _CommonFunctions.getFormattedUnits)(payload[0].payload.packageCostValue)} (${packageCostPercent.toFixed(1)}%) `)), redemptionCostPercent > 0 && /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.ToolTipLabelAndValueContainer, {
|
|
149
|
+
id: "ToolTipLabelAndValueContainer"
|
|
150
|
+
}, /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.TooltipLabel, {
|
|
151
|
+
id: "TooltipLabel"
|
|
152
|
+
}, tooltipBarchartLabel_IndividualPerformance2), /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.TooltipValue, {
|
|
153
|
+
id: "TooltipValue"
|
|
154
|
+
}, `${(0, _CommonFunctions.getCurrencySign)(currencyType)}
|
|
155
|
+
${(0, _CommonFunctions.getFormattedValue)(payload[0].payload.redemptionCostValue)}
|
|
156
|
+
${(0, _CommonFunctions.getFormattedUnits)(payload[0].payload.redemptionCostValue)}
|
|
157
|
+
(${redemptionCostPercent.toFixed(1)}%) `)))), /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.ToolTipLabelAndValueContainer, {
|
|
158
|
+
id: "ToolTipLabelAndValueContainer"
|
|
159
|
+
}, /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.LegendColorRectangle, {
|
|
160
|
+
id: "LegendColorRectangle",
|
|
161
|
+
color: colorBarchart2
|
|
162
|
+
}), /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.TooltipLabel, {
|
|
163
|
+
id: "TooltipLabel"
|
|
164
|
+
}, tooltipBarchartLabel_IndividualPerformance3), /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.TooltipValue, {
|
|
165
|
+
id: "TooltipValue"
|
|
166
|
+
}, `${(0, _CommonFunctions.getCurrencySign)(currencyType)}${(0, _CommonFunctions.getFormattedValue)(payload[0].payload.incrementalSalesValue)}
|
|
167
|
+
${(0, _CommonFunctions.getFormattedUnits)(payload[0].payload.incrementalSalesValue)} `)));
|
|
168
|
+
case PERCENT_INCREMENTAL_GROWTH_STR:
|
|
169
|
+
return /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.TooltipContainer, {
|
|
170
|
+
id: "TooltipContainer"
|
|
171
|
+
}, /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.ToolTipLabelAndValueContainer, {
|
|
172
|
+
id: "ToolTipLabelAndValueContainer"
|
|
173
|
+
}, /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.LegendColorRectangle, {
|
|
174
|
+
id: "LegendColorRectangle",
|
|
175
|
+
color: colorBarchart2
|
|
176
|
+
}), /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.TooltipLabel, {
|
|
177
|
+
id: "TooltipLabel"
|
|
178
|
+
}, "Incremental Growth Value:"), /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.TooltipValue, {
|
|
179
|
+
id: "TooltipValue"
|
|
180
|
+
}, `${(_payload$0$payload$In = payload[0].payload.IncrementalGrowthValue) === null || _payload$0$payload$In === void 0 ? void 0 : _payload$0$payload$In.toFixed(1)}% `)));
|
|
181
|
+
case PERCENT_CONTRIBUTION_OF_TOTAL_STR:
|
|
182
|
+
return /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.TooltipContainer, {
|
|
183
|
+
id: "TooltipContainer"
|
|
184
|
+
}, /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.ToolTipBarchart1Container, {
|
|
185
|
+
id: "ToolTipBarchart1Container"
|
|
186
|
+
}, /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.LegendColorRectangle, {
|
|
187
|
+
id: "LegendColorRectangle",
|
|
188
|
+
color: colorBarchart1
|
|
189
|
+
}), /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.ToolTipBarchart1LabelAndValueContainer, {
|
|
190
|
+
id: "ToolTipBarchart1LabelAndValueContainer"
|
|
191
|
+
}, /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.ToolTipLabelAndValueContainer, {
|
|
192
|
+
id: "ToolTipLabelAndValueContainer"
|
|
193
|
+
}, /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.TooltipLabel, {
|
|
194
|
+
id: "TooltipLabel"
|
|
195
|
+
}, tooltipBarchartLabel_ContributionOfTotal1), /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.TooltipValue, {
|
|
196
|
+
id: "TooltipValue"
|
|
197
|
+
}, `${(_payload$0$payload$co = payload[0].payload.contributionTotalCostValue) === null || _payload$0$payload$co === void 0 ? void 0 : _payload$0$payload$co.toFixed(1)}% `)))), /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.ToolTipLabelAndValueContainer, {
|
|
198
|
+
id: "ToolTipLabelAndValueContainer"
|
|
199
|
+
}, /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.LegendColorRectangle, {
|
|
200
|
+
id: "LegendColorRectangle",
|
|
201
|
+
color: colorBarchart2
|
|
202
|
+
}), /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.TooltipLabel, {
|
|
203
|
+
id: "TooltipLabel"
|
|
204
|
+
}, tooltipBarchartLabel_ContributionOfTotal2), /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.TooltipValue, {
|
|
205
|
+
id: "TooltipValue"
|
|
206
|
+
}, `${(_payload$0$payload$co2 = payload[0].payload.contributionIncrementalSalesValue) === null || _payload$0$payload$co2 === void 0 ? void 0 : _payload$0$payload$co2.toFixed(1)}% `)));
|
|
207
|
+
default:
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return null;
|
|
212
|
+
};
|
|
213
|
+
const displayLineChartROI = () => /*#__PURE__*/_react.default.createElement(_recharts.ResponsiveContainer, {
|
|
214
|
+
id: "ResponsiveContainer",
|
|
215
|
+
height: lineChartHeight
|
|
216
|
+
}, segmentedButtonsFilter !== PERCENT_CONTRIBUTION_OF_TOTAL_STR ? /*#__PURE__*/_react.default.createElement(_recharts.LineChart, {
|
|
217
|
+
data: data,
|
|
218
|
+
margin: {
|
|
219
|
+
top: 20,
|
|
220
|
+
right: 30,
|
|
221
|
+
left: 20,
|
|
222
|
+
bottom: 10
|
|
223
|
+
}
|
|
224
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, {
|
|
225
|
+
content: /*#__PURE__*/_react.default.createElement(CustomTooltipROI, null)
|
|
226
|
+
}), /*#__PURE__*/_react.default.createElement(_recharts.Line, {
|
|
227
|
+
type: "monotone",
|
|
228
|
+
dataKey: "roiValue",
|
|
229
|
+
fill: colorGraphROI,
|
|
230
|
+
name: "retailer",
|
|
231
|
+
stroke: colorGraphROI
|
|
232
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.LabelList, {
|
|
233
|
+
content: /*#__PURE__*/_react.default.createElement(CustomizedLabelROI, null)
|
|
234
|
+
}))) : /*#__PURE__*/_react.default.createElement("div", null));
|
|
235
|
+
const CustomizedLabelBarchart = props => {
|
|
236
|
+
const {
|
|
237
|
+
x,
|
|
238
|
+
y,
|
|
239
|
+
width,
|
|
240
|
+
value,
|
|
241
|
+
payload
|
|
242
|
+
} = props;
|
|
243
|
+
const radius = 10;
|
|
244
|
+
const plusSign = value > 0 ? '+' : '';
|
|
245
|
+
return /*#__PURE__*/_react.default.createElement("g", null, /*#__PURE__*/_react.default.createElement("text", {
|
|
246
|
+
x: x + width / 2,
|
|
247
|
+
y: y - radius,
|
|
248
|
+
fill: textcolor,
|
|
249
|
+
fontWeight: 400,
|
|
250
|
+
fontSize: "16px",
|
|
251
|
+
textAnchor: "middle",
|
|
252
|
+
dominantBaseline: "middle"
|
|
253
|
+
}, segmentedButtonsFilter === INDIVIDUAL_PERFORMANCE_STR ? currencyType ? `${(0, _CommonFunctions.getCurrencySign)(currencyType).toString()}
|
|
254
|
+
${dotCut ? (0, _CommonFunctions.getFormattedValue)(value) : (0, _CommonFunctions.getNumberWithCommas)(value)}
|
|
255
|
+
${dotCut ? (0, _CommonFunctions.getFormattedUnits)(value) : ''} ` : '' : segmentedButtonsFilter === PERCENT_INCREMENTAL_GROWTH_STR ? `${plusSign}${value}%` : segmentedButtonsFilter === PERCENT_CONTRIBUTION_OF_TOTAL_STR ? `${value}%` : ''));
|
|
256
|
+
};
|
|
257
|
+
function CustomizedTickBarChart(props) {
|
|
258
|
+
const {
|
|
259
|
+
x,
|
|
260
|
+
y,
|
|
261
|
+
stroke,
|
|
262
|
+
payload
|
|
263
|
+
} = props;
|
|
264
|
+
const handleMouseEnter = content => {
|
|
265
|
+
setTooltipCouponText(prevState => ({
|
|
266
|
+
...prevState,
|
|
267
|
+
content: content !== prevState.content ? content : prevState.content,
|
|
268
|
+
clientX: x,
|
|
269
|
+
clientY: y
|
|
270
|
+
}));
|
|
271
|
+
setShowLegendTooltip(true);
|
|
272
|
+
};
|
|
273
|
+
const handleMouseLeave = () => {
|
|
274
|
+
setShowLegendTooltip(false);
|
|
275
|
+
};
|
|
276
|
+
if (data && data.length > 0 && payload) {
|
|
277
|
+
const retailerData = data.filter(item => item.retailer === payload.value);
|
|
278
|
+
if (retailerData && retailerData.length > 0) {
|
|
279
|
+
const {
|
|
280
|
+
offerType
|
|
281
|
+
} = retailerData[0];
|
|
282
|
+
return /*#__PURE__*/_react.default.createElement("g", {
|
|
283
|
+
transform: `translate(${x},${y})`,
|
|
284
|
+
onMouseEnter: () => handleMouseEnter(offerType),
|
|
285
|
+
onMouseLeave: handleMouseLeave
|
|
286
|
+
}, /*#__PURE__*/_react.default.createElement("text", {
|
|
287
|
+
x: 0,
|
|
288
|
+
y: 0,
|
|
289
|
+
dy: 16,
|
|
290
|
+
fill: "#212121"
|
|
291
|
+
}, /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.LabelBoldText, {
|
|
292
|
+
textAnchor: "middle",
|
|
293
|
+
x: "0",
|
|
294
|
+
dy: "50",
|
|
295
|
+
fontSize: 16,
|
|
296
|
+
fontWeight: 600
|
|
297
|
+
}, payload.value), /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.LabelText, {
|
|
298
|
+
textAnchor: "middle",
|
|
299
|
+
x: "0",
|
|
300
|
+
dy: "30",
|
|
301
|
+
fontSize: 14,
|
|
302
|
+
fontWeight: 400
|
|
303
|
+
}, retailerData[0].period)));
|
|
304
|
+
}
|
|
305
|
+
return null;
|
|
306
|
+
}
|
|
307
|
+
return null;
|
|
308
|
+
}
|
|
309
|
+
const getDataKeyNameBar1 = () => segmentedButtonsFilter === INDIVIDUAL_PERFORMANCE_STR ? 'totalValue' : segmentedButtonsFilter === PERCENT_INCREMENTAL_GROWTH_STR ? '' : segmentedButtonsFilter === PERCENT_CONTRIBUTION_OF_TOTAL_STR ? 'contributionTotalCostValue' : '';
|
|
310
|
+
const getDataKeyNameBar2 = () => segmentedButtonsFilter === INDIVIDUAL_PERFORMANCE_STR ? 'incrementalSalesValue' : segmentedButtonsFilter === PERCENT_INCREMENTAL_GROWTH_STR ? 'IncrementalGrowthValue' : segmentedButtonsFilter === PERCENT_CONTRIBUTION_OF_TOTAL_STR ? 'contributionIncrementalSalesValue' : '';
|
|
311
|
+
const displayBarChart = () => {
|
|
312
|
+
if (data && data.length > 0) {
|
|
313
|
+
const formatedData = data.map(item => ({
|
|
314
|
+
...item,
|
|
315
|
+
totalValue: item.packageCostValue + item.redemptionCostValue,
|
|
316
|
+
contributionTotalCostValue: item.contributionTotalCostValue
|
|
317
|
+
}));
|
|
318
|
+
return /*#__PURE__*/_react.default.createElement(_recharts.ResponsiveContainer, {
|
|
319
|
+
id: "ResponsiveContainer",
|
|
320
|
+
height: barChartHeight,
|
|
321
|
+
width: width
|
|
322
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.BarChart, {
|
|
323
|
+
data: formatedData,
|
|
324
|
+
maxBarSize: 60,
|
|
325
|
+
margin: {
|
|
326
|
+
top: 30,
|
|
327
|
+
right: 30,
|
|
328
|
+
left: 20,
|
|
329
|
+
bottom: 5
|
|
330
|
+
}
|
|
331
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.XAxis, {
|
|
332
|
+
dataKey: "retailer",
|
|
333
|
+
tick: CustomizedTickBarChart,
|
|
334
|
+
tickLine: false,
|
|
335
|
+
height: 120,
|
|
336
|
+
stroke: isNegativeValueFound() === true ? '#D0D0D0' : '#000'
|
|
337
|
+
}), showLegendTooltip && /*#__PURE__*/_react.default.createElement(_TspanTooltip.default, {
|
|
338
|
+
id: "Tooltip",
|
|
339
|
+
content: tooltipCouponText.content,
|
|
340
|
+
top: tooltipCouponText.clientY,
|
|
341
|
+
left: tooltipCouponText.clientX,
|
|
342
|
+
direction: "top"
|
|
343
|
+
}), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, {
|
|
344
|
+
cursor: {
|
|
345
|
+
fill: 'transparent'
|
|
346
|
+
},
|
|
347
|
+
content: CustomTooltipBarChart
|
|
348
|
+
}), /*#__PURE__*/_react.default.createElement(_recharts.ReferenceLine, {
|
|
349
|
+
y: 0,
|
|
350
|
+
stroke: "#D0D0D0"
|
|
351
|
+
}), segmentedButtonsFilter !== PERCENT_INCREMENTAL_GROWTH_STR ? /*#__PURE__*/_react.default.createElement(_recharts.Bar, {
|
|
352
|
+
dataKey: getDataKeyNameBar1(),
|
|
353
|
+
fill: colorBarchart1,
|
|
354
|
+
minPointSize: 5,
|
|
355
|
+
radius: [5, 5, 0, 0]
|
|
356
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.LabelList, {
|
|
357
|
+
dataKey: getDataKeyNameBar1(),
|
|
358
|
+
content: CustomizedLabelBarchart
|
|
359
|
+
})) : '', /*#__PURE__*/_react.default.createElement(_recharts.Bar, {
|
|
360
|
+
dataKey: getDataKeyNameBar2(),
|
|
361
|
+
fill: colorBarchart2,
|
|
362
|
+
minPointSize: 10,
|
|
363
|
+
radius: [5, 5, 0, 0]
|
|
364
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.LabelList, {
|
|
365
|
+
dataKey: getDataKeyNameBar2(),
|
|
366
|
+
content: CustomizedLabelBarchart
|
|
367
|
+
}))));
|
|
368
|
+
}
|
|
369
|
+
return null;
|
|
370
|
+
};
|
|
371
|
+
const isNegativeValueFound = () => {
|
|
372
|
+
if (data && data.length > 0) {
|
|
373
|
+
const negativeData = data.filter(item => item.IncrementalGrowthValue < 0);
|
|
374
|
+
if (negativeData && negativeData.length > 0) return true;
|
|
375
|
+
return false;
|
|
376
|
+
}
|
|
377
|
+
return false;
|
|
378
|
+
};
|
|
379
|
+
const displayLegendData = () => {
|
|
380
|
+
switch (segmentedButtonsFilter) {
|
|
381
|
+
case INDIVIDUAL_PERFORMANCE_STR:
|
|
382
|
+
return /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsLegend.PerformanceAnalyticsLegend, {
|
|
383
|
+
legendData: legendData
|
|
384
|
+
});
|
|
385
|
+
case PERCENT_INCREMENTAL_GROWTH_STR:
|
|
386
|
+
return /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsLegend.PerformanceAnalyticsLegend, {
|
|
387
|
+
legendData: [{
|
|
388
|
+
iconColor: colorBarchart2,
|
|
389
|
+
iconType: 'Square',
|
|
390
|
+
title: '% Incremental Growth'
|
|
391
|
+
}, {
|
|
392
|
+
iconColor: colorGraphROI,
|
|
393
|
+
iconType: 'LegendUnionIcon',
|
|
394
|
+
title: 'Incremental Sales ROI'
|
|
395
|
+
}]
|
|
396
|
+
});
|
|
397
|
+
case PERCENT_CONTRIBUTION_OF_TOTAL_STR:
|
|
398
|
+
return /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsLegend.PerformanceAnalyticsLegend, {
|
|
399
|
+
legendData: [{
|
|
400
|
+
iconColor: colorBarchart1,
|
|
401
|
+
iconType: 'Square',
|
|
402
|
+
title: '% Contribution to the Total Cost'
|
|
403
|
+
}, {
|
|
404
|
+
iconColor: colorBarchart2,
|
|
405
|
+
iconType: 'Square',
|
|
406
|
+
title: '% Contribution to the Inc. Sales'
|
|
407
|
+
}]
|
|
408
|
+
});
|
|
409
|
+
default:
|
|
410
|
+
return '';
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
return /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.ControlsContainer, {
|
|
414
|
+
id: "ControlsContainer",
|
|
415
|
+
height: height,
|
|
416
|
+
width: width,
|
|
417
|
+
textcolor: textcolor
|
|
418
|
+
}, (totalsData === null || totalsData === void 0 ? void 0 : totalsData.length) > 0 && (data === null || data === void 0 ? void 0 : data.length) > 0 ? /*#__PURE__*/_react.default.createElement(_PerformanceAnalytics.Controls, {
|
|
419
|
+
id: "Controls"
|
|
420
|
+
}, displayTotalsData(), displaySegmentedButtons(), displayLineChartROI(), displayBarChart(), displayLegendData()) : /*#__PURE__*/_react.default.createElement(_NoDataFoundMessage.NoDataFoundMessage, {
|
|
421
|
+
noDataText: noDataText
|
|
422
|
+
}));
|
|
423
|
+
};
|
|
424
|
+
exports.PerformanceAnalytics = PerformanceAnalytics;
|
|
425
|
+
var _default = exports.default = PerformanceAnalytics;
|
|
426
|
+
PerformanceAnalytics.defaultProps = {
|
|
427
|
+
totalsData: [],
|
|
428
|
+
data: [],
|
|
429
|
+
legendData: [],
|
|
430
|
+
currencyType: 'USD',
|
|
431
|
+
colorGraphROI: '#9CCB3B',
|
|
432
|
+
colorBarchart1: '#1F7677',
|
|
433
|
+
colorBarchart2: '#90CE9C',
|
|
434
|
+
textcolor: '#212121',
|
|
435
|
+
width: '',
|
|
436
|
+
height: 130,
|
|
437
|
+
barChartHeight: 130,
|
|
438
|
+
lineChartHeight: 50,
|
|
439
|
+
dotCut: true,
|
|
440
|
+
noDataText: '',
|
|
441
|
+
tooltipBarchartLabel_ROI: 'Incremental Sales ROI:',
|
|
442
|
+
tooltipBarchartLabel_IndividualPerformance1: 'Package Cost:',
|
|
443
|
+
tooltipBarchartLabel_IndividualPerformance2: 'Redemption Cost:',
|
|
444
|
+
tooltipBarchartLabel_IndividualPerformance3: 'Incremental Sales:',
|
|
445
|
+
tooltipBarchartLabel_ContributionOfTotal1: '% Contribution to the Total Cost:',
|
|
446
|
+
tooltipBarchartLabel_ContributionOfTotal2: '% Contribution to the Inc. Sales:'
|
|
447
|
+
};
|