sag_components 2.0.0-beta54 → 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.d.ts +1 -1
- package/dist/index.esm.js +393 -469
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +393 -469
- package/dist/index.js.map +1 -1
- package/dist/types/components/BrushChart/BrushChart.d.ts +1 -1
- package/dist/types/components/BrushChart/BrushChart.style.d.ts +1 -1
- package/dist/types/components/BrushChart/Charts/BarLine.d.ts +3 -1
- package/dist/types/components/BrushChart/Charts/InnerBar.d.ts +3 -1
- package/dist/types/components/BrushChart/Charts/SingleChart.d.ts +3 -2
- package/dist/types/components/InsightsCarousel/InsightsCarousel.d.ts +10 -0
- package/dist/types/components/InsightsCarousel/InsightsCarousel.stories.d.ts +48 -0
- package/dist/types/components/InsightsCarousel/InsightsCarousel.style.d.ts +12 -0
- package/dist/types/icons/ChervronLeftIcon.d.ts +5 -1
- package/dist/types/icons/ChervronRightIcon.d.ts +5 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -9484,70 +9484,67 @@ const DropdownMain = styled.div`
|
|
|
9484
9484
|
`;
|
|
9485
9485
|
|
|
9486
9486
|
/* eslint-disable react/prop-types */
|
|
9487
|
-
const DropdownNew =
|
|
9488
|
-
|
|
9489
|
-
|
|
9490
|
-
|
|
9491
|
-
|
|
9492
|
-
|
|
9493
|
-
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
|
|
9497
|
-
|
|
9498
|
-
|
|
9499
|
-
|
|
9500
|
-
|
|
9501
|
-
|
|
9502
|
-
|
|
9503
|
-
|
|
9504
|
-
|
|
9505
|
-
|
|
9506
|
-
|
|
9507
|
-
|
|
9508
|
-
|
|
9509
|
-
|
|
9510
|
-
|
|
9511
|
-
|
|
9512
|
-
|
|
9513
|
-
|
|
9514
|
-
|
|
9515
|
-
|
|
9516
|
-
|
|
9517
|
-
|
|
9518
|
-
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9547
|
-
|
|
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,
|
|
@@ -9720,26 +9717,34 @@ const OptionsContainer$4 = styled.div`
|
|
|
9720
9717
|
padding-top: 8px;
|
|
9721
9718
|
`;
|
|
9722
9719
|
|
|
9723
|
-
const ChervronRightIcon = (
|
|
9724
|
-
width
|
|
9725
|
-
height
|
|
9720
|
+
const ChervronRightIcon = ({
|
|
9721
|
+
width = "8",
|
|
9722
|
+
height = "13",
|
|
9723
|
+
fill = "#777575"
|
|
9724
|
+
}) => /*#__PURE__*/React$1.createElement("svg", {
|
|
9725
|
+
width: width,
|
|
9726
|
+
height: height,
|
|
9726
9727
|
viewBox: "0 0 8 13",
|
|
9727
9728
|
fill: "none",
|
|
9728
9729
|
xmlns: "http://www.w3.org/2000/svg"
|
|
9729
9730
|
}, /*#__PURE__*/React$1.createElement("path", {
|
|
9730
9731
|
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",
|
|
9731
|
-
fill:
|
|
9732
|
+
fill: fill
|
|
9732
9733
|
}));
|
|
9733
9734
|
|
|
9734
|
-
const ChervronLeftIcon = (
|
|
9735
|
-
width
|
|
9736
|
-
height
|
|
9735
|
+
const ChervronLeftIcon = ({
|
|
9736
|
+
width = 7,
|
|
9737
|
+
height = 13,
|
|
9738
|
+
fill = "#777575"
|
|
9739
|
+
}) => /*#__PURE__*/React$1.createElement("svg", {
|
|
9740
|
+
width: width,
|
|
9741
|
+
height: height,
|
|
9737
9742
|
viewBox: "0 0 7 13",
|
|
9738
9743
|
fill: "none",
|
|
9739
9744
|
xmlns: "http://www.w3.org/2000/svg"
|
|
9740
9745
|
}, /*#__PURE__*/React$1.createElement("path", {
|
|
9741
9746
|
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",
|
|
9742
|
-
fill:
|
|
9747
|
+
fill: fill
|
|
9743
9748
|
}));
|
|
9744
9749
|
|
|
9745
9750
|
/* eslint-disable react/prop-types */
|
|
@@ -9961,21 +9966,20 @@ const DatePicker = ({
|
|
|
9961
9966
|
};
|
|
9962
9967
|
|
|
9963
9968
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
9964
|
-
const RangePicker =
|
|
9965
|
-
|
|
9966
|
-
|
|
9967
|
-
|
|
9968
|
-
|
|
9969
|
-
|
|
9970
|
-
|
|
9971
|
-
|
|
9972
|
-
|
|
9973
|
-
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9978
|
-
} = _ref;
|
|
9969
|
+
const RangePicker = ({
|
|
9970
|
+
label,
|
|
9971
|
+
onChange,
|
|
9972
|
+
borderRadius,
|
|
9973
|
+
required,
|
|
9974
|
+
width,
|
|
9975
|
+
height,
|
|
9976
|
+
placeholder,
|
|
9977
|
+
disabled,
|
|
9978
|
+
borderColor,
|
|
9979
|
+
borderColorFocus,
|
|
9980
|
+
textColor,
|
|
9981
|
+
selectedValue
|
|
9982
|
+
}) => {
|
|
9979
9983
|
const [isFocused, setIsFocused] = useState(false);
|
|
9980
9984
|
const [isOpen, setIsOpen] = useState(false);
|
|
9981
9985
|
const [value, setValue] = useState(''); // Added value state
|
|
@@ -10330,7 +10334,15 @@ const DateCell$1 = styled.div`
|
|
|
10330
10334
|
color: #ccc;
|
|
10331
10335
|
}
|
|
10332
10336
|
`;
|
|
10333
|
-
const
|
|
10337
|
+
const generateYearsArray$1 = (startYear, endDate) => {
|
|
10338
|
+
const years = [];
|
|
10339
|
+
const endYear = endDate.getFullYear();
|
|
10340
|
+
for (let year = startYear; year <= endYear; year++) {
|
|
10341
|
+
years.push(`${year}`);
|
|
10342
|
+
}
|
|
10343
|
+
return years;
|
|
10344
|
+
};
|
|
10345
|
+
const years$1 = generateYearsArray$1(2022, new Date());
|
|
10334
10346
|
const QuarterPopupPicker = ({
|
|
10335
10347
|
isOpen,
|
|
10336
10348
|
onChangeDate,
|
|
@@ -10408,23 +10420,22 @@ const QuarterPopupPicker = ({
|
|
|
10408
10420
|
};
|
|
10409
10421
|
|
|
10410
10422
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
10411
|
-
const QuarterPicker =
|
|
10412
|
-
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
|
|
10419
|
-
|
|
10420
|
-
|
|
10421
|
-
|
|
10422
|
-
|
|
10423
|
-
|
|
10424
|
-
|
|
10425
|
-
|
|
10426
|
-
|
|
10427
|
-
} = _ref;
|
|
10423
|
+
const QuarterPicker = ({
|
|
10424
|
+
availableQuarters,
|
|
10425
|
+
// ["Q1-2024"]
|
|
10426
|
+
label,
|
|
10427
|
+
onChange,
|
|
10428
|
+
borderRadius,
|
|
10429
|
+
required,
|
|
10430
|
+
width,
|
|
10431
|
+
height,
|
|
10432
|
+
placeholder,
|
|
10433
|
+
disabled,
|
|
10434
|
+
borderColor,
|
|
10435
|
+
borderColorFocus,
|
|
10436
|
+
textColor,
|
|
10437
|
+
selectedValue
|
|
10438
|
+
}) => {
|
|
10428
10439
|
const [isFocused, setIsFocused] = useState(false);
|
|
10429
10440
|
const [isOpen, setIsOpen] = useState(false);
|
|
10430
10441
|
const [value, setValue] = useState('');
|
|
@@ -10759,7 +10770,15 @@ const DateCell = styled.div`
|
|
|
10759
10770
|
color: #ccc;
|
|
10760
10771
|
}
|
|
10761
10772
|
`;
|
|
10762
|
-
const
|
|
10773
|
+
const generateYearsArray = (startYear, endDate) => {
|
|
10774
|
+
const years = [];
|
|
10775
|
+
const endYear = endDate.getFullYear();
|
|
10776
|
+
for (let year = startYear; year <= endYear; year++) {
|
|
10777
|
+
years.push(`${year}`);
|
|
10778
|
+
}
|
|
10779
|
+
return years;
|
|
10780
|
+
};
|
|
10781
|
+
const years = generateYearsArray(2022, new Date());
|
|
10763
10782
|
const MonthPopupPicker = ({
|
|
10764
10783
|
isOpen,
|
|
10765
10784
|
onChangeDate,
|
|
@@ -10863,22 +10882,21 @@ const MonthPopupPicker = ({
|
|
|
10863
10882
|
};
|
|
10864
10883
|
|
|
10865
10884
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
10866
|
-
const MonthPicker =
|
|
10867
|
-
|
|
10868
|
-
|
|
10869
|
-
|
|
10870
|
-
|
|
10871
|
-
|
|
10872
|
-
|
|
10873
|
-
|
|
10874
|
-
|
|
10875
|
-
|
|
10876
|
-
|
|
10877
|
-
|
|
10878
|
-
|
|
10879
|
-
|
|
10880
|
-
|
|
10881
|
-
} = _ref;
|
|
10885
|
+
const MonthPicker = ({
|
|
10886
|
+
availableMonths,
|
|
10887
|
+
label,
|
|
10888
|
+
onChange,
|
|
10889
|
+
borderRadius,
|
|
10890
|
+
required,
|
|
10891
|
+
width,
|
|
10892
|
+
height,
|
|
10893
|
+
placeholder,
|
|
10894
|
+
disabled,
|
|
10895
|
+
borderColor,
|
|
10896
|
+
borderColorFocus,
|
|
10897
|
+
textColor,
|
|
10898
|
+
selectedValue
|
|
10899
|
+
}) => {
|
|
10882
10900
|
const [isFocused, setIsFocused] = useState(false);
|
|
10883
10901
|
const [isOpen, setIsOpen] = useState(false);
|
|
10884
10902
|
const [value, setValue] = useState('');
|
|
@@ -25146,8 +25164,8 @@ function styleInject(css, ref) {
|
|
|
25146
25164
|
}
|
|
25147
25165
|
}
|
|
25148
25166
|
|
|
25149
|
-
var css_248z
|
|
25150
|
-
styleInject(css_248z
|
|
25167
|
+
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";
|
|
25168
|
+
styleInject(css_248z);
|
|
25151
25169
|
|
|
25152
25170
|
const OneColumnContainer = props => {
|
|
25153
25171
|
const {
|
|
@@ -31371,83 +31389,102 @@ const BatteryChart = props => {
|
|
|
31371
31389
|
}))))))), starText !== "" && /*#__PURE__*/React$1.createElement(StarText, null, starText));
|
|
31372
31390
|
};
|
|
31373
31391
|
|
|
31374
|
-
const originalData
|
|
31375
|
-
|
|
31376
|
-
|
|
31377
|
-
|
|
31378
|
-
},
|
|
31379
|
-
|
|
31380
|
-
|
|
31381
|
-
|
|
31382
|
-
},
|
|
31383
|
-
|
|
31384
|
-
|
|
31385
|
-
|
|
31386
|
-
|
|
31387
|
-
label: "Vendor Selling Event: Week 33",
|
|
31388
|
-
inc_unit: 12000,
|
|
31389
|
-
inc_roi: 1.1
|
|
31390
|
-
}, {
|
|
31391
|
-
label: "Vendor Selling Event: Week 36",
|
|
31392
|
-
inc_unit: 8000,
|
|
31393
|
-
inc_roi: 1.2
|
|
31394
|
-
}, {
|
|
31395
|
-
label: "Vendor Selling Event: Week 34",
|
|
31396
|
-
inc_unit: 8000,
|
|
31397
|
-
inc_roi: 0.7
|
|
31398
|
-
}, {
|
|
31399
|
-
label: "Vendor Selling Event: Week 35",
|
|
31400
|
-
inc_unit: 8000,
|
|
31401
|
-
inc_roi: 0.8
|
|
31402
|
-
}, {
|
|
31403
|
-
label: "Vendor Selling Event: Week 38",
|
|
31404
|
-
inc_unit: 9000,
|
|
31405
|
-
inc_roi: 1.1
|
|
31406
|
-
}];
|
|
31407
|
-
const dataWithIndex$1 = originalData$1.map((item, index) => ({
|
|
31408
|
-
...item,
|
|
31409
|
-
index,
|
|
31410
|
-
shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
|
|
31411
|
-
}));
|
|
31412
|
-
const CustomizedTick$1 = ({
|
|
31413
|
-
x,
|
|
31414
|
-
y,
|
|
31415
|
-
payload
|
|
31392
|
+
// const originalData = [
|
|
31393
|
+
// { label: "Vendor Selling Event: Week 34", inc_sales: 20000, inc_roi: 1.2 },
|
|
31394
|
+
// { label: "Vendor Selling Event: Week 36", inc_sales: 10000, inc_roi: 1.2 },
|
|
31395
|
+
// { label: "Vendor Selling Event: Week 38", inc_sales: 8000, inc_roi: 0.8 },
|
|
31396
|
+
// { label: "Vendor Selling Event: Week 33", inc_sales: 12000, inc_roi: 1.1 },
|
|
31397
|
+
// { label: "Vendor Selling Event: Week 29", inc_sales: 8000, inc_roi: 1.2 },
|
|
31398
|
+
// { label: "Vendor Selling Event: Week 28", inc_sales: 8000, inc_roi: 0.7 },
|
|
31399
|
+
// { label: "Vendor Selling Event: Week 35", inc_sales: 8000, inc_roi: 0.8 },
|
|
31400
|
+
// { label: "Vendor Selling Event: Week 30", inc_sales: 9000, inc_roi: 1.1 },
|
|
31401
|
+
// ];
|
|
31402
|
+
|
|
31403
|
+
const SeparatedLineBarChart = ({
|
|
31404
|
+
barlineData
|
|
31416
31405
|
}) => {
|
|
31417
|
-
|
|
31418
|
-
const
|
|
31419
|
-
|
|
31420
|
-
|
|
31421
|
-
|
|
31422
|
-
|
|
31423
|
-
|
|
31424
|
-
|
|
31425
|
-
|
|
31426
|
-
|
|
31427
|
-
|
|
31428
|
-
|
|
31429
|
-
|
|
31430
|
-
|
|
31431
|
-
|
|
31432
|
-
|
|
31433
|
-
}
|
|
31434
|
-
|
|
31435
|
-
|
|
31436
|
-
|
|
31437
|
-
|
|
31438
|
-
|
|
31439
|
-
|
|
31440
|
-
|
|
31441
|
-
|
|
31442
|
-
|
|
31443
|
-
|
|
31444
|
-
|
|
31445
|
-
|
|
31446
|
-
|
|
31406
|
+
// Sort the data by week number extracted from the label
|
|
31407
|
+
const sortedData = barlineData?.sort((a, b) => {
|
|
31408
|
+
const weekA = parseInt(a.label.match(/Week (\d+)/)[1], 10);
|
|
31409
|
+
const weekB = parseInt(b.label.match(/Week (\d+)/)[1], 10);
|
|
31410
|
+
return weekA - weekB;
|
|
31411
|
+
});
|
|
31412
|
+
const dataWithIndex = sortedData.map((item, index) => ({
|
|
31413
|
+
...item,
|
|
31414
|
+
index,
|
|
31415
|
+
shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
|
|
31416
|
+
}));
|
|
31417
|
+
const CustomizedTick = ({
|
|
31418
|
+
x,
|
|
31419
|
+
y,
|
|
31420
|
+
payload,
|
|
31421
|
+
viewableIndices
|
|
31422
|
+
}) => {
|
|
31423
|
+
const label = dataWithIndex[payload.value]?.label ?? "";
|
|
31424
|
+
const parts = label.replace("Vendor Selling Event: ", "").split(" ");
|
|
31425
|
+
if (!viewableIndices.includes(payload.value)) {
|
|
31426
|
+
return null;
|
|
31427
|
+
}
|
|
31428
|
+
return /*#__PURE__*/React$1.createElement("g", {
|
|
31429
|
+
transform: `translate(${x},${y})`
|
|
31430
|
+
}, /*#__PURE__*/React$1.createElement("text", {
|
|
31431
|
+
x: 0,
|
|
31432
|
+
y: 0,
|
|
31433
|
+
dy: 16,
|
|
31434
|
+
textAnchor: "middle",
|
|
31435
|
+
fill: "#212121",
|
|
31436
|
+
fontSize: 11,
|
|
31437
|
+
fontWeight: "400",
|
|
31438
|
+
fontFamily: "Poppins"
|
|
31439
|
+
}, /*#__PURE__*/React$1.createElement("tspan", {
|
|
31440
|
+
x: 0,
|
|
31441
|
+
dy: 8
|
|
31442
|
+
}, "Vendor Selling"), /*#__PURE__*/React$1.createElement("tspan", {
|
|
31443
|
+
x: 0,
|
|
31444
|
+
dy: 18
|
|
31445
|
+
}, "Event: ", parts.join(" "))));
|
|
31446
|
+
};
|
|
31447
|
+
const CustomLabelListFilter = props => {
|
|
31448
|
+
const {
|
|
31449
|
+
viewableIndices,
|
|
31450
|
+
dataKey,
|
|
31451
|
+
position,
|
|
31452
|
+
formatter,
|
|
31453
|
+
fill,
|
|
31454
|
+
fontSize,
|
|
31455
|
+
fontWeight,
|
|
31456
|
+
fontFamily
|
|
31457
|
+
} = props;
|
|
31458
|
+
return /*#__PURE__*/React$1.createElement(LabelList, {
|
|
31459
|
+
dataKey: dataKey,
|
|
31460
|
+
position: position,
|
|
31461
|
+
formatter: (value, name, props) => {
|
|
31462
|
+
if (!viewableIndices.includes(props.index)) {
|
|
31463
|
+
return "";
|
|
31464
|
+
}
|
|
31465
|
+
return formatter ? formatter(value) : value;
|
|
31466
|
+
},
|
|
31467
|
+
fill: fill || "#212121",
|
|
31468
|
+
fontSize: fontSize || 12,
|
|
31469
|
+
fontWeight: fontWeight || "400",
|
|
31470
|
+
fontFamily: fontFamily || "Poppins"
|
|
31471
|
+
});
|
|
31472
|
+
};
|
|
31473
|
+
const chartMargins = {
|
|
31474
|
+
top: 15,
|
|
31475
|
+
right: 40,
|
|
31476
|
+
left: 20,
|
|
31477
|
+
bottom: 40
|
|
31478
|
+
};
|
|
31447
31479
|
const [viewWindow, setViewWindow] = useState({
|
|
31448
31480
|
startIndex: 0,
|
|
31449
|
-
endIndex: dataWithIndex
|
|
31481
|
+
endIndex: dataWithIndex.length - 1
|
|
31450
31482
|
});
|
|
31483
|
+
const viewableIndices = [];
|
|
31484
|
+
for (let i = viewWindow.startIndex; i <= viewWindow.endIndex; i++) {
|
|
31485
|
+
viewableIndices.push(i);
|
|
31486
|
+
}
|
|
31487
|
+
dataWithIndex.filter(item => viewableIndices.includes(item.index));
|
|
31451
31488
|
return /*#__PURE__*/React$1.createElement("div", {
|
|
31452
31489
|
style: {
|
|
31453
31490
|
width: "100%",
|
|
@@ -31461,8 +31498,7 @@ const SeparatedLineBarChart = () => {
|
|
|
31461
31498
|
width: "100%",
|
|
31462
31499
|
height: "100%"
|
|
31463
31500
|
}, /*#__PURE__*/React$1.createElement(LineChart, {
|
|
31464
|
-
data: dataWithIndex
|
|
31465
|
-
,
|
|
31501
|
+
data: dataWithIndex,
|
|
31466
31502
|
margin: chartMargins
|
|
31467
31503
|
}, /*#__PURE__*/React$1.createElement(CartesianGrid, {
|
|
31468
31504
|
strokeDasharray: "3 3",
|
|
@@ -31490,10 +31526,11 @@ const SeparatedLineBarChart = () => {
|
|
|
31490
31526
|
},
|
|
31491
31527
|
activeDot: false,
|
|
31492
31528
|
name: "INC Sales ROI"
|
|
31493
|
-
}, /*#__PURE__*/React$1.createElement(
|
|
31529
|
+
}, /*#__PURE__*/React$1.createElement(CustomLabelListFilter, {
|
|
31494
31530
|
dataKey: "inc_roi",
|
|
31495
31531
|
position: "top",
|
|
31496
|
-
formatter: value => value.toFixed(1)
|
|
31532
|
+
formatter: value => value.toFixed(1),
|
|
31533
|
+
viewableIndices: viewableIndices
|
|
31497
31534
|
}))))), /*#__PURE__*/React$1.createElement("div", {
|
|
31498
31535
|
style: {
|
|
31499
31536
|
height: "60%"
|
|
@@ -31502,7 +31539,7 @@ const SeparatedLineBarChart = () => {
|
|
|
31502
31539
|
width: "100%",
|
|
31503
31540
|
height: "100%"
|
|
31504
31541
|
}, /*#__PURE__*/React$1.createElement(ComposedChart, {
|
|
31505
|
-
data: dataWithIndex
|
|
31542
|
+
data: dataWithIndex,
|
|
31506
31543
|
margin: chartMargins
|
|
31507
31544
|
}, /*#__PURE__*/React$1.createElement(CartesianGrid, {
|
|
31508
31545
|
strokeDasharray: "3 3",
|
|
@@ -31515,30 +31552,28 @@ const SeparatedLineBarChart = () => {
|
|
|
31515
31552
|
left: 20,
|
|
31516
31553
|
right: 20
|
|
31517
31554
|
},
|
|
31518
|
-
tick: /*#__PURE__*/React$1.createElement(CustomizedTick
|
|
31519
|
-
|
|
31520
|
-
,
|
|
31555
|
+
tick: props => /*#__PURE__*/React$1.createElement(CustomizedTick, _extends({}, props, {
|
|
31556
|
+
viewableIndices: viewableIndices
|
|
31557
|
+
})),
|
|
31558
|
+
interval: 0,
|
|
31521
31559
|
height: 60,
|
|
31522
31560
|
tickLine: false,
|
|
31523
|
-
ticks: dataWithIndex
|
|
31561
|
+
ticks: dataWithIndex.map(item => item.index)
|
|
31524
31562
|
}), /*#__PURE__*/React$1.createElement(YAxis, {
|
|
31525
|
-
tickFormatter: v =>
|
|
31563
|
+
tickFormatter: v => `${v / 1000}k`,
|
|
31526
31564
|
hide: true
|
|
31527
31565
|
}), /*#__PURE__*/React$1.createElement(Tooltip$2, null), /*#__PURE__*/React$1.createElement(Bar, {
|
|
31528
|
-
dataKey: "
|
|
31566
|
+
dataKey: "inc_sales",
|
|
31529
31567
|
fill: "#CCDCDD",
|
|
31530
31568
|
gap: "4px",
|
|
31531
31569
|
borderRadius: [4, 4, 0, 8],
|
|
31532
31570
|
barSize: 40,
|
|
31533
31571
|
name: "INC Sales"
|
|
31534
|
-
}, /*#__PURE__*/React$1.createElement(
|
|
31535
|
-
dataKey: "
|
|
31572
|
+
}, /*#__PURE__*/React$1.createElement(CustomLabelListFilter, {
|
|
31573
|
+
dataKey: "inc_sales",
|
|
31536
31574
|
position: "top",
|
|
31537
|
-
formatter: value =>
|
|
31538
|
-
|
|
31539
|
-
fontSize: 12,
|
|
31540
|
-
fontWeight: "400",
|
|
31541
|
-
fontFamily: "Poppins"
|
|
31575
|
+
formatter: value => `${value / 1000}k`,
|
|
31576
|
+
viewableIndices: viewableIndices
|
|
31542
31577
|
})), /*#__PURE__*/React$1.createElement(Brush, {
|
|
31543
31578
|
dataKey: "index",
|
|
31544
31579
|
height: 30,
|
|
@@ -31548,7 +31583,7 @@ const SeparatedLineBarChart = () => {
|
|
|
31548
31583
|
onChange: e => {
|
|
31549
31584
|
setViewWindow({
|
|
31550
31585
|
startIndex: e.startIndex ?? 0,
|
|
31551
|
-
endIndex: e.endIndex ?? dataWithIndex
|
|
31586
|
+
endIndex: e.endIndex ?? dataWithIndex.length - 1
|
|
31552
31587
|
});
|
|
31553
31588
|
},
|
|
31554
31589
|
travellerWidth: 12
|
|
@@ -31569,68 +31604,42 @@ const SeparatedLineBarChart = () => {
|
|
|
31569
31604
|
})))));
|
|
31570
31605
|
};
|
|
31571
31606
|
|
|
31572
|
-
|
|
31573
|
-
|
|
31574
|
-
|
|
31575
|
-
|
|
31576
|
-
|
|
31577
|
-
|
|
31578
|
-
|
|
31579
|
-
|
|
31580
|
-
|
|
31581
|
-
|
|
31582
|
-
|
|
31583
|
-
|
|
31584
|
-
}
|
|
31585
|
-
|
|
31586
|
-
|
|
31587
|
-
|
|
31588
|
-
|
|
31589
|
-
|
|
31590
|
-
|
|
31591
|
-
|
|
31592
|
-
|
|
31593
|
-
|
|
31594
|
-
|
|
31595
|
-
|
|
31596
|
-
|
|
31597
|
-
|
|
31598
|
-
|
|
31599
|
-
|
|
31600
|
-
|
|
31601
|
-
|
|
31602
|
-
|
|
31603
|
-
|
|
31604
|
-
|
|
31605
|
-
|
|
31606
|
-
y,
|
|
31607
|
-
payload
|
|
31608
|
-
}) => {
|
|
31609
|
-
const label = dataWithIndex[payload.value]?.label ?? "";
|
|
31610
|
-
const parts = label.replace("Vendor Selling Event: ", "").split(" ");
|
|
31611
|
-
return /*#__PURE__*/React$1.createElement("g", {
|
|
31612
|
-
transform: `translate(${x},${y})`
|
|
31613
|
-
}, /*#__PURE__*/React$1.createElement("text", {
|
|
31614
|
-
x: 0,
|
|
31615
|
-
y: 0,
|
|
31616
|
-
dy: 16,
|
|
31617
|
-
textAnchor: "middle",
|
|
31618
|
-
fill: "#212121",
|
|
31619
|
-
fontSize: 11,
|
|
31620
|
-
fontWeight: "400",
|
|
31621
|
-
fontFamily: "Poppins"
|
|
31622
|
-
}, /*#__PURE__*/React$1.createElement("tspan", {
|
|
31623
|
-
x: 0,
|
|
31624
|
-
dy: 8
|
|
31625
|
-
}, "Vendor Selling"), /*#__PURE__*/React$1.createElement("tspan", {
|
|
31626
|
-
x: 0,
|
|
31627
|
-
dy: 18
|
|
31628
|
-
}, "Event: ", parts.join(" "))));
|
|
31629
|
-
};
|
|
31630
|
-
const SingleChart = () => {
|
|
31607
|
+
function SingleChart({
|
|
31608
|
+
lineChartData
|
|
31609
|
+
}) {
|
|
31610
|
+
const dataWithIndex = lineChartData?.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$1.createElement("g", {
|
|
31623
|
+
transform: `translate(${x},${y})`
|
|
31624
|
+
}, /*#__PURE__*/React$1.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$1.createElement("tspan", {
|
|
31634
|
+
x: 0,
|
|
31635
|
+
dy: 8
|
|
31636
|
+
}, "Vendor Selling"), /*#__PURE__*/React$1.createElement("tspan", {
|
|
31637
|
+
x: 0,
|
|
31638
|
+
dy: 18
|
|
31639
|
+
}, "Event: ", parts.join(" "))));
|
|
31640
|
+
};
|
|
31631
31641
|
const [startIndex, setStartIndex] = useState(0);
|
|
31632
|
-
const [endIndex, setEndIndex] = useState(dataWithIndex
|
|
31633
|
-
dataWithIndex.slice(startIndex, endIndex + 1);
|
|
31642
|
+
const [endIndex, setEndIndex] = useState(dataWithIndex?.length - 1);
|
|
31634
31643
|
return /*#__PURE__*/React$1.createElement("div", {
|
|
31635
31644
|
style: {
|
|
31636
31645
|
width: "100%",
|
|
@@ -31668,14 +31677,14 @@ const SingleChart = () => {
|
|
|
31668
31677
|
tickFormatter: v => `$${v / 1000}k`,
|
|
31669
31678
|
hide: true
|
|
31670
31679
|
}), /*#__PURE__*/React$1.createElement(Tooltip$2, null), /*#__PURE__*/React$1.createElement(Bar, {
|
|
31671
|
-
dataKey: "
|
|
31680
|
+
dataKey: "value",
|
|
31672
31681
|
fill: "#CCDCDD",
|
|
31673
31682
|
gap: "4px",
|
|
31674
31683
|
borderRadius: [4, 4, 0, 8],
|
|
31675
31684
|
barSize: 40,
|
|
31676
31685
|
name: "INC Sales"
|
|
31677
31686
|
}, /*#__PURE__*/React$1.createElement(LabelList, {
|
|
31678
|
-
dataKey: "
|
|
31687
|
+
dataKey: "value",
|
|
31679
31688
|
position: "top",
|
|
31680
31689
|
formatter: value => `$${value / 1000}k`,
|
|
31681
31690
|
fill: "#212121",
|
|
@@ -31690,7 +31699,7 @@ const SingleChart = () => {
|
|
|
31690
31699
|
endIndex: endIndex,
|
|
31691
31700
|
onChange: e => {
|
|
31692
31701
|
setStartIndex(e.startIndex ?? 0);
|
|
31693
|
-
setEndIndex(e.endIndex ?? dataWithIndex
|
|
31702
|
+
setEndIndex(e.endIndex ?? dataWithIndex?.length - 1);
|
|
31694
31703
|
},
|
|
31695
31704
|
travellerWidth: 12
|
|
31696
31705
|
})), /*#__PURE__*/React$1.createElement(PerformanceAnalyticsLegend, {
|
|
@@ -31700,7 +31709,7 @@ const SingleChart = () => {
|
|
|
31700
31709
|
title: "INC Units"
|
|
31701
31710
|
}]
|
|
31702
31711
|
}))));
|
|
31703
|
-
}
|
|
31712
|
+
}
|
|
31704
31713
|
|
|
31705
31714
|
styled.div`
|
|
31706
31715
|
display: flex;
|
|
@@ -31832,15 +31841,17 @@ const SegmentedButton = props => {
|
|
|
31832
31841
|
}, [defaultIndex]);
|
|
31833
31842
|
useEffect(() => {
|
|
31834
31843
|
const activeSegmentRef = optionsRef[activeIndex].ref;
|
|
31835
|
-
|
|
31836
|
-
|
|
31837
|
-
|
|
31838
|
-
|
|
31839
|
-
|
|
31840
|
-
|
|
31841
|
-
|
|
31842
|
-
|
|
31843
|
-
|
|
31844
|
+
setTimeout(() => {
|
|
31845
|
+
const {
|
|
31846
|
+
offsetWidth,
|
|
31847
|
+
offsetLeft
|
|
31848
|
+
} = activeSegmentRef.current;
|
|
31849
|
+
const {
|
|
31850
|
+
style
|
|
31851
|
+
} = controlRef.current;
|
|
31852
|
+
style.setProperty("--highlight-width", `${offsetWidth}px`);
|
|
31853
|
+
style.setProperty("--highlight-x-pos", `${offsetLeft}px`);
|
|
31854
|
+
}, 0);
|
|
31844
31855
|
}, [activeIndex, controlRef, optionsRef]);
|
|
31845
31856
|
const onInputChangeHandler = (value, index) => {
|
|
31846
31857
|
setActiveIndex(index);
|
|
@@ -31863,14 +31874,14 @@ const SegmentedButton = props => {
|
|
|
31863
31874
|
gap: gap,
|
|
31864
31875
|
controlradius: controlradius,
|
|
31865
31876
|
segmentwidth: segmentwidth,
|
|
31866
|
-
className: `controls ${componentReady.current ?
|
|
31877
|
+
className: `controls ${componentReady.current ? "ready" : "idle"}`
|
|
31867
31878
|
}, optionsRef?.map((item, i) => /*#__PURE__*/React$1.createElement(Segment, {
|
|
31868
31879
|
id: "Segment",
|
|
31869
31880
|
key: item.id,
|
|
31870
31881
|
selectedsegmentcolor: selectedsegmentcolor,
|
|
31871
31882
|
controlradius: controlradius,
|
|
31872
31883
|
segmentwidth: segmentwidth,
|
|
31873
|
-
className: `${activeIndex === i ?
|
|
31884
|
+
className: `${activeIndex === i ? "active" : "inactive"}`,
|
|
31874
31885
|
ref: item.ref
|
|
31875
31886
|
}, /*#__PURE__*/React$1.createElement(ControlsInput, {
|
|
31876
31887
|
type: "radio",
|
|
@@ -31884,7 +31895,7 @@ const SegmentedButton = props => {
|
|
|
31884
31895
|
selectedtextcolor: selectedtextcolor,
|
|
31885
31896
|
unselectedtextcolor: unselectedtextcolor,
|
|
31886
31897
|
segmentheight: height / 5,
|
|
31887
|
-
className: `${activeIndex === i ?
|
|
31898
|
+
className: `${activeIndex === i ? "active" : "inactive"} `,
|
|
31888
31899
|
htmlFor: item.value
|
|
31889
31900
|
}, item.value)))));
|
|
31890
31901
|
};
|
|
@@ -31906,116 +31917,38 @@ SegmentedButton.propTypes = {
|
|
|
31906
31917
|
onClick: PropTypes.func
|
|
31907
31918
|
};
|
|
31908
31919
|
SegmentedButton.defaultProps = {
|
|
31909
|
-
name:
|
|
31920
|
+
name: "",
|
|
31910
31921
|
options: [{
|
|
31911
|
-
value:
|
|
31922
|
+
value: "4 w"
|
|
31912
31923
|
}, {
|
|
31913
|
-
value:
|
|
31924
|
+
value: "8 w"
|
|
31914
31925
|
}, {
|
|
31915
|
-
value:
|
|
31926
|
+
value: "13 w"
|
|
31916
31927
|
}],
|
|
31917
31928
|
width: 120,
|
|
31918
31929
|
height: 40,
|
|
31919
31930
|
controlradius: 8,
|
|
31920
31931
|
segmentradius: 8,
|
|
31921
|
-
gap:
|
|
31932
|
+
gap: "0px",
|
|
31922
31933
|
fontSize: 14,
|
|
31923
|
-
selectedsegmentcolor:
|
|
31924
|
-
selectedtextcolor:
|
|
31925
|
-
unselectedtextcolor:
|
|
31934
|
+
selectedsegmentcolor: "#3a9df9",
|
|
31935
|
+
selectedtextcolor: "#212121",
|
|
31936
|
+
unselectedtextcolor: "black",
|
|
31926
31937
|
defaultIndex: 0,
|
|
31927
31938
|
onClick: () => {}
|
|
31928
31939
|
};
|
|
31929
31940
|
|
|
31930
|
-
|
|
31931
|
-
|
|
31932
|
-
|
|
31933
|
-
|
|
31934
|
-
|
|
31935
|
-
|
|
31936
|
-
|
|
31937
|
-
|
|
31938
|
-
|
|
31939
|
-
|
|
31940
|
-
total: 10000,
|
|
31941
|
-
actual: 8000
|
|
31942
|
-
}, {
|
|
31943
|
-
week: "Week 30",
|
|
31944
|
-
total: 8000,
|
|
31945
|
-
actual: 950
|
|
31946
|
-
}, {
|
|
31947
|
-
week: "Week 33",
|
|
31948
|
-
total: 12000,
|
|
31949
|
-
actual: 1000
|
|
31950
|
-
}, {
|
|
31951
|
-
week: "Week 36",
|
|
31952
|
-
total: 16000,
|
|
31953
|
-
actual: 13000
|
|
31954
|
-
}, {
|
|
31955
|
-
week: "Week 34",
|
|
31956
|
-
total: 30000,
|
|
31957
|
-
actual: 3000
|
|
31958
|
-
}, {
|
|
31959
|
-
week: "Week 35",
|
|
31960
|
-
total: 8000,
|
|
31961
|
-
actual: 950
|
|
31962
|
-
}, {
|
|
31963
|
-
week: "Week 37",
|
|
31964
|
-
total: 9000,
|
|
31965
|
-
actual: 3000
|
|
31966
|
-
}];
|
|
31967
|
-
const originalData = [{
|
|
31968
|
-
label: "Vendor Selling Event: Week 28",
|
|
31969
|
-
inc_unit: 20000,
|
|
31970
|
-
inc_roi: 1.2
|
|
31971
|
-
}, {
|
|
31972
|
-
label: "Vendor Selling Event: Week 29",
|
|
31973
|
-
inc_unit: 10000,
|
|
31974
|
-
inc_roi: 1.2
|
|
31975
|
-
}, {
|
|
31976
|
-
label: "Vendor Selling Event: Week 30",
|
|
31977
|
-
inc_unit: 8000,
|
|
31978
|
-
inc_roi: 0.8
|
|
31979
|
-
}, {
|
|
31980
|
-
label: "Vendor Selling Event: Week 33",
|
|
31981
|
-
inc_unit: 12000,
|
|
31982
|
-
inc_roi: 1.1
|
|
31983
|
-
}, {
|
|
31984
|
-
label: "Vendor Selling Event: Week 36",
|
|
31985
|
-
inc_unit: 8000,
|
|
31986
|
-
inc_roi: 1.2
|
|
31987
|
-
}, {
|
|
31988
|
-
label: "Vendor Selling Event: Week 34",
|
|
31989
|
-
inc_unit: 8000,
|
|
31990
|
-
inc_roi: 0.7
|
|
31991
|
-
}, {
|
|
31992
|
-
label: "Vendor Selling Event: Week 35",
|
|
31993
|
-
inc_unit: 8000,
|
|
31994
|
-
inc_roi: 0.8
|
|
31995
|
-
}, {
|
|
31996
|
-
label: "Vendor Selling Event: Week 38",
|
|
31997
|
-
inc_unit: 9000,
|
|
31998
|
-
inc_roi: 1.1
|
|
31999
|
-
}];
|
|
31941
|
+
function InnerBarChart({
|
|
31942
|
+
data
|
|
31943
|
+
}) {
|
|
31944
|
+
const processedData = data.map(item => {
|
|
31945
|
+
const parts = item.label.replace("Vendor Selling Event:", "").trim();
|
|
31946
|
+
return {
|
|
31947
|
+
...item,
|
|
31948
|
+
shortLabel: parts
|
|
31949
|
+
};
|
|
31950
|
+
});
|
|
32000
31951
|
const format = v => v >= 1000 ? `${v / 1000}K` : v;
|
|
32001
|
-
const CustomBarLabel = ({
|
|
32002
|
-
x,
|
|
32003
|
-
y,
|
|
32004
|
-
width,
|
|
32005
|
-
payload
|
|
32006
|
-
}) => {
|
|
32007
|
-
if (!payload || typeof payload.total === "undefined") {
|
|
32008
|
-
console.error("Invalid payload:", payload);
|
|
32009
|
-
return null;
|
|
32010
|
-
}
|
|
32011
|
-
const centerX = x + width / 2;
|
|
32012
|
-
return /*#__PURE__*/React$1.createElement("text", {
|
|
32013
|
-
x: centerX,
|
|
32014
|
-
y: Math.max(y - 8, 10),
|
|
32015
|
-
textAnchor: "middle",
|
|
32016
|
-
fill: "black"
|
|
32017
|
-
}, format(payload.total));
|
|
32018
|
-
};
|
|
32019
31952
|
const BarWithInner = props => {
|
|
32020
31953
|
const {
|
|
32021
31954
|
x,
|
|
@@ -32070,27 +32003,16 @@ function InnerBarChart() {
|
|
|
32070
32003
|
if (!active || !payload || !payload.length) return null;
|
|
32071
32004
|
const data = payload[0].payload;
|
|
32072
32005
|
return /*#__PURE__*/React$1.createElement("div", {
|
|
32073
|
-
|
|
32074
|
-
|
|
32075
|
-
border: "1px solid #ccc",
|
|
32076
|
-
padding: "10px",
|
|
32077
|
-
borderRadius: "8px",
|
|
32078
|
-
fontSize: "14px"
|
|
32079
|
-
}
|
|
32080
|
-
}, /*#__PURE__*/React$1.createElement("strong", null, label), /*#__PURE__*/React$1.createElement("div", null, "Actual: ", format(data.actual)), /*#__PURE__*/React$1.createElement("div", null, "Total: ", format(data.total)));
|
|
32006
|
+
className: "bg-white border border-gray-300 p-2 rounded-lg text-sm"
|
|
32007
|
+
}, /*#__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)));
|
|
32081
32008
|
};
|
|
32082
|
-
const
|
|
32083
|
-
|
|
32084
|
-
|
|
32085
|
-
|
|
32086
|
-
|
|
32087
|
-
|
|
32088
|
-
|
|
32089
|
-
y,
|
|
32090
|
-
payload
|
|
32091
|
-
}) => {
|
|
32092
|
-
const label = dataWithIndex[payload.value]?.label ?? "";
|
|
32093
|
-
const parts = label.replace("Vendor Selling Event: ", "").split(" ");
|
|
32009
|
+
const CustomizedTick = props => {
|
|
32010
|
+
const {
|
|
32011
|
+
x,
|
|
32012
|
+
y,
|
|
32013
|
+
payload
|
|
32014
|
+
} = props;
|
|
32015
|
+
const labelText = payload.value.replace("Vendor Selling Event:", "").trim();
|
|
32094
32016
|
return /*#__PURE__*/React$1.createElement("g", {
|
|
32095
32017
|
transform: `translate(${x},${y})`
|
|
32096
32018
|
}, /*#__PURE__*/React$1.createElement("text", {
|
|
@@ -32099,54 +32021,75 @@ function InnerBarChart() {
|
|
|
32099
32021
|
dy: 16,
|
|
32100
32022
|
textAnchor: "middle",
|
|
32101
32023
|
fill: "#212121",
|
|
32102
|
-
fontSize:
|
|
32103
|
-
fontWeight: "400",
|
|
32024
|
+
fontSize: 10,
|
|
32104
32025
|
fontFamily: "Poppins"
|
|
32105
32026
|
}, /*#__PURE__*/React$1.createElement("tspan", {
|
|
32106
32027
|
x: 0,
|
|
32107
|
-
dy:
|
|
32108
|
-
}, "Vendor
|
|
32028
|
+
dy: "0.71em"
|
|
32029
|
+
}, "Vendor"), /*#__PURE__*/React$1.createElement("tspan", {
|
|
32109
32030
|
x: 0,
|
|
32110
|
-
dy:
|
|
32111
|
-
}, "
|
|
32031
|
+
dy: "1.2em"
|
|
32032
|
+
}, "Selling"), /*#__PURE__*/React$1.createElement("tspan", {
|
|
32033
|
+
x: 0,
|
|
32034
|
+
dy: "1.2em"
|
|
32035
|
+
}, labelText)));
|
|
32112
32036
|
};
|
|
32113
|
-
return /*#__PURE__*/React$1.createElement(
|
|
32037
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
32038
|
+
className: "w-full"
|
|
32039
|
+
}, /*#__PURE__*/React$1.createElement("h3", {
|
|
32040
|
+
className: "text-lg font-medium mb-4 text-center"
|
|
32041
|
+
}, "Vendor Selling Events Comparison"), /*#__PURE__*/React$1.createElement(ResponsiveContainer, {
|
|
32114
32042
|
width: "100%",
|
|
32115
|
-
height:
|
|
32043
|
+
height: 450
|
|
32116
32044
|
}, /*#__PURE__*/React$1.createElement(BarChart$1, {
|
|
32117
|
-
data:
|
|
32045
|
+
data: processedData,
|
|
32118
32046
|
margin: {
|
|
32119
|
-
top:
|
|
32047
|
+
top: 30,
|
|
32120
32048
|
right: 30,
|
|
32121
32049
|
left: 20,
|
|
32122
|
-
bottom:
|
|
32050
|
+
bottom: 60
|
|
32123
32051
|
}
|
|
32124
32052
|
}, /*#__PURE__*/React$1.createElement(CartesianGrid, {
|
|
32125
32053
|
strokeDasharray: "3 3",
|
|
32126
32054
|
vertical: false
|
|
32127
32055
|
}), /*#__PURE__*/React$1.createElement(XAxis, {
|
|
32128
|
-
dataKey: "
|
|
32129
|
-
tick: /*#__PURE__*/React$1.createElement(CustomizedTick, null)
|
|
32056
|
+
dataKey: "shortLabel",
|
|
32057
|
+
tick: /*#__PURE__*/React$1.createElement(CustomizedTick, null),
|
|
32058
|
+
height: 70,
|
|
32059
|
+
interval: 0
|
|
32130
32060
|
}), /*#__PURE__*/React$1.createElement(YAxis, {
|
|
32131
32061
|
type: "number",
|
|
32132
32062
|
domain: [0, "dataMax + 2000"],
|
|
32133
|
-
|
|
32063
|
+
tickFormatter: format
|
|
32134
32064
|
}), /*#__PURE__*/React$1.createElement(Tooltip$2, {
|
|
32135
32065
|
content: /*#__PURE__*/React$1.createElement(CustomTooltip, null)
|
|
32136
32066
|
}), /*#__PURE__*/React$1.createElement(Brush, {
|
|
32137
32067
|
height: 30,
|
|
32138
32068
|
travellerWidth: 10,
|
|
32139
|
-
startIndex:
|
|
32069
|
+
startIndex: 0,
|
|
32140
32070
|
endIndex: 5,
|
|
32141
|
-
y:
|
|
32071
|
+
y: 380
|
|
32142
32072
|
}), /*#__PURE__*/React$1.createElement(Bar, {
|
|
32143
32073
|
dataKey: "total",
|
|
32144
32074
|
shape: /*#__PURE__*/React$1.createElement(BarWithInner, null),
|
|
32145
|
-
|
|
32146
|
-
|
|
32147
|
-
})));
|
|
32075
|
+
barSize: 36
|
|
32076
|
+
}))));
|
|
32148
32077
|
}
|
|
32149
32078
|
|
|
32079
|
+
const Container = styled.div`
|
|
32080
|
+
width: ${props => props.width};
|
|
32081
|
+
height: ${props => props.height};
|
|
32082
|
+
padding: 15px;
|
|
32083
|
+
display: flex;
|
|
32084
|
+
flex-direction: column;
|
|
32085
|
+
#Segment {
|
|
32086
|
+
width: auto;
|
|
32087
|
+
white-space: nowrap;
|
|
32088
|
+
font-size: 14px;
|
|
32089
|
+
font-weight: 500;
|
|
32090
|
+
font-family: "Poppins"
|
|
32091
|
+
}
|
|
32092
|
+
`;
|
|
32150
32093
|
styled.div`
|
|
32151
32094
|
font-family: sans-serif;
|
|
32152
32095
|
text-align: center;
|
|
@@ -32163,49 +32106,22 @@ styled.div`
|
|
|
32163
32106
|
flex-direction: column;
|
|
32164
32107
|
background-color: white;
|
|
32165
32108
|
`;
|
|
32166
|
-
const Container = styled.div`
|
|
32167
|
-
width: 100%;
|
|
32168
|
-
height: 100%;
|
|
32169
|
-
display: flex;
|
|
32170
|
-
flex-direction: column;
|
|
32171
|
-
#Segment {
|
|
32172
|
-
width: auto;
|
|
32173
|
-
white-space: nowrap;
|
|
32174
|
-
font-size: 14px;
|
|
32175
|
-
font-weight: 500;
|
|
32176
|
-
font-family: "Poppins"
|
|
32177
|
-
}
|
|
32178
|
-
`;
|
|
32179
|
-
/* Make brush background darker */
|
|
32180
|
-
/* .recharts-brush .recharts-brush-slide {
|
|
32181
|
-
fill: #a52a2a !important;
|
|
32182
|
-
stroke: none;
|
|
32183
|
-
}
|
|
32184
|
-
|
|
32185
|
-
/* Style draggable handles (travellers) */
|
|
32186
|
-
/* .recharts-brush-traveller {
|
|
32187
|
-
fill: limegreen !important; /* bright green like in the image */
|
|
32188
|
-
/* cursor: ew-resize;
|
|
32189
|
-
} */
|
|
32190
32109
|
|
|
32191
|
-
|
|
32192
|
-
|
|
32193
|
-
|
|
32194
|
-
|
|
32195
|
-
|
|
32196
|
-
|
|
32197
|
-
|
|
32198
|
-
|
|
32199
|
-
/* Remove tick labels if needed */
|
|
32200
|
-
// .recharts-brush .recharts-layer text {
|
|
32201
|
-
// display: none;
|
|
32202
|
-
// }
|
|
32203
|
-
|
|
32204
|
-
const BrushChart = () => {
|
|
32110
|
+
const BrushChart = props => {
|
|
32111
|
+
const {
|
|
32112
|
+
width,
|
|
32113
|
+
height,
|
|
32114
|
+
data,
|
|
32115
|
+
barlineData,
|
|
32116
|
+
lineChartData
|
|
32117
|
+
} = props;
|
|
32205
32118
|
const segmentedbuttonOptions = ["New Shoppers & Repeaters", "INC Sales & ROI", "INC Units", "Basket Lift"];
|
|
32206
32119
|
const [selectedOption, setSelectedOption] = useState(segmentedbuttonOptions[0]);
|
|
32207
|
-
return /*#__PURE__*/React$1.createElement(Container,
|
|
32208
|
-
|
|
32120
|
+
return /*#__PURE__*/React$1.createElement(Container, {
|
|
32121
|
+
height: height,
|
|
32122
|
+
width: width
|
|
32123
|
+
}, /*#__PURE__*/React$1.createElement(SegmentedButton, {
|
|
32124
|
+
gap: "8px",
|
|
32209
32125
|
options: segmentedbuttonOptions.map(value => ({
|
|
32210
32126
|
value
|
|
32211
32127
|
})),
|
|
@@ -32215,7 +32131,15 @@ const BrushChart = () => {
|
|
|
32215
32131
|
} = _ref;
|
|
32216
32132
|
return setSelectedOption(value);
|
|
32217
32133
|
}
|
|
32218
|
-
}), selectedOption === "New Shoppers & Repeaters" && /*#__PURE__*/React$1.createElement(InnerBarChart,
|
|
32134
|
+
}), selectedOption === "New Shoppers & Repeaters" && /*#__PURE__*/React$1.createElement(InnerBarChart, {
|
|
32135
|
+
data: data
|
|
32136
|
+
}), selectedOption === "INC Sales & ROI" && /*#__PURE__*/React$1.createElement(SeparatedLineBarChart, {
|
|
32137
|
+
barlineData: barlineData
|
|
32138
|
+
}), selectedOption === "INC Units" && /*#__PURE__*/React$1.createElement(SingleChart, {
|
|
32139
|
+
lineChartData: lineChartData
|
|
32140
|
+
}), selectedOption === "Basket Lift" && /*#__PURE__*/React$1.createElement(SingleChart, {
|
|
32141
|
+
lineChartData: lineChartData
|
|
32142
|
+
}));
|
|
32219
32143
|
};
|
|
32220
32144
|
|
|
32221
32145
|
export { AreaChart, BannerEventBoxList, BarChart, BarChartsByWeeks, BatteryChart, BreakdownPanel, BrushChart, BubbleChart, Button, CollapseHeader, DialogOverlay, DoubleBarSingleLine, DoublePanelDataRow, EventDetailsCard, EventList, FilterPanel, Heatmap, IconButton, LinkButton, LinnerDataBox, MarketShareDescription, OneColumnContainer, PerformanceAnalyticsLegend, PieChart, PopupCharts, QuickFilter, ReportTable, TabMenu, TopToggleList, TotalDoughnutChart, TotalHorizontalCharts };
|