sag_components 2.0.0-beta60 → 2.0.0-beta62

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/index.esm.js CHANGED
@@ -1933,7 +1933,7 @@ const TitleAndValueContainer$4 = styled.div`
1933
1933
  flex-direction: column;
1934
1934
  padding: 0 20px;
1935
1935
  `;
1936
- const Title$e = styled.h4`
1936
+ const Title$f = styled.h4`
1937
1937
  font-weight: 400;
1938
1938
  font-size: 18px;
1939
1939
  margin: 0 0 8px;
@@ -2068,7 +2068,7 @@ const AvarageDelimiter = styled.div`
2068
2068
  `;
2069
2069
 
2070
2070
  /* Custom properties */
2071
- const TooltipContainer$3 = styled.div`
2071
+ const TooltipContainer$4 = styled.div`
2072
2072
  --tooltip-text-color: black;
2073
2073
  --tooltip-background-color: white;
2074
2074
  --tooltip-margin: 40px;
@@ -2182,7 +2182,7 @@ const Tooltip$1 = props => {
2182
2182
  clearInterval(timeout);
2183
2183
  setActive(false);
2184
2184
  };
2185
- return /*#__PURE__*/React$1.createElement(TooltipContainer$3, null, /*#__PURE__*/React$1.createElement(TooltipWrapper$2, {
2185
+ return /*#__PURE__*/React$1.createElement(TooltipContainer$4, null, /*#__PURE__*/React$1.createElement(TooltipWrapper$2, {
2186
2186
  onMouseEnter: showTip,
2187
2187
  onMouseLeave: hideTip
2188
2188
  }, children, active && /*#__PURE__*/React$1.createElement(TooltipTip$1, {
@@ -2413,7 +2413,7 @@ const PieChart = props => {
2413
2413
  width: width
2414
2414
  }, !hideTitleAndValue && /*#__PURE__*/React$1.createElement(TitleAndValueContainer$4, {
2415
2415
  className: "TitleAndValueContainer"
2416
- }, /*#__PURE__*/React$1.createElement(Title$e, {
2416
+ }, /*#__PURE__*/React$1.createElement(Title$f, {
2417
2417
  className: "Title"
2418
2418
  }, title), /*#__PURE__*/React$1.createElement(CurrencySignAndFormattedValueContainer$2, {
2419
2419
  className: "CurrencySignAndFormattedValueContainer"
@@ -9484,70 +9484,67 @@ const DropdownMain = styled.div`
9484
9484
  `;
9485
9485
 
9486
9486
  /* eslint-disable react/prop-types */
9487
- const DropdownNew = _ref => {
9488
- let {
9489
- isMulti,
9490
- label,
9491
- labelEmptyValue,
9492
- options,
9493
- selectedValue,
9494
- placeHolder,
9495
- onChange,
9496
- required,
9497
- disabled,
9498
- width,
9499
- error,
9500
- errorMessage,
9501
- labelColor,
9502
- checkBoxColor,
9503
- xIconShow,
9504
- showLabelOnTop,
9505
- orderBy,
9506
- elementType
9507
- } = _ref;
9508
- return /*#__PURE__*/React$1.createElement(DropdownMain, {
9509
- className: "DropdownMain",
9510
- width: width
9511
- }, isMulti ? /*#__PURE__*/React$1.createElement(DropdownMultiNew, {
9512
- className: "DropdownMultiNew",
9513
- placeHolder: placeHolder,
9514
- label: label,
9515
- labelEmptyValue: labelEmptyValue,
9516
- labelColor: labelColor,
9517
- checkBoxColor: checkBoxColor,
9518
- required: required,
9519
- options: options,
9520
- width: width,
9521
- disabled: disabled,
9522
- error: error,
9523
- errorMessage: errorMessage,
9524
- selectedValue: selectedValue,
9525
- xIconShow: xIconShow,
9526
- onChange: onChange,
9527
- showLabelOnTop: showLabelOnTop,
9528
- orderBy: orderBy,
9529
- elementType: elementType
9530
- }) : /*#__PURE__*/React$1.createElement(DropdownSingleNew, {
9531
- className: "DropdownSingleNew",
9532
- placeHolder: placeHolder,
9533
- label: label,
9534
- labelEmptyValue: labelEmptyValue,
9535
- labelColor: labelColor,
9536
- checkBoxColor: checkBoxColor,
9537
- required: required,
9538
- options: options,
9539
- width: width,
9540
- disabled: disabled,
9541
- error: error,
9542
- errorMessage: errorMessage,
9543
- selectedValue: selectedValue,
9544
- xIconShow: xIconShow,
9545
- onChange: onChange,
9546
- showLabelOnTop: showLabelOnTop,
9547
- orderBy: orderBy,
9548
- elementType: elementType
9549
- }));
9550
- };
9487
+ const DropdownNew = ({
9488
+ isMulti,
9489
+ label,
9490
+ labelEmptyValue,
9491
+ options,
9492
+ selectedValue,
9493
+ placeHolder,
9494
+ onChange,
9495
+ required,
9496
+ disabled,
9497
+ width,
9498
+ error,
9499
+ errorMessage,
9500
+ labelColor,
9501
+ checkBoxColor,
9502
+ xIconShow,
9503
+ showLabelOnTop,
9504
+ orderBy,
9505
+ elementType
9506
+ }) => /*#__PURE__*/React$1.createElement(DropdownMain, {
9507
+ className: "DropdownMain",
9508
+ width: width
9509
+ }, isMulti ? /*#__PURE__*/React$1.createElement(DropdownMultiNew, {
9510
+ className: "DropdownMultiNew",
9511
+ placeHolder: placeHolder,
9512
+ label: label,
9513
+ labelEmptyValue: labelEmptyValue,
9514
+ labelColor: labelColor,
9515
+ checkBoxColor: checkBoxColor,
9516
+ required: required,
9517
+ options: options,
9518
+ width: width,
9519
+ disabled: disabled,
9520
+ error: error,
9521
+ errorMessage: errorMessage,
9522
+ selectedValue: selectedValue,
9523
+ xIconShow: xIconShow,
9524
+ onChange: onChange,
9525
+ showLabelOnTop: showLabelOnTop,
9526
+ orderBy: orderBy,
9527
+ elementType: elementType
9528
+ }) : /*#__PURE__*/React$1.createElement(DropdownSingleNew, {
9529
+ className: "DropdownSingleNew",
9530
+ placeHolder: placeHolder,
9531
+ label: label,
9532
+ labelEmptyValue: labelEmptyValue,
9533
+ labelColor: labelColor,
9534
+ checkBoxColor: checkBoxColor,
9535
+ required: required,
9536
+ options: options,
9537
+ width: width,
9538
+ disabled: disabled,
9539
+ error: error,
9540
+ errorMessage: errorMessage,
9541
+ selectedValue: selectedValue,
9542
+ xIconShow: xIconShow,
9543
+ onChange: onChange,
9544
+ showLabelOnTop: showLabelOnTop,
9545
+ orderBy: orderBy,
9546
+ elementType: elementType
9547
+ }));
9551
9548
  DropdownNew.propTypes = {
9552
9549
  placeHolder: PropTypes.string,
9553
9550
  label: PropTypes.string,
@@ -9975,21 +9972,20 @@ const DatePicker = ({
9975
9972
  };
9976
9973
 
9977
9974
  /* eslint-disable import/no-extraneous-dependencies */
9978
- const RangePicker = _ref => {
9979
- let {
9980
- label,
9981
- onChange,
9982
- borderRadius,
9983
- required,
9984
- width,
9985
- height,
9986
- placeholder,
9987
- disabled,
9988
- borderColor,
9989
- borderColorFocus,
9990
- textColor,
9991
- selectedValue
9992
- } = _ref;
9975
+ const RangePicker = ({
9976
+ label,
9977
+ onChange,
9978
+ borderRadius,
9979
+ required,
9980
+ width,
9981
+ height,
9982
+ placeholder,
9983
+ disabled,
9984
+ borderColor,
9985
+ borderColorFocus,
9986
+ textColor,
9987
+ selectedValue
9988
+ }) => {
9993
9989
  const [isFocused, setIsFocused] = useState(false);
9994
9990
  const [isOpen, setIsOpen] = useState(false);
9995
9991
  const [value, setValue] = useState(''); // Added value state
@@ -10430,23 +10426,22 @@ const QuarterPopupPicker = ({
10430
10426
  };
10431
10427
 
10432
10428
  /* eslint-disable import/no-extraneous-dependencies */
10433
- const QuarterPicker = _ref => {
10434
- let {
10435
- availableQuarters,
10436
- // ["Q1-2024"]
10437
- label,
10438
- onChange,
10439
- borderRadius,
10440
- required,
10441
- width,
10442
- height,
10443
- placeholder,
10444
- disabled,
10445
- borderColor,
10446
- borderColorFocus,
10447
- textColor,
10448
- selectedValue
10449
- } = _ref;
10429
+ const QuarterPicker = ({
10430
+ availableQuarters,
10431
+ // ["Q1-2024"]
10432
+ label,
10433
+ onChange,
10434
+ borderRadius,
10435
+ required,
10436
+ width,
10437
+ height,
10438
+ placeholder,
10439
+ disabled,
10440
+ borderColor,
10441
+ borderColorFocus,
10442
+ textColor,
10443
+ selectedValue
10444
+ }) => {
10450
10445
  const [isFocused, setIsFocused] = useState(false);
10451
10446
  const [isOpen, setIsOpen] = useState(false);
10452
10447
  const [value, setValue] = useState('');
@@ -10893,22 +10888,21 @@ const MonthPopupPicker = ({
10893
10888
  };
10894
10889
 
10895
10890
  /* eslint-disable import/no-extraneous-dependencies */
10896
- const MonthPicker = _ref => {
10897
- let {
10898
- availableMonths,
10899
- label,
10900
- onChange,
10901
- borderRadius,
10902
- required,
10903
- width,
10904
- height,
10905
- placeholder,
10906
- disabled,
10907
- borderColor,
10908
- borderColorFocus,
10909
- textColor,
10910
- selectedValue
10911
- } = _ref;
10891
+ const MonthPicker = ({
10892
+ availableMonths,
10893
+ label,
10894
+ onChange,
10895
+ borderRadius,
10896
+ required,
10897
+ width,
10898
+ height,
10899
+ placeholder,
10900
+ disabled,
10901
+ borderColor,
10902
+ borderColorFocus,
10903
+ textColor,
10904
+ selectedValue
10905
+ }) => {
10912
10906
  const [isFocused, setIsFocused] = useState(false);
10913
10907
  const [isOpen, setIsOpen] = useState(false);
10914
10908
  const [value, setValue] = useState('');
@@ -11139,7 +11133,7 @@ const TooltipTextContainer = styled.div`
11139
11133
  cursor: pointer;
11140
11134
  }
11141
11135
  `;
11142
- const TooltipText$1 = styled.div`
11136
+ const TooltipText$2 = styled.div`
11143
11137
  margin: 0;
11144
11138
  `;
11145
11139
 
@@ -11309,8 +11303,8 @@ const FilterPanel = props => {
11309
11303
  fieldsData: newFieldsDataState
11310
11304
  });
11311
11305
  };
11312
- const getTooltipTextDates = () => /*#__PURE__*/React$1.createElement(TooltipTextContainer, null, /*#__PURE__*/React$1.createElement(TooltipText$1, null, "Dates can be selected"), /*#__PURE__*/React$1.createElement(TooltipText$1, null, "only after selecting"), /*#__PURE__*/React$1.createElement(TooltipText$1, null, "period types"));
11313
- const getTooltipTextGoButton = () => /*#__PURE__*/React$1.createElement(TooltipTextContainer, null, /*#__PURE__*/React$1.createElement(TooltipText$1, null, tooltipTextGoButton));
11306
+ const getTooltipTextDates = () => /*#__PURE__*/React$1.createElement(TooltipTextContainer, null, /*#__PURE__*/React$1.createElement(TooltipText$2, null, "Dates can be selected"), /*#__PURE__*/React$1.createElement(TooltipText$2, null, "only after selecting"), /*#__PURE__*/React$1.createElement(TooltipText$2, null, "period types"));
11307
+ const getTooltipTextGoButton = () => /*#__PURE__*/React$1.createElement(TooltipTextContainer, null, /*#__PURE__*/React$1.createElement(TooltipText$2, null, tooltipTextGoButton));
11314
11308
  const getYearsArray = () => {
11315
11309
  const currentYear = moment().year();
11316
11310
  const previousYear = moment().subtract(1, 'years').year();
@@ -24134,22 +24128,21 @@ const DeleteIcon = styled.div`
24134
24128
  position: absolute;
24135
24129
  `;
24136
24130
 
24137
- const QuickFilterDropdownSingle = _ref => {
24138
- let {
24139
- label,
24140
- hoverColor,
24141
- options,
24142
- selectedValue,
24143
- placeHolder,
24144
- onChange,
24145
- disabled,
24146
- width,
24147
- error,
24148
- errorMessage,
24149
- xIconShow,
24150
- labelColor,
24151
- showLabelOnTop
24152
- } = _ref;
24131
+ const QuickFilterDropdownSingle = ({
24132
+ label,
24133
+ hoverColor,
24134
+ options,
24135
+ selectedValue,
24136
+ placeHolder,
24137
+ onChange,
24138
+ disabled,
24139
+ width,
24140
+ error,
24141
+ errorMessage,
24142
+ xIconShow,
24143
+ labelColor,
24144
+ showLabelOnTop
24145
+ }) => {
24153
24146
  const [isFocused, setIsFocused] = useState(false);
24154
24147
  const [showOptions, setShowOptions] = useState(false);
24155
24148
  const [inputValue, setInputValue] = useState("");
@@ -24547,24 +24540,23 @@ const IconContainer$2 = styled.div`
24547
24540
  cursor: pointer;
24548
24541
  `;
24549
24542
 
24550
- const QuickFilterDropdownMultiSelection = _ref => {
24551
- let {
24552
- label,
24553
- labelEmptyValue,
24554
- options,
24555
- selectedValue,
24556
- placeHolder,
24557
- onChange,
24558
- required,
24559
- disabled,
24560
- width,
24561
- error,
24562
- errorMessage,
24563
- labelColor,
24564
- xIconShow,
24565
- checkBoxColor,
24566
- showLabelOnTop
24567
- } = _ref;
24543
+ const QuickFilterDropdownMultiSelection = ({
24544
+ label,
24545
+ labelEmptyValue,
24546
+ options,
24547
+ selectedValue,
24548
+ placeHolder,
24549
+ onChange,
24550
+ required,
24551
+ disabled,
24552
+ width,
24553
+ error,
24554
+ errorMessage,
24555
+ labelColor,
24556
+ xIconShow,
24557
+ checkBoxColor,
24558
+ showLabelOnTop
24559
+ }) => {
24568
24560
  const [isFocused, setIsFocused] = useState(false);
24569
24561
  const [showOptions, setShowOptions] = useState(false);
24570
24562
  const [inputValue, setInputValue] = useState('');
@@ -25387,7 +25379,7 @@ const TitleAndValueContainer$3 = styled.div`
25387
25379
  display: flex;
25388
25380
  flex-direction: column;
25389
25381
  `;
25390
- const Title$d = styled.h4`
25382
+ const Title$e = styled.h4`
25391
25383
  font-weight: 400;
25392
25384
  font-size: 20px;
25393
25385
  margin: 0;
@@ -25450,7 +25442,7 @@ const FormattedValue$3 = props => {
25450
25442
  width: width
25451
25443
  }, /*#__PURE__*/React$1.createElement(TitleAndValueContainer$3, {
25452
25444
  className: "TitleAndValueContainer"
25453
- }, title ? /*#__PURE__*/React$1.createElement(Title$d, {
25445
+ }, title ? /*#__PURE__*/React$1.createElement(Title$e, {
25454
25446
  className: "Title",
25455
25447
  width: width
25456
25448
  }, title) : '', showTopValue && /*#__PURE__*/React$1.createElement(CurrencySignAndFormattedValueContainer$1, {
@@ -25462,7 +25454,7 @@ const FormattedValue$3 = props => {
25462
25454
  className: "CurrencySignOrPercent"
25463
25455
  }, currencySign ? getCurrencySign(currencyType, value) : ''), dotCut ? getFormattedValue(value && Math.abs(value) > 0 && value % 1 !== 0 ? value?.toFixed(2) : value) : getNumberWithCommas(value), dotCut ? getFormattedUnits(value) : '', /*#__PURE__*/React$1.createElement(CurrencySignOrPercent, {
25464
25456
  className: "CurrencySignOrPercent"
25465
- }, isPercent ? '%' : ''))), subtitle ? /*#__PURE__*/React$1.createElement(Title$d, {
25457
+ }, isPercent ? '%' : ''))), subtitle ? /*#__PURE__*/React$1.createElement(Title$e, {
25466
25458
  className: "Title",
25467
25459
  width: width
25468
25460
  }, subtitle) : '')));
@@ -25524,7 +25516,7 @@ const TooltipLabel$3 = styled.div`
25524
25516
  font-weight: 400;
25525
25517
  width: fit-content;
25526
25518
  `;
25527
- const TooltipTitle$3 = styled.div`
25519
+ const TooltipTitle$4 = styled.div`
25528
25520
  color: #212121;
25529
25521
  font-size: 14px;
25530
25522
  font-weight: 600;
@@ -25532,7 +25524,7 @@ const TooltipTitle$3 = styled.div`
25532
25524
  const TitleAndValueContainer$2 = styled.div`
25533
25525
  padding: 0 1rem;
25534
25526
  `;
25535
- const Title$c = styled.h5`
25527
+ const Title$d = styled.h5`
25536
25528
  font-weight: 500;
25537
25529
  font-size: 18px;
25538
25530
  line-height: 20px;
@@ -25661,7 +25653,7 @@ const TitleAndIconContainer = styled.div`
25661
25653
  display: flex;
25662
25654
  align-items: center;
25663
25655
  `;
25664
- const Title$b = styled.h4`
25656
+ const Title$c = styled.h4`
25665
25657
  font-weight: 400;
25666
25658
  font-size: 14px;
25667
25659
  line-height: 27px;
@@ -25715,7 +25707,7 @@ const PerformanceAnalyticsLegend = props => {
25715
25707
  color: item.iconColor
25716
25708
  }) : item.iconType === ICON_TYPE_LEGEND_LINE_ICON$2 ? /*#__PURE__*/React$1.createElement(LegendLineIcon, {
25717
25709
  color: item.iconColor
25718
- }) : '', /*#__PURE__*/React$1.createElement(Title$b, {
25710
+ }) : '', /*#__PURE__*/React$1.createElement(Title$c, {
25719
25711
  id: "Title",
25720
25712
  width: width
25721
25713
  }, item.title))))) : '');
@@ -25813,7 +25805,7 @@ const BarChartsByWeeks = props => {
25813
25805
  let currentTooltipSecondValue = 0;
25814
25806
  if (payload[0].payload?.value) currentTooltipValue = payload[0].payload?.value;
25815
25807
  if (payload[0].payload?.secondValue) currentTooltipSecondValue = payload[0].payload?.secondValue;
25816
- return /*#__PURE__*/React$1.createElement(TooltipDiv$3, null, /*#__PURE__*/React$1.createElement(TooltipTitle$3, null, `${isTitleOriganal ? '' : 'Week: '}${week}`), /*#__PURE__*/React$1.createElement(TooltipLabel$3, null, `${tooltipTitle}
25808
+ return /*#__PURE__*/React$1.createElement(TooltipDiv$3, null, /*#__PURE__*/React$1.createElement(TooltipTitle$4, null, `${isTitleOriganal ? '' : 'Week: '}${week}`), /*#__PURE__*/React$1.createElement(TooltipLabel$3, null, `${tooltipTitle}
25817
25809
  ${displayFormattedValue(currentTooltipValue)}
25818
25810
  `), currentTooltipSecondValue ? /*#__PURE__*/React$1.createElement(TooltipLabel$3, null, `${tooltipSecondTitle}
25819
25811
  ${displayFormattedValue(currentTooltipSecondValue)}
@@ -25870,7 +25862,7 @@ const BarChartsByWeeks = props => {
25870
25862
  ref: controlsContainerRef
25871
25863
  }, /*#__PURE__*/React$1.createElement(Controls$6, {
25872
25864
  height: getControlsHeight()
25873
- }, showTitle && /*#__PURE__*/React$1.createElement(TitleAndValueContainer$2, null, /*#__PURE__*/React$1.createElement(Title$c, null, title), /*#__PURE__*/React$1.createElement(FormattedValue$3, {
25865
+ }, showTitle && /*#__PURE__*/React$1.createElement(TitleAndValueContainer$2, null, /*#__PURE__*/React$1.createElement(Title$d, null, title), /*#__PURE__*/React$1.createElement(FormattedValue$3, {
25874
25866
  title: headerValueTopTitle,
25875
25867
  subtitle: headerValueBottomTitle,
25876
25868
  showTopValue: showHeaderTopValue,
@@ -26103,7 +26095,7 @@ const TitleAndValueContainer$1 = styled.div`
26103
26095
  flex-direction: column;
26104
26096
  padding: 0 1.25em; /* 20px → 1.25em */
26105
26097
  `;
26106
- const Title$a = styled.h4`
26098
+ const Title$b = styled.h4`
26107
26099
  font-weight: 500;
26108
26100
  font-size: ${props => props.titleFontSize || '1.125em'}; /* Default: 18px → 1.125em */
26109
26101
  margin: 0;
@@ -26306,7 +26298,7 @@ const TotalDoughnutChart = props => {
26306
26298
  width: width
26307
26299
  }, !hideTitleAndValue && /*#__PURE__*/React$1.createElement(TitleAndValueContainer$1, {
26308
26300
  className: "TitleAndValueContainer"
26309
- }, /*#__PURE__*/React$1.createElement(Title$a, {
26301
+ }, /*#__PURE__*/React$1.createElement(Title$b, {
26310
26302
  className: "Title",
26311
26303
  fontSize: titleFontSize
26312
26304
  }, title), /*#__PURE__*/React$1.createElement(CurrencySignAndFormattedValueContainer, {
@@ -26436,7 +26428,7 @@ CustomTooltip.defaultProps = {
26436
26428
  isPercent: false
26437
26429
  };
26438
26430
 
26439
- const TooltipContainer$2 = styled.div`
26431
+ const TooltipContainer$3 = styled.div`
26440
26432
  --tooltip-text-color: black;
26441
26433
  --tooltip-background-color: white;
26442
26434
  --tooltip-margin: 40px;
@@ -26542,7 +26534,7 @@ const Tooltip = props => {
26542
26534
  direction,
26543
26535
  content
26544
26536
  } = props;
26545
- return /*#__PURE__*/React$1.createElement(TooltipContainer$2, {
26537
+ return /*#__PURE__*/React$1.createElement(TooltipContainer$3, {
26546
26538
  className: className,
26547
26539
  top: `${top}px`,
26548
26540
  left: `${left}px`
@@ -26628,7 +26620,7 @@ const TotalValue = styled.div`
26628
26620
  font-size: 20px;
26629
26621
  }
26630
26622
  `;
26631
- const Title$9 = styled.h4`
26623
+ const Title$a = styled.h4`
26632
26624
  font-size: 18px;
26633
26625
  font-weight: 400;
26634
26626
  line-height: 1;
@@ -26785,7 +26777,7 @@ const TotalHorizontalCharts = props => {
26785
26777
  }, chartsData?.length > 0 ? /*#__PURE__*/React$1.createElement(React$1.Fragment, null, !hideTitle || !hideTotalValue ? /*#__PURE__*/React$1.createElement(CardHeader, {
26786
26778
  ref: topHeader,
26787
26779
  className: "CardHeader"
26788
- }, !hideTitle ? /*#__PURE__*/React$1.createElement(Title$9, null, title) : '', !hideTotalValue ? /*#__PURE__*/React$1.createElement(TotalValue, {
26780
+ }, !hideTitle ? /*#__PURE__*/React$1.createElement(Title$a, null, title) : '', !hideTotalValue ? /*#__PURE__*/React$1.createElement(TotalValue, {
26789
26781
  className: "TotalValue"
26790
26782
  }, currencySign && /*#__PURE__*/React$1.createElement(CurrencySign, {
26791
26783
  className: "CurrencySign"
@@ -27258,7 +27250,7 @@ const ItemContainer = styled.div`
27258
27250
  flex-direction: column;
27259
27251
  flex-wrap: wrap;
27260
27252
  `;
27261
- const Title$8 = styled.h4`
27253
+ const Title$9 = styled.h4`
27262
27254
  font-size: 18px;
27263
27255
  font-weight: 500;
27264
27256
  margin: 0;
@@ -27374,7 +27366,7 @@ const SalesAndROI = props => {
27374
27366
  showBorderShadow: showBorderShadow
27375
27367
  }, /*#__PURE__*/React$1.createElement(TitleAndValueContainer, {
27376
27368
  id: "TitleAndValueContainer"
27377
- }, /*#__PURE__*/React$1.createElement(Title$8, {
27369
+ }, /*#__PURE__*/React$1.createElement(Title$9, {
27378
27370
  id: "Title"
27379
27371
  }, title), showBanner && /*#__PURE__*/React$1.createElement(OutBanner, {
27380
27372
  id: "OutBanner",
@@ -27473,7 +27465,7 @@ const TitleContainer$1 = styled.div`
27473
27465
  margin: 0;
27474
27466
  border-bottom: 1px solid #b1b1b1;
27475
27467
  `;
27476
- const Title$7 = styled.p`
27468
+ const Title$8 = styled.p`
27477
27469
  font-weight: 400;
27478
27470
  font-size: 24px;
27479
27471
  margin: 0;
@@ -27693,7 +27685,7 @@ const PopupCharts = props => {
27693
27685
  height: height,
27694
27686
  width: width,
27695
27687
  onClick: e => e.stopPropagation()
27696
- }, /*#__PURE__*/React$1.createElement(TitleContainer$1, null, /*#__PURE__*/React$1.createElement(Title$7, null, title), /*#__PURE__*/React$1.createElement(CloseXIconContainer, {
27688
+ }, /*#__PURE__*/React$1.createElement(TitleContainer$1, null, /*#__PURE__*/React$1.createElement(Title$8, null, title), /*#__PURE__*/React$1.createElement(CloseXIconContainer, {
27697
27689
  onClick: e => closePopupCharts(e)
27698
27690
  }, /*#__PURE__*/React$1.createElement(CloseXIcon, null))), /*#__PURE__*/React$1.createElement(ChartsContainer, {
27699
27691
  id: "ChartsContainer",
@@ -27791,7 +27783,7 @@ const TopToggleListMainContainer = styled.div`
27791
27783
  padding: 0 24px;
27792
27784
  width: ${props => props.width};
27793
27785
  `;
27794
- const Title$6 = styled.h4`
27786
+ const Title$7 = styled.h4`
27795
27787
  font-size: 14px;
27796
27788
  font-weight: 600;
27797
27789
  margin: 20px 0 12px;
@@ -27821,7 +27813,7 @@ const TopToggleList = props => {
27821
27813
  } = props;
27822
27814
  return /*#__PURE__*/React$1.createElement(TopToggleListMainContainer, {
27823
27815
  width: width
27824
- }, /*#__PURE__*/React$1.createElement(Title$6, null, title), /*#__PURE__*/React$1.createElement(ListContainer, {
27816
+ }, /*#__PURE__*/React$1.createElement(Title$7, null, title), /*#__PURE__*/React$1.createElement(ListContainer, {
27825
27817
  height: height
27826
27818
  }, list.map(item => /*#__PURE__*/React$1.createElement(ListItem, {
27827
27819
  key: item.value
@@ -27883,7 +27875,7 @@ const TitleContainer = styled.div`
27883
27875
  justify-content: flex-start;
27884
27876
  margin: 0 0 10px 0;
27885
27877
  `;
27886
- const Title$5 = styled.h3`
27878
+ const Title$6 = styled.h3`
27887
27879
  user-select: none;
27888
27880
  text-align: left;
27889
27881
  margin: 0;
@@ -27928,7 +27920,7 @@ const BarLabel = styled.span`
27928
27920
  font-weight: 400;
27929
27921
  user-select: none;
27930
27922
  `;
27931
- const TooltipContainer$1 = styled.div`
27923
+ const TooltipContainer$2 = styled.div`
27932
27924
  position: absolute;
27933
27925
 
27934
27926
  top: ${props => props.top};
@@ -28038,7 +28030,7 @@ const Heatmap = props => {
28038
28030
  if (tooltip && tooltipPosition && tooltip.label === `${item.label} - ${Math.round(item.value / totalValue * 100)}%`) {
28039
28031
  const top = `${tooltipPosition.y}px`;
28040
28032
  const left = `${tooltipPosition.x}px`;
28041
- return /*#__PURE__*/React$1.createElement(TooltipContainer$1, {
28033
+ return /*#__PURE__*/React$1.createElement(TooltipContainer$2, {
28042
28034
  className: "TooltipContainer",
28043
28035
  top: top,
28044
28036
  left: left
@@ -28158,7 +28150,7 @@ const Heatmap = props => {
28158
28150
  className: "HeatmapWrapper"
28159
28151
  }, /*#__PURE__*/React$1.createElement(TitleContainer, {
28160
28152
  className: "TitleContainer"
28161
- }, /*#__PURE__*/React$1.createElement(Title$5, {
28153
+ }, /*#__PURE__*/React$1.createElement(Title$6, {
28162
28154
  className: "Title"
28163
28155
  }, title)), refreshRequired && renderBars(), !refreshRequired && renderBars(), renderLegend()));
28164
28156
  };
@@ -28572,12 +28564,12 @@ const TooltipLabel$1 = styled.div`
28572
28564
  font-weight: 400;
28573
28565
  width: fit-content;
28574
28566
  `;
28575
- const TooltipTitle$2 = styled.div`
28567
+ const TooltipTitle$3 = styled.div`
28576
28568
  color: #212121;
28577
28569
  font-size: 14px;
28578
28570
  font-weight: 600;
28579
28571
  `;
28580
- const Title$4 = styled.h5`
28572
+ const Title$5 = styled.h5`
28581
28573
  font-weight: 500;
28582
28574
  font-size: 18px;
28583
28575
  line-height: 20px;
@@ -28654,7 +28646,7 @@ const BarChart = props => {
28654
28646
  if (!active || !payload || payload?.length === 0) return null;
28655
28647
  let currentTooltipValue = 0;
28656
28648
  if (payload[0].payload?.value) currentTooltipValue = payload[0].payload?.value;
28657
- return /*#__PURE__*/React$1.createElement(TooltipDiv$1, null, /*#__PURE__*/React$1.createElement(TooltipTitle$2, null, `${label}`), /*#__PURE__*/React$1.createElement(TooltipLabel$1, null, `${displayFormattedValue(currentTooltipValue, !!showCurrentCampaignStyle)}`));
28649
+ return /*#__PURE__*/React$1.createElement(TooltipDiv$1, null, /*#__PURE__*/React$1.createElement(TooltipTitle$3, null, `${label}`), /*#__PURE__*/React$1.createElement(TooltipLabel$1, null, `${displayFormattedValue(currentTooltipValue, !!showCurrentCampaignStyle)}`));
28658
28650
  };
28659
28651
  const CustomizedTickBarChart = props => {
28660
28652
  const {
@@ -28737,7 +28729,7 @@ const BarChart = props => {
28737
28729
  height: height,
28738
28730
  width: width,
28739
28731
  ref: controlsContainerRef
28740
- }, /*#__PURE__*/React$1.createElement(Controls$3, null, /*#__PURE__*/React$1.createElement(Title$4, null, title), /*#__PURE__*/React$1.createElement(ResponsiveContainer, {
28732
+ }, /*#__PURE__*/React$1.createElement(Controls$3, null, /*#__PURE__*/React$1.createElement(Title$5, null, title), /*#__PURE__*/React$1.createElement(ResponsiveContainer, {
28741
28733
  width: "100%",
28742
28734
  height: 400
28743
28735
  }, /*#__PURE__*/React$1.createElement(BarChart$1, {
@@ -28908,7 +28900,7 @@ const Controls$2 = styled.div`
28908
28900
  flex-direction: column;
28909
28901
  background-color: white;
28910
28902
  `;
28911
- const Title$3 = styled.h5`
28903
+ const Title$4 = styled.h5`
28912
28904
  font-size: 18px;
28913
28905
  font-weight: 400;
28914
28906
  margin: 0 0 30px;
@@ -28941,7 +28933,7 @@ const TooltipLabel = styled.div`
28941
28933
  font-weight: 400;
28942
28934
  width: fit-content;
28943
28935
  `;
28944
- const TooltipTitle$1 = styled.div`
28936
+ const TooltipTitle$2 = styled.div`
28945
28937
  color: #212121;
28946
28938
  font-size: 14px;
28947
28939
  font-weight: 600;
@@ -29094,7 +29086,7 @@ const DoubleBarSingleLine = props => {
29094
29086
  } else {
29095
29087
  `${currentTooltipValue.toFixed(1)}`;
29096
29088
  }
29097
- return /*#__PURE__*/React$1.createElement(TooltipDiv, null, /*#__PURE__*/React$1.createElement(TooltipTitle$1, null, `${label}`), payload.map((item, idx) => {
29089
+ return /*#__PURE__*/React$1.createElement(TooltipDiv, null, /*#__PURE__*/React$1.createElement(TooltipTitle$2, null, `${label}`), payload.map((item, idx) => {
29098
29090
  const dataStateItem = dataState.find(state => state.key === item.dataKey);
29099
29091
  return /*#__PURE__*/React$1.createElement(TooltipLabel, {
29100
29092
  key: item.dataKey || idx
@@ -29167,7 +29159,7 @@ const DoubleBarSingleLine = props => {
29167
29159
  noDataText: noDataText
29168
29160
  }) : /*#__PURE__*/React$1.createElement(Controls$2, {
29169
29161
  className: "Controls"
29170
- }, title && title.trim() !== '' && /*#__PURE__*/React$1.createElement(Title$3, null, title), /*#__PURE__*/React$1.createElement(ChartsWrapper, {
29162
+ }, title && title.trim() !== '' && /*#__PURE__*/React$1.createElement(Title$4, null, title), /*#__PURE__*/React$1.createElement(ChartsWrapper, {
29171
29163
  width: hasScroll ? `${data.length * 178}px` : 'auto'
29172
29164
  }, /*#__PURE__*/React$1.createElement(LineChartWrapper, null, /*#__PURE__*/React$1.createElement(ResponsiveContainer, null, /*#__PURE__*/React$1.createElement(LineChart, _extends({
29173
29165
  data: transformedData
@@ -29266,7 +29258,7 @@ const CheckboxGroupContainer = styled.div`
29266
29258
  height: 21px;
29267
29259
  gap: 20px;
29268
29260
  `;
29269
- const Title$2 = styled.h5`
29261
+ const Title$3 = styled.h5`
29270
29262
  font-weight: 500;
29271
29263
  font-size: 18px;
29272
29264
  line-height: 20px;
@@ -29286,7 +29278,7 @@ const LegendIcon = styled.div`
29286
29278
  margin-right: 5px;
29287
29279
  background-color: ${props => props.color};
29288
29280
  `;
29289
- const TooltipContainer = styled.div`
29281
+ const TooltipContainer$1 = styled.div`
29290
29282
  background: white;
29291
29283
  padding: 10px;
29292
29284
  border-radius: 5px;
@@ -29296,12 +29288,12 @@ const TooltipContainer = styled.div`
29296
29288
  font-weight: 500;
29297
29289
  font-size: 14px;
29298
29290
  `;
29299
- const TooltipTitle = styled.p`
29291
+ const TooltipTitle$1 = styled.p`
29300
29292
  font-weight: 700;
29301
29293
  margin-top: 5px;
29302
29294
  margin-bottom: 5px;
29303
29295
  `;
29304
- const TooltipText = styled.p`
29296
+ const TooltipText$1 = styled.p`
29305
29297
  margin-top: 5px;
29306
29298
  margin-bottom: 5px;
29307
29299
  `;
@@ -29542,10 +29534,10 @@ const AreaChart = props => {
29542
29534
  payload
29543
29535
  } = _ref3;
29544
29536
  if (active && payload && payload.length) {
29545
- return /*#__PURE__*/React$1.createElement(TooltipContainer, null, /*#__PURE__*/React$1.createElement(TooltipTitle, null, `${payload[0].payload.label}`), payload.map((data, index) => {
29537
+ return /*#__PURE__*/React$1.createElement(TooltipContainer$1, null, /*#__PURE__*/React$1.createElement(TooltipTitle$1, null, `${payload[0].payload.label}`), payload.map((data, index) => {
29546
29538
  const chart = areaChartsState.find(chart => chart.key === data.dataKey);
29547
29539
  if (chart) {
29548
- return /*#__PURE__*/React$1.createElement(TooltipText, {
29540
+ return /*#__PURE__*/React$1.createElement(TooltipText$1, {
29549
29541
  key: index
29550
29542
  }, `${chart.name}: ${displayFormattedValue(data.value, chart.isDollar)}`);
29551
29543
  }
@@ -29594,7 +29586,7 @@ const AreaChart = props => {
29594
29586
  height: height
29595
29587
  }) : /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(HeaderContainer$2, {
29596
29588
  "data-testid": "header-container"
29597
- }, /*#__PURE__*/React$1.createElement(Title$2, {
29589
+ }, /*#__PURE__*/React$1.createElement(Title$3, {
29598
29590
  "data-testid": "title"
29599
29591
  }, title), /*#__PURE__*/React$1.createElement(CheckboxGroupContainer, {
29600
29592
  "data-testid": "checkbox-group-container"
@@ -30092,7 +30084,7 @@ const HeaderContainer$1 = styled.div`
30092
30084
  align-items: center;
30093
30085
  padding-bottom: 8px;
30094
30086
  `;
30095
- const Title$1 = styled.h3`
30087
+ const Title$2 = styled.h3`
30096
30088
  font-size: 18px;
30097
30089
  font-weight: 400;
30098
30090
  margin: 0;
@@ -30161,7 +30153,7 @@ const BreakdownPanel = props => {
30161
30153
  height: height
30162
30154
  }) : /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(HeaderContainer$1, {
30163
30155
  "data-testid": "header-container"
30164
- }, /*#__PURE__*/React$1.createElement(Title$1, {
30156
+ }, /*#__PURE__*/React$1.createElement(Title$2, {
30165
30157
  "data-testid": "title"
30166
30158
  }, title)), /*#__PURE__*/React$1.createElement(CategorySalesMainContainer, {
30167
30159
  "data-testid": "category-sales-main-container"
@@ -31403,42 +31395,82 @@ const BatteryChart = props => {
31403
31395
  }))))))), starText !== "" && /*#__PURE__*/React$1.createElement(StarText, null, starText));
31404
31396
  };
31405
31397
 
31406
- // const originalData = [
31407
- // { label: "Vendor Selling Event: Week 34", inc_sales: 20000, inc_roi: 1.2 },
31408
- // { label: "Vendor Selling Event: Week 36", inc_sales: 10000, inc_roi: 1.2 },
31409
- // { label: "Vendor Selling Event: Week 38", inc_sales: 8000, inc_roi: 0.8 },
31410
- // { label: "Vendor Selling Event: Week 33", inc_sales: 12000, inc_roi: 1.1 },
31411
- // { label: "Vendor Selling Event: Week 29", inc_sales: 8000, inc_roi: 1.2 },
31412
- // { label: "Vendor Selling Event: Week 28", inc_sales: 8000, inc_roi: 0.7 },
31413
- // { label: "Vendor Selling Event: Week 35", inc_sales: 8000, inc_roi: 0.8 },
31414
- // { label: "Vendor Selling Event: Week 30", inc_sales: 9000, inc_roi: 1.1 },
31415
- // ];
31398
+ const Container = styled.div`
31399
+ width: ${props => props.width};
31400
+ height: ${props => props.height};
31401
+ padding: 15px;
31402
+ display: flex;
31403
+ flex-direction: column;
31404
+ #Segment {
31405
+ width: auto;
31406
+ white-space: nowrap;
31407
+ font-size: 14px;
31408
+ font-weight: 500;
31409
+ font-family: "Poppins"
31410
+ }
31411
+ `;
31412
+ const Title$1 = styled.h2`
31413
+ color: #212121;
31414
+ font-family: "Poppins";
31415
+ font-size: 18px;
31416
+ font-style: normal;
31417
+ font-weight: 400;
31418
+ line-height: normal;
31419
+ margin: 0 0 16px 0;
31420
+ `;
31421
+ styled.div`
31422
+ font-family: sans-serif;
31423
+ text-align: center;
31424
+ `;
31425
+ styled.div`
31426
+ height: 25%;
31427
+ `;
31428
+ styled.div`
31429
+ height: 75%;
31430
+ `;
31431
+ styled.div`
31432
+ height: 100%;
31433
+ display: flex;
31434
+ flex-direction: column;
31435
+ background-color: white;
31436
+ `;
31437
+ const TooltipContainer = styled.div`
31438
+ background: white;
31439
+ padding: 10px;
31440
+ border-radius: 5px;
31441
+ box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.2);
31442
+ border: 1px solid #ddd;
31443
+ font-family: Poppins, sans-serif;
31444
+ font-weight: 500;
31445
+ font-size: 14px;
31446
+ `;
31447
+ const TooltipTitle = styled.p`
31448
+ font-weight: 700;
31449
+ margin-top: 5px;
31450
+ margin-bottom: 5px;
31451
+ `;
31452
+ const TooltipText = styled.p`
31453
+ margin-top: 5px;
31454
+ margin-bottom: 5px;
31455
+ `;
31416
31456
 
31417
31457
  const SeparatedLineBarChart = ({
31418
- barlineData = []
31458
+ brushAreaBarData = []
31419
31459
  }) => {
31420
- // Sort the data by week number extracted from the label
31421
- const sortedData = barlineData?.sort((a, b) => {
31422
- const weekA = parseInt(a.label.match(/Week (\d+)/)[1], 10);
31423
- const weekB = parseInt(b.label.match(/Week (\d+)/)[1], 10);
31424
- return weekA - weekB;
31460
+ const processedData = brushAreaBarData.map(item => {
31461
+ return {
31462
+ ...item,
31463
+ shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
31464
+ };
31425
31465
  });
31426
- const dataWithIndex = sortedData.map((item, index) => ({
31427
- ...item,
31428
- index,
31429
- shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
31430
- }));
31431
- const CustomizedTick = ({
31432
- x,
31433
- y,
31434
- payload,
31435
- viewableIndices
31436
- }) => {
31437
- const label = dataWithIndex[payload.value]?.label ?? "";
31466
+ const CustomizedTick = props => {
31467
+ const {
31468
+ x,
31469
+ y,
31470
+ payload
31471
+ } = props;
31472
+ const label = payload.value;
31438
31473
  const parts = label.replace("Vendor Selling Event: ", "").split(" ");
31439
- if (!viewableIndices.includes(payload.value)) {
31440
- return null;
31441
- }
31442
31474
  return /*#__PURE__*/React$1.createElement("g", {
31443
31475
  transform: `translate(${x},${y})`
31444
31476
  }, /*#__PURE__*/React$1.createElement("text", {
@@ -31448,7 +31480,7 @@ const SeparatedLineBarChart = ({
31448
31480
  textAnchor: "middle",
31449
31481
  fill: "#212121",
31450
31482
  fontSize: 11,
31451
- fontWeight: "400",
31483
+ fontWeight: 400,
31452
31484
  fontFamily: "Poppins"
31453
31485
  }, /*#__PURE__*/React$1.createElement("tspan", {
31454
31486
  x: 0,
@@ -31458,51 +31490,32 @@ const SeparatedLineBarChart = ({
31458
31490
  dy: 18
31459
31491
  }, "Event: ", parts.join(" "))));
31460
31492
  };
31461
- const CustomLabelListFilter = props => {
31462
- const {
31463
- viewableIndices,
31464
- dataKey,
31465
- position,
31466
- formatter,
31467
- fill,
31468
- fontSize,
31469
- fontWeight,
31470
- fontFamily
31471
- } = props;
31472
- return /*#__PURE__*/React$1.createElement(LabelList, {
31473
- dataKey: dataKey,
31474
- position: position,
31475
- formatter: (value, name, props) => {
31476
- if (!viewableIndices.includes(props.index)) {
31477
- return "";
31478
- }
31479
- return formatter ? formatter(value) : value;
31480
- },
31481
- fill: fill || "#212121",
31482
- fontSize: fontSize || 12,
31483
- fontWeight: fontWeight || "400",
31484
- fontFamily: fontFamily || "Poppins"
31485
- });
31493
+ const CustomTooltip = ({
31494
+ active,
31495
+ payload
31496
+ }) => {
31497
+ if (!active || !payload || !payload.length) return null;
31498
+ const data = payload[0]?.payload;
31499
+ if (!data) return null;
31500
+ return /*#__PURE__*/React$1.createElement(TooltipContainer, null, /*#__PURE__*/React$1.createElement(TooltipTitle, null, `${data.label}`), /*#__PURE__*/React$1.createElement(TooltipText, null, `${data.description}`), /*#__PURE__*/React$1.createElement(TooltipText, null, `INC Sales: ${getFormattedValue(data.inc_sales)}${getFormattedUnits(data.inc_sales)}`), /*#__PURE__*/React$1.createElement(TooltipText, null, `INC Sales ROI: ${getFormattedValue(data.inc_roi)}${getFormattedUnits(data.inc_roi)}`));
31486
31501
  };
31487
31502
  const chartMargins = {
31488
- top: 15,
31489
- right: 40,
31503
+ top: 30,
31504
+ right: 30,
31490
31505
  left: 20,
31491
- bottom: 40
31506
+ bottom: 0
31492
31507
  };
31493
- const [viewWindow, setViewWindow] = useState({
31494
- startIndex: 0,
31495
- endIndex: dataWithIndex.length - 1
31496
- });
31497
- const viewableIndices = [];
31498
- for (let i = viewWindow.startIndex; i <= viewWindow.endIndex; i++) {
31499
- viewableIndices.push(i);
31500
- }
31501
- dataWithIndex.filter(item => viewableIndices.includes(item.index));
31508
+ const chartMargins2 = {
31509
+ top: 30,
31510
+ right: 30,
31511
+ left: 20,
31512
+ bottom: 80
31513
+ };
31514
+ const BAR_CATEGORY_GAP = "30%";
31502
31515
  return /*#__PURE__*/React$1.createElement("div", {
31503
31516
  style: {
31504
31517
  width: "100%",
31505
- height: 700
31518
+ height: "700px"
31506
31519
  }
31507
31520
  }, /*#__PURE__*/React$1.createElement("div", {
31508
31521
  style: {
@@ -31512,24 +31525,25 @@ const SeparatedLineBarChart = ({
31512
31525
  width: "100%",
31513
31526
  height: "100%"
31514
31527
  }, /*#__PURE__*/React$1.createElement(LineChart, {
31515
- data: dataWithIndex,
31516
- margin: chartMargins
31528
+ data: processedData,
31529
+ margin: chartMargins,
31530
+ syncId: "composedChart",
31531
+ syncMethod: "index"
31517
31532
  }, /*#__PURE__*/React$1.createElement(CartesianGrid, {
31518
31533
  strokeDasharray: "3 3",
31519
31534
  vertical: false
31520
31535
  }), /*#__PURE__*/React$1.createElement(XAxis, {
31521
- dataKey: "index",
31522
- type: "number",
31523
- domain: ['dataMin', 'dataMax'],
31536
+ dataKey: "label",
31537
+ tick: false,
31524
31538
  padding: {
31525
- left: 20,
31526
- right: 20
31539
+ left: 70,
31540
+ right: 70
31527
31541
  },
31528
31542
  hide: true
31529
31543
  }), /*#__PURE__*/React$1.createElement(YAxis, {
31530
31544
  domain: [0, 2],
31531
31545
  hide: true
31532
- }), /*#__PURE__*/React$1.createElement(Tooltip$2, null), /*#__PURE__*/React$1.createElement(Line, {
31546
+ }), /*#__PURE__*/React$1.createElement(Line, {
31533
31547
  type: "monotone",
31534
31548
  dataKey: "inc_roi",
31535
31549
  stroke: "#F8CD00",
@@ -31539,13 +31553,28 @@ const SeparatedLineBarChart = ({
31539
31553
  fill: "#F8CD00"
31540
31554
  },
31541
31555
  activeDot: false,
31542
- name: "INC Sales ROI"
31543
- }, /*#__PURE__*/React$1.createElement(CustomLabelListFilter, {
31556
+ name: "INC Sales ROI",
31557
+ barCategoryGap: BAR_CATEGORY_GAP,
31558
+ barGap: 0
31559
+ }, /*#__PURE__*/React$1.createElement(LabelList, {
31544
31560
  dataKey: "inc_roi",
31545
31561
  position: "top",
31546
31562
  formatter: value => value.toFixed(1),
31547
- viewableIndices: viewableIndices
31548
- }))))), /*#__PURE__*/React$1.createElement("div", {
31563
+ fill: "#212121",
31564
+ fontSize: 12,
31565
+ fontWeight: "400",
31566
+ fontFamily: "Poppins"
31567
+ })), /*#__PURE__*/React$1.createElement(Brush, {
31568
+ dataKey: "label",
31569
+ height: 30,
31570
+ stroke: "#212121",
31571
+ startIndex: 0,
31572
+ endIndex: Math.min(6, processedData.length - 1),
31573
+ y: 330,
31574
+ travellerWidth: 10,
31575
+ tickFormatter: (value, index) => index + 1,
31576
+ hide: true
31577
+ })))), /*#__PURE__*/React$1.createElement("div", {
31549
31578
  style: {
31550
31579
  height: "60%"
31551
31580
  }
@@ -31553,59 +31582,51 @@ const SeparatedLineBarChart = ({
31553
31582
  width: "100%",
31554
31583
  height: "100%"
31555
31584
  }, /*#__PURE__*/React$1.createElement(ComposedChart, {
31556
- data: dataWithIndex,
31557
- margin: chartMargins
31585
+ data: processedData,
31586
+ margin: chartMargins2,
31587
+ syncId: "composedChart",
31588
+ syncMethod: "index",
31589
+ barCategoryGap: BAR_CATEGORY_GAP,
31590
+ barGap: 0
31558
31591
  }, /*#__PURE__*/React$1.createElement(CartesianGrid, {
31559
31592
  strokeDasharray: "3 3",
31560
31593
  vertical: false
31561
31594
  }), /*#__PURE__*/React$1.createElement(XAxis, {
31562
- dataKey: "index",
31563
- type: "number",
31564
- domain: ['dataMin', 'dataMax'],
31565
- padding: {
31566
- left: 20,
31567
- right: 20
31568
- },
31569
- tick: props => /*#__PURE__*/React$1.createElement(CustomizedTick, _extends({}, props, {
31570
- viewableIndices: viewableIndices
31571
- })),
31595
+ dataKey: "label",
31596
+ tick: /*#__PURE__*/React$1.createElement(CustomizedTick, null),
31572
31597
  interval: 0,
31573
31598
  height: 60,
31574
- tickLine: false,
31575
- ticks: dataWithIndex.map(item => item.index)
31599
+ tickLine: false
31576
31600
  }), /*#__PURE__*/React$1.createElement(YAxis, {
31577
31601
  tickFormatter: v => `${v / 1000}k`,
31578
31602
  hide: true
31579
- }), /*#__PURE__*/React$1.createElement(Tooltip$2, null), /*#__PURE__*/React$1.createElement(Bar, {
31603
+ }), /*#__PURE__*/React$1.createElement(Tooltip$2, {
31604
+ content: /*#__PURE__*/React$1.createElement(CustomTooltip, null)
31605
+ }), /*#__PURE__*/React$1.createElement(Bar, {
31580
31606
  dataKey: "inc_sales",
31581
31607
  fill: "#CCDCDD",
31582
- gap: "4px",
31608
+ gap: 4,
31583
31609
  borderRadius: [4, 4, 0, 8],
31584
31610
  barSize: 40,
31585
31611
  name: "INC Sales"
31586
- }, /*#__PURE__*/React$1.createElement(CustomLabelListFilter, {
31612
+ }, /*#__PURE__*/React$1.createElement(LabelList, {
31587
31613
  dataKey: "inc_sales",
31588
31614
  position: "top",
31589
31615
  formatter: value => `${value / 1000}k`,
31590
- viewableIndices: viewableIndices
31616
+ fill: "#212121",
31617
+ fontSize: 12,
31618
+ fontWeight: "400",
31619
+ fontFamily: "Poppins"
31591
31620
  })), /*#__PURE__*/React$1.createElement(Brush, {
31592
- dataKey: "index",
31621
+ dataKey: "label",
31593
31622
  height: 30,
31594
31623
  stroke: "#212121",
31595
- startIndex: viewWindow.startIndex,
31596
- endIndex: viewWindow.endIndex,
31597
- onChange: e => {
31598
- setViewWindow({
31599
- startIndex: e.startIndex ?? 0,
31600
- endIndex: e.endIndex ?? dataWithIndex.length - 1
31601
- });
31602
- },
31603
- travellerWidth: 12
31604
- })), /*#__PURE__*/React$1.createElement("div", {
31605
- style: {
31606
- marginTop: "-28px"
31607
- }
31608
- }, /*#__PURE__*/React$1.createElement(PerformanceAnalyticsLegend, {
31624
+ startIndex: 0,
31625
+ endIndex: Math.min(6, processedData.length - 1),
31626
+ y: 330,
31627
+ travellerWidth: 10,
31628
+ tickFormatter: (value, index) => index + 1
31629
+ })), /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement(PerformanceAnalyticsLegend, {
31609
31630
  legendData: [{
31610
31631
  iconColor: "#CCDCDD",
31611
31632
  iconType: "Square",
@@ -31619,9 +31640,11 @@ const SeparatedLineBarChart = ({
31619
31640
  };
31620
31641
 
31621
31642
  function SingleChart({
31622
- lineChartData
31643
+ barData,
31644
+ height = 450,
31645
+ width = "100%"
31623
31646
  }) {
31624
- const dataWithIndex = lineChartData?.map((item, index) => ({
31647
+ const dataWithIndex = barData?.map((item, index) => ({
31625
31648
  ...item,
31626
31649
  index,
31627
31650
  shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
@@ -31652,20 +31675,23 @@ function SingleChart({
31652
31675
  dy: 18
31653
31676
  }, "Event: ", parts.join(" "))));
31654
31677
  };
31655
- const [startIndex, setStartIndex] = useState(0);
31656
- const [endIndex, setEndIndex] = useState(dataWithIndex?.length - 1);
31678
+ const CustomTooltip = ({
31679
+ active,
31680
+ payload
31681
+ }) => {
31682
+ if (!active || !payload || !payload.length) return null;
31683
+ const data = payload[0]?.payload;
31684
+ if (!data) return null;
31685
+ console.log(data);
31686
+ return /*#__PURE__*/React$1.createElement(TooltipContainer, null, /*#__PURE__*/React$1.createElement(TooltipTitle, null, `${data.label}`), /*#__PURE__*/React$1.createElement(TooltipText, null, `${data.description}`), /*#__PURE__*/React$1.createElement(TooltipText, null, `${data.typeTitle}: ${getFormattedValue(data.value)}${getFormattedUnits(data.value)}`));
31687
+ };
31657
31688
  return /*#__PURE__*/React$1.createElement("div", {
31658
31689
  style: {
31659
- width: "100%",
31660
- height: 600
31661
- }
31662
- }, /*#__PURE__*/React$1.createElement("div", {
31663
- style: {
31664
- height: "100%"
31690
+ width: "100%"
31665
31691
  }
31666
31692
  }, /*#__PURE__*/React$1.createElement(ResponsiveContainer, {
31667
- width: "100%",
31668
- height: "100%"
31693
+ width: width,
31694
+ height: height
31669
31695
  }, /*#__PURE__*/React$1.createElement(ComposedChart, {
31670
31696
  data: dataWithIndex,
31671
31697
  margin: {
@@ -31690,7 +31716,9 @@ function SingleChart({
31690
31716
  }), /*#__PURE__*/React$1.createElement(YAxis, {
31691
31717
  tickFormatter: v => `$${v / 1000}k`,
31692
31718
  hide: true
31693
- }), /*#__PURE__*/React$1.createElement(Tooltip$2, null), /*#__PURE__*/React$1.createElement(Bar, {
31719
+ }), /*#__PURE__*/React$1.createElement(Tooltip$2, {
31720
+ content: /*#__PURE__*/React$1.createElement(CustomTooltip, null)
31721
+ }), /*#__PURE__*/React$1.createElement(Bar, {
31694
31722
  dataKey: "value",
31695
31723
  fill: "#CCDCDD",
31696
31724
  gap: "4px",
@@ -31706,23 +31734,18 @@ function SingleChart({
31706
31734
  fontWeight: "400",
31707
31735
  fontFamily: "Poppins"
31708
31736
  })), /*#__PURE__*/React$1.createElement(Brush, {
31709
- dataKey: "index",
31710
31737
  height: 30,
31711
- stroke: "#212121",
31712
- startIndex: startIndex,
31713
- endIndex: endIndex,
31714
- onChange: e => {
31715
- setStartIndex(e.startIndex ?? 0);
31716
- setEndIndex(e.endIndex ?? dataWithIndex?.length - 1);
31717
- },
31718
- travellerWidth: 12
31738
+ travellerWidth: 10,
31739
+ startIndex: 0,
31740
+ endIndex: Math.min(6, barData.length - 1),
31741
+ y: 380
31719
31742
  })), /*#__PURE__*/React$1.createElement(PerformanceAnalyticsLegend, {
31720
31743
  legendData: [{
31721
31744
  iconColor: "#CCDCDD",
31722
31745
  iconType: "Square",
31723
31746
  title: "INC Units"
31724
31747
  }]
31725
- }))));
31748
+ })));
31726
31749
  }
31727
31750
 
31728
31751
  styled.div`
@@ -31953,16 +31976,15 @@ SegmentedButton.defaultProps = {
31953
31976
  };
31954
31977
 
31955
31978
  function InnerBarChart({
31956
- data = []
31979
+ brushInnerBarData
31957
31980
  }) {
31958
- const processedData = data.map(item => {
31981
+ const processedData = brushInnerBarData.map(item => {
31959
31982
  const parts = item.label.replace("Vendor Selling Event:", "").trim();
31960
31983
  return {
31961
31984
  ...item,
31962
31985
  shortLabel: parts
31963
31986
  };
31964
31987
  });
31965
- const format = v => v >= 1000 ? `${v / 1000}K` : v;
31966
31988
  const BarWithInner = props => {
31967
31989
  const {
31968
31990
  x,
@@ -31991,7 +32013,7 @@ function InnerBarChart({
31991
32013
  fontWeight: 400,
31992
32014
  fontFamily: "Poppins",
31993
32015
  fill: "#212121"
31994
- }, format(payload.total)), /*#__PURE__*/React$1.createElement("rect", {
32016
+ }, `${getFormattedValue(payload.total)}${getFormattedUnits(payload.total)}`), /*#__PURE__*/React$1.createElement("rect", {
31995
32017
  x: x + width * 0.2,
31996
32018
  y: innerY,
31997
32019
  width: width * 0.6,
@@ -32007,7 +32029,7 @@ function InnerBarChart({
32007
32029
  fontWeight: 400,
32008
32030
  fontFamily: "Poppins",
32009
32031
  fill: "#212121"
32010
- }, format(payload.actual)));
32032
+ }, `${getFormattedValue(payload.actual)}${getFormattedUnits(payload.actual)}`));
32011
32033
  };
32012
32034
  const CustomTooltip = ({
32013
32035
  active,
@@ -32016,9 +32038,8 @@ function InnerBarChart({
32016
32038
  }) => {
32017
32039
  if (!active || !payload || !payload.length) return null;
32018
32040
  const data = payload[0].payload;
32019
- return /*#__PURE__*/React$1.createElement("div", {
32020
- className: "bg-white border border-gray-300 p-2 rounded-lg text-sm"
32021
- }, /*#__PURE__*/React$1.createElement("strong", null, data.label), /*#__PURE__*/React$1.createElement("div", null, "Actual: ", format(data.actual)), /*#__PURE__*/React$1.createElement("div", null, "Total: ", format(data.total)));
32041
+ const repeaterPercentage = (data.actual / data.total * 100).toFixed(1);
32042
+ return /*#__PURE__*/React$1.createElement(TooltipContainer, null, /*#__PURE__*/React$1.createElement(TooltipTitle, null, `${data.label}`), /*#__PURE__*/React$1.createElement(TooltipText, null, `${data.description}`), /*#__PURE__*/React$1.createElement(TooltipText, null, `New Shoppers: ${getFormattedValue(data.total)}${getFormattedUnits(data.total)}`), /*#__PURE__*/React$1.createElement(TooltipText, null, `Repeaters: ${getFormattedValue(data.actual)}${getFormattedUnits(data.actual)}`), /*#__PURE__*/React$1.createElement(TooltipText, null, `% Repeaters: ${repeaterPercentage}%`));
32022
32043
  };
32023
32044
  const CustomizedTick = props => {
32024
32045
  const {
@@ -32050,9 +32071,7 @@ function InnerBarChart({
32050
32071
  };
32051
32072
  return /*#__PURE__*/React$1.createElement("div", {
32052
32073
  className: "w-full"
32053
- }, /*#__PURE__*/React$1.createElement("h3", {
32054
- className: "text-lg font-medium mb-4 text-center"
32055
- }, "Vendor Selling Events Comparison"), /*#__PURE__*/React$1.createElement(ResponsiveContainer, {
32074
+ }, /*#__PURE__*/React$1.createElement(ResponsiveContainer, {
32056
32075
  width: "100%",
32057
32076
  height: 450
32058
32077
  }, /*#__PURE__*/React$1.createElement(BarChart$1, {
@@ -32074,14 +32093,14 @@ function InnerBarChart({
32074
32093
  }), /*#__PURE__*/React$1.createElement(YAxis, {
32075
32094
  type: "number",
32076
32095
  domain: [0, "dataMax + 2000"],
32077
- tickFormatter: format
32096
+ hide: true
32078
32097
  }), /*#__PURE__*/React$1.createElement(Tooltip$2, {
32079
32098
  content: /*#__PURE__*/React$1.createElement(CustomTooltip, null)
32080
32099
  }), /*#__PURE__*/React$1.createElement(Brush, {
32081
32100
  height: 30,
32082
32101
  travellerWidth: 10,
32083
32102
  startIndex: 0,
32084
- endIndex: 5,
32103
+ endIndex: Math.min(6, processedData.length - 1),
32085
32104
  y: 380
32086
32105
  }), /*#__PURE__*/React$1.createElement(Bar, {
32087
32106
  dataKey: "total",
@@ -32090,51 +32109,22 @@ function InnerBarChart({
32090
32109
  }))));
32091
32110
  }
32092
32111
 
32093
- const Container = styled.div`
32094
- width: ${props => props.width};
32095
- height: ${props => props.height};
32096
- padding: 15px;
32097
- display: flex;
32098
- flex-direction: column;
32099
- #Segment {
32100
- width: auto;
32101
- white-space: nowrap;
32102
- font-size: 14px;
32103
- font-weight: 500;
32104
- font-family: "Poppins"
32105
- }
32106
- `;
32107
- styled.div`
32108
- font-family: sans-serif;
32109
- text-align: center;
32110
- `;
32111
- styled.div`
32112
- height: 25%;
32113
- `;
32114
- styled.div`
32115
- height: 75%;
32116
- `;
32117
- styled.div`
32118
- height: 100%;
32119
- display: flex;
32120
- flex-direction: column;
32121
- background-color: white;
32122
- `;
32123
-
32124
32112
  const BrushChart = props => {
32125
32113
  const {
32126
32114
  width,
32127
32115
  height,
32128
- data,
32129
- barlineData,
32130
- lineChartData
32116
+ brushInnerBarData,
32117
+ brushBarIncData,
32118
+ brushBarBasketData,
32119
+ brushAreaBarData,
32120
+ title
32131
32121
  } = props;
32132
32122
  const segmentedbuttonOptions = ["New Shoppers & Repeaters", "INC Sales & ROI", "INC Units", "Basket Lift"];
32133
32123
  const [selectedOption, setSelectedOption] = useState(segmentedbuttonOptions[0]);
32134
32124
  return /*#__PURE__*/React$1.createElement(Container, {
32135
32125
  height: height,
32136
32126
  width: width
32137
- }, /*#__PURE__*/React$1.createElement(SegmentedButton, {
32127
+ }, /*#__PURE__*/React$1.createElement(Title$1, null, title), /*#__PURE__*/React$1.createElement(SegmentedButton, {
32138
32128
  gap: "8px",
32139
32129
  options: segmentedbuttonOptions.map(value => ({
32140
32130
  value
@@ -32146,13 +32136,13 @@ const BrushChart = props => {
32146
32136
  return setSelectedOption(value);
32147
32137
  }
32148
32138
  }), selectedOption === "New Shoppers & Repeaters" && /*#__PURE__*/React$1.createElement(InnerBarChart, {
32149
- data: data
32139
+ brushInnerBarData: brushInnerBarData
32150
32140
  }), selectedOption === "INC Sales & ROI" && /*#__PURE__*/React$1.createElement(SeparatedLineBarChart, {
32151
- barlineData: barlineData
32141
+ brushAreaBarData: brushAreaBarData
32152
32142
  }), selectedOption === "INC Units" && /*#__PURE__*/React$1.createElement(SingleChart, {
32153
- lineChartData: lineChartData
32143
+ barData: brushBarIncData
32154
32144
  }), selectedOption === "Basket Lift" && /*#__PURE__*/React$1.createElement(SingleChart, {
32155
- lineChartData: lineChartData
32145
+ barData: brushBarBasketData
32156
32146
  }));
32157
32147
  };
32158
32148