sag_components 2.0.0-beta26 → 2.0.0-beta28
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 +4257 -4248
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +323 -314
- 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 +3 -3
|
@@ -0,0 +1,220 @@
|
|
|
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 = exports.BarChartTwoRows = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _recharts = require("recharts");
|
|
10
|
+
var _CommonFunctions = require("./CommonFunctions");
|
|
11
|
+
var _BarChartTwoRows = require("./BarChartTwoRows.style");
|
|
12
|
+
/* eslint-disable react/prop-types */
|
|
13
|
+
/* eslint-disable no-shadow */
|
|
14
|
+
/* eslint-disable react/no-unstable-nested-components */
|
|
15
|
+
/* eslint-disable no-nested-ternary */
|
|
16
|
+
|
|
17
|
+
const ICON_TYPE_SQUARE = 'Square';
|
|
18
|
+
/* BarChartsByWeeks */
|
|
19
|
+
const BarChartTwoRows = props => {
|
|
20
|
+
const {
|
|
21
|
+
className,
|
|
22
|
+
title,
|
|
23
|
+
width,
|
|
24
|
+
height,
|
|
25
|
+
barChartHeight,
|
|
26
|
+
barSize,
|
|
27
|
+
barFontSizeValue,
|
|
28
|
+
barChartData,
|
|
29
|
+
barChartColorFirst,
|
|
30
|
+
barChartColorSecond,
|
|
31
|
+
showDollarSign,
|
|
32
|
+
isDollar,
|
|
33
|
+
showReferenceLine,
|
|
34
|
+
referenceLinePoint,
|
|
35
|
+
referenceLineColor,
|
|
36
|
+
referenceLineDashed,
|
|
37
|
+
lowerValueLabel,
|
|
38
|
+
highValueLabel,
|
|
39
|
+
showLegend,
|
|
40
|
+
legendData
|
|
41
|
+
} = props;
|
|
42
|
+
const controlsContainerRef = (0, _react.useRef)();
|
|
43
|
+
const displayFormattedValue = value => {
|
|
44
|
+
if (!value) return 'N/A';
|
|
45
|
+
let formattedValue = '';
|
|
46
|
+
formattedValue = !isDollar ? ''.concat('', value.toFixed(1)) : ''.concat(showDollarSign ? '$' : '', (0, _CommonFunctions.getFormattedValue)(value), (0, _CommonFunctions.getFormattedUnits)(value));
|
|
47
|
+
return formattedValue;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// eslint-disable-next-line react/no-unstable-nested-components
|
|
51
|
+
const CustomTooltip = tooltipData => {
|
|
52
|
+
var _payload$0$payload, _payload$0$payload2, _payload$0$payload3, _payload$0$payload4;
|
|
53
|
+
const {
|
|
54
|
+
active,
|
|
55
|
+
payload,
|
|
56
|
+
label
|
|
57
|
+
} = tooltipData;
|
|
58
|
+
if (!active || !payload || (payload === null || payload === void 0 ? void 0 : payload.length) === 0) return null;
|
|
59
|
+
let currentTooltipLowerValue = 0;
|
|
60
|
+
let currentTooltipHighValue = 0;
|
|
61
|
+
if ((_payload$0$payload = payload[0].payload) !== null && _payload$0$payload !== void 0 && _payload$0$payload.lowerValue) currentTooltipLowerValue = (_payload$0$payload2 = payload[0].payload) === null || _payload$0$payload2 === void 0 ? void 0 : _payload$0$payload2.lowerValue;
|
|
62
|
+
if ((_payload$0$payload3 = payload[0].payload) !== null && _payload$0$payload3 !== void 0 && _payload$0$payload3.highValue) currentTooltipHighValue = (_payload$0$payload4 = payload[0].payload) === null || _payload$0$payload4 === void 0 ? void 0 : _payload$0$payload4.highValue;
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.TooltipDiv, null, /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.TooltipTitle, null, `${label}`), /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.TooltipLabel, null, `${lowerValueLabel} ${displayFormattedValue(currentTooltipLowerValue)}`), /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.TooltipLabel, null, `${highValueLabel} ${displayFormattedValue(currentTooltipHighValue)}`));
|
|
64
|
+
};
|
|
65
|
+
const CustomizedTickBarChart = props => {
|
|
66
|
+
const {
|
|
67
|
+
x,
|
|
68
|
+
y,
|
|
69
|
+
payload
|
|
70
|
+
} = props;
|
|
71
|
+
if (barChartData && barChartData.length > 0 && payload) {
|
|
72
|
+
const retailerData = barChartData.filter(item => item.title === payload.value);
|
|
73
|
+
if (retailerData && retailerData.length > 0) {
|
|
74
|
+
return /*#__PURE__*/_react.default.createElement("g", {
|
|
75
|
+
transform: `translate(${x},${y})`
|
|
76
|
+
// onMouseEnter={() => handleMouseEnter(offerType)}
|
|
77
|
+
// onMouseLeave={handleMouseLeave}
|
|
78
|
+
}, /*#__PURE__*/_react.default.createElement("text", {
|
|
79
|
+
x: 0,
|
|
80
|
+
y: 0,
|
|
81
|
+
dy: 16,
|
|
82
|
+
fill: "#212121"
|
|
83
|
+
}, /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.LabelBoldText, {
|
|
84
|
+
textAnchor: "middle",
|
|
85
|
+
x: "0",
|
|
86
|
+
dy: "30",
|
|
87
|
+
fontSize: 16,
|
|
88
|
+
fontWeight: 600
|
|
89
|
+
}, payload.value)), /*#__PURE__*/_react.default.createElement("text", {
|
|
90
|
+
x: 0,
|
|
91
|
+
y: 0,
|
|
92
|
+
dy: 16,
|
|
93
|
+
fill: "#212121"
|
|
94
|
+
}, /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.LabelText, {
|
|
95
|
+
textAnchor: "middle",
|
|
96
|
+
x: "0",
|
|
97
|
+
dy: "50",
|
|
98
|
+
fontSize: 14,
|
|
99
|
+
fontWeight: 400
|
|
100
|
+
}, retailerData[0].date)));
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
return null;
|
|
105
|
+
};
|
|
106
|
+
const CustomizedLabel = props => {
|
|
107
|
+
const {
|
|
108
|
+
x,
|
|
109
|
+
y,
|
|
110
|
+
stroke,
|
|
111
|
+
value
|
|
112
|
+
} = props;
|
|
113
|
+
return /*#__PURE__*/_react.default.createElement("text", {
|
|
114
|
+
x: x + 30,
|
|
115
|
+
y: y,
|
|
116
|
+
dy: -8,
|
|
117
|
+
fill: stroke,
|
|
118
|
+
fontSize: barFontSizeValue,
|
|
119
|
+
textAnchor: "middle"
|
|
120
|
+
}, displayFormattedValue(value));
|
|
121
|
+
};
|
|
122
|
+
return /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.ControlsContainer, {
|
|
123
|
+
className: className,
|
|
124
|
+
height: height,
|
|
125
|
+
width: width,
|
|
126
|
+
ref: controlsContainerRef
|
|
127
|
+
}, /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.Controls, {
|
|
128
|
+
className: "Controls"
|
|
129
|
+
}, title !== '' && /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.Title, null, title), /*#__PURE__*/_react.default.createElement(_recharts.ResponsiveContainer, {
|
|
130
|
+
height: barChartHeight
|
|
131
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.BarChart, {
|
|
132
|
+
width: width,
|
|
133
|
+
height: height,
|
|
134
|
+
data: barChartData,
|
|
135
|
+
maxBarSize: 60,
|
|
136
|
+
margin: {
|
|
137
|
+
top: 20,
|
|
138
|
+
right: 0,
|
|
139
|
+
left: 0,
|
|
140
|
+
bottom: 20
|
|
141
|
+
}
|
|
142
|
+
}, showReferenceLine && /*#__PURE__*/_react.default.createElement(_recharts.ReferenceLine, {
|
|
143
|
+
y: referenceLinePoint,
|
|
144
|
+
stroke: referenceLineColor,
|
|
145
|
+
strokeDasharray: referenceLineDashed
|
|
146
|
+
}), /*#__PURE__*/_react.default.createElement(_recharts.XAxis, {
|
|
147
|
+
dataKey: "title",
|
|
148
|
+
tick: CustomizedTickBarChart,
|
|
149
|
+
tickLine: false,
|
|
150
|
+
height: 80,
|
|
151
|
+
interval: 0,
|
|
152
|
+
stroke: "#D0D0D0"
|
|
153
|
+
}), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, {
|
|
154
|
+
content: /*#__PURE__*/_react.default.createElement(CustomTooltip, null)
|
|
155
|
+
}), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, null), /*#__PURE__*/_react.default.createElement(_recharts.Bar, {
|
|
156
|
+
dataKey: "lowerValue",
|
|
157
|
+
fill: barChartColorFirst,
|
|
158
|
+
minPointSize: 5,
|
|
159
|
+
barSize: barSize !== null && barSize !== void 0 ? barSize : 60,
|
|
160
|
+
radius: 0,
|
|
161
|
+
stackId: "a"
|
|
162
|
+
}), /*#__PURE__*/_react.default.createElement(_recharts.Bar, {
|
|
163
|
+
dataKey: "highValue",
|
|
164
|
+
fill: barChartColorSecond,
|
|
165
|
+
stackId: "a",
|
|
166
|
+
radius: [5, 5, 0, 0]
|
|
167
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.LabelList, {
|
|
168
|
+
dataKey: "value",
|
|
169
|
+
content: CustomizedLabel
|
|
170
|
+
})))), showLegend && /*#__PURE__*/_react.default.createElement(_BarChartTwoRows.LegendContainer, {
|
|
171
|
+
legendData: legendData
|
|
172
|
+
})));
|
|
173
|
+
};
|
|
174
|
+
exports.BarChartTwoRows = BarChartTwoRows;
|
|
175
|
+
var _default = exports.default = BarChartTwoRows;
|
|
176
|
+
BarChartTwoRows.defaultProps = {
|
|
177
|
+
title: 'String',
|
|
178
|
+
width: '100%',
|
|
179
|
+
height: '100%',
|
|
180
|
+
barChartHeight: 250,
|
|
181
|
+
barSize: 60,
|
|
182
|
+
barFontSizeValue: '0.6em',
|
|
183
|
+
barChartColorFirst: '#BD9EFF',
|
|
184
|
+
barChartColorSecond: '#0b00aaF',
|
|
185
|
+
showDollarSign: true,
|
|
186
|
+
isDollar: true,
|
|
187
|
+
showReferenceLine: false,
|
|
188
|
+
referenceLinePoint: 0,
|
|
189
|
+
referenceLineColor: '#212121',
|
|
190
|
+
referenceLineDashed: '5',
|
|
191
|
+
lowerValueLabel: 'Lower Value:',
|
|
192
|
+
highValueLabel: 'High Value:',
|
|
193
|
+
showLegend: true,
|
|
194
|
+
legendData: [{
|
|
195
|
+
title: 'Incremental Sales',
|
|
196
|
+
iconType: ICON_TYPE_SQUARE,
|
|
197
|
+
iconColor: '#BD9EFF'
|
|
198
|
+
}],
|
|
199
|
+
barChartData: [{
|
|
200
|
+
title: 'Food Lion',
|
|
201
|
+
date: '15.01.24-31.01.24',
|
|
202
|
+
value: 542366
|
|
203
|
+
}, {
|
|
204
|
+
title: 'Hannaford',
|
|
205
|
+
date: '15.01.24-31.01.24',
|
|
206
|
+
value: 699511
|
|
207
|
+
}, {
|
|
208
|
+
title: 'The Giant Company',
|
|
209
|
+
date: '15.01.24-31.01.24',
|
|
210
|
+
value: 403092
|
|
211
|
+
}, {
|
|
212
|
+
title: 'Giant Food',
|
|
213
|
+
date: '15.01.24-31.01.24',
|
|
214
|
+
value: 396184
|
|
215
|
+
}, {
|
|
216
|
+
title: 'Stop&Shop',
|
|
217
|
+
date: '15.01.24-31.01.24',
|
|
218
|
+
value: 415317
|
|
219
|
+
}]
|
|
220
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.TooltipTitle = exports.TooltipLabel = exports.TooltipDiv = exports.Title = exports.LegendContainer = exports.LabelText = exports.LabelBoldText = exports.ControlsContainer = exports.Controls = void 0;
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
var _PerformanceAnalyticsLegend = require("./PerformanceAnalyticsLegend");
|
|
10
|
+
const ControlsContainer = exports.ControlsContainer = _styledComponents.default.div`
|
|
11
|
+
font-family: "Poppins", sans-serif;
|
|
12
|
+
width: ${props => props.width};
|
|
13
|
+
height: ${props => props.height};
|
|
14
|
+
border-radius: 12px;
|
|
15
|
+
align-self: center;
|
|
16
|
+
&.NoData {
|
|
17
|
+
align-self: center;
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
width: 50%;
|
|
21
|
+
margin: 10% auto 0;
|
|
22
|
+
}
|
|
23
|
+
> * {
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
const Controls = exports.Controls = _styledComponents.default.div`
|
|
28
|
+
height: 100%;
|
|
29
|
+
width: 100%;
|
|
30
|
+
padding: 24px 40px;
|
|
31
|
+
background: white;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
@media (max-width: 1536px) {
|
|
35
|
+
padding: 12px 32px;
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
const Title = exports.Title = _styledComponents.default.span`
|
|
39
|
+
color: #212121;
|
|
40
|
+
display: inline-block;
|
|
41
|
+
font-size: 18px;
|
|
42
|
+
font-weight: 400;
|
|
43
|
+
margin-bottom: 14px;
|
|
44
|
+
@media (max-width: 1536px) {
|
|
45
|
+
font-size: 16px;
|
|
46
|
+
}
|
|
47
|
+
@media (max-width: 1366px) {
|
|
48
|
+
font-size: 14px;
|
|
49
|
+
}
|
|
50
|
+
`;
|
|
51
|
+
const LegendContainer = exports.LegendContainer = (0, _styledComponents.default)(_PerformanceAnalyticsLegend.PerformanceAnalyticsLegend)`
|
|
52
|
+
margin-top: auto;
|
|
53
|
+
padding-bottom: 16px;
|
|
54
|
+
`;
|
|
55
|
+
const TooltipDiv = exports.TooltipDiv = _styledComponents.default.div`
|
|
56
|
+
border-radius: 5px;
|
|
57
|
+
padding: 8px 12px;
|
|
58
|
+
background: white;
|
|
59
|
+
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);
|
|
60
|
+
margin: 0;
|
|
61
|
+
`;
|
|
62
|
+
const TooltipLabel = exports.TooltipLabel = _styledComponents.default.div`
|
|
63
|
+
color: #212121;
|
|
64
|
+
font-size: 14px;
|
|
65
|
+
font-weight: 400;
|
|
66
|
+
line-height: normal;
|
|
67
|
+
width: fit-content;
|
|
68
|
+
`;
|
|
69
|
+
const TooltipTitle = exports.TooltipTitle = _styledComponents.default.div`
|
|
70
|
+
color: #212121;
|
|
71
|
+
font-size: 14px;
|
|
72
|
+
font-weight: 600;
|
|
73
|
+
`;
|
|
74
|
+
const LabelBoldText = exports.LabelBoldText = _styledComponents.default.tspan`
|
|
75
|
+
font-size: 0.7em;
|
|
76
|
+
`;
|
|
77
|
+
const LabelText = exports.LabelText = _styledComponents.default.tspan`
|
|
78
|
+
font-size: 0.6em;
|
|
79
|
+
`;
|
|
@@ -0,0 +1,268 @@
|
|
|
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.BarChartWithAreaChart = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _recharts = require("recharts");
|
|
11
|
+
var _FoodLionChartIcon = _interopRequireDefault(require("./icons/FoodLionChartIcon"));
|
|
12
|
+
var _GiantFoodChartIcon = _interopRequireDefault(require("./icons/GiantFoodChartIcon"));
|
|
13
|
+
var _TheGiantCompanyChartIcon = _interopRequireDefault(require("./icons/TheGiantCompanyChartIcon"));
|
|
14
|
+
var _StopAndShopChartIcon = _interopRequireDefault(require("./icons/StopAndShopChartIcon"));
|
|
15
|
+
var _HannafordChartIcon = _interopRequireDefault(require("./icons/HannafordChartIcon"));
|
|
16
|
+
var _CommonFunctions = require("./CommonFunctions");
|
|
17
|
+
var _BarChartWithAreaChart = require("./BarChartWithAreaChart.style");
|
|
18
|
+
var _PerformanceAnalyticsLegend = _interopRequireDefault(require("./PerformanceAnalyticsLegend"));
|
|
19
|
+
/* eslint-disable consistent-return */
|
|
20
|
+
/* eslint-disable default-case */
|
|
21
|
+
/* eslint-disable react/prop-types */
|
|
22
|
+
/* eslint-disable no-shadow */
|
|
23
|
+
/* eslint-disable react/no-unstable-nested-components */
|
|
24
|
+
/* eslint-disable no-nested-ternary */
|
|
25
|
+
|
|
26
|
+
const ICON_TYPE_SQUARE = 'Square';
|
|
27
|
+
const BarChartWithAreaChart = props => {
|
|
28
|
+
const {
|
|
29
|
+
className,
|
|
30
|
+
title,
|
|
31
|
+
barChartData,
|
|
32
|
+
barSize,
|
|
33
|
+
barFontSizeValue,
|
|
34
|
+
barChartHeight,
|
|
35
|
+
signType,
|
|
36
|
+
width,
|
|
37
|
+
height,
|
|
38
|
+
barChartColor,
|
|
39
|
+
showLegend,
|
|
40
|
+
isAreaChartDisplayed,
|
|
41
|
+
legendData,
|
|
42
|
+
maxRange
|
|
43
|
+
} = props;
|
|
44
|
+
const controlsContainerRef = (0, _react.useRef)();
|
|
45
|
+
const displayFormattedValue = (value, signType) => {
|
|
46
|
+
if (!value) return '';
|
|
47
|
+
switch (signType) {
|
|
48
|
+
case 'dollar':
|
|
49
|
+
return ''.concat('$', (0, _CommonFunctions.getFormattedValue)(value), (0, _CommonFunctions.getFormattedUnits)(value));
|
|
50
|
+
case 'percentage':
|
|
51
|
+
return ''.concat((0, _CommonFunctions.getFormattedValue)(value), (0, _CommonFunctions.getFormattedUnits)(value), '%');
|
|
52
|
+
case 'unit':
|
|
53
|
+
return ''.concat((0, _CommonFunctions.getFormattedValue)(value), (0, _CommonFunctions.getFormattedUnits)(value));
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const displayRetailerIcon = (retailer, x, y) => {
|
|
57
|
+
switch (retailer) {
|
|
58
|
+
case 'Food Lion':
|
|
59
|
+
return /*#__PURE__*/_react.default.createElement("g", {
|
|
60
|
+
transform: `translate(${x - 34},${y - 10})`
|
|
61
|
+
}, /*#__PURE__*/_react.default.createElement(_FoodLionChartIcon.default, null));
|
|
62
|
+
case 'Hannaford':
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement("g", {
|
|
64
|
+
transform: `translate(${x - 34},${y - 10})`
|
|
65
|
+
}, /*#__PURE__*/_react.default.createElement(_HannafordChartIcon.default, null));
|
|
66
|
+
case 'Stop&Shop':
|
|
67
|
+
return /*#__PURE__*/_react.default.createElement("g", {
|
|
68
|
+
transform: `translate(${x - 34},${y - 10})`
|
|
69
|
+
}, /*#__PURE__*/_react.default.createElement(_StopAndShopChartIcon.default, null));
|
|
70
|
+
case 'The Giant Company':
|
|
71
|
+
return /*#__PURE__*/_react.default.createElement("g", {
|
|
72
|
+
transform: `translate(${x - 34},${y - 10})`
|
|
73
|
+
}, /*#__PURE__*/_react.default.createElement(_TheGiantCompanyChartIcon.default, null));
|
|
74
|
+
case 'Giant Food':
|
|
75
|
+
return /*#__PURE__*/_react.default.createElement("g", {
|
|
76
|
+
transform: `translate(${x - 34},${y - 10})`
|
|
77
|
+
}, /*#__PURE__*/_react.default.createElement(_GiantFoodChartIcon.default, null));
|
|
78
|
+
default:
|
|
79
|
+
return '';
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
const CustomTooltip = props => {
|
|
83
|
+
var _first$payload, _first$payload2, _first$payload3, _first$payload4;
|
|
84
|
+
const {
|
|
85
|
+
active,
|
|
86
|
+
payload,
|
|
87
|
+
label
|
|
88
|
+
} = props;
|
|
89
|
+
if (!active || !payload || (payload === null || payload === void 0 ? void 0 : payload.length) === 0) return null;
|
|
90
|
+
let currentTooltipValue = 0;
|
|
91
|
+
let currentTooltipAvgValue = 0;
|
|
92
|
+
const [first] = payload;
|
|
93
|
+
if ((_first$payload = first.payload) !== null && _first$payload !== void 0 && _first$payload.value) currentTooltipValue = (_first$payload2 = first.payload) === null || _first$payload2 === void 0 ? void 0 : _first$payload2.value;
|
|
94
|
+
if ((_first$payload3 = first.payload) !== null && _first$payload3 !== void 0 && _first$payload3.avgValue) currentTooltipAvgValue = (_first$payload4 = first.payload) === null || _first$payload4 === void 0 ? void 0 : _first$payload4.avgValue;
|
|
95
|
+
return /*#__PURE__*/_react.default.createElement(_BarChartWithAreaChart.TooltipDiv, null, /*#__PURE__*/_react.default.createElement(_BarChartWithAreaChart.TooltipTitle, null, `${label}`), /*#__PURE__*/_react.default.createElement(_BarChartWithAreaChart.TooltipLabel, null, `${title}: ${displayFormattedValue(currentTooltipValue, signType)}`), isAreaChartDisplayed && /*#__PURE__*/_react.default.createElement(_BarChartWithAreaChart.TooltipLabel, null, `AVG. Sales: ${displayFormattedValue(currentTooltipAvgValue, signType)}`));
|
|
96
|
+
};
|
|
97
|
+
const CustomizedTickBarChart = props => {
|
|
98
|
+
const {
|
|
99
|
+
x,
|
|
100
|
+
y,
|
|
101
|
+
payload
|
|
102
|
+
} = props;
|
|
103
|
+
if (barChartData && barChartData.length > 0 && payload) {
|
|
104
|
+
const retailerData = barChartData.filter(item => item.title === payload.value);
|
|
105
|
+
if (retailerData && retailerData.length > 0) {
|
|
106
|
+
return /*#__PURE__*/_react.default.createElement("g", null, displayRetailerIcon(payload.value, x, y), /*#__PURE__*/_react.default.createElement("g", {
|
|
107
|
+
transform: `translate(${x},${y})`
|
|
108
|
+
}, /*#__PURE__*/_react.default.createElement("text", {
|
|
109
|
+
x: 0,
|
|
110
|
+
y: 15,
|
|
111
|
+
dy: 16,
|
|
112
|
+
fill: "#212121"
|
|
113
|
+
}, /*#__PURE__*/_react.default.createElement(_BarChartWithAreaChart.LabelText, {
|
|
114
|
+
textAnchor: "middle",
|
|
115
|
+
x: "0",
|
|
116
|
+
dy: "30",
|
|
117
|
+
fontSize: 14,
|
|
118
|
+
fontWeight: 400
|
|
119
|
+
}, retailerData[0].date))));
|
|
120
|
+
}
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
return null;
|
|
124
|
+
};
|
|
125
|
+
const CustomizedLabel = props => {
|
|
126
|
+
const {
|
|
127
|
+
x,
|
|
128
|
+
y,
|
|
129
|
+
stroke,
|
|
130
|
+
value,
|
|
131
|
+
viewBox
|
|
132
|
+
} = props;
|
|
133
|
+
if (value === undefined || value === null) {
|
|
134
|
+
return /*#__PURE__*/_react.default.createElement("text", {
|
|
135
|
+
x: x + 30,
|
|
136
|
+
y: y,
|
|
137
|
+
dy: -8,
|
|
138
|
+
fill: stroke,
|
|
139
|
+
fontSize: "0.6em",
|
|
140
|
+
textAnchor: "middle"
|
|
141
|
+
}, "N/A");
|
|
142
|
+
}
|
|
143
|
+
if (value === 0) {
|
|
144
|
+
return /*#__PURE__*/_react.default.createElement("text", {
|
|
145
|
+
x: x + 30,
|
|
146
|
+
y: y,
|
|
147
|
+
dy: -8,
|
|
148
|
+
fill: stroke,
|
|
149
|
+
fontSize: barFontSizeValue,
|
|
150
|
+
textAnchor: "middle"
|
|
151
|
+
}, "0");
|
|
152
|
+
}
|
|
153
|
+
if (value < 0) {
|
|
154
|
+
return /*#__PURE__*/_react.default.createElement("text", {
|
|
155
|
+
x: x + 30,
|
|
156
|
+
y: y + viewBox.height,
|
|
157
|
+
dy: -8,
|
|
158
|
+
fill: stroke,
|
|
159
|
+
fontSize: barFontSizeValue,
|
|
160
|
+
textAnchor: "middle"
|
|
161
|
+
}, displayFormattedValue(value, signType));
|
|
162
|
+
}
|
|
163
|
+
return /*#__PURE__*/_react.default.createElement("text", {
|
|
164
|
+
x: x + 30,
|
|
165
|
+
y: y,
|
|
166
|
+
dy: -8,
|
|
167
|
+
fill: stroke,
|
|
168
|
+
fontSize: barFontSizeValue,
|
|
169
|
+
textAnchor: "middle"
|
|
170
|
+
}, displayFormattedValue(value, signType));
|
|
171
|
+
};
|
|
172
|
+
return /*#__PURE__*/_react.default.createElement(_BarChartWithAreaChart.ControlsContainer, {
|
|
173
|
+
className: className,
|
|
174
|
+
height: height,
|
|
175
|
+
width: width,
|
|
176
|
+
ref: controlsContainerRef
|
|
177
|
+
}, /*#__PURE__*/_react.default.createElement(_BarChartWithAreaChart.Controls, {
|
|
178
|
+
className: "Controls"
|
|
179
|
+
}, /*#__PURE__*/_react.default.createElement(_BarChartWithAreaChart.Title, null, title), /*#__PURE__*/_react.default.createElement(_recharts.ResponsiveContainer, {
|
|
180
|
+
height: barChartHeight
|
|
181
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.ComposedChart, {
|
|
182
|
+
data: barChartData
|
|
183
|
+
// margin={{
|
|
184
|
+
// top: 20,
|
|
185
|
+
// right: 0,
|
|
186
|
+
// bottom: -50,
|
|
187
|
+
// left: 0,
|
|
188
|
+
// }}
|
|
189
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.YAxis, {
|
|
190
|
+
type: "number",
|
|
191
|
+
width: 0,
|
|
192
|
+
display: "none",
|
|
193
|
+
domain: [0, dataMax => dataMax * maxRange],
|
|
194
|
+
allowDataOverflow: true
|
|
195
|
+
}), /*#__PURE__*/_react.default.createElement(_recharts.XAxis, {
|
|
196
|
+
dataKey: "title",
|
|
197
|
+
tick: CustomizedTickBarChart,
|
|
198
|
+
tickLine: false,
|
|
199
|
+
height: 120,
|
|
200
|
+
stroke: "#D0D0D0",
|
|
201
|
+
allowDataOverflow: true,
|
|
202
|
+
width: 700,
|
|
203
|
+
interval: 0
|
|
204
|
+
}), isAreaChartDisplayed && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, {
|
|
205
|
+
content: /*#__PURE__*/_react.default.createElement(CustomTooltip, null)
|
|
206
|
+
}), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, null)), /*#__PURE__*/_react.default.createElement(_recharts.Bar, {
|
|
207
|
+
dataKey: "value",
|
|
208
|
+
fill: barChartColor,
|
|
209
|
+
minPointSize: 0,
|
|
210
|
+
barSize: barSize !== null && barSize !== void 0 ? barSize : 60,
|
|
211
|
+
radius: [5, 5, 0, 0]
|
|
212
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.LabelList, {
|
|
213
|
+
dataKey: "value",
|
|
214
|
+
content: CustomizedLabel
|
|
215
|
+
})), isAreaChartDisplayed && /*#__PURE__*/_react.default.createElement(_recharts.Area, {
|
|
216
|
+
dataKey: "avgValue",
|
|
217
|
+
stroke: "#066768",
|
|
218
|
+
fill: "#0666685b"
|
|
219
|
+
}))), showLegend && /*#__PURE__*/_react.default.createElement(_PerformanceAnalyticsLegend.default, {
|
|
220
|
+
legendData: legendData
|
|
221
|
+
})));
|
|
222
|
+
};
|
|
223
|
+
exports.BarChartWithAreaChart = BarChartWithAreaChart;
|
|
224
|
+
var _default = exports.default = BarChartWithAreaChart;
|
|
225
|
+
BarChartWithAreaChart.defaultProps = {
|
|
226
|
+
title: 'Title Chart',
|
|
227
|
+
barChartData: [{
|
|
228
|
+
title: 'Food Lion',
|
|
229
|
+
date: '15.01.24-31.01.24',
|
|
230
|
+
value: 70,
|
|
231
|
+
avgValue: 42
|
|
232
|
+
}, {
|
|
233
|
+
title: 'Hannaford',
|
|
234
|
+
date: '15.01.24-31.01.24',
|
|
235
|
+
value: 50,
|
|
236
|
+
avgValue: 34
|
|
237
|
+
}, {
|
|
238
|
+
title: 'The Giant Company',
|
|
239
|
+
date: '15.01.24-31.01.24',
|
|
240
|
+
value: 40,
|
|
241
|
+
avgValue: 35
|
|
242
|
+
}, {
|
|
243
|
+
title: 'Giant Food',
|
|
244
|
+
date: '15.01.24-31.01.24',
|
|
245
|
+
value: 80,
|
|
246
|
+
avgValue: 70
|
|
247
|
+
}, {
|
|
248
|
+
title: 'Stop&Shop',
|
|
249
|
+
date: '15.01.24-31.01.24',
|
|
250
|
+
value: 20,
|
|
251
|
+
avgValue: 80
|
|
252
|
+
}],
|
|
253
|
+
width: '100%',
|
|
254
|
+
height: '100%',
|
|
255
|
+
barSize: 60,
|
|
256
|
+
barChartHeight: 50,
|
|
257
|
+
barFontSizeValue: '14px',
|
|
258
|
+
barChartColor: '#BD9EFF',
|
|
259
|
+
showLegend: true,
|
|
260
|
+
signType: 'dollar',
|
|
261
|
+
isAreaChartDisplayed: true,
|
|
262
|
+
legendData: [{
|
|
263
|
+
title: 'Incremental Sales',
|
|
264
|
+
iconType: ICON_TYPE_SQUARE,
|
|
265
|
+
iconColor: '#BD9EFF'
|
|
266
|
+
}],
|
|
267
|
+
maxRange: 2
|
|
268
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.TooltipTitle = exports.TooltipLabel = exports.TooltipDiv = exports.Title = exports.RetailerIconContainer = exports.LabelText = exports.LabelBoldText = exports.ControlsContainer = exports.Controls = void 0;
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
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
|
+
background: white;
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
height: ${props => props.height};
|
|
22
|
+
padding: 20px;
|
|
23
|
+
@media (max-width: 1536px) {
|
|
24
|
+
padding: 18px;
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
const TooltipDiv = exports.TooltipDiv = _styledComponents.default.div`
|
|
28
|
+
border-radius: 5px;
|
|
29
|
+
padding: 8px 12px;
|
|
30
|
+
background: white;
|
|
31
|
+
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);
|
|
32
|
+
margin: 0;
|
|
33
|
+
`;
|
|
34
|
+
const TooltipLabel = exports.TooltipLabel = _styledComponents.default.div`
|
|
35
|
+
color: #212121;
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
font-weight: 400;
|
|
38
|
+
width: fit-content;
|
|
39
|
+
`;
|
|
40
|
+
const TooltipTitle = exports.TooltipTitle = _styledComponents.default.div`
|
|
41
|
+
color: #212121;
|
|
42
|
+
font-size: 14px;
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
`;
|
|
45
|
+
const Title = exports.Title = _styledComponents.default.h5`
|
|
46
|
+
font-weight: 500;
|
|
47
|
+
font-size: 18px;
|
|
48
|
+
line-height: 20px;
|
|
49
|
+
margin: 0 0 30px;
|
|
50
|
+
@media (max-width: 1536px) {
|
|
51
|
+
font-size: 16px;
|
|
52
|
+
margin: 0 0 20px;
|
|
53
|
+
}
|
|
54
|
+
@media (max-width: 1366px) {
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
const LabelBoldText = exports.LabelBoldText = _styledComponents.default.tspan`
|
|
59
|
+
font-size: 0.7em;
|
|
60
|
+
`;
|
|
61
|
+
const LabelText = exports.LabelText = _styledComponents.default.tspan`
|
|
62
|
+
font-size: 0.6em;
|
|
63
|
+
`;
|
|
64
|
+
const RetailerIconContainer = exports.RetailerIconContainer = _styledComponents.default.div`
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
`;
|