sag_components 2.0.0-beta53 → 2.0.0-beta56

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.js CHANGED
@@ -9494,70 +9494,67 @@ const DropdownMain = styled__default["default"].div`
9494
9494
  `;
9495
9495
 
9496
9496
  /* eslint-disable react/prop-types */
9497
- const DropdownNew = _ref => {
9498
- let {
9499
- isMulti,
9500
- label,
9501
- labelEmptyValue,
9502
- options,
9503
- selectedValue,
9504
- placeHolder,
9505
- onChange,
9506
- required,
9507
- disabled,
9508
- width,
9509
- error,
9510
- errorMessage,
9511
- labelColor,
9512
- checkBoxColor,
9513
- xIconShow,
9514
- showLabelOnTop,
9515
- orderBy,
9516
- elementType
9517
- } = _ref;
9518
- return /*#__PURE__*/React__default["default"].createElement(DropdownMain, {
9519
- className: "DropdownMain",
9520
- width: width
9521
- }, isMulti ? /*#__PURE__*/React__default["default"].createElement(DropdownMultiNew, {
9522
- className: "DropdownMultiNew",
9523
- placeHolder: placeHolder,
9524
- label: label,
9525
- labelEmptyValue: labelEmptyValue,
9526
- labelColor: labelColor,
9527
- checkBoxColor: checkBoxColor,
9528
- required: required,
9529
- options: options,
9530
- width: width,
9531
- disabled: disabled,
9532
- error: error,
9533
- errorMessage: errorMessage,
9534
- selectedValue: selectedValue,
9535
- xIconShow: xIconShow,
9536
- onChange: onChange,
9537
- showLabelOnTop: showLabelOnTop,
9538
- orderBy: orderBy,
9539
- elementType: elementType
9540
- }) : /*#__PURE__*/React__default["default"].createElement(DropdownSingleNew, {
9541
- className: "DropdownSingleNew",
9542
- placeHolder: placeHolder,
9543
- label: label,
9544
- labelEmptyValue: labelEmptyValue,
9545
- labelColor: labelColor,
9546
- checkBoxColor: checkBoxColor,
9547
- required: required,
9548
- options: options,
9549
- width: width,
9550
- disabled: disabled,
9551
- error: error,
9552
- errorMessage: errorMessage,
9553
- selectedValue: selectedValue,
9554
- xIconShow: xIconShow,
9555
- onChange: onChange,
9556
- showLabelOnTop: showLabelOnTop,
9557
- orderBy: orderBy,
9558
- elementType: elementType
9559
- }));
9560
- };
9497
+ const DropdownNew = ({
9498
+ isMulti,
9499
+ label,
9500
+ labelEmptyValue,
9501
+ options,
9502
+ selectedValue,
9503
+ placeHolder,
9504
+ onChange,
9505
+ required,
9506
+ disabled,
9507
+ width,
9508
+ error,
9509
+ errorMessage,
9510
+ labelColor,
9511
+ checkBoxColor,
9512
+ xIconShow,
9513
+ showLabelOnTop,
9514
+ orderBy,
9515
+ elementType
9516
+ }) => /*#__PURE__*/React__default["default"].createElement(DropdownMain, {
9517
+ className: "DropdownMain",
9518
+ width: width
9519
+ }, isMulti ? /*#__PURE__*/React__default["default"].createElement(DropdownMultiNew, {
9520
+ className: "DropdownMultiNew",
9521
+ placeHolder: placeHolder,
9522
+ label: label,
9523
+ labelEmptyValue: labelEmptyValue,
9524
+ labelColor: labelColor,
9525
+ checkBoxColor: checkBoxColor,
9526
+ required: required,
9527
+ options: options,
9528
+ width: width,
9529
+ disabled: disabled,
9530
+ error: error,
9531
+ errorMessage: errorMessage,
9532
+ selectedValue: selectedValue,
9533
+ xIconShow: xIconShow,
9534
+ onChange: onChange,
9535
+ showLabelOnTop: showLabelOnTop,
9536
+ orderBy: orderBy,
9537
+ elementType: elementType
9538
+ }) : /*#__PURE__*/React__default["default"].createElement(DropdownSingleNew, {
9539
+ className: "DropdownSingleNew",
9540
+ placeHolder: placeHolder,
9541
+ label: label,
9542
+ labelEmptyValue: labelEmptyValue,
9543
+ labelColor: labelColor,
9544
+ checkBoxColor: checkBoxColor,
9545
+ required: required,
9546
+ options: options,
9547
+ width: width,
9548
+ disabled: disabled,
9549
+ error: error,
9550
+ errorMessage: errorMessage,
9551
+ selectedValue: selectedValue,
9552
+ xIconShow: xIconShow,
9553
+ onChange: onChange,
9554
+ showLabelOnTop: showLabelOnTop,
9555
+ orderBy: orderBy,
9556
+ elementType: elementType
9557
+ }));
9561
9558
  DropdownNew.propTypes = {
9562
9559
  placeHolder: PropTypes.string,
9563
9560
  label: PropTypes.string,
@@ -9730,26 +9727,34 @@ const OptionsContainer$4 = styled__default["default"].div`
9730
9727
  padding-top: 8px;
9731
9728
  `;
9732
9729
 
9733
- const ChervronRightIcon = () => /*#__PURE__*/React__default["default"].createElement("svg", {
9734
- width: "8",
9735
- height: "13",
9730
+ const ChervronRightIcon = ({
9731
+ width = "8",
9732
+ height = "13",
9733
+ fill = "#777575"
9734
+ }) => /*#__PURE__*/React__default["default"].createElement("svg", {
9735
+ width: width,
9736
+ height: height,
9736
9737
  viewBox: "0 0 8 13",
9737
9738
  fill: "none",
9738
9739
  xmlns: "http://www.w3.org/2000/svg"
9739
9740
  }, /*#__PURE__*/React__default["default"].createElement("path", {
9740
9741
  d: "M7.33984 5.78516C7.58594 6.05859 7.58594 6.46875 7.33984 6.71484L2.08984 11.9648C1.81641 12.2383 1.40625 12.2383 1.16016 11.9648C0.886719 11.7188 0.886719 11.3086 1.16016 11.0625L5.94531 6.27734L1.16016 1.46484C0.886719 1.21875 0.886719 0.808594 1.16016 0.5625C1.40625 0.289062 1.81641 0.289062 2.0625 0.5625L7.33984 5.78516Z",
9741
- fill: "#777575"
9742
+ fill: fill
9742
9743
  }));
9743
9744
 
9744
- const ChervronLeftIcon = () => /*#__PURE__*/React__default["default"].createElement("svg", {
9745
- width: "7",
9746
- height: "13",
9745
+ const ChervronLeftIcon = ({
9746
+ width = 7,
9747
+ height = 13,
9748
+ fill = "#777575"
9749
+ }) => /*#__PURE__*/React__default["default"].createElement("svg", {
9750
+ width: width,
9751
+ height: height,
9747
9752
  viewBox: "0 0 7 13",
9748
9753
  fill: "none",
9749
9754
  xmlns: "http://www.w3.org/2000/svg"
9750
9755
  }, /*#__PURE__*/React__default["default"].createElement("path", {
9751
9756
  d: "M0.410156 5.78516L5.66016 0.5625C5.90625 0.289062 6.31641 0.289062 6.58984 0.5625C6.83594 0.808594 6.83594 1.21875 6.58984 1.46484L1.77734 6.25L6.5625 11.0625C6.83594 11.3086 6.83594 11.7188 6.5625 11.9648C6.31641 12.2383 5.90625 12.2383 5.66016 11.9648L0.410156 6.71484C0.136719 6.46875 0.136719 6.05859 0.410156 5.78516Z",
9752
- fill: "#777575"
9757
+ fill: fill
9753
9758
  }));
9754
9759
 
9755
9760
  /* eslint-disable react/prop-types */
@@ -9971,21 +9976,20 @@ const DatePicker = ({
9971
9976
  };
9972
9977
 
9973
9978
  /* eslint-disable import/no-extraneous-dependencies */
9974
- const RangePicker = _ref => {
9975
- let {
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
- } = _ref;
9979
+ const RangePicker = ({
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
+ }) => {
9989
9993
  const [isFocused, setIsFocused] = React$1.useState(false);
9990
9994
  const [isOpen, setIsOpen] = React$1.useState(false);
9991
9995
  const [value, setValue] = React$1.useState(''); // Added value state
@@ -10047,6 +10051,7 @@ const RangePicker = _ref => {
10047
10051
  setValue(e.target.value);
10048
10052
  };
10049
10053
  const toggleDatePicker = () => {
10054
+ if (disabled) return;
10050
10055
  setIsOpen(!isOpen);
10051
10056
  };
10052
10057
  const handleFocus = () => {
@@ -10339,7 +10344,15 @@ const DateCell$1 = styled__default["default"].div`
10339
10344
  color: #ccc;
10340
10345
  }
10341
10346
  `;
10342
- const years$1 = [2022, 2023, 2024];
10347
+ const generateYearsArray$1 = (startYear, endDate) => {
10348
+ const years = [];
10349
+ const endYear = endDate.getFullYear();
10350
+ for (let year = startYear; year <= endYear; year++) {
10351
+ years.push(`${year}`);
10352
+ }
10353
+ return years;
10354
+ };
10355
+ const years$1 = generateYearsArray$1(2022, new Date());
10343
10356
  const QuarterPopupPicker = ({
10344
10357
  isOpen,
10345
10358
  onChangeDate,
@@ -10417,23 +10430,22 @@ const QuarterPopupPicker = ({
10417
10430
  };
10418
10431
 
10419
10432
  /* eslint-disable import/no-extraneous-dependencies */
10420
- const QuarterPicker = _ref => {
10421
- let {
10422
- availableQuarters,
10423
- // ["Q1-2024"]
10424
- label,
10425
- onChange,
10426
- borderRadius,
10427
- required,
10428
- width,
10429
- height,
10430
- placeholder,
10431
- disabled,
10432
- borderColor,
10433
- borderColorFocus,
10434
- textColor,
10435
- selectedValue
10436
- } = _ref;
10433
+ const QuarterPicker = ({
10434
+ availableQuarters,
10435
+ // ["Q1-2024"]
10436
+ label,
10437
+ onChange,
10438
+ borderRadius,
10439
+ required,
10440
+ width,
10441
+ height,
10442
+ placeholder,
10443
+ disabled,
10444
+ borderColor,
10445
+ borderColorFocus,
10446
+ textColor,
10447
+ selectedValue
10448
+ }) => {
10437
10449
  const [isFocused, setIsFocused] = React$1.useState(false);
10438
10450
  const [isOpen, setIsOpen] = React$1.useState(false);
10439
10451
  const [value, setValue] = React$1.useState('');
@@ -10768,7 +10780,15 @@ const DateCell = styled__default["default"].div`
10768
10780
  color: #ccc;
10769
10781
  }
10770
10782
  `;
10771
- const years = [2022, 2023, 2024];
10783
+ const generateYearsArray = (startYear, endDate) => {
10784
+ const years = [];
10785
+ const endYear = endDate.getFullYear();
10786
+ for (let year = startYear; year <= endYear; year++) {
10787
+ years.push(`${year}`);
10788
+ }
10789
+ return years;
10790
+ };
10791
+ const years = generateYearsArray(2022, new Date());
10772
10792
  const MonthPopupPicker = ({
10773
10793
  isOpen,
10774
10794
  onChangeDate,
@@ -10872,22 +10892,21 @@ const MonthPopupPicker = ({
10872
10892
  };
10873
10893
 
10874
10894
  /* eslint-disable import/no-extraneous-dependencies */
10875
- const MonthPicker = _ref => {
10876
- let {
10877
- availableMonths,
10878
- label,
10879
- onChange,
10880
- borderRadius,
10881
- required,
10882
- width,
10883
- height,
10884
- placeholder,
10885
- disabled,
10886
- borderColor,
10887
- borderColorFocus,
10888
- textColor,
10889
- selectedValue
10890
- } = _ref;
10895
+ const MonthPicker = ({
10896
+ availableMonths,
10897
+ label,
10898
+ onChange,
10899
+ borderRadius,
10900
+ required,
10901
+ width,
10902
+ height,
10903
+ placeholder,
10904
+ disabled,
10905
+ borderColor,
10906
+ borderColorFocus,
10907
+ textColor,
10908
+ selectedValue
10909
+ }) => {
10891
10910
  const [isFocused, setIsFocused] = React$1.useState(false);
10892
10911
  const [isOpen, setIsOpen] = React$1.useState(false);
10893
10912
  const [value, setValue] = React$1.useState('');
@@ -24113,22 +24132,21 @@ const DeleteIcon = styled__default["default"].div`
24113
24132
  position: absolute;
24114
24133
  `;
24115
24134
 
24116
- const QuickFilterDropdownSingle = _ref => {
24117
- let {
24118
- label,
24119
- hoverColor,
24120
- options,
24121
- selectedValue,
24122
- placeHolder,
24123
- onChange,
24124
- disabled,
24125
- width,
24126
- error,
24127
- errorMessage,
24128
- xIconShow,
24129
- labelColor,
24130
- showLabelOnTop
24131
- } = _ref;
24135
+ const QuickFilterDropdownSingle = ({
24136
+ label,
24137
+ hoverColor,
24138
+ options,
24139
+ selectedValue,
24140
+ placeHolder,
24141
+ onChange,
24142
+ disabled,
24143
+ width,
24144
+ error,
24145
+ errorMessage,
24146
+ xIconShow,
24147
+ labelColor,
24148
+ showLabelOnTop
24149
+ }) => {
24132
24150
  const [isFocused, setIsFocused] = React$1.useState(false);
24133
24151
  const [showOptions, setShowOptions] = React$1.useState(false);
24134
24152
  const [inputValue, setInputValue] = React$1.useState("");
@@ -24526,24 +24544,23 @@ const IconContainer$2 = styled__default["default"].div`
24526
24544
  cursor: pointer;
24527
24545
  `;
24528
24546
 
24529
- const QuickFilterDropdownMultiSelection = _ref => {
24530
- let {
24531
- label,
24532
- labelEmptyValue,
24533
- options,
24534
- selectedValue,
24535
- placeHolder,
24536
- onChange,
24537
- required,
24538
- disabled,
24539
- width,
24540
- error,
24541
- errorMessage,
24542
- labelColor,
24543
- xIconShow,
24544
- checkBoxColor,
24545
- showLabelOnTop
24546
- } = _ref;
24547
+ const QuickFilterDropdownMultiSelection = ({
24548
+ label,
24549
+ labelEmptyValue,
24550
+ options,
24551
+ selectedValue,
24552
+ placeHolder,
24553
+ onChange,
24554
+ required,
24555
+ disabled,
24556
+ width,
24557
+ error,
24558
+ errorMessage,
24559
+ labelColor,
24560
+ xIconShow,
24561
+ checkBoxColor,
24562
+ showLabelOnTop
24563
+ }) => {
24547
24564
  const [isFocused, setIsFocused] = React$1.useState(false);
24548
24565
  const [showOptions, setShowOptions] = React$1.useState(false);
24549
24566
  const [inputValue, setInputValue] = React$1.useState('');
@@ -25157,8 +25174,8 @@ function styleInject(css, ref) {
25157
25174
  }
25158
25175
  }
25159
25176
 
25160
- var css_248z$1 = "@keyframes react-loading-skeleton {\n 100% {\n transform: translateX(100%);\n }\n}\n\n.react-loading-skeleton {\n --base-color: #ebebeb;\n --highlight-color: #f5f5f5;\n --animation-duration: 1.5s;\n --animation-direction: normal;\n --pseudo-element-display: block; /* Enable animation */\n\n background-color: var(--base-color);\n\n width: 100%;\n border-radius: 0.25rem;\n display: inline-flex;\n line-height: 1;\n\n position: relative;\n user-select: none;\n overflow: hidden;\n}\n\n.react-loading-skeleton::after {\n content: ' ';\n display: var(--pseudo-element-display);\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 100%;\n background-repeat: no-repeat;\n background-image: var(\n --custom-highlight-background,\n linear-gradient(\n 90deg,\n var(--base-color) 0%,\n var(--highlight-color) 50%,\n var(--base-color) 100%\n )\n );\n transform: translateX(-100%);\n\n animation-name: react-loading-skeleton;\n animation-direction: var(--animation-direction);\n animation-duration: var(--animation-duration);\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n}\n\n@media (prefers-reduced-motion) {\n .react-loading-skeleton {\n --pseudo-element-display: none; /* Disable animation */\n }\n}\n";
25161
- styleInject(css_248z$1);
25177
+ var css_248z = "@keyframes react-loading-skeleton {\n 100% {\n transform: translateX(100%);\n }\n}\n\n.react-loading-skeleton {\n --base-color: #ebebeb;\n --highlight-color: #f5f5f5;\n --animation-duration: 1.5s;\n --animation-direction: normal;\n --pseudo-element-display: block; /* Enable animation */\n\n background-color: var(--base-color);\n\n width: 100%;\n border-radius: 0.25rem;\n display: inline-flex;\n line-height: 1;\n\n position: relative;\n user-select: none;\n overflow: hidden;\n}\n\n.react-loading-skeleton::after {\n content: ' ';\n display: var(--pseudo-element-display);\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 100%;\n background-repeat: no-repeat;\n background-image: var(\n --custom-highlight-background,\n linear-gradient(\n 90deg,\n var(--base-color) 0%,\n var(--highlight-color) 50%,\n var(--base-color) 100%\n )\n );\n transform: translateX(-100%);\n\n animation-name: react-loading-skeleton;\n animation-direction: var(--animation-direction);\n animation-duration: var(--animation-duration);\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n}\n\n@media (prefers-reduced-motion) {\n .react-loading-skeleton {\n --pseudo-element-display: none; /* Disable animation */\n }\n}\n";
25178
+ styleInject(css_248z);
25162
25179
 
25163
25180
  const OneColumnContainer = props => {
25164
25181
  const {
@@ -31382,83 +31399,102 @@ const BatteryChart = props => {
31382
31399
  }))))))), starText !== "" && /*#__PURE__*/React__default["default"].createElement(StarText, null, starText));
31383
31400
  };
31384
31401
 
31385
- const originalData$1 = [{
31386
- label: "Vendor Selling Event: Week 28",
31387
- inc_unit: 20000,
31388
- inc_roi: 1.2
31389
- }, {
31390
- label: "Vendor Selling Event: Week 29",
31391
- inc_unit: 10000,
31392
- inc_roi: 1.2
31393
- }, {
31394
- label: "Vendor Selling Event: Week 30",
31395
- inc_unit: 8000,
31396
- inc_roi: 0.8
31397
- }, {
31398
- label: "Vendor Selling Event: Week 33",
31399
- inc_unit: 12000,
31400
- inc_roi: 1.1
31401
- }, {
31402
- label: "Vendor Selling Event: Week 36",
31403
- inc_unit: 8000,
31404
- inc_roi: 1.2
31405
- }, {
31406
- label: "Vendor Selling Event: Week 34",
31407
- inc_unit: 8000,
31408
- inc_roi: 0.7
31409
- }, {
31410
- label: "Vendor Selling Event: Week 35",
31411
- inc_unit: 8000,
31412
- inc_roi: 0.8
31413
- }, {
31414
- label: "Vendor Selling Event: Week 38",
31415
- inc_unit: 9000,
31416
- inc_roi: 1.1
31417
- }];
31418
- const dataWithIndex$1 = originalData$1.map((item, index) => ({
31419
- ...item,
31420
- index,
31421
- shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
31422
- }));
31423
- const CustomizedTick$1 = ({
31424
- x,
31425
- y,
31426
- payload
31402
+ // const originalData = [
31403
+ // { label: "Vendor Selling Event: Week 34", inc_sales: 20000, inc_roi: 1.2 },
31404
+ // { label: "Vendor Selling Event: Week 36", inc_sales: 10000, inc_roi: 1.2 },
31405
+ // { label: "Vendor Selling Event: Week 38", inc_sales: 8000, inc_roi: 0.8 },
31406
+ // { label: "Vendor Selling Event: Week 33", inc_sales: 12000, inc_roi: 1.1 },
31407
+ // { label: "Vendor Selling Event: Week 29", inc_sales: 8000, inc_roi: 1.2 },
31408
+ // { label: "Vendor Selling Event: Week 28", inc_sales: 8000, inc_roi: 0.7 },
31409
+ // { label: "Vendor Selling Event: Week 35", inc_sales: 8000, inc_roi: 0.8 },
31410
+ // { label: "Vendor Selling Event: Week 30", inc_sales: 9000, inc_roi: 1.1 },
31411
+ // ];
31412
+
31413
+ const SeparatedLineBarChart = ({
31414
+ barlineData
31427
31415
  }) => {
31428
- const label = dataWithIndex$1[payload.value]?.label ?? "";
31429
- const parts = label.replace("Vendor Selling Event: ", "").split(" ");
31430
- return /*#__PURE__*/React__default["default"].createElement("g", {
31431
- transform: `translate(${x},${y})`
31432
- }, /*#__PURE__*/React__default["default"].createElement("text", {
31433
- x: 0,
31434
- y: 0,
31435
- dy: 16,
31436
- textAnchor: "middle",
31437
- fill: "#212121",
31438
- fontSize: 11,
31439
- fontWeight: "400",
31440
- fontFamily: "Poppins"
31441
- }, /*#__PURE__*/React__default["default"].createElement("tspan", {
31442
- x: 0,
31443
- dy: 8
31444
- }, "Vendor Selling"), /*#__PURE__*/React__default["default"].createElement("tspan", {
31445
- x: 0,
31446
- dy: 18
31447
- }, "Event: ", parts.join(" "))));
31448
- };
31449
-
31450
- // Common chart configuration
31451
- const chartMargins = {
31452
- top: 15,
31453
- right: 40,
31454
- left: 20,
31455
- bottom: 40
31456
- };
31457
- const SeparatedLineBarChart = () => {
31416
+ // Sort the data by week number extracted from the label
31417
+ const sortedData = barlineData?.sort((a, b) => {
31418
+ const weekA = parseInt(a.label.match(/Week (\d+)/)[1], 10);
31419
+ const weekB = parseInt(b.label.match(/Week (\d+)/)[1], 10);
31420
+ return weekA - weekB;
31421
+ });
31422
+ const dataWithIndex = sortedData.map((item, index) => ({
31423
+ ...item,
31424
+ index,
31425
+ shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
31426
+ }));
31427
+ const CustomizedTick = ({
31428
+ x,
31429
+ y,
31430
+ payload,
31431
+ viewableIndices
31432
+ }) => {
31433
+ const label = dataWithIndex[payload.value]?.label ?? "";
31434
+ const parts = label.replace("Vendor Selling Event: ", "").split(" ");
31435
+ if (!viewableIndices.includes(payload.value)) {
31436
+ return null;
31437
+ }
31438
+ return /*#__PURE__*/React__default["default"].createElement("g", {
31439
+ transform: `translate(${x},${y})`
31440
+ }, /*#__PURE__*/React__default["default"].createElement("text", {
31441
+ x: 0,
31442
+ y: 0,
31443
+ dy: 16,
31444
+ textAnchor: "middle",
31445
+ fill: "#212121",
31446
+ fontSize: 11,
31447
+ fontWeight: "400",
31448
+ fontFamily: "Poppins"
31449
+ }, /*#__PURE__*/React__default["default"].createElement("tspan", {
31450
+ x: 0,
31451
+ dy: 8
31452
+ }, "Vendor Selling"), /*#__PURE__*/React__default["default"].createElement("tspan", {
31453
+ x: 0,
31454
+ dy: 18
31455
+ }, "Event: ", parts.join(" "))));
31456
+ };
31457
+ const CustomLabelListFilter = props => {
31458
+ const {
31459
+ viewableIndices,
31460
+ dataKey,
31461
+ position,
31462
+ formatter,
31463
+ fill,
31464
+ fontSize,
31465
+ fontWeight,
31466
+ fontFamily
31467
+ } = props;
31468
+ return /*#__PURE__*/React__default["default"].createElement(recharts.LabelList, {
31469
+ dataKey: dataKey,
31470
+ position: position,
31471
+ formatter: (value, name, props) => {
31472
+ if (!viewableIndices.includes(props.index)) {
31473
+ return "";
31474
+ }
31475
+ return formatter ? formatter(value) : value;
31476
+ },
31477
+ fill: fill || "#212121",
31478
+ fontSize: fontSize || 12,
31479
+ fontWeight: fontWeight || "400",
31480
+ fontFamily: fontFamily || "Poppins"
31481
+ });
31482
+ };
31483
+ const chartMargins = {
31484
+ top: 15,
31485
+ right: 40,
31486
+ left: 20,
31487
+ bottom: 40
31488
+ };
31458
31489
  const [viewWindow, setViewWindow] = React$1.useState({
31459
31490
  startIndex: 0,
31460
- endIndex: dataWithIndex$1.length - 1
31491
+ endIndex: dataWithIndex.length - 1
31461
31492
  });
31493
+ const viewableIndices = [];
31494
+ for (let i = viewWindow.startIndex; i <= viewWindow.endIndex; i++) {
31495
+ viewableIndices.push(i);
31496
+ }
31497
+ dataWithIndex.filter(item => viewableIndices.includes(item.index));
31462
31498
  return /*#__PURE__*/React__default["default"].createElement("div", {
31463
31499
  style: {
31464
31500
  width: "100%",
@@ -31472,8 +31508,7 @@ const SeparatedLineBarChart = () => {
31472
31508
  width: "100%",
31473
31509
  height: "100%"
31474
31510
  }, /*#__PURE__*/React__default["default"].createElement(recharts.LineChart, {
31475
- data: dataWithIndex$1 // Use full dataset for alignment
31476
- ,
31511
+ data: dataWithIndex,
31477
31512
  margin: chartMargins
31478
31513
  }, /*#__PURE__*/React__default["default"].createElement(recharts.CartesianGrid, {
31479
31514
  strokeDasharray: "3 3",
@@ -31501,10 +31536,11 @@ const SeparatedLineBarChart = () => {
31501
31536
  },
31502
31537
  activeDot: false,
31503
31538
  name: "INC Sales ROI"
31504
- }, /*#__PURE__*/React__default["default"].createElement(recharts.LabelList, {
31539
+ }, /*#__PURE__*/React__default["default"].createElement(CustomLabelListFilter, {
31505
31540
  dataKey: "inc_roi",
31506
31541
  position: "top",
31507
- formatter: value => value.toFixed(1)
31542
+ formatter: value => value.toFixed(1),
31543
+ viewableIndices: viewableIndices
31508
31544
  }))))), /*#__PURE__*/React__default["default"].createElement("div", {
31509
31545
  style: {
31510
31546
  height: "60%"
@@ -31513,7 +31549,7 @@ const SeparatedLineBarChart = () => {
31513
31549
  width: "100%",
31514
31550
  height: "100%"
31515
31551
  }, /*#__PURE__*/React__default["default"].createElement(recharts.ComposedChart, {
31516
- data: dataWithIndex$1,
31552
+ data: dataWithIndex,
31517
31553
  margin: chartMargins
31518
31554
  }, /*#__PURE__*/React__default["default"].createElement(recharts.CartesianGrid, {
31519
31555
  strokeDasharray: "3 3",
@@ -31526,30 +31562,28 @@ const SeparatedLineBarChart = () => {
31526
31562
  left: 20,
31527
31563
  right: 20
31528
31564
  },
31529
- tick: /*#__PURE__*/React__default["default"].createElement(CustomizedTick$1, null),
31530
- interval: 0 // Force display all ticks
31531
- ,
31565
+ tick: props => /*#__PURE__*/React__default["default"].createElement(CustomizedTick, _extends({}, props, {
31566
+ viewableIndices: viewableIndices
31567
+ })),
31568
+ interval: 0,
31532
31569
  height: 60,
31533
31570
  tickLine: false,
31534
- ticks: dataWithIndex$1.map(item => item.index)
31571
+ ticks: dataWithIndex.map(item => item.index)
31535
31572
  }), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
31536
- tickFormatter: v => `$${v / 1000}k`,
31573
+ tickFormatter: v => `${v / 1000}k`,
31537
31574
  hide: true
31538
31575
  }), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, null), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
31539
- dataKey: "inc_unit",
31576
+ dataKey: "inc_sales",
31540
31577
  fill: "#CCDCDD",
31541
31578
  gap: "4px",
31542
31579
  borderRadius: [4, 4, 0, 8],
31543
31580
  barSize: 40,
31544
31581
  name: "INC Sales"
31545
- }, /*#__PURE__*/React__default["default"].createElement(recharts.LabelList, {
31546
- dataKey: "inc_unit",
31582
+ }, /*#__PURE__*/React__default["default"].createElement(CustomLabelListFilter, {
31583
+ dataKey: "inc_sales",
31547
31584
  position: "top",
31548
- formatter: value => `$${value / 1000}k`,
31549
- fill: "#212121",
31550
- fontSize: 12,
31551
- fontWeight: "400",
31552
- fontFamily: "Poppins"
31585
+ formatter: value => `${value / 1000}k`,
31586
+ viewableIndices: viewableIndices
31553
31587
  })), /*#__PURE__*/React__default["default"].createElement(recharts.Brush, {
31554
31588
  dataKey: "index",
31555
31589
  height: 30,
@@ -31559,7 +31593,7 @@ const SeparatedLineBarChart = () => {
31559
31593
  onChange: e => {
31560
31594
  setViewWindow({
31561
31595
  startIndex: e.startIndex ?? 0,
31562
- endIndex: e.endIndex ?? dataWithIndex$1.length - 1
31596
+ endIndex: e.endIndex ?? dataWithIndex.length - 1
31563
31597
  });
31564
31598
  },
31565
31599
  travellerWidth: 12
@@ -31580,68 +31614,42 @@ const SeparatedLineBarChart = () => {
31580
31614
  })))));
31581
31615
  };
31582
31616
 
31583
- const originalData = [{
31584
- label: "Vendor Selling Event: Week 28",
31585
- inc_unit: 20000
31586
- }, {
31587
- label: "Vendor Selling Event: Week 29",
31588
- inc_unit: 10000
31589
- }, {
31590
- label: "Vendor Selling Event: Week 30",
31591
- inc_unit: 8000
31592
- }, {
31593
- label: "Vendor Selling Event: Week 33",
31594
- inc_unit: 12000
31595
- }, {
31596
- label: "Vendor Selling Event: Week 36",
31597
- inc_unit: 8000
31598
- }, {
31599
- label: "Vendor Selling Event: Week 34",
31600
- inc_unit: 8000
31601
- }, {
31602
- label: "Vendor Selling Event: Week 35",
31603
- inc_unit: 8000
31604
- }, {
31605
- label: "Vendor Selling Event: Week 38",
31606
- inc_unit: 9000
31607
- }];
31608
-
31609
- // Adding index and shortLabel to original data
31610
- const dataWithIndex = originalData.map((item, index) => ({
31611
- ...item,
31612
- index,
31613
- shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
31614
- }));
31615
- const CustomizedTick = ({
31616
- x,
31617
- y,
31618
- payload
31619
- }) => {
31620
- const label = dataWithIndex[payload.value]?.label ?? "";
31621
- const parts = label.replace("Vendor Selling Event: ", "").split(" ");
31622
- return /*#__PURE__*/React__default["default"].createElement("g", {
31623
- transform: `translate(${x},${y})`
31624
- }, /*#__PURE__*/React__default["default"].createElement("text", {
31625
- x: 0,
31626
- y: 0,
31627
- dy: 16,
31628
- textAnchor: "middle",
31629
- fill: "#212121",
31630
- fontSize: 11,
31631
- fontWeight: "400",
31632
- fontFamily: "Poppins"
31633
- }, /*#__PURE__*/React__default["default"].createElement("tspan", {
31634
- x: 0,
31635
- dy: 8
31636
- }, "Vendor Selling"), /*#__PURE__*/React__default["default"].createElement("tspan", {
31637
- x: 0,
31638
- dy: 18
31639
- }, "Event: ", parts.join(" "))));
31640
- };
31641
- const SingleChart = () => {
31617
+ function SingleChart({
31618
+ lineChartData
31619
+ }) {
31620
+ const dataWithIndex = lineChartData?.map((item, index) => ({
31621
+ ...item,
31622
+ index,
31623
+ shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
31624
+ }));
31625
+ const CustomizedTick = ({
31626
+ x,
31627
+ y,
31628
+ payload
31629
+ }) => {
31630
+ const label = dataWithIndex[payload.value]?.label ?? "";
31631
+ const parts = label.replace("Vendor Selling Event: ", "").split(" ");
31632
+ return /*#__PURE__*/React__default["default"].createElement("g", {
31633
+ transform: `translate(${x},${y})`
31634
+ }, /*#__PURE__*/React__default["default"].createElement("text", {
31635
+ x: 0,
31636
+ y: 0,
31637
+ dy: 16,
31638
+ textAnchor: "middle",
31639
+ fill: "#212121",
31640
+ fontSize: 11,
31641
+ fontWeight: "400",
31642
+ fontFamily: "Poppins"
31643
+ }, /*#__PURE__*/React__default["default"].createElement("tspan", {
31644
+ x: 0,
31645
+ dy: 8
31646
+ }, "Vendor Selling"), /*#__PURE__*/React__default["default"].createElement("tspan", {
31647
+ x: 0,
31648
+ dy: 18
31649
+ }, "Event: ", parts.join(" "))));
31650
+ };
31642
31651
  const [startIndex, setStartIndex] = React$1.useState(0);
31643
- const [endIndex, setEndIndex] = React$1.useState(dataWithIndex.length - 1);
31644
- dataWithIndex.slice(startIndex, endIndex + 1);
31652
+ const [endIndex, setEndIndex] = React$1.useState(dataWithIndex?.length - 1);
31645
31653
  return /*#__PURE__*/React__default["default"].createElement("div", {
31646
31654
  style: {
31647
31655
  width: "100%",
@@ -31679,14 +31687,14 @@ const SingleChart = () => {
31679
31687
  tickFormatter: v => `$${v / 1000}k`,
31680
31688
  hide: true
31681
31689
  }), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, null), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
31682
- dataKey: "inc_unit",
31690
+ dataKey: "value",
31683
31691
  fill: "#CCDCDD",
31684
31692
  gap: "4px",
31685
31693
  borderRadius: [4, 4, 0, 8],
31686
31694
  barSize: 40,
31687
31695
  name: "INC Sales"
31688
31696
  }, /*#__PURE__*/React__default["default"].createElement(recharts.LabelList, {
31689
- dataKey: "inc_unit",
31697
+ dataKey: "value",
31690
31698
  position: "top",
31691
31699
  formatter: value => `$${value / 1000}k`,
31692
31700
  fill: "#212121",
@@ -31701,7 +31709,7 @@ const SingleChart = () => {
31701
31709
  endIndex: endIndex,
31702
31710
  onChange: e => {
31703
31711
  setStartIndex(e.startIndex ?? 0);
31704
- setEndIndex(e.endIndex ?? dataWithIndex.length - 1);
31712
+ setEndIndex(e.endIndex ?? dataWithIndex?.length - 1);
31705
31713
  },
31706
31714
  travellerWidth: 12
31707
31715
  })), /*#__PURE__*/React__default["default"].createElement(PerformanceAnalyticsLegend, {
@@ -31711,7 +31719,7 @@ const SingleChart = () => {
31711
31719
  title: "INC Units"
31712
31720
  }]
31713
31721
  }))));
31714
- };
31722
+ }
31715
31723
 
31716
31724
  styled__default["default"].div`
31717
31725
  display: flex;
@@ -31843,15 +31851,17 @@ const SegmentedButton = props => {
31843
31851
  }, [defaultIndex]);
31844
31852
  React$1.useEffect(() => {
31845
31853
  const activeSegmentRef = optionsRef[activeIndex].ref;
31846
- const {
31847
- offsetWidth,
31848
- offsetLeft
31849
- } = activeSegmentRef.current;
31850
- const {
31851
- style
31852
- } = controlRef.current;
31853
- style.setProperty('--highlight-width', `${offsetWidth}px`);
31854
- style.setProperty('--highlight-x-pos', `${offsetLeft}px`);
31854
+ setTimeout(() => {
31855
+ const {
31856
+ offsetWidth,
31857
+ offsetLeft
31858
+ } = activeSegmentRef.current;
31859
+ const {
31860
+ style
31861
+ } = controlRef.current;
31862
+ style.setProperty("--highlight-width", `${offsetWidth}px`);
31863
+ style.setProperty("--highlight-x-pos", `${offsetLeft}px`);
31864
+ }, 0);
31855
31865
  }, [activeIndex, controlRef, optionsRef]);
31856
31866
  const onInputChangeHandler = (value, index) => {
31857
31867
  setActiveIndex(index);
@@ -31874,14 +31884,14 @@ const SegmentedButton = props => {
31874
31884
  gap: gap,
31875
31885
  controlradius: controlradius,
31876
31886
  segmentwidth: segmentwidth,
31877
- className: `controls ${componentReady.current ? 'ready' : 'idle'}`
31887
+ className: `controls ${componentReady.current ? "ready" : "idle"}`
31878
31888
  }, optionsRef?.map((item, i) => /*#__PURE__*/React__default["default"].createElement(Segment, {
31879
31889
  id: "Segment",
31880
31890
  key: item.id,
31881
31891
  selectedsegmentcolor: selectedsegmentcolor,
31882
31892
  controlradius: controlradius,
31883
31893
  segmentwidth: segmentwidth,
31884
- className: `${activeIndex === i ? 'active' : 'inactive'}`,
31894
+ className: `${activeIndex === i ? "active" : "inactive"}`,
31885
31895
  ref: item.ref
31886
31896
  }, /*#__PURE__*/React__default["default"].createElement(ControlsInput, {
31887
31897
  type: "radio",
@@ -31895,7 +31905,7 @@ const SegmentedButton = props => {
31895
31905
  selectedtextcolor: selectedtextcolor,
31896
31906
  unselectedtextcolor: unselectedtextcolor,
31897
31907
  segmentheight: height / 5,
31898
- className: `${activeIndex === i ? 'active' : 'inactive'} `,
31908
+ className: `${activeIndex === i ? "active" : "inactive"} `,
31899
31909
  htmlFor: item.value
31900
31910
  }, item.value)))));
31901
31911
  };
@@ -31917,116 +31927,38 @@ SegmentedButton.propTypes = {
31917
31927
  onClick: PropTypes.func
31918
31928
  };
31919
31929
  SegmentedButton.defaultProps = {
31920
- name: '',
31930
+ name: "",
31921
31931
  options: [{
31922
- value: '4 w'
31932
+ value: "4 w"
31923
31933
  }, {
31924
- value: '8 w'
31934
+ value: "8 w"
31925
31935
  }, {
31926
- value: '13 w'
31936
+ value: "13 w"
31927
31937
  }],
31928
31938
  width: 120,
31929
31939
  height: 40,
31930
31940
  controlradius: 8,
31931
31941
  segmentradius: 8,
31932
- gap: '0px',
31942
+ gap: "0px",
31933
31943
  fontSize: 14,
31934
- selectedsegmentcolor: '#3a9df9',
31935
- selectedtextcolor: '#212121',
31936
- unselectedtextcolor: 'black',
31944
+ selectedsegmentcolor: "#3a9df9",
31945
+ selectedtextcolor: "#212121",
31946
+ unselectedtextcolor: "black",
31937
31947
  defaultIndex: 0,
31938
31948
  onClick: () => {}
31939
31949
  };
31940
31950
 
31941
- var css_248z = ".BarLine {\r\n font-family: sans-serif;\r\n text-align: center;\r\n }\r\n \r\n /* Make brush background darker */\r\n /* .recharts-brush .recharts-brush-slide {\r\n fill: #a52a2a !important;\r\n stroke: none;\r\n }\r\n \r\n /* Style draggable handles (travellers) */\r\n /* .recharts-brush-traveller {\r\n fill: limegreen !important; /* bright green like in the image */\r\n /* cursor: ew-resize;\r\n } */\r\n */\r\n \r\n /* Optional: center grip arrows (you can fake it with CSS) */\r\n /* .recharts-brush .recharts-brush-traveller > rect {\r\n rx: 2;\r\n ry: 2;\r\n width: 6;\r\n fill: #a52a2a !important; /* dark gray */\r\n /* } */ */\r\n */\r\n \r\n /* Remove tick labels if needed */\r\n .recharts-brush .recharts-layer text {\r\n display: none;\r\n }\r\n ";
31942
- styleInject(css_248z);
31943
-
31944
- function InnerBarChart() {
31945
- const data = [{
31946
- week: "Week 28",
31947
- total: 20000,
31948
- actual: 4000
31949
- }, {
31950
- week: "Week 29",
31951
- total: 10000,
31952
- actual: 8000
31953
- }, {
31954
- week: "Week 30",
31955
- total: 8000,
31956
- actual: 950
31957
- }, {
31958
- week: "Week 33",
31959
- total: 12000,
31960
- actual: 1000
31961
- }, {
31962
- week: "Week 36",
31963
- total: 16000,
31964
- actual: 13000
31965
- }, {
31966
- week: "Week 34",
31967
- total: 30000,
31968
- actual: 3000
31969
- }, {
31970
- week: "Week 35",
31971
- total: 8000,
31972
- actual: 950
31973
- }, {
31974
- week: "Week 37",
31975
- total: 9000,
31976
- actual: 3000
31977
- }];
31978
- const originalData = [{
31979
- label: "Vendor Selling Event: Week 28",
31980
- inc_unit: 20000,
31981
- inc_roi: 1.2
31982
- }, {
31983
- label: "Vendor Selling Event: Week 29",
31984
- inc_unit: 10000,
31985
- inc_roi: 1.2
31986
- }, {
31987
- label: "Vendor Selling Event: Week 30",
31988
- inc_unit: 8000,
31989
- inc_roi: 0.8
31990
- }, {
31991
- label: "Vendor Selling Event: Week 33",
31992
- inc_unit: 12000,
31993
- inc_roi: 1.1
31994
- }, {
31995
- label: "Vendor Selling Event: Week 36",
31996
- inc_unit: 8000,
31997
- inc_roi: 1.2
31998
- }, {
31999
- label: "Vendor Selling Event: Week 34",
32000
- inc_unit: 8000,
32001
- inc_roi: 0.7
32002
- }, {
32003
- label: "Vendor Selling Event: Week 35",
32004
- inc_unit: 8000,
32005
- inc_roi: 0.8
32006
- }, {
32007
- label: "Vendor Selling Event: Week 38",
32008
- inc_unit: 9000,
32009
- inc_roi: 1.1
32010
- }];
31951
+ function InnerBarChart({
31952
+ data
31953
+ }) {
31954
+ const processedData = data.map(item => {
31955
+ const parts = item.label.replace("Vendor Selling Event:", "").trim();
31956
+ return {
31957
+ ...item,
31958
+ shortLabel: parts
31959
+ };
31960
+ });
32011
31961
  const format = v => v >= 1000 ? `${v / 1000}K` : v;
32012
- const CustomBarLabel = ({
32013
- x,
32014
- y,
32015
- width,
32016
- payload
32017
- }) => {
32018
- if (!payload || typeof payload.total === "undefined") {
32019
- console.error("Invalid payload:", payload);
32020
- return null;
32021
- }
32022
- const centerX = x + width / 2;
32023
- return /*#__PURE__*/React__default["default"].createElement("text", {
32024
- x: centerX,
32025
- y: Math.max(y - 8, 10),
32026
- textAnchor: "middle",
32027
- fill: "black"
32028
- }, format(payload.total));
32029
- };
32030
31962
  const BarWithInner = props => {
32031
31963
  const {
32032
31964
  x,
@@ -32081,27 +32013,16 @@ function InnerBarChart() {
32081
32013
  if (!active || !payload || !payload.length) return null;
32082
32014
  const data = payload[0].payload;
32083
32015
  return /*#__PURE__*/React__default["default"].createElement("div", {
32084
- style: {
32085
- background: "white",
32086
- border: "1px solid #ccc",
32087
- padding: "10px",
32088
- borderRadius: "8px",
32089
- fontSize: "14px"
32090
- }
32091
- }, /*#__PURE__*/React__default["default"].createElement("strong", null, label), /*#__PURE__*/React__default["default"].createElement("div", null, "Actual: ", format(data.actual)), /*#__PURE__*/React__default["default"].createElement("div", null, "Total: ", format(data.total)));
32016
+ className: "bg-white border border-gray-300 p-2 rounded-lg text-sm"
32017
+ }, /*#__PURE__*/React__default["default"].createElement("strong", null, data.label), /*#__PURE__*/React__default["default"].createElement("div", null, "Actual: ", format(data.actual)), /*#__PURE__*/React__default["default"].createElement("div", null, "Total: ", format(data.total)));
32092
32018
  };
32093
- const dataWithIndex = originalData.map((item, index) => ({
32094
- ...item,
32095
- index,
32096
- shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
32097
- }));
32098
- const CustomizedTick = ({
32099
- x,
32100
- y,
32101
- payload
32102
- }) => {
32103
- const label = dataWithIndex[payload.value]?.label ?? "";
32104
- const parts = label.replace("Vendor Selling Event: ", "").split(" ");
32019
+ const CustomizedTick = props => {
32020
+ const {
32021
+ x,
32022
+ y,
32023
+ payload
32024
+ } = props;
32025
+ const labelText = payload.value.replace("Vendor Selling Event:", "").trim();
32105
32026
  return /*#__PURE__*/React__default["default"].createElement("g", {
32106
32027
  transform: `translate(${x},${y})`
32107
32028
  }, /*#__PURE__*/React__default["default"].createElement("text", {
@@ -32110,54 +32031,75 @@ function InnerBarChart() {
32110
32031
  dy: 16,
32111
32032
  textAnchor: "middle",
32112
32033
  fill: "#212121",
32113
- fontSize: 11,
32114
- fontWeight: "400",
32034
+ fontSize: 10,
32115
32035
  fontFamily: "Poppins"
32116
32036
  }, /*#__PURE__*/React__default["default"].createElement("tspan", {
32117
32037
  x: 0,
32118
- dy: 8
32119
- }, "Vendor Selling"), /*#__PURE__*/React__default["default"].createElement("tspan", {
32038
+ dy: "0.71em"
32039
+ }, "Vendor"), /*#__PURE__*/React__default["default"].createElement("tspan", {
32120
32040
  x: 0,
32121
- dy: 18
32122
- }, "Event: ", parts.join(" "))));
32041
+ dy: "1.2em"
32042
+ }, "Selling"), /*#__PURE__*/React__default["default"].createElement("tspan", {
32043
+ x: 0,
32044
+ dy: "1.2em"
32045
+ }, labelText)));
32123
32046
  };
32124
- return /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
32047
+ return /*#__PURE__*/React__default["default"].createElement("div", {
32048
+ className: "w-full"
32049
+ }, /*#__PURE__*/React__default["default"].createElement("h3", {
32050
+ className: "text-lg font-medium mb-4 text-center"
32051
+ }, "Vendor Selling Events Comparison"), /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
32125
32052
  width: "100%",
32126
- height: 400
32053
+ height: 450
32127
32054
  }, /*#__PURE__*/React__default["default"].createElement(recharts.BarChart, {
32128
- data: data,
32055
+ data: processedData,
32129
32056
  margin: {
32130
- top: 20,
32057
+ top: 30,
32131
32058
  right: 30,
32132
32059
  left: 20,
32133
- bottom: 10
32060
+ bottom: 60
32134
32061
  }
32135
32062
  }, /*#__PURE__*/React__default["default"].createElement(recharts.CartesianGrid, {
32136
32063
  strokeDasharray: "3 3",
32137
32064
  vertical: false
32138
32065
  }), /*#__PURE__*/React__default["default"].createElement(recharts.XAxis, {
32139
- dataKey: "week",
32140
- tick: /*#__PURE__*/React__default["default"].createElement(CustomizedTick, null)
32066
+ dataKey: "shortLabel",
32067
+ tick: /*#__PURE__*/React__default["default"].createElement(CustomizedTick, null),
32068
+ height: 70,
32069
+ interval: 0
32141
32070
  }), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
32142
32071
  type: "number",
32143
32072
  domain: [0, "dataMax + 2000"],
32144
- hide: true
32073
+ tickFormatter: format
32145
32074
  }), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, {
32146
32075
  content: /*#__PURE__*/React__default["default"].createElement(CustomTooltip, null)
32147
32076
  }), /*#__PURE__*/React__default["default"].createElement(recharts.Brush, {
32148
32077
  height: 30,
32149
32078
  travellerWidth: 10,
32150
- startIndex: 1,
32079
+ startIndex: 0,
32151
32080
  endIndex: 5,
32152
- y: 369
32081
+ y: 380
32153
32082
  }), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
32154
32083
  dataKey: "total",
32155
32084
  shape: /*#__PURE__*/React__default["default"].createElement(BarWithInner, null),
32156
- label: /*#__PURE__*/React__default["default"].createElement(CustomBarLabel, null),
32157
- barSize: 30
32158
- })));
32085
+ barSize: 36
32086
+ }))));
32159
32087
  }
32160
32088
 
32089
+ const Container = styled__default["default"].div`
32090
+ width: ${props => props.width};
32091
+ height: ${props => props.height};
32092
+ padding: 15px;
32093
+ display: flex;
32094
+ flex-direction: column;
32095
+ #Segment {
32096
+ width: auto;
32097
+ white-space: nowrap;
32098
+ font-size: 14px;
32099
+ font-weight: 500;
32100
+ font-family: "Poppins"
32101
+ }
32102
+ `;
32161
32103
  styled__default["default"].div`
32162
32104
  font-family: sans-serif;
32163
32105
  text-align: center;
@@ -32174,49 +32116,22 @@ styled__default["default"].div`
32174
32116
  flex-direction: column;
32175
32117
  background-color: white;
32176
32118
  `;
32177
- const Container = styled__default["default"].div`
32178
- width: 100%;
32179
- height: 100%;
32180
- display: flex;
32181
- flex-direction: column;
32182
- #Segment {
32183
- width: auto;
32184
- white-space: nowrap;
32185
- font-size: 14px;
32186
- font-weight: 500;
32187
- font-family: "Poppins"
32188
- }
32189
- `;
32190
- /* Make brush background darker */
32191
- /* .recharts-brush .recharts-brush-slide {
32192
- fill: #a52a2a !important;
32193
- stroke: none;
32194
- }
32195
-
32196
- /* Style draggable handles (travellers) */
32197
- /* .recharts-brush-traveller {
32198
- fill: limegreen !important; /* bright green like in the image */
32199
- /* cursor: ew-resize;
32200
- } */
32201
-
32202
- /* Optional: center grip arrows (you can fake it with CSS) */
32203
- /* .recharts-brush .recharts-brush-traveller > rect {
32204
- rx: 2;
32205
- ry: 2;
32206
- width: 6;
32207
- fill: #a52a2a !important; /* dark gray */
32208
- /* } */
32209
-
32210
- /* Remove tick labels if needed */
32211
- // .recharts-brush .recharts-layer text {
32212
- // display: none;
32213
- // }
32214
32119
 
32215
- const BrushChart = () => {
32120
+ const BrushChart = props => {
32121
+ const {
32122
+ width,
32123
+ height,
32124
+ data,
32125
+ barlineData,
32126
+ lineChartData
32127
+ } = props;
32216
32128
  const segmentedbuttonOptions = ["New Shoppers & Repeaters", "INC Sales & ROI", "INC Units", "Basket Lift"];
32217
32129
  const [selectedOption, setSelectedOption] = React$1.useState(segmentedbuttonOptions[0]);
32218
- return /*#__PURE__*/React__default["default"].createElement(Container, null, /*#__PURE__*/React__default["default"].createElement(SegmentedButton, {
32219
- gap: '8px',
32130
+ return /*#__PURE__*/React__default["default"].createElement(Container, {
32131
+ height: height,
32132
+ width: width
32133
+ }, /*#__PURE__*/React__default["default"].createElement(SegmentedButton, {
32134
+ gap: "8px",
32220
32135
  options: segmentedbuttonOptions.map(value => ({
32221
32136
  value
32222
32137
  })),
@@ -32226,7 +32141,15 @@ const BrushChart = () => {
32226
32141
  } = _ref;
32227
32142
  return setSelectedOption(value);
32228
32143
  }
32229
- }), selectedOption === "New Shoppers & Repeaters" && /*#__PURE__*/React__default["default"].createElement(InnerBarChart, null), selectedOption === "INC Sales & ROI" && /*#__PURE__*/React__default["default"].createElement(SeparatedLineBarChart, null), selectedOption === "INC Units" && /*#__PURE__*/React__default["default"].createElement(SingleChart, null), selectedOption === "Basket Lift" && /*#__PURE__*/React__default["default"].createElement(SingleChart, null));
32144
+ }), selectedOption === "New Shoppers & Repeaters" && /*#__PURE__*/React__default["default"].createElement(InnerBarChart, {
32145
+ data: data
32146
+ }), selectedOption === "INC Sales & ROI" && /*#__PURE__*/React__default["default"].createElement(SeparatedLineBarChart, {
32147
+ barlineData: barlineData
32148
+ }), selectedOption === "INC Units" && /*#__PURE__*/React__default["default"].createElement(SingleChart, {
32149
+ lineChartData: lineChartData
32150
+ }), selectedOption === "Basket Lift" && /*#__PURE__*/React__default["default"].createElement(SingleChart, {
32151
+ lineChartData: lineChartData
32152
+ }));
32230
32153
  };
32231
32154
 
32232
32155
  exports.AreaChart = AreaChart;