sag_components 2.0.0-beta50 → 2.0.0-beta52

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
@@ -3480,50 +3480,240 @@ const LinnerDataBox = props => {
3480
3480
  }))));
3481
3481
  };
3482
3482
 
3483
- const LampIcon = _ref => {
3484
- let {
3485
- // eslint-disable-next-line react/prop-types
3486
- width = '23',
3487
- // eslint-disable-next-line react/prop-types
3488
- height = '19',
3489
- // eslint-disable-next-line react/prop-types
3490
- fill = '#229E38'
3491
- } = _ref;
3492
- return /*#__PURE__*/React__default["default"].createElement("svg", {
3493
- width: width,
3483
+ const SagIconButtonWrapper = styled__default["default"].button`
3484
+ height: ${props => props.height};
3485
+ font-size: 14px;
3486
+ font-weight: 400;
3487
+ display: flex;
3488
+ gap: 8px;
3489
+ align-items: center;
3490
+ justify-content: center;
3491
+ padding: 8px 18px;
3492
+ white-space: nowrap;
3493
+ color: ${props => props.color};
3494
+ border-radius: 8px;
3495
+ border: 1px solid ${props => props.color};
3496
+ background: ${props => props.backgroundColor ? props.backgroundColor : 'transparent'};
3497
+ transition: box-shadow 0.3s ease;
3498
+ &:hover, &:focus {
3499
+ cursor: pointer;
3500
+ box-shadow: 5px 5px 10px 0px rgba(0, 0, 0, 0.1);
3501
+ }
3502
+ `;
3503
+ const SpanText$1 = styled__default["default"].span`
3504
+ `;
3505
+
3506
+ const SagIconButton = props => {
3507
+ const {
3508
+ iconName,
3509
+ color,
3510
+ backgroundColor,
3511
+ activeColor,
3512
+ height,
3513
+ buttonText,
3514
+ iconWidth,
3515
+ iconHeight,
3516
+ disabled,
3517
+ openState,
3518
+ onButtonClick,
3519
+ className
3520
+ } = props;
3521
+ const [activeState, setActiveState] = React$1.useState(openState);
3522
+ const onClickHandler = event => {
3523
+ onButtonClick(event);
3524
+ setActiveState(prevState => !prevState);
3525
+ };
3526
+ const getIcon = icon => {
3527
+ switch (icon.toLowerCase()) {
3528
+ case 'filter':
3529
+ return /*#__PURE__*/React__default["default"].createElement(FilterIcon, {
3530
+ height: iconHeight,
3531
+ width: iconWidth,
3532
+ color: activeState ? activeColor : color
3533
+ });
3534
+ case 'options':
3535
+ return /*#__PURE__*/React__default["default"].createElement(OptionsIcon, {
3536
+ height: iconHeight,
3537
+ width: iconWidth,
3538
+ color: activeState ? activeColor : color
3539
+ });
3540
+ case 'download':
3541
+ return /*#__PURE__*/React__default["default"].createElement(DownloadIcon, {
3542
+ height: iconHeight,
3543
+ width: iconWidth,
3544
+ color: activeState ? activeColor : color
3545
+ });
3546
+ case 'document':
3547
+ return /*#__PURE__*/React__default["default"].createElement(DocumentIcon, {
3548
+ height: iconHeight,
3549
+ width: iconWidth,
3550
+ color: activeState ? activeColor : color
3551
+ });
3552
+ case 'fly':
3553
+ return /*#__PURE__*/React__default["default"].createElement(FlyIcon, {
3554
+ height: iconHeight,
3555
+ width: iconWidth,
3556
+ color: activeState ? activeColor : color
3557
+ });
3558
+ case 'bell':
3559
+ return /*#__PURE__*/React__default["default"].createElement(BellIcon, {
3560
+ height: iconHeight,
3561
+ width: iconWidth,
3562
+ color: activeState ? activeColor : color
3563
+ });
3564
+ case 'maintenance':
3565
+ return /*#__PURE__*/React__default["default"].createElement(MaintenanceIcon, {
3566
+ height: iconHeight,
3567
+ width: iconWidth,
3568
+ color: activeState ? activeColor : color
3569
+ });
3570
+ case 'exit':
3571
+ return /*#__PURE__*/React__default["default"].createElement(ExitIcon, {
3572
+ height: iconHeight,
3573
+ width: iconWidth,
3574
+ color: activeState ? activeColor : color
3575
+ });
3576
+ case 'eye':
3577
+ return /*#__PURE__*/React__default["default"].createElement(EyeIcon, {
3578
+ height: iconHeight,
3579
+ width: iconWidth,
3580
+ color: activeState ? activeColor : color
3581
+ });
3582
+ default:
3583
+ return /*#__PURE__*/React__default["default"].createElement(EyeIcon, {
3584
+ height: iconHeight,
3585
+ width: iconWidth,
3586
+ color: activeState ? activeColor : color
3587
+ });
3588
+ }
3589
+ };
3590
+ return /*#__PURE__*/React__default["default"].createElement(SagIconButtonWrapper, {
3591
+ className: className,
3494
3592
  height: height,
3495
- viewBox: "0 0 23 19",
3496
- fill: "none",
3497
- xmlns: "http://www.w3.org/2000/svg"
3498
- }, /*#__PURE__*/React__default["default"].createElement("path", {
3499
- d: "M2.42578 0.390625L4.11328 1.51562C4.5 1.79688 4.60547 2.32422 4.35938 2.71094C4.07812 3.09766 3.55078 3.20312 3.16406 2.92188L1.47656 1.79688C1.08984 1.55078 0.984375 1.02344 1.26562 0.636719C1.51172 0.25 2.03906 0.144531 2.42578 0.390625ZM20.9883 1.79688L19.3008 2.92188C18.9141 3.20312 18.3867 3.09766 18.1406 2.71094C17.8594 2.32422 17.9648 1.79688 18.3516 1.51562L20.0391 0.390625C20.4258 0.144531 20.9531 0.25 21.2344 0.636719C21.4805 1.02344 21.375 1.55078 20.9883 1.79688ZM0.84375 5.875H3.09375C3.55078 5.875 3.9375 6.26172 3.9375 6.71875C3.9375 7.21094 3.55078 7.5625 3.09375 7.5625H0.84375C0.351562 7.5625 0 7.21094 0 6.71875C0 6.26172 0.351562 5.875 0.84375 5.875ZM19.4062 5.875H21.6562C22.1133 5.875 22.5 6.26172 22.5 6.71875C22.5 7.21094 22.1133 7.5625 21.6562 7.5625H19.4062C18.9141 7.5625 18.5625 7.21094 18.5625 6.71875C18.5625 6.26172 18.9141 5.875 19.4062 5.875ZM4.11328 11.9219L2.42578 13.0469C2.03906 13.3281 1.51172 13.2227 1.26562 12.8359C0.984375 12.4492 1.08984 11.9219 1.47656 11.6406L3.16406 10.5156C3.55078 10.2695 4.07812 10.375 4.35938 10.7617C4.60547 11.1484 4.5 11.6758 4.11328 11.9219ZM19.3008 10.5508L20.9883 11.6758C21.375 11.9219 21.4805 12.4492 21.2344 12.8359C20.9531 13.2227 20.4258 13.3281 20.0391 13.082L18.3516 11.957C17.9648 11.6758 17.8594 11.1484 18.1406 10.7617C18.3867 10.375 18.9141 10.2695 19.3008 10.5508ZM15.75 6.4375C15.75 3.97656 13.7109 1.9375 11.25 1.9375C8.75391 1.9375 6.75 3.97656 6.75 6.4375C6.75 7.42188 7.03125 8.30078 7.52344 9.00391C7.66406 9.21484 7.80469 9.42578 7.98047 9.63672C8.4375 10.2695 8.96484 11.0078 9.38672 11.7461C9.73828 12.4141 9.94922 13.1172 10.0195 13.75H8.33203C8.22656 13.3281 8.12109 12.9414 7.91016 12.5547C7.55859 11.9219 7.13672 11.3242 6.67969 10.7266C6.50391 10.4805 6.32812 10.2344 6.15234 9.98828C5.44922 8.96875 5.0625 7.77344 5.0625 6.4375C5.0625 3.02734 7.80469 0.25 11.25 0.25C14.6602 0.25 17.4375 3.02734 17.4375 6.4375C17.4375 7.77344 17.0156 8.96875 16.3125 9.98828C16.1367 10.2344 15.9609 10.4805 15.7852 10.7266C15.3633 11.3242 14.9062 11.9219 14.5547 12.5547C14.3438 12.9414 14.2383 13.3281 14.168 13.75H12.4453C12.5508 13.1172 12.7266 12.4141 13.0781 11.7461C13.5 11.0078 14.0273 10.2695 14.4844 9.63672C14.6602 9.42578 14.8008 9.21484 14.9414 9.00391C15.4336 8.30078 15.75 7.42188 15.75 6.4375ZM9.5625 6.4375C9.5625 6.75391 9.28125 7 9 7C8.68359 7 8.4375 6.75391 8.4375 6.4375C8.4375 4.89062 9.66797 3.625 11.25 3.625C11.5312 3.625 11.8125 3.90625 11.8125 4.1875C11.8125 4.50391 11.5312 4.75 11.25 4.75C10.3008 4.75 9.5625 5.52344 9.5625 6.4375ZM14.0625 15.4375C14.0625 17.0195 12.7969 18.25 11.25 18.25C9.66797 18.25 8.4375 17.0195 8.4375 15.4375V14.875H14.0625V15.4375Z",
3500
- fill: fill
3501
- }));
3593
+ color: activeState ? activeColor : color,
3594
+ backgroundColor: backgroundColor,
3595
+ disabled: disabled,
3596
+ onClick: event => {
3597
+ onClickHandler(event);
3598
+ }
3599
+ }, getIcon(iconName), buttonText && /*#__PURE__*/React__default["default"].createElement(SpanText$1, null, buttonText));
3600
+ };
3601
+ SagIconButton.propTypes = {
3602
+ className: PropTypes.string,
3603
+ iconName: PropTypes.string,
3604
+ buttonText: PropTypes.string,
3605
+ height: PropTypes.string,
3606
+ color: PropTypes.string,
3607
+ backgroundColor: PropTypes.string,
3608
+ activeColor: PropTypes.string,
3609
+ iconHeight: PropTypes.number,
3610
+ iconWidth: PropTypes.number,
3611
+ openState: PropTypes.bool,
3612
+ disabled: PropTypes.bool,
3613
+ onButtonClick: PropTypes.func
3614
+ };
3615
+ SagIconButton.defaultProps = {
3616
+ className: '',
3617
+ iconName: 'filter',
3618
+ buttonText: 'Filter',
3619
+ height: '40px',
3620
+ color: '#212121',
3621
+ activeColor: '#229E38',
3622
+ backgroundColor: 'transparent',
3623
+ // '#E8F5EB',
3624
+ iconHeight: 12,
3625
+ iconWidth: 12,
3626
+ openState: false,
3627
+ disabled: false,
3628
+ onButtonClick: () => {}
3502
3629
  };
3503
3630
 
3504
- const ExportIcon = _ref => {
3505
- let {
3506
- width = '14',
3507
- height = '15',
3508
- color = '#212121'
3509
- } = _ref;
3510
- return /*#__PURE__*/React__default["default"].createElement("svg", {
3511
- width: width,
3631
+ const TextFieldContainer = styled__default["default"].div`
3632
+ position: relative;
3633
+ width: ${props => props.width};
3634
+ > svg {
3635
+ position: absolute;
3636
+ top: 50%;
3637
+ transform: translateY(-50%);
3638
+ left: 10px;
3639
+
3640
+ }
3641
+ `;
3642
+ const TextFieldInput = styled__default["default"].input`
3643
+ width: 100%;
3644
+ height: ${props => props.height};
3645
+ font-size: 14px;
3646
+ font-weight: 400;
3647
+ padding: 6px 16px;
3648
+ border-radius: 8px;
3649
+ border: 1px solid #B1B1B1;
3650
+ background: transparent;
3651
+ text-indent: 14px;
3652
+ &:hover,
3653
+ &:focus {
3654
+ border: 1px solid #212121;
3655
+ }
3656
+ &::placeholder {
3657
+ color: #B1B1B1;
3658
+ }
3659
+ `;
3660
+
3661
+ const SearchIcon = ({
3662
+ width = '13',
3663
+ height = '13',
3664
+ color = '#212121'
3665
+ }) => /*#__PURE__*/React__default["default"].createElement("svg", {
3666
+ width: width,
3667
+ height: height,
3668
+ viewBox: "0 0 13 13",
3669
+ fill: "none",
3670
+ xmlns: "http://www.w3.org/2000/svg"
3671
+ }, /*#__PURE__*/React__default["default"].createElement("path", {
3672
+ d: "M8.625 4.875C8.625 3.53906 7.89844 2.32031 6.75 1.64062C5.57812 0.960938 4.14844 0.960938 3 1.64062C1.82812 2.32031 1.125 3.53906 1.125 4.875C1.125 6.23438 1.82812 7.45312 3 8.13281C4.14844 8.8125 5.57812 8.8125 6.75 8.13281C7.89844 7.45312 8.625 6.23438 8.625 4.875ZM7.89844 8.71875C7.05469 9.375 6 9.75 4.875 9.75C2.17969 9.75 0 7.57031 0 4.875C0 2.20312 2.17969 0 4.875 0C7.54688 0 9.75 2.20312 9.75 4.875C9.75 6.02344 9.35156 7.07812 8.69531 7.92188L11.8359 11.0391C12.0469 11.2734 12.0469 11.625 11.8359 11.8359C11.6016 12.0703 11.25 12.0703 11.0391 11.8359L7.89844 8.71875Z",
3673
+ fill: color
3674
+ }));
3675
+
3676
+ const SearchInput = props => {
3677
+ const {
3678
+ placeholder,
3679
+ onTyping,
3680
+ width,
3681
+ height,
3682
+ className
3683
+ } = props;
3684
+ const handleInputChange = e => {
3685
+ onTyping(e);
3686
+ };
3687
+ return /*#__PURE__*/React__default["default"].createElement(TextFieldContainer, {
3688
+ className: className,
3689
+ width: width
3690
+ }, /*#__PURE__*/React__default["default"].createElement(TextFieldInput, {
3691
+ type: "search",
3512
3692
  height: height,
3513
- viewBox: "0 0 14 15",
3514
- fill: "none",
3515
- xmlns: "http://www.w3.org/2000/svg"
3516
- }, /*#__PURE__*/React__default["default"].createElement("path", {
3517
- d: "M8.3125 0.90625C8.3125 0.550781 8.58594 0.25 8.96875 0.25H13.3164C13.6992 0.25 13.9727 0.550781 13.9727 0.90625V5.28125C13.9727 5.66406 13.6992 5.9375 13.3164 5.9375C12.9609 5.9375 12.6602 5.66406 12.6602 5.28125V2.49219L6.5625 8.58984C6.31641 8.86328 5.90625 8.86328 5.66016 8.58984C5.38672 8.34375 5.38672 7.93359 5.66016 7.66016L11.7578 1.5625H8.96875C8.58594 1.5625 8.3125 1.28906 8.3125 0.90625ZM1.96875 1.125H5.46875C5.82422 1.125 6.125 1.42578 6.125 1.78125C6.125 2.16406 5.82422 2.4375 5.46875 2.4375H1.96875C1.58594 2.4375 1.3125 2.73828 1.3125 3.09375V12.2812C1.3125 12.6641 1.58594 12.9375 1.96875 12.9375H11.1562C11.5117 12.9375 11.8125 12.6641 11.8125 12.2812V8.78125C11.8125 8.42578 12.0859 8.125 12.4688 8.125C12.8242 8.125 13.125 8.42578 13.125 8.78125V12.2812C13.125 13.375 12.2227 14.25 11.1562 14.25H1.96875C0.875 14.25 0 13.375 0 12.2812V3.09375C0 2.02734 0.875 1.125 1.96875 1.125Z",
3518
- fill: color
3519
- }));
3693
+ placeholder: placeholder,
3694
+ onChange: handleInputChange
3695
+ }), /*#__PURE__*/React__default["default"].createElement(SearchIcon, null));
3696
+ };
3697
+ SearchInput.propTypes = {
3698
+ placeholder: PropTypes.string,
3699
+ width: PropTypes.string,
3700
+ height: PropTypes.string,
3701
+ onTyping: PropTypes.func,
3702
+ className: PropTypes.string
3703
+ };
3704
+ SearchInput.defaultProps = {
3705
+ placeholder: 'Search',
3706
+ width: '100%',
3707
+ height: '40px',
3708
+ onTyping: () => {},
3709
+ className: ''
3520
3710
  };
3521
3711
 
3522
3712
  const scrollableStyles$c = `
3523
3713
  overflow-y: auto;
3524
3714
 
3525
3715
  &::-webkit-scrollbar {
3526
- width: 8px;
3716
+ width: 4px;
3527
3717
  }
3528
3718
 
3529
3719
  &::-webkit-scrollbar-track {
@@ -3536,665 +3726,125 @@ const scrollableStyles$c = `
3536
3726
  border-radius: 5px;
3537
3727
  }
3538
3728
  `;
3539
- const MainContainer$5 = styled__default["default"].div`
3540
- display: flex;
3541
- flex-direction: row;
3542
- position: relative;
3543
- font-family: "Poppins", sans-serif;
3544
- font-style: normal;
3545
- font-size: 1rem;
3546
- border-radius: 12px;
3547
- padding: 10px;
3548
- width: ${props => props.width};
3549
- height: ${props => props.height};
3550
- overflow: auto;
3551
- ${scrollableStyles$c}
3729
+ const TabMenuContainer = styled__default["default"].div`
3730
+ font-family: 'Poppins', sans-serif;
3731
+ display: grid;
3732
+ gap: 20px;
3733
+ grid-template-rows: repeat(3, auto);
3552
3734
  `;
3553
- const RowTitle = styled__default["default"].h4`
3735
+ const TopRow = styled__default["default"].div`
3554
3736
  display: flex;
3555
- justify-content: space-between;
3556
- font-weight: 500;
3557
- font-size: 18px;
3558
- margin: 5px 5px 5px 0;
3559
- @media (max-width: 1536px) {
3560
- font-size: 15px;
3561
- }
3562
- @media (max-width: 1366px) {
3563
- font-size: 12px;
3564
- }
3737
+ align-items: center;
3738
+ gap: 20px;
3565
3739
  `;
3566
- const AllRowsContainer = styled__default["default"].div`
3567
- display: flex;
3568
- flex-direction: column;
3569
- justify-content: space-between;
3570
- align-items: flex-start;
3571
- width: 100%;
3572
- height: 100%;
3740
+ const Headline$1 = styled__default["default"].span`
3741
+ font-size: 18px;
3742
+ font-weight: 500;
3743
+ margin-right: auto;
3573
3744
  `;
3574
- const OneRowContainer = styled__default["default"].div`
3575
- display: flex;
3576
- flex-direction: column;
3577
- width: 100%;
3578
- height: 100%;
3745
+ const Nav = styled__default["default"].nav`
3746
+ display: flex;
3747
+ flex-direction: row;
3748
+
3579
3749
  `;
3580
- const ColumnLineSeporatorContainer = styled__default["default"].div`
3750
+ const TabActionLine = styled__default["default"].div`
3751
+ margin-left: auto;
3581
3752
  display: flex;
3582
- flex-direction: column;
3583
- background-color: #b1b1b1;
3584
3753
  align-items: center;
3585
- height: 1px;
3586
- width: 100%;
3587
- &.ColumnLineSeporatorContainer_vertical {
3588
- margin: 0 30px;
3589
- height: 100%;
3590
- width: 1px;
3591
- }
3592
- &.ColumnLineSeporatorContainer_horizontal {
3593
- margin: 30px 0;
3594
- min-height: 1px;
3595
- height: 1px;
3596
- width: 100%;
3597
- }
3598
- `;
3599
- const ColumnLineSeporator = styled__default["default"].div`
3600
- min-width: 0.5px;
3601
- width: 0.5px;
3602
- `;
3603
- const FieldsContainer$1 = styled__default["default"].div`
3604
- display: flex;
3605
- flex-direction: row;
3606
- justify-content: space-between;
3607
- white-space: nowrap;
3608
3754
  height: 100%;
3609
- padding: 30px 0px;
3610
3755
  `;
3611
- const OneFieldsContainer = styled__default["default"].div`
3756
+ const Tabs = styled__default["default"].div`
3757
+ position: relative;
3612
3758
  display: flex;
3613
- padding: 4px;
3614
- gap: 10px;
3759
+ align-items: center;
3615
3760
  width: 100%;
3616
- justify-content: flex-start;
3617
- // padding: ${props => props.padding}; //0 0 0 40px;
3618
- `;
3619
- const FieldTitle = styled__default["default"].h4`
3620
- font-size: 18px;
3621
- font-weight: 400;
3622
- margin: 0;
3623
- @media (max-width: 1536px) {
3624
- font-size: 14px;
3625
- }
3626
- @media (max-width: 1366px) {
3627
- font-size: 12px;
3628
- }
3629
- `;
3630
- const FormattedValue$3 = styled__default["default"].div`
3631
- font-weight: 400;
3632
- font-size: 40px;
3633
- display: flex;
3634
- align-items: baseline;
3635
- min-height: 40px;
3636
- gap: 2px;
3637
- @media (max-width: 1536px) {
3638
- font-size: 24px;
3639
- }
3640
- @media (max-width: 1366px) {
3641
- font-size: 20px;
3642
- }
3643
3761
  `;
3644
- const TextBeforeAndAfterValue$1 = styled__default["default"].span`
3645
- font-weight: 400;
3762
+ const Tab = styled__default["default"].div`
3763
+ cursor: pointer;
3764
+ position: relative;
3765
+ text-align: center;
3766
+ padding: 8px 12px;
3646
3767
  font-size: 16px;
3647
- @media (max-width: 1536px) {
3648
- font-size: 14px;
3649
- }
3650
- @media (max-width: 1366px) {
3651
- font-size: 11px;
3768
+ color: #000000;
3769
+ &.active {
3770
+ font-weight: 600;
3771
+ color: ${props => props.color};
3772
+ border-bottom: 1mm solid ${props => props.color};
3773
+ //2px solid ${props => props.color};
3652
3774
  }
3653
3775
  `;
3654
- const FieldTitleAndValueSubContainer = styled__default["default"].div`
3655
- display: flex;
3656
- justify-content: space-around;
3657
- flex-direction: column;
3658
- flex-wrap: wrap;
3776
+ const PresentationSlider = styled__default["default"].div`
3777
+ position: absolute;
3778
+ bottom: 0;
3779
+ left: 0;
3659
3780
  width: 100%;
3781
+ height: 2px;
3782
+ background-color: #EAEAEA;
3783
+ &::before {
3784
+ content: '';
3785
+ position: absolute;
3786
+ left: 0;
3787
+ z-index: 1;
3788
+ width: ${props => props.width};
3789
+ height: 2px;
3790
+ /* background-color: ${props => props.color}; */
3791
+ transform: translateX(calc(100% * ${props => props.activeTab}));
3792
+ transition: transform .35s ease;
3793
+ }
3660
3794
  `;
3661
- const InfoTextContainer$1 = styled__default["default"].div`
3662
- display: flex;
3663
- flex-direction: row;
3795
+ const Body = styled__default["default"].div`
3664
3796
  width: 100%;
3665
- height: 100%;
3666
- overflow:auto;
3667
- `;
3668
- const IconContainer$5 = styled__default["default"].div`
3669
- display: flex;
3670
- padding: 5px 10px 0 0;
3671
- cursor: pointer;
3797
+ ${scrollableStyles$c}
3798
+ position: relative;
3799
+ overflow-x: hidden;
3800
+ box-sizing: border-box;
3801
+ padding: ${props => props.setBackground ? '20px' : '5px'};
3802
+ background-color: ${props => props.setBackground ? 'white' : 'unset'};
3803
+ border-radius: ${props => props.setBackground ? '12px' : '0'};
3804
+ box-shadow: ${props => props.setBackground ? '0px 0px 20px 0px rgba(0, 0, 0, 0.10)' : 'unset'};
3672
3805
  `;
3673
- const InfoTextLabel$1 = styled__default["default"].div`
3674
- color: black;
3675
- font-size: 18px;
3676
- line-height: 24px;
3806
+ const Label$5 = styled__default["default"].div`
3807
+ font-size: 12px;
3677
3808
  font-weight: 400;
3678
- width: 100%;
3679
- overflow: auto;
3680
- ${scrollableStyles$c}
3681
- strong {
3682
- font-weight: 500;
3683
- color: #212121;
3684
- @media (max-width: 1536px) {
3685
- font-size: 14px;
3686
- }
3687
- @media (max-width: 1366px) {
3688
- font-size: 12px;
3689
- }
3690
- };
3691
- p1 {
3692
- font-weight: 400;
3693
- color: #726F6F;
3694
- @media (max-width: 1536px) {
3695
- font-size: 14px;
3809
+ padding: 8px;
3810
+ color: #5a5a5a;
3811
+ background-color: #E7E7E7;
3812
+ border-radius: 4px;
3813
+ > span {
3814
+ font-weight: 500;
3696
3815
  }
3697
- @media (max-width: 1366px) {
3698
- font-size: 12px;
3816
+ ~ span {
3817
+ margin: 0 24px;
3818
+ font-weight: 400;
3699
3819
  }
3700
- };
3701
3820
  `;
3702
- const OutBanner$2 = styled__default["default"].div`
3821
+ const ActionsWrapper = styled__default["default"].div`
3703
3822
  display: flex;
3704
- gap: 8px;
3705
3823
  align-items: center;
3706
- font-size: 14px;
3707
- font-weight: 400;
3708
- color: ${props => props.textColor};
3709
- cursor: pointer;
3710
- @media (max-width: 1536px) {
3711
- font-size: 13px;
3712
- }
3713
- @media (max-width: 1366px) {
3714
- font-size: 12px;
3715
- }
3716
- > svg {
3717
- width: 14px;
3718
- height: 14px;
3719
- @media (max-width: 1536px) {
3720
- width: 13px;
3721
- height: 13px;
3722
- }
3723
- @media (max-width: 1366px) {
3724
- width: 12px;
3725
- height: 12px;
3726
- }
3727
- }
3728
- `;
3729
-
3730
- const MarketShareDescription = props => {
3731
- const {
3732
- width,
3733
- height,
3734
- marketShareData,
3735
- iconColor,
3736
- onBannerClick,
3737
- dotCut
3738
- } = props;
3739
- const displayField = dataItem => {
3740
- const content = /*#__PURE__*/React__default["default"].createElement(FieldTitleAndValueSubContainer, {
3741
- className: "FieldTitleAndValueSubContainer"
3742
- }, /*#__PURE__*/React__default["default"].createElement(FieldTitle, {
3743
- className: "FieldTitle"
3744
- }, dataItem.label), /*#__PURE__*/React__default["default"].createElement(FormattedValue$3, {
3745
- className: "FormattedValue"
3746
- }, /*#__PURE__*/React__default["default"].createElement(TextBeforeAndAfterValue$1, {
3747
- className: "TextBeforeAndAfterValue"
3748
- }, dataItem.textBefore), dotCut ? getFormattedValue(dataItem.value && Math.abs(dataItem.value) > 0 && dataItem.value % 1 !== 0 ? dataItem.value?.toFixed(2) : dataItem.value) : getNumberWithCommas(dataItem.value), dotCut ? getFormattedUnits(dataItem.value) : '', /*#__PURE__*/React__default["default"].createElement(TextBeforeAndAfterValue$1, null, dataItem.textAfter)));
3749
- return content;
3750
- };
3751
- const dispalyRowFields = data => {
3752
- if (!data && !data.length > 0) return '';
3753
- const content = /*#__PURE__*/React__default["default"].createElement(FieldsContainer$1, {
3754
- className: "FieldsContainer",
3755
- height: "160px"
3756
- }, data?.map((item, index) => /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(OneFieldsContainer, {
3757
- className: "OneFieldsContainer",
3758
- padding: index === 0 ? '0px' : '0 0 0 40px'
3759
- }, displayField(item)), data?.length !== index + 1 ? /*#__PURE__*/React__default["default"].createElement(ColumnLineSeporatorContainer, {
3760
- className: "ColumnLineSeporatorContainer_vertical"
3761
- }, /*#__PURE__*/React__default["default"].createElement(ColumnLineSeporator, {
3762
- className: "ColumnLineSeporator"
3763
- })) : '')));
3764
- return content;
3765
- };
3766
- const displayRows = () => {
3767
- if (!marketShareData || marketShareData?.length === 0) return '';
3768
- const content = /*#__PURE__*/React__default["default"].createElement(AllRowsContainer, {
3769
- className: "AllRowsContainer"
3770
- }, marketShareData.map((item, index) => /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(OneRowContainer, {
3771
- className: "OneRowContainer"
3772
- }, /*#__PURE__*/React__default["default"].createElement(RowTitle, {
3773
- className: "RowTitle"
3774
- }, /*#__PURE__*/React__default["default"].createElement(InfoTextLabel$1, {
3775
- className: "InfoTextLabel",
3776
- dangerouslySetInnerHTML: {
3777
- __html: item.rowTitle
3778
- }
3779
- }), item.showBanner && /*#__PURE__*/React__default["default"].createElement(OutBanner$2, {
3780
- className: "OutBanner",
3781
- onClick: () => onBannerClick({
3782
- eventName: 'onBannerClick',
3783
- rowName: item.name
3784
- })
3785
- }, /*#__PURE__*/React__default["default"].createElement(ExportIcon, {
3786
- color: "#212121"
3787
- }), "View By Banner")), dispalyRowFields(item.fieldsArray), /*#__PURE__*/React__default["default"].createElement(InfoTextContainer$1, {
3788
- className: "InfoTextContainer"
3789
- }, item.rowFooter && item.rowFooter?.length > 0 ? /*#__PURE__*/React__default["default"].createElement(IconContainer$5, {
3790
- className: "IconContainer"
3791
- }, /*#__PURE__*/React__default["default"].createElement(LampIcon, {
3792
- width: "23px",
3793
- height: "19px",
3794
- fill: iconColor
3795
- })) : '', /*#__PURE__*/React__default["default"].createElement(InfoTextLabel$1, {
3796
- className: "InfoTextLabel",
3797
- dangerouslySetInnerHTML: {
3798
- __html: item.rowFooter
3799
- }
3800
- }))), marketShareData?.length !== index + 1 ? /*#__PURE__*/React__default["default"].createElement(ColumnLineSeporatorContainer, {
3801
- className: "ColumnLineSeporatorContainer_horizontal"
3802
- }, /*#__PURE__*/React__default["default"].createElement(ColumnLineSeporator, {
3803
- className: "ColumnLineSeporator"
3804
- })) : '')));
3805
- return content;
3806
- };
3807
- return /*#__PURE__*/React__default["default"].createElement(MainContainer$5, {
3808
- className: "MainContainer",
3809
- height: height,
3810
- width: width
3811
- }, displayRows());
3812
- };
3813
- MarketShareDescription.propTypes = {
3814
- marketShareData: PropTypes.arrayOf(PropTypes.shape({
3815
- label: PropTypes.string,
3816
- checked: PropTypes.bool,
3817
- disabled: PropTypes.bool
3818
- })),
3819
- height: PropTypes.string,
3820
- width: PropTypes.string,
3821
- iconColor: PropTypes.string,
3822
- onBannerClick: PropTypes.func,
3823
- dotCut: PropTypes.bool
3824
- };
3825
- MarketShareDescription.defaultProps = {
3826
- marketShareData: [],
3827
- width: '100%',
3828
- height: '100%',
3829
- iconColor: '#1B30AA',
3830
- onBannerClick: () => {},
3831
- dotCut: false
3832
- };
3833
-
3834
- const SagIconButtonWrapper = styled__default["default"].button`
3835
- height: ${props => props.height};
3836
- font-size: 14px;
3837
- font-weight: 400;
3838
- display: flex;
3839
- gap: 8px;
3840
- align-items: center;
3841
- justify-content: center;
3842
- padding: 8px 18px;
3843
- white-space: nowrap;
3844
- color: ${props => props.color};
3845
- border-radius: 8px;
3846
- border: 1px solid ${props => props.color};
3847
- background: ${props => props.backgroundColor ? props.backgroundColor : 'transparent'};
3848
- transition: box-shadow 0.3s ease;
3849
- &:hover, &:focus {
3850
- cursor: pointer;
3851
- box-shadow: 5px 5px 10px 0px rgba(0, 0, 0, 0.1);
3852
- }
3853
- `;
3854
- const SpanText$1 = styled__default["default"].span`
3855
- `;
3856
-
3857
- const SagIconButton = props => {
3858
- const {
3859
- iconName,
3860
- color,
3861
- backgroundColor,
3862
- activeColor,
3863
- height,
3864
- buttonText,
3865
- iconWidth,
3866
- iconHeight,
3867
- disabled,
3868
- openState,
3869
- onButtonClick,
3870
- className
3871
- } = props;
3872
- const [activeState, setActiveState] = React$1.useState(openState);
3873
- const onClickHandler = event => {
3874
- onButtonClick(event);
3875
- setActiveState(prevState => !prevState);
3876
- };
3877
- const getIcon = icon => {
3878
- switch (icon.toLowerCase()) {
3879
- case 'filter':
3880
- return /*#__PURE__*/React__default["default"].createElement(FilterIcon, {
3881
- height: iconHeight,
3882
- width: iconWidth,
3883
- color: activeState ? activeColor : color
3884
- });
3885
- case 'options':
3886
- return /*#__PURE__*/React__default["default"].createElement(OptionsIcon, {
3887
- height: iconHeight,
3888
- width: iconWidth,
3889
- color: activeState ? activeColor : color
3890
- });
3891
- case 'download':
3892
- return /*#__PURE__*/React__default["default"].createElement(DownloadIcon, {
3893
- height: iconHeight,
3894
- width: iconWidth,
3895
- color: activeState ? activeColor : color
3896
- });
3897
- case 'document':
3898
- return /*#__PURE__*/React__default["default"].createElement(DocumentIcon, {
3899
- height: iconHeight,
3900
- width: iconWidth,
3901
- color: activeState ? activeColor : color
3902
- });
3903
- case 'fly':
3904
- return /*#__PURE__*/React__default["default"].createElement(FlyIcon, {
3905
- height: iconHeight,
3906
- width: iconWidth,
3907
- color: activeState ? activeColor : color
3908
- });
3909
- case 'bell':
3910
- return /*#__PURE__*/React__default["default"].createElement(BellIcon, {
3911
- height: iconHeight,
3912
- width: iconWidth,
3913
- color: activeState ? activeColor : color
3914
- });
3915
- case 'maintenance':
3916
- return /*#__PURE__*/React__default["default"].createElement(MaintenanceIcon, {
3917
- height: iconHeight,
3918
- width: iconWidth,
3919
- color: activeState ? activeColor : color
3920
- });
3921
- case 'exit':
3922
- return /*#__PURE__*/React__default["default"].createElement(ExitIcon, {
3923
- height: iconHeight,
3924
- width: iconWidth,
3925
- color: activeState ? activeColor : color
3926
- });
3927
- case 'eye':
3928
- return /*#__PURE__*/React__default["default"].createElement(EyeIcon, {
3929
- height: iconHeight,
3930
- width: iconWidth,
3931
- color: activeState ? activeColor : color
3932
- });
3933
- default:
3934
- return /*#__PURE__*/React__default["default"].createElement(EyeIcon, {
3935
- height: iconHeight,
3936
- width: iconWidth,
3937
- color: activeState ? activeColor : color
3938
- });
3939
- }
3940
- };
3941
- return /*#__PURE__*/React__default["default"].createElement(SagIconButtonWrapper, {
3942
- className: className,
3943
- height: height,
3944
- color: activeState ? activeColor : color,
3945
- backgroundColor: backgroundColor,
3946
- disabled: disabled,
3947
- onClick: event => {
3948
- onClickHandler(event);
3949
- }
3950
- }, getIcon(iconName), buttonText && /*#__PURE__*/React__default["default"].createElement(SpanText$1, null, buttonText));
3951
- };
3952
- SagIconButton.propTypes = {
3953
- className: PropTypes.string,
3954
- iconName: PropTypes.string,
3955
- buttonText: PropTypes.string,
3956
- height: PropTypes.string,
3957
- color: PropTypes.string,
3958
- backgroundColor: PropTypes.string,
3959
- activeColor: PropTypes.string,
3960
- iconHeight: PropTypes.number,
3961
- iconWidth: PropTypes.number,
3962
- openState: PropTypes.bool,
3963
- disabled: PropTypes.bool,
3964
- onButtonClick: PropTypes.func
3965
- };
3966
- SagIconButton.defaultProps = {
3967
- className: '',
3968
- iconName: 'filter',
3969
- buttonText: 'Filter',
3970
- height: '40px',
3971
- color: '#212121',
3972
- activeColor: '#229E38',
3973
- backgroundColor: 'transparent',
3974
- // '#E8F5EB',
3975
- iconHeight: 12,
3976
- iconWidth: 12,
3977
- openState: false,
3978
- disabled: false,
3979
- onButtonClick: () => {}
3980
- };
3981
-
3982
- const TextFieldContainer = styled__default["default"].div`
3983
- position: relative;
3984
- width: ${props => props.width};
3985
- > svg {
3986
- position: absolute;
3987
- top: 50%;
3988
- transform: translateY(-50%);
3989
- left: 10px;
3990
-
3991
- }
3992
- `;
3993
- const TextFieldInput = styled__default["default"].input`
3994
- width: 100%;
3995
- height: ${props => props.height};
3996
- font-size: 14px;
3997
- font-weight: 400;
3998
- padding: 6px 16px;
3999
- border-radius: 8px;
4000
- border: 1px solid #B1B1B1;
4001
- background: transparent;
4002
- text-indent: 14px;
4003
- &:hover,
4004
- &:focus {
4005
- border: 1px solid #212121;
4006
- }
4007
- &::placeholder {
4008
- color: #B1B1B1;
4009
- }
4010
- `;
4011
-
4012
- const SearchIcon = ({
4013
- width = '13',
4014
- height = '13',
4015
- color = '#212121'
4016
- }) => /*#__PURE__*/React__default["default"].createElement("svg", {
4017
- width: width,
4018
- height: height,
4019
- viewBox: "0 0 13 13",
4020
- fill: "none",
4021
- xmlns: "http://www.w3.org/2000/svg"
4022
- }, /*#__PURE__*/React__default["default"].createElement("path", {
4023
- d: "M8.625 4.875C8.625 3.53906 7.89844 2.32031 6.75 1.64062C5.57812 0.960938 4.14844 0.960938 3 1.64062C1.82812 2.32031 1.125 3.53906 1.125 4.875C1.125 6.23438 1.82812 7.45312 3 8.13281C4.14844 8.8125 5.57812 8.8125 6.75 8.13281C7.89844 7.45312 8.625 6.23438 8.625 4.875ZM7.89844 8.71875C7.05469 9.375 6 9.75 4.875 9.75C2.17969 9.75 0 7.57031 0 4.875C0 2.20312 2.17969 0 4.875 0C7.54688 0 9.75 2.20312 9.75 4.875C9.75 6.02344 9.35156 7.07812 8.69531 7.92188L11.8359 11.0391C12.0469 11.2734 12.0469 11.625 11.8359 11.8359C11.6016 12.0703 11.25 12.0703 11.0391 11.8359L7.89844 8.71875Z",
4024
- fill: color
4025
- }));
4026
-
4027
- const SearchInput = props => {
4028
- const {
4029
- placeholder,
4030
- onTyping,
4031
- width,
4032
- height,
4033
- className
4034
- } = props;
4035
- const handleInputChange = e => {
4036
- onTyping(e);
4037
- };
4038
- return /*#__PURE__*/React__default["default"].createElement(TextFieldContainer, {
4039
- className: className,
4040
- width: width
4041
- }, /*#__PURE__*/React__default["default"].createElement(TextFieldInput, {
4042
- type: "search",
4043
- height: height,
4044
- placeholder: placeholder,
4045
- onChange: handleInputChange
4046
- }), /*#__PURE__*/React__default["default"].createElement(SearchIcon, null));
4047
- };
4048
- SearchInput.propTypes = {
4049
- placeholder: PropTypes.string,
4050
- width: PropTypes.string,
4051
- height: PropTypes.string,
4052
- onTyping: PropTypes.func,
4053
- className: PropTypes.string
4054
- };
4055
- SearchInput.defaultProps = {
4056
- placeholder: 'Search',
4057
- width: '100%',
4058
- height: '40px',
4059
- onTyping: () => {},
4060
- className: ''
4061
- };
4062
-
4063
- const scrollableStyles$b = `
4064
- overflow-y: auto;
4065
-
4066
- &::-webkit-scrollbar {
4067
- width: 4px;
4068
- }
4069
-
4070
- &::-webkit-scrollbar-track {
4071
- background: #E8E8E8;
4072
- border-radius: 5px;
4073
- }
4074
-
4075
- &::-webkit-scrollbar-thumb {
4076
- background: #D0D0D0;
4077
- border-radius: 5px;
4078
- }
4079
- `;
4080
- const TabMenuContainer = styled__default["default"].div`
4081
- font-family: 'Poppins', sans-serif;
4082
- display: grid;
4083
- gap: 20px;
4084
- grid-template-rows: repeat(3, auto);
4085
- `;
4086
- const TopRow = styled__default["default"].div`
4087
- display: flex;
4088
- align-items: center;
4089
- gap: 20px;
4090
- `;
4091
- const Headline$1 = styled__default["default"].span`
4092
- font-size: 18px;
4093
- font-weight: 500;
4094
- margin-right: auto;
4095
- `;
4096
- const Nav = styled__default["default"].nav`
4097
- display: flex;
4098
- flex-direction: row;
4099
-
4100
- `;
4101
- const TabActionLine = styled__default["default"].div`
4102
- margin-left: auto;
4103
- display: flex;
4104
- align-items: center;
4105
- height: 100%;
4106
- `;
4107
- const Tabs = styled__default["default"].div`
4108
- position: relative;
4109
- display: flex;
4110
- align-items: center;
4111
- width: 100%;
4112
- `;
4113
- const Tab = styled__default["default"].div`
4114
- cursor: pointer;
4115
- position: relative;
4116
- text-align: center;
4117
- padding: 8px 12px;
4118
- font-size: 16px;
4119
- color: #000000;
4120
- &.active {
4121
- font-weight: 600;
4122
- color: ${props => props.color};
4123
- border-bottom: 1mm solid #229E38;
4124
- //2px solid ${props => props.color};
4125
- }
4126
- `;
4127
- const PresentationSlider = styled__default["default"].div`
4128
- position: absolute;
4129
- bottom: 0;
4130
- left: 0;
4131
- width: 100%;
4132
- height: 2px;
4133
- background-color: #EAEAEA;
4134
- &::before {
4135
- content: '';
4136
- position: absolute;
4137
- left: 0;
4138
- z-index: 1;
4139
- width: ${props => props.width};
4140
- height: 2px;
4141
- /* background-color: ${props => props.color}; */
4142
- transform: translateX(calc(100% * ${props => props.activeTab}));
4143
- transition: transform .35s ease;
4144
- }
4145
- `;
4146
- const Body = styled__default["default"].div`
4147
- width: 100%;
4148
- ${scrollableStyles$b}
4149
- position: relative;
4150
- overflow-x: hidden;
4151
- box-sizing: border-box;
4152
- padding: ${props => props.setBackground ? '20px' : '5px'};
4153
- background-color: ${props => props.setBackground ? 'white' : 'unset'};
4154
- border-radius: ${props => props.setBackground ? '12px' : '0'};
4155
- box-shadow: ${props => props.setBackground ? '0px 0px 20px 0px rgba(0, 0, 0, 0.10)' : 'unset'};
4156
- `;
4157
- const Label$5 = styled__default["default"].div`
4158
- font-size: 12px;
4159
- font-weight: 400;
4160
- padding: 8px;
4161
- color: #5a5a5a;
4162
- background-color: #E7E7E7;
4163
- border-radius: 4px;
4164
- > span {
4165
- font-weight: 500;
4166
- }
4167
- ~ span {
4168
- margin: 0 24px;
4169
- font-weight: 400;
4170
- }
4171
- `;
4172
- const ActionsWrapper = styled__default["default"].div`
4173
- display: flex;
4174
- align-items: center;
4175
- gap: 10px;
4176
- width: 100%;
4177
- `;
4178
- const SagIconButtonWrap = styled__default["default"](SagIconButton)`
4179
- `;
4180
- const SearchInputWrap = styled__default["default"](SearchInput)`
4181
- margin-left: auto;
3824
+ gap: 10px;
3825
+ width: 100%;
3826
+ `;
3827
+ const SagIconButtonWrap = styled__default["default"](SagIconButton)`
3828
+ `;
3829
+ const SearchInputWrap = styled__default["default"](SearchInput)`
3830
+ margin-left: auto;
4182
3831
  `;
4183
3832
 
4184
3833
  const TabMenu = _ref => {
4185
3834
  let {
4186
- activeColor = '#229E38',
4187
- headlineContent = /*#__PURE__*/React__default["default"].createElement("div", null),
4188
- children = null,
4189
- className = 'TabMenuContainer',
4190
3835
  color = '#229E38',
4191
3836
  currentTab = 0,
4192
3837
  headlineInsteadTabs = false,
4193
3838
  headlineText = 'Headline',
3839
+ headlineContent = /*#__PURE__*/React__default["default"].createElement("div", null),
3840
+ className = 'TabMenuContainer',
3841
+ children = null,
3842
+ tabs = [],
4194
3843
  inputWidth = '100%',
4195
3844
  onFilterButtonClick = () => {},
4196
3845
  onSearchFieldTyping = () => {},
4197
3846
  onTabChange = () => {},
3847
+ onTopButtonClick = () => {},
4198
3848
  panelIsOpen = false,
4199
3849
  setBackground = false,
4200
3850
  showActions = true,
@@ -4205,9 +3855,7 @@ const TabMenu = _ref => {
4205
3855
  disabledButton = false,
4206
3856
  setTopRightButton = false,
4207
3857
  rightButtonText = 'Button',
4208
- rightButtonIcon = 'arrow',
4209
- onTopButtonClick = () => {},
4210
- tabs = []
3858
+ rightButtonIcon = 'arrow'
4211
3859
  } = _ref;
4212
3860
  const [activeTab, setActiveTab] = React$1.useState(currentTab);
4213
3861
  React$1.useEffect(() => {
@@ -4231,7 +3879,7 @@ const TabMenu = _ref => {
4231
3879
  iconName: "Filter",
4232
3880
  buttonText: "",
4233
3881
  openState: panelIsOpen,
4234
- activeColor: activeColor,
3882
+ activeColor: color,
4235
3883
  onButtonClick: onFilterButtonClick
4236
3884
  }), headlineInsteadTabs ? /*#__PURE__*/React__default["default"].createElement(Headline$1, null, headlineText) : /*#__PURE__*/React__default["default"].createElement(Nav, {
4237
3885
  className: "Nav"
@@ -4267,7 +3915,6 @@ const TabMenu = _ref => {
4267
3915
  }, tabs[activeTab]?.content));
4268
3916
  };
4269
3917
  TabMenu.propTypes = {
4270
- activeColor: PropTypes.string,
4271
3918
  children: PropTypes.node,
4272
3919
  className: PropTypes.string,
4273
3920
  color: PropTypes.string,
@@ -8871,7 +8518,7 @@ const MenuItemUpIcon = ({
8871
8518
  }));
8872
8519
 
8873
8520
  /* eslint-disable no-nested-ternary */
8874
- const scrollableStyles$a = `
8521
+ const scrollableStyles$b = `
8875
8522
  overflow-y: auto;
8876
8523
 
8877
8524
  &::-webkit-scrollbar {
@@ -8996,7 +8643,7 @@ const OptionsContainer$6 = styled__default["default"].div`
8996
8643
  display: ${props => props.showoptions && props.filteredoptions?.length > 0 ? 'block' : 'none'};
8997
8644
  `;
8998
8645
  const OptionsSubContainer$3 = styled__default["default"].ul`
8999
- ${scrollableStyles$a}
8646
+ ${scrollableStyles$b}
9000
8647
  list-style: none;
9001
8648
  font-weight: 400;
9002
8649
  margin: 0;
@@ -9039,7 +8686,7 @@ const ErrorMessage$3 = styled__default["default"].div`
9039
8686
  color: red;
9040
8687
  margin-top: 5px;
9041
8688
  `;
9042
- const IconContainer$4 = styled__default["default"].div`
8689
+ const IconContainer$5 = styled__default["default"].div`
9043
8690
  display: flex;
9044
8691
  padding: 2px;
9045
8692
  cursor: pointer;
@@ -9223,14 +8870,14 @@ const DropdownSingleNew = ({
9223
8870
  placeholder: isFocused ? filteredOptions.length <= 5 ? "Select Option…" : "Type To Search" : "",
9224
8871
  error: error,
9225
8872
  isFocused: isFocused
9226
- })), selectedOptions.length > 0 && xIconShow && /*#__PURE__*/React__default["default"].createElement(IconContainer$4, {
8873
+ })), selectedOptions.length > 0 && xIconShow && /*#__PURE__*/React__default["default"].createElement(IconContainer$5, {
9227
8874
  className: "IconContainer",
9228
8875
  onClick: handleClearClick
9229
8876
  }, /*#__PURE__*/React__default["default"].createElement(CloseXIcon, {
9230
8877
  width: "12px",
9231
8878
  height: "12px",
9232
8879
  fill: "#B1B1B1"
9233
- })), /*#__PURE__*/React__default["default"].createElement(IconContainer$4, {
8880
+ })), /*#__PURE__*/React__default["default"].createElement(IconContainer$5, {
9234
8881
  className: "IconContainer",
9235
8882
  onClick: handleOpenCloseMenuClick
9236
8883
  }, showOptions ? /*#__PURE__*/React__default["default"].createElement(MenuItemUpIcon, {
@@ -9338,7 +8985,7 @@ const CheckBoxNotCheckedIcon = ({
9338
8985
  };
9339
8986
 
9340
8987
  /* eslint-disable no-nested-ternary */
9341
- const scrollableStyles$9 = `
8988
+ const scrollableStyles$a = `
9342
8989
  overflow-y: auto;
9343
8990
 
9344
8991
  &::-webkit-scrollbar {
@@ -9463,7 +9110,7 @@ const OptionsContainer$5 = styled__default["default"].div`
9463
9110
  display: ${props => props.showoptions && props.filteredoptions?.length > 0 ? 'block' : 'none'};
9464
9111
  `;
9465
9112
  const OptionsSubContainer$2 = styled__default["default"].ul`
9466
- ${scrollableStyles$9}
9113
+ ${scrollableStyles$a}
9467
9114
  list-style: none;
9468
9115
  font-weight: 400;
9469
9116
  margin: 0;
@@ -9535,7 +9182,7 @@ const SelectedOptionItem$1 = styled__default["default"].div`
9535
9182
  padding: 4px 6px;
9536
9183
  font-size: 12px;
9537
9184
  `;
9538
- const IconContainer$3 = styled__default["default"].div`
9185
+ const IconContainer$4 = styled__default["default"].div`
9539
9186
  display: flex;
9540
9187
  padding: 2px;
9541
9188
  cursor: pointer;
@@ -9742,14 +9389,14 @@ const DropdownMultiNew = ({
9742
9389
  placeholder: isFocused ? filteredOptions.length <= 5 ? "Select Option…" : "Type To Search" : "",
9743
9390
  error: error,
9744
9391
  isFocused: isFocused
9745
- }) : " "), selectedOptions.length > 0 && xIconShow && /*#__PURE__*/React__default["default"].createElement(IconContainer$3, {
9392
+ }) : " "), selectedOptions.length > 0 && xIconShow && /*#__PURE__*/React__default["default"].createElement(IconContainer$4, {
9746
9393
  className: "IconContainer",
9747
9394
  onClick: handleClearClick
9748
9395
  }, /*#__PURE__*/React__default["default"].createElement(CloseXIcon, {
9749
9396
  width: "12px",
9750
9397
  height: "12px",
9751
9398
  fill: "#B1B1B1"
9752
- })), /*#__PURE__*/React__default["default"].createElement(IconContainer$3, {
9399
+ })), /*#__PURE__*/React__default["default"].createElement(IconContainer$4, {
9753
9400
  className: "IconContainer",
9754
9401
  onClick: handleOpenCloseMenuClick
9755
9402
  }, showOptions ? /*#__PURE__*/React__default["default"].createElement(MenuItemUpIcon, {
@@ -9777,7 +9424,7 @@ const DropdownMultiNew = ({
9777
9424
  key: option.value,
9778
9425
  onClick: () => toggleOption(option),
9779
9426
  selected: isDropdowned(option)
9780
- }, " ", /*#__PURE__*/React__default["default"].createElement(IconContainer$3, {
9427
+ }, " ", /*#__PURE__*/React__default["default"].createElement(IconContainer$4, {
9781
9428
  className: "IconContainer"
9782
9429
  }, selectedOptions.find(itemSelectedOptions => option.value === itemSelectedOptions.value) ? /*#__PURE__*/React__default["default"].createElement(CheckBoxCheckedIcon, {
9783
9430
  width: "14px",
@@ -11420,7 +11067,7 @@ const AllFieldsContainer = styled__default["default"].div`
11420
11067
  flex-wrap: wrap;
11421
11068
  width: 100%;
11422
11069
  `;
11423
- const FieldsContainer = styled__default["default"].div`
11070
+ const FieldsContainer$1 = styled__default["default"].div`
11424
11071
  display: flex;
11425
11072
  flex-direction: column;
11426
11073
  white-space: wrap;
@@ -11572,7 +11219,7 @@ const FilterPanel = props => {
11572
11219
  const mm = String(date.getMonth() + 1).padStart(2, '0');
11573
11220
  const dd = String(date.getDate()).padStart(2, '0');
11574
11221
  const yyyy = date.getFullYear();
11575
- return `${dd}/${mm}/${yyyy}`;
11222
+ return `${mm}/${dd}/${yyyy}`;
11576
11223
  };
11577
11224
  return `${formatDate(startOfYear)} - ${formatDate(now)}`;
11578
11225
  };
@@ -11794,6 +11441,7 @@ const FilterPanel = props => {
11794
11441
  borderRadius: "12px",
11795
11442
  label: "Date Range",
11796
11443
  onChange: eventRangePicker => {
11444
+ // Allow changes to the date range even in YTD mode
11797
11445
  const selectedValue = eventRangePicker && typeof eventRangePicker === 'string' ? `${eventRangePicker}` : undefined;
11798
11446
  const newFieldsDataState = FieldsDataState?.map(itemField => itemField.name === item.name ? {
11799
11447
  ...itemField,
@@ -11813,7 +11461,7 @@ const FilterPanel = props => {
11813
11461
  },
11814
11462
  required: item.required,
11815
11463
  placeholder: "Select Date Range ...",
11816
- selectedValue: getYTDString(),
11464
+ selectedValue: item.selectedValue || getYTDString(),
11817
11465
  disabled: true,
11818
11466
  width: "100%",
11819
11467
  height: "55px"
@@ -11979,7 +11627,7 @@ const FilterPanel = props => {
11979
11627
  if (!data || data.length === 0) {
11980
11628
  return '';
11981
11629
  }
11982
- return /*#__PURE__*/React__default["default"].createElement(FieldsContainer, {
11630
+ return /*#__PURE__*/React__default["default"].createElement(FieldsContainer$1, {
11983
11631
  className: "FieldsContainer"
11984
11632
  }, data?.map((item, i) => /*#__PURE__*/React__default["default"].createElement(FieldContainer$1, {
11985
11633
  key: `${item.name}-${i}`,
@@ -12173,7 +11821,7 @@ const SortIcon = _ref => {
12173
11821
  }))));
12174
11822
  };
12175
11823
 
12176
- const scrollableStyles$8 = `
11824
+ const scrollableStyles$9 = `
12177
11825
  overflow-y: auto;
12178
11826
 
12179
11827
  &::-webkit-scrollbar {
@@ -12408,7 +12056,7 @@ const TableWrapper = styled__default["default"].div`
12408
12056
  border: 1px solid #dddddd;
12409
12057
  border-radius: ${props => props.columnsNumber > props.maxColumnsNumber ? ' 12px 12px 6px 6px' : '12px'};
12410
12058
  overflow-x: ${props => props.columnsNumber > props.maxColumnsNumber ? 'auto' : 'hidden'};
12411
- ${scrollableStyles$8}
12059
+ ${scrollableStyles$9}
12412
12060
  `;
12413
12061
  const Table = styled__default["default"].table`
12414
12062
  font-family: "Poppins", sans-serif;
@@ -12999,7 +12647,7 @@ EventListItem.defaultProps = {
12999
12647
  onClick: () => {}
13000
12648
  };
13001
12649
 
13002
- const MainContainer$4 = styled__default["default"].div`
12650
+ const MainContainer$5 = styled__default["default"].div`
13003
12651
  /* display: flex; */
13004
12652
  position: relative;
13005
12653
  font-family: "Poppins", sans-serif;
@@ -13062,7 +12710,7 @@ const EventList = props => {
13062
12710
  };
13063
12711
 
13064
12712
  //= ======================================== MAIN RETURN ====================================
13065
- return /*#__PURE__*/React__default["default"].createElement(MainContainer$4, {
12713
+ return /*#__PURE__*/React__default["default"].createElement(MainContainer$5, {
13066
12714
  id: "MainContainer",
13067
12715
  height: height,
13068
12716
  width: width
@@ -13258,7 +12906,7 @@ const CollapseMenuItemContentContainer = styled__default["default"].div`
13258
12906
  font-size: 12px;
13259
12907
  }
13260
12908
  `;
13261
- const MainContainer$3 = styled__default["default"].div`
12909
+ const MainContainer$4 = styled__default["default"].div`
13262
12910
  width: ${props => props.width};
13263
12911
  height: ${props => props.height};
13264
12912
  display: flex;
@@ -13273,7 +12921,7 @@ const DraftTag$1 = styled__default["default"].div`
13273
12921
  height: fit-content;
13274
12922
  `;
13275
12923
 
13276
- const MainContainer$2 = styled__default["default"].div`
12924
+ const MainContainer$3 = styled__default["default"].div`
13277
12925
  width: ${props => props.width};
13278
12926
  height: ${props => props.height};
13279
12927
  font-family: 'Poppins', sans-serif;
@@ -13390,7 +13038,7 @@ const BannerEventBox = props => {
13390
13038
  const onInfoClickHandler = event => {
13391
13039
  onInfoClick(event);
13392
13040
  };
13393
- return /*#__PURE__*/React__default["default"].createElement(MainContainer$2, {
13041
+ return /*#__PURE__*/React__default["default"].createElement(MainContainer$3, {
13394
13042
  height: height,
13395
13043
  width: width
13396
13044
  }, /*#__PURE__*/React__default["default"].createElement(TitleWrapper, null, formatedBanners().icon, "|", /*#__PURE__*/React__default["default"].createElement(CardTitle, null, formatedBanners().name)), /*#__PURE__*/React__default["default"].createElement(Block, null, /*#__PURE__*/React__default["default"].createElement(Headline, null, "Event Description"), /*#__PURE__*/React__default["default"].createElement(Text, null, description)), /*#__PURE__*/React__default["default"].createElement(Block, null, /*#__PURE__*/React__default["default"].createElement(Headline, null, "Event Dates:"), /*#__PURE__*/React__default["default"].createElement(Text, null, dates.join(" - "))), /*#__PURE__*/React__default["default"].createElement(ButtonWrap, null, /*#__PURE__*/React__default["default"].createElement(Button, {
@@ -13500,7 +13148,7 @@ const BannerEventBoxList = props => {
13500
13148
  color: toggleColor
13501
13149
  }))), IsItemOpen && /*#__PURE__*/React.createElement(CollapseMenuItemContentContainer, {
13502
13150
  id: "CollapseMenuItemContentContainer"
13503
- }, cardsContent ? /*#__PURE__*/React.createElement(MainContainer$3, {
13151
+ }, cardsContent ? /*#__PURE__*/React.createElement(MainContainer$4, {
13504
13152
  width: width,
13505
13153
  height: height
13506
13154
  }, data.map(item => /*#__PURE__*/React.createElement(BannerEventBox, {
@@ -13588,7 +13236,7 @@ BannerEventBoxList.defaultProps = {
13588
13236
  showDraft: false
13589
13237
  };
13590
13238
 
13591
- const scrollableStyles$7 = `
13239
+ const scrollableStyles$8 = `
13592
13240
  overflow-y: auto;
13593
13241
 
13594
13242
  &::-webkit-scrollbar {
@@ -13625,7 +13273,7 @@ const Modal = styled__default["default"].div`
13625
13273
  width: 79%;
13626
13274
  max-width: 1500px;
13627
13275
  margin: 0 auto;
13628
- ${scrollableStyles$7}
13276
+ ${scrollableStyles$8}
13629
13277
  `;
13630
13278
  const ModalHeader = styled__default["default"].div`
13631
13279
  display: flex;
@@ -13634,7 +13282,7 @@ const ModalHeader = styled__default["default"].div`
13634
13282
  margin-bottom: 32px;
13635
13283
  `;
13636
13284
  const ModalBody = styled__default["default"].div`
13637
- ${scrollableStyles$7}
13285
+ ${scrollableStyles$8}
13638
13286
  max-height: 80vh;
13639
13287
  `;
13640
13288
  const ModalTitle = styled__default["default"].h5`
@@ -23889,7 +23537,7 @@ const TheGiantCompanyIcon = _ref => {
23889
23537
  })));
23890
23538
  };
23891
23539
 
23892
- const MainContainer$1 = styled__default["default"].div`
23540
+ const MainContainer$2 = styled__default["default"].div`
23893
23541
  display: flex;
23894
23542
  position: relative;
23895
23543
  font-family: "Poppins", sans-serif;
@@ -24182,7 +23830,7 @@ const CollapseHeader = props => {
24182
23830
  } = viewCreativeContainerRef.current;
24183
23831
  return (offsetTop + 33).toString().concat("", "px");
24184
23832
  };
24185
- return /*#__PURE__*/React__default["default"].createElement(MainContainer$1, {
23833
+ return /*#__PURE__*/React__default["default"].createElement(MainContainer$2, {
24186
23834
  id: "CollapseHeader",
24187
23835
  className: className,
24188
23836
  height: height,
@@ -24456,7 +24104,7 @@ const ErrorMessage$1 = styled__default["default"].div`
24456
24104
  color: red;
24457
24105
  margin-top: 5px;
24458
24106
  `;
24459
- const IconContainer$2 = styled__default["default"].div`
24107
+ const IconContainer$3 = styled__default["default"].div`
24460
24108
  padding: 2px;
24461
24109
  cursor: pointer;
24462
24110
  `;
@@ -24630,7 +24278,7 @@ const QuickFilterDropdownSingle = _ref => {
24630
24278
  width: "12px",
24631
24279
  height: "12px",
24632
24280
  fill: "#B1B1B1"
24633
- })), /*#__PURE__*/React__default["default"].createElement(IconContainer$2, {
24281
+ })), /*#__PURE__*/React__default["default"].createElement(IconContainer$3, {
24634
24282
  className: "IconContainer",
24635
24283
  onClick: handleOpenCloseMenuClick
24636
24284
  }, showOptions ? /*#__PURE__*/React__default["default"].createElement(MenuItemUpIcon, {
@@ -24872,7 +24520,7 @@ const SelectedOptionItem = styled__default["default"].div`
24872
24520
  padding: 4px 6px;
24873
24521
  font-size: 12px;
24874
24522
  `;
24875
- const IconContainer$1 = styled__default["default"].div`
24523
+ const IconContainer$2 = styled__default["default"].div`
24876
24524
  display: flex;
24877
24525
  padding: 2px;
24878
24526
  cursor: pointer;
@@ -25090,14 +24738,14 @@ const QuickFilterDropdownMultiSelection = _ref => {
25090
24738
  placeholder: isFocused ? placeHolder || 'Type to search...' : '',
25091
24739
  error: error,
25092
24740
  isFocused: isFocused
25093
- }) : ' '), selectedOptions.length > 0 && xIconShow && /*#__PURE__*/React__default["default"].createElement(IconContainer$1, {
24741
+ }) : ' '), selectedOptions.length > 0 && xIconShow && /*#__PURE__*/React__default["default"].createElement(IconContainer$2, {
25094
24742
  className: "IconContainer",
25095
24743
  onClick: handleClearClick
25096
24744
  }, /*#__PURE__*/React__default["default"].createElement(CloseXIcon, {
25097
24745
  width: "12px",
25098
24746
  height: "12px",
25099
24747
  fill: "#B1B1B1"
25100
- })), /*#__PURE__*/React__default["default"].createElement(IconContainer$1, {
24748
+ })), /*#__PURE__*/React__default["default"].createElement(IconContainer$2, {
25101
24749
  className: "IconContainer",
25102
24750
  onClick: handleOpenCloseMenuClick
25103
24751
  }, showOptions ? /*#__PURE__*/React__default["default"].createElement(MenuItemUpIcon, {
@@ -25125,7 +24773,7 @@ const QuickFilterDropdownMultiSelection = _ref => {
25125
24773
  key: option.value,
25126
24774
  onClick: () => toggleOption(option),
25127
24775
  selected: isDropdowned(option)
25128
- }, highlightText(option.label, inputValue), /*#__PURE__*/React__default["default"].createElement(IconContainer$1, {
24776
+ }, highlightText(option.label, inputValue), /*#__PURE__*/React__default["default"].createElement(IconContainer$2, {
25129
24777
  className: "IconContainer"
25130
24778
  }, selectedOptions.find(itemSelectedOptions => option.value === itemSelectedOptions.value) ? /*#__PURE__*/React__default["default"].createElement(CheckBoxCheckedIcon, {
25131
24779
  width: "14px",
@@ -25308,6 +24956,24 @@ classnames.exports;
25308
24956
  var classnamesExports = classnames.exports;
25309
24957
  var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
25310
24958
 
24959
+ const ExportIcon = _ref => {
24960
+ let {
24961
+ width = '14',
24962
+ height = '15',
24963
+ color = '#212121'
24964
+ } = _ref;
24965
+ return /*#__PURE__*/React__default["default"].createElement("svg", {
24966
+ width: width,
24967
+ height: height,
24968
+ viewBox: "0 0 14 15",
24969
+ fill: "none",
24970
+ xmlns: "http://www.w3.org/2000/svg"
24971
+ }, /*#__PURE__*/React__default["default"].createElement("path", {
24972
+ d: "M8.3125 0.90625C8.3125 0.550781 8.58594 0.25 8.96875 0.25H13.3164C13.6992 0.25 13.9727 0.550781 13.9727 0.90625V5.28125C13.9727 5.66406 13.6992 5.9375 13.3164 5.9375C12.9609 5.9375 12.6602 5.66406 12.6602 5.28125V2.49219L6.5625 8.58984C6.31641 8.86328 5.90625 8.86328 5.66016 8.58984C5.38672 8.34375 5.38672 7.93359 5.66016 7.66016L11.7578 1.5625H8.96875C8.58594 1.5625 8.3125 1.28906 8.3125 0.90625ZM1.96875 1.125H5.46875C5.82422 1.125 6.125 1.42578 6.125 1.78125C6.125 2.16406 5.82422 2.4375 5.46875 2.4375H1.96875C1.58594 2.4375 1.3125 2.73828 1.3125 3.09375V12.2812C1.3125 12.6641 1.58594 12.9375 1.96875 12.9375H11.1562C11.5117 12.9375 11.8125 12.6641 11.8125 12.2812V8.78125C11.8125 8.42578 12.0859 8.125 12.4688 8.125C12.8242 8.125 13.125 8.42578 13.125 8.78125V12.2812C13.125 13.375 12.2227 14.25 11.1562 14.25H1.96875C0.875 14.25 0 13.375 0 12.2812V3.09375C0 2.02734 0.875 1.125 1.96875 1.125Z",
24973
+ fill: color
24974
+ }));
24975
+ };
24976
+
25311
24977
  const UpArrowIcon = _ref => {
25312
24978
  let {
25313
24979
  width = '10',
@@ -25368,7 +25034,7 @@ const OneColumnContainerMainDiv = styled__default["default"].div`
25368
25034
  box-sizing: border-box;
25369
25035
  }
25370
25036
  `;
25371
- const InfoTextContainer = styled__default["default"].div`
25037
+ const InfoTextContainer$1 = styled__default["default"].div`
25372
25038
  overflow: auto;
25373
25039
  padding: 20px;
25374
25040
  box-sizing: border-box;
@@ -25380,7 +25046,7 @@ const InfoTitleLabel = styled__default["default"].div`
25380
25046
  font-size: 18px;
25381
25047
  line-height: 32px;
25382
25048
  `;
25383
- const InfoTextLabel = styled__default["default"].div`
25049
+ const InfoTextLabel$1 = styled__default["default"].div`
25384
25050
  color: black;
25385
25051
  font-size: 14px;
25386
25052
  line-height: 20px;
@@ -25393,7 +25059,7 @@ const ColumnTitle = styled__default["default"].span`
25393
25059
  font-weight: 500;
25394
25060
  padding: 20px 20px 0;
25395
25061
  `;
25396
- const IconContainer = styled__default["default"].div`
25062
+ const IconContainer$1 = styled__default["default"].div`
25397
25063
  width: 20px;
25398
25064
  height: 20px;
25399
25065
  top: 10px;
@@ -25415,7 +25081,7 @@ const BannerContainer = styled__default["default"].div`
25415
25081
  right: ${props => props.right};
25416
25082
  user-select: none;
25417
25083
  `;
25418
- const OutBanner$1 = styled__default["default"].div`
25084
+ const OutBanner$2 = styled__default["default"].div`
25419
25085
  display: flex;
25420
25086
  justify-content: flex-end;
25421
25087
  align-items: center;
@@ -25448,7 +25114,7 @@ const PercentOfChange = styled__default["default"].div`
25448
25114
  align-items: baseline;
25449
25115
  justify-content: center;
25450
25116
  padding: 4px 8px;
25451
- background-color: ${props => props.isPercentDataPositive ? '#E8F5EB' : '#FFE9EB'};
25117
+ background-color: ${props => props.isPercentDataPositive > 0 ? '#E8F5EB' : props.isPercentDataPositive < 0 ? '#FFE9EB' : '#E3E4E5'}; /* Gray for 0 */
25452
25118
  color: #333333;
25453
25119
  border-radius: 12px 0px 12px 0px;
25454
25120
  font-size: 12px;
@@ -25528,7 +25194,6 @@ const OneColumnContainer = props => {
25528
25194
  React$1.useEffect(() => {
25529
25195
  setOffsetWidth(anotherRef?.current?.offsetWidth);
25530
25196
  }, [anotherRef]);
25531
- const isPercentDataPositive = PercentOfChangeData > 0;
25532
25197
  return /*#__PURE__*/React__default["default"].createElement(StyledContainer, {
25533
25198
  className: classNames('OneColumnContainer', itemClass, overStyle, draggingStyle, children && droppedStyle, divStyle),
25534
25199
  width: width,
@@ -25553,37 +25218,37 @@ const OneColumnContainer = props => {
25553
25218
  }, columnTitle), !isLoading && showViewByBannerButton && !hover && /*#__PURE__*/React__default["default"].createElement(BannerContainer, {
25554
25219
  className: "BannerContainer",
25555
25220
  right: disableInfo ? '20px' : '45px'
25556
- }, /*#__PURE__*/React__default["default"].createElement(OutBanner$1, {
25221
+ }, /*#__PURE__*/React__default["default"].createElement(OutBanner$2, {
25557
25222
  className: "OutBanner",
25558
25223
  onClick: () => onBannerClick({
25559
25224
  eventName: 'onBannerClick'
25560
25225
  })
25561
- }, /*#__PURE__*/React__default["default"].createElement(ExportIcon, null), "By Banner")), !isLoading && !hover && children, !disableInfo && !isLoading && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(IconContainer, {
25226
+ }, /*#__PURE__*/React__default["default"].createElement(ExportIcon, null), "By Banner")), !isLoading && !hover && children, !disableInfo && !isLoading && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(IconContainer$1, {
25562
25227
  className: "IconContainer",
25563
25228
  onMouseEnter: () => setHover(true),
25564
25229
  onMouseLeave: () => setHover(false)
25565
- }, /*#__PURE__*/React__default["default"].createElement(InfoIcon, null)), hover && /*#__PURE__*/React__default["default"].createElement(InfoTextContainer, {
25230
+ }, /*#__PURE__*/React__default["default"].createElement(InfoIcon, null)), hover && /*#__PURE__*/React__default["default"].createElement(InfoTextContainer$1, {
25566
25231
  className: "InfoTextContainer"
25567
25232
  }, infoTitle && /*#__PURE__*/React__default["default"].createElement(InfoTitleLabel, {
25568
25233
  className: "InfoTitleLabel",
25569
25234
  dangerouslySetInnerHTML: {
25570
25235
  __html: infoTitle
25571
25236
  }
25572
- }), /*#__PURE__*/React__default["default"].createElement(InfoTextLabel, {
25237
+ }), /*#__PURE__*/React__default["default"].createElement(InfoTextLabel$1, {
25573
25238
  className: "InfoTextLabel",
25574
25239
  dangerouslySetInnerHTML: {
25575
25240
  __html: infoText
25576
25241
  }
25577
25242
  }))), isPercentOfChange && !isLoading && /*#__PURE__*/React__default["default"].createElement(PercentOfChange, {
25578
25243
  className: "PercentOfChange",
25579
- isPercentDataPositive: isPercentDataPositive
25580
- }, isPercentDataPositive ? /*#__PURE__*/React__default["default"].createElement(UpArrowIcon, {
25244
+ isPercentDataPositive: PercentOfChangeData
25245
+ }, PercentOfChangeData > 0 ? /*#__PURE__*/React__default["default"].createElement(UpArrowIcon, {
25581
25246
  width: "11",
25582
25247
  height: "10"
25583
- }) : /*#__PURE__*/React__default["default"].createElement(DownArrowIcon, {
25248
+ }) : PercentOfChangeData < 0 ? /*#__PURE__*/React__default["default"].createElement(DownArrowIcon, {
25584
25249
  width: "11",
25585
25250
  height: "10"
25586
- }), `${Math.abs(PercentOfChangeData)}%`), isLoading && /*#__PURE__*/React__default["default"].createElement(LoadingDiv, {
25251
+ }) : null, `${Math.abs(PercentOfChangeData)}%`), isLoading && /*#__PURE__*/React__default["default"].createElement(LoadingDiv, {
25587
25252
  className: "loadingDiv"
25588
25253
  }, /*#__PURE__*/React__default["default"].createElement(Skeleton.SkeletonTheme, {
25589
25254
  baseColor: "#EAEAEA"
@@ -25627,1335 +25292,1732 @@ OneColumnContainer.propTypes = {
25627
25292
  showBackgroundImage: PropTypes.bool,
25628
25293
  backgroundImageStyle: PropTypes.object
25629
25294
  };
25630
- OneColumnContainer.defaultProps = {
25631
- children: null,
25632
- display: 'block',
25633
- isLoading: '',
25634
- gridTemplateColumns: '',
25635
- itemClass: '',
25636
- divStyle: '',
25637
- overStyle: '',
25638
- draggingStyle: '',
25639
- droppedStyle: '',
25640
- width: '300px',
25641
- height: '300px',
25642
- overflow: 'hidden',
25643
- transparentBackground: false,
25644
- infoTitle: '',
25645
- infoText: '',
25646
- disableInfo: false,
25647
- showViewByBannerButton: false,
25648
- onBannerClick: () => {},
25649
- columnTitle: '',
25650
- isPercentOfChange: false,
25651
- PercentOfChangeData: 0,
25652
- backgroundImage: '',
25653
- showBackgroundImage: false,
25654
- backgroundImageStyle: {}
25295
+ OneColumnContainer.defaultProps = {
25296
+ children: null,
25297
+ display: 'block',
25298
+ isLoading: '',
25299
+ gridTemplateColumns: '',
25300
+ itemClass: '',
25301
+ divStyle: '',
25302
+ overStyle: '',
25303
+ draggingStyle: '',
25304
+ droppedStyle: '',
25305
+ width: '300px',
25306
+ height: '300px',
25307
+ overflow: 'hidden',
25308
+ transparentBackground: false,
25309
+ infoTitle: '',
25310
+ infoText: '',
25311
+ disableInfo: false,
25312
+ showViewByBannerButton: false,
25313
+ onBannerClick: () => {},
25314
+ columnTitle: '',
25315
+ isPercentOfChange: false,
25316
+ PercentOfChangeData: 0,
25317
+ backgroundImage: '',
25318
+ showBackgroundImage: false,
25319
+ backgroundImageStyle: {}
25320
+ };
25321
+
25322
+ const scrollableStyles$7 = `
25323
+ overflow-y: auto;
25324
+
25325
+ &::-webkit-scrollbar {
25326
+ width: 8px;
25327
+ }
25328
+
25329
+ &::-webkit-scrollbar-track {
25330
+ background: #E8E8E8;
25331
+ border-radius: 5px;
25332
+ }
25333
+
25334
+ &::-webkit-scrollbar-thumb {
25335
+ background: #D0D0D0;
25336
+ border-radius: 5px;
25337
+ }
25338
+ `;
25339
+ const ControlsContainer$7 = styled__default["default"].div`
25340
+ position: relative;
25341
+ font-family: "Poppins", sans-serif;
25342
+ font-style: normal;
25343
+ font-weight: 500;
25344
+ font-size: 20px;
25345
+ color: ${props => props.textcolor};
25346
+ width: ${props => props.width};
25347
+ height: ${props => props.height};
25348
+ display: flex;
25349
+ align-items: center;
25350
+ @media (max-width: 1536px) {
25351
+ ${scrollableStyles$7}
25352
+ }
25353
+
25354
+ > * {
25355
+ box-sizing: border-box;
25356
+ }
25357
+ `;
25358
+ const Controls$6 = styled__default["default"].div`
25359
+ display: flex;
25360
+ flex-direction: column;
25361
+ width: 100%;
25362
+ height: 100%;
25363
+ background: white;
25364
+ `;
25365
+ const TitleAndValueContainer$3 = styled__default["default"].div`
25366
+ display: flex;
25367
+ flex-direction: column;
25368
+ `;
25369
+ const Title$c = styled__default["default"].h4`
25370
+ font-weight: 400;
25371
+ font-size: 20px;
25372
+ margin: 0;
25373
+ @media (max-width: 1536px) {
25374
+ font-size: 14px;
25375
+ }
25376
+ @media (max-width: 1366px) {
25377
+ font-size: 10px;
25378
+ }
25379
+ `;
25380
+ const CurrencySignAndFormattedValueContainer$1 = styled__default["default"].div`
25381
+ display: flex;
25382
+ align-items: center;
25383
+ gap: 16px;
25384
+ `;
25385
+ const CurrencySignOrPercent = styled__default["default"].span`
25386
+ font-weight: 500;
25387
+ font-size: 16px;
25388
+ @media (max-width: 1536px) {
25389
+ font-size: 14px;
25390
+ }
25391
+ @media (max-width: 1366px) {
25392
+ font-size: 11px;
25393
+ }
25394
+ `;
25395
+ const FormattedValueText = styled__default["default"].div`
25396
+ font-weight: 500;
25397
+ font-size: 40px;
25398
+ @media (max-width: 1536px) {
25399
+ font-size: 34px;
25400
+ }
25401
+ @media (max-width: 1366px) {
25402
+ font-size: 28px;
25403
+ }
25404
+ `;
25405
+
25406
+ const FormattedValue$3 = props => {
25407
+ const {
25408
+ className,
25409
+ title,
25410
+ subtitle,
25411
+ showTopValue,
25412
+ value,
25413
+ dotCut,
25414
+ currencySign,
25415
+ currencyType,
25416
+ width,
25417
+ height,
25418
+ textcolor,
25419
+ isPercent
25420
+ } = props;
25421
+ return /*#__PURE__*/React__default["default"].createElement(ControlsContainer$7, {
25422
+ className: className || 'FormattedValue_ControlsContainer',
25423
+ height: height,
25424
+ width: width,
25425
+ textcolor: textcolor
25426
+ }, /*#__PURE__*/React__default["default"].createElement(Controls$6, {
25427
+ className: "Controls",
25428
+ height: height,
25429
+ width: width
25430
+ }, /*#__PURE__*/React__default["default"].createElement(TitleAndValueContainer$3, {
25431
+ className: "TitleAndValueContainer"
25432
+ }, title ? /*#__PURE__*/React__default["default"].createElement(Title$c, {
25433
+ className: "Title",
25434
+ width: width
25435
+ }, title) : '', showTopValue && /*#__PURE__*/React__default["default"].createElement(CurrencySignAndFormattedValueContainer$1, {
25436
+ className: "CurrencySignAndFormattedValueContainer"
25437
+ }, /*#__PURE__*/React__default["default"].createElement(FormattedValueText, {
25438
+ className: "FormattedValueText",
25439
+ width: width
25440
+ }, /*#__PURE__*/React__default["default"].createElement(CurrencySignOrPercent, {
25441
+ className: "CurrencySignOrPercent"
25442
+ }, currencySign ? getCurrencySign(currencyType, value) : ''), dotCut ? getFormattedValue(value && Math.abs(value) > 0 && value % 1 !== 0 ? value?.toFixed(2) : value) : getNumberWithCommas(value), dotCut ? getFormattedUnits(value) : '', /*#__PURE__*/React__default["default"].createElement(CurrencySignOrPercent, {
25443
+ className: "CurrencySignOrPercent"
25444
+ }, isPercent ? '%' : ''))), subtitle ? /*#__PURE__*/React__default["default"].createElement(Title$c, {
25445
+ className: "Title",
25446
+ width: width
25447
+ }, subtitle) : '')));
25448
+ };
25449
+ FormattedValue$3.propTypes = {
25450
+ className: PropTypes.string,
25451
+ title: PropTypes.string,
25452
+ subtitle: PropTypes.string,
25453
+ showTopValue: PropTypes.bool,
25454
+ value: PropTypes.number,
25455
+ dotCut: PropTypes.bool,
25456
+ currencySign: PropTypes.bool,
25457
+ currencyType: PropTypes.string,
25458
+ width: PropTypes.string,
25459
+ height: PropTypes.string,
25460
+ textcolor: PropTypes.string,
25461
+ isPercent: PropTypes.bool
25462
+ };
25463
+ FormattedValue$3.defaultProps = {
25464
+ className: 'FormattedValue_ControlsContainer',
25465
+ title: '',
25466
+ subtitle: '',
25467
+ showTopValue: true,
25468
+ value: 0,
25469
+ dotCut: false,
25470
+ currencySign: false,
25471
+ currencyType: 'USD',
25472
+ width: '100%',
25473
+ height: '100%',
25474
+ textcolor: '#212121',
25475
+ isPercent: false
25655
25476
  };
25656
25477
 
25657
- const scrollableStyles$6 = `
25658
- overflow-y: auto;
25659
-
25660
- &::-webkit-scrollbar {
25661
- width: 8px;
25662
- }
25663
-
25664
- &::-webkit-scrollbar-track {
25665
- background: #E8E8E8;
25666
- border-radius: 5px;
25667
- }
25668
-
25669
- &::-webkit-scrollbar-thumb {
25670
- background: #D0D0D0;
25671
- border-radius: 5px;
25672
- }
25673
- `;
25674
- const ControlsContainer$7 = styled__default["default"].div`
25478
+ const ControlsContainer$6 = styled__default["default"].div`
25675
25479
  position: relative;
25676
25480
  font-family: "Poppins", sans-serif;
25677
- font-style: normal;
25678
- font-weight: 500;
25679
- font-size: 20px;
25680
- color: ${props => props.textcolor};
25481
+ color: #212121;
25681
25482
  width: ${props => props.width};
25682
25483
  height: ${props => props.height};
25484
+ min-width: 250px;
25485
+ `;
25486
+ const Controls$5 = styled__default["default"].div`
25487
+ height: 100%;
25488
+ width: 100%;
25489
+ background: white;
25490
+ display: flex;
25491
+ flex-direction: column;
25492
+ `;
25493
+ const TooltipDiv$3 = styled__default["default"].div`
25494
+ border-radius: 5px;
25495
+ padding: 8px 12px;
25496
+ background: white;
25497
+ box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);
25498
+ margin: 0;
25499
+ `;
25500
+ const TooltipLabel$3 = styled__default["default"].div`
25501
+ color: #212121;
25502
+ font-size: 14px;
25503
+ font-weight: 400;
25504
+ width: fit-content;
25505
+ `;
25506
+ const TooltipTitle$3 = styled__default["default"].div`
25507
+ color: #212121;
25508
+ font-size: 14px;
25509
+ font-weight: 600;
25510
+ `;
25511
+ const TitleAndValueContainer$2 = styled__default["default"].div`
25512
+ padding: 0 1rem;
25513
+ `;
25514
+ const Title$b = styled__default["default"].h5`
25515
+ font-weight: 500;
25516
+ font-size: 18px;
25517
+ line-height: 20px;
25518
+ margin: 0;
25519
+ @media (max-width: 1536px) {
25520
+ font-size: 16px;
25521
+ }
25522
+ @media (max-width: 1366px) {
25523
+ font-size: 14px;
25524
+ }
25525
+ `;
25526
+ const EventWeeksLegendMainContainer = styled__default["default"].div`
25527
+ display: flex;
25528
+ justify-content: center;
25529
+ flex-direction: column;
25530
+ margin: 2px 0 0 0;
25531
+ padding-left: 55px;
25532
+ align-items: center;
25533
+ `;
25534
+ const EventWeeksLegendDataElementsContainer = styled__default["default"].div`
25683
25535
  display: flex;
25536
+ margin: 0px;
25684
25537
  align-items: center;
25538
+ justify-content: space-around;
25539
+ width: 100%;
25540
+ `;
25541
+ const EventWeeksLegendDataElement = styled__default["default"].h4`
25542
+ display: flex;
25543
+ font-weight: ${props => props.fontWeight};
25544
+ font-size: 12px;
25545
+ line-height: 15px;
25546
+ margin: 0;
25547
+ width: 100%;
25548
+ justify-content: center;
25549
+ align-content: center;
25550
+ color: ${props => props.textColor};
25551
+ border-top-left-radius: ${props => props.borderLeftRadius};
25552
+ border-bottom-left-radius: ${props => props.borderLeftRadius};
25553
+ border-top-right-radius: ${props => props.borderRightRadius};
25554
+ border-bottom-right-radius: ${props => props.borderRightRadius};
25555
+ background: ${props => props.color};
25685
25556
  @media (max-width: 1536px) {
25686
- ${scrollableStyles$6}
25557
+ font-size: 11px;
25558
+ }
25559
+ @media (max-width: 1366px) {
25560
+ font-size: 10px;
25687
25561
  }
25562
+ `;
25563
+ const LegendWrapper = styled__default["default"].div`
25564
+ padding-top: 15px;
25565
+ `;
25566
+
25567
+ const LegendUnionIcon = _ref => {
25568
+ let {
25569
+ width = '18',
25570
+ height = '5',
25571
+ color = '#9CCB3B'
25572
+ } = _ref;
25573
+ return /*#__PURE__*/React__default["default"].createElement("svg", {
25574
+ width: width,
25575
+ height: height,
25576
+ viewBox: "0 0 18 5",
25577
+ fill: "none",
25578
+ xmlns: "http://www.w3.org/2000/svg"
25579
+ }, /*#__PURE__*/React__default["default"].createElement("path", {
25580
+ fillRule: "evenodd",
25581
+ clipRule: "evenodd",
25582
+ d: "M11.45 2H17C17.2761 2 17.5 2.22386 17.5 2.5C17.5 2.77614 17.2761 3 17 3H11.45C11.2184 4.14112 10.2095 5 9 5C7.79052 5 6.78164 4.14112 6.55001 3H1C0.723858 3 0.5 2.77614 0.5 2.5C0.5 2.22386 0.723858 2 1 2H6.55001C6.78164 0.85888 7.79052 0 9 0C10.2095 0 11.2184 0.85888 11.45 2Z",
25583
+ fill: color
25584
+ }));
25585
+ };
25586
+
25587
+ const LegendLineIcon = _ref => {
25588
+ let {
25589
+ width = '19',
25590
+ height = '3',
25591
+ color = '#9CCB3B'
25592
+ } = _ref;
25593
+ return /*#__PURE__*/React__default["default"].createElement("svg", {
25594
+ width: width,
25595
+ height: height,
25596
+ viewBox: "0 0 19 3",
25597
+ fill: "none",
25598
+ xmlns: "http://www.w3.org/2000/svg"
25599
+ }, /*#__PURE__*/React__default["default"].createElement("path", {
25600
+ fillRule: "evenodd",
25601
+ clipRule: "evenodd",
25602
+ d: "M0 1.5C0 0.671573 0.671573 0 1.5 0H17.5C18.3284 0 19 0.671572 19 1.5C19 2.32843 18.3284 3 17.5 3H1.5C0.671575 3 0 2.32843 0 1.5Z",
25603
+ fill: color
25604
+ }));
25605
+ };
25606
+
25607
+ const ControlsContainer$5 = styled__default["default"].div`
25608
+ position: relative;
25609
+ font-family: "Poppins", sans-serif;
25610
+ font-size: ${props => props.rootFont};
25611
+ color: ${props => props.textColor};
25612
+ width: ${props => props.width};
25613
+ height: ${props => props.height};
25688
25614
 
25689
25615
  > * {
25690
25616
  box-sizing: border-box;
25691
25617
  }
25692
25618
  `;
25693
- const Controls$6 = styled__default["default"].div`
25619
+ const Controls$4 = styled__default["default"].div`
25694
25620
  display: flex;
25621
+ gap: 20px;
25695
25622
  flex-direction: column;
25696
25623
  width: 100%;
25697
25624
  height: 100%;
25698
- background: white;
25625
+ background: white;
25699
25626
  `;
25700
- const TitleAndValueContainer$3 = styled__default["default"].div`
25627
+ const LegendDataContainer = styled__default["default"].div`
25701
25628
  display: flex;
25702
- flex-direction: column;
25703
- `;
25704
- const Title$c = styled__default["default"].h4`
25705
- font-weight: 400;
25706
- font-size: 20px;
25707
- margin: 0;
25629
+ justify-content: center;
25630
+ gap: 40px;
25631
+ margin-top: auto;
25708
25632
  @media (max-width: 1536px) {
25709
- font-size: 14px;
25633
+ gap: 38px;
25710
25634
  }
25711
25635
  @media (max-width: 1366px) {
25712
- font-size: 10px;
25636
+ gap: 30px;
25713
25637
  }
25714
25638
  `;
25715
- const CurrencySignAndFormattedValueContainer$1 = styled__default["default"].div`
25639
+ const TitleAndIconContainer = styled__default["default"].div`
25716
25640
  display: flex;
25717
25641
  align-items: center;
25718
- gap: 16px;
25719
25642
  `;
25720
- const CurrencySignOrPercent = styled__default["default"].span`
25721
- font-weight: 500;
25722
- font-size: 16px;
25643
+ const Title$a = styled__default["default"].h4`
25644
+ font-weight: 400;
25645
+ font-size: 14px;
25646
+ line-height: 27px;
25647
+ margin: 0 0 0 10px;
25723
25648
  @media (max-width: 1536px) {
25724
25649
  font-size: 14px;
25725
25650
  }
25726
25651
  @media (max-width: 1366px) {
25727
- font-size: 11px;
25652
+ font-size: 12px;
25728
25653
  }
25729
25654
  `;
25730
- const FormattedValueText = styled__default["default"].div`
25731
- font-weight: 500;
25732
- font-size: 40px;
25733
- @media (max-width: 1536px) {
25734
- font-size: 34px;
25735
- }
25736
- @media (max-width: 1366px) {
25737
- font-size: 28px;
25738
- }
25655
+ const LegendColorRectangle$1 = styled__default["default"].div`
25656
+ width: 0.875rem;
25657
+ min-width: 0.875rem;
25658
+ height: 0.875rem;
25659
+ border-radius: 2px;
25660
+ background: ${props => props.color};
25739
25661
  `;
25740
25662
 
25741
- const FormattedValue$2 = props => {
25663
+ /* eslint-disable no-nested-ternary */
25664
+ const ICON_TYPE_SQUARE$3 = 'Square';
25665
+ const ICON_TYPE_LEGEND_UNION_ICON$3 = 'LegendUnionIcon';
25666
+ const ICON_TYPE_LEGEND_LINE_ICON$2 = 'LegendLineIcon';
25667
+ const PerformanceAnalyticsLegend = props => {
25668
+ const {
25669
+ className = 'PerformanceAnalyticsLegend',
25670
+ width = '100%',
25671
+ height = '100%',
25672
+ legendData = [{
25673
+ title: '',
25674
+ iconType: ICON_TYPE_SQUARE$3,
25675
+ iconColor: '#1F7677'
25676
+ }]
25677
+ } = props;
25678
+ return /*#__PURE__*/React__default["default"].createElement(ControlsContainer$5, {
25679
+ className: className,
25680
+ height: height,
25681
+ width: width
25682
+ }, legendData?.length > 0 ? /*#__PURE__*/React__default["default"].createElement(Controls$4, {
25683
+ height: height,
25684
+ width: width
25685
+ }, /*#__PURE__*/React__default["default"].createElement(LegendDataContainer, {
25686
+ id: "LegendDataContainer"
25687
+ }, legendData?.map((item, i) => /*#__PURE__*/React__default["default"].createElement(TitleAndIconContainer, {
25688
+ key: `${item.title + i}`
25689
+ }, item.iconType === ICON_TYPE_SQUARE$3 ? /*#__PURE__*/React__default["default"].createElement(LegendColorRectangle$1, {
25690
+ color: item.iconColor
25691
+ }) : item.iconType === ICON_TYPE_LEGEND_UNION_ICON$3 ? /*#__PURE__*/React__default["default"].createElement(LegendUnionIcon, {
25692
+ width: 30,
25693
+ height: 30,
25694
+ color: item.iconColor
25695
+ }) : item.iconType === ICON_TYPE_LEGEND_LINE_ICON$2 ? /*#__PURE__*/React__default["default"].createElement(LegendLineIcon, {
25696
+ color: item.iconColor
25697
+ }) : '', /*#__PURE__*/React__default["default"].createElement(Title$a, {
25698
+ id: "Title",
25699
+ width: width
25700
+ }, item.title))))) : '');
25701
+ };
25702
+
25703
+ /* eslint-disable no-nested-ternary */
25704
+ const ICON_TYPE_SQUARE$2 = 'Square';
25705
+ const ICON_TYPE_LEGEND_UNION_ICON$2 = 'LegendUnionIcon';
25706
+ const ICON_TYPE_LEGEND_LINE_ICON$1 = 'LegendLineIcon';
25707
+ const BarChartsByWeeks = props => {
25742
25708
  const {
25743
25709
  className,
25744
25710
  title,
25745
- subtitle,
25746
- showTopValue,
25747
- value,
25748
- dotCut,
25749
- currencySign,
25750
- currencyType,
25711
+ showHeaderTopValue,
25712
+ headerValueTopTitle,
25713
+ headerValueBottomTitle,
25714
+ headerValue,
25715
+ HeaderValueCurrencyType,
25716
+ HeaderValueIsPercent,
25717
+ barChartData,
25718
+ isTitleOriganal,
25751
25719
  width,
25752
25720
  height,
25753
- textcolor,
25754
- isPercent
25721
+ barChartColor,
25722
+ barChartSecondColor,
25723
+ xselectedColor,
25724
+ tooltipTitle,
25725
+ tooltipSecondTitle,
25726
+ startWeekRange = 0,
25727
+ endWeekRange = 0,
25728
+ yAxisCounter,
25729
+ isPercentValue,
25730
+ interval,
25731
+ showTitle,
25732
+ showLegend,
25733
+ legendData,
25734
+ showTwoBars,
25735
+ setLimitHeight,
25736
+ setLimitLow
25755
25737
  } = props;
25756
- return /*#__PURE__*/React__default["default"].createElement(ControlsContainer$7, {
25757
- className: className || 'FormattedValue_ControlsContainer',
25738
+
25739
+ // const [BarChartContainerWidth, setBarChartContainerWidth] = useState(0);
25740
+ // const [BarChartContainerHeight, setBarChartContainerHeight] = useState(0);
25741
+
25742
+ const controlsContainerRef = React$1.useRef();
25743
+
25744
+ // useEffect(() => {
25745
+ // const { offsetWidth } = controlsContainerRef.current;
25746
+ // setBarChartContainerWidth(offsetWidth - 20);
25747
+ // }, [width]);
25748
+
25749
+ // useEffect(() => {
25750
+ // const { offsetHeight } = controlsContainerRef.current;
25751
+ // setBarChartContainerHeight(offsetHeight - 40);
25752
+ // }, [height]);
25753
+
25754
+ const displayFormattedValue = value => {
25755
+ if (!value) return '';
25756
+ let formattedValue = '';
25757
+ formattedValue = isPercentValue ? ''.concat('', value.toFixed(1), '%') : ''.concat('', getFormattedValue(value), getFormattedUnits(value));
25758
+ return formattedValue;
25759
+ };
25760
+ const formmatedData = barChartData?.map(item => {
25761
+ if (setLimitHeight && item.value > setLimitHeight) {
25762
+ return {
25763
+ title: item.title,
25764
+ value: setLimitHeight,
25765
+ secondValue: item.secondValue
25766
+ };
25767
+ }
25768
+ if (setLimitLow && item.value < setLimitLow) {
25769
+ return {
25770
+ title: item.title,
25771
+ value: setLimitLow,
25772
+ secondValue: item.secondValue
25773
+ };
25774
+ }
25775
+ return {
25776
+ title: item.title,
25777
+ value: item.value,
25778
+ secondValue: item.secondValue
25779
+ };
25780
+ });
25781
+
25782
+ // eslint-disable-next-line react/no-unstable-nested-components
25783
+ const CustomTooltip = tooltipData => {
25784
+ const {
25785
+ active,
25786
+ payload,
25787
+ label
25788
+ } = tooltipData;
25789
+ if (!active || !payload || payload?.length === 0) return null;
25790
+ const week = isTitleOriganal ? label : label && label?.toString().length === 6 ? label.toString().substring(4, 6) : 0;
25791
+ let currentTooltipValue = 0;
25792
+ let currentTooltipSecondValue = 0;
25793
+ if (payload[0].payload?.value) currentTooltipValue = payload[0].payload?.value;
25794
+ if (payload[0].payload?.secondValue) currentTooltipSecondValue = payload[0].payload?.secondValue;
25795
+ return /*#__PURE__*/React__default["default"].createElement(TooltipDiv$3, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle$3, null, `${isTitleOriganal ? '' : 'Week: '}${week}`), /*#__PURE__*/React__default["default"].createElement(TooltipLabel$3, null, `${tooltipTitle}
25796
+ ${displayFormattedValue(currentTooltipValue)}
25797
+ `), currentTooltipSecondValue ? /*#__PURE__*/React__default["default"].createElement(TooltipLabel$3, null, `${tooltipSecondTitle}
25798
+ ${displayFormattedValue(currentTooltipSecondValue)}
25799
+ `) : '');
25800
+ };
25801
+ const getWeek = () => {
25802
+ if (!barChartData || barChartData?.length === 0) return null;
25803
+ const newFormattedData = barChartData?.map(item => ({
25804
+ ...item,
25805
+ titleWeek: item.title && isTitleOriganal ? item.title : item.title?.toString().length === 6 ? item.title.toString().substring(4, 6) : 0
25806
+ }));
25807
+ return newFormattedData;
25808
+ };
25809
+ const displayEventWeeksElements = () => {
25810
+ if (!barChartData || barChartData.length === 0) return '';
25811
+ return /*#__PURE__*/React__default["default"].createElement(EventWeeksLegendDataElementsContainer, null, getWeek()?.map(item => /*#__PURE__*/React__default["default"].createElement(EventWeeksLegendDataElement, {
25812
+ color: item.title >= startWeekRange && item.title <= endWeekRange ? xselectedColor : '',
25813
+ textColor: item.title >= startWeekRange && item.title <= endWeekRange ? '#212121' : '#B1B1B1',
25814
+ fontWeight: item.title >= startWeekRange && item.title <= endWeekRange ? 600 : 400,
25815
+ borderLeftRadius: startWeekRange && item?.title?.toString() === startWeekRange?.toString() ? '12px' : '0px',
25816
+ borderRightRadius: endWeekRange && item?.title?.toString() === endWeekRange?.toString() ? '12px' : '0px'
25817
+ }, item.titleWeek)));
25818
+ };
25819
+ const displayEventWeeksLegendData = () => /*#__PURE__*/React__default["default"].createElement(EventWeeksLegendMainContainer, {
25820
+ className: "EventWeeksLegendMainContainer"
25821
+ }, displayEventWeeksElements());
25822
+ const getControlsHeight = () => {
25823
+ if (!controlsContainerRef?.current) return '100%';
25824
+ const {
25825
+ offsetHeight
25826
+ } = controlsContainerRef.current;
25827
+ let newHeight = offsetHeight - 20;
25828
+ if (title) {
25829
+ newHeight -= 20;
25830
+ }
25831
+ if (headerValueTopTitle) {
25832
+ newHeight -= 16;
25833
+ }
25834
+ if (headerValueBottomTitle) {
25835
+ newHeight -= 16;
25836
+ }
25837
+ if (headerValue) {
25838
+ newHeight -= 42;
25839
+ }
25840
+ if (showLegend) {
25841
+ newHeight -= 34;
25842
+ }
25843
+ return `${newHeight}px`;
25844
+ };
25845
+ return /*#__PURE__*/React__default["default"].createElement(ControlsContainer$6, {
25846
+ className: className,
25758
25847
  height: height,
25759
25848
  width: width,
25760
- textcolor: textcolor
25761
- }, /*#__PURE__*/React__default["default"].createElement(Controls$6, {
25762
- className: "Controls",
25849
+ ref: controlsContainerRef
25850
+ }, /*#__PURE__*/React__default["default"].createElement(Controls$5, {
25851
+ height: getControlsHeight()
25852
+ }, showTitle && /*#__PURE__*/React__default["default"].createElement(TitleAndValueContainer$2, null, /*#__PURE__*/React__default["default"].createElement(Title$b, null, title), /*#__PURE__*/React__default["default"].createElement(FormattedValue$3, {
25853
+ title: headerValueTopTitle,
25854
+ subtitle: headerValueBottomTitle,
25855
+ showTopValue: showHeaderTopValue,
25856
+ value: headerValue,
25857
+ currencyType: HeaderValueCurrencyType,
25858
+ isPercent: HeaderValueIsPercent,
25859
+ dotCut: true
25860
+ })), /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
25861
+ width: "100%",
25862
+ height: "100%"
25863
+ }, /*#__PURE__*/React__default["default"].createElement(recharts.BarChart, {
25864
+ width: width,
25763
25865
  height: height,
25764
- width: width
25765
- }, /*#__PURE__*/React__default["default"].createElement(TitleAndValueContainer$3, {
25766
- className: "TitleAndValueContainer"
25767
- }, title ? /*#__PURE__*/React__default["default"].createElement(Title$c, {
25768
- className: "Title",
25769
- width: width
25770
- }, title) : '', showTopValue && /*#__PURE__*/React__default["default"].createElement(CurrencySignAndFormattedValueContainer$1, {
25771
- className: "CurrencySignAndFormattedValueContainer"
25772
- }, /*#__PURE__*/React__default["default"].createElement(FormattedValueText, {
25773
- className: "FormattedValueText",
25774
- width: width
25775
- }, /*#__PURE__*/React__default["default"].createElement(CurrencySignOrPercent, {
25776
- className: "CurrencySignOrPercent"
25777
- }, currencySign ? getCurrencySign(currencyType, value) : ''), dotCut ? getFormattedValue(value && Math.abs(value) > 0 && value % 1 !== 0 ? value?.toFixed(2) : value) : getNumberWithCommas(value), dotCut ? getFormattedUnits(value) : '', /*#__PURE__*/React__default["default"].createElement(CurrencySignOrPercent, {
25778
- className: "CurrencySignOrPercent"
25779
- }, isPercent ? '%' : ''))), subtitle ? /*#__PURE__*/React__default["default"].createElement(Title$c, {
25780
- className: "Title",
25781
- width: width
25782
- }, subtitle) : '')));
25866
+ data: formmatedData,
25867
+ margin: {
25868
+ top: 20,
25869
+ right: 0,
25870
+ bottom: 0,
25871
+ left: -5
25872
+ }
25873
+ }, /*#__PURE__*/React__default["default"].createElement(recharts.CartesianGrid, {
25874
+ strokeDasharray: "3 3",
25875
+ vertical: false
25876
+ }), /*#__PURE__*/React__default["default"].createElement(recharts.XAxis, {
25877
+ dataKey: "title",
25878
+ tick: false,
25879
+ tickLine: false
25880
+ }), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
25881
+ tickCount: yAxisCounter,
25882
+ interval: interval || 'preserveEnd',
25883
+ domain: [0, 'auto'],
25884
+ tick: {
25885
+ fill: '#B1B1B1'
25886
+ },
25887
+ axisLine: false,
25888
+ fontWeight: 400,
25889
+ fontSize: "12px",
25890
+ tickLine: false,
25891
+ tickFormatter: value => `${displayFormattedValue(value)}`
25892
+ }), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, {
25893
+ content: /*#__PURE__*/React__default["default"].createElement(CustomTooltip, null)
25894
+ }), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, null), !showTwoBars ? /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
25895
+ dataKey: "value",
25896
+ name: "title",
25897
+ maxBarSize: 30,
25898
+ radius: [4, 4, 0, 0],
25899
+ fill: barChartColor
25900
+ }) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
25901
+ dataKey: "value",
25902
+ name: "title",
25903
+ maxBarSize: 30,
25904
+ stackId: "a",
25905
+ fill: barChartColor
25906
+ }), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
25907
+ dataKey: "secondValue",
25908
+ name: "title",
25909
+ maxBarSize: 30,
25910
+ radius: [4, 4, 0, 0],
25911
+ stackId: "a",
25912
+ fill: barChartSecondColor
25913
+ })))), displayEventWeeksLegendData(), showLegend && /*#__PURE__*/React__default["default"].createElement(LegendWrapper, null, /*#__PURE__*/React__default["default"].createElement(PerformanceAnalyticsLegend, {
25914
+ legendData: legendData
25915
+ }))));
25783
25916
  };
25784
- FormattedValue$2.propTypes = {
25917
+ BarChartsByWeeks.propTypes = {
25785
25918
  className: PropTypes.string,
25786
25919
  title: PropTypes.string,
25787
- subtitle: PropTypes.string,
25788
- showTopValue: PropTypes.bool,
25789
- value: PropTypes.number,
25790
- dotCut: PropTypes.bool,
25791
- currencySign: PropTypes.bool,
25792
- currencyType: PropTypes.string,
25920
+ showHeaderTopValue: PropTypes.bool,
25921
+ headerValueTopTitle: PropTypes.string,
25922
+ headerValueBottomTitle: PropTypes.string,
25923
+ headerValue: PropTypes.number,
25924
+ HeaderValueCurrencyType: PropTypes.string,
25925
+ HeaderValueIsPercent: PropTypes.bool,
25926
+ barChartData: PropTypes.arrayOf(PropTypes.shape({
25927
+ title: PropTypes.string,
25928
+ value: PropTypes.number
25929
+ })),
25930
+ isTitleOriganal: PropTypes.bool,
25793
25931
  width: PropTypes.string,
25794
25932
  height: PropTypes.string,
25795
- textcolor: PropTypes.string,
25796
- isPercent: PropTypes.bool
25933
+ barChartColor: PropTypes.string,
25934
+ barChartSecondColor: PropTypes.string,
25935
+ xselectedColor: PropTypes.string,
25936
+ startWeekRange: PropTypes.string,
25937
+ endWeekRange: PropTypes.string,
25938
+ tooltipTitle: PropTypes.string,
25939
+ tooltipSecondTitle: PropTypes.string,
25940
+ yAxisCounter: PropTypes.number,
25941
+ isPercentValue: PropTypes.bool,
25942
+ interval: PropTypes.string,
25943
+ showTitle: PropTypes.bool,
25944
+ showLegend: PropTypes.bool,
25945
+ legendData: PropTypes.arrayOf(PropTypes.shape({
25946
+ title: PropTypes.string.isRequired,
25947
+ iconType: PropTypes.oneOf([ICON_TYPE_SQUARE$2, ICON_TYPE_LEGEND_UNION_ICON$2, ICON_TYPE_LEGEND_LINE_ICON$1]).isRequired,
25948
+ iconColor: PropTypes.string.isRequired
25949
+ })),
25950
+ showTwoBars: PropTypes.bool,
25951
+ setLimitHeight: PropTypes.number,
25952
+ setLimitLow: PropTypes.number
25797
25953
  };
25798
- FormattedValue$2.defaultProps = {
25799
- className: 'FormattedValue_ControlsContainer',
25954
+ BarChartsByWeeks.defaultProps = {
25955
+ className: '',
25800
25956
  title: '',
25801
- subtitle: '',
25802
- showTopValue: true,
25803
- value: 0,
25804
- dotCut: false,
25805
- currencySign: false,
25806
- currencyType: 'USD',
25957
+ showHeaderTopValue: true,
25958
+ headerValueTopTitle: '',
25959
+ headerValueBottomTitle: '',
25960
+ headerValue: 0,
25961
+ HeaderValueCurrencyType: '',
25962
+ HeaderValueIsPercent: false,
25963
+ barChartData: [{
25964
+ title: '202320',
25965
+ value: 542366
25966
+ }, {
25967
+ title: '202321',
25968
+ value: 699511
25969
+ }, {
25970
+ title: '202322',
25971
+ value: 403092
25972
+ }, {
25973
+ title: '202323',
25974
+ value: 396184
25975
+ }, {
25976
+ title: '202324',
25977
+ value: 415317
25978
+ }, {
25979
+ title: '202325',
25980
+ value: 568376
25981
+ }, {
25982
+ title: '202326',
25983
+ value: 1078121
25984
+ }, {
25985
+ title: '202327',
25986
+ value: 347930
25987
+ }, {
25988
+ title: '202328',
25989
+ value: 346258
25990
+ }, {
25991
+ title: '202329',
25992
+ value: 350184
25993
+ }],
25807
25994
  width: '100%',
25808
25995
  height: '100%',
25809
- textcolor: '#212121',
25810
- isPercent: false
25996
+ barChartColor: '#BD9EFF',
25997
+ barChartSecondColor: '#42977A',
25998
+ xselectedColor: '#42977A',
25999
+ tooltipTitle: 'Sales',
26000
+ tooltipSecondTitle: 'Sales 2',
26001
+ startWeekRange: 0,
26002
+ endWeekRange: 0,
26003
+ yAxisCounter: 10,
26004
+ isPercentValue: false,
26005
+ interval: 'preserveEnd',
26006
+ showTitle: true,
26007
+ showLegend: true,
26008
+ isTitleOriganal: false,
26009
+ legendData: [{
26010
+ title: 'Sales',
26011
+ iconType: ICON_TYPE_SQUARE$2,
26012
+ iconColor: '#90CE9C'
26013
+ }, {
26014
+ title: 'Category Average',
26015
+ iconType: ICON_TYPE_LEGEND_LINE_ICON$1,
26016
+ iconColor: '#C906FD'
26017
+ }],
26018
+ showTwoBars: false,
26019
+ setLimitHeight: null,
26020
+ setLimitLow: null
25811
26021
  };
25812
26022
 
25813
- const ControlsContainer$6 = styled__default["default"].div`
25814
- position: relative;
25815
- font-family: "Poppins", sans-serif;
25816
- color: #212121;
25817
- width: ${props => props.width};
25818
- height: ${props => props.height};
25819
- min-width: 250px;
25820
- `;
25821
- const Controls$5 = styled__default["default"].div`
25822
- height: 100%;
25823
- width: 100%;
25824
- background: white;
25825
- display: flex;
25826
- flex-direction: column;
25827
- `;
25828
- const TooltipDiv$3 = styled__default["default"].div`
25829
- border-radius: 5px;
25830
- padding: 8px 12px;
25831
- background: white;
25832
- box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);
25833
- margin: 0;
25834
- `;
25835
- const TooltipLabel$3 = styled__default["default"].div`
25836
- color: #212121;
25837
- font-size: 14px;
25838
- font-weight: 400;
25839
- width: fit-content;
25840
- `;
25841
- const TooltipTitle$3 = styled__default["default"].div`
25842
- color: #212121;
25843
- font-size: 14px;
25844
- font-weight: 600;
25845
- `;
25846
- const TitleAndValueContainer$2 = styled__default["default"].div`
25847
- padding: 0 1rem;
25848
- `;
25849
- const Title$b = styled__default["default"].h5`
25850
- font-weight: 500;
25851
- font-size: 18px;
25852
- line-height: 20px;
25853
- margin: 0;
25854
- @media (max-width: 1536px) {
25855
- font-size: 16px;
25856
- }
25857
- @media (max-width: 1366px) {
25858
- font-size: 14px;
25859
- }
25860
- `;
25861
- const EventWeeksLegendMainContainer = styled__default["default"].div`
25862
- display: flex;
25863
- justify-content: center;
25864
- flex-direction: column;
25865
- margin: 2px 0 0 0;
25866
- padding-left: 55px;
25867
- align-items: center;
25868
- `;
25869
- const EventWeeksLegendDataElementsContainer = styled__default["default"].div`
25870
- display: flex;
25871
- margin: 0px;
25872
- align-items: center;
25873
- justify-content: space-around;
25874
- width: 100%;
25875
- `;
25876
- const EventWeeksLegendDataElement = styled__default["default"].h4`
25877
- display: flex;
25878
- font-weight: ${props => props.fontWeight};
25879
- font-size: 12px;
25880
- line-height: 15px;
25881
- margin: 0;
25882
- width: 100%;
25883
- justify-content: center;
25884
- align-content: center;
25885
- color: ${props => props.textColor};
25886
- border-top-left-radius: ${props => props.borderLeftRadius};
25887
- border-bottom-left-radius: ${props => props.borderLeftRadius};
25888
- border-top-right-radius: ${props => props.borderRightRadius};
25889
- border-bottom-right-radius: ${props => props.borderRightRadius};
25890
- background: ${props => props.color};
25891
- @media (max-width: 1536px) {
25892
- font-size: 11px;
25893
- }
25894
- @media (max-width: 1366px) {
25895
- font-size: 10px;
25896
- }
25897
- `;
25898
- const LegendWrapper = styled__default["default"].div`
25899
- padding-top: 15px;
25900
- `;
26023
+ const scrollableStyles$6 = `
26024
+ overflow-y: auto;
25901
26025
 
25902
- const LegendUnionIcon = _ref => {
25903
- let {
25904
- width = '18',
25905
- height = '5',
25906
- color = '#9CCB3B'
25907
- } = _ref;
25908
- return /*#__PURE__*/React__default["default"].createElement("svg", {
25909
- width: width,
25910
- height: height,
25911
- viewBox: "0 0 18 5",
25912
- fill: "none",
25913
- xmlns: "http://www.w3.org/2000/svg"
25914
- }, /*#__PURE__*/React__default["default"].createElement("path", {
25915
- fillRule: "evenodd",
25916
- clipRule: "evenodd",
25917
- d: "M11.45 2H17C17.2761 2 17.5 2.22386 17.5 2.5C17.5 2.77614 17.2761 3 17 3H11.45C11.2184 4.14112 10.2095 5 9 5C7.79052 5 6.78164 4.14112 6.55001 3H1C0.723858 3 0.5 2.77614 0.5 2.5C0.5 2.22386 0.723858 2 1 2H6.55001C6.78164 0.85888 7.79052 0 9 0C10.2095 0 11.2184 0.85888 11.45 2Z",
25918
- fill: color
25919
- }));
25920
- };
26026
+ &::-webkit-scrollbar {
26027
+ width: 0.5em; /* 8px → 0.5em */
26028
+ }
25921
26029
 
25922
- const LegendLineIcon = _ref => {
25923
- let {
25924
- width = '19',
25925
- height = '3',
25926
- color = '#9CCB3B'
25927
- } = _ref;
25928
- return /*#__PURE__*/React__default["default"].createElement("svg", {
25929
- width: width,
25930
- height: height,
25931
- viewBox: "0 0 19 3",
25932
- fill: "none",
25933
- xmlns: "http://www.w3.org/2000/svg"
25934
- }, /*#__PURE__*/React__default["default"].createElement("path", {
25935
- fillRule: "evenodd",
25936
- clipRule: "evenodd",
25937
- d: "M0 1.5C0 0.671573 0.671573 0 1.5 0H17.5C18.3284 0 19 0.671572 19 1.5C19 2.32843 18.3284 3 17.5 3H1.5C0.671575 3 0 2.32843 0 1.5Z",
25938
- fill: color
25939
- }));
25940
- };
26030
+ &::-webkit-scrollbar-track {
26031
+ background: #E8E8E8;
26032
+ }
25941
26033
 
25942
- const ControlsContainer$5 = styled__default["default"].div`
26034
+ &::-webkit-scrollbar-thumb {
26035
+ background: #D0D0D0;
26036
+ }
26037
+ `;
26038
+ const ControlsContainer$4 = styled__default["default"].div`
25943
26039
  position: relative;
25944
26040
  font-family: "Poppins", sans-serif;
25945
- font-size: ${props => props.rootFont};
26041
+ font-size: ${props => props.rootFont || '1em'}; /* Base font size */
25946
26042
  color: ${props => props.textColor};
25947
26043
  width: ${props => props.width};
25948
26044
  height: ${props => props.height};
26045
+ padding: ${props => props.containerPadding || '0'};
26046
+ display: flex;
26047
+ align-items: center;
26048
+ @media (max-width: 1536px) {
26049
+ ${scrollableStyles$6}
26050
+ }
25949
26051
 
25950
26052
  > * {
25951
26053
  box-sizing: border-box;
25952
26054
  }
25953
26055
  `;
25954
- const Controls$4 = styled__default["default"].div`
26056
+ const Controls$3 = styled__default["default"].div`
25955
26057
  display: flex;
25956
- gap: 20px;
25957
26058
  flex-direction: column;
25958
26059
  width: 100%;
25959
26060
  height: 100%;
25960
26061
  background: white;
26062
+ border-radius: 12px;
25961
26063
  `;
25962
- const LegendDataContainer = styled__default["default"].div`
26064
+ const TooltipDiv$2 = styled__default["default"].div`
25963
26065
  display: flex;
25964
- justify-content: center;
25965
- gap: 40px;
25966
- margin-top: auto;
26066
+ background: white;
26067
+ padding: 0.375em 0.625em; /* 6px 10px → 0.375em 0.625em */
26068
+ margin: 0;
26069
+ `;
26070
+ const TooltipLabel$2 = styled__default["default"].p`
26071
+ color: #212121;
26072
+ font-family: "Poppins", sans-serif;
26073
+ font-size: 0.75em; /* 12px → 0.75em */
26074
+ font-weight: 400;
26075
+ font-style: normal;
26076
+ width: max-content;
26077
+ line-height: normal;
26078
+ margin: 0;
26079
+ `;
26080
+ const TitleAndValueContainer$1 = styled__default["default"].div`
26081
+ display: flex;
26082
+ flex-direction: column;
26083
+ padding: 0 1.25em; /* 20px → 1.25em */
26084
+ `;
26085
+ const Title$9 = styled__default["default"].h4`
26086
+ font-weight: 500;
26087
+ font-size: ${props => props.titleFontSize || '1.125em'}; /* Default: 18px → 1.125em */
26088
+ margin: 0;
25967
26089
  @media (max-width: 1536px) {
25968
- gap: 38px;
26090
+ font-size: 0.875em; /* 14px → 0.875em */
25969
26091
  }
25970
26092
  @media (max-width: 1366px) {
25971
- gap: 30px;
26093
+ font-size: 0.75em; /* 12px → 0.75em */
25972
26094
  }
25973
26095
  `;
25974
- const TitleAndIconContainer = styled__default["default"].div`
26096
+ const CurrencySignAndFormattedValueContainer = styled__default["default"].div`
25975
26097
  display: flex;
25976
26098
  align-items: center;
26099
+ gap: 0.3125em; /* 5px → 0.3125em */
26100
+ align-items: baseline;
25977
26101
  `;
25978
- const Title$a = styled__default["default"].h4`
26102
+ const CurrencySign$1 = styled__default["default"].span`
26103
+ font-weight: 500;
26104
+ font-size: 1em; /* 16px → 1em */
26105
+ @media (max-width: 1536px) {
26106
+ font-size: 0.875em; /* 14px → 0.875em */
26107
+ }
26108
+ @media (max-width: 1366px) {
26109
+ font-size: 0.6875em; /* 11px → 0.6875em */
26110
+ }
26111
+ `;
26112
+ const FormattedValue$2 = styled__default["default"].div`
26113
+ font-weight: 500;
26114
+ font-size: ${props => props.FormattedValueFontSize || '2.5em'}; /* Default: 40px → 2.5em */
26115
+ @media (max-width: 1536px) {
26116
+ font-size: 1.5em; /* 24px → 1.5em */
26117
+ }
26118
+ @media (max-width: 1366px) {
26119
+ font-size: 1.25em; /* 20px → 1.25em */
26120
+ }
26121
+ `;
26122
+ const TextAfterValue = styled__default["default"].div`
25979
26123
  font-weight: 400;
25980
- font-size: 14px;
25981
- line-height: 27px;
25982
- margin: 0 0 0 10px;
26124
+ font-size: 0.75em; /* 12px → 0.75em */
25983
26125
  @media (max-width: 1536px) {
25984
- font-size: 14px;
26126
+ font-size: 0.6875em; /* 11px → 0.6875em */
25985
26127
  }
25986
26128
  @media (max-width: 1366px) {
25987
- font-size: 12px;
26129
+ font-size: 0.625em; /* 10px → 0.625em */
25988
26130
  }
25989
26131
  `;
25990
- const LegendColorRectangle$1 = styled__default["default"].div`
26132
+ const DoughnutChartAndLegendContainer = styled__default["default"].div`
26133
+ display: flex;
26134
+ flex-direction: ${props => props.legendBelow ? 'column' : 'row'};
26135
+ gap: 0.75em; /* 12px → 0.75em */
26136
+ justify-content: space-between;
26137
+ margin-top: auto;
26138
+ padding: 0 1.25em; /* 20px → 1.25em */
26139
+ margin-bottom: 1.25em; /* 20px → 1.25em */
26140
+ `;
26141
+ const DoughnutChartContainer = styled__default["default"].div`
26142
+ display: flex;
26143
+ align-items: center;
26144
+ min-width: 90px;
26145
+ min-height: 90px;
26146
+ `;
26147
+ const LegendContainer$2 = styled__default["default"].div`
26148
+ padding-left: 0.625em; /* 10px → 0.625em */
26149
+ display: flex;
26150
+ flex-direction: column;
26151
+ justify-content: space-evenly;
26152
+ `;
26153
+ const LegendControlsContainer = styled__default["default"].div`
26154
+ display: flex;
26155
+ gap: 0.5em; /* 8px → 0.5em */
26156
+ align-items: center;
26157
+ margin-bottom: 0.375em; /* 6px → 0.375em */
26158
+ `;
26159
+ const LegendTitleAndFormatedValueContainer = styled__default["default"].div`
26160
+ flex-grow: 1;
26161
+ `;
26162
+ styled__default["default"].div`
26163
+ font-size: 0.875rem;
26164
+ `;
26165
+ const LegendColorRectangle = styled__default["default"].div`
25991
26166
  width: 0.875rem;
25992
26167
  min-width: 0.875rem;
25993
26168
  height: 0.875rem;
25994
26169
  border-radius: 2px;
25995
26170
  background: ${props => props.color};
25996
26171
  `;
26172
+ const LegendTitle = styled__default["default"].h5`
26173
+ font-weight: 400;
26174
+ font-size: 1em; /* 16px → 1em */
26175
+ gap: 0.3125em; /* 5px → 0.3125em */
26176
+ margin: 0;
26177
+ display: flex;
26178
+ justify-content: space-between;
26179
+ @media (max-width: 1536px) {
26180
+ font-size: 0.75em; /* 11px → 0.6875em */
26181
+ }
26182
+ @media (max-width: 1366px) {
26183
+ font-size: 0.625em; /* 10px → 0.625em */
26184
+ }
26185
+ `;
26186
+ const LegendFormattedValue = styled__default["default"].span`
26187
+ font-weight: 500;
26188
+ font-size: 0.875em; /* 14px → 0.875em */
26189
+ white-space: nowrap;
26190
+ `;
25997
26191
 
25998
- /* eslint-disable no-nested-ternary */
25999
- const ICON_TYPE_SQUARE$3 = 'Square';
26000
- const ICON_TYPE_LEGEND_UNION_ICON$3 = 'LegendUnionIcon';
26001
- const ICON_TYPE_LEGEND_LINE_ICON$2 = 'LegendLineIcon';
26002
- const PerformanceAnalyticsLegend = props => {
26003
- const {
26004
- className = 'PerformanceAnalyticsLegend',
26005
- width = '100%',
26006
- height = '100%',
26007
- legendData = [{
26008
- title: '',
26009
- iconType: ICON_TYPE_SQUARE$3,
26010
- iconColor: '#1F7677'
26011
- }]
26012
- } = props;
26013
- return /*#__PURE__*/React__default["default"].createElement(ControlsContainer$5, {
26014
- className: className,
26015
- height: height,
26016
- width: width
26017
- }, legendData?.length > 0 ? /*#__PURE__*/React__default["default"].createElement(Controls$4, {
26018
- height: height,
26019
- width: width
26020
- }, /*#__PURE__*/React__default["default"].createElement(LegendDataContainer, {
26021
- id: "LegendDataContainer"
26022
- }, legendData?.map((item, i) => /*#__PURE__*/React__default["default"].createElement(TitleAndIconContainer, {
26023
- key: `${item.title + i}`
26024
- }, item.iconType === ICON_TYPE_SQUARE$3 ? /*#__PURE__*/React__default["default"].createElement(LegendColorRectangle$1, {
26025
- color: item.iconColor
26026
- }) : item.iconType === ICON_TYPE_LEGEND_UNION_ICON$3 ? /*#__PURE__*/React__default["default"].createElement(LegendUnionIcon, {
26027
- width: 30,
26028
- height: 30,
26029
- color: item.iconColor
26030
- }) : item.iconType === ICON_TYPE_LEGEND_LINE_ICON$2 ? /*#__PURE__*/React__default["default"].createElement(LegendLineIcon, {
26031
- color: item.iconColor
26032
- }) : '', /*#__PURE__*/React__default["default"].createElement(Title$a, {
26033
- id: "Title",
26034
- width: width
26035
- }, item.title))))) : '');
26036
- };
26037
-
26038
- /* eslint-disable no-nested-ternary */
26039
- const ICON_TYPE_SQUARE$2 = 'Square';
26040
- const ICON_TYPE_LEGEND_UNION_ICON$2 = 'LegendUnionIcon';
26041
- const ICON_TYPE_LEGEND_LINE_ICON$1 = 'LegendLineIcon';
26042
- const BarChartsByWeeks = props => {
26192
+ const TotalDoughnutChart = props => {
26043
26193
  const {
26044
26194
  className,
26045
- title,
26046
- showHeaderTopValue,
26047
- headerValueTopTitle,
26048
- headerValueBottomTitle,
26049
- headerValue,
26050
- HeaderValueCurrencyType,
26051
- HeaderValueIsPercent,
26052
- barChartData,
26053
- isTitleOriganal,
26054
26195
  width,
26055
26196
  height,
26056
- barChartColor,
26057
- barChartSecondColor,
26058
- xselectedColor,
26059
- tooltipTitle,
26060
- tooltipSecondTitle,
26061
- startWeekRange = 0,
26062
- endWeekRange = 0,
26063
- yAxisCounter,
26064
- isPercentValue,
26065
- interval,
26066
- showTitle,
26067
- showLegend,
26197
+ title,
26198
+ value,
26199
+ rootFont,
26200
+ containerPadding,
26201
+ addingBenchmark,
26202
+ dotCut,
26203
+ currencySign,
26204
+ currencyType,
26068
26205
  legendData,
26069
- showTwoBars,
26070
- setLimitHeight,
26071
- setLimitLow
26072
- } = props;
26073
-
26074
- // const [BarChartContainerWidth, setBarChartContainerWidth] = useState(0);
26075
- // const [BarChartContainerHeight, setBarChartContainerHeight] = useState(0);
26076
-
26077
- const controlsContainerRef = React$1.useRef();
26078
-
26079
- // useEffect(() => {
26080
- // const { offsetWidth } = controlsContainerRef.current;
26081
- // setBarChartContainerWidth(offsetWidth - 20);
26082
- // }, [width]);
26083
-
26084
- // useEffect(() => {
26085
- // const { offsetHeight } = controlsContainerRef.current;
26086
- // setBarChartContainerHeight(offsetHeight - 40);
26087
- // }, [height]);
26088
-
26089
- const displayFormattedValue = value => {
26090
- if (!value) return '';
26091
- let formattedValue = '';
26092
- formattedValue = isPercentValue ? ''.concat('', value.toFixed(1), '%') : ''.concat('', getFormattedValue(value), getFormattedUnits(value));
26093
- return formattedValue;
26094
- };
26095
- const formmatedData = barChartData?.map(item => {
26096
- if (setLimitHeight && item.value > setLimitHeight) {
26097
- return {
26098
- title: item.title,
26099
- value: setLimitHeight,
26100
- secondValue: item.secondValue
26101
- };
26102
- }
26103
- if (setLimitLow && item.value < setLimitLow) {
26104
- return {
26105
- title: item.title,
26106
- value: setLimitLow,
26107
- secondValue: item.secondValue
26108
- };
26206
+ legendBelow,
26207
+ itemsPercentagesValueAside,
26208
+ itemsBoldedValues,
26209
+ itemsValuesSeparateLine,
26210
+ textcolor,
26211
+ titleFontSize,
26212
+ FormattedValueFontSize,
26213
+ isPercent,
26214
+ hideTitleAndValue,
26215
+ noDataText,
26216
+ textAfterValue
26217
+ } = props;
26218
+ const [DoughnutChartRadius, setDoughnutChartRadius] = React$1.useState(0);
26219
+ const [zoomResolution, setZoomResolution] = React$1.useState(1);
26220
+ const DoughnutChartContainerRef = React$1.useRef();
26221
+ const dotCutTrenty = row => {
26222
+ if (!row || !row.value) return null;
26223
+ let valueNew = 0;
26224
+ if (row?.value && Math.abs(row.value) > 0 && row.value % 1 !== 0) {
26225
+ valueNew = row?.value?.toFixed(2);
26226
+ } else {
26227
+ valueNew = row?.value;
26109
26228
  }
26110
- return {
26111
- title: item.title,
26112
- value: item.value,
26113
- secondValue: item.secondValue
26229
+ return dotCut ? getFormattedValue(valueNew) : getNumberWithCommas(valueNew);
26230
+ };
26231
+ React$1.useEffect(() => {
26232
+ const handleResize = () => {
26233
+ setZoomResolution(window.devicePixelRatio);
26114
26234
  };
26115
- });
26116
26235
 
26117
- // eslint-disable-next-line react/no-unstable-nested-components
26118
- const CustomTooltip = tooltipData => {
26119
- const {
26120
- active,
26121
- payload,
26122
- label
26123
- } = tooltipData;
26124
- if (!active || !payload || payload?.length === 0) return null;
26125
- const week = isTitleOriganal ? label : label && label?.toString().length === 6 ? label.toString().substring(4, 6) : 0;
26126
- let currentTooltipValue = 0;
26127
- let currentTooltipSecondValue = 0;
26128
- if (payload[0].payload?.value) currentTooltipValue = payload[0].payload?.value;
26129
- if (payload[0].payload?.secondValue) currentTooltipSecondValue = payload[0].payload?.secondValue;
26130
- return /*#__PURE__*/React__default["default"].createElement(TooltipDiv$3, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle$3, null, `${isTitleOriganal ? '' : 'Week: '}${week}`), /*#__PURE__*/React__default["default"].createElement(TooltipLabel$3, null, `${tooltipTitle}
26131
- ${displayFormattedValue(currentTooltipValue)}
26132
- `), currentTooltipSecondValue ? /*#__PURE__*/React__default["default"].createElement(TooltipLabel$3, null, `${tooltipSecondTitle}
26133
- ${displayFormattedValue(currentTooltipSecondValue)}
26134
- `) : '');
26135
- };
26136
- const getWeek = () => {
26137
- if (!barChartData || barChartData?.length === 0) return null;
26138
- const newFormattedData = barChartData?.map(item => ({
26139
- ...item,
26140
- titleWeek: item.title && isTitleOriganal ? item.title : item.title?.toString().length === 6 ? item.title.toString().substring(4, 6) : 0
26141
- }));
26142
- return newFormattedData;
26143
- };
26144
- const displayEventWeeksElements = () => {
26145
- if (!barChartData || barChartData.length === 0) return '';
26146
- return /*#__PURE__*/React__default["default"].createElement(EventWeeksLegendDataElementsContainer, null, getWeek()?.map(item => /*#__PURE__*/React__default["default"].createElement(EventWeeksLegendDataElement, {
26147
- color: item.title >= startWeekRange && item.title <= endWeekRange ? xselectedColor : '',
26148
- textColor: item.title >= startWeekRange && item.title <= endWeekRange ? '#212121' : '#B1B1B1',
26149
- fontWeight: item.title >= startWeekRange && item.title <= endWeekRange ? 600 : 400,
26150
- borderLeftRadius: startWeekRange && item?.title?.toString() === startWeekRange?.toString() ? '12px' : '0px',
26151
- borderRightRadius: endWeekRange && item?.title?.toString() === endWeekRange?.toString() ? '12px' : '0px'
26152
- }, item.titleWeek)));
26153
- };
26154
- const displayEventWeeksLegendData = () => /*#__PURE__*/React__default["default"].createElement(EventWeeksLegendMainContainer, {
26155
- className: "EventWeeksLegendMainContainer"
26156
- }, displayEventWeeksElements());
26157
- const getControlsHeight = () => {
26158
- if (!controlsContainerRef?.current) return '100%';
26236
+ // Add event listener for window resize to update zoom resolution
26237
+ window.addEventListener('resize', handleResize);
26238
+
26239
+ // Initial update of zoom resolution
26240
+ setZoomResolution(window.devicePixelRatio);
26241
+
26242
+ // Clean up the event listener when component unmounts
26243
+ return () => {
26244
+ window.removeEventListener('resize', handleResize);
26245
+ };
26246
+ }, []);
26247
+ React$1.useEffect(() => {
26248
+ const MIN_RADIUS = 45;
26249
+ if (!DoughnutChartContainerRef) return;
26159
26250
  const {
26160
- offsetHeight
26161
- } = controlsContainerRef.current;
26162
- let newHeight = offsetHeight - 20;
26163
- if (title) {
26164
- newHeight -= 20;
26165
- }
26166
- if (headerValueTopTitle) {
26167
- newHeight -= 16;
26168
- }
26169
- if (headerValueBottomTitle) {
26170
- newHeight -= 16;
26251
+ current
26252
+ } = DoughnutChartContainerRef;
26253
+ if (!current) return;
26254
+ const DoughnutChartContainerWidth = current?.clientWidth;
26255
+ const DoughnutChartContainerHeight = current?.clientHeight;
26256
+ const resolutionFactor = zoomResolution && zoomResolution >= 1 ? zoomResolution : 1;
26257
+ let radius = DoughnutChartContainerWidth > DoughnutChartContainerHeight ? DoughnutChartContainerHeight / 2 / resolutionFactor : DoughnutChartContainerWidth / 2 / resolutionFactor;
26258
+ if (radius < MIN_RADIUS) {
26259
+ radius = MIN_RADIUS;
26171
26260
  }
26172
- if (headerValue) {
26173
- newHeight -= 42;
26261
+ setDoughnutChartRadius(radius);
26262
+ }, [height, width, DoughnutChartContainerRef?.current?.clientWidth, DoughnutChartContainerRef?.current?.clientHeight, zoomResolution]);
26263
+ const displayLegendValue = row => /*#__PURE__*/React__default["default"].createElement(LegendFormattedValue, {
26264
+ style: {
26265
+ fontWeight: itemsBoldedValues ? '700' : '500'
26174
26266
  }
26175
- if (showLegend) {
26176
- newHeight -= 34;
26267
+ }, !isPercent && row.value && currencySign ? getCurrencySign(currencyType, row.value) : '', !isPercent && row.value !== undefined && row.value !== null ? dotCutTrenty(row) : !isPercent && 'No Data', !isPercent && row.value && dotCut ? getFormattedUnits(row.value) : '', !isPercent && row.value && itemsPercentagesValueAside && /*#__PURE__*/React__default["default"].createElement("span", {
26268
+ style: {
26269
+ fontWeight: itemsBoldedValues ? '700' : '400'
26177
26270
  }
26178
- return `${newHeight}px`;
26179
- };
26180
- return /*#__PURE__*/React__default["default"].createElement(ControlsContainer$6, {
26271
+ }, ' (', `${Math.round(row.value / value * 100)}%)`), isPercent && row.value && `${row.value.toFixed(1)}%`);
26272
+ return /*#__PURE__*/React__default["default"].createElement(ControlsContainer$4, {
26181
26273
  className: className,
26182
26274
  height: height,
26183
26275
  width: width,
26184
- ref: controlsContainerRef
26185
- }, /*#__PURE__*/React__default["default"].createElement(Controls$5, {
26186
- height: getControlsHeight()
26187
- }, showTitle && /*#__PURE__*/React__default["default"].createElement(TitleAndValueContainer$2, null, /*#__PURE__*/React__default["default"].createElement(Title$b, null, title), /*#__PURE__*/React__default["default"].createElement(FormattedValue$2, {
26188
- title: headerValueTopTitle,
26189
- subtitle: headerValueBottomTitle,
26190
- showTopValue: showHeaderTopValue,
26191
- value: headerValue,
26192
- currencyType: HeaderValueCurrencyType,
26193
- isPercent: HeaderValueIsPercent,
26194
- dotCut: true
26195
- })), /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
26196
- width: "100%",
26197
- height: "100%"
26198
- }, /*#__PURE__*/React__default["default"].createElement(recharts.BarChart, {
26276
+ rootFont: rootFont,
26277
+ containerPadding: containerPadding,
26278
+ textcolor: textcolor
26279
+ }, legendData.length === 0 || legendData.every(item => item.value === undefined || item.value === null) ? /*#__PURE__*/React__default["default"].createElement(NoDataFoundMessage, {
26280
+ className: "NoDataFoundMessage",
26281
+ noDataText: noDataText
26282
+ }) : /*#__PURE__*/React__default["default"].createElement(Controls$3, {
26283
+ className: "Controls",
26284
+ height: height,
26285
+ width: width
26286
+ }, !hideTitleAndValue && /*#__PURE__*/React__default["default"].createElement(TitleAndValueContainer$1, {
26287
+ className: "TitleAndValueContainer"
26288
+ }, /*#__PURE__*/React__default["default"].createElement(Title$9, {
26289
+ className: "Title",
26290
+ fontSize: titleFontSize
26291
+ }, title), /*#__PURE__*/React__default["default"].createElement(CurrencySignAndFormattedValueContainer, {
26292
+ className: "CurrencySignAndFormattedValueContainer"
26293
+ }, /*#__PURE__*/React__default["default"].createElement(FormattedValue$2, {
26294
+ className: "FormattedValue",
26295
+ fontSize: FormattedValueFontSize,
26296
+ width: width
26297
+ }, /*#__PURE__*/React__default["default"].createElement(CurrencySign$1, {
26298
+ className: "CurrencySign"
26299
+ }, currencySign ? getCurrencySign(currencyType, value) : ''), dotCut ? getFormattedValue(value && Math.abs(value) > 0 && value % 1 !== 0 ? value?.toFixed(2) : value) : getNumberWithCommas(value), dotCut ? getFormattedUnits(value) : ''), textAfterValue ? /*#__PURE__*/React__default["default"].createElement(TextAfterValue, {
26300
+ className: "TextAfterValue"
26301
+ }, textAfterValue) : '', addingBenchmark && /*#__PURE__*/React__default["default"].createElement(Benchmark, null))), /*#__PURE__*/React__default["default"].createElement(DoughnutChartAndLegendContainer, {
26302
+ legendBelow: legendBelow
26303
+ }, /*#__PURE__*/React__default["default"].createElement(DoughnutChartContainer, {
26199
26304
  width: width,
26200
26305
  height: height,
26201
- data: formmatedData,
26202
- margin: {
26203
- top: 20,
26204
- right: 0,
26205
- bottom: 0,
26206
- left: -5
26207
- }
26208
- }, /*#__PURE__*/React__default["default"].createElement(recharts.CartesianGrid, {
26209
- strokeDasharray: "3 3",
26210
- vertical: false
26211
- }), /*#__PURE__*/React__default["default"].createElement(recharts.XAxis, {
26212
- dataKey: "title",
26213
- tick: false,
26214
- tickLine: false
26215
- }), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
26216
- tickCount: yAxisCounter,
26217
- interval: interval || 'preserveEnd',
26218
- domain: [0, 'auto'],
26219
- tick: {
26220
- fill: '#B1B1B1'
26221
- },
26222
- axisLine: false,
26223
- fontWeight: 400,
26224
- fontSize: "12px",
26225
- tickLine: false,
26226
- tickFormatter: value => `${displayFormattedValue(value)}`
26227
- }), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, {
26228
- content: /*#__PURE__*/React__default["default"].createElement(CustomTooltip, null)
26229
- }), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, null), !showTwoBars ? /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
26230
- dataKey: "value",
26231
- name: "title",
26232
- maxBarSize: 30,
26233
- radius: [4, 4, 0, 0],
26234
- fill: barChartColor
26235
- }) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
26306
+ ref: DoughnutChartContainerRef
26307
+ }, /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, null, /*#__PURE__*/React__default["default"].createElement(recharts.PieChart, null, /*#__PURE__*/React__default["default"].createElement(recharts.Pie, {
26308
+ fill: "#8884d8",
26236
26309
  dataKey: "value",
26237
- name: "title",
26238
- maxBarSize: 30,
26239
- stackId: "a",
26240
- fill: barChartColor
26241
- }), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
26242
- dataKey: "secondValue",
26243
- name: "title",
26244
- maxBarSize: 30,
26245
- radius: [4, 4, 0, 0],
26246
- stackId: "a",
26247
- fill: barChartSecondColor
26248
- })))), displayEventWeeksLegendData(), showLegend && /*#__PURE__*/React__default["default"].createElement(LegendWrapper, null, /*#__PURE__*/React__default["default"].createElement(PerformanceAnalyticsLegend, {
26249
- legendData: legendData
26250
- }))));
26310
+ blendStroke: true,
26311
+ startAngle: -270,
26312
+ data: legendData,
26313
+ outerRadius: DoughnutChartRadius - 4,
26314
+ innerRadius: DoughnutChartRadius - DoughnutChartRadius / 3
26315
+ }, legendData.map(row => /*#__PURE__*/React__default["default"].createElement(recharts.Cell, {
26316
+ key: `cell-${row.name}`,
26317
+ fill: row.color
26318
+ }))), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, {
26319
+ content: /*#__PURE__*/React__default["default"].createElement(CustomTooltip, {
26320
+ value: value,
26321
+ isPercent: isPercent
26322
+ })
26323
+ }), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, null)))), /*#__PURE__*/React__default["default"].createElement(LegendContainer$2, null, legendData.map(row => /*#__PURE__*/React__default["default"].createElement(LegendControlsContainer, {
26324
+ key: row.name
26325
+ }, /*#__PURE__*/React__default["default"].createElement(LegendColorRectangle, {
26326
+ color: row.color
26327
+ }), /*#__PURE__*/React__default["default"].createElement(LegendTitleAndFormatedValueContainer, null, /*#__PURE__*/React__default["default"].createElement(LegendTitle, {
26328
+ style: {
26329
+ flexDirection: itemsValuesSeparateLine ? 'column' : 'row',
26330
+ alignItems: itemsValuesSeparateLine ? 'baseline' : 'center'
26331
+ }
26332
+ }, row.name, displayLegendValue(row)))))))));
26251
26333
  };
26252
- BarChartsByWeeks.propTypes = {
26334
+ TotalDoughnutChart.propTypes = {
26253
26335
  className: PropTypes.string,
26254
26336
  title: PropTypes.string,
26255
- showHeaderTopValue: PropTypes.bool,
26256
- headerValueTopTitle: PropTypes.string,
26257
- headerValueBottomTitle: PropTypes.string,
26258
- headerValue: PropTypes.number,
26259
- HeaderValueCurrencyType: PropTypes.string,
26260
- HeaderValueIsPercent: PropTypes.bool,
26261
- barChartData: PropTypes.arrayOf(PropTypes.shape({
26262
- title: PropTypes.string,
26263
- value: PropTypes.number
26337
+ value: PropTypes.number,
26338
+ rootFont: PropTypes.string,
26339
+ containerPadding: PropTypes.string,
26340
+ addingBenchmark: PropTypes.bool,
26341
+ dotCut: PropTypes.bool,
26342
+ currencySign: PropTypes.bool,
26343
+ currencyType: PropTypes.string,
26344
+ legendData: PropTypes.arrayOf(PropTypes.shape({
26345
+ color: PropTypes.string,
26346
+ value: PropTypes.number,
26347
+ name: PropTypes.string
26264
26348
  })),
26265
- isTitleOriganal: PropTypes.bool,
26349
+ legendBelow: PropTypes.bool,
26350
+ itemsPercentagesValueAside: PropTypes.bool,
26351
+ itemsBoldedValues: PropTypes.bool,
26352
+ itemsValuesSeparateLine: PropTypes.bool,
26266
26353
  width: PropTypes.string,
26267
26354
  height: PropTypes.string,
26268
- barChartColor: PropTypes.string,
26269
- barChartSecondColor: PropTypes.string,
26270
- xselectedColor: PropTypes.string,
26271
- startWeekRange: PropTypes.string,
26272
- endWeekRange: PropTypes.string,
26273
- tooltipTitle: PropTypes.string,
26274
- tooltipSecondTitle: PropTypes.string,
26275
- yAxisCounter: PropTypes.number,
26276
- isPercentValue: PropTypes.bool,
26277
- interval: PropTypes.string,
26278
- showTitle: PropTypes.bool,
26279
- showLegend: PropTypes.bool,
26280
- legendData: PropTypes.arrayOf(PropTypes.shape({
26281
- title: PropTypes.string.isRequired,
26282
- iconType: PropTypes.oneOf([ICON_TYPE_SQUARE$2, ICON_TYPE_LEGEND_UNION_ICON$2, ICON_TYPE_LEGEND_LINE_ICON$1]).isRequired,
26283
- iconColor: PropTypes.string.isRequired
26284
- })),
26285
- showTwoBars: PropTypes.bool,
26286
- setLimitHeight: PropTypes.number,
26287
- setLimitLow: PropTypes.number
26355
+ textcolor: PropTypes.string,
26356
+ titleFontSize: PropTypes.string,
26357
+ FormattedValueFontSize: PropTypes.string,
26358
+ isPercent: PropTypes.bool,
26359
+ hideTitleAndValue: PropTypes.bool,
26360
+ noDataText: PropTypes.string,
26361
+ textAfterValue: PropTypes.string
26288
26362
  };
26289
- BarChartsByWeeks.defaultProps = {
26363
+ TotalDoughnutChart.defaultProps = {
26290
26364
  className: '',
26291
26365
  title: '',
26292
- showHeaderTopValue: true,
26293
- headerValueTopTitle: '',
26294
- headerValueBottomTitle: '',
26295
- headerValue: 0,
26296
- HeaderValueCurrencyType: '',
26297
- HeaderValueIsPercent: false,
26298
- barChartData: [{
26299
- title: '202320',
26300
- value: 542366
26301
- }, {
26302
- title: '202321',
26303
- value: 699511
26304
- }, {
26305
- title: '202322',
26306
- value: 403092
26307
- }, {
26308
- title: '202323',
26309
- value: 396184
26310
- }, {
26311
- title: '202324',
26312
- value: 415317
26313
- }, {
26314
- title: '202325',
26315
- value: 568376
26316
- }, {
26317
- title: '202326',
26318
- value: 1078121
26319
- }, {
26320
- title: '202327',
26321
- value: 347930
26322
- }, {
26323
- title: '202328',
26324
- value: 346258
26325
- }, {
26326
- title: '202329',
26327
- value: 350184
26328
- }],
26366
+ value: 0,
26367
+ rootFont: '18px',
26368
+ containerPadding: '0px',
26369
+ addingBenchmark: false,
26370
+ dotCut: false,
26371
+ currencySign: false,
26372
+ currencyType: 'USD',
26373
+ legendData: [],
26374
+ legendBelow: false,
26375
+ itemsPercentagesValueAside: true,
26376
+ itemsBoldedValues: true,
26377
+ itemsValuesSeparateLine: true,
26329
26378
  width: '100%',
26330
26379
  height: '100%',
26331
- barChartColor: '#BD9EFF',
26332
- barChartSecondColor: '#42977A',
26333
- xselectedColor: '#42977A',
26334
- tooltipTitle: 'Sales',
26335
- tooltipSecondTitle: 'Sales 2',
26336
- startWeekRange: 0,
26337
- endWeekRange: 0,
26338
- yAxisCounter: 10,
26339
- isPercentValue: false,
26340
- interval: 'preserveEnd',
26341
- showTitle: true,
26342
- showLegend: true,
26343
- isTitleOriganal: false,
26344
- legendData: [{
26345
- title: 'Sales',
26346
- iconType: ICON_TYPE_SQUARE$2,
26347
- iconColor: '#90CE9C'
26348
- }, {
26349
- title: 'Category Average',
26350
- iconType: ICON_TYPE_LEGEND_LINE_ICON$1,
26351
- iconColor: '#C906FD'
26352
- }],
26353
- showTwoBars: false,
26354
- setLimitHeight: null,
26355
- setLimitLow: null
26380
+ textcolor: '#212121',
26381
+ titleFontSize: '18px',
26382
+ FormattedValueFontSize: '40px',
26383
+ isPercent: false,
26384
+ hideTitleAndValue: false,
26385
+ noDataText: 'No Data',
26386
+ textAfterValue: ''
26387
+ };
26388
+ function CustomTooltip(_ref) {
26389
+ let {
26390
+ active,
26391
+ payload,
26392
+ value,
26393
+ isPercent = false
26394
+ } = _ref;
26395
+ if (active && payload && payload.length) {
26396
+ // eslint-disable-next-line no-nested-ternary
26397
+ const percent = value && value !== 0 && !isPercent ? (payload[0].value / value * 100).toFixed(1) : value && isPercent ? payload[0].value.toFixed(1) : 0;
26398
+ return /*#__PURE__*/React__default["default"].createElement(TooltipDiv$2, null, /*#__PURE__*/React__default["default"].createElement(TooltipLabel$2, null, `${payload[0].name} ${percent}%`));
26399
+ }
26400
+ }
26401
+ CustomTooltip.propTypes = {
26402
+ // eslint-disable-next-line react/forbid-prop-types
26403
+ active: PropTypes.any,
26404
+ // eslint-disable-next-line react/forbid-prop-types
26405
+ payload: PropTypes.any,
26406
+ // eslint-disable-next-line react/forbid-prop-types
26407
+ value: PropTypes.any,
26408
+ // eslint-disable-next-line react/forbid-prop-types
26409
+ isPercent: PropTypes.any
26410
+ };
26411
+ CustomTooltip.defaultProps = {
26412
+ active: '',
26413
+ payload: '',
26414
+ value: '',
26415
+ isPercent: false
26416
+ };
26417
+
26418
+ const TooltipContainer$2 = styled__default["default"].div`
26419
+ --tooltip-text-color: black;
26420
+ --tooltip-background-color: white;
26421
+ --tooltip-margin: 40px;
26422
+ --tooltip-arrow-size: 10px;
26423
+ position: absolute;
26424
+ z-index: 999999;
26425
+ top: ${props => props.top};
26426
+ left: ${props => props.left};
26427
+ `;
26428
+ const TooltipWrapper = styled__default["default"].div`
26429
+ display: inline-block;
26430
+ position: relative;
26431
+ `;
26432
+ const TooltipTip = styled__default["default"].div`
26433
+ box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);
26434
+ position: absolute;
26435
+ border-radius: 4px;
26436
+ left: 50%;
26437
+ transform: translateX(-50%);
26438
+ padding: 8px 12px;
26439
+ color: var(--tooltip-text-color);
26440
+ background: var(--tooltip-background-color);
26441
+ font-size: 10px;
26442
+ z-index: 999;
26443
+ white-space: nowrap;
26444
+
26445
+ /* CSS border triangles */
26446
+ &.controls::before {
26447
+ content: " ";
26448
+ left: 50%;
26449
+ border: solid transparent;
26450
+ height: 0;
26451
+ width: 0;
26452
+ position: absolute;
26453
+ pointer-events: none;
26454
+ border-width: var(--tooltip-arrow-size);
26455
+ margin-left: calc(var(--tooltip-arrow-size) * -1);
26456
+ }
26457
+
26458
+ /* Absolute positioning */
26459
+ &.controls.top {
26460
+ top: calc(var(--tooltip-margin) * -1);
26461
+ }
26462
+
26463
+ /* CSS border triangles */
26464
+ &.controls.top::before {
26465
+ top: 100%;
26466
+ border-top-color: var(--tooltip-background-color);
26467
+ }
26468
+
26469
+ /* Absolute positioning */
26470
+ &.controls.right {
26471
+ left: calc(70% + var(--tooltip-margin));
26472
+ top: 50%;
26473
+ transform: translateX(0) translateY(-50%);
26474
+ }
26475
+
26476
+ /* CSS border triangles */
26477
+ &.controls.right::before {
26478
+ left: calc(var(--tooltip-arrow-size) * -1);
26479
+ top: 50%;
26480
+ transform: translateX(0) translateY(-50%);
26481
+ border-right-color: var(--tooltip-background-color);
26482
+ }
26483
+
26484
+ /* Absolute positioning */
26485
+ &.controls.bottom {
26486
+ bottom: calc(var(--tooltip-margin) * -1);
26487
+ }
26488
+ /* CSS border triangles */
26489
+ &.controls.bottom::before {
26490
+ bottom: 100%;
26491
+ border-bottom-color: var(--tooltip-background-color);
26492
+ }
26493
+
26494
+ /* Absolute positioning */
26495
+ &.controls.left {
26496
+ left: auto;
26497
+ right: calc(70% + var(--tooltip-margin));
26498
+ top: 50%;
26499
+ transform: translateX(0) translateY(-50%);
26500
+ }
26501
+ /* CSS border triangles */
26502
+ &.controls.left::before {
26503
+ left: auto;
26504
+ right: calc(var(--tooltip-arrow-size) * -2);
26505
+ top: 50%;
26506
+ transform: translateX(0) translateY(-50%);
26507
+ border-left-color: var(--tooltip-background-color);
26508
+ }
26509
+
26510
+ > ul {
26511
+ padding-left: 10px;
26512
+ margin: 0;
26513
+ }
26514
+ `;
26515
+
26516
+ const Tooltip = props => {
26517
+ const {
26518
+ className,
26519
+ top,
26520
+ left,
26521
+ direction,
26522
+ content
26523
+ } = props;
26524
+ return /*#__PURE__*/React__default["default"].createElement(TooltipContainer$2, {
26525
+ className: className,
26526
+ top: `${top}px`,
26527
+ left: `${left}px`
26528
+ }, /*#__PURE__*/React__default["default"].createElement(TooltipWrapper, null, /*#__PURE__*/React__default["default"].createElement(TooltipTip, {
26529
+ className: `controls ${direction || 'top'}`
26530
+ }, content)));
26531
+ };
26532
+ Tooltip.propTypes = {
26533
+ className: PropTypes.string,
26534
+ top: PropTypes.number,
26535
+ left: PropTypes.number,
26536
+ direction: PropTypes.string,
26537
+ content: PropTypes.string
26538
+ };
26539
+ Tooltip.defaultProps = {
26540
+ className: '',
26541
+ top: 0,
26542
+ left: 0,
26543
+ direction: 'top',
26544
+ content: ''
26356
26545
  };
26357
26546
 
26358
- const scrollableStyles$5 = `
26359
- overflow-y: auto;
26547
+ const ControlsContainer$3 = styled__default["default"].div`
26548
+ font-family: "Poppins", sans-serif;
26549
+ background-color: white;
26550
+ color: ${props => props.textColor};
26551
+ width: ${props => props.width};
26552
+ height: ${props => props.height};
26553
+ /* display: flex;
26554
+ flex-direction: column;
26555
+ overflow: hidden; */
26556
+ overflow-y: ${props => props.scroller};
26360
26557
 
26361
26558
  &::-webkit-scrollbar {
26362
- width: 0.5em; /* 8px → 0.5em */
26559
+ width: 8px;
26363
26560
  }
26364
26561
 
26365
26562
  &::-webkit-scrollbar-track {
26366
26563
  background: #E8E8E8;
26564
+ border-radius: 5px;
26367
26565
  }
26368
26566
 
26369
26567
  &::-webkit-scrollbar-thumb {
26370
26568
  background: #D0D0D0;
26569
+ border-radius: 5px;
26371
26570
  }
26372
26571
  `;
26373
- const ControlsContainer$4 = styled__default["default"].div`
26374
- position: relative;
26375
- font-family: "Poppins", sans-serif;
26376
- font-size: ${props => props.rootFont || '1em'}; /* Base font size */
26377
- color: ${props => props.textColor};
26378
- width: ${props => props.width};
26379
- height: ${props => props.height};
26380
- padding: ${props => props.containerPadding || '0'};
26381
- display: flex;
26382
- align-items: center;
26383
- @media (max-width: 1536px) {
26384
- ${scrollableStyles$5}
26572
+ styled__default["default"].div`
26573
+ overflow-y: auto;
26574
+ height: 100%;
26575
+
26576
+ &::-webkit-scrollbar {
26577
+ width: 8px;
26385
26578
  }
26386
26579
 
26387
- > * {
26388
- box-sizing: border-box;
26580
+ &::-webkit-scrollbar-track {
26581
+ background: #E8E8E8;
26582
+ border-radius: 5px;
26583
+ }
26584
+
26585
+ &::-webkit-scrollbar-thumb {
26586
+ background: #D0D0D0;
26587
+ border-radius: 5px;
26389
26588
  }
26390
26589
  `;
26391
- const Controls$3 = styled__default["default"].div`
26392
- display: flex;
26393
- flex-direction: column;
26394
- width: 100%;
26395
- height: 100%;
26396
- background: white;
26397
- border-radius: 12px;
26398
- `;
26399
- const TooltipDiv$2 = styled__default["default"].div`
26400
- display: flex;
26401
- background: white;
26402
- padding: 0.375em 0.625em; /* 6px 10px → 0.375em 0.625em */
26403
- margin: 0;
26404
- `;
26405
- const TooltipLabel$2 = styled__default["default"].p`
26406
- color: #212121;
26407
- font-family: "Poppins", sans-serif;
26408
- font-size: 0.75em; /* 12px → 0.75em */
26409
- font-weight: 400;
26410
- font-style: normal;
26411
- width: max-content;
26412
- line-height: normal;
26413
- margin: 0;
26414
- `;
26415
- const TitleAndValueContainer$1 = styled__default["default"].div`
26416
- display: flex;
26417
- flex-direction: column;
26418
- padding: 0 1.25em; /* 20px → 1.25em */
26590
+ const CardHeader = styled__default["default"].div`
26591
+ padding: 16px;
26592
+ position: sticky;
26593
+ top: 0;
26594
+ z-index: 10;
26595
+ background-color: white;
26419
26596
  `;
26420
- const Title$9 = styled__default["default"].h4`
26597
+ const TotalValue = styled__default["default"].div`
26421
26598
  font-weight: 500;
26422
- font-size: ${props => props.titleFontSize || '1.125em'}; /* Default: 18px → 1.125em */
26423
- margin: 0;
26424
- @media (max-width: 1536px) {
26425
- font-size: 0.875em; /* 14px → 0.875em */
26426
- }
26427
- @media (max-width: 1366px) {
26428
- font-size: 0.75em; /* 12px → 0.75em */
26429
- }
26430
- `;
26431
- const CurrencySignAndFormattedValueContainer = styled__default["default"].div`
26599
+ font-size: 40px;
26432
26600
  display: flex;
26433
- align-items: center;
26434
- gap: 0.3125em; /* 5px → 0.3125em */
26435
26601
  align-items: baseline;
26436
- `;
26437
- const CurrencySign$1 = styled__default["default"].span`
26438
- font-weight: 500;
26439
- font-size: 1em; /* 16px → 1em */
26440
- @media (max-width: 1536px) {
26441
- font-size: 0.875em; /* 14px → 0.875em */
26442
- }
26443
- @media (max-width: 1366px) {
26444
- font-size: 0.6875em; /* 11px → 0.6875em */
26445
- }
26446
- `;
26447
- const FormattedValue$1 = styled__default["default"].div`
26448
- font-weight: 500;
26449
- font-size: ${props => props.FormattedValueFontSize || '2.5em'}; /* Default: 40px → 2.5em */
26602
+ line-height: 1;
26450
26603
  @media (max-width: 1536px) {
26451
- font-size: 1.5em; /* 24px → 1.5em */
26604
+ font-size: 24px;
26452
26605
  }
26453
26606
  @media (max-width: 1366px) {
26454
- font-size: 1.25em; /* 20px → 1.25em */
26607
+ font-size: 20px;
26455
26608
  }
26456
26609
  `;
26457
- const TextAfterValue = styled__default["default"].div`
26610
+ const Title$8 = styled__default["default"].h4`
26611
+ font-size: 18px;
26458
26612
  font-weight: 400;
26459
- font-size: 0.75em; /* 12px → 0.75em */
26613
+ line-height: 1;
26614
+ margin: 0 0 8px;
26460
26615
  @media (max-width: 1536px) {
26461
- font-size: 0.6875em; /* 11px → 0.6875em */
26616
+ font-size: 14px;
26462
26617
  }
26463
26618
  @media (max-width: 1366px) {
26464
- font-size: 0.625em; /* 10px → 0.625em */
26619
+ font-size: 12px;
26465
26620
  }
26466
26621
  `;
26467
- const DoughnutChartAndLegendContainer = styled__default["default"].div`
26468
- display: flex;
26469
- flex-direction: ${props => props.legendBelow ? 'column' : 'row'};
26470
- gap: 0.75em; /* 12px → 0.75em */
26471
- justify-content: space-between;
26472
- margin-top: auto;
26473
- padding: 0 1.25em; /* 20px → 1.25em */
26474
- margin-bottom: 1.25em; /* 20px → 1.25em */
26475
- `;
26476
- const DoughnutChartContainer = styled__default["default"].div`
26477
- display: flex;
26478
- align-items: center;
26479
- min-width: 90px;
26480
- min-height: 90px;
26481
- `;
26482
- const LegendContainer$2 = styled__default["default"].div`
26483
- padding-left: 0.625em; /* 10px → 0.625em */
26484
- display: flex;
26485
- flex-direction: column;
26486
- justify-content: space-evenly;
26487
- `;
26488
- const LegendControlsContainer = styled__default["default"].div`
26489
- display: flex;
26490
- gap: 0.5em; /* 8px → 0.5em */
26491
- align-items: center;
26492
- margin-bottom: 0.375em; /* 6px → 0.375em */
26493
- `;
26494
- const LegendTitleAndFormatedValueContainer = styled__default["default"].div`
26495
- flex-grow: 1;
26496
- `;
26497
- styled__default["default"].div`
26498
- font-size: 0.875rem;
26499
- `;
26500
- const LegendColorRectangle = styled__default["default"].div`
26501
- width: 0.875rem;
26502
- min-width: 0.875rem;
26503
- height: 0.875rem;
26504
- border-radius: 2px;
26505
- background: ${props => props.color};
26506
- `;
26507
- const LegendTitle = styled__default["default"].h5`
26508
- font-weight: 400;
26509
- font-size: 1em; /* 16px → 1em */
26510
- gap: 0.3125em; /* 5px → 0.3125em */
26511
- margin: 0;
26512
- display: flex;
26513
- justify-content: space-between;
26622
+ const CurrencySign = styled__default["default"].span`
26623
+ font-weight: 500;
26624
+ font-size: 16px;
26514
26625
  @media (max-width: 1536px) {
26515
- font-size: 0.75em; /* 11px → 0.6875em */
26626
+ font-size: 14px;
26516
26627
  }
26517
26628
  @media (max-width: 1366px) {
26518
- font-size: 0.625em; /* 10px → 0.625em */
26629
+ font-size: 11px;
26519
26630
  }
26520
26631
  `;
26521
- const LegendFormattedValue = styled__default["default"].span`
26522
- font-weight: 500;
26523
- font-size: 0.875em; /* 14px → 0.875em */
26524
- white-space: nowrap;
26525
- `;
26526
26632
 
26527
- const TotalDoughnutChart = props => {
26633
+ /* eslint-disable no-unused-vars */
26634
+ const TotalHorizontalCharts = props => {
26528
26635
  const {
26529
- className,
26530
- width,
26531
- height,
26532
26636
  title,
26533
26637
  value,
26534
- rootFont,
26535
- containerPadding,
26536
- addingBenchmark,
26537
26638
  dotCut,
26538
26639
  currencySign,
26539
26640
  currencyType,
26540
- legendData,
26541
- legendBelow,
26542
- itemsPercentagesValueAside,
26543
- itemsBoldedValues,
26544
- itemsValuesSeparateLine,
26545
- textcolor,
26546
- titleFontSize,
26547
- FormattedValueFontSize,
26548
- isPercent,
26549
- hideTitleAndValue,
26641
+ chartsData,
26642
+ showScrollerBarsCount,
26643
+ labelFontSize,
26644
+ labelLimitedLetters,
26645
+ width,
26646
+ height,
26647
+ rightGap,
26648
+ textColor,
26550
26649
  noDataText,
26551
- textAfterValue
26552
- } = props;
26553
- const [DoughnutChartRadius, setDoughnutChartRadius] = React$1.useState(0);
26554
- const [zoomResolution, setZoomResolution] = React$1.useState(1);
26555
- const DoughnutChartContainerRef = React$1.useRef();
26556
- const dotCutTrenty = row => {
26557
- if (!row || !row.value) return null;
26558
- let valueNew = 0;
26559
- if (row?.value && Math.abs(row.value) > 0 && row.value % 1 !== 0) {
26560
- valueNew = row?.value?.toFixed(2);
26561
- } else {
26562
- valueNew = row?.value;
26563
- }
26564
- return dotCut ? getFormattedValue(valueNew) : getNumberWithCommas(valueNew);
26565
- };
26566
- React$1.useEffect(() => {
26567
- const handleResize = () => {
26568
- setZoomResolution(window.devicePixelRatio);
26569
- };
26650
+ showPercentAsideValue,
26651
+ isDollar,
26652
+ isPercentage,
26653
+ showDollarSign,
26654
+ className,
26655
+ hideTotalValue,
26656
+ hideTitle
26657
+ } = props;
26658
+ const barBackgrounds = chartsData.map(bg => bg.color);
26659
+ const topHeader = React$1.useRef();
26660
+ const wrapper = React$1.useRef();
26661
+ const BAR_HEIGHT = 40; // Height of each bar including padding
26662
+ const CHART_PADDING = 40; // Total padding for chart (top + bottom)
26570
26663
 
26571
- // Add event listener for window resize to update zoom resolution
26572
- window.addEventListener('resize', handleResize);
26664
+ // Inside the TotalHorizontalCharts component
26665
+ const calculateChartHeight = () => {
26666
+ if (!chartsData?.length) return 0;
26667
+ if (chartsData.length > showScrollerBarsCount) {
26668
+ return chartsData.length * BAR_HEIGHT + CHART_PADDING;
26669
+ }
26573
26670
 
26574
- // Initial update of zoom resolution
26575
- setZoomResolution(window.devicePixelRatio);
26671
+ // Calculate height to show only specified number of bars
26672
+ const visibleBarsHeight = showScrollerBarsCount * BAR_HEIGHT;
26576
26673
 
26577
- // Clean up the event listener when component unmounts
26578
- return () => {
26579
- window.removeEventListener('resize', handleResize);
26580
- };
26581
- }, []);
26582
- React$1.useEffect(() => {
26583
- const MIN_RADIUS = 45;
26584
- if (!DoughnutChartContainerRef) return;
26674
+ // Use the smaller value between:
26675
+ // 1. Height needed for all bars
26676
+ // 2. Height needed for specified number of bars
26677
+ return Math.min(chartsData.length * BAR_HEIGHT + CHART_PADDING, visibleBarsHeight + CHART_PADDING);
26678
+ };
26679
+ const [showLegendTooltip, setShowLegendTooltip] = React$1.useState(false);
26680
+ const [tooltipText, setTooltipText] = React$1.useState({
26681
+ content: '',
26682
+ clientX: 0,
26683
+ clientY: 0
26684
+ });
26685
+ const CustomizedLabel = props => showPercentAsideValue ? /*#__PURE__*/React__default["default"].createElement("text", {
26686
+ x: props.x + (props.width <= 0 ? -12 : props.width) + 56,
26687
+ y: props.y + 4,
26688
+ dy: props.height / 2,
26689
+ dx: -8,
26690
+ fill: props.stroke,
26691
+ fontSize: 12,
26692
+ fontWeight: 500,
26693
+ textAnchor: "middle"
26694
+ }, ''.concat(getFormattedValue(props.value), getFormattedUnits(props.value)), /*#__PURE__*/React__default["default"].createElement("tspan", {
26695
+ fontWeight: 400
26696
+ }, ` (${(props.value / value * 100).toFixed(0)}%)`)) : /*#__PURE__*/React__default["default"].createElement("text", {
26697
+ x: props.x + (props.width <= 0 ? -12 : props.width) + 40,
26698
+ y: props.y + 4,
26699
+ dy: props.height / 2,
26700
+ dx: -8,
26701
+ fill: props.stroke,
26702
+ fontSize: 12,
26703
+ fontWeight: 400,
26704
+ textAnchor: "middle"
26705
+ }, !isDollar ? ''.concat(getFormattedValue(props.value), isPercentage ? '%' : getFormattedUnits(props.value)) : ''.concat(showDollarSign ? '$' : '', getFormattedValue(props.value), getFormattedUnits(props.value)));
26706
+ const CustomizedTickBarChart = props => {
26585
26707
  const {
26586
- current
26587
- } = DoughnutChartContainerRef;
26588
- if (!current) return;
26589
- const DoughnutChartContainerWidth = current?.clientWidth;
26590
- const DoughnutChartContainerHeight = current?.clientHeight;
26591
- const resolutionFactor = zoomResolution && zoomResolution >= 1 ? zoomResolution : 1;
26592
- let radius = DoughnutChartContainerWidth > DoughnutChartContainerHeight ? DoughnutChartContainerHeight / 2 / resolutionFactor : DoughnutChartContainerWidth / 2 / resolutionFactor;
26593
- if (radius < MIN_RADIUS) {
26594
- radius = MIN_RADIUS;
26595
- }
26596
- setDoughnutChartRadius(radius);
26597
- }, [height, width, DoughnutChartContainerRef?.current?.clientWidth, DoughnutChartContainerRef?.current?.clientHeight, zoomResolution]);
26598
- const displayLegendValue = row => /*#__PURE__*/React__default["default"].createElement(LegendFormattedValue, {
26599
- style: {
26600
- fontWeight: itemsBoldedValues ? '700' : '500'
26601
- }
26602
- }, !isPercent && row.value && currencySign ? getCurrencySign(currencyType, row.value) : '', !isPercent && row.value !== undefined && row.value !== null ? dotCutTrenty(row) : !isPercent && 'No Data', !isPercent && row.value && dotCut ? getFormattedUnits(row.value) : '', !isPercent && row.value && itemsPercentagesValueAside && /*#__PURE__*/React__default["default"].createElement("span", {
26603
- style: {
26604
- fontWeight: itemsBoldedValues ? '700' : '400'
26708
+ x,
26709
+ y,
26710
+ height,
26711
+ payload,
26712
+ fill,
26713
+ orientation,
26714
+ stroke
26715
+ } = props;
26716
+ const handleMouseEnter = content => {
26717
+ setTooltipText(prevState => ({
26718
+ ...prevState,
26719
+ content: content !== prevState.content ? content : prevState.content,
26720
+ clientX: x / 1.2,
26721
+ clientY: y - 20
26722
+ }));
26723
+ setShowLegendTooltip(true);
26724
+ };
26725
+ const handleMouseLeave = () => {
26726
+ if (showLegendTooltip === false) return;
26727
+ setTimeout(() => {
26728
+ setShowLegendTooltip(false);
26729
+ }, 1200);
26730
+ };
26731
+ if (chartsData && chartsData.length > 0 && payload) {
26732
+ const chartsDataLabel = chartsData.filter(item => item.name === payload.value);
26733
+ if (chartsDataLabel && chartsDataLabel.length > 0) {
26734
+ return /*#__PURE__*/React__default["default"].createElement("g", {
26735
+ onMouseEnter: () => handleMouseEnter(payload.value),
26736
+ onMouseLeave: handleMouseLeave
26737
+ }, /*#__PURE__*/React__default["default"].createElement("text", {
26738
+ style: {
26739
+ whiteSpace: 'nowrap'
26740
+ },
26741
+ height: height,
26742
+ x: 20,
26743
+ y: y,
26744
+ fontSize: labelFontSize,
26745
+ orientation: orientation,
26746
+ stroke: stroke,
26747
+ textAnchor: "start"
26748
+ // verticalAnchor="middle"
26749
+ ,
26750
+ fill: fill
26751
+ }, payload.value.length > labelLimitedLetters - 1 ? `${payload.value.slice(0, labelLimitedLetters)}...` : payload.value));
26752
+ }
26753
+ return null;
26605
26754
  }
26606
- }, ' (', `${Math.round(row.value / value * 100)}%)`), isPercent && row.value && `${row.value.toFixed(1)}%`);
26607
- return /*#__PURE__*/React__default["default"].createElement(ControlsContainer$4, {
26608
- className: className,
26755
+ return null;
26756
+ };
26757
+ return /*#__PURE__*/React__default["default"].createElement(ControlsContainer$3, {
26758
+ ref: wrapper,
26609
26759
  height: height,
26610
26760
  width: width,
26611
- rootFont: rootFont,
26612
- containerPadding: containerPadding,
26613
- textcolor: textcolor
26614
- }, legendData.length === 0 || legendData.every(item => item.value === undefined || item.value === null) ? /*#__PURE__*/React__default["default"].createElement(NoDataFoundMessage, {
26615
- className: "NoDataFoundMessage",
26616
- noDataText: noDataText
26617
- }) : /*#__PURE__*/React__default["default"].createElement(Controls$3, {
26618
- className: "Controls",
26619
- height: height,
26620
- width: width
26621
- }, !hideTitleAndValue && /*#__PURE__*/React__default["default"].createElement(TitleAndValueContainer$1, {
26622
- className: "TitleAndValueContainer"
26623
- }, /*#__PURE__*/React__default["default"].createElement(Title$9, {
26624
- className: "Title",
26625
- fontSize: titleFontSize
26626
- }, title), /*#__PURE__*/React__default["default"].createElement(CurrencySignAndFormattedValueContainer, {
26627
- className: "CurrencySignAndFormattedValueContainer"
26628
- }, /*#__PURE__*/React__default["default"].createElement(FormattedValue$1, {
26629
- className: "FormattedValue",
26630
- fontSize: FormattedValueFontSize,
26631
- width: width
26632
- }, /*#__PURE__*/React__default["default"].createElement(CurrencySign$1, {
26761
+ textColor: textColor,
26762
+ scroller: chartsData.length > showScrollerBarsCount ? 'auto' : 'hidden',
26763
+ className: className
26764
+ }, chartsData?.length > 0 ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, !hideTitle || !hideTotalValue ? /*#__PURE__*/React__default["default"].createElement(CardHeader, {
26765
+ ref: topHeader,
26766
+ className: "CardHeader"
26767
+ }, !hideTitle ? /*#__PURE__*/React__default["default"].createElement(Title$8, null, title) : '', !hideTotalValue ? /*#__PURE__*/React__default["default"].createElement(TotalValue, {
26768
+ className: "TotalValue"
26769
+ }, currencySign && /*#__PURE__*/React__default["default"].createElement(CurrencySign, {
26633
26770
  className: "CurrencySign"
26634
- }, currencySign ? getCurrencySign(currencyType, value) : ''), dotCut ? getFormattedValue(value && Math.abs(value) > 0 && value % 1 !== 0 ? value?.toFixed(2) : value) : getNumberWithCommas(value), dotCut ? getFormattedUnits(value) : ''), textAfterValue ? /*#__PURE__*/React__default["default"].createElement(TextAfterValue, {
26635
- className: "TextAfterValue"
26636
- }, textAfterValue) : '', addingBenchmark && /*#__PURE__*/React__default["default"].createElement(Benchmark, null))), /*#__PURE__*/React__default["default"].createElement(DoughnutChartAndLegendContainer, {
26637
- legendBelow: legendBelow
26638
- }, /*#__PURE__*/React__default["default"].createElement(DoughnutChartContainer, {
26639
- width: width,
26640
- height: height,
26641
- ref: DoughnutChartContainerRef
26642
- }, /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, null, /*#__PURE__*/React__default["default"].createElement(recharts.PieChart, null, /*#__PURE__*/React__default["default"].createElement(recharts.Pie, {
26771
+ }, getCurrencySign(currencyType, value)), dotCut ? getFormattedValue(value && Math.abs(value) > 0 && value % 1 !== 0 ? value?.toFixed(2) : value) : getNumberWithCommas(value), dotCut ? getFormattedUnits(value) : '') : '') : '', /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
26772
+ width: "100%",
26773
+ height: calculateChartHeight()
26774
+ }, /*#__PURE__*/React__default["default"].createElement(recharts.BarChart, {
26775
+ layout: "vertical",
26776
+ data: chartsData,
26777
+ margin: {
26778
+ top: 10,
26779
+ right: 20,
26780
+ bottom: 20,
26781
+ left: 10
26782
+ }
26783
+ }, /*#__PURE__*/React__default["default"].createElement(recharts.XAxis, {
26784
+ type: "number",
26785
+ domain: [0, dataMax => dataMax * rightGap]
26786
+ // allowDataOverflow={false}
26787
+ ,
26788
+ hide: true
26789
+ }), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
26790
+ dataKey: "name",
26791
+ type: "category",
26792
+ width: labelLimitedLetters * 10,
26793
+ tickLine: false,
26794
+ axisLine: false,
26795
+ interval: 0,
26796
+ allowDataOverflow: true,
26797
+ tick: CustomizedTickBarChart
26798
+ }), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
26799
+ dataKey: "value",
26800
+ barSize: 20,
26643
26801
  fill: "#8884d8",
26802
+ barCategoryGap: 10,
26803
+ barGap: 5
26804
+ }, /*#__PURE__*/React__default["default"].createElement(recharts.LabelList, {
26644
26805
  dataKey: "value",
26645
- blendStroke: true,
26646
- startAngle: -270,
26647
- data: legendData,
26648
- outerRadius: DoughnutChartRadius - 4,
26649
- innerRadius: DoughnutChartRadius - DoughnutChartRadius / 3
26650
- }, legendData.map(row => /*#__PURE__*/React__default["default"].createElement(recharts.Cell, {
26651
- key: `cell-${row.name}`,
26652
- fill: row.color
26653
- }))), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, {
26654
- content: /*#__PURE__*/React__default["default"].createElement(CustomTooltip, {
26655
- value: value,
26656
- isPercent: isPercent
26657
- })
26658
- }), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, null)))), /*#__PURE__*/React__default["default"].createElement(LegendContainer$2, null, legendData.map(row => /*#__PURE__*/React__default["default"].createElement(LegendControlsContainer, {
26659
- key: row.name
26660
- }, /*#__PURE__*/React__default["default"].createElement(LegendColorRectangle, {
26661
- color: row.color
26662
- }), /*#__PURE__*/React__default["default"].createElement(LegendTitleAndFormatedValueContainer, null, /*#__PURE__*/React__default["default"].createElement(LegendTitle, {
26806
+ content: CustomizedLabel
26807
+ }), chartsData.map((entry, index) =>
26808
+ /*#__PURE__*/
26809
+ // eslint-disable-next-line react/no-array-index-key
26810
+ React__default["default"].createElement(recharts.Cell, {
26811
+ key: `cell-${index}`,
26812
+ fill: barBackgrounds[index % 20]
26813
+ }))), showLegendTooltip && /*#__PURE__*/React__default["default"].createElement(Tooltip, {
26814
+ direction: "top",
26815
+ content: tooltipText.content,
26816
+ top: tooltipText.clientY,
26817
+ left: tooltipText.clientX,
26663
26818
  style: {
26664
- flexDirection: itemsValuesSeparateLine ? 'column' : 'row',
26665
- alignItems: itemsValuesSeparateLine ? 'baseline' : 'center'
26819
+ pointerEvents: 'none'
26666
26820
  }
26667
- }, row.name, displayLegendValue(row)))))))));
26821
+ })))) : /*#__PURE__*/React__default["default"].createElement(NoDataFoundMessage, {
26822
+ noDataText: noDataText
26823
+ }));
26668
26824
  };
26669
- TotalDoughnutChart.propTypes = {
26825
+ TotalHorizontalCharts.propTypes = {
26670
26826
  className: PropTypes.string,
26671
26827
  title: PropTypes.string,
26672
26828
  value: PropTypes.number,
26673
- rootFont: PropTypes.string,
26674
- containerPadding: PropTypes.string,
26675
- addingBenchmark: PropTypes.bool,
26676
26829
  dotCut: PropTypes.bool,
26677
26830
  currencySign: PropTypes.bool,
26678
26831
  currencyType: PropTypes.string,
26679
- legendData: PropTypes.arrayOf(PropTypes.shape({
26680
- color: PropTypes.string,
26832
+ chartsData: PropTypes.arrayOf(PropTypes.shape({
26833
+ name: PropTypes.string,
26681
26834
  value: PropTypes.number,
26682
- name: PropTypes.string
26683
- })),
26684
- legendBelow: PropTypes.bool,
26685
- itemsPercentagesValueAside: PropTypes.bool,
26686
- itemsBoldedValues: PropTypes.bool,
26687
- itemsValuesSeparateLine: PropTypes.bool,
26835
+ color: PropTypes.string
26836
+ })),
26837
+ showScrollerBarsCount: PropTypes.number,
26838
+ showPercentAsideValue: PropTypes.bool,
26839
+ labelFontSize: PropTypes.number,
26840
+ labelLimitedLetters: PropTypes.number,
26688
26841
  width: PropTypes.string,
26689
26842
  height: PropTypes.string,
26690
- textcolor: PropTypes.string,
26691
- titleFontSize: PropTypes.string,
26692
- FormattedValueFontSize: PropTypes.string,
26693
- isPercent: PropTypes.bool,
26694
- hideTitleAndValue: PropTypes.bool,
26843
+ rightGap: PropTypes.number,
26844
+ textColor: PropTypes.string,
26695
26845
  noDataText: PropTypes.string,
26696
- textAfterValue: PropTypes.string
26846
+ isDollar: PropTypes.bool,
26847
+ isPercentage: PropTypes.bool,
26848
+ showDollarSign: PropTypes.bool,
26849
+ hideTotalValue: PropTypes.bool,
26850
+ hideTitle: PropTypes.bool
26697
26851
  };
26698
- TotalDoughnutChart.defaultProps = {
26852
+ TotalHorizontalCharts.defaultProps = {
26699
26853
  className: '',
26700
- title: '',
26854
+ title: 'SALES',
26701
26855
  value: 0,
26702
- rootFont: '18px',
26703
- containerPadding: '0px',
26704
- addingBenchmark: false,
26705
26856
  dotCut: false,
26706
26857
  currencySign: false,
26707
26858
  currencyType: 'USD',
26708
- legendData: [],
26709
- legendBelow: false,
26710
- itemsPercentagesValueAside: true,
26711
- itemsBoldedValues: true,
26712
- itemsValuesSeparateLine: true,
26859
+ chartsData: [],
26860
+ showScrollerBarsCount: 7,
26861
+ showPercentAsideValue: false,
26862
+ labelFontSize: 10,
26863
+ labelLimitedLetters: 12,
26713
26864
  width: '100%',
26714
26865
  height: '100%',
26715
- textcolor: '#212121',
26716
- titleFontSize: '18px',
26717
- FormattedValueFontSize: '40px',
26718
- isPercent: false,
26719
- hideTitleAndValue: false,
26866
+ rightGap: 1,
26867
+ textColor: '#212121',
26720
26868
  noDataText: 'No Data',
26721
- textAfterValue: ''
26869
+ isDollar: true,
26870
+ isPercentage: false,
26871
+ showDollarSign: true,
26872
+ hideTotalValue: false,
26873
+ hideTitle: false
26722
26874
  };
26723
- function CustomTooltip(_ref) {
26875
+
26876
+ const LampIcon = _ref => {
26724
26877
  let {
26725
- active,
26726
- payload,
26727
- value,
26728
- isPercent = false
26878
+ // eslint-disable-next-line react/prop-types
26879
+ width = '23',
26880
+ // eslint-disable-next-line react/prop-types
26881
+ height = '19',
26882
+ // eslint-disable-next-line react/prop-types
26883
+ fill = '#229E38'
26729
26884
  } = _ref;
26730
- if (active && payload && payload.length) {
26731
- // eslint-disable-next-line no-nested-ternary
26732
- const percent = value && value !== 0 && !isPercent ? (payload[0].value / value * 100).toFixed(1) : value && isPercent ? payload[0].value.toFixed(1) : 0;
26733
- return /*#__PURE__*/React__default["default"].createElement(TooltipDiv$2, null, /*#__PURE__*/React__default["default"].createElement(TooltipLabel$2, null, `${payload[0].name} ${percent}%`));
26734
- }
26735
- }
26736
- CustomTooltip.propTypes = {
26737
- // eslint-disable-next-line react/forbid-prop-types
26738
- active: PropTypes.any,
26739
- // eslint-disable-next-line react/forbid-prop-types
26740
- payload: PropTypes.any,
26741
- // eslint-disable-next-line react/forbid-prop-types
26742
- value: PropTypes.any,
26743
- // eslint-disable-next-line react/forbid-prop-types
26744
- isPercent: PropTypes.any
26745
- };
26746
- CustomTooltip.defaultProps = {
26747
- active: '',
26748
- payload: '',
26749
- value: '',
26750
- isPercent: false
26885
+ return /*#__PURE__*/React__default["default"].createElement("svg", {
26886
+ width: width,
26887
+ height: height,
26888
+ viewBox: "0 0 23 19",
26889
+ fill: "none",
26890
+ xmlns: "http://www.w3.org/2000/svg"
26891
+ }, /*#__PURE__*/React__default["default"].createElement("path", {
26892
+ d: "M2.42578 0.390625L4.11328 1.51562C4.5 1.79688 4.60547 2.32422 4.35938 2.71094C4.07812 3.09766 3.55078 3.20312 3.16406 2.92188L1.47656 1.79688C1.08984 1.55078 0.984375 1.02344 1.26562 0.636719C1.51172 0.25 2.03906 0.144531 2.42578 0.390625ZM20.9883 1.79688L19.3008 2.92188C18.9141 3.20312 18.3867 3.09766 18.1406 2.71094C17.8594 2.32422 17.9648 1.79688 18.3516 1.51562L20.0391 0.390625C20.4258 0.144531 20.9531 0.25 21.2344 0.636719C21.4805 1.02344 21.375 1.55078 20.9883 1.79688ZM0.84375 5.875H3.09375C3.55078 5.875 3.9375 6.26172 3.9375 6.71875C3.9375 7.21094 3.55078 7.5625 3.09375 7.5625H0.84375C0.351562 7.5625 0 7.21094 0 6.71875C0 6.26172 0.351562 5.875 0.84375 5.875ZM19.4062 5.875H21.6562C22.1133 5.875 22.5 6.26172 22.5 6.71875C22.5 7.21094 22.1133 7.5625 21.6562 7.5625H19.4062C18.9141 7.5625 18.5625 7.21094 18.5625 6.71875C18.5625 6.26172 18.9141 5.875 19.4062 5.875ZM4.11328 11.9219L2.42578 13.0469C2.03906 13.3281 1.51172 13.2227 1.26562 12.8359C0.984375 12.4492 1.08984 11.9219 1.47656 11.6406L3.16406 10.5156C3.55078 10.2695 4.07812 10.375 4.35938 10.7617C4.60547 11.1484 4.5 11.6758 4.11328 11.9219ZM19.3008 10.5508L20.9883 11.6758C21.375 11.9219 21.4805 12.4492 21.2344 12.8359C20.9531 13.2227 20.4258 13.3281 20.0391 13.082L18.3516 11.957C17.9648 11.6758 17.8594 11.1484 18.1406 10.7617C18.3867 10.375 18.9141 10.2695 19.3008 10.5508ZM15.75 6.4375C15.75 3.97656 13.7109 1.9375 11.25 1.9375C8.75391 1.9375 6.75 3.97656 6.75 6.4375C6.75 7.42188 7.03125 8.30078 7.52344 9.00391C7.66406 9.21484 7.80469 9.42578 7.98047 9.63672C8.4375 10.2695 8.96484 11.0078 9.38672 11.7461C9.73828 12.4141 9.94922 13.1172 10.0195 13.75H8.33203C8.22656 13.3281 8.12109 12.9414 7.91016 12.5547C7.55859 11.9219 7.13672 11.3242 6.67969 10.7266C6.50391 10.4805 6.32812 10.2344 6.15234 9.98828C5.44922 8.96875 5.0625 7.77344 5.0625 6.4375C5.0625 3.02734 7.80469 0.25 11.25 0.25C14.6602 0.25 17.4375 3.02734 17.4375 6.4375C17.4375 7.77344 17.0156 8.96875 16.3125 9.98828C16.1367 10.2344 15.9609 10.4805 15.7852 10.7266C15.3633 11.3242 14.9062 11.9219 14.5547 12.5547C14.3438 12.9414 14.2383 13.3281 14.168 13.75H12.4453C12.5508 13.1172 12.7266 12.4141 13.0781 11.7461C13.5 11.0078 14.0273 10.2695 14.4844 9.63672C14.6602 9.42578 14.8008 9.21484 14.9414 9.00391C15.4336 8.30078 15.75 7.42188 15.75 6.4375ZM9.5625 6.4375C9.5625 6.75391 9.28125 7 9 7C8.68359 7 8.4375 6.75391 8.4375 6.4375C8.4375 4.89062 9.66797 3.625 11.25 3.625C11.5312 3.625 11.8125 3.90625 11.8125 4.1875C11.8125 4.50391 11.5312 4.75 11.25 4.75C10.3008 4.75 9.5625 5.52344 9.5625 6.4375ZM14.0625 15.4375C14.0625 17.0195 12.7969 18.25 11.25 18.25C9.66797 18.25 8.4375 17.0195 8.4375 15.4375V14.875H14.0625V15.4375Z",
26893
+ fill: fill
26894
+ }));
26751
26895
  };
26752
26896
 
26753
- const TooltipContainer$2 = styled__default["default"].div`
26754
- --tooltip-text-color: black;
26755
- --tooltip-background-color: white;
26756
- --tooltip-margin: 40px;
26757
- --tooltip-arrow-size: 10px;
26758
- position: absolute;
26759
- z-index: 999999;
26760
- top: ${props => props.top};
26761
- left: ${props => props.left};
26762
- `;
26763
- const TooltipWrapper = styled__default["default"].div`
26764
- display: inline-block;
26765
- position: relative;
26766
- `;
26767
- const TooltipTip = styled__default["default"].div`
26768
- box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);
26769
- position: absolute;
26770
- border-radius: 4px;
26771
- left: 50%;
26772
- transform: translateX(-50%);
26773
- padding: 8px 12px;
26774
- color: var(--tooltip-text-color);
26775
- background: var(--tooltip-background-color);
26776
- font-size: 10px;
26777
- z-index: 999;
26778
- white-space: nowrap;
26779
-
26780
- /* CSS border triangles */
26781
- &.controls::before {
26782
- content: " ";
26783
- left: 50%;
26784
- border: solid transparent;
26785
- height: 0;
26786
- width: 0;
26787
- position: absolute;
26788
- pointer-events: none;
26789
- border-width: var(--tooltip-arrow-size);
26790
- margin-left: calc(var(--tooltip-arrow-size) * -1);
26791
- }
26792
-
26793
- /* Absolute positioning */
26794
- &.controls.top {
26795
- top: calc(var(--tooltip-margin) * -1);
26796
- }
26797
-
26798
- /* CSS border triangles */
26799
- &.controls.top::before {
26800
- top: 100%;
26801
- border-top-color: var(--tooltip-background-color);
26802
- }
26803
-
26804
- /* Absolute positioning */
26805
- &.controls.right {
26806
- left: calc(70% + var(--tooltip-margin));
26807
- top: 50%;
26808
- transform: translateX(0) translateY(-50%);
26809
- }
26810
-
26811
- /* CSS border triangles */
26812
- &.controls.right::before {
26813
- left: calc(var(--tooltip-arrow-size) * -1);
26814
- top: 50%;
26815
- transform: translateX(0) translateY(-50%);
26816
- border-right-color: var(--tooltip-background-color);
26817
- }
26897
+ const scrollableStyles$5 = `
26898
+ overflow-y: auto;
26818
26899
 
26819
- /* Absolute positioning */
26820
- &.controls.bottom {
26821
- bottom: calc(var(--tooltip-margin) * -1);
26822
- }
26823
- /* CSS border triangles */
26824
- &.controls.bottom::before {
26825
- bottom: 100%;
26826
- border-bottom-color: var(--tooltip-background-color);
26900
+ &::-webkit-scrollbar {
26901
+ width: 8px;
26827
26902
  }
26828
26903
 
26829
- /* Absolute positioning */
26830
- &.controls.left {
26831
- left: auto;
26832
- right: calc(70% + var(--tooltip-margin));
26833
- top: 50%;
26834
- transform: translateX(0) translateY(-50%);
26835
- }
26836
- /* CSS border triangles */
26837
- &.controls.left::before {
26838
- left: auto;
26839
- right: calc(var(--tooltip-arrow-size) * -2);
26840
- top: 50%;
26841
- transform: translateX(0) translateY(-50%);
26842
- border-left-color: var(--tooltip-background-color);
26904
+ &::-webkit-scrollbar-track {
26905
+ background: #E8E8E8;
26906
+ border-radius: 5px;
26843
26907
  }
26844
26908
 
26845
- > ul {
26846
- padding-left: 10px;
26847
- margin: 0;
26909
+ &::-webkit-scrollbar-thumb {
26910
+ background: #D0D0D0;
26911
+ border-radius: 5px;
26848
26912
  }
26849
26913
  `;
26850
-
26851
- const Tooltip = props => {
26852
- const {
26853
- className,
26854
- top,
26855
- left,
26856
- direction,
26857
- content
26858
- } = props;
26859
- return /*#__PURE__*/React__default["default"].createElement(TooltipContainer$2, {
26860
- className: className,
26861
- top: `${top}px`,
26862
- left: `${left}px`
26863
- }, /*#__PURE__*/React__default["default"].createElement(TooltipWrapper, null, /*#__PURE__*/React__default["default"].createElement(TooltipTip, {
26864
- className: `controls ${direction || 'top'}`
26865
- }, content)));
26866
- };
26867
- Tooltip.propTypes = {
26868
- className: PropTypes.string,
26869
- top: PropTypes.number,
26870
- left: PropTypes.number,
26871
- direction: PropTypes.string,
26872
- content: PropTypes.string
26873
- };
26874
- Tooltip.defaultProps = {
26875
- className: '',
26876
- top: 0,
26877
- left: 0,
26878
- direction: 'top',
26879
- content: ''
26880
- };
26881
-
26882
- const ControlsContainer$3 = styled__default["default"].div`
26914
+ const MainContainer$1 = styled__default["default"].div`
26915
+ display: flex;
26916
+ flex-direction: row;
26917
+ position: relative;
26883
26918
  font-family: "Poppins", sans-serif;
26884
- background-color: white;
26885
- color: ${props => props.textColor};
26919
+ font-style: normal;
26920
+ font-size: 1rem;
26921
+ border-radius: 12px;
26922
+ padding: 10px;
26886
26923
  width: ${props => props.width};
26887
26924
  height: ${props => props.height};
26888
- /* display: flex;
26889
- flex-direction: column;
26890
- overflow: hidden; */
26891
- overflow-y: ${props => props.scroller};
26892
-
26893
- &::-webkit-scrollbar {
26894
- width: 8px;
26895
- }
26896
-
26897
- &::-webkit-scrollbar-track {
26898
- background: #E8E8E8;
26899
- border-radius: 5px;
26925
+ overflow: auto;
26926
+ ${scrollableStyles$5}
26927
+ `;
26928
+ const RowTitle = styled__default["default"].h4`
26929
+ display: flex;
26930
+ justify-content: space-between;
26931
+ font-weight: 500;
26932
+ font-size: 18px;
26933
+ margin: 5px 5px 5px 0;
26934
+ @media (max-width: 1536px) {
26935
+ font-size: 15px;
26900
26936
  }
26901
-
26902
- &::-webkit-scrollbar-thumb {
26903
- background: #D0D0D0;
26904
- border-radius: 5px;
26937
+ @media (max-width: 1366px) {
26938
+ font-size: 12px;
26905
26939
  }
26906
26940
  `;
26907
- styled__default["default"].div`
26908
- overflow-y: auto;
26941
+ const AllRowsContainer = styled__default["default"].div`
26942
+ display: flex;
26943
+ flex-direction: column;
26944
+ justify-content: space-between;
26945
+ align-items: flex-start;
26946
+ width: 100%;
26909
26947
  height: 100%;
26910
-
26911
- &::-webkit-scrollbar {
26912
- width: 8px;
26913
- }
26914
-
26915
- &::-webkit-scrollbar-track {
26916
- background: #E8E8E8;
26917
- border-radius: 5px;
26948
+ `;
26949
+ const OneRowContainer = styled__default["default"].div`
26950
+ display: flex;
26951
+ flex-direction: column;
26952
+ width: 100%;
26953
+ height: 100%;
26954
+ `;
26955
+ const ColumnLineSeporatorContainer = styled__default["default"].div`
26956
+ display: flex;
26957
+ flex-direction: column;
26958
+ background-color: #b1b1b1;
26959
+ align-items: center;
26960
+ height: 1px;
26961
+ width: 100%;
26962
+ &.ColumnLineSeporatorContainer_vertical {
26963
+ margin: 0 30px;
26964
+ height: 100%;
26965
+ width: 1px;
26918
26966
  }
26919
-
26920
- &::-webkit-scrollbar-thumb {
26921
- background: #D0D0D0;
26922
- border-radius: 5px;
26967
+ &.ColumnLineSeporatorContainer_horizontal {
26968
+ margin: 30px 0;
26969
+ min-height: 1px;
26970
+ height: 1px;
26971
+ width: 100%;
26923
26972
  }
26924
26973
  `;
26925
- const CardHeader = styled__default["default"].div`
26926
- padding: 16px;
26927
- position: sticky;
26928
- top: 0;
26929
- z-index: 10;
26930
- background-color: white;
26974
+ const ColumnLineSeporator = styled__default["default"].div`
26975
+ min-width: 0.5px;
26976
+ width: 0.5px;
26931
26977
  `;
26932
- const TotalValue = styled__default["default"].div`
26933
- font-weight: 500;
26934
- font-size: 40px;
26978
+ const FieldsContainer = styled__default["default"].div`
26935
26979
  display: flex;
26936
- align-items: baseline;
26937
- line-height: 1;
26980
+ flex-direction: row;
26981
+ justify-content: space-between;
26982
+ white-space: nowrap;
26983
+ height: 100%;
26984
+ padding: 30px 0px;
26985
+ `;
26986
+ const OneFieldsContainer = styled__default["default"].div`
26987
+ display: flex;
26988
+ padding: 4px;
26989
+ gap: 10px;
26990
+ width: 100%;
26991
+ justify-content: flex-start;
26992
+ // padding: ${props => props.padding}; //0 0 0 40px;
26993
+ `;
26994
+ const FieldTitle = styled__default["default"].h4`
26995
+ font-size: 18px;
26996
+ font-weight: 400;
26997
+ margin: 0;
26938
26998
  @media (max-width: 1536px) {
26939
- font-size: 24px;
26999
+ font-size: 14px;
26940
27000
  }
26941
27001
  @media (max-width: 1366px) {
26942
- font-size: 20px;
27002
+ font-size: 12px;
26943
27003
  }
26944
27004
  `;
26945
- const Title$8 = styled__default["default"].h4`
26946
- font-size: 18px;
27005
+ const FormattedValue$1 = styled__default["default"].div`
26947
27006
  font-weight: 400;
26948
- line-height: 1;
26949
- margin: 0 0 8px;
27007
+ font-size: 40px;
27008
+ display: flex;
27009
+ align-items: baseline;
27010
+ min-height: 40px;
27011
+ gap: 2px;
26950
27012
  @media (max-width: 1536px) {
26951
- font-size: 14px;
27013
+ font-size: 24px;
26952
27014
  }
26953
27015
  @media (max-width: 1366px) {
26954
- font-size: 12px;
27016
+ font-size: 20px;
26955
27017
  }
26956
27018
  `;
26957
- const CurrencySign = styled__default["default"].span`
26958
- font-weight: 500;
27019
+ const TextBeforeAndAfterValue$1 = styled__default["default"].span`
27020
+ font-weight: 400;
26959
27021
  font-size: 16px;
26960
27022
  @media (max-width: 1536px) {
26961
27023
  font-size: 14px;
@@ -26964,248 +27026,184 @@ const CurrencySign = styled__default["default"].span`
26964
27026
  font-size: 11px;
26965
27027
  }
26966
27028
  `;
26967
-
26968
- /* eslint-disable no-unused-vars */
26969
- const TotalHorizontalCharts = props => {
26970
- const {
26971
- title,
26972
- value,
26973
- dotCut,
26974
- currencySign,
26975
- currencyType,
26976
- chartsData,
26977
- showScrollerBarsCount,
26978
- labelFontSize,
26979
- labelLimitedLetters,
26980
- width,
26981
- height,
26982
- rightGap,
26983
- textColor,
26984
- noDataText,
26985
- showPercentAsideValue,
26986
- isDollar,
26987
- isPercentage,
26988
- showDollarSign,
26989
- className,
26990
- hideTotalValue,
26991
- hideTitle
26992
- } = props;
26993
- const barBackgrounds = chartsData.map(bg => bg.color);
26994
- const topHeader = React$1.useRef();
26995
- const wrapper = React$1.useRef();
26996
- const BAR_HEIGHT = 40; // Height of each bar including padding
26997
- const CHART_PADDING = 40; // Total padding for chart (top + bottom)
26998
-
26999
- // Inside the TotalHorizontalCharts component
27000
- const calculateChartHeight = () => {
27001
- if (!chartsData?.length) return 0;
27002
- if (chartsData.length > showScrollerBarsCount) {
27003
- return chartsData.length * BAR_HEIGHT + CHART_PADDING;
27029
+ const FieldTitleAndValueSubContainer = styled__default["default"].div`
27030
+ display: flex;
27031
+ justify-content: space-around;
27032
+ flex-direction: column;
27033
+ flex-wrap: wrap;
27034
+ width: 100%;
27035
+ `;
27036
+ const InfoTextContainer = styled__default["default"].div`
27037
+ display: flex;
27038
+ flex-direction: row;
27039
+ width: 100%;
27040
+ height: 100%;
27041
+ overflow:auto;
27042
+ `;
27043
+ const IconContainer = styled__default["default"].div`
27044
+ display: flex;
27045
+ padding: 5px 10px 0 0;
27046
+ cursor: pointer;
27047
+ `;
27048
+ const InfoTextLabel = styled__default["default"].div`
27049
+ color: black;
27050
+ font-size: 18px;
27051
+ line-height: 24px;
27052
+ font-weight: 400;
27053
+ width: 100%;
27054
+ overflow: auto;
27055
+ ${scrollableStyles$5}
27056
+ strong {
27057
+ font-weight: 500;
27058
+ color: #212121;
27059
+ @media (max-width: 1536px) {
27060
+ font-size: 14px;
27004
27061
  }
27005
-
27006
- // Calculate height to show only specified number of bars
27007
- const visibleBarsHeight = showScrollerBarsCount * BAR_HEIGHT;
27008
-
27009
- // Use the smaller value between:
27010
- // 1. Height needed for all bars
27011
- // 2. Height needed for specified number of bars
27012
- return Math.min(chartsData.length * BAR_HEIGHT + CHART_PADDING, visibleBarsHeight + CHART_PADDING);
27013
- };
27014
- const [showLegendTooltip, setShowLegendTooltip] = React$1.useState(false);
27015
- const [tooltipText, setTooltipText] = React$1.useState({
27016
- content: '',
27017
- clientX: 0,
27018
- clientY: 0
27019
- });
27020
- const CustomizedLabel = props => showPercentAsideValue ? /*#__PURE__*/React__default["default"].createElement("text", {
27021
- x: props.x + (props.width <= 0 ? -12 : props.width) + 56,
27022
- y: props.y + 4,
27023
- dy: props.height / 2,
27024
- dx: -8,
27025
- fill: props.stroke,
27026
- fontSize: 12,
27027
- fontWeight: 500,
27028
- textAnchor: "middle"
27029
- }, ''.concat(getFormattedValue(props.value), getFormattedUnits(props.value)), /*#__PURE__*/React__default["default"].createElement("tspan", {
27030
- fontWeight: 400
27031
- }, ` (${(props.value / value * 100).toFixed(0)}%)`)) : /*#__PURE__*/React__default["default"].createElement("text", {
27032
- x: props.x + (props.width <= 0 ? -12 : props.width) + 40,
27033
- y: props.y + 4,
27034
- dy: props.height / 2,
27035
- dx: -8,
27036
- fill: props.stroke,
27037
- fontSize: 12,
27038
- fontWeight: 400,
27039
- textAnchor: "middle"
27040
- }, !isDollar ? ''.concat(getFormattedValue(props.value), isPercentage ? '%' : getFormattedUnits(props.value)) : ''.concat(showDollarSign ? '$' : '', getFormattedValue(props.value), getFormattedUnits(props.value)));
27041
- const CustomizedTickBarChart = props => {
27042
- const {
27043
- x,
27044
- y,
27045
- height,
27046
- payload,
27047
- fill,
27048
- orientation,
27049
- stroke
27050
- } = props;
27051
- const handleMouseEnter = content => {
27052
- setTooltipText(prevState => ({
27053
- ...prevState,
27054
- content: content !== prevState.content ? content : prevState.content,
27055
- clientX: x / 1.2,
27056
- clientY: y - 20
27057
- }));
27058
- setShowLegendTooltip(true);
27059
- };
27060
- const handleMouseLeave = () => {
27061
- if (showLegendTooltip === false) return;
27062
- setTimeout(() => {
27063
- setShowLegendTooltip(false);
27064
- }, 1200);
27065
- };
27066
- if (chartsData && chartsData.length > 0 && payload) {
27067
- const chartsDataLabel = chartsData.filter(item => item.name === payload.value);
27068
- if (chartsDataLabel && chartsDataLabel.length > 0) {
27069
- return /*#__PURE__*/React__default["default"].createElement("g", {
27070
- onMouseEnter: () => handleMouseEnter(payload.value),
27071
- onMouseLeave: handleMouseLeave
27072
- }, /*#__PURE__*/React__default["default"].createElement("text", {
27073
- style: {
27074
- whiteSpace: 'nowrap'
27075
- },
27076
- height: height,
27077
- x: 20,
27078
- y: y,
27079
- fontSize: labelFontSize,
27080
- orientation: orientation,
27081
- stroke: stroke,
27082
- textAnchor: "start"
27083
- // verticalAnchor="middle"
27084
- ,
27085
- fill: fill
27086
- }, payload.value.length > labelLimitedLetters - 1 ? `${payload.value.slice(0, labelLimitedLetters)}...` : payload.value));
27087
- }
27088
- return null;
27062
+ @media (max-width: 1366px) {
27063
+ font-size: 12px;
27089
27064
  }
27090
- return null;
27091
27065
  };
27092
- return /*#__PURE__*/React__default["default"].createElement(ControlsContainer$3, {
27093
- ref: wrapper,
27094
- height: height,
27095
- width: width,
27096
- textColor: textColor,
27097
- scroller: chartsData.length > showScrollerBarsCount ? 'auto' : 'hidden',
27098
- className: className
27099
- }, chartsData?.length > 0 ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, !hideTitle || !hideTotalValue ? /*#__PURE__*/React__default["default"].createElement(CardHeader, {
27100
- ref: topHeader,
27101
- className: "CardHeader"
27102
- }, !hideTitle ? /*#__PURE__*/React__default["default"].createElement(Title$8, null, title) : '', !hideTotalValue ? /*#__PURE__*/React__default["default"].createElement(TotalValue, {
27103
- className: "TotalValue"
27104
- }, currencySign && /*#__PURE__*/React__default["default"].createElement(CurrencySign, {
27105
- className: "CurrencySign"
27106
- }, getCurrencySign(currencyType, value)), dotCut ? getFormattedValue(value && Math.abs(value) > 0 && value % 1 !== 0 ? value?.toFixed(2) : value) : getNumberWithCommas(value), dotCut ? getFormattedUnits(value) : '') : '') : '', /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
27107
- width: "100%",
27108
- height: calculateChartHeight()
27109
- }, /*#__PURE__*/React__default["default"].createElement(recharts.BarChart, {
27110
- layout: "vertical",
27111
- data: chartsData,
27112
- margin: {
27113
- top: 10,
27114
- right: 20,
27115
- bottom: 20,
27116
- left: 10
27066
+ p1 {
27067
+ font-weight: 400;
27068
+ color: #726F6F;
27069
+ @media (max-width: 1536px) {
27070
+ font-size: 14px;
27117
27071
  }
27118
- }, /*#__PURE__*/React__default["default"].createElement(recharts.XAxis, {
27119
- type: "number",
27120
- domain: [0, dataMax => dataMax * rightGap]
27121
- // allowDataOverflow={false}
27122
- ,
27123
- hide: true
27124
- }), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
27125
- dataKey: "name",
27126
- type: "category",
27127
- width: labelLimitedLetters * 10,
27128
- tickLine: false,
27129
- axisLine: false,
27130
- interval: 0,
27131
- allowDataOverflow: true,
27132
- tick: CustomizedTickBarChart
27133
- }), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
27134
- dataKey: "value",
27135
- barSize: 20,
27136
- fill: "#8884d8",
27137
- barCategoryGap: 10,
27138
- barGap: 5
27139
- }, /*#__PURE__*/React__default["default"].createElement(recharts.LabelList, {
27140
- dataKey: "value",
27141
- content: CustomizedLabel
27142
- }), chartsData.map((entry, index) =>
27143
- /*#__PURE__*/
27144
- // eslint-disable-next-line react/no-array-index-key
27145
- React__default["default"].createElement(recharts.Cell, {
27146
- key: `cell-${index}`,
27147
- fill: barBackgrounds[index % 20]
27148
- }))), showLegendTooltip && /*#__PURE__*/React__default["default"].createElement(Tooltip, {
27149
- direction: "top",
27150
- content: tooltipText.content,
27151
- top: tooltipText.clientY,
27152
- left: tooltipText.clientX,
27153
- style: {
27154
- pointerEvents: 'none'
27072
+ @media (max-width: 1366px) {
27073
+ font-size: 12px;
27155
27074
  }
27156
- })))) : /*#__PURE__*/React__default["default"].createElement(NoDataFoundMessage, {
27157
- noDataText: noDataText
27158
- }));
27075
+ };
27076
+ `;
27077
+ const OutBanner$1 = styled__default["default"].div`
27078
+ display: flex;
27079
+ gap: 8px;
27080
+ align-items: center;
27081
+ font-size: 14px;
27082
+ font-weight: 400;
27083
+ color: ${props => props.textColor};
27084
+ cursor: pointer;
27085
+ @media (max-width: 1536px) {
27086
+ font-size: 13px;
27087
+ }
27088
+ @media (max-width: 1366px) {
27089
+ font-size: 12px;
27090
+ }
27091
+ > svg {
27092
+ width: 14px;
27093
+ height: 14px;
27094
+ @media (max-width: 1536px) {
27095
+ width: 13px;
27096
+ height: 13px;
27097
+ }
27098
+ @media (max-width: 1366px) {
27099
+ width: 12px;
27100
+ height: 12px;
27101
+ }
27102
+ }
27103
+ `;
27104
+
27105
+ const MarketShareDescription = props => {
27106
+ const {
27107
+ width,
27108
+ height,
27109
+ marketShareData,
27110
+ iconColor,
27111
+ onBannerClick,
27112
+ dotCut
27113
+ } = props;
27114
+ const displayField = dataItem => {
27115
+ const content = /*#__PURE__*/React__default["default"].createElement(FieldTitleAndValueSubContainer, {
27116
+ className: "FieldTitleAndValueSubContainer"
27117
+ }, /*#__PURE__*/React__default["default"].createElement(FieldTitle, {
27118
+ className: "FieldTitle"
27119
+ }, dataItem.label), /*#__PURE__*/React__default["default"].createElement(FormattedValue$1, {
27120
+ className: "FormattedValue"
27121
+ }, /*#__PURE__*/React__default["default"].createElement(TextBeforeAndAfterValue$1, {
27122
+ className: "TextBeforeAndAfterValue"
27123
+ }, dataItem.textBefore), dotCut ? getFormattedValue(dataItem.value && Math.abs(dataItem.value) > 0 && dataItem.value % 1 !== 0 ? dataItem.value?.toFixed(2) : dataItem.value) : getNumberWithCommas(dataItem.value), dotCut ? getFormattedUnits(dataItem.value) : '', /*#__PURE__*/React__default["default"].createElement(TextBeforeAndAfterValue$1, null, dataItem.textAfter)));
27124
+ return content;
27125
+ };
27126
+ const dispalyRowFields = data => {
27127
+ if (!data && !data.length > 0) return '';
27128
+ const content = /*#__PURE__*/React__default["default"].createElement(FieldsContainer, {
27129
+ className: "FieldsContainer",
27130
+ height: "160px"
27131
+ }, data?.map((item, index) => /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(OneFieldsContainer, {
27132
+ className: "OneFieldsContainer",
27133
+ padding: index === 0 ? '0px' : '0 0 0 40px'
27134
+ }, displayField(item)), data?.length !== index + 1 ? /*#__PURE__*/React__default["default"].createElement(ColumnLineSeporatorContainer, {
27135
+ className: "ColumnLineSeporatorContainer_vertical"
27136
+ }, /*#__PURE__*/React__default["default"].createElement(ColumnLineSeporator, {
27137
+ className: "ColumnLineSeporator"
27138
+ })) : '')));
27139
+ return content;
27140
+ };
27141
+ const displayRows = () => {
27142
+ if (!marketShareData || marketShareData?.length === 0) return '';
27143
+ const content = /*#__PURE__*/React__default["default"].createElement(AllRowsContainer, {
27144
+ className: "AllRowsContainer"
27145
+ }, marketShareData.map((item, index) => /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(OneRowContainer, {
27146
+ className: "OneRowContainer"
27147
+ }, /*#__PURE__*/React__default["default"].createElement(RowTitle, {
27148
+ className: "RowTitle"
27149
+ }, /*#__PURE__*/React__default["default"].createElement(InfoTextLabel, {
27150
+ className: "InfoTextLabel",
27151
+ dangerouslySetInnerHTML: {
27152
+ __html: item.rowTitle
27153
+ }
27154
+ }), item.showBanner && /*#__PURE__*/React__default["default"].createElement(OutBanner$1, {
27155
+ className: "OutBanner",
27156
+ onClick: () => onBannerClick({
27157
+ eventName: 'onBannerClick',
27158
+ rowName: item.name
27159
+ })
27160
+ }, /*#__PURE__*/React__default["default"].createElement(ExportIcon, {
27161
+ color: "#212121"
27162
+ }), "View By Banner")), dispalyRowFields(item.fieldsArray), /*#__PURE__*/React__default["default"].createElement(InfoTextContainer, {
27163
+ className: "InfoTextContainer"
27164
+ }, item.rowFooter && item.rowFooter?.length > 0 ? /*#__PURE__*/React__default["default"].createElement(IconContainer, {
27165
+ className: "IconContainer"
27166
+ }, /*#__PURE__*/React__default["default"].createElement(LampIcon, {
27167
+ width: "23px",
27168
+ height: "19px",
27169
+ fill: iconColor
27170
+ })) : '', /*#__PURE__*/React__default["default"].createElement(InfoTextLabel, {
27171
+ className: "InfoTextLabel",
27172
+ dangerouslySetInnerHTML: {
27173
+ __html: item.rowFooter
27174
+ }
27175
+ }))), marketShareData?.length !== index + 1 ? /*#__PURE__*/React__default["default"].createElement(ColumnLineSeporatorContainer, {
27176
+ className: "ColumnLineSeporatorContainer_horizontal"
27177
+ }, /*#__PURE__*/React__default["default"].createElement(ColumnLineSeporator, {
27178
+ className: "ColumnLineSeporator"
27179
+ })) : '')));
27180
+ return content;
27181
+ };
27182
+ return /*#__PURE__*/React__default["default"].createElement(MainContainer$1, {
27183
+ className: "MainContainer",
27184
+ height: height,
27185
+ width: width
27186
+ }, displayRows());
27159
27187
  };
27160
- TotalHorizontalCharts.propTypes = {
27161
- className: PropTypes.string,
27162
- title: PropTypes.string,
27163
- value: PropTypes.number,
27164
- dotCut: PropTypes.bool,
27165
- currencySign: PropTypes.bool,
27166
- currencyType: PropTypes.string,
27167
- chartsData: PropTypes.arrayOf(PropTypes.shape({
27168
- name: PropTypes.string,
27169
- value: PropTypes.number,
27170
- color: PropTypes.string
27188
+ MarketShareDescription.propTypes = {
27189
+ marketShareData: PropTypes.arrayOf(PropTypes.shape({
27190
+ label: PropTypes.string,
27191
+ checked: PropTypes.bool,
27192
+ disabled: PropTypes.bool
27171
27193
  })),
27172
- showScrollerBarsCount: PropTypes.number,
27173
- showPercentAsideValue: PropTypes.bool,
27174
- labelFontSize: PropTypes.number,
27175
- labelLimitedLetters: PropTypes.number,
27176
- width: PropTypes.string,
27177
27194
  height: PropTypes.string,
27178
- rightGap: PropTypes.number,
27179
- textColor: PropTypes.string,
27180
- noDataText: PropTypes.string,
27181
- isDollar: PropTypes.bool,
27182
- isPercentage: PropTypes.bool,
27183
- showDollarSign: PropTypes.bool,
27184
- hideTotalValue: PropTypes.bool,
27185
- hideTitle: PropTypes.bool
27195
+ width: PropTypes.string,
27196
+ iconColor: PropTypes.string,
27197
+ onBannerClick: PropTypes.func,
27198
+ dotCut: PropTypes.bool
27186
27199
  };
27187
- TotalHorizontalCharts.defaultProps = {
27188
- className: '',
27189
- title: 'SALES',
27190
- value: 0,
27191
- dotCut: false,
27192
- currencySign: false,
27193
- currencyType: 'USD',
27194
- chartsData: [],
27195
- showScrollerBarsCount: 7,
27196
- showPercentAsideValue: false,
27197
- labelFontSize: 10,
27198
- labelLimitedLetters: 12,
27200
+ MarketShareDescription.defaultProps = {
27201
+ marketShareData: [],
27199
27202
  width: '100%',
27200
27203
  height: '100%',
27201
- rightGap: 1,
27202
- textColor: '#212121',
27203
- noDataText: 'No Data',
27204
- isDollar: true,
27205
- isPercentage: false,
27206
- showDollarSign: true,
27207
- hideTotalValue: false,
27208
- hideTitle: false
27204
+ iconColor: '#1B30AA',
27205
+ onBannerClick: () => {},
27206
+ dotCut: false
27209
27207
  };
27210
27208
 
27211
27209
  const ControlsContainer$2 = styled__default["default"].div`
@@ -28880,10 +28878,11 @@ const LegendContainer = styled__default["default"].div`
28880
28878
  left: 0;
28881
28879
  text-align: center;
28882
28880
  width: ${props => `${props.width}px`};
28883
- bottom: 30px;
28881
+ bottom: 20px;
28884
28882
  `;
28885
28883
  const Controls$1 = styled__default["default"].div`
28886
- height: calc(100% - 30px);
28884
+ /* height: calc(100% - 30px); */
28885
+ height: 100%;
28887
28886
  display: flex;
28888
28887
  flex-direction: column;
28889
28888
  background-color: white;
@@ -28899,14 +28898,14 @@ const Title$2 = styled__default["default"].h5`
28899
28898
  const ChartsWrapper = styled__default["default"].div`
28900
28899
  flex-grow: 1;
28901
28900
  width: ${props => props.width};
28902
- margin-top: auto;
28901
+ /* margin-top: auto; */
28903
28902
  background-color: white;
28904
28903
  `;
28905
28904
  const LineChartWrapper = styled__default["default"].div`
28906
- height: 25%;
28905
+ height: 30%;
28907
28906
  `;
28908
28907
  const BarChartWrapper = styled__default["default"].div`
28909
- height: 75%;
28908
+ height: 70%;
28910
28909
  `;
28911
28910
  const TooltipDiv = styled__default["default"].div`
28912
28911
  border-radius: 5px;
@@ -29122,7 +29121,7 @@ const DoubleBarSingleLine = props => {
29122
29121
  syncId: "anyId",
29123
29122
  // This synchronizes the charts
29124
29123
  margin: {
29125
- top: 20,
29124
+ top: 0,
29126
29125
  right: 35,
29127
29126
  left: 35,
29128
29127
  bottom: 5
@@ -29727,8 +29726,8 @@ const scrollableStyles$1 = `
29727
29726
  }
29728
29727
  `;
29729
29728
  const CategorySalesPanelContainer = styled__default["default"].div`
29730
- width: "100%",
29731
- margin: "10px auto"
29729
+ width: "100%";
29730
+ margin: "10px auto";
29732
29731
  `;
29733
29732
  const AccordionContainer = styled__default["default"].div`
29734
29733
  border-radius: 12px;
@@ -29737,7 +29736,7 @@ const AccordionContainer = styled__default["default"].div`
29737
29736
  `;
29738
29737
  const CategorySalesContainer = styled__default["default"].button`
29739
29738
  display: flex;
29740
- justify-content: space-between;
29739
+ /* justify-content: space-between; */
29741
29740
  align-items: center;
29742
29741
  width: 100%;
29743
29742
  font-family: "Poppins", sans-serif;
@@ -29759,7 +29758,7 @@ const ItemSalesContainer = styled__default["default"].div`
29759
29758
  padding-top: 10px;
29760
29759
  background: #F7F8FA;
29761
29760
  border-top: 1px solid #ddd;
29762
- gap:12px;
29761
+ gap: 12px;
29763
29762
  transition: max-height 0.3s ease-in-out;
29764
29763
  max-height: 250px;
29765
29764
  ${scrollableStyles$1}
@@ -29769,9 +29768,21 @@ const FieldContainer = styled__default["default"].div`
29769
29768
  display: flex;
29770
29769
  align-items: center;
29771
29770
  padding: 5px 0px;
29772
- width: ${props => props.width};
29773
29771
  font-size: ${props => props.fontSize || '14px'};
29774
29772
  font-weight: ${props => props.fontwidth || 500};
29773
+ &:first-child {
29774
+ width: 40px;
29775
+ }
29776
+ &:nth-child(2) {
29777
+ width: 320px;
29778
+ }
29779
+ &:nth-child(3) {
29780
+ flex-grow: 1;
29781
+ }
29782
+ &:nth-child(4) {
29783
+ width: 21%;
29784
+ margin-left: auto;
29785
+ }
29775
29786
  `;
29776
29787
 
29777
29788
  const ButtonContainer = styled__default["default"].button`
@@ -29786,7 +29797,7 @@ const ButtonContainer = styled__default["default"].button`
29786
29797
  opacity: ${props => props.disabled ? "0.4" : "1"};
29787
29798
  cursor: ${props => props.disabled ? "not-allowed" : "pointer"};
29788
29799
  transition: all 0.3s ease-in-out;
29789
- box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
29800
+ box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.2);
29790
29801
 
29791
29802
  &:hover {
29792
29803
  border: ${props => props.disabled ? "1px solid #ddd" : `1px solid ${props.hoverbordercolor}`};
@@ -29868,7 +29879,6 @@ const BannerButton = ({
29868
29879
 
29869
29880
  const ItemSalesPanelContainer = styled__default["default"].div`
29870
29881
  display: flex;
29871
- flex-direction: row;
29872
29882
  background: #F7F8FA;
29873
29883
  color: #212121;
29874
29884
  transition: max-height 0.3s ease-in-out;
@@ -29877,7 +29887,7 @@ const ItemTitle = styled__default["default"].h4`
29877
29887
  font-size: 14px;
29878
29888
  font-weight: 400;
29879
29889
  margin: 14px 0px;
29880
- width: 30%
29890
+ min-width: 360px;
29881
29891
  `;
29882
29892
  const BannerIconWrapper = styled__default["default"].div`
29883
29893
  display: flex;
@@ -29902,11 +29912,15 @@ const ItemSalesPanel = props => {
29902
29912
  banners,
29903
29913
  onBannerClick
29904
29914
  } = props;
29915
+ const truncateString = maxLength => {
29916
+ return itemName[0].length > maxLength ? itemName[0].slice(0, maxLength) + '...' : itemName[0];
29917
+ };
29905
29918
  return /*#__PURE__*/React__default["default"].createElement(ItemSalesPanelContainer, {
29906
29919
  "data-testid": "item-sales-panel-container"
29907
29920
  }, /*#__PURE__*/React__default["default"].createElement(ItemTitle, {
29908
- "data-testid": "item-title"
29909
- }, itemName), (banners || []).map(banner => /*#__PURE__*/React__default["default"].createElement(BannerIconWrapper, {
29921
+ "data-testid": "item-title",
29922
+ title: itemName[0]
29923
+ }, truncateString(35)), (banners || []).map(banner => /*#__PURE__*/React__default["default"].createElement(BannerIconWrapper, {
29910
29924
  "data-testid": "banner-icon-wrapper",
29911
29925
  key: banner
29912
29926
  }, /*#__PURE__*/React__default["default"].createElement(BannerButton, {
@@ -29979,16 +29993,13 @@ const CategorySalesPanel = ({
29979
29993
  "data-testid": "category-sales-container",
29980
29994
  onClick: () => setIsOpen(!isOpen)
29981
29995
  }, /*#__PURE__*/React__default["default"].createElement(FieldContainer, {
29982
- "data-testid": "field-container-dropdown-icon",
29983
- width: "2.4%"
29996
+ "data-testid": "field-container-dropdown-icon"
29984
29997
  }, isOpen ? /*#__PURE__*/React__default["default"].createElement(MenuItemUpIcon, null) : /*#__PURE__*/React__default["default"].createElement(MenuItemRightIcon, null)), /*#__PURE__*/React__default["default"].createElement(FieldContainer, {
29985
29998
  "data-testid": "field-container-category",
29986
- width: "25%",
29987
29999
  fontwidth: 500,
29988
30000
  fontSize: "14px"
29989
30001
  }, categorySales.category), /*#__PURE__*/React__default["default"].createElement(FieldContainer, {
29990
30002
  "data-testid": "field-container-items-counter",
29991
- width: "70%",
29992
30003
  fontwidth: 400,
29993
30004
  fontSize: "20px"
29994
30005
  }, /*#__PURE__*/React__default["default"].createElement(ItemsCounterGraphPanel, {
@@ -29997,7 +30008,6 @@ const CategorySalesPanel = ({
29997
30008
  graphCounterMax: graphCounterMax
29998
30009
  })), /*#__PURE__*/React__default["default"].createElement(FieldContainer, {
29999
30010
  "data-testid": "field-container-value-of-items",
30000
- width: "10%",
30001
30011
  fontwidth: 400,
30002
30012
  fontSize: "14px"
30003
30013
  }, `${displayFormattedValue(categorySales.valueOfItems)}`)), isOpen && /*#__PURE__*/React__default["default"].createElement(AccordionContent, {
@@ -30073,8 +30083,16 @@ const CategorySalesMainContainer = styled__default["default"].div`
30073
30083
  `;
30074
30084
  const CategoryHeadersContainer = styled__default["default"].div`
30075
30085
  display: flex;
30076
- flex-direction: row;
30077
- padding: 10px ;
30086
+ padding: 10px;
30087
+ > div {
30088
+ &:first-of-type {
30089
+ padding-left: 40px;
30090
+ box-sizing: border-box;
30091
+ }
30092
+ &:last-of-type {
30093
+ margin-left: auto;
30094
+ }
30095
+ }
30078
30096
  `;
30079
30097
  const CategoryHeader = styled__default["default"].div`
30080
30098
  display: flex;
@@ -30092,7 +30110,6 @@ const CategorySalesDataContainer = styled__default["default"].div`
30092
30110
  ${scrollableStyles}
30093
30111
  `;
30094
30112
 
30095
- /* BreakdownPanel */
30096
30113
  const BreakdownPanel = props => {
30097
30114
  const {
30098
30115
  title = '',
@@ -30107,10 +30124,9 @@ const BreakdownPanel = props => {
30107
30124
  }
30108
30125
  } = props;
30109
30126
  const getCategoryHeaderWidth = index => {
30110
- if (index === 0) return "2.5%";
30111
- if (index === 1) return "23.2%";
30112
- if (index === 2) return "64.8%";
30113
- if (index === 3) return "9.5%";
30127
+ if (index === 0) return "360px";
30128
+ if (index === 1) return "auto";
30129
+ if (index === 2) return "21%";
30114
30130
  };
30115
30131
  return /*#__PURE__*/React__default["default"].createElement(BreakdownPanelContainer, {
30116
30132
  "data-testid": "breakdown-panel-container",
@@ -30130,12 +30146,12 @@ const BreakdownPanel = props => {
30130
30146
  "data-testid": "category-sales-main-container"
30131
30147
  }, /*#__PURE__*/React__default["default"].createElement(CategoryHeadersContainer, {
30132
30148
  "data-testid": "category-headers-container"
30133
- }, categoryHeaders && ["", ...categoryHeaders].map((headerTitle, index) => /*#__PURE__*/React__default["default"].createElement(CategoryHeader, {
30149
+ }, categoryHeaders?.map((headerTitle, index) => /*#__PURE__*/React__default["default"].createElement(CategoryHeader, {
30134
30150
  "data-testid": "category-header",
30135
- width: getCategoryHeaderWidth(index),
30136
- key: headerTitle
30151
+ key: headerTitle,
30152
+ width: getCategoryHeaderWidth(index)
30137
30153
  }, headerTitle))), /*#__PURE__*/React__default["default"].createElement(CategorySalesDataContainer, {
30138
- "data-testid": "category-sales-data-container"
30154
+ "data-testid": "caitem-sales-panel-containerer"
30139
30155
  }, data.map((categorySales, index) => /*#__PURE__*/React__default["default"].createElement(CategorySalesPanel, {
30140
30156
  "data-testid": "category-sales-panel",
30141
30157
  key: categorySales.category || index,