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.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 =
|
|
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
|
-
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
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 = (
|
|
9734
|
-
width
|
|
9735
|
-
height
|
|
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:
|
|
9742
|
+
fill: fill
|
|
9742
9743
|
}));
|
|
9743
9744
|
|
|
9744
|
-
const ChervronLeftIcon = (
|
|
9745
|
-
width
|
|
9746
|
-
height
|
|
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:
|
|
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 =
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
|
|
9981
|
-
|
|
9982
|
-
|
|
9983
|
-
|
|
9984
|
-
|
|
9985
|
-
|
|
9986
|
-
|
|
9987
|
-
|
|
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
|
|
@@ -10340,7 +10344,15 @@ const DateCell$1 = styled__default["default"].div`
|
|
|
10340
10344
|
color: #ccc;
|
|
10341
10345
|
}
|
|
10342
10346
|
`;
|
|
10343
|
-
const
|
|
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());
|
|
10344
10356
|
const QuarterPopupPicker = ({
|
|
10345
10357
|
isOpen,
|
|
10346
10358
|
onChangeDate,
|
|
@@ -10418,23 +10430,22 @@ const QuarterPopupPicker = ({
|
|
|
10418
10430
|
};
|
|
10419
10431
|
|
|
10420
10432
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
10421
|
-
const QuarterPicker =
|
|
10422
|
-
|
|
10423
|
-
|
|
10424
|
-
|
|
10425
|
-
|
|
10426
|
-
|
|
10427
|
-
|
|
10428
|
-
|
|
10429
|
-
|
|
10430
|
-
|
|
10431
|
-
|
|
10432
|
-
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
|
|
10436
|
-
|
|
10437
|
-
} = _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
|
+
}) => {
|
|
10438
10449
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
10439
10450
|
const [isOpen, setIsOpen] = React$1.useState(false);
|
|
10440
10451
|
const [value, setValue] = React$1.useState('');
|
|
@@ -10769,7 +10780,15 @@ const DateCell = styled__default["default"].div`
|
|
|
10769
10780
|
color: #ccc;
|
|
10770
10781
|
}
|
|
10771
10782
|
`;
|
|
10772
|
-
const
|
|
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());
|
|
10773
10792
|
const MonthPopupPicker = ({
|
|
10774
10793
|
isOpen,
|
|
10775
10794
|
onChangeDate,
|
|
@@ -10873,22 +10892,21 @@ const MonthPopupPicker = ({
|
|
|
10873
10892
|
};
|
|
10874
10893
|
|
|
10875
10894
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
10876
|
-
const MonthPicker =
|
|
10877
|
-
|
|
10878
|
-
|
|
10879
|
-
|
|
10880
|
-
|
|
10881
|
-
|
|
10882
|
-
|
|
10883
|
-
|
|
10884
|
-
|
|
10885
|
-
|
|
10886
|
-
|
|
10887
|
-
|
|
10888
|
-
|
|
10889
|
-
|
|
10890
|
-
|
|
10891
|
-
} = _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
|
+
}) => {
|
|
10892
10910
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
10893
10911
|
const [isOpen, setIsOpen] = React$1.useState(false);
|
|
10894
10912
|
const [value, setValue] = React$1.useState('');
|
|
@@ -25156,8 +25174,8 @@ function styleInject(css, ref) {
|
|
|
25156
25174
|
}
|
|
25157
25175
|
}
|
|
25158
25176
|
|
|
25159
|
-
var css_248z
|
|
25160
|
-
styleInject(css_248z
|
|
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);
|
|
25161
25179
|
|
|
25162
25180
|
const OneColumnContainer = props => {
|
|
25163
25181
|
const {
|
|
@@ -31381,83 +31399,102 @@ const BatteryChart = props => {
|
|
|
31381
31399
|
}))))))), starText !== "" && /*#__PURE__*/React__default["default"].createElement(StarText, null, starText));
|
|
31382
31400
|
};
|
|
31383
31401
|
|
|
31384
|
-
const originalData
|
|
31385
|
-
|
|
31386
|
-
|
|
31387
|
-
|
|
31388
|
-
},
|
|
31389
|
-
|
|
31390
|
-
|
|
31391
|
-
|
|
31392
|
-
},
|
|
31393
|
-
|
|
31394
|
-
|
|
31395
|
-
|
|
31396
|
-
|
|
31397
|
-
label: "Vendor Selling Event: Week 33",
|
|
31398
|
-
inc_unit: 12000,
|
|
31399
|
-
inc_roi: 1.1
|
|
31400
|
-
}, {
|
|
31401
|
-
label: "Vendor Selling Event: Week 36",
|
|
31402
|
-
inc_unit: 8000,
|
|
31403
|
-
inc_roi: 1.2
|
|
31404
|
-
}, {
|
|
31405
|
-
label: "Vendor Selling Event: Week 34",
|
|
31406
|
-
inc_unit: 8000,
|
|
31407
|
-
inc_roi: 0.7
|
|
31408
|
-
}, {
|
|
31409
|
-
label: "Vendor Selling Event: Week 35",
|
|
31410
|
-
inc_unit: 8000,
|
|
31411
|
-
inc_roi: 0.8
|
|
31412
|
-
}, {
|
|
31413
|
-
label: "Vendor Selling Event: Week 38",
|
|
31414
|
-
inc_unit: 9000,
|
|
31415
|
-
inc_roi: 1.1
|
|
31416
|
-
}];
|
|
31417
|
-
const dataWithIndex$1 = originalData$1.map((item, index) => ({
|
|
31418
|
-
...item,
|
|
31419
|
-
index,
|
|
31420
|
-
shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
|
|
31421
|
-
}));
|
|
31422
|
-
const CustomizedTick$1 = ({
|
|
31423
|
-
x,
|
|
31424
|
-
y,
|
|
31425
|
-
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
|
|
31426
31415
|
}) => {
|
|
31427
|
-
|
|
31428
|
-
const
|
|
31429
|
-
|
|
31430
|
-
|
|
31431
|
-
|
|
31432
|
-
|
|
31433
|
-
|
|
31434
|
-
|
|
31435
|
-
|
|
31436
|
-
|
|
31437
|
-
|
|
31438
|
-
|
|
31439
|
-
|
|
31440
|
-
|
|
31441
|
-
|
|
31442
|
-
|
|
31443
|
-
}
|
|
31444
|
-
|
|
31445
|
-
|
|
31446
|
-
|
|
31447
|
-
|
|
31448
|
-
|
|
31449
|
-
|
|
31450
|
-
|
|
31451
|
-
|
|
31452
|
-
|
|
31453
|
-
|
|
31454
|
-
|
|
31455
|
-
|
|
31456
|
-
|
|
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
|
+
};
|
|
31457
31489
|
const [viewWindow, setViewWindow] = React$1.useState({
|
|
31458
31490
|
startIndex: 0,
|
|
31459
|
-
endIndex: dataWithIndex
|
|
31491
|
+
endIndex: dataWithIndex.length - 1
|
|
31460
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));
|
|
31461
31498
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
31462
31499
|
style: {
|
|
31463
31500
|
width: "100%",
|
|
@@ -31471,8 +31508,7 @@ const SeparatedLineBarChart = () => {
|
|
|
31471
31508
|
width: "100%",
|
|
31472
31509
|
height: "100%"
|
|
31473
31510
|
}, /*#__PURE__*/React__default["default"].createElement(recharts.LineChart, {
|
|
31474
|
-
data: dataWithIndex
|
|
31475
|
-
,
|
|
31511
|
+
data: dataWithIndex,
|
|
31476
31512
|
margin: chartMargins
|
|
31477
31513
|
}, /*#__PURE__*/React__default["default"].createElement(recharts.CartesianGrid, {
|
|
31478
31514
|
strokeDasharray: "3 3",
|
|
@@ -31500,10 +31536,11 @@ const SeparatedLineBarChart = () => {
|
|
|
31500
31536
|
},
|
|
31501
31537
|
activeDot: false,
|
|
31502
31538
|
name: "INC Sales ROI"
|
|
31503
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
31539
|
+
}, /*#__PURE__*/React__default["default"].createElement(CustomLabelListFilter, {
|
|
31504
31540
|
dataKey: "inc_roi",
|
|
31505
31541
|
position: "top",
|
|
31506
|
-
formatter: value => value.toFixed(1)
|
|
31542
|
+
formatter: value => value.toFixed(1),
|
|
31543
|
+
viewableIndices: viewableIndices
|
|
31507
31544
|
}))))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
31508
31545
|
style: {
|
|
31509
31546
|
height: "60%"
|
|
@@ -31512,7 +31549,7 @@ const SeparatedLineBarChart = () => {
|
|
|
31512
31549
|
width: "100%",
|
|
31513
31550
|
height: "100%"
|
|
31514
31551
|
}, /*#__PURE__*/React__default["default"].createElement(recharts.ComposedChart, {
|
|
31515
|
-
data: dataWithIndex
|
|
31552
|
+
data: dataWithIndex,
|
|
31516
31553
|
margin: chartMargins
|
|
31517
31554
|
}, /*#__PURE__*/React__default["default"].createElement(recharts.CartesianGrid, {
|
|
31518
31555
|
strokeDasharray: "3 3",
|
|
@@ -31525,30 +31562,28 @@ const SeparatedLineBarChart = () => {
|
|
|
31525
31562
|
left: 20,
|
|
31526
31563
|
right: 20
|
|
31527
31564
|
},
|
|
31528
|
-
tick: /*#__PURE__*/React__default["default"].createElement(CustomizedTick
|
|
31529
|
-
|
|
31530
|
-
,
|
|
31565
|
+
tick: props => /*#__PURE__*/React__default["default"].createElement(CustomizedTick, _extends({}, props, {
|
|
31566
|
+
viewableIndices: viewableIndices
|
|
31567
|
+
})),
|
|
31568
|
+
interval: 0,
|
|
31531
31569
|
height: 60,
|
|
31532
31570
|
tickLine: false,
|
|
31533
|
-
ticks: dataWithIndex
|
|
31571
|
+
ticks: dataWithIndex.map(item => item.index)
|
|
31534
31572
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
|
|
31535
|
-
tickFormatter: v =>
|
|
31573
|
+
tickFormatter: v => `${v / 1000}k`,
|
|
31536
31574
|
hide: true
|
|
31537
31575
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, null), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
|
|
31538
|
-
dataKey: "
|
|
31576
|
+
dataKey: "inc_sales",
|
|
31539
31577
|
fill: "#CCDCDD",
|
|
31540
31578
|
gap: "4px",
|
|
31541
31579
|
borderRadius: [4, 4, 0, 8],
|
|
31542
31580
|
barSize: 40,
|
|
31543
31581
|
name: "INC Sales"
|
|
31544
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
31545
|
-
dataKey: "
|
|
31582
|
+
}, /*#__PURE__*/React__default["default"].createElement(CustomLabelListFilter, {
|
|
31583
|
+
dataKey: "inc_sales",
|
|
31546
31584
|
position: "top",
|
|
31547
|
-
formatter: value =>
|
|
31548
|
-
|
|
31549
|
-
fontSize: 12,
|
|
31550
|
-
fontWeight: "400",
|
|
31551
|
-
fontFamily: "Poppins"
|
|
31585
|
+
formatter: value => `${value / 1000}k`,
|
|
31586
|
+
viewableIndices: viewableIndices
|
|
31552
31587
|
})), /*#__PURE__*/React__default["default"].createElement(recharts.Brush, {
|
|
31553
31588
|
dataKey: "index",
|
|
31554
31589
|
height: 30,
|
|
@@ -31558,7 +31593,7 @@ const SeparatedLineBarChart = () => {
|
|
|
31558
31593
|
onChange: e => {
|
|
31559
31594
|
setViewWindow({
|
|
31560
31595
|
startIndex: e.startIndex ?? 0,
|
|
31561
|
-
endIndex: e.endIndex ?? dataWithIndex
|
|
31596
|
+
endIndex: e.endIndex ?? dataWithIndex.length - 1
|
|
31562
31597
|
});
|
|
31563
31598
|
},
|
|
31564
31599
|
travellerWidth: 12
|
|
@@ -31579,68 +31614,42 @@ const SeparatedLineBarChart = () => {
|
|
|
31579
31614
|
})))));
|
|
31580
31615
|
};
|
|
31581
31616
|
|
|
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
|
-
|
|
31607
|
-
|
|
31608
|
-
|
|
31609
|
-
|
|
31610
|
-
|
|
31611
|
-
|
|
31612
|
-
|
|
31613
|
-
|
|
31614
|
-
|
|
31615
|
-
|
|
31616
|
-
y,
|
|
31617
|
-
payload
|
|
31618
|
-
}) => {
|
|
31619
|
-
const label = dataWithIndex[payload.value]?.label ?? "";
|
|
31620
|
-
const parts = label.replace("Vendor Selling Event: ", "").split(" ");
|
|
31621
|
-
return /*#__PURE__*/React__default["default"].createElement("g", {
|
|
31622
|
-
transform: `translate(${x},${y})`
|
|
31623
|
-
}, /*#__PURE__*/React__default["default"].createElement("text", {
|
|
31624
|
-
x: 0,
|
|
31625
|
-
y: 0,
|
|
31626
|
-
dy: 16,
|
|
31627
|
-
textAnchor: "middle",
|
|
31628
|
-
fill: "#212121",
|
|
31629
|
-
fontSize: 11,
|
|
31630
|
-
fontWeight: "400",
|
|
31631
|
-
fontFamily: "Poppins"
|
|
31632
|
-
}, /*#__PURE__*/React__default["default"].createElement("tspan", {
|
|
31633
|
-
x: 0,
|
|
31634
|
-
dy: 8
|
|
31635
|
-
}, "Vendor Selling"), /*#__PURE__*/React__default["default"].createElement("tspan", {
|
|
31636
|
-
x: 0,
|
|
31637
|
-
dy: 18
|
|
31638
|
-
}, "Event: ", parts.join(" "))));
|
|
31639
|
-
};
|
|
31640
|
-
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
|
+
};
|
|
31641
31651
|
const [startIndex, setStartIndex] = React$1.useState(0);
|
|
31642
|
-
const [endIndex, setEndIndex] = React$1.useState(dataWithIndex
|
|
31643
|
-
dataWithIndex.slice(startIndex, endIndex + 1);
|
|
31652
|
+
const [endIndex, setEndIndex] = React$1.useState(dataWithIndex?.length - 1);
|
|
31644
31653
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
31645
31654
|
style: {
|
|
31646
31655
|
width: "100%",
|
|
@@ -31678,14 +31687,14 @@ const SingleChart = () => {
|
|
|
31678
31687
|
tickFormatter: v => `$${v / 1000}k`,
|
|
31679
31688
|
hide: true
|
|
31680
31689
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, null), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
|
|
31681
|
-
dataKey: "
|
|
31690
|
+
dataKey: "value",
|
|
31682
31691
|
fill: "#CCDCDD",
|
|
31683
31692
|
gap: "4px",
|
|
31684
31693
|
borderRadius: [4, 4, 0, 8],
|
|
31685
31694
|
barSize: 40,
|
|
31686
31695
|
name: "INC Sales"
|
|
31687
31696
|
}, /*#__PURE__*/React__default["default"].createElement(recharts.LabelList, {
|
|
31688
|
-
dataKey: "
|
|
31697
|
+
dataKey: "value",
|
|
31689
31698
|
position: "top",
|
|
31690
31699
|
formatter: value => `$${value / 1000}k`,
|
|
31691
31700
|
fill: "#212121",
|
|
@@ -31700,7 +31709,7 @@ const SingleChart = () => {
|
|
|
31700
31709
|
endIndex: endIndex,
|
|
31701
31710
|
onChange: e => {
|
|
31702
31711
|
setStartIndex(e.startIndex ?? 0);
|
|
31703
|
-
setEndIndex(e.endIndex ?? dataWithIndex
|
|
31712
|
+
setEndIndex(e.endIndex ?? dataWithIndex?.length - 1);
|
|
31704
31713
|
},
|
|
31705
31714
|
travellerWidth: 12
|
|
31706
31715
|
})), /*#__PURE__*/React__default["default"].createElement(PerformanceAnalyticsLegend, {
|
|
@@ -31710,7 +31719,7 @@ const SingleChart = () => {
|
|
|
31710
31719
|
title: "INC Units"
|
|
31711
31720
|
}]
|
|
31712
31721
|
}))));
|
|
31713
|
-
}
|
|
31722
|
+
}
|
|
31714
31723
|
|
|
31715
31724
|
styled__default["default"].div`
|
|
31716
31725
|
display: flex;
|
|
@@ -31842,15 +31851,17 @@ const SegmentedButton = props => {
|
|
|
31842
31851
|
}, [defaultIndex]);
|
|
31843
31852
|
React$1.useEffect(() => {
|
|
31844
31853
|
const activeSegmentRef = optionsRef[activeIndex].ref;
|
|
31845
|
-
|
|
31846
|
-
|
|
31847
|
-
|
|
31848
|
-
|
|
31849
|
-
|
|
31850
|
-
|
|
31851
|
-
|
|
31852
|
-
|
|
31853
|
-
|
|
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);
|
|
31854
31865
|
}, [activeIndex, controlRef, optionsRef]);
|
|
31855
31866
|
const onInputChangeHandler = (value, index) => {
|
|
31856
31867
|
setActiveIndex(index);
|
|
@@ -31873,14 +31884,14 @@ const SegmentedButton = props => {
|
|
|
31873
31884
|
gap: gap,
|
|
31874
31885
|
controlradius: controlradius,
|
|
31875
31886
|
segmentwidth: segmentwidth,
|
|
31876
|
-
className: `controls ${componentReady.current ?
|
|
31887
|
+
className: `controls ${componentReady.current ? "ready" : "idle"}`
|
|
31877
31888
|
}, optionsRef?.map((item, i) => /*#__PURE__*/React__default["default"].createElement(Segment, {
|
|
31878
31889
|
id: "Segment",
|
|
31879
31890
|
key: item.id,
|
|
31880
31891
|
selectedsegmentcolor: selectedsegmentcolor,
|
|
31881
31892
|
controlradius: controlradius,
|
|
31882
31893
|
segmentwidth: segmentwidth,
|
|
31883
|
-
className: `${activeIndex === i ?
|
|
31894
|
+
className: `${activeIndex === i ? "active" : "inactive"}`,
|
|
31884
31895
|
ref: item.ref
|
|
31885
31896
|
}, /*#__PURE__*/React__default["default"].createElement(ControlsInput, {
|
|
31886
31897
|
type: "radio",
|
|
@@ -31894,7 +31905,7 @@ const SegmentedButton = props => {
|
|
|
31894
31905
|
selectedtextcolor: selectedtextcolor,
|
|
31895
31906
|
unselectedtextcolor: unselectedtextcolor,
|
|
31896
31907
|
segmentheight: height / 5,
|
|
31897
|
-
className: `${activeIndex === i ?
|
|
31908
|
+
className: `${activeIndex === i ? "active" : "inactive"} `,
|
|
31898
31909
|
htmlFor: item.value
|
|
31899
31910
|
}, item.value)))));
|
|
31900
31911
|
};
|
|
@@ -31916,116 +31927,38 @@ SegmentedButton.propTypes = {
|
|
|
31916
31927
|
onClick: PropTypes.func
|
|
31917
31928
|
};
|
|
31918
31929
|
SegmentedButton.defaultProps = {
|
|
31919
|
-
name:
|
|
31930
|
+
name: "",
|
|
31920
31931
|
options: [{
|
|
31921
|
-
value:
|
|
31932
|
+
value: "4 w"
|
|
31922
31933
|
}, {
|
|
31923
|
-
value:
|
|
31934
|
+
value: "8 w"
|
|
31924
31935
|
}, {
|
|
31925
|
-
value:
|
|
31936
|
+
value: "13 w"
|
|
31926
31937
|
}],
|
|
31927
31938
|
width: 120,
|
|
31928
31939
|
height: 40,
|
|
31929
31940
|
controlradius: 8,
|
|
31930
31941
|
segmentradius: 8,
|
|
31931
|
-
gap:
|
|
31942
|
+
gap: "0px",
|
|
31932
31943
|
fontSize: 14,
|
|
31933
|
-
selectedsegmentcolor:
|
|
31934
|
-
selectedtextcolor:
|
|
31935
|
-
unselectedtextcolor:
|
|
31944
|
+
selectedsegmentcolor: "#3a9df9",
|
|
31945
|
+
selectedtextcolor: "#212121",
|
|
31946
|
+
unselectedtextcolor: "black",
|
|
31936
31947
|
defaultIndex: 0,
|
|
31937
31948
|
onClick: () => {}
|
|
31938
31949
|
};
|
|
31939
31950
|
|
|
31940
|
-
|
|
31941
|
-
|
|
31942
|
-
|
|
31943
|
-
|
|
31944
|
-
|
|
31945
|
-
|
|
31946
|
-
|
|
31947
|
-
|
|
31948
|
-
|
|
31949
|
-
|
|
31950
|
-
total: 10000,
|
|
31951
|
-
actual: 8000
|
|
31952
|
-
}, {
|
|
31953
|
-
week: "Week 30",
|
|
31954
|
-
total: 8000,
|
|
31955
|
-
actual: 950
|
|
31956
|
-
}, {
|
|
31957
|
-
week: "Week 33",
|
|
31958
|
-
total: 12000,
|
|
31959
|
-
actual: 1000
|
|
31960
|
-
}, {
|
|
31961
|
-
week: "Week 36",
|
|
31962
|
-
total: 16000,
|
|
31963
|
-
actual: 13000
|
|
31964
|
-
}, {
|
|
31965
|
-
week: "Week 34",
|
|
31966
|
-
total: 30000,
|
|
31967
|
-
actual: 3000
|
|
31968
|
-
}, {
|
|
31969
|
-
week: "Week 35",
|
|
31970
|
-
total: 8000,
|
|
31971
|
-
actual: 950
|
|
31972
|
-
}, {
|
|
31973
|
-
week: "Week 37",
|
|
31974
|
-
total: 9000,
|
|
31975
|
-
actual: 3000
|
|
31976
|
-
}];
|
|
31977
|
-
const originalData = [{
|
|
31978
|
-
label: "Vendor Selling Event: Week 28",
|
|
31979
|
-
inc_unit: 20000,
|
|
31980
|
-
inc_roi: 1.2
|
|
31981
|
-
}, {
|
|
31982
|
-
label: "Vendor Selling Event: Week 29",
|
|
31983
|
-
inc_unit: 10000,
|
|
31984
|
-
inc_roi: 1.2
|
|
31985
|
-
}, {
|
|
31986
|
-
label: "Vendor Selling Event: Week 30",
|
|
31987
|
-
inc_unit: 8000,
|
|
31988
|
-
inc_roi: 0.8
|
|
31989
|
-
}, {
|
|
31990
|
-
label: "Vendor Selling Event: Week 33",
|
|
31991
|
-
inc_unit: 12000,
|
|
31992
|
-
inc_roi: 1.1
|
|
31993
|
-
}, {
|
|
31994
|
-
label: "Vendor Selling Event: Week 36",
|
|
31995
|
-
inc_unit: 8000,
|
|
31996
|
-
inc_roi: 1.2
|
|
31997
|
-
}, {
|
|
31998
|
-
label: "Vendor Selling Event: Week 34",
|
|
31999
|
-
inc_unit: 8000,
|
|
32000
|
-
inc_roi: 0.7
|
|
32001
|
-
}, {
|
|
32002
|
-
label: "Vendor Selling Event: Week 35",
|
|
32003
|
-
inc_unit: 8000,
|
|
32004
|
-
inc_roi: 0.8
|
|
32005
|
-
}, {
|
|
32006
|
-
label: "Vendor Selling Event: Week 38",
|
|
32007
|
-
inc_unit: 9000,
|
|
32008
|
-
inc_roi: 1.1
|
|
32009
|
-
}];
|
|
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
|
+
});
|
|
32010
31961
|
const format = v => v >= 1000 ? `${v / 1000}K` : v;
|
|
32011
|
-
const CustomBarLabel = ({
|
|
32012
|
-
x,
|
|
32013
|
-
y,
|
|
32014
|
-
width,
|
|
32015
|
-
payload
|
|
32016
|
-
}) => {
|
|
32017
|
-
if (!payload || typeof payload.total === "undefined") {
|
|
32018
|
-
console.error("Invalid payload:", payload);
|
|
32019
|
-
return null;
|
|
32020
|
-
}
|
|
32021
|
-
const centerX = x + width / 2;
|
|
32022
|
-
return /*#__PURE__*/React__default["default"].createElement("text", {
|
|
32023
|
-
x: centerX,
|
|
32024
|
-
y: Math.max(y - 8, 10),
|
|
32025
|
-
textAnchor: "middle",
|
|
32026
|
-
fill: "black"
|
|
32027
|
-
}, format(payload.total));
|
|
32028
|
-
};
|
|
32029
31962
|
const BarWithInner = props => {
|
|
32030
31963
|
const {
|
|
32031
31964
|
x,
|
|
@@ -32080,27 +32013,16 @@ function InnerBarChart() {
|
|
|
32080
32013
|
if (!active || !payload || !payload.length) return null;
|
|
32081
32014
|
const data = payload[0].payload;
|
|
32082
32015
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
32083
|
-
|
|
32084
|
-
|
|
32085
|
-
border: "1px solid #ccc",
|
|
32086
|
-
padding: "10px",
|
|
32087
|
-
borderRadius: "8px",
|
|
32088
|
-
fontSize: "14px"
|
|
32089
|
-
}
|
|
32090
|
-
}, /*#__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)));
|
|
32091
32018
|
};
|
|
32092
|
-
const
|
|
32093
|
-
|
|
32094
|
-
|
|
32095
|
-
|
|
32096
|
-
|
|
32097
|
-
|
|
32098
|
-
|
|
32099
|
-
y,
|
|
32100
|
-
payload
|
|
32101
|
-
}) => {
|
|
32102
|
-
const label = dataWithIndex[payload.value]?.label ?? "";
|
|
32103
|
-
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();
|
|
32104
32026
|
return /*#__PURE__*/React__default["default"].createElement("g", {
|
|
32105
32027
|
transform: `translate(${x},${y})`
|
|
32106
32028
|
}, /*#__PURE__*/React__default["default"].createElement("text", {
|
|
@@ -32109,54 +32031,75 @@ function InnerBarChart() {
|
|
|
32109
32031
|
dy: 16,
|
|
32110
32032
|
textAnchor: "middle",
|
|
32111
32033
|
fill: "#212121",
|
|
32112
|
-
fontSize:
|
|
32113
|
-
fontWeight: "400",
|
|
32034
|
+
fontSize: 10,
|
|
32114
32035
|
fontFamily: "Poppins"
|
|
32115
32036
|
}, /*#__PURE__*/React__default["default"].createElement("tspan", {
|
|
32116
32037
|
x: 0,
|
|
32117
|
-
dy:
|
|
32118
|
-
}, "Vendor
|
|
32038
|
+
dy: "0.71em"
|
|
32039
|
+
}, "Vendor"), /*#__PURE__*/React__default["default"].createElement("tspan", {
|
|
32119
32040
|
x: 0,
|
|
32120
|
-
dy:
|
|
32121
|
-
}, "
|
|
32041
|
+
dy: "1.2em"
|
|
32042
|
+
}, "Selling"), /*#__PURE__*/React__default["default"].createElement("tspan", {
|
|
32043
|
+
x: 0,
|
|
32044
|
+
dy: "1.2em"
|
|
32045
|
+
}, labelText)));
|
|
32122
32046
|
};
|
|
32123
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
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, {
|
|
32124
32052
|
width: "100%",
|
|
32125
|
-
height:
|
|
32053
|
+
height: 450
|
|
32126
32054
|
}, /*#__PURE__*/React__default["default"].createElement(recharts.BarChart, {
|
|
32127
|
-
data:
|
|
32055
|
+
data: processedData,
|
|
32128
32056
|
margin: {
|
|
32129
|
-
top:
|
|
32057
|
+
top: 30,
|
|
32130
32058
|
right: 30,
|
|
32131
32059
|
left: 20,
|
|
32132
|
-
bottom:
|
|
32060
|
+
bottom: 60
|
|
32133
32061
|
}
|
|
32134
32062
|
}, /*#__PURE__*/React__default["default"].createElement(recharts.CartesianGrid, {
|
|
32135
32063
|
strokeDasharray: "3 3",
|
|
32136
32064
|
vertical: false
|
|
32137
32065
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.XAxis, {
|
|
32138
|
-
dataKey: "
|
|
32139
|
-
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
|
|
32140
32070
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
|
|
32141
32071
|
type: "number",
|
|
32142
32072
|
domain: [0, "dataMax + 2000"],
|
|
32143
|
-
|
|
32073
|
+
tickFormatter: format
|
|
32144
32074
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, {
|
|
32145
32075
|
content: /*#__PURE__*/React__default["default"].createElement(CustomTooltip, null)
|
|
32146
32076
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.Brush, {
|
|
32147
32077
|
height: 30,
|
|
32148
32078
|
travellerWidth: 10,
|
|
32149
|
-
startIndex:
|
|
32079
|
+
startIndex: 0,
|
|
32150
32080
|
endIndex: 5,
|
|
32151
|
-
y:
|
|
32081
|
+
y: 380
|
|
32152
32082
|
}), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
|
|
32153
32083
|
dataKey: "total",
|
|
32154
32084
|
shape: /*#__PURE__*/React__default["default"].createElement(BarWithInner, null),
|
|
32155
|
-
|
|
32156
|
-
|
|
32157
|
-
})));
|
|
32085
|
+
barSize: 36
|
|
32086
|
+
}))));
|
|
32158
32087
|
}
|
|
32159
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
|
+
`;
|
|
32160
32103
|
styled__default["default"].div`
|
|
32161
32104
|
font-family: sans-serif;
|
|
32162
32105
|
text-align: center;
|
|
@@ -32173,49 +32116,22 @@ styled__default["default"].div`
|
|
|
32173
32116
|
flex-direction: column;
|
|
32174
32117
|
background-color: white;
|
|
32175
32118
|
`;
|
|
32176
|
-
const Container = styled__default["default"].div`
|
|
32177
|
-
width: 100%;
|
|
32178
|
-
height: 100%;
|
|
32179
|
-
display: flex;
|
|
32180
|
-
flex-direction: column;
|
|
32181
|
-
#Segment {
|
|
32182
|
-
width: auto;
|
|
32183
|
-
white-space: nowrap;
|
|
32184
|
-
font-size: 14px;
|
|
32185
|
-
font-weight: 500;
|
|
32186
|
-
font-family: "Poppins"
|
|
32187
|
-
}
|
|
32188
|
-
`;
|
|
32189
|
-
/* Make brush background darker */
|
|
32190
|
-
/* .recharts-brush .recharts-brush-slide {
|
|
32191
|
-
fill: #a52a2a !important;
|
|
32192
|
-
stroke: none;
|
|
32193
|
-
}
|
|
32194
|
-
|
|
32195
|
-
/* Style draggable handles (travellers) */
|
|
32196
|
-
/* .recharts-brush-traveller {
|
|
32197
|
-
fill: limegreen !important; /* bright green like in the image */
|
|
32198
|
-
/* cursor: ew-resize;
|
|
32199
|
-
} */
|
|
32200
32119
|
|
|
32201
|
-
|
|
32202
|
-
|
|
32203
|
-
|
|
32204
|
-
|
|
32205
|
-
|
|
32206
|
-
|
|
32207
|
-
|
|
32208
|
-
|
|
32209
|
-
/* Remove tick labels if needed */
|
|
32210
|
-
// .recharts-brush .recharts-layer text {
|
|
32211
|
-
// display: none;
|
|
32212
|
-
// }
|
|
32213
|
-
|
|
32214
|
-
const BrushChart = () => {
|
|
32120
|
+
const BrushChart = props => {
|
|
32121
|
+
const {
|
|
32122
|
+
width,
|
|
32123
|
+
height,
|
|
32124
|
+
data,
|
|
32125
|
+
barlineData,
|
|
32126
|
+
lineChartData
|
|
32127
|
+
} = props;
|
|
32215
32128
|
const segmentedbuttonOptions = ["New Shoppers & Repeaters", "INC Sales & ROI", "INC Units", "Basket Lift"];
|
|
32216
32129
|
const [selectedOption, setSelectedOption] = React$1.useState(segmentedbuttonOptions[0]);
|
|
32217
|
-
return /*#__PURE__*/React__default["default"].createElement(Container,
|
|
32218
|
-
|
|
32130
|
+
return /*#__PURE__*/React__default["default"].createElement(Container, {
|
|
32131
|
+
height: height,
|
|
32132
|
+
width: width
|
|
32133
|
+
}, /*#__PURE__*/React__default["default"].createElement(SegmentedButton, {
|
|
32134
|
+
gap: "8px",
|
|
32219
32135
|
options: segmentedbuttonOptions.map(value => ({
|
|
32220
32136
|
value
|
|
32221
32137
|
})),
|
|
@@ -32225,7 +32141,15 @@ const BrushChart = () => {
|
|
|
32225
32141
|
} = _ref;
|
|
32226
32142
|
return setSelectedOption(value);
|
|
32227
32143
|
}
|
|
32228
|
-
}), selectedOption === "New Shoppers & Repeaters" && /*#__PURE__*/React__default["default"].createElement(InnerBarChart,
|
|
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
|
+
}));
|
|
32229
32153
|
};
|
|
32230
32154
|
|
|
32231
32155
|
exports.AreaChart = AreaChart;
|