sag_components 2.0.0-beta51 → 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.esm.js CHANGED
@@ -3470,50 +3470,240 @@ const LinnerDataBox = props => {
3470
3470
  }))));
3471
3471
  };
3472
3472
 
3473
- const LampIcon = _ref => {
3474
- let {
3475
- // eslint-disable-next-line react/prop-types
3476
- width = '23',
3477
- // eslint-disable-next-line react/prop-types
3478
- height = '19',
3479
- // eslint-disable-next-line react/prop-types
3480
- fill = '#229E38'
3481
- } = _ref;
3482
- return /*#__PURE__*/React$1.createElement("svg", {
3483
- width: width,
3473
+ const SagIconButtonWrapper = styled.button`
3474
+ height: ${props => props.height};
3475
+ font-size: 14px;
3476
+ font-weight: 400;
3477
+ display: flex;
3478
+ gap: 8px;
3479
+ align-items: center;
3480
+ justify-content: center;
3481
+ padding: 8px 18px;
3482
+ white-space: nowrap;
3483
+ color: ${props => props.color};
3484
+ border-radius: 8px;
3485
+ border: 1px solid ${props => props.color};
3486
+ background: ${props => props.backgroundColor ? props.backgroundColor : 'transparent'};
3487
+ transition: box-shadow 0.3s ease;
3488
+ &:hover, &:focus {
3489
+ cursor: pointer;
3490
+ box-shadow: 5px 5px 10px 0px rgba(0, 0, 0, 0.1);
3491
+ }
3492
+ `;
3493
+ const SpanText$1 = styled.span`
3494
+ `;
3495
+
3496
+ const SagIconButton = props => {
3497
+ const {
3498
+ iconName,
3499
+ color,
3500
+ backgroundColor,
3501
+ activeColor,
3502
+ height,
3503
+ buttonText,
3504
+ iconWidth,
3505
+ iconHeight,
3506
+ disabled,
3507
+ openState,
3508
+ onButtonClick,
3509
+ className
3510
+ } = props;
3511
+ const [activeState, setActiveState] = useState(openState);
3512
+ const onClickHandler = event => {
3513
+ onButtonClick(event);
3514
+ setActiveState(prevState => !prevState);
3515
+ };
3516
+ const getIcon = icon => {
3517
+ switch (icon.toLowerCase()) {
3518
+ case 'filter':
3519
+ return /*#__PURE__*/React$1.createElement(FilterIcon, {
3520
+ height: iconHeight,
3521
+ width: iconWidth,
3522
+ color: activeState ? activeColor : color
3523
+ });
3524
+ case 'options':
3525
+ return /*#__PURE__*/React$1.createElement(OptionsIcon, {
3526
+ height: iconHeight,
3527
+ width: iconWidth,
3528
+ color: activeState ? activeColor : color
3529
+ });
3530
+ case 'download':
3531
+ return /*#__PURE__*/React$1.createElement(DownloadIcon, {
3532
+ height: iconHeight,
3533
+ width: iconWidth,
3534
+ color: activeState ? activeColor : color
3535
+ });
3536
+ case 'document':
3537
+ return /*#__PURE__*/React$1.createElement(DocumentIcon, {
3538
+ height: iconHeight,
3539
+ width: iconWidth,
3540
+ color: activeState ? activeColor : color
3541
+ });
3542
+ case 'fly':
3543
+ return /*#__PURE__*/React$1.createElement(FlyIcon, {
3544
+ height: iconHeight,
3545
+ width: iconWidth,
3546
+ color: activeState ? activeColor : color
3547
+ });
3548
+ case 'bell':
3549
+ return /*#__PURE__*/React$1.createElement(BellIcon, {
3550
+ height: iconHeight,
3551
+ width: iconWidth,
3552
+ color: activeState ? activeColor : color
3553
+ });
3554
+ case 'maintenance':
3555
+ return /*#__PURE__*/React$1.createElement(MaintenanceIcon, {
3556
+ height: iconHeight,
3557
+ width: iconWidth,
3558
+ color: activeState ? activeColor : color
3559
+ });
3560
+ case 'exit':
3561
+ return /*#__PURE__*/React$1.createElement(ExitIcon, {
3562
+ height: iconHeight,
3563
+ width: iconWidth,
3564
+ color: activeState ? activeColor : color
3565
+ });
3566
+ case 'eye':
3567
+ return /*#__PURE__*/React$1.createElement(EyeIcon, {
3568
+ height: iconHeight,
3569
+ width: iconWidth,
3570
+ color: activeState ? activeColor : color
3571
+ });
3572
+ default:
3573
+ return /*#__PURE__*/React$1.createElement(EyeIcon, {
3574
+ height: iconHeight,
3575
+ width: iconWidth,
3576
+ color: activeState ? activeColor : color
3577
+ });
3578
+ }
3579
+ };
3580
+ return /*#__PURE__*/React$1.createElement(SagIconButtonWrapper, {
3581
+ className: className,
3484
3582
  height: height,
3485
- viewBox: "0 0 23 19",
3486
- fill: "none",
3487
- xmlns: "http://www.w3.org/2000/svg"
3488
- }, /*#__PURE__*/React$1.createElement("path", {
3489
- 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",
3490
- fill: fill
3491
- }));
3583
+ color: activeState ? activeColor : color,
3584
+ backgroundColor: backgroundColor,
3585
+ disabled: disabled,
3586
+ onClick: event => {
3587
+ onClickHandler(event);
3588
+ }
3589
+ }, getIcon(iconName), buttonText && /*#__PURE__*/React$1.createElement(SpanText$1, null, buttonText));
3590
+ };
3591
+ SagIconButton.propTypes = {
3592
+ className: PropTypes.string,
3593
+ iconName: PropTypes.string,
3594
+ buttonText: PropTypes.string,
3595
+ height: PropTypes.string,
3596
+ color: PropTypes.string,
3597
+ backgroundColor: PropTypes.string,
3598
+ activeColor: PropTypes.string,
3599
+ iconHeight: PropTypes.number,
3600
+ iconWidth: PropTypes.number,
3601
+ openState: PropTypes.bool,
3602
+ disabled: PropTypes.bool,
3603
+ onButtonClick: PropTypes.func
3604
+ };
3605
+ SagIconButton.defaultProps = {
3606
+ className: '',
3607
+ iconName: 'filter',
3608
+ buttonText: 'Filter',
3609
+ height: '40px',
3610
+ color: '#212121',
3611
+ activeColor: '#229E38',
3612
+ backgroundColor: 'transparent',
3613
+ // '#E8F5EB',
3614
+ iconHeight: 12,
3615
+ iconWidth: 12,
3616
+ openState: false,
3617
+ disabled: false,
3618
+ onButtonClick: () => {}
3492
3619
  };
3493
3620
 
3494
- const ExportIcon = _ref => {
3495
- let {
3496
- width = '14',
3497
- height = '15',
3498
- color = '#212121'
3499
- } = _ref;
3500
- return /*#__PURE__*/React$1.createElement("svg", {
3501
- width: width,
3621
+ const TextFieldContainer = styled.div`
3622
+ position: relative;
3623
+ width: ${props => props.width};
3624
+ > svg {
3625
+ position: absolute;
3626
+ top: 50%;
3627
+ transform: translateY(-50%);
3628
+ left: 10px;
3629
+
3630
+ }
3631
+ `;
3632
+ const TextFieldInput = styled.input`
3633
+ width: 100%;
3634
+ height: ${props => props.height};
3635
+ font-size: 14px;
3636
+ font-weight: 400;
3637
+ padding: 6px 16px;
3638
+ border-radius: 8px;
3639
+ border: 1px solid #B1B1B1;
3640
+ background: transparent;
3641
+ text-indent: 14px;
3642
+ &:hover,
3643
+ &:focus {
3644
+ border: 1px solid #212121;
3645
+ }
3646
+ &::placeholder {
3647
+ color: #B1B1B1;
3648
+ }
3649
+ `;
3650
+
3651
+ const SearchIcon = ({
3652
+ width = '13',
3653
+ height = '13',
3654
+ color = '#212121'
3655
+ }) => /*#__PURE__*/React$1.createElement("svg", {
3656
+ width: width,
3657
+ height: height,
3658
+ viewBox: "0 0 13 13",
3659
+ fill: "none",
3660
+ xmlns: "http://www.w3.org/2000/svg"
3661
+ }, /*#__PURE__*/React$1.createElement("path", {
3662
+ 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",
3663
+ fill: color
3664
+ }));
3665
+
3666
+ const SearchInput = props => {
3667
+ const {
3668
+ placeholder,
3669
+ onTyping,
3670
+ width,
3671
+ height,
3672
+ className
3673
+ } = props;
3674
+ const handleInputChange = e => {
3675
+ onTyping(e);
3676
+ };
3677
+ return /*#__PURE__*/React$1.createElement(TextFieldContainer, {
3678
+ className: className,
3679
+ width: width
3680
+ }, /*#__PURE__*/React$1.createElement(TextFieldInput, {
3681
+ type: "search",
3502
3682
  height: height,
3503
- viewBox: "0 0 14 15",
3504
- fill: "none",
3505
- xmlns: "http://www.w3.org/2000/svg"
3506
- }, /*#__PURE__*/React$1.createElement("path", {
3507
- 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",
3508
- fill: color
3509
- }));
3683
+ placeholder: placeholder,
3684
+ onChange: handleInputChange
3685
+ }), /*#__PURE__*/React$1.createElement(SearchIcon, null));
3686
+ };
3687
+ SearchInput.propTypes = {
3688
+ placeholder: PropTypes.string,
3689
+ width: PropTypes.string,
3690
+ height: PropTypes.string,
3691
+ onTyping: PropTypes.func,
3692
+ className: PropTypes.string
3693
+ };
3694
+ SearchInput.defaultProps = {
3695
+ placeholder: 'Search',
3696
+ width: '100%',
3697
+ height: '40px',
3698
+ onTyping: () => {},
3699
+ className: ''
3510
3700
  };
3511
3701
 
3512
3702
  const scrollableStyles$c = `
3513
3703
  overflow-y: auto;
3514
3704
 
3515
3705
  &::-webkit-scrollbar {
3516
- width: 8px;
3706
+ width: 4px;
3517
3707
  }
3518
3708
 
3519
3709
  &::-webkit-scrollbar-track {
@@ -3526,665 +3716,125 @@ const scrollableStyles$c = `
3526
3716
  border-radius: 5px;
3527
3717
  }
3528
3718
  `;
3529
- const MainContainer$5 = styled.div`
3530
- display: flex;
3531
- flex-direction: row;
3532
- position: relative;
3533
- font-family: "Poppins", sans-serif;
3534
- font-style: normal;
3535
- font-size: 1rem;
3536
- border-radius: 12px;
3537
- padding: 10px;
3538
- width: ${props => props.width};
3539
- height: ${props => props.height};
3540
- overflow: auto;
3541
- ${scrollableStyles$c}
3719
+ const TabMenuContainer = styled.div`
3720
+ font-family: 'Poppins', sans-serif;
3721
+ display: grid;
3722
+ gap: 20px;
3723
+ grid-template-rows: repeat(3, auto);
3542
3724
  `;
3543
- const RowTitle = styled.h4`
3725
+ const TopRow = styled.div`
3544
3726
  display: flex;
3545
- justify-content: space-between;
3546
- font-weight: 500;
3547
- font-size: 18px;
3548
- margin: 5px 5px 5px 0;
3549
- @media (max-width: 1536px) {
3550
- font-size: 15px;
3551
- }
3552
- @media (max-width: 1366px) {
3553
- font-size: 12px;
3554
- }
3727
+ align-items: center;
3728
+ gap: 20px;
3555
3729
  `;
3556
- const AllRowsContainer = styled.div`
3557
- display: flex;
3558
- flex-direction: column;
3559
- justify-content: space-between;
3560
- align-items: flex-start;
3561
- width: 100%;
3562
- height: 100%;
3730
+ const Headline$1 = styled.span`
3731
+ font-size: 18px;
3732
+ font-weight: 500;
3733
+ margin-right: auto;
3563
3734
  `;
3564
- const OneRowContainer = styled.div`
3565
- display: flex;
3566
- flex-direction: column;
3567
- width: 100%;
3568
- height: 100%;
3735
+ const Nav = styled.nav`
3736
+ display: flex;
3737
+ flex-direction: row;
3738
+
3569
3739
  `;
3570
- const ColumnLineSeporatorContainer = styled.div`
3740
+ const TabActionLine = styled.div`
3741
+ margin-left: auto;
3571
3742
  display: flex;
3572
- flex-direction: column;
3573
- background-color: #b1b1b1;
3574
3743
  align-items: center;
3575
- height: 1px;
3576
- width: 100%;
3577
- &.ColumnLineSeporatorContainer_vertical {
3578
- margin: 0 30px;
3579
- height: 100%;
3580
- width: 1px;
3581
- }
3582
- &.ColumnLineSeporatorContainer_horizontal {
3583
- margin: 30px 0;
3584
- min-height: 1px;
3585
- height: 1px;
3586
- width: 100%;
3587
- }
3588
- `;
3589
- const ColumnLineSeporator = styled.div`
3590
- min-width: 0.5px;
3591
- width: 0.5px;
3592
- `;
3593
- const FieldsContainer$1 = styled.div`
3594
- display: flex;
3595
- flex-direction: row;
3596
- justify-content: space-between;
3597
- white-space: nowrap;
3598
3744
  height: 100%;
3599
- padding: 30px 0px;
3600
3745
  `;
3601
- const OneFieldsContainer = styled.div`
3746
+ const Tabs = styled.div`
3747
+ position: relative;
3602
3748
  display: flex;
3603
- padding: 4px;
3604
- gap: 10px;
3749
+ align-items: center;
3605
3750
  width: 100%;
3606
- justify-content: flex-start;
3607
- // padding: ${props => props.padding}; //0 0 0 40px;
3608
- `;
3609
- const FieldTitle = styled.h4`
3610
- font-size: 18px;
3611
- font-weight: 400;
3612
- margin: 0;
3613
- @media (max-width: 1536px) {
3614
- font-size: 14px;
3615
- }
3616
- @media (max-width: 1366px) {
3617
- font-size: 12px;
3618
- }
3619
- `;
3620
- const FormattedValue$3 = styled.div`
3621
- font-weight: 400;
3622
- font-size: 40px;
3623
- display: flex;
3624
- align-items: baseline;
3625
- min-height: 40px;
3626
- gap: 2px;
3627
- @media (max-width: 1536px) {
3628
- font-size: 24px;
3629
- }
3630
- @media (max-width: 1366px) {
3631
- font-size: 20px;
3632
- }
3633
3751
  `;
3634
- const TextBeforeAndAfterValue$1 = styled.span`
3635
- font-weight: 400;
3752
+ const Tab = styled.div`
3753
+ cursor: pointer;
3754
+ position: relative;
3755
+ text-align: center;
3756
+ padding: 8px 12px;
3636
3757
  font-size: 16px;
3637
- @media (max-width: 1536px) {
3638
- font-size: 14px;
3639
- }
3640
- @media (max-width: 1366px) {
3641
- font-size: 11px;
3758
+ color: #000000;
3759
+ &.active {
3760
+ font-weight: 600;
3761
+ color: ${props => props.color};
3762
+ border-bottom: 1mm solid ${props => props.color};
3763
+ //2px solid ${props => props.color};
3642
3764
  }
3643
3765
  `;
3644
- const FieldTitleAndValueSubContainer = styled.div`
3645
- display: flex;
3646
- justify-content: space-around;
3647
- flex-direction: column;
3648
- flex-wrap: wrap;
3766
+ const PresentationSlider = styled.div`
3767
+ position: absolute;
3768
+ bottom: 0;
3769
+ left: 0;
3649
3770
  width: 100%;
3771
+ height: 2px;
3772
+ background-color: #EAEAEA;
3773
+ &::before {
3774
+ content: '';
3775
+ position: absolute;
3776
+ left: 0;
3777
+ z-index: 1;
3778
+ width: ${props => props.width};
3779
+ height: 2px;
3780
+ /* background-color: ${props => props.color}; */
3781
+ transform: translateX(calc(100% * ${props => props.activeTab}));
3782
+ transition: transform .35s ease;
3783
+ }
3650
3784
  `;
3651
- const InfoTextContainer$1 = styled.div`
3652
- display: flex;
3653
- flex-direction: row;
3785
+ const Body = styled.div`
3654
3786
  width: 100%;
3655
- height: 100%;
3656
- overflow:auto;
3657
- `;
3658
- const IconContainer$5 = styled.div`
3659
- display: flex;
3660
- padding: 5px 10px 0 0;
3661
- cursor: pointer;
3787
+ ${scrollableStyles$c}
3788
+ position: relative;
3789
+ overflow-x: hidden;
3790
+ box-sizing: border-box;
3791
+ padding: ${props => props.setBackground ? '20px' : '5px'};
3792
+ background-color: ${props => props.setBackground ? 'white' : 'unset'};
3793
+ border-radius: ${props => props.setBackground ? '12px' : '0'};
3794
+ box-shadow: ${props => props.setBackground ? '0px 0px 20px 0px rgba(0, 0, 0, 0.10)' : 'unset'};
3662
3795
  `;
3663
- const InfoTextLabel$1 = styled.div`
3664
- color: black;
3665
- font-size: 18px;
3666
- line-height: 24px;
3796
+ const Label$5 = styled.div`
3797
+ font-size: 12px;
3667
3798
  font-weight: 400;
3668
- width: 100%;
3669
- overflow: auto;
3670
- ${scrollableStyles$c}
3671
- strong {
3672
- font-weight: 500;
3673
- color: #212121;
3674
- @media (max-width: 1536px) {
3675
- font-size: 14px;
3676
- }
3677
- @media (max-width: 1366px) {
3678
- font-size: 12px;
3679
- }
3680
- };
3681
- p1 {
3682
- font-weight: 400;
3683
- color: #726F6F;
3684
- @media (max-width: 1536px) {
3685
- font-size: 14px;
3799
+ padding: 8px;
3800
+ color: #5a5a5a;
3801
+ background-color: #E7E7E7;
3802
+ border-radius: 4px;
3803
+ > span {
3804
+ font-weight: 500;
3686
3805
  }
3687
- @media (max-width: 1366px) {
3688
- font-size: 12px;
3806
+ ~ span {
3807
+ margin: 0 24px;
3808
+ font-weight: 400;
3689
3809
  }
3690
- };
3691
3810
  `;
3692
- const OutBanner$2 = styled.div`
3811
+ const ActionsWrapper = styled.div`
3693
3812
  display: flex;
3694
- gap: 8px;
3695
3813
  align-items: center;
3696
- font-size: 14px;
3697
- font-weight: 400;
3698
- color: ${props => props.textColor};
3699
- cursor: pointer;
3700
- @media (max-width: 1536px) {
3701
- font-size: 13px;
3702
- }
3703
- @media (max-width: 1366px) {
3704
- font-size: 12px;
3705
- }
3706
- > svg {
3707
- width: 14px;
3708
- height: 14px;
3709
- @media (max-width: 1536px) {
3710
- width: 13px;
3711
- height: 13px;
3712
- }
3713
- @media (max-width: 1366px) {
3714
- width: 12px;
3715
- height: 12px;
3716
- }
3717
- }
3718
- `;
3719
-
3720
- const MarketShareDescription = props => {
3721
- const {
3722
- width,
3723
- height,
3724
- marketShareData,
3725
- iconColor,
3726
- onBannerClick,
3727
- dotCut
3728
- } = props;
3729
- const displayField = dataItem => {
3730
- const content = /*#__PURE__*/React$1.createElement(FieldTitleAndValueSubContainer, {
3731
- className: "FieldTitleAndValueSubContainer"
3732
- }, /*#__PURE__*/React$1.createElement(FieldTitle, {
3733
- className: "FieldTitle"
3734
- }, dataItem.label), /*#__PURE__*/React$1.createElement(FormattedValue$3, {
3735
- className: "FormattedValue"
3736
- }, /*#__PURE__*/React$1.createElement(TextBeforeAndAfterValue$1, {
3737
- className: "TextBeforeAndAfterValue"
3738
- }, 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$1.createElement(TextBeforeAndAfterValue$1, null, dataItem.textAfter)));
3739
- return content;
3740
- };
3741
- const dispalyRowFields = data => {
3742
- if (!data && !data.length > 0) return '';
3743
- const content = /*#__PURE__*/React$1.createElement(FieldsContainer$1, {
3744
- className: "FieldsContainer",
3745
- height: "160px"
3746
- }, data?.map((item, index) => /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(OneFieldsContainer, {
3747
- className: "OneFieldsContainer",
3748
- padding: index === 0 ? '0px' : '0 0 0 40px'
3749
- }, displayField(item)), data?.length !== index + 1 ? /*#__PURE__*/React$1.createElement(ColumnLineSeporatorContainer, {
3750
- className: "ColumnLineSeporatorContainer_vertical"
3751
- }, /*#__PURE__*/React$1.createElement(ColumnLineSeporator, {
3752
- className: "ColumnLineSeporator"
3753
- })) : '')));
3754
- return content;
3755
- };
3756
- const displayRows = () => {
3757
- if (!marketShareData || marketShareData?.length === 0) return '';
3758
- const content = /*#__PURE__*/React$1.createElement(AllRowsContainer, {
3759
- className: "AllRowsContainer"
3760
- }, marketShareData.map((item, index) => /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(OneRowContainer, {
3761
- className: "OneRowContainer"
3762
- }, /*#__PURE__*/React$1.createElement(RowTitle, {
3763
- className: "RowTitle"
3764
- }, /*#__PURE__*/React$1.createElement(InfoTextLabel$1, {
3765
- className: "InfoTextLabel",
3766
- dangerouslySetInnerHTML: {
3767
- __html: item.rowTitle
3768
- }
3769
- }), item.showBanner && /*#__PURE__*/React$1.createElement(OutBanner$2, {
3770
- className: "OutBanner",
3771
- onClick: () => onBannerClick({
3772
- eventName: 'onBannerClick',
3773
- rowName: item.name
3774
- })
3775
- }, /*#__PURE__*/React$1.createElement(ExportIcon, {
3776
- color: "#212121"
3777
- }), "View By Banner")), dispalyRowFields(item.fieldsArray), /*#__PURE__*/React$1.createElement(InfoTextContainer$1, {
3778
- className: "InfoTextContainer"
3779
- }, item.rowFooter && item.rowFooter?.length > 0 ? /*#__PURE__*/React$1.createElement(IconContainer$5, {
3780
- className: "IconContainer"
3781
- }, /*#__PURE__*/React$1.createElement(LampIcon, {
3782
- width: "23px",
3783
- height: "19px",
3784
- fill: iconColor
3785
- })) : '', /*#__PURE__*/React$1.createElement(InfoTextLabel$1, {
3786
- className: "InfoTextLabel",
3787
- dangerouslySetInnerHTML: {
3788
- __html: item.rowFooter
3789
- }
3790
- }))), marketShareData?.length !== index + 1 ? /*#__PURE__*/React$1.createElement(ColumnLineSeporatorContainer, {
3791
- className: "ColumnLineSeporatorContainer_horizontal"
3792
- }, /*#__PURE__*/React$1.createElement(ColumnLineSeporator, {
3793
- className: "ColumnLineSeporator"
3794
- })) : '')));
3795
- return content;
3796
- };
3797
- return /*#__PURE__*/React$1.createElement(MainContainer$5, {
3798
- className: "MainContainer",
3799
- height: height,
3800
- width: width
3801
- }, displayRows());
3802
- };
3803
- MarketShareDescription.propTypes = {
3804
- marketShareData: PropTypes.arrayOf(PropTypes.shape({
3805
- label: PropTypes.string,
3806
- checked: PropTypes.bool,
3807
- disabled: PropTypes.bool
3808
- })),
3809
- height: PropTypes.string,
3810
- width: PropTypes.string,
3811
- iconColor: PropTypes.string,
3812
- onBannerClick: PropTypes.func,
3813
- dotCut: PropTypes.bool
3814
- };
3815
- MarketShareDescription.defaultProps = {
3816
- marketShareData: [],
3817
- width: '100%',
3818
- height: '100%',
3819
- iconColor: '#1B30AA',
3820
- onBannerClick: () => {},
3821
- dotCut: false
3822
- };
3823
-
3824
- const SagIconButtonWrapper = styled.button`
3825
- height: ${props => props.height};
3826
- font-size: 14px;
3827
- font-weight: 400;
3828
- display: flex;
3829
- gap: 8px;
3830
- align-items: center;
3831
- justify-content: center;
3832
- padding: 8px 18px;
3833
- white-space: nowrap;
3834
- color: ${props => props.color};
3835
- border-radius: 8px;
3836
- border: 1px solid ${props => props.color};
3837
- background: ${props => props.backgroundColor ? props.backgroundColor : 'transparent'};
3838
- transition: box-shadow 0.3s ease;
3839
- &:hover, &:focus {
3840
- cursor: pointer;
3841
- box-shadow: 5px 5px 10px 0px rgba(0, 0, 0, 0.1);
3842
- }
3843
- `;
3844
- const SpanText$1 = styled.span`
3845
- `;
3846
-
3847
- const SagIconButton = props => {
3848
- const {
3849
- iconName,
3850
- color,
3851
- backgroundColor,
3852
- activeColor,
3853
- height,
3854
- buttonText,
3855
- iconWidth,
3856
- iconHeight,
3857
- disabled,
3858
- openState,
3859
- onButtonClick,
3860
- className
3861
- } = props;
3862
- const [activeState, setActiveState] = useState(openState);
3863
- const onClickHandler = event => {
3864
- onButtonClick(event);
3865
- setActiveState(prevState => !prevState);
3866
- };
3867
- const getIcon = icon => {
3868
- switch (icon.toLowerCase()) {
3869
- case 'filter':
3870
- return /*#__PURE__*/React$1.createElement(FilterIcon, {
3871
- height: iconHeight,
3872
- width: iconWidth,
3873
- color: activeState ? activeColor : color
3874
- });
3875
- case 'options':
3876
- return /*#__PURE__*/React$1.createElement(OptionsIcon, {
3877
- height: iconHeight,
3878
- width: iconWidth,
3879
- color: activeState ? activeColor : color
3880
- });
3881
- case 'download':
3882
- return /*#__PURE__*/React$1.createElement(DownloadIcon, {
3883
- height: iconHeight,
3884
- width: iconWidth,
3885
- color: activeState ? activeColor : color
3886
- });
3887
- case 'document':
3888
- return /*#__PURE__*/React$1.createElement(DocumentIcon, {
3889
- height: iconHeight,
3890
- width: iconWidth,
3891
- color: activeState ? activeColor : color
3892
- });
3893
- case 'fly':
3894
- return /*#__PURE__*/React$1.createElement(FlyIcon, {
3895
- height: iconHeight,
3896
- width: iconWidth,
3897
- color: activeState ? activeColor : color
3898
- });
3899
- case 'bell':
3900
- return /*#__PURE__*/React$1.createElement(BellIcon, {
3901
- height: iconHeight,
3902
- width: iconWidth,
3903
- color: activeState ? activeColor : color
3904
- });
3905
- case 'maintenance':
3906
- return /*#__PURE__*/React$1.createElement(MaintenanceIcon, {
3907
- height: iconHeight,
3908
- width: iconWidth,
3909
- color: activeState ? activeColor : color
3910
- });
3911
- case 'exit':
3912
- return /*#__PURE__*/React$1.createElement(ExitIcon, {
3913
- height: iconHeight,
3914
- width: iconWidth,
3915
- color: activeState ? activeColor : color
3916
- });
3917
- case 'eye':
3918
- return /*#__PURE__*/React$1.createElement(EyeIcon, {
3919
- height: iconHeight,
3920
- width: iconWidth,
3921
- color: activeState ? activeColor : color
3922
- });
3923
- default:
3924
- return /*#__PURE__*/React$1.createElement(EyeIcon, {
3925
- height: iconHeight,
3926
- width: iconWidth,
3927
- color: activeState ? activeColor : color
3928
- });
3929
- }
3930
- };
3931
- return /*#__PURE__*/React$1.createElement(SagIconButtonWrapper, {
3932
- className: className,
3933
- height: height,
3934
- color: activeState ? activeColor : color,
3935
- backgroundColor: backgroundColor,
3936
- disabled: disabled,
3937
- onClick: event => {
3938
- onClickHandler(event);
3939
- }
3940
- }, getIcon(iconName), buttonText && /*#__PURE__*/React$1.createElement(SpanText$1, null, buttonText));
3941
- };
3942
- SagIconButton.propTypes = {
3943
- className: PropTypes.string,
3944
- iconName: PropTypes.string,
3945
- buttonText: PropTypes.string,
3946
- height: PropTypes.string,
3947
- color: PropTypes.string,
3948
- backgroundColor: PropTypes.string,
3949
- activeColor: PropTypes.string,
3950
- iconHeight: PropTypes.number,
3951
- iconWidth: PropTypes.number,
3952
- openState: PropTypes.bool,
3953
- disabled: PropTypes.bool,
3954
- onButtonClick: PropTypes.func
3955
- };
3956
- SagIconButton.defaultProps = {
3957
- className: '',
3958
- iconName: 'filter',
3959
- buttonText: 'Filter',
3960
- height: '40px',
3961
- color: '#212121',
3962
- activeColor: '#229E38',
3963
- backgroundColor: 'transparent',
3964
- // '#E8F5EB',
3965
- iconHeight: 12,
3966
- iconWidth: 12,
3967
- openState: false,
3968
- disabled: false,
3969
- onButtonClick: () => {}
3970
- };
3971
-
3972
- const TextFieldContainer = styled.div`
3973
- position: relative;
3974
- width: ${props => props.width};
3975
- > svg {
3976
- position: absolute;
3977
- top: 50%;
3978
- transform: translateY(-50%);
3979
- left: 10px;
3980
-
3981
- }
3982
- `;
3983
- const TextFieldInput = styled.input`
3984
- width: 100%;
3985
- height: ${props => props.height};
3986
- font-size: 14px;
3987
- font-weight: 400;
3988
- padding: 6px 16px;
3989
- border-radius: 8px;
3990
- border: 1px solid #B1B1B1;
3991
- background: transparent;
3992
- text-indent: 14px;
3993
- &:hover,
3994
- &:focus {
3995
- border: 1px solid #212121;
3996
- }
3997
- &::placeholder {
3998
- color: #B1B1B1;
3999
- }
4000
- `;
4001
-
4002
- const SearchIcon = ({
4003
- width = '13',
4004
- height = '13',
4005
- color = '#212121'
4006
- }) => /*#__PURE__*/React$1.createElement("svg", {
4007
- width: width,
4008
- height: height,
4009
- viewBox: "0 0 13 13",
4010
- fill: "none",
4011
- xmlns: "http://www.w3.org/2000/svg"
4012
- }, /*#__PURE__*/React$1.createElement("path", {
4013
- 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",
4014
- fill: color
4015
- }));
4016
-
4017
- const SearchInput = props => {
4018
- const {
4019
- placeholder,
4020
- onTyping,
4021
- width,
4022
- height,
4023
- className
4024
- } = props;
4025
- const handleInputChange = e => {
4026
- onTyping(e);
4027
- };
4028
- return /*#__PURE__*/React$1.createElement(TextFieldContainer, {
4029
- className: className,
4030
- width: width
4031
- }, /*#__PURE__*/React$1.createElement(TextFieldInput, {
4032
- type: "search",
4033
- height: height,
4034
- placeholder: placeholder,
4035
- onChange: handleInputChange
4036
- }), /*#__PURE__*/React$1.createElement(SearchIcon, null));
4037
- };
4038
- SearchInput.propTypes = {
4039
- placeholder: PropTypes.string,
4040
- width: PropTypes.string,
4041
- height: PropTypes.string,
4042
- onTyping: PropTypes.func,
4043
- className: PropTypes.string
4044
- };
4045
- SearchInput.defaultProps = {
4046
- placeholder: 'Search',
4047
- width: '100%',
4048
- height: '40px',
4049
- onTyping: () => {},
4050
- className: ''
4051
- };
4052
-
4053
- const scrollableStyles$b = `
4054
- overflow-y: auto;
4055
-
4056
- &::-webkit-scrollbar {
4057
- width: 4px;
4058
- }
4059
-
4060
- &::-webkit-scrollbar-track {
4061
- background: #E8E8E8;
4062
- border-radius: 5px;
4063
- }
4064
-
4065
- &::-webkit-scrollbar-thumb {
4066
- background: #D0D0D0;
4067
- border-radius: 5px;
4068
- }
4069
- `;
4070
- const TabMenuContainer = styled.div`
4071
- font-family: 'Poppins', sans-serif;
4072
- display: grid;
4073
- gap: 20px;
4074
- grid-template-rows: repeat(3, auto);
4075
- `;
4076
- const TopRow = styled.div`
4077
- display: flex;
4078
- align-items: center;
4079
- gap: 20px;
4080
- `;
4081
- const Headline$1 = styled.span`
4082
- font-size: 18px;
4083
- font-weight: 500;
4084
- margin-right: auto;
4085
- `;
4086
- const Nav = styled.nav`
4087
- display: flex;
4088
- flex-direction: row;
4089
-
4090
- `;
4091
- const TabActionLine = styled.div`
4092
- margin-left: auto;
4093
- display: flex;
4094
- align-items: center;
4095
- height: 100%;
4096
- `;
4097
- const Tabs = styled.div`
4098
- position: relative;
4099
- display: flex;
4100
- align-items: center;
4101
- width: 100%;
4102
- `;
4103
- const Tab = styled.div`
4104
- cursor: pointer;
4105
- position: relative;
4106
- text-align: center;
4107
- padding: 8px 12px;
4108
- font-size: 16px;
4109
- color: #000000;
4110
- &.active {
4111
- font-weight: 600;
4112
- color: ${props => props.color};
4113
- border-bottom: 1mm solid #229E38;
4114
- //2px solid ${props => props.color};
4115
- }
4116
- `;
4117
- const PresentationSlider = styled.div`
4118
- position: absolute;
4119
- bottom: 0;
4120
- left: 0;
4121
- width: 100%;
4122
- height: 2px;
4123
- background-color: #EAEAEA;
4124
- &::before {
4125
- content: '';
4126
- position: absolute;
4127
- left: 0;
4128
- z-index: 1;
4129
- width: ${props => props.width};
4130
- height: 2px;
4131
- /* background-color: ${props => props.color}; */
4132
- transform: translateX(calc(100% * ${props => props.activeTab}));
4133
- transition: transform .35s ease;
4134
- }
4135
- `;
4136
- const Body = styled.div`
4137
- width: 100%;
4138
- ${scrollableStyles$b}
4139
- position: relative;
4140
- overflow-x: hidden;
4141
- box-sizing: border-box;
4142
- padding: ${props => props.setBackground ? '20px' : '5px'};
4143
- background-color: ${props => props.setBackground ? 'white' : 'unset'};
4144
- border-radius: ${props => props.setBackground ? '12px' : '0'};
4145
- box-shadow: ${props => props.setBackground ? '0px 0px 20px 0px rgba(0, 0, 0, 0.10)' : 'unset'};
4146
- `;
4147
- const Label$5 = styled.div`
4148
- font-size: 12px;
4149
- font-weight: 400;
4150
- padding: 8px;
4151
- color: #5a5a5a;
4152
- background-color: #E7E7E7;
4153
- border-radius: 4px;
4154
- > span {
4155
- font-weight: 500;
4156
- }
4157
- ~ span {
4158
- margin: 0 24px;
4159
- font-weight: 400;
4160
- }
4161
- `;
4162
- const ActionsWrapper = styled.div`
4163
- display: flex;
4164
- align-items: center;
4165
- gap: 10px;
4166
- width: 100%;
4167
- `;
4168
- const SagIconButtonWrap = styled(SagIconButton)`
4169
- `;
4170
- const SearchInputWrap = styled(SearchInput)`
4171
- margin-left: auto;
3814
+ gap: 10px;
3815
+ width: 100%;
3816
+ `;
3817
+ const SagIconButtonWrap = styled(SagIconButton)`
3818
+ `;
3819
+ const SearchInputWrap = styled(SearchInput)`
3820
+ margin-left: auto;
4172
3821
  `;
4173
3822
 
4174
3823
  const TabMenu = _ref => {
4175
3824
  let {
4176
- activeColor = '#229E38',
4177
- headlineContent = /*#__PURE__*/React$1.createElement("div", null),
4178
- children = null,
4179
- className = 'TabMenuContainer',
4180
3825
  color = '#229E38',
4181
3826
  currentTab = 0,
4182
3827
  headlineInsteadTabs = false,
4183
3828
  headlineText = 'Headline',
3829
+ headlineContent = /*#__PURE__*/React$1.createElement("div", null),
3830
+ className = 'TabMenuContainer',
3831
+ children = null,
3832
+ tabs = [],
4184
3833
  inputWidth = '100%',
4185
3834
  onFilterButtonClick = () => {},
4186
3835
  onSearchFieldTyping = () => {},
4187
3836
  onTabChange = () => {},
3837
+ onTopButtonClick = () => {},
4188
3838
  panelIsOpen = false,
4189
3839
  setBackground = false,
4190
3840
  showActions = true,
@@ -4195,9 +3845,7 @@ const TabMenu = _ref => {
4195
3845
  disabledButton = false,
4196
3846
  setTopRightButton = false,
4197
3847
  rightButtonText = 'Button',
4198
- rightButtonIcon = 'arrow',
4199
- onTopButtonClick = () => {},
4200
- tabs = []
3848
+ rightButtonIcon = 'arrow'
4201
3849
  } = _ref;
4202
3850
  const [activeTab, setActiveTab] = useState(currentTab);
4203
3851
  useEffect(() => {
@@ -4221,7 +3869,7 @@ const TabMenu = _ref => {
4221
3869
  iconName: "Filter",
4222
3870
  buttonText: "",
4223
3871
  openState: panelIsOpen,
4224
- activeColor: activeColor,
3872
+ activeColor: color,
4225
3873
  onButtonClick: onFilterButtonClick
4226
3874
  }), headlineInsteadTabs ? /*#__PURE__*/React$1.createElement(Headline$1, null, headlineText) : /*#__PURE__*/React$1.createElement(Nav, {
4227
3875
  className: "Nav"
@@ -4257,7 +3905,6 @@ const TabMenu = _ref => {
4257
3905
  }, tabs[activeTab]?.content));
4258
3906
  };
4259
3907
  TabMenu.propTypes = {
4260
- activeColor: PropTypes.string,
4261
3908
  children: PropTypes.node,
4262
3909
  className: PropTypes.string,
4263
3910
  color: PropTypes.string,
@@ -8861,7 +8508,7 @@ const MenuItemUpIcon = ({
8861
8508
  }));
8862
8509
 
8863
8510
  /* eslint-disable no-nested-ternary */
8864
- const scrollableStyles$a = `
8511
+ const scrollableStyles$b = `
8865
8512
  overflow-y: auto;
8866
8513
 
8867
8514
  &::-webkit-scrollbar {
@@ -8986,7 +8633,7 @@ const OptionsContainer$6 = styled.div`
8986
8633
  display: ${props => props.showoptions && props.filteredoptions?.length > 0 ? 'block' : 'none'};
8987
8634
  `;
8988
8635
  const OptionsSubContainer$3 = styled.ul`
8989
- ${scrollableStyles$a}
8636
+ ${scrollableStyles$b}
8990
8637
  list-style: none;
8991
8638
  font-weight: 400;
8992
8639
  margin: 0;
@@ -9029,7 +8676,7 @@ const ErrorMessage$3 = styled.div`
9029
8676
  color: red;
9030
8677
  margin-top: 5px;
9031
8678
  `;
9032
- const IconContainer$4 = styled.div`
8679
+ const IconContainer$5 = styled.div`
9033
8680
  display: flex;
9034
8681
  padding: 2px;
9035
8682
  cursor: pointer;
@@ -9213,14 +8860,14 @@ const DropdownSingleNew = ({
9213
8860
  placeholder: isFocused ? filteredOptions.length <= 5 ? "Select Option…" : "Type To Search" : "",
9214
8861
  error: error,
9215
8862
  isFocused: isFocused
9216
- })), selectedOptions.length > 0 && xIconShow && /*#__PURE__*/React$1.createElement(IconContainer$4, {
8863
+ })), selectedOptions.length > 0 && xIconShow && /*#__PURE__*/React$1.createElement(IconContainer$5, {
9217
8864
  className: "IconContainer",
9218
8865
  onClick: handleClearClick
9219
8866
  }, /*#__PURE__*/React$1.createElement(CloseXIcon, {
9220
8867
  width: "12px",
9221
8868
  height: "12px",
9222
8869
  fill: "#B1B1B1"
9223
- })), /*#__PURE__*/React$1.createElement(IconContainer$4, {
8870
+ })), /*#__PURE__*/React$1.createElement(IconContainer$5, {
9224
8871
  className: "IconContainer",
9225
8872
  onClick: handleOpenCloseMenuClick
9226
8873
  }, showOptions ? /*#__PURE__*/React$1.createElement(MenuItemUpIcon, {
@@ -9328,7 +8975,7 @@ const CheckBoxNotCheckedIcon = ({
9328
8975
  };
9329
8976
 
9330
8977
  /* eslint-disable no-nested-ternary */
9331
- const scrollableStyles$9 = `
8978
+ const scrollableStyles$a = `
9332
8979
  overflow-y: auto;
9333
8980
 
9334
8981
  &::-webkit-scrollbar {
@@ -9453,7 +9100,7 @@ const OptionsContainer$5 = styled.div`
9453
9100
  display: ${props => props.showoptions && props.filteredoptions?.length > 0 ? 'block' : 'none'};
9454
9101
  `;
9455
9102
  const OptionsSubContainer$2 = styled.ul`
9456
- ${scrollableStyles$9}
9103
+ ${scrollableStyles$a}
9457
9104
  list-style: none;
9458
9105
  font-weight: 400;
9459
9106
  margin: 0;
@@ -9525,7 +9172,7 @@ const SelectedOptionItem$1 = styled.div`
9525
9172
  padding: 4px 6px;
9526
9173
  font-size: 12px;
9527
9174
  `;
9528
- const IconContainer$3 = styled.div`
9175
+ const IconContainer$4 = styled.div`
9529
9176
  display: flex;
9530
9177
  padding: 2px;
9531
9178
  cursor: pointer;
@@ -9732,14 +9379,14 @@ const DropdownMultiNew = ({
9732
9379
  placeholder: isFocused ? filteredOptions.length <= 5 ? "Select Option…" : "Type To Search" : "",
9733
9380
  error: error,
9734
9381
  isFocused: isFocused
9735
- }) : " "), selectedOptions.length > 0 && xIconShow && /*#__PURE__*/React$1.createElement(IconContainer$3, {
9382
+ }) : " "), selectedOptions.length > 0 && xIconShow && /*#__PURE__*/React$1.createElement(IconContainer$4, {
9736
9383
  className: "IconContainer",
9737
9384
  onClick: handleClearClick
9738
9385
  }, /*#__PURE__*/React$1.createElement(CloseXIcon, {
9739
9386
  width: "12px",
9740
9387
  height: "12px",
9741
9388
  fill: "#B1B1B1"
9742
- })), /*#__PURE__*/React$1.createElement(IconContainer$3, {
9389
+ })), /*#__PURE__*/React$1.createElement(IconContainer$4, {
9743
9390
  className: "IconContainer",
9744
9391
  onClick: handleOpenCloseMenuClick
9745
9392
  }, showOptions ? /*#__PURE__*/React$1.createElement(MenuItemUpIcon, {
@@ -9767,7 +9414,7 @@ const DropdownMultiNew = ({
9767
9414
  key: option.value,
9768
9415
  onClick: () => toggleOption(option),
9769
9416
  selected: isDropdowned(option)
9770
- }, " ", /*#__PURE__*/React$1.createElement(IconContainer$3, {
9417
+ }, " ", /*#__PURE__*/React$1.createElement(IconContainer$4, {
9771
9418
  className: "IconContainer"
9772
9419
  }, selectedOptions.find(itemSelectedOptions => option.value === itemSelectedOptions.value) ? /*#__PURE__*/React$1.createElement(CheckBoxCheckedIcon, {
9773
9420
  width: "14px",
@@ -11410,7 +11057,7 @@ const AllFieldsContainer = styled.div`
11410
11057
  flex-wrap: wrap;
11411
11058
  width: 100%;
11412
11059
  `;
11413
- const FieldsContainer = styled.div`
11060
+ const FieldsContainer$1 = styled.div`
11414
11061
  display: flex;
11415
11062
  flex-direction: column;
11416
11063
  white-space: wrap;
@@ -11562,7 +11209,7 @@ const FilterPanel = props => {
11562
11209
  const mm = String(date.getMonth() + 1).padStart(2, '0');
11563
11210
  const dd = String(date.getDate()).padStart(2, '0');
11564
11211
  const yyyy = date.getFullYear();
11565
- return `${dd}/${mm}/${yyyy}`;
11212
+ return `${mm}/${dd}/${yyyy}`;
11566
11213
  };
11567
11214
  return `${formatDate(startOfYear)} - ${formatDate(now)}`;
11568
11215
  };
@@ -11784,6 +11431,7 @@ const FilterPanel = props => {
11784
11431
  borderRadius: "12px",
11785
11432
  label: "Date Range",
11786
11433
  onChange: eventRangePicker => {
11434
+ // Allow changes to the date range even in YTD mode
11787
11435
  const selectedValue = eventRangePicker && typeof eventRangePicker === 'string' ? `${eventRangePicker}` : undefined;
11788
11436
  const newFieldsDataState = FieldsDataState?.map(itemField => itemField.name === item.name ? {
11789
11437
  ...itemField,
@@ -11803,7 +11451,7 @@ const FilterPanel = props => {
11803
11451
  },
11804
11452
  required: item.required,
11805
11453
  placeholder: "Select Date Range ...",
11806
- selectedValue: getYTDString(),
11454
+ selectedValue: item.selectedValue || getYTDString(),
11807
11455
  disabled: true,
11808
11456
  width: "100%",
11809
11457
  height: "55px"
@@ -11969,7 +11617,7 @@ const FilterPanel = props => {
11969
11617
  if (!data || data.length === 0) {
11970
11618
  return '';
11971
11619
  }
11972
- return /*#__PURE__*/React$1.createElement(FieldsContainer, {
11620
+ return /*#__PURE__*/React$1.createElement(FieldsContainer$1, {
11973
11621
  className: "FieldsContainer"
11974
11622
  }, data?.map((item, i) => /*#__PURE__*/React$1.createElement(FieldContainer$1, {
11975
11623
  key: `${item.name}-${i}`,
@@ -12163,7 +11811,7 @@ const SortIcon = _ref => {
12163
11811
  }))));
12164
11812
  };
12165
11813
 
12166
- const scrollableStyles$8 = `
11814
+ const scrollableStyles$9 = `
12167
11815
  overflow-y: auto;
12168
11816
 
12169
11817
  &::-webkit-scrollbar {
@@ -12398,7 +12046,7 @@ const TableWrapper = styled.div`
12398
12046
  border: 1px solid #dddddd;
12399
12047
  border-radius: ${props => props.columnsNumber > props.maxColumnsNumber ? ' 12px 12px 6px 6px' : '12px'};
12400
12048
  overflow-x: ${props => props.columnsNumber > props.maxColumnsNumber ? 'auto' : 'hidden'};
12401
- ${scrollableStyles$8}
12049
+ ${scrollableStyles$9}
12402
12050
  `;
12403
12051
  const Table = styled.table`
12404
12052
  font-family: "Poppins", sans-serif;
@@ -12989,7 +12637,7 @@ EventListItem.defaultProps = {
12989
12637
  onClick: () => {}
12990
12638
  };
12991
12639
 
12992
- const MainContainer$4 = styled.div`
12640
+ const MainContainer$5 = styled.div`
12993
12641
  /* display: flex; */
12994
12642
  position: relative;
12995
12643
  font-family: "Poppins", sans-serif;
@@ -13052,7 +12700,7 @@ const EventList = props => {
13052
12700
  };
13053
12701
 
13054
12702
  //= ======================================== MAIN RETURN ====================================
13055
- return /*#__PURE__*/React$1.createElement(MainContainer$4, {
12703
+ return /*#__PURE__*/React$1.createElement(MainContainer$5, {
13056
12704
  id: "MainContainer",
13057
12705
  height: height,
13058
12706
  width: width
@@ -13248,7 +12896,7 @@ const CollapseMenuItemContentContainer = styled.div`
13248
12896
  font-size: 12px;
13249
12897
  }
13250
12898
  `;
13251
- const MainContainer$3 = styled.div`
12899
+ const MainContainer$4 = styled.div`
13252
12900
  width: ${props => props.width};
13253
12901
  height: ${props => props.height};
13254
12902
  display: flex;
@@ -13263,7 +12911,7 @@ const DraftTag$1 = styled.div`
13263
12911
  height: fit-content;
13264
12912
  `;
13265
12913
 
13266
- const MainContainer$2 = styled.div`
12914
+ const MainContainer$3 = styled.div`
13267
12915
  width: ${props => props.width};
13268
12916
  height: ${props => props.height};
13269
12917
  font-family: 'Poppins', sans-serif;
@@ -13380,7 +13028,7 @@ const BannerEventBox = props => {
13380
13028
  const onInfoClickHandler = event => {
13381
13029
  onInfoClick(event);
13382
13030
  };
13383
- return /*#__PURE__*/React$1.createElement(MainContainer$2, {
13031
+ return /*#__PURE__*/React$1.createElement(MainContainer$3, {
13384
13032
  height: height,
13385
13033
  width: width
13386
13034
  }, /*#__PURE__*/React$1.createElement(TitleWrapper, null, formatedBanners().icon, "|", /*#__PURE__*/React$1.createElement(CardTitle, null, formatedBanners().name)), /*#__PURE__*/React$1.createElement(Block, null, /*#__PURE__*/React$1.createElement(Headline, null, "Event Description"), /*#__PURE__*/React$1.createElement(Text, null, description)), /*#__PURE__*/React$1.createElement(Block, null, /*#__PURE__*/React$1.createElement(Headline, null, "Event Dates:"), /*#__PURE__*/React$1.createElement(Text, null, dates.join(" - "))), /*#__PURE__*/React$1.createElement(ButtonWrap, null, /*#__PURE__*/React$1.createElement(Button, {
@@ -13490,7 +13138,7 @@ const BannerEventBoxList = props => {
13490
13138
  color: toggleColor
13491
13139
  }))), IsItemOpen && /*#__PURE__*/React.createElement(CollapseMenuItemContentContainer, {
13492
13140
  id: "CollapseMenuItemContentContainer"
13493
- }, cardsContent ? /*#__PURE__*/React.createElement(MainContainer$3, {
13141
+ }, cardsContent ? /*#__PURE__*/React.createElement(MainContainer$4, {
13494
13142
  width: width,
13495
13143
  height: height
13496
13144
  }, data.map(item => /*#__PURE__*/React.createElement(BannerEventBox, {
@@ -13578,7 +13226,7 @@ BannerEventBoxList.defaultProps = {
13578
13226
  showDraft: false
13579
13227
  };
13580
13228
 
13581
- const scrollableStyles$7 = `
13229
+ const scrollableStyles$8 = `
13582
13230
  overflow-y: auto;
13583
13231
 
13584
13232
  &::-webkit-scrollbar {
@@ -13615,7 +13263,7 @@ const Modal = styled.div`
13615
13263
  width: 79%;
13616
13264
  max-width: 1500px;
13617
13265
  margin: 0 auto;
13618
- ${scrollableStyles$7}
13266
+ ${scrollableStyles$8}
13619
13267
  `;
13620
13268
  const ModalHeader = styled.div`
13621
13269
  display: flex;
@@ -13624,7 +13272,7 @@ const ModalHeader = styled.div`
13624
13272
  margin-bottom: 32px;
13625
13273
  `;
13626
13274
  const ModalBody = styled.div`
13627
- ${scrollableStyles$7}
13275
+ ${scrollableStyles$8}
13628
13276
  max-height: 80vh;
13629
13277
  `;
13630
13278
  const ModalTitle = styled.h5`
@@ -23879,7 +23527,7 @@ const TheGiantCompanyIcon = _ref => {
23879
23527
  })));
23880
23528
  };
23881
23529
 
23882
- const MainContainer$1 = styled.div`
23530
+ const MainContainer$2 = styled.div`
23883
23531
  display: flex;
23884
23532
  position: relative;
23885
23533
  font-family: "Poppins", sans-serif;
@@ -24172,7 +23820,7 @@ const CollapseHeader = props => {
24172
23820
  } = viewCreativeContainerRef.current;
24173
23821
  return (offsetTop + 33).toString().concat("", "px");
24174
23822
  };
24175
- return /*#__PURE__*/React$1.createElement(MainContainer$1, {
23823
+ return /*#__PURE__*/React$1.createElement(MainContainer$2, {
24176
23824
  id: "CollapseHeader",
24177
23825
  className: className,
24178
23826
  height: height,
@@ -24446,7 +24094,7 @@ const ErrorMessage$1 = styled.div`
24446
24094
  color: red;
24447
24095
  margin-top: 5px;
24448
24096
  `;
24449
- const IconContainer$2 = styled.div`
24097
+ const IconContainer$3 = styled.div`
24450
24098
  padding: 2px;
24451
24099
  cursor: pointer;
24452
24100
  `;
@@ -24620,7 +24268,7 @@ const QuickFilterDropdownSingle = _ref => {
24620
24268
  width: "12px",
24621
24269
  height: "12px",
24622
24270
  fill: "#B1B1B1"
24623
- })), /*#__PURE__*/React$1.createElement(IconContainer$2, {
24271
+ })), /*#__PURE__*/React$1.createElement(IconContainer$3, {
24624
24272
  className: "IconContainer",
24625
24273
  onClick: handleOpenCloseMenuClick
24626
24274
  }, showOptions ? /*#__PURE__*/React$1.createElement(MenuItemUpIcon, {
@@ -24862,7 +24510,7 @@ const SelectedOptionItem = styled.div`
24862
24510
  padding: 4px 6px;
24863
24511
  font-size: 12px;
24864
24512
  `;
24865
- const IconContainer$1 = styled.div`
24513
+ const IconContainer$2 = styled.div`
24866
24514
  display: flex;
24867
24515
  padding: 2px;
24868
24516
  cursor: pointer;
@@ -25080,14 +24728,14 @@ const QuickFilterDropdownMultiSelection = _ref => {
25080
24728
  placeholder: isFocused ? placeHolder || 'Type to search...' : '',
25081
24729
  error: error,
25082
24730
  isFocused: isFocused
25083
- }) : ' '), selectedOptions.length > 0 && xIconShow && /*#__PURE__*/React$1.createElement(IconContainer$1, {
24731
+ }) : ' '), selectedOptions.length > 0 && xIconShow && /*#__PURE__*/React$1.createElement(IconContainer$2, {
25084
24732
  className: "IconContainer",
25085
24733
  onClick: handleClearClick
25086
24734
  }, /*#__PURE__*/React$1.createElement(CloseXIcon, {
25087
24735
  width: "12px",
25088
24736
  height: "12px",
25089
24737
  fill: "#B1B1B1"
25090
- })), /*#__PURE__*/React$1.createElement(IconContainer$1, {
24738
+ })), /*#__PURE__*/React$1.createElement(IconContainer$2, {
25091
24739
  className: "IconContainer",
25092
24740
  onClick: handleOpenCloseMenuClick
25093
24741
  }, showOptions ? /*#__PURE__*/React$1.createElement(MenuItemUpIcon, {
@@ -25115,7 +24763,7 @@ const QuickFilterDropdownMultiSelection = _ref => {
25115
24763
  key: option.value,
25116
24764
  onClick: () => toggleOption(option),
25117
24765
  selected: isDropdowned(option)
25118
- }, highlightText(option.label, inputValue), /*#__PURE__*/React$1.createElement(IconContainer$1, {
24766
+ }, highlightText(option.label, inputValue), /*#__PURE__*/React$1.createElement(IconContainer$2, {
25119
24767
  className: "IconContainer"
25120
24768
  }, selectedOptions.find(itemSelectedOptions => option.value === itemSelectedOptions.value) ? /*#__PURE__*/React$1.createElement(CheckBoxCheckedIcon, {
25121
24769
  width: "14px",
@@ -25298,6 +24946,24 @@ classnames.exports;
25298
24946
  var classnamesExports = classnames.exports;
25299
24947
  var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
25300
24948
 
24949
+ const ExportIcon = _ref => {
24950
+ let {
24951
+ width = '14',
24952
+ height = '15',
24953
+ color = '#212121'
24954
+ } = _ref;
24955
+ return /*#__PURE__*/React$1.createElement("svg", {
24956
+ width: width,
24957
+ height: height,
24958
+ viewBox: "0 0 14 15",
24959
+ fill: "none",
24960
+ xmlns: "http://www.w3.org/2000/svg"
24961
+ }, /*#__PURE__*/React$1.createElement("path", {
24962
+ 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",
24963
+ fill: color
24964
+ }));
24965
+ };
24966
+
25301
24967
  const UpArrowIcon = _ref => {
25302
24968
  let {
25303
24969
  width = '10',
@@ -25358,7 +25024,7 @@ const OneColumnContainerMainDiv = styled.div`
25358
25024
  box-sizing: border-box;
25359
25025
  }
25360
25026
  `;
25361
- const InfoTextContainer = styled.div`
25027
+ const InfoTextContainer$1 = styled.div`
25362
25028
  overflow: auto;
25363
25029
  padding: 20px;
25364
25030
  box-sizing: border-box;
@@ -25370,7 +25036,7 @@ const InfoTitleLabel = styled.div`
25370
25036
  font-size: 18px;
25371
25037
  line-height: 32px;
25372
25038
  `;
25373
- const InfoTextLabel = styled.div`
25039
+ const InfoTextLabel$1 = styled.div`
25374
25040
  color: black;
25375
25041
  font-size: 14px;
25376
25042
  line-height: 20px;
@@ -25383,7 +25049,7 @@ const ColumnTitle = styled.span`
25383
25049
  font-weight: 500;
25384
25050
  padding: 20px 20px 0;
25385
25051
  `;
25386
- const IconContainer = styled.div`
25052
+ const IconContainer$1 = styled.div`
25387
25053
  width: 20px;
25388
25054
  height: 20px;
25389
25055
  top: 10px;
@@ -25405,7 +25071,7 @@ const BannerContainer = styled.div`
25405
25071
  right: ${props => props.right};
25406
25072
  user-select: none;
25407
25073
  `;
25408
- const OutBanner$1 = styled.div`
25074
+ const OutBanner$2 = styled.div`
25409
25075
  display: flex;
25410
25076
  justify-content: flex-end;
25411
25077
  align-items: center;
@@ -25438,7 +25104,7 @@ const PercentOfChange = styled.div`
25438
25104
  align-items: baseline;
25439
25105
  justify-content: center;
25440
25106
  padding: 4px 8px;
25441
- background-color: ${props => props.isPercentDataPositive ? '#E8F5EB' : '#FFE9EB'};
25107
+ background-color: ${props => props.isPercentDataPositive > 0 ? '#E8F5EB' : props.isPercentDataPositive < 0 ? '#FFE9EB' : '#E3E4E5'}; /* Gray for 0 */
25442
25108
  color: #333333;
25443
25109
  border-radius: 12px 0px 12px 0px;
25444
25110
  font-size: 12px;
@@ -25518,7 +25184,6 @@ const OneColumnContainer = props => {
25518
25184
  useEffect(() => {
25519
25185
  setOffsetWidth(anotherRef?.current?.offsetWidth);
25520
25186
  }, [anotherRef]);
25521
- const isPercentDataPositive = PercentOfChangeData > 0;
25522
25187
  return /*#__PURE__*/React$1.createElement(StyledContainer, {
25523
25188
  className: classNames('OneColumnContainer', itemClass, overStyle, draggingStyle, children && droppedStyle, divStyle),
25524
25189
  width: width,
@@ -25543,37 +25208,37 @@ const OneColumnContainer = props => {
25543
25208
  }, columnTitle), !isLoading && showViewByBannerButton && !hover && /*#__PURE__*/React$1.createElement(BannerContainer, {
25544
25209
  className: "BannerContainer",
25545
25210
  right: disableInfo ? '20px' : '45px'
25546
- }, /*#__PURE__*/React$1.createElement(OutBanner$1, {
25211
+ }, /*#__PURE__*/React$1.createElement(OutBanner$2, {
25547
25212
  className: "OutBanner",
25548
25213
  onClick: () => onBannerClick({
25549
25214
  eventName: 'onBannerClick'
25550
25215
  })
25551
- }, /*#__PURE__*/React$1.createElement(ExportIcon, null), "By Banner")), !isLoading && !hover && children, !disableInfo && !isLoading && /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(IconContainer, {
25216
+ }, /*#__PURE__*/React$1.createElement(ExportIcon, null), "By Banner")), !isLoading && !hover && children, !disableInfo && !isLoading && /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(IconContainer$1, {
25552
25217
  className: "IconContainer",
25553
25218
  onMouseEnter: () => setHover(true),
25554
25219
  onMouseLeave: () => setHover(false)
25555
- }, /*#__PURE__*/React$1.createElement(InfoIcon, null)), hover && /*#__PURE__*/React$1.createElement(InfoTextContainer, {
25220
+ }, /*#__PURE__*/React$1.createElement(InfoIcon, null)), hover && /*#__PURE__*/React$1.createElement(InfoTextContainer$1, {
25556
25221
  className: "InfoTextContainer"
25557
25222
  }, infoTitle && /*#__PURE__*/React$1.createElement(InfoTitleLabel, {
25558
25223
  className: "InfoTitleLabel",
25559
25224
  dangerouslySetInnerHTML: {
25560
25225
  __html: infoTitle
25561
25226
  }
25562
- }), /*#__PURE__*/React$1.createElement(InfoTextLabel, {
25227
+ }), /*#__PURE__*/React$1.createElement(InfoTextLabel$1, {
25563
25228
  className: "InfoTextLabel",
25564
25229
  dangerouslySetInnerHTML: {
25565
25230
  __html: infoText
25566
25231
  }
25567
25232
  }))), isPercentOfChange && !isLoading && /*#__PURE__*/React$1.createElement(PercentOfChange, {
25568
25233
  className: "PercentOfChange",
25569
- isPercentDataPositive: isPercentDataPositive
25570
- }, isPercentDataPositive ? /*#__PURE__*/React$1.createElement(UpArrowIcon, {
25234
+ isPercentDataPositive: PercentOfChangeData
25235
+ }, PercentOfChangeData > 0 ? /*#__PURE__*/React$1.createElement(UpArrowIcon, {
25571
25236
  width: "11",
25572
25237
  height: "10"
25573
- }) : /*#__PURE__*/React$1.createElement(DownArrowIcon, {
25238
+ }) : PercentOfChangeData < 0 ? /*#__PURE__*/React$1.createElement(DownArrowIcon, {
25574
25239
  width: "11",
25575
25240
  height: "10"
25576
- }), `${Math.abs(PercentOfChangeData)}%`), isLoading && /*#__PURE__*/React$1.createElement(LoadingDiv, {
25241
+ }) : null, `${Math.abs(PercentOfChangeData)}%`), isLoading && /*#__PURE__*/React$1.createElement(LoadingDiv, {
25577
25242
  className: "loadingDiv"
25578
25243
  }, /*#__PURE__*/React$1.createElement(SkeletonTheme, {
25579
25244
  baseColor: "#EAEAEA"
@@ -25617,1335 +25282,1732 @@ OneColumnContainer.propTypes = {
25617
25282
  showBackgroundImage: PropTypes.bool,
25618
25283
  backgroundImageStyle: PropTypes.object
25619
25284
  };
25620
- OneColumnContainer.defaultProps = {
25621
- children: null,
25622
- display: 'block',
25623
- isLoading: '',
25624
- gridTemplateColumns: '',
25625
- itemClass: '',
25626
- divStyle: '',
25627
- overStyle: '',
25628
- draggingStyle: '',
25629
- droppedStyle: '',
25630
- width: '300px',
25631
- height: '300px',
25632
- overflow: 'hidden',
25633
- transparentBackground: false,
25634
- infoTitle: '',
25635
- infoText: '',
25636
- disableInfo: false,
25637
- showViewByBannerButton: false,
25638
- onBannerClick: () => {},
25639
- columnTitle: '',
25640
- isPercentOfChange: false,
25641
- PercentOfChangeData: 0,
25642
- backgroundImage: '',
25643
- showBackgroundImage: false,
25644
- backgroundImageStyle: {}
25285
+ OneColumnContainer.defaultProps = {
25286
+ children: null,
25287
+ display: 'block',
25288
+ isLoading: '',
25289
+ gridTemplateColumns: '',
25290
+ itemClass: '',
25291
+ divStyle: '',
25292
+ overStyle: '',
25293
+ draggingStyle: '',
25294
+ droppedStyle: '',
25295
+ width: '300px',
25296
+ height: '300px',
25297
+ overflow: 'hidden',
25298
+ transparentBackground: false,
25299
+ infoTitle: '',
25300
+ infoText: '',
25301
+ disableInfo: false,
25302
+ showViewByBannerButton: false,
25303
+ onBannerClick: () => {},
25304
+ columnTitle: '',
25305
+ isPercentOfChange: false,
25306
+ PercentOfChangeData: 0,
25307
+ backgroundImage: '',
25308
+ showBackgroundImage: false,
25309
+ backgroundImageStyle: {}
25310
+ };
25311
+
25312
+ const scrollableStyles$7 = `
25313
+ overflow-y: auto;
25314
+
25315
+ &::-webkit-scrollbar {
25316
+ width: 8px;
25317
+ }
25318
+
25319
+ &::-webkit-scrollbar-track {
25320
+ background: #E8E8E8;
25321
+ border-radius: 5px;
25322
+ }
25323
+
25324
+ &::-webkit-scrollbar-thumb {
25325
+ background: #D0D0D0;
25326
+ border-radius: 5px;
25327
+ }
25328
+ `;
25329
+ const ControlsContainer$7 = styled.div`
25330
+ position: relative;
25331
+ font-family: "Poppins", sans-serif;
25332
+ font-style: normal;
25333
+ font-weight: 500;
25334
+ font-size: 20px;
25335
+ color: ${props => props.textcolor};
25336
+ width: ${props => props.width};
25337
+ height: ${props => props.height};
25338
+ display: flex;
25339
+ align-items: center;
25340
+ @media (max-width: 1536px) {
25341
+ ${scrollableStyles$7}
25342
+ }
25343
+
25344
+ > * {
25345
+ box-sizing: border-box;
25346
+ }
25347
+ `;
25348
+ const Controls$6 = styled.div`
25349
+ display: flex;
25350
+ flex-direction: column;
25351
+ width: 100%;
25352
+ height: 100%;
25353
+ background: white;
25354
+ `;
25355
+ const TitleAndValueContainer$3 = styled.div`
25356
+ display: flex;
25357
+ flex-direction: column;
25358
+ `;
25359
+ const Title$c = styled.h4`
25360
+ font-weight: 400;
25361
+ font-size: 20px;
25362
+ margin: 0;
25363
+ @media (max-width: 1536px) {
25364
+ font-size: 14px;
25365
+ }
25366
+ @media (max-width: 1366px) {
25367
+ font-size: 10px;
25368
+ }
25369
+ `;
25370
+ const CurrencySignAndFormattedValueContainer$1 = styled.div`
25371
+ display: flex;
25372
+ align-items: center;
25373
+ gap: 16px;
25374
+ `;
25375
+ const CurrencySignOrPercent = styled.span`
25376
+ font-weight: 500;
25377
+ font-size: 16px;
25378
+ @media (max-width: 1536px) {
25379
+ font-size: 14px;
25380
+ }
25381
+ @media (max-width: 1366px) {
25382
+ font-size: 11px;
25383
+ }
25384
+ `;
25385
+ const FormattedValueText = styled.div`
25386
+ font-weight: 500;
25387
+ font-size: 40px;
25388
+ @media (max-width: 1536px) {
25389
+ font-size: 34px;
25390
+ }
25391
+ @media (max-width: 1366px) {
25392
+ font-size: 28px;
25393
+ }
25394
+ `;
25395
+
25396
+ const FormattedValue$3 = props => {
25397
+ const {
25398
+ className,
25399
+ title,
25400
+ subtitle,
25401
+ showTopValue,
25402
+ value,
25403
+ dotCut,
25404
+ currencySign,
25405
+ currencyType,
25406
+ width,
25407
+ height,
25408
+ textcolor,
25409
+ isPercent
25410
+ } = props;
25411
+ return /*#__PURE__*/React$1.createElement(ControlsContainer$7, {
25412
+ className: className || 'FormattedValue_ControlsContainer',
25413
+ height: height,
25414
+ width: width,
25415
+ textcolor: textcolor
25416
+ }, /*#__PURE__*/React$1.createElement(Controls$6, {
25417
+ className: "Controls",
25418
+ height: height,
25419
+ width: width
25420
+ }, /*#__PURE__*/React$1.createElement(TitleAndValueContainer$3, {
25421
+ className: "TitleAndValueContainer"
25422
+ }, title ? /*#__PURE__*/React$1.createElement(Title$c, {
25423
+ className: "Title",
25424
+ width: width
25425
+ }, title) : '', showTopValue && /*#__PURE__*/React$1.createElement(CurrencySignAndFormattedValueContainer$1, {
25426
+ className: "CurrencySignAndFormattedValueContainer"
25427
+ }, /*#__PURE__*/React$1.createElement(FormattedValueText, {
25428
+ className: "FormattedValueText",
25429
+ width: width
25430
+ }, /*#__PURE__*/React$1.createElement(CurrencySignOrPercent, {
25431
+ className: "CurrencySignOrPercent"
25432
+ }, currencySign ? getCurrencySign(currencyType, value) : ''), dotCut ? getFormattedValue(value && Math.abs(value) > 0 && value % 1 !== 0 ? value?.toFixed(2) : value) : getNumberWithCommas(value), dotCut ? getFormattedUnits(value) : '', /*#__PURE__*/React$1.createElement(CurrencySignOrPercent, {
25433
+ className: "CurrencySignOrPercent"
25434
+ }, isPercent ? '%' : ''))), subtitle ? /*#__PURE__*/React$1.createElement(Title$c, {
25435
+ className: "Title",
25436
+ width: width
25437
+ }, subtitle) : '')));
25438
+ };
25439
+ FormattedValue$3.propTypes = {
25440
+ className: PropTypes.string,
25441
+ title: PropTypes.string,
25442
+ subtitle: PropTypes.string,
25443
+ showTopValue: PropTypes.bool,
25444
+ value: PropTypes.number,
25445
+ dotCut: PropTypes.bool,
25446
+ currencySign: PropTypes.bool,
25447
+ currencyType: PropTypes.string,
25448
+ width: PropTypes.string,
25449
+ height: PropTypes.string,
25450
+ textcolor: PropTypes.string,
25451
+ isPercent: PropTypes.bool
25452
+ };
25453
+ FormattedValue$3.defaultProps = {
25454
+ className: 'FormattedValue_ControlsContainer',
25455
+ title: '',
25456
+ subtitle: '',
25457
+ showTopValue: true,
25458
+ value: 0,
25459
+ dotCut: false,
25460
+ currencySign: false,
25461
+ currencyType: 'USD',
25462
+ width: '100%',
25463
+ height: '100%',
25464
+ textcolor: '#212121',
25465
+ isPercent: false
25645
25466
  };
25646
25467
 
25647
- const scrollableStyles$6 = `
25648
- overflow-y: auto;
25649
-
25650
- &::-webkit-scrollbar {
25651
- width: 8px;
25652
- }
25653
-
25654
- &::-webkit-scrollbar-track {
25655
- background: #E8E8E8;
25656
- border-radius: 5px;
25657
- }
25658
-
25659
- &::-webkit-scrollbar-thumb {
25660
- background: #D0D0D0;
25661
- border-radius: 5px;
25662
- }
25663
- `;
25664
- const ControlsContainer$7 = styled.div`
25468
+ const ControlsContainer$6 = styled.div`
25665
25469
  position: relative;
25666
25470
  font-family: "Poppins", sans-serif;
25667
- font-style: normal;
25668
- font-weight: 500;
25669
- font-size: 20px;
25670
- color: ${props => props.textcolor};
25471
+ color: #212121;
25671
25472
  width: ${props => props.width};
25672
25473
  height: ${props => props.height};
25474
+ min-width: 250px;
25475
+ `;
25476
+ const Controls$5 = styled.div`
25477
+ height: 100%;
25478
+ width: 100%;
25479
+ background: white;
25480
+ display: flex;
25481
+ flex-direction: column;
25482
+ `;
25483
+ const TooltipDiv$3 = styled.div`
25484
+ border-radius: 5px;
25485
+ padding: 8px 12px;
25486
+ background: white;
25487
+ box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);
25488
+ margin: 0;
25489
+ `;
25490
+ const TooltipLabel$3 = styled.div`
25491
+ color: #212121;
25492
+ font-size: 14px;
25493
+ font-weight: 400;
25494
+ width: fit-content;
25495
+ `;
25496
+ const TooltipTitle$3 = styled.div`
25497
+ color: #212121;
25498
+ font-size: 14px;
25499
+ font-weight: 600;
25500
+ `;
25501
+ const TitleAndValueContainer$2 = styled.div`
25502
+ padding: 0 1rem;
25503
+ `;
25504
+ const Title$b = styled.h5`
25505
+ font-weight: 500;
25506
+ font-size: 18px;
25507
+ line-height: 20px;
25508
+ margin: 0;
25509
+ @media (max-width: 1536px) {
25510
+ font-size: 16px;
25511
+ }
25512
+ @media (max-width: 1366px) {
25513
+ font-size: 14px;
25514
+ }
25515
+ `;
25516
+ const EventWeeksLegendMainContainer = styled.div`
25517
+ display: flex;
25518
+ justify-content: center;
25519
+ flex-direction: column;
25520
+ margin: 2px 0 0 0;
25521
+ padding-left: 55px;
25522
+ align-items: center;
25523
+ `;
25524
+ const EventWeeksLegendDataElementsContainer = styled.div`
25673
25525
  display: flex;
25526
+ margin: 0px;
25674
25527
  align-items: center;
25528
+ justify-content: space-around;
25529
+ width: 100%;
25530
+ `;
25531
+ const EventWeeksLegendDataElement = styled.h4`
25532
+ display: flex;
25533
+ font-weight: ${props => props.fontWeight};
25534
+ font-size: 12px;
25535
+ line-height: 15px;
25536
+ margin: 0;
25537
+ width: 100%;
25538
+ justify-content: center;
25539
+ align-content: center;
25540
+ color: ${props => props.textColor};
25541
+ border-top-left-radius: ${props => props.borderLeftRadius};
25542
+ border-bottom-left-radius: ${props => props.borderLeftRadius};
25543
+ border-top-right-radius: ${props => props.borderRightRadius};
25544
+ border-bottom-right-radius: ${props => props.borderRightRadius};
25545
+ background: ${props => props.color};
25675
25546
  @media (max-width: 1536px) {
25676
- ${scrollableStyles$6}
25547
+ font-size: 11px;
25548
+ }
25549
+ @media (max-width: 1366px) {
25550
+ font-size: 10px;
25677
25551
  }
25552
+ `;
25553
+ const LegendWrapper = styled.div`
25554
+ padding-top: 15px;
25555
+ `;
25556
+
25557
+ const LegendUnionIcon = _ref => {
25558
+ let {
25559
+ width = '18',
25560
+ height = '5',
25561
+ color = '#9CCB3B'
25562
+ } = _ref;
25563
+ return /*#__PURE__*/React$1.createElement("svg", {
25564
+ width: width,
25565
+ height: height,
25566
+ viewBox: "0 0 18 5",
25567
+ fill: "none",
25568
+ xmlns: "http://www.w3.org/2000/svg"
25569
+ }, /*#__PURE__*/React$1.createElement("path", {
25570
+ fillRule: "evenodd",
25571
+ clipRule: "evenodd",
25572
+ 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",
25573
+ fill: color
25574
+ }));
25575
+ };
25576
+
25577
+ const LegendLineIcon = _ref => {
25578
+ let {
25579
+ width = '19',
25580
+ height = '3',
25581
+ color = '#9CCB3B'
25582
+ } = _ref;
25583
+ return /*#__PURE__*/React$1.createElement("svg", {
25584
+ width: width,
25585
+ height: height,
25586
+ viewBox: "0 0 19 3",
25587
+ fill: "none",
25588
+ xmlns: "http://www.w3.org/2000/svg"
25589
+ }, /*#__PURE__*/React$1.createElement("path", {
25590
+ fillRule: "evenodd",
25591
+ clipRule: "evenodd",
25592
+ 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",
25593
+ fill: color
25594
+ }));
25595
+ };
25596
+
25597
+ const ControlsContainer$5 = styled.div`
25598
+ position: relative;
25599
+ font-family: "Poppins", sans-serif;
25600
+ font-size: ${props => props.rootFont};
25601
+ color: ${props => props.textColor};
25602
+ width: ${props => props.width};
25603
+ height: ${props => props.height};
25678
25604
 
25679
25605
  > * {
25680
25606
  box-sizing: border-box;
25681
25607
  }
25682
25608
  `;
25683
- const Controls$6 = styled.div`
25609
+ const Controls$4 = styled.div`
25684
25610
  display: flex;
25611
+ gap: 20px;
25685
25612
  flex-direction: column;
25686
25613
  width: 100%;
25687
25614
  height: 100%;
25688
- background: white;
25615
+ background: white;
25689
25616
  `;
25690
- const TitleAndValueContainer$3 = styled.div`
25617
+ const LegendDataContainer = styled.div`
25691
25618
  display: flex;
25692
- flex-direction: column;
25693
- `;
25694
- const Title$c = styled.h4`
25695
- font-weight: 400;
25696
- font-size: 20px;
25697
- margin: 0;
25619
+ justify-content: center;
25620
+ gap: 40px;
25621
+ margin-top: auto;
25698
25622
  @media (max-width: 1536px) {
25699
- font-size: 14px;
25623
+ gap: 38px;
25700
25624
  }
25701
25625
  @media (max-width: 1366px) {
25702
- font-size: 10px;
25626
+ gap: 30px;
25703
25627
  }
25704
25628
  `;
25705
- const CurrencySignAndFormattedValueContainer$1 = styled.div`
25629
+ const TitleAndIconContainer = styled.div`
25706
25630
  display: flex;
25707
25631
  align-items: center;
25708
- gap: 16px;
25709
25632
  `;
25710
- const CurrencySignOrPercent = styled.span`
25711
- font-weight: 500;
25712
- font-size: 16px;
25633
+ const Title$a = styled.h4`
25634
+ font-weight: 400;
25635
+ font-size: 14px;
25636
+ line-height: 27px;
25637
+ margin: 0 0 0 10px;
25713
25638
  @media (max-width: 1536px) {
25714
25639
  font-size: 14px;
25715
25640
  }
25716
25641
  @media (max-width: 1366px) {
25717
- font-size: 11px;
25642
+ font-size: 12px;
25718
25643
  }
25719
25644
  `;
25720
- const FormattedValueText = styled.div`
25721
- font-weight: 500;
25722
- font-size: 40px;
25723
- @media (max-width: 1536px) {
25724
- font-size: 34px;
25725
- }
25726
- @media (max-width: 1366px) {
25727
- font-size: 28px;
25728
- }
25645
+ const LegendColorRectangle$1 = styled.div`
25646
+ width: 0.875rem;
25647
+ min-width: 0.875rem;
25648
+ height: 0.875rem;
25649
+ border-radius: 2px;
25650
+ background: ${props => props.color};
25729
25651
  `;
25730
25652
 
25731
- const FormattedValue$2 = props => {
25653
+ /* eslint-disable no-nested-ternary */
25654
+ const ICON_TYPE_SQUARE$3 = 'Square';
25655
+ const ICON_TYPE_LEGEND_UNION_ICON$3 = 'LegendUnionIcon';
25656
+ const ICON_TYPE_LEGEND_LINE_ICON$2 = 'LegendLineIcon';
25657
+ const PerformanceAnalyticsLegend = props => {
25658
+ const {
25659
+ className = 'PerformanceAnalyticsLegend',
25660
+ width = '100%',
25661
+ height = '100%',
25662
+ legendData = [{
25663
+ title: '',
25664
+ iconType: ICON_TYPE_SQUARE$3,
25665
+ iconColor: '#1F7677'
25666
+ }]
25667
+ } = props;
25668
+ return /*#__PURE__*/React$1.createElement(ControlsContainer$5, {
25669
+ className: className,
25670
+ height: height,
25671
+ width: width
25672
+ }, legendData?.length > 0 ? /*#__PURE__*/React$1.createElement(Controls$4, {
25673
+ height: height,
25674
+ width: width
25675
+ }, /*#__PURE__*/React$1.createElement(LegendDataContainer, {
25676
+ id: "LegendDataContainer"
25677
+ }, legendData?.map((item, i) => /*#__PURE__*/React$1.createElement(TitleAndIconContainer, {
25678
+ key: `${item.title + i}`
25679
+ }, item.iconType === ICON_TYPE_SQUARE$3 ? /*#__PURE__*/React$1.createElement(LegendColorRectangle$1, {
25680
+ color: item.iconColor
25681
+ }) : item.iconType === ICON_TYPE_LEGEND_UNION_ICON$3 ? /*#__PURE__*/React$1.createElement(LegendUnionIcon, {
25682
+ width: 30,
25683
+ height: 30,
25684
+ color: item.iconColor
25685
+ }) : item.iconType === ICON_TYPE_LEGEND_LINE_ICON$2 ? /*#__PURE__*/React$1.createElement(LegendLineIcon, {
25686
+ color: item.iconColor
25687
+ }) : '', /*#__PURE__*/React$1.createElement(Title$a, {
25688
+ id: "Title",
25689
+ width: width
25690
+ }, item.title))))) : '');
25691
+ };
25692
+
25693
+ /* eslint-disable no-nested-ternary */
25694
+ const ICON_TYPE_SQUARE$2 = 'Square';
25695
+ const ICON_TYPE_LEGEND_UNION_ICON$2 = 'LegendUnionIcon';
25696
+ const ICON_TYPE_LEGEND_LINE_ICON$1 = 'LegendLineIcon';
25697
+ const BarChartsByWeeks = props => {
25732
25698
  const {
25733
25699
  className,
25734
25700
  title,
25735
- subtitle,
25736
- showTopValue,
25737
- value,
25738
- dotCut,
25739
- currencySign,
25740
- currencyType,
25701
+ showHeaderTopValue,
25702
+ headerValueTopTitle,
25703
+ headerValueBottomTitle,
25704
+ headerValue,
25705
+ HeaderValueCurrencyType,
25706
+ HeaderValueIsPercent,
25707
+ barChartData,
25708
+ isTitleOriganal,
25741
25709
  width,
25742
25710
  height,
25743
- textcolor,
25744
- isPercent
25711
+ barChartColor,
25712
+ barChartSecondColor,
25713
+ xselectedColor,
25714
+ tooltipTitle,
25715
+ tooltipSecondTitle,
25716
+ startWeekRange = 0,
25717
+ endWeekRange = 0,
25718
+ yAxisCounter,
25719
+ isPercentValue,
25720
+ interval,
25721
+ showTitle,
25722
+ showLegend,
25723
+ legendData,
25724
+ showTwoBars,
25725
+ setLimitHeight,
25726
+ setLimitLow
25745
25727
  } = props;
25746
- return /*#__PURE__*/React$1.createElement(ControlsContainer$7, {
25747
- className: className || 'FormattedValue_ControlsContainer',
25728
+
25729
+ // const [BarChartContainerWidth, setBarChartContainerWidth] = useState(0);
25730
+ // const [BarChartContainerHeight, setBarChartContainerHeight] = useState(0);
25731
+
25732
+ const controlsContainerRef = useRef();
25733
+
25734
+ // useEffect(() => {
25735
+ // const { offsetWidth } = controlsContainerRef.current;
25736
+ // setBarChartContainerWidth(offsetWidth - 20);
25737
+ // }, [width]);
25738
+
25739
+ // useEffect(() => {
25740
+ // const { offsetHeight } = controlsContainerRef.current;
25741
+ // setBarChartContainerHeight(offsetHeight - 40);
25742
+ // }, [height]);
25743
+
25744
+ const displayFormattedValue = value => {
25745
+ if (!value) return '';
25746
+ let formattedValue = '';
25747
+ formattedValue = isPercentValue ? ''.concat('', value.toFixed(1), '%') : ''.concat('', getFormattedValue(value), getFormattedUnits(value));
25748
+ return formattedValue;
25749
+ };
25750
+ const formmatedData = barChartData?.map(item => {
25751
+ if (setLimitHeight && item.value > setLimitHeight) {
25752
+ return {
25753
+ title: item.title,
25754
+ value: setLimitHeight,
25755
+ secondValue: item.secondValue
25756
+ };
25757
+ }
25758
+ if (setLimitLow && item.value < setLimitLow) {
25759
+ return {
25760
+ title: item.title,
25761
+ value: setLimitLow,
25762
+ secondValue: item.secondValue
25763
+ };
25764
+ }
25765
+ return {
25766
+ title: item.title,
25767
+ value: item.value,
25768
+ secondValue: item.secondValue
25769
+ };
25770
+ });
25771
+
25772
+ // eslint-disable-next-line react/no-unstable-nested-components
25773
+ const CustomTooltip = tooltipData => {
25774
+ const {
25775
+ active,
25776
+ payload,
25777
+ label
25778
+ } = tooltipData;
25779
+ if (!active || !payload || payload?.length === 0) return null;
25780
+ const week = isTitleOriganal ? label : label && label?.toString().length === 6 ? label.toString().substring(4, 6) : 0;
25781
+ let currentTooltipValue = 0;
25782
+ let currentTooltipSecondValue = 0;
25783
+ if (payload[0].payload?.value) currentTooltipValue = payload[0].payload?.value;
25784
+ if (payload[0].payload?.secondValue) currentTooltipSecondValue = payload[0].payload?.secondValue;
25785
+ return /*#__PURE__*/React$1.createElement(TooltipDiv$3, null, /*#__PURE__*/React$1.createElement(TooltipTitle$3, null, `${isTitleOriganal ? '' : 'Week: '}${week}`), /*#__PURE__*/React$1.createElement(TooltipLabel$3, null, `${tooltipTitle}
25786
+ ${displayFormattedValue(currentTooltipValue)}
25787
+ `), currentTooltipSecondValue ? /*#__PURE__*/React$1.createElement(TooltipLabel$3, null, `${tooltipSecondTitle}
25788
+ ${displayFormattedValue(currentTooltipSecondValue)}
25789
+ `) : '');
25790
+ };
25791
+ const getWeek = () => {
25792
+ if (!barChartData || barChartData?.length === 0) return null;
25793
+ const newFormattedData = barChartData?.map(item => ({
25794
+ ...item,
25795
+ titleWeek: item.title && isTitleOriganal ? item.title : item.title?.toString().length === 6 ? item.title.toString().substring(4, 6) : 0
25796
+ }));
25797
+ return newFormattedData;
25798
+ };
25799
+ const displayEventWeeksElements = () => {
25800
+ if (!barChartData || barChartData.length === 0) return '';
25801
+ return /*#__PURE__*/React$1.createElement(EventWeeksLegendDataElementsContainer, null, getWeek()?.map(item => /*#__PURE__*/React$1.createElement(EventWeeksLegendDataElement, {
25802
+ color: item.title >= startWeekRange && item.title <= endWeekRange ? xselectedColor : '',
25803
+ textColor: item.title >= startWeekRange && item.title <= endWeekRange ? '#212121' : '#B1B1B1',
25804
+ fontWeight: item.title >= startWeekRange && item.title <= endWeekRange ? 600 : 400,
25805
+ borderLeftRadius: startWeekRange && item?.title?.toString() === startWeekRange?.toString() ? '12px' : '0px',
25806
+ borderRightRadius: endWeekRange && item?.title?.toString() === endWeekRange?.toString() ? '12px' : '0px'
25807
+ }, item.titleWeek)));
25808
+ };
25809
+ const displayEventWeeksLegendData = () => /*#__PURE__*/React$1.createElement(EventWeeksLegendMainContainer, {
25810
+ className: "EventWeeksLegendMainContainer"
25811
+ }, displayEventWeeksElements());
25812
+ const getControlsHeight = () => {
25813
+ if (!controlsContainerRef?.current) return '100%';
25814
+ const {
25815
+ offsetHeight
25816
+ } = controlsContainerRef.current;
25817
+ let newHeight = offsetHeight - 20;
25818
+ if (title) {
25819
+ newHeight -= 20;
25820
+ }
25821
+ if (headerValueTopTitle) {
25822
+ newHeight -= 16;
25823
+ }
25824
+ if (headerValueBottomTitle) {
25825
+ newHeight -= 16;
25826
+ }
25827
+ if (headerValue) {
25828
+ newHeight -= 42;
25829
+ }
25830
+ if (showLegend) {
25831
+ newHeight -= 34;
25832
+ }
25833
+ return `${newHeight}px`;
25834
+ };
25835
+ return /*#__PURE__*/React$1.createElement(ControlsContainer$6, {
25836
+ className: className,
25748
25837
  height: height,
25749
25838
  width: width,
25750
- textcolor: textcolor
25751
- }, /*#__PURE__*/React$1.createElement(Controls$6, {
25752
- className: "Controls",
25839
+ ref: controlsContainerRef
25840
+ }, /*#__PURE__*/React$1.createElement(Controls$5, {
25841
+ height: getControlsHeight()
25842
+ }, showTitle && /*#__PURE__*/React$1.createElement(TitleAndValueContainer$2, null, /*#__PURE__*/React$1.createElement(Title$b, null, title), /*#__PURE__*/React$1.createElement(FormattedValue$3, {
25843
+ title: headerValueTopTitle,
25844
+ subtitle: headerValueBottomTitle,
25845
+ showTopValue: showHeaderTopValue,
25846
+ value: headerValue,
25847
+ currencyType: HeaderValueCurrencyType,
25848
+ isPercent: HeaderValueIsPercent,
25849
+ dotCut: true
25850
+ })), /*#__PURE__*/React$1.createElement(ResponsiveContainer, {
25851
+ width: "100%",
25852
+ height: "100%"
25853
+ }, /*#__PURE__*/React$1.createElement(BarChart$1, {
25854
+ width: width,
25753
25855
  height: height,
25754
- width: width
25755
- }, /*#__PURE__*/React$1.createElement(TitleAndValueContainer$3, {
25756
- className: "TitleAndValueContainer"
25757
- }, title ? /*#__PURE__*/React$1.createElement(Title$c, {
25758
- className: "Title",
25759
- width: width
25760
- }, title) : '', showTopValue && /*#__PURE__*/React$1.createElement(CurrencySignAndFormattedValueContainer$1, {
25761
- className: "CurrencySignAndFormattedValueContainer"
25762
- }, /*#__PURE__*/React$1.createElement(FormattedValueText, {
25763
- className: "FormattedValueText",
25764
- width: width
25765
- }, /*#__PURE__*/React$1.createElement(CurrencySignOrPercent, {
25766
- className: "CurrencySignOrPercent"
25767
- }, currencySign ? getCurrencySign(currencyType, value) : ''), dotCut ? getFormattedValue(value && Math.abs(value) > 0 && value % 1 !== 0 ? value?.toFixed(2) : value) : getNumberWithCommas(value), dotCut ? getFormattedUnits(value) : '', /*#__PURE__*/React$1.createElement(CurrencySignOrPercent, {
25768
- className: "CurrencySignOrPercent"
25769
- }, isPercent ? '%' : ''))), subtitle ? /*#__PURE__*/React$1.createElement(Title$c, {
25770
- className: "Title",
25771
- width: width
25772
- }, subtitle) : '')));
25856
+ data: formmatedData,
25857
+ margin: {
25858
+ top: 20,
25859
+ right: 0,
25860
+ bottom: 0,
25861
+ left: -5
25862
+ }
25863
+ }, /*#__PURE__*/React$1.createElement(CartesianGrid, {
25864
+ strokeDasharray: "3 3",
25865
+ vertical: false
25866
+ }), /*#__PURE__*/React$1.createElement(XAxis, {
25867
+ dataKey: "title",
25868
+ tick: false,
25869
+ tickLine: false
25870
+ }), /*#__PURE__*/React$1.createElement(YAxis, {
25871
+ tickCount: yAxisCounter,
25872
+ interval: interval || 'preserveEnd',
25873
+ domain: [0, 'auto'],
25874
+ tick: {
25875
+ fill: '#B1B1B1'
25876
+ },
25877
+ axisLine: false,
25878
+ fontWeight: 400,
25879
+ fontSize: "12px",
25880
+ tickLine: false,
25881
+ tickFormatter: value => `${displayFormattedValue(value)}`
25882
+ }), /*#__PURE__*/React$1.createElement(Tooltip$2, {
25883
+ content: /*#__PURE__*/React$1.createElement(CustomTooltip, null)
25884
+ }), /*#__PURE__*/React$1.createElement(Tooltip$2, null), !showTwoBars ? /*#__PURE__*/React$1.createElement(Bar, {
25885
+ dataKey: "value",
25886
+ name: "title",
25887
+ maxBarSize: 30,
25888
+ radius: [4, 4, 0, 0],
25889
+ fill: barChartColor
25890
+ }) : /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(Bar, {
25891
+ dataKey: "value",
25892
+ name: "title",
25893
+ maxBarSize: 30,
25894
+ stackId: "a",
25895
+ fill: barChartColor
25896
+ }), /*#__PURE__*/React$1.createElement(Bar, {
25897
+ dataKey: "secondValue",
25898
+ name: "title",
25899
+ maxBarSize: 30,
25900
+ radius: [4, 4, 0, 0],
25901
+ stackId: "a",
25902
+ fill: barChartSecondColor
25903
+ })))), displayEventWeeksLegendData(), showLegend && /*#__PURE__*/React$1.createElement(LegendWrapper, null, /*#__PURE__*/React$1.createElement(PerformanceAnalyticsLegend, {
25904
+ legendData: legendData
25905
+ }))));
25773
25906
  };
25774
- FormattedValue$2.propTypes = {
25907
+ BarChartsByWeeks.propTypes = {
25775
25908
  className: PropTypes.string,
25776
25909
  title: PropTypes.string,
25777
- subtitle: PropTypes.string,
25778
- showTopValue: PropTypes.bool,
25779
- value: PropTypes.number,
25780
- dotCut: PropTypes.bool,
25781
- currencySign: PropTypes.bool,
25782
- currencyType: PropTypes.string,
25910
+ showHeaderTopValue: PropTypes.bool,
25911
+ headerValueTopTitle: PropTypes.string,
25912
+ headerValueBottomTitle: PropTypes.string,
25913
+ headerValue: PropTypes.number,
25914
+ HeaderValueCurrencyType: PropTypes.string,
25915
+ HeaderValueIsPercent: PropTypes.bool,
25916
+ barChartData: PropTypes.arrayOf(PropTypes.shape({
25917
+ title: PropTypes.string,
25918
+ value: PropTypes.number
25919
+ })),
25920
+ isTitleOriganal: PropTypes.bool,
25783
25921
  width: PropTypes.string,
25784
25922
  height: PropTypes.string,
25785
- textcolor: PropTypes.string,
25786
- isPercent: PropTypes.bool
25923
+ barChartColor: PropTypes.string,
25924
+ barChartSecondColor: PropTypes.string,
25925
+ xselectedColor: PropTypes.string,
25926
+ startWeekRange: PropTypes.string,
25927
+ endWeekRange: PropTypes.string,
25928
+ tooltipTitle: PropTypes.string,
25929
+ tooltipSecondTitle: PropTypes.string,
25930
+ yAxisCounter: PropTypes.number,
25931
+ isPercentValue: PropTypes.bool,
25932
+ interval: PropTypes.string,
25933
+ showTitle: PropTypes.bool,
25934
+ showLegend: PropTypes.bool,
25935
+ legendData: PropTypes.arrayOf(PropTypes.shape({
25936
+ title: PropTypes.string.isRequired,
25937
+ iconType: PropTypes.oneOf([ICON_TYPE_SQUARE$2, ICON_TYPE_LEGEND_UNION_ICON$2, ICON_TYPE_LEGEND_LINE_ICON$1]).isRequired,
25938
+ iconColor: PropTypes.string.isRequired
25939
+ })),
25940
+ showTwoBars: PropTypes.bool,
25941
+ setLimitHeight: PropTypes.number,
25942
+ setLimitLow: PropTypes.number
25787
25943
  };
25788
- FormattedValue$2.defaultProps = {
25789
- className: 'FormattedValue_ControlsContainer',
25944
+ BarChartsByWeeks.defaultProps = {
25945
+ className: '',
25790
25946
  title: '',
25791
- subtitle: '',
25792
- showTopValue: true,
25793
- value: 0,
25794
- dotCut: false,
25795
- currencySign: false,
25796
- currencyType: 'USD',
25947
+ showHeaderTopValue: true,
25948
+ headerValueTopTitle: '',
25949
+ headerValueBottomTitle: '',
25950
+ headerValue: 0,
25951
+ HeaderValueCurrencyType: '',
25952
+ HeaderValueIsPercent: false,
25953
+ barChartData: [{
25954
+ title: '202320',
25955
+ value: 542366
25956
+ }, {
25957
+ title: '202321',
25958
+ value: 699511
25959
+ }, {
25960
+ title: '202322',
25961
+ value: 403092
25962
+ }, {
25963
+ title: '202323',
25964
+ value: 396184
25965
+ }, {
25966
+ title: '202324',
25967
+ value: 415317
25968
+ }, {
25969
+ title: '202325',
25970
+ value: 568376
25971
+ }, {
25972
+ title: '202326',
25973
+ value: 1078121
25974
+ }, {
25975
+ title: '202327',
25976
+ value: 347930
25977
+ }, {
25978
+ title: '202328',
25979
+ value: 346258
25980
+ }, {
25981
+ title: '202329',
25982
+ value: 350184
25983
+ }],
25797
25984
  width: '100%',
25798
25985
  height: '100%',
25799
- textcolor: '#212121',
25800
- isPercent: false
25986
+ barChartColor: '#BD9EFF',
25987
+ barChartSecondColor: '#42977A',
25988
+ xselectedColor: '#42977A',
25989
+ tooltipTitle: 'Sales',
25990
+ tooltipSecondTitle: 'Sales 2',
25991
+ startWeekRange: 0,
25992
+ endWeekRange: 0,
25993
+ yAxisCounter: 10,
25994
+ isPercentValue: false,
25995
+ interval: 'preserveEnd',
25996
+ showTitle: true,
25997
+ showLegend: true,
25998
+ isTitleOriganal: false,
25999
+ legendData: [{
26000
+ title: 'Sales',
26001
+ iconType: ICON_TYPE_SQUARE$2,
26002
+ iconColor: '#90CE9C'
26003
+ }, {
26004
+ title: 'Category Average',
26005
+ iconType: ICON_TYPE_LEGEND_LINE_ICON$1,
26006
+ iconColor: '#C906FD'
26007
+ }],
26008
+ showTwoBars: false,
26009
+ setLimitHeight: null,
26010
+ setLimitLow: null
25801
26011
  };
25802
26012
 
25803
- const ControlsContainer$6 = styled.div`
25804
- position: relative;
25805
- font-family: "Poppins", sans-serif;
25806
- color: #212121;
25807
- width: ${props => props.width};
25808
- height: ${props => props.height};
25809
- min-width: 250px;
25810
- `;
25811
- const Controls$5 = styled.div`
25812
- height: 100%;
25813
- width: 100%;
25814
- background: white;
25815
- display: flex;
25816
- flex-direction: column;
25817
- `;
25818
- const TooltipDiv$3 = styled.div`
25819
- border-radius: 5px;
25820
- padding: 8px 12px;
25821
- background: white;
25822
- box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);
25823
- margin: 0;
25824
- `;
25825
- const TooltipLabel$3 = styled.div`
25826
- color: #212121;
25827
- font-size: 14px;
25828
- font-weight: 400;
25829
- width: fit-content;
25830
- `;
25831
- const TooltipTitle$3 = styled.div`
25832
- color: #212121;
25833
- font-size: 14px;
25834
- font-weight: 600;
25835
- `;
25836
- const TitleAndValueContainer$2 = styled.div`
25837
- padding: 0 1rem;
25838
- `;
25839
- const Title$b = styled.h5`
25840
- font-weight: 500;
25841
- font-size: 18px;
25842
- line-height: 20px;
25843
- margin: 0;
25844
- @media (max-width: 1536px) {
25845
- font-size: 16px;
25846
- }
25847
- @media (max-width: 1366px) {
25848
- font-size: 14px;
25849
- }
25850
- `;
25851
- const EventWeeksLegendMainContainer = styled.div`
25852
- display: flex;
25853
- justify-content: center;
25854
- flex-direction: column;
25855
- margin: 2px 0 0 0;
25856
- padding-left: 55px;
25857
- align-items: center;
25858
- `;
25859
- const EventWeeksLegendDataElementsContainer = styled.div`
25860
- display: flex;
25861
- margin: 0px;
25862
- align-items: center;
25863
- justify-content: space-around;
25864
- width: 100%;
25865
- `;
25866
- const EventWeeksLegendDataElement = styled.h4`
25867
- display: flex;
25868
- font-weight: ${props => props.fontWeight};
25869
- font-size: 12px;
25870
- line-height: 15px;
25871
- margin: 0;
25872
- width: 100%;
25873
- justify-content: center;
25874
- align-content: center;
25875
- color: ${props => props.textColor};
25876
- border-top-left-radius: ${props => props.borderLeftRadius};
25877
- border-bottom-left-radius: ${props => props.borderLeftRadius};
25878
- border-top-right-radius: ${props => props.borderRightRadius};
25879
- border-bottom-right-radius: ${props => props.borderRightRadius};
25880
- background: ${props => props.color};
25881
- @media (max-width: 1536px) {
25882
- font-size: 11px;
25883
- }
25884
- @media (max-width: 1366px) {
25885
- font-size: 10px;
25886
- }
25887
- `;
25888
- const LegendWrapper = styled.div`
25889
- padding-top: 15px;
25890
- `;
26013
+ const scrollableStyles$6 = `
26014
+ overflow-y: auto;
25891
26015
 
25892
- const LegendUnionIcon = _ref => {
25893
- let {
25894
- width = '18',
25895
- height = '5',
25896
- color = '#9CCB3B'
25897
- } = _ref;
25898
- return /*#__PURE__*/React$1.createElement("svg", {
25899
- width: width,
25900
- height: height,
25901
- viewBox: "0 0 18 5",
25902
- fill: "none",
25903
- xmlns: "http://www.w3.org/2000/svg"
25904
- }, /*#__PURE__*/React$1.createElement("path", {
25905
- fillRule: "evenodd",
25906
- clipRule: "evenodd",
25907
- 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",
25908
- fill: color
25909
- }));
25910
- };
26016
+ &::-webkit-scrollbar {
26017
+ width: 0.5em; /* 8px → 0.5em */
26018
+ }
25911
26019
 
25912
- const LegendLineIcon = _ref => {
25913
- let {
25914
- width = '19',
25915
- height = '3',
25916
- color = '#9CCB3B'
25917
- } = _ref;
25918
- return /*#__PURE__*/React$1.createElement("svg", {
25919
- width: width,
25920
- height: height,
25921
- viewBox: "0 0 19 3",
25922
- fill: "none",
25923
- xmlns: "http://www.w3.org/2000/svg"
25924
- }, /*#__PURE__*/React$1.createElement("path", {
25925
- fillRule: "evenodd",
25926
- clipRule: "evenodd",
25927
- 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",
25928
- fill: color
25929
- }));
25930
- };
26020
+ &::-webkit-scrollbar-track {
26021
+ background: #E8E8E8;
26022
+ }
25931
26023
 
25932
- const ControlsContainer$5 = styled.div`
26024
+ &::-webkit-scrollbar-thumb {
26025
+ background: #D0D0D0;
26026
+ }
26027
+ `;
26028
+ const ControlsContainer$4 = styled.div`
25933
26029
  position: relative;
25934
26030
  font-family: "Poppins", sans-serif;
25935
- font-size: ${props => props.rootFont};
26031
+ font-size: ${props => props.rootFont || '1em'}; /* Base font size */
25936
26032
  color: ${props => props.textColor};
25937
26033
  width: ${props => props.width};
25938
26034
  height: ${props => props.height};
26035
+ padding: ${props => props.containerPadding || '0'};
26036
+ display: flex;
26037
+ align-items: center;
26038
+ @media (max-width: 1536px) {
26039
+ ${scrollableStyles$6}
26040
+ }
25939
26041
 
25940
26042
  > * {
25941
26043
  box-sizing: border-box;
25942
26044
  }
25943
26045
  `;
25944
- const Controls$4 = styled.div`
26046
+ const Controls$3 = styled.div`
25945
26047
  display: flex;
25946
- gap: 20px;
25947
26048
  flex-direction: column;
25948
26049
  width: 100%;
25949
26050
  height: 100%;
25950
26051
  background: white;
26052
+ border-radius: 12px;
25951
26053
  `;
25952
- const LegendDataContainer = styled.div`
26054
+ const TooltipDiv$2 = styled.div`
25953
26055
  display: flex;
25954
- justify-content: center;
25955
- gap: 40px;
25956
- margin-top: auto;
26056
+ background: white;
26057
+ padding: 0.375em 0.625em; /* 6px 10px → 0.375em 0.625em */
26058
+ margin: 0;
26059
+ `;
26060
+ const TooltipLabel$2 = styled.p`
26061
+ color: #212121;
26062
+ font-family: "Poppins", sans-serif;
26063
+ font-size: 0.75em; /* 12px → 0.75em */
26064
+ font-weight: 400;
26065
+ font-style: normal;
26066
+ width: max-content;
26067
+ line-height: normal;
26068
+ margin: 0;
26069
+ `;
26070
+ const TitleAndValueContainer$1 = styled.div`
26071
+ display: flex;
26072
+ flex-direction: column;
26073
+ padding: 0 1.25em; /* 20px → 1.25em */
26074
+ `;
26075
+ const Title$9 = styled.h4`
26076
+ font-weight: 500;
26077
+ font-size: ${props => props.titleFontSize || '1.125em'}; /* Default: 18px → 1.125em */
26078
+ margin: 0;
25957
26079
  @media (max-width: 1536px) {
25958
- gap: 38px;
26080
+ font-size: 0.875em; /* 14px → 0.875em */
25959
26081
  }
25960
26082
  @media (max-width: 1366px) {
25961
- gap: 30px;
26083
+ font-size: 0.75em; /* 12px → 0.75em */
25962
26084
  }
25963
26085
  `;
25964
- const TitleAndIconContainer = styled.div`
26086
+ const CurrencySignAndFormattedValueContainer = styled.div`
25965
26087
  display: flex;
25966
26088
  align-items: center;
26089
+ gap: 0.3125em; /* 5px → 0.3125em */
26090
+ align-items: baseline;
25967
26091
  `;
25968
- const Title$a = styled.h4`
26092
+ const CurrencySign$1 = styled.span`
26093
+ font-weight: 500;
26094
+ font-size: 1em; /* 16px → 1em */
26095
+ @media (max-width: 1536px) {
26096
+ font-size: 0.875em; /* 14px → 0.875em */
26097
+ }
26098
+ @media (max-width: 1366px) {
26099
+ font-size: 0.6875em; /* 11px → 0.6875em */
26100
+ }
26101
+ `;
26102
+ const FormattedValue$2 = styled.div`
26103
+ font-weight: 500;
26104
+ font-size: ${props => props.FormattedValueFontSize || '2.5em'}; /* Default: 40px → 2.5em */
26105
+ @media (max-width: 1536px) {
26106
+ font-size: 1.5em; /* 24px → 1.5em */
26107
+ }
26108
+ @media (max-width: 1366px) {
26109
+ font-size: 1.25em; /* 20px → 1.25em */
26110
+ }
26111
+ `;
26112
+ const TextAfterValue = styled.div`
25969
26113
  font-weight: 400;
25970
- font-size: 14px;
25971
- line-height: 27px;
25972
- margin: 0 0 0 10px;
26114
+ font-size: 0.75em; /* 12px → 0.75em */
25973
26115
  @media (max-width: 1536px) {
25974
- font-size: 14px;
26116
+ font-size: 0.6875em; /* 11px → 0.6875em */
25975
26117
  }
25976
26118
  @media (max-width: 1366px) {
25977
- font-size: 12px;
26119
+ font-size: 0.625em; /* 10px → 0.625em */
25978
26120
  }
25979
26121
  `;
25980
- const LegendColorRectangle$1 = styled.div`
26122
+ const DoughnutChartAndLegendContainer = styled.div`
26123
+ display: flex;
26124
+ flex-direction: ${props => props.legendBelow ? 'column' : 'row'};
26125
+ gap: 0.75em; /* 12px → 0.75em */
26126
+ justify-content: space-between;
26127
+ margin-top: auto;
26128
+ padding: 0 1.25em; /* 20px → 1.25em */
26129
+ margin-bottom: 1.25em; /* 20px → 1.25em */
26130
+ `;
26131
+ const DoughnutChartContainer = styled.div`
26132
+ display: flex;
26133
+ align-items: center;
26134
+ min-width: 90px;
26135
+ min-height: 90px;
26136
+ `;
26137
+ const LegendContainer$2 = styled.div`
26138
+ padding-left: 0.625em; /* 10px → 0.625em */
26139
+ display: flex;
26140
+ flex-direction: column;
26141
+ justify-content: space-evenly;
26142
+ `;
26143
+ const LegendControlsContainer = styled.div`
26144
+ display: flex;
26145
+ gap: 0.5em; /* 8px → 0.5em */
26146
+ align-items: center;
26147
+ margin-bottom: 0.375em; /* 6px → 0.375em */
26148
+ `;
26149
+ const LegendTitleAndFormatedValueContainer = styled.div`
26150
+ flex-grow: 1;
26151
+ `;
26152
+ styled.div`
26153
+ font-size: 0.875rem;
26154
+ `;
26155
+ const LegendColorRectangle = styled.div`
25981
26156
  width: 0.875rem;
25982
26157
  min-width: 0.875rem;
25983
26158
  height: 0.875rem;
25984
26159
  border-radius: 2px;
25985
26160
  background: ${props => props.color};
25986
26161
  `;
26162
+ const LegendTitle = styled.h5`
26163
+ font-weight: 400;
26164
+ font-size: 1em; /* 16px → 1em */
26165
+ gap: 0.3125em; /* 5px → 0.3125em */
26166
+ margin: 0;
26167
+ display: flex;
26168
+ justify-content: space-between;
26169
+ @media (max-width: 1536px) {
26170
+ font-size: 0.75em; /* 11px → 0.6875em */
26171
+ }
26172
+ @media (max-width: 1366px) {
26173
+ font-size: 0.625em; /* 10px → 0.625em */
26174
+ }
26175
+ `;
26176
+ const LegendFormattedValue = styled.span`
26177
+ font-weight: 500;
26178
+ font-size: 0.875em; /* 14px → 0.875em */
26179
+ white-space: nowrap;
26180
+ `;
25987
26181
 
25988
- /* eslint-disable no-nested-ternary */
25989
- const ICON_TYPE_SQUARE$3 = 'Square';
25990
- const ICON_TYPE_LEGEND_UNION_ICON$3 = 'LegendUnionIcon';
25991
- const ICON_TYPE_LEGEND_LINE_ICON$2 = 'LegendLineIcon';
25992
- const PerformanceAnalyticsLegend = props => {
25993
- const {
25994
- className = 'PerformanceAnalyticsLegend',
25995
- width = '100%',
25996
- height = '100%',
25997
- legendData = [{
25998
- title: '',
25999
- iconType: ICON_TYPE_SQUARE$3,
26000
- iconColor: '#1F7677'
26001
- }]
26002
- } = props;
26003
- return /*#__PURE__*/React$1.createElement(ControlsContainer$5, {
26004
- className: className,
26005
- height: height,
26006
- width: width
26007
- }, legendData?.length > 0 ? /*#__PURE__*/React$1.createElement(Controls$4, {
26008
- height: height,
26009
- width: width
26010
- }, /*#__PURE__*/React$1.createElement(LegendDataContainer, {
26011
- id: "LegendDataContainer"
26012
- }, legendData?.map((item, i) => /*#__PURE__*/React$1.createElement(TitleAndIconContainer, {
26013
- key: `${item.title + i}`
26014
- }, item.iconType === ICON_TYPE_SQUARE$3 ? /*#__PURE__*/React$1.createElement(LegendColorRectangle$1, {
26015
- color: item.iconColor
26016
- }) : item.iconType === ICON_TYPE_LEGEND_UNION_ICON$3 ? /*#__PURE__*/React$1.createElement(LegendUnionIcon, {
26017
- width: 30,
26018
- height: 30,
26019
- color: item.iconColor
26020
- }) : item.iconType === ICON_TYPE_LEGEND_LINE_ICON$2 ? /*#__PURE__*/React$1.createElement(LegendLineIcon, {
26021
- color: item.iconColor
26022
- }) : '', /*#__PURE__*/React$1.createElement(Title$a, {
26023
- id: "Title",
26024
- width: width
26025
- }, item.title))))) : '');
26026
- };
26027
-
26028
- /* eslint-disable no-nested-ternary */
26029
- const ICON_TYPE_SQUARE$2 = 'Square';
26030
- const ICON_TYPE_LEGEND_UNION_ICON$2 = 'LegendUnionIcon';
26031
- const ICON_TYPE_LEGEND_LINE_ICON$1 = 'LegendLineIcon';
26032
- const BarChartsByWeeks = props => {
26182
+ const TotalDoughnutChart = props => {
26033
26183
  const {
26034
26184
  className,
26035
- title,
26036
- showHeaderTopValue,
26037
- headerValueTopTitle,
26038
- headerValueBottomTitle,
26039
- headerValue,
26040
- HeaderValueCurrencyType,
26041
- HeaderValueIsPercent,
26042
- barChartData,
26043
- isTitleOriganal,
26044
26185
  width,
26045
26186
  height,
26046
- barChartColor,
26047
- barChartSecondColor,
26048
- xselectedColor,
26049
- tooltipTitle,
26050
- tooltipSecondTitle,
26051
- startWeekRange = 0,
26052
- endWeekRange = 0,
26053
- yAxisCounter,
26054
- isPercentValue,
26055
- interval,
26056
- showTitle,
26057
- showLegend,
26187
+ title,
26188
+ value,
26189
+ rootFont,
26190
+ containerPadding,
26191
+ addingBenchmark,
26192
+ dotCut,
26193
+ currencySign,
26194
+ currencyType,
26058
26195
  legendData,
26059
- showTwoBars,
26060
- setLimitHeight,
26061
- setLimitLow
26062
- } = props;
26063
-
26064
- // const [BarChartContainerWidth, setBarChartContainerWidth] = useState(0);
26065
- // const [BarChartContainerHeight, setBarChartContainerHeight] = useState(0);
26066
-
26067
- const controlsContainerRef = useRef();
26068
-
26069
- // useEffect(() => {
26070
- // const { offsetWidth } = controlsContainerRef.current;
26071
- // setBarChartContainerWidth(offsetWidth - 20);
26072
- // }, [width]);
26073
-
26074
- // useEffect(() => {
26075
- // const { offsetHeight } = controlsContainerRef.current;
26076
- // setBarChartContainerHeight(offsetHeight - 40);
26077
- // }, [height]);
26078
-
26079
- const displayFormattedValue = value => {
26080
- if (!value) return '';
26081
- let formattedValue = '';
26082
- formattedValue = isPercentValue ? ''.concat('', value.toFixed(1), '%') : ''.concat('', getFormattedValue(value), getFormattedUnits(value));
26083
- return formattedValue;
26084
- };
26085
- const formmatedData = barChartData?.map(item => {
26086
- if (setLimitHeight && item.value > setLimitHeight) {
26087
- return {
26088
- title: item.title,
26089
- value: setLimitHeight,
26090
- secondValue: item.secondValue
26091
- };
26092
- }
26093
- if (setLimitLow && item.value < setLimitLow) {
26094
- return {
26095
- title: item.title,
26096
- value: setLimitLow,
26097
- secondValue: item.secondValue
26098
- };
26196
+ legendBelow,
26197
+ itemsPercentagesValueAside,
26198
+ itemsBoldedValues,
26199
+ itemsValuesSeparateLine,
26200
+ textcolor,
26201
+ titleFontSize,
26202
+ FormattedValueFontSize,
26203
+ isPercent,
26204
+ hideTitleAndValue,
26205
+ noDataText,
26206
+ textAfterValue
26207
+ } = props;
26208
+ const [DoughnutChartRadius, setDoughnutChartRadius] = useState(0);
26209
+ const [zoomResolution, setZoomResolution] = useState(1);
26210
+ const DoughnutChartContainerRef = useRef();
26211
+ const dotCutTrenty = row => {
26212
+ if (!row || !row.value) return null;
26213
+ let valueNew = 0;
26214
+ if (row?.value && Math.abs(row.value) > 0 && row.value % 1 !== 0) {
26215
+ valueNew = row?.value?.toFixed(2);
26216
+ } else {
26217
+ valueNew = row?.value;
26099
26218
  }
26100
- return {
26101
- title: item.title,
26102
- value: item.value,
26103
- secondValue: item.secondValue
26219
+ return dotCut ? getFormattedValue(valueNew) : getNumberWithCommas(valueNew);
26220
+ };
26221
+ useEffect(() => {
26222
+ const handleResize = () => {
26223
+ setZoomResolution(window.devicePixelRatio);
26104
26224
  };
26105
- });
26106
26225
 
26107
- // eslint-disable-next-line react/no-unstable-nested-components
26108
- const CustomTooltip = tooltipData => {
26109
- const {
26110
- active,
26111
- payload,
26112
- label
26113
- } = tooltipData;
26114
- if (!active || !payload || payload?.length === 0) return null;
26115
- const week = isTitleOriganal ? label : label && label?.toString().length === 6 ? label.toString().substring(4, 6) : 0;
26116
- let currentTooltipValue = 0;
26117
- let currentTooltipSecondValue = 0;
26118
- if (payload[0].payload?.value) currentTooltipValue = payload[0].payload?.value;
26119
- if (payload[0].payload?.secondValue) currentTooltipSecondValue = payload[0].payload?.secondValue;
26120
- return /*#__PURE__*/React$1.createElement(TooltipDiv$3, null, /*#__PURE__*/React$1.createElement(TooltipTitle$3, null, `${isTitleOriganal ? '' : 'Week: '}${week}`), /*#__PURE__*/React$1.createElement(TooltipLabel$3, null, `${tooltipTitle}
26121
- ${displayFormattedValue(currentTooltipValue)}
26122
- `), currentTooltipSecondValue ? /*#__PURE__*/React$1.createElement(TooltipLabel$3, null, `${tooltipSecondTitle}
26123
- ${displayFormattedValue(currentTooltipSecondValue)}
26124
- `) : '');
26125
- };
26126
- const getWeek = () => {
26127
- if (!barChartData || barChartData?.length === 0) return null;
26128
- const newFormattedData = barChartData?.map(item => ({
26129
- ...item,
26130
- titleWeek: item.title && isTitleOriganal ? item.title : item.title?.toString().length === 6 ? item.title.toString().substring(4, 6) : 0
26131
- }));
26132
- return newFormattedData;
26133
- };
26134
- const displayEventWeeksElements = () => {
26135
- if (!barChartData || barChartData.length === 0) return '';
26136
- return /*#__PURE__*/React$1.createElement(EventWeeksLegendDataElementsContainer, null, getWeek()?.map(item => /*#__PURE__*/React$1.createElement(EventWeeksLegendDataElement, {
26137
- color: item.title >= startWeekRange && item.title <= endWeekRange ? xselectedColor : '',
26138
- textColor: item.title >= startWeekRange && item.title <= endWeekRange ? '#212121' : '#B1B1B1',
26139
- fontWeight: item.title >= startWeekRange && item.title <= endWeekRange ? 600 : 400,
26140
- borderLeftRadius: startWeekRange && item?.title?.toString() === startWeekRange?.toString() ? '12px' : '0px',
26141
- borderRightRadius: endWeekRange && item?.title?.toString() === endWeekRange?.toString() ? '12px' : '0px'
26142
- }, item.titleWeek)));
26143
- };
26144
- const displayEventWeeksLegendData = () => /*#__PURE__*/React$1.createElement(EventWeeksLegendMainContainer, {
26145
- className: "EventWeeksLegendMainContainer"
26146
- }, displayEventWeeksElements());
26147
- const getControlsHeight = () => {
26148
- if (!controlsContainerRef?.current) return '100%';
26226
+ // Add event listener for window resize to update zoom resolution
26227
+ window.addEventListener('resize', handleResize);
26228
+
26229
+ // Initial update of zoom resolution
26230
+ setZoomResolution(window.devicePixelRatio);
26231
+
26232
+ // Clean up the event listener when component unmounts
26233
+ return () => {
26234
+ window.removeEventListener('resize', handleResize);
26235
+ };
26236
+ }, []);
26237
+ useEffect(() => {
26238
+ const MIN_RADIUS = 45;
26239
+ if (!DoughnutChartContainerRef) return;
26149
26240
  const {
26150
- offsetHeight
26151
- } = controlsContainerRef.current;
26152
- let newHeight = offsetHeight - 20;
26153
- if (title) {
26154
- newHeight -= 20;
26155
- }
26156
- if (headerValueTopTitle) {
26157
- newHeight -= 16;
26158
- }
26159
- if (headerValueBottomTitle) {
26160
- newHeight -= 16;
26241
+ current
26242
+ } = DoughnutChartContainerRef;
26243
+ if (!current) return;
26244
+ const DoughnutChartContainerWidth = current?.clientWidth;
26245
+ const DoughnutChartContainerHeight = current?.clientHeight;
26246
+ const resolutionFactor = zoomResolution && zoomResolution >= 1 ? zoomResolution : 1;
26247
+ let radius = DoughnutChartContainerWidth > DoughnutChartContainerHeight ? DoughnutChartContainerHeight / 2 / resolutionFactor : DoughnutChartContainerWidth / 2 / resolutionFactor;
26248
+ if (radius < MIN_RADIUS) {
26249
+ radius = MIN_RADIUS;
26161
26250
  }
26162
- if (headerValue) {
26163
- newHeight -= 42;
26251
+ setDoughnutChartRadius(radius);
26252
+ }, [height, width, DoughnutChartContainerRef?.current?.clientWidth, DoughnutChartContainerRef?.current?.clientHeight, zoomResolution]);
26253
+ const displayLegendValue = row => /*#__PURE__*/React$1.createElement(LegendFormattedValue, {
26254
+ style: {
26255
+ fontWeight: itemsBoldedValues ? '700' : '500'
26164
26256
  }
26165
- if (showLegend) {
26166
- newHeight -= 34;
26257
+ }, !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$1.createElement("span", {
26258
+ style: {
26259
+ fontWeight: itemsBoldedValues ? '700' : '400'
26167
26260
  }
26168
- return `${newHeight}px`;
26169
- };
26170
- return /*#__PURE__*/React$1.createElement(ControlsContainer$6, {
26261
+ }, ' (', `${Math.round(row.value / value * 100)}%)`), isPercent && row.value && `${row.value.toFixed(1)}%`);
26262
+ return /*#__PURE__*/React$1.createElement(ControlsContainer$4, {
26171
26263
  className: className,
26172
26264
  height: height,
26173
26265
  width: width,
26174
- ref: controlsContainerRef
26175
- }, /*#__PURE__*/React$1.createElement(Controls$5, {
26176
- height: getControlsHeight()
26177
- }, showTitle && /*#__PURE__*/React$1.createElement(TitleAndValueContainer$2, null, /*#__PURE__*/React$1.createElement(Title$b, null, title), /*#__PURE__*/React$1.createElement(FormattedValue$2, {
26178
- title: headerValueTopTitle,
26179
- subtitle: headerValueBottomTitle,
26180
- showTopValue: showHeaderTopValue,
26181
- value: headerValue,
26182
- currencyType: HeaderValueCurrencyType,
26183
- isPercent: HeaderValueIsPercent,
26184
- dotCut: true
26185
- })), /*#__PURE__*/React$1.createElement(ResponsiveContainer, {
26186
- width: "100%",
26187
- height: "100%"
26188
- }, /*#__PURE__*/React$1.createElement(BarChart$1, {
26266
+ rootFont: rootFont,
26267
+ containerPadding: containerPadding,
26268
+ textcolor: textcolor
26269
+ }, legendData.length === 0 || legendData.every(item => item.value === undefined || item.value === null) ? /*#__PURE__*/React$1.createElement(NoDataFoundMessage, {
26270
+ className: "NoDataFoundMessage",
26271
+ noDataText: noDataText
26272
+ }) : /*#__PURE__*/React$1.createElement(Controls$3, {
26273
+ className: "Controls",
26274
+ height: height,
26275
+ width: width
26276
+ }, !hideTitleAndValue && /*#__PURE__*/React$1.createElement(TitleAndValueContainer$1, {
26277
+ className: "TitleAndValueContainer"
26278
+ }, /*#__PURE__*/React$1.createElement(Title$9, {
26279
+ className: "Title",
26280
+ fontSize: titleFontSize
26281
+ }, title), /*#__PURE__*/React$1.createElement(CurrencySignAndFormattedValueContainer, {
26282
+ className: "CurrencySignAndFormattedValueContainer"
26283
+ }, /*#__PURE__*/React$1.createElement(FormattedValue$2, {
26284
+ className: "FormattedValue",
26285
+ fontSize: FormattedValueFontSize,
26286
+ width: width
26287
+ }, /*#__PURE__*/React$1.createElement(CurrencySign$1, {
26288
+ className: "CurrencySign"
26289
+ }, 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$1.createElement(TextAfterValue, {
26290
+ className: "TextAfterValue"
26291
+ }, textAfterValue) : '', addingBenchmark && /*#__PURE__*/React$1.createElement(Benchmark, null))), /*#__PURE__*/React$1.createElement(DoughnutChartAndLegendContainer, {
26292
+ legendBelow: legendBelow
26293
+ }, /*#__PURE__*/React$1.createElement(DoughnutChartContainer, {
26189
26294
  width: width,
26190
26295
  height: height,
26191
- data: formmatedData,
26192
- margin: {
26193
- top: 20,
26194
- right: 0,
26195
- bottom: 0,
26196
- left: -5
26197
- }
26198
- }, /*#__PURE__*/React$1.createElement(CartesianGrid, {
26199
- strokeDasharray: "3 3",
26200
- vertical: false
26201
- }), /*#__PURE__*/React$1.createElement(XAxis, {
26202
- dataKey: "title",
26203
- tick: false,
26204
- tickLine: false
26205
- }), /*#__PURE__*/React$1.createElement(YAxis, {
26206
- tickCount: yAxisCounter,
26207
- interval: interval || 'preserveEnd',
26208
- domain: [0, 'auto'],
26209
- tick: {
26210
- fill: '#B1B1B1'
26211
- },
26212
- axisLine: false,
26213
- fontWeight: 400,
26214
- fontSize: "12px",
26215
- tickLine: false,
26216
- tickFormatter: value => `${displayFormattedValue(value)}`
26217
- }), /*#__PURE__*/React$1.createElement(Tooltip$2, {
26218
- content: /*#__PURE__*/React$1.createElement(CustomTooltip, null)
26219
- }), /*#__PURE__*/React$1.createElement(Tooltip$2, null), !showTwoBars ? /*#__PURE__*/React$1.createElement(Bar, {
26220
- dataKey: "value",
26221
- name: "title",
26222
- maxBarSize: 30,
26223
- radius: [4, 4, 0, 0],
26224
- fill: barChartColor
26225
- }) : /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(Bar, {
26296
+ ref: DoughnutChartContainerRef
26297
+ }, /*#__PURE__*/React$1.createElement(ResponsiveContainer, null, /*#__PURE__*/React$1.createElement(PieChart$1, null, /*#__PURE__*/React$1.createElement(Pie, {
26298
+ fill: "#8884d8",
26226
26299
  dataKey: "value",
26227
- name: "title",
26228
- maxBarSize: 30,
26229
- stackId: "a",
26230
- fill: barChartColor
26231
- }), /*#__PURE__*/React$1.createElement(Bar, {
26232
- dataKey: "secondValue",
26233
- name: "title",
26234
- maxBarSize: 30,
26235
- radius: [4, 4, 0, 0],
26236
- stackId: "a",
26237
- fill: barChartSecondColor
26238
- })))), displayEventWeeksLegendData(), showLegend && /*#__PURE__*/React$1.createElement(LegendWrapper, null, /*#__PURE__*/React$1.createElement(PerformanceAnalyticsLegend, {
26239
- legendData: legendData
26240
- }))));
26300
+ blendStroke: true,
26301
+ startAngle: -270,
26302
+ data: legendData,
26303
+ outerRadius: DoughnutChartRadius - 4,
26304
+ innerRadius: DoughnutChartRadius - DoughnutChartRadius / 3
26305
+ }, legendData.map(row => /*#__PURE__*/React$1.createElement(Cell, {
26306
+ key: `cell-${row.name}`,
26307
+ fill: row.color
26308
+ }))), /*#__PURE__*/React$1.createElement(Tooltip$2, {
26309
+ content: /*#__PURE__*/React$1.createElement(CustomTooltip, {
26310
+ value: value,
26311
+ isPercent: isPercent
26312
+ })
26313
+ }), /*#__PURE__*/React$1.createElement(Tooltip$2, null)))), /*#__PURE__*/React$1.createElement(LegendContainer$2, null, legendData.map(row => /*#__PURE__*/React$1.createElement(LegendControlsContainer, {
26314
+ key: row.name
26315
+ }, /*#__PURE__*/React$1.createElement(LegendColorRectangle, {
26316
+ color: row.color
26317
+ }), /*#__PURE__*/React$1.createElement(LegendTitleAndFormatedValueContainer, null, /*#__PURE__*/React$1.createElement(LegendTitle, {
26318
+ style: {
26319
+ flexDirection: itemsValuesSeparateLine ? 'column' : 'row',
26320
+ alignItems: itemsValuesSeparateLine ? 'baseline' : 'center'
26321
+ }
26322
+ }, row.name, displayLegendValue(row)))))))));
26241
26323
  };
26242
- BarChartsByWeeks.propTypes = {
26324
+ TotalDoughnutChart.propTypes = {
26243
26325
  className: PropTypes.string,
26244
26326
  title: PropTypes.string,
26245
- showHeaderTopValue: PropTypes.bool,
26246
- headerValueTopTitle: PropTypes.string,
26247
- headerValueBottomTitle: PropTypes.string,
26248
- headerValue: PropTypes.number,
26249
- HeaderValueCurrencyType: PropTypes.string,
26250
- HeaderValueIsPercent: PropTypes.bool,
26251
- barChartData: PropTypes.arrayOf(PropTypes.shape({
26252
- title: PropTypes.string,
26253
- value: PropTypes.number
26327
+ value: PropTypes.number,
26328
+ rootFont: PropTypes.string,
26329
+ containerPadding: PropTypes.string,
26330
+ addingBenchmark: PropTypes.bool,
26331
+ dotCut: PropTypes.bool,
26332
+ currencySign: PropTypes.bool,
26333
+ currencyType: PropTypes.string,
26334
+ legendData: PropTypes.arrayOf(PropTypes.shape({
26335
+ color: PropTypes.string,
26336
+ value: PropTypes.number,
26337
+ name: PropTypes.string
26254
26338
  })),
26255
- isTitleOriganal: PropTypes.bool,
26339
+ legendBelow: PropTypes.bool,
26340
+ itemsPercentagesValueAside: PropTypes.bool,
26341
+ itemsBoldedValues: PropTypes.bool,
26342
+ itemsValuesSeparateLine: PropTypes.bool,
26256
26343
  width: PropTypes.string,
26257
26344
  height: PropTypes.string,
26258
- barChartColor: PropTypes.string,
26259
- barChartSecondColor: PropTypes.string,
26260
- xselectedColor: PropTypes.string,
26261
- startWeekRange: PropTypes.string,
26262
- endWeekRange: PropTypes.string,
26263
- tooltipTitle: PropTypes.string,
26264
- tooltipSecondTitle: PropTypes.string,
26265
- yAxisCounter: PropTypes.number,
26266
- isPercentValue: PropTypes.bool,
26267
- interval: PropTypes.string,
26268
- showTitle: PropTypes.bool,
26269
- showLegend: PropTypes.bool,
26270
- legendData: PropTypes.arrayOf(PropTypes.shape({
26271
- title: PropTypes.string.isRequired,
26272
- iconType: PropTypes.oneOf([ICON_TYPE_SQUARE$2, ICON_TYPE_LEGEND_UNION_ICON$2, ICON_TYPE_LEGEND_LINE_ICON$1]).isRequired,
26273
- iconColor: PropTypes.string.isRequired
26274
- })),
26275
- showTwoBars: PropTypes.bool,
26276
- setLimitHeight: PropTypes.number,
26277
- setLimitLow: PropTypes.number
26345
+ textcolor: PropTypes.string,
26346
+ titleFontSize: PropTypes.string,
26347
+ FormattedValueFontSize: PropTypes.string,
26348
+ isPercent: PropTypes.bool,
26349
+ hideTitleAndValue: PropTypes.bool,
26350
+ noDataText: PropTypes.string,
26351
+ textAfterValue: PropTypes.string
26278
26352
  };
26279
- BarChartsByWeeks.defaultProps = {
26353
+ TotalDoughnutChart.defaultProps = {
26280
26354
  className: '',
26281
26355
  title: '',
26282
- showHeaderTopValue: true,
26283
- headerValueTopTitle: '',
26284
- headerValueBottomTitle: '',
26285
- headerValue: 0,
26286
- HeaderValueCurrencyType: '',
26287
- HeaderValueIsPercent: false,
26288
- barChartData: [{
26289
- title: '202320',
26290
- value: 542366
26291
- }, {
26292
- title: '202321',
26293
- value: 699511
26294
- }, {
26295
- title: '202322',
26296
- value: 403092
26297
- }, {
26298
- title: '202323',
26299
- value: 396184
26300
- }, {
26301
- title: '202324',
26302
- value: 415317
26303
- }, {
26304
- title: '202325',
26305
- value: 568376
26306
- }, {
26307
- title: '202326',
26308
- value: 1078121
26309
- }, {
26310
- title: '202327',
26311
- value: 347930
26312
- }, {
26313
- title: '202328',
26314
- value: 346258
26315
- }, {
26316
- title: '202329',
26317
- value: 350184
26318
- }],
26356
+ value: 0,
26357
+ rootFont: '18px',
26358
+ containerPadding: '0px',
26359
+ addingBenchmark: false,
26360
+ dotCut: false,
26361
+ currencySign: false,
26362
+ currencyType: 'USD',
26363
+ legendData: [],
26364
+ legendBelow: false,
26365
+ itemsPercentagesValueAside: true,
26366
+ itemsBoldedValues: true,
26367
+ itemsValuesSeparateLine: true,
26319
26368
  width: '100%',
26320
26369
  height: '100%',
26321
- barChartColor: '#BD9EFF',
26322
- barChartSecondColor: '#42977A',
26323
- xselectedColor: '#42977A',
26324
- tooltipTitle: 'Sales',
26325
- tooltipSecondTitle: 'Sales 2',
26326
- startWeekRange: 0,
26327
- endWeekRange: 0,
26328
- yAxisCounter: 10,
26329
- isPercentValue: false,
26330
- interval: 'preserveEnd',
26331
- showTitle: true,
26332
- showLegend: true,
26333
- isTitleOriganal: false,
26334
- legendData: [{
26335
- title: 'Sales',
26336
- iconType: ICON_TYPE_SQUARE$2,
26337
- iconColor: '#90CE9C'
26338
- }, {
26339
- title: 'Category Average',
26340
- iconType: ICON_TYPE_LEGEND_LINE_ICON$1,
26341
- iconColor: '#C906FD'
26342
- }],
26343
- showTwoBars: false,
26344
- setLimitHeight: null,
26345
- setLimitLow: null
26370
+ textcolor: '#212121',
26371
+ titleFontSize: '18px',
26372
+ FormattedValueFontSize: '40px',
26373
+ isPercent: false,
26374
+ hideTitleAndValue: false,
26375
+ noDataText: 'No Data',
26376
+ textAfterValue: ''
26377
+ };
26378
+ function CustomTooltip(_ref) {
26379
+ let {
26380
+ active,
26381
+ payload,
26382
+ value,
26383
+ isPercent = false
26384
+ } = _ref;
26385
+ if (active && payload && payload.length) {
26386
+ // eslint-disable-next-line no-nested-ternary
26387
+ const percent = value && value !== 0 && !isPercent ? (payload[0].value / value * 100).toFixed(1) : value && isPercent ? payload[0].value.toFixed(1) : 0;
26388
+ return /*#__PURE__*/React$1.createElement(TooltipDiv$2, null, /*#__PURE__*/React$1.createElement(TooltipLabel$2, null, `${payload[0].name} ${percent}%`));
26389
+ }
26390
+ }
26391
+ CustomTooltip.propTypes = {
26392
+ // eslint-disable-next-line react/forbid-prop-types
26393
+ active: PropTypes.any,
26394
+ // eslint-disable-next-line react/forbid-prop-types
26395
+ payload: PropTypes.any,
26396
+ // eslint-disable-next-line react/forbid-prop-types
26397
+ value: PropTypes.any,
26398
+ // eslint-disable-next-line react/forbid-prop-types
26399
+ isPercent: PropTypes.any
26400
+ };
26401
+ CustomTooltip.defaultProps = {
26402
+ active: '',
26403
+ payload: '',
26404
+ value: '',
26405
+ isPercent: false
26406
+ };
26407
+
26408
+ const TooltipContainer$2 = styled.div`
26409
+ --tooltip-text-color: black;
26410
+ --tooltip-background-color: white;
26411
+ --tooltip-margin: 40px;
26412
+ --tooltip-arrow-size: 10px;
26413
+ position: absolute;
26414
+ z-index: 999999;
26415
+ top: ${props => props.top};
26416
+ left: ${props => props.left};
26417
+ `;
26418
+ const TooltipWrapper = styled.div`
26419
+ display: inline-block;
26420
+ position: relative;
26421
+ `;
26422
+ const TooltipTip = styled.div`
26423
+ box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);
26424
+ position: absolute;
26425
+ border-radius: 4px;
26426
+ left: 50%;
26427
+ transform: translateX(-50%);
26428
+ padding: 8px 12px;
26429
+ color: var(--tooltip-text-color);
26430
+ background: var(--tooltip-background-color);
26431
+ font-size: 10px;
26432
+ z-index: 999;
26433
+ white-space: nowrap;
26434
+
26435
+ /* CSS border triangles */
26436
+ &.controls::before {
26437
+ content: " ";
26438
+ left: 50%;
26439
+ border: solid transparent;
26440
+ height: 0;
26441
+ width: 0;
26442
+ position: absolute;
26443
+ pointer-events: none;
26444
+ border-width: var(--tooltip-arrow-size);
26445
+ margin-left: calc(var(--tooltip-arrow-size) * -1);
26446
+ }
26447
+
26448
+ /* Absolute positioning */
26449
+ &.controls.top {
26450
+ top: calc(var(--tooltip-margin) * -1);
26451
+ }
26452
+
26453
+ /* CSS border triangles */
26454
+ &.controls.top::before {
26455
+ top: 100%;
26456
+ border-top-color: var(--tooltip-background-color);
26457
+ }
26458
+
26459
+ /* Absolute positioning */
26460
+ &.controls.right {
26461
+ left: calc(70% + var(--tooltip-margin));
26462
+ top: 50%;
26463
+ transform: translateX(0) translateY(-50%);
26464
+ }
26465
+
26466
+ /* CSS border triangles */
26467
+ &.controls.right::before {
26468
+ left: calc(var(--tooltip-arrow-size) * -1);
26469
+ top: 50%;
26470
+ transform: translateX(0) translateY(-50%);
26471
+ border-right-color: var(--tooltip-background-color);
26472
+ }
26473
+
26474
+ /* Absolute positioning */
26475
+ &.controls.bottom {
26476
+ bottom: calc(var(--tooltip-margin) * -1);
26477
+ }
26478
+ /* CSS border triangles */
26479
+ &.controls.bottom::before {
26480
+ bottom: 100%;
26481
+ border-bottom-color: var(--tooltip-background-color);
26482
+ }
26483
+
26484
+ /* Absolute positioning */
26485
+ &.controls.left {
26486
+ left: auto;
26487
+ right: calc(70% + var(--tooltip-margin));
26488
+ top: 50%;
26489
+ transform: translateX(0) translateY(-50%);
26490
+ }
26491
+ /* CSS border triangles */
26492
+ &.controls.left::before {
26493
+ left: auto;
26494
+ right: calc(var(--tooltip-arrow-size) * -2);
26495
+ top: 50%;
26496
+ transform: translateX(0) translateY(-50%);
26497
+ border-left-color: var(--tooltip-background-color);
26498
+ }
26499
+
26500
+ > ul {
26501
+ padding-left: 10px;
26502
+ margin: 0;
26503
+ }
26504
+ `;
26505
+
26506
+ const Tooltip = props => {
26507
+ const {
26508
+ className,
26509
+ top,
26510
+ left,
26511
+ direction,
26512
+ content
26513
+ } = props;
26514
+ return /*#__PURE__*/React$1.createElement(TooltipContainer$2, {
26515
+ className: className,
26516
+ top: `${top}px`,
26517
+ left: `${left}px`
26518
+ }, /*#__PURE__*/React$1.createElement(TooltipWrapper, null, /*#__PURE__*/React$1.createElement(TooltipTip, {
26519
+ className: `controls ${direction || 'top'}`
26520
+ }, content)));
26521
+ };
26522
+ Tooltip.propTypes = {
26523
+ className: PropTypes.string,
26524
+ top: PropTypes.number,
26525
+ left: PropTypes.number,
26526
+ direction: PropTypes.string,
26527
+ content: PropTypes.string
26528
+ };
26529
+ Tooltip.defaultProps = {
26530
+ className: '',
26531
+ top: 0,
26532
+ left: 0,
26533
+ direction: 'top',
26534
+ content: ''
26346
26535
  };
26347
26536
 
26348
- const scrollableStyles$5 = `
26349
- overflow-y: auto;
26537
+ const ControlsContainer$3 = styled.div`
26538
+ font-family: "Poppins", sans-serif;
26539
+ background-color: white;
26540
+ color: ${props => props.textColor};
26541
+ width: ${props => props.width};
26542
+ height: ${props => props.height};
26543
+ /* display: flex;
26544
+ flex-direction: column;
26545
+ overflow: hidden; */
26546
+ overflow-y: ${props => props.scroller};
26350
26547
 
26351
26548
  &::-webkit-scrollbar {
26352
- width: 0.5em; /* 8px → 0.5em */
26549
+ width: 8px;
26353
26550
  }
26354
26551
 
26355
26552
  &::-webkit-scrollbar-track {
26356
26553
  background: #E8E8E8;
26554
+ border-radius: 5px;
26357
26555
  }
26358
26556
 
26359
26557
  &::-webkit-scrollbar-thumb {
26360
26558
  background: #D0D0D0;
26559
+ border-radius: 5px;
26361
26560
  }
26362
26561
  `;
26363
- const ControlsContainer$4 = styled.div`
26364
- position: relative;
26365
- font-family: "Poppins", sans-serif;
26366
- font-size: ${props => props.rootFont || '1em'}; /* Base font size */
26367
- color: ${props => props.textColor};
26368
- width: ${props => props.width};
26369
- height: ${props => props.height};
26370
- padding: ${props => props.containerPadding || '0'};
26371
- display: flex;
26372
- align-items: center;
26373
- @media (max-width: 1536px) {
26374
- ${scrollableStyles$5}
26562
+ styled.div`
26563
+ overflow-y: auto;
26564
+ height: 100%;
26565
+
26566
+ &::-webkit-scrollbar {
26567
+ width: 8px;
26375
26568
  }
26376
26569
 
26377
- > * {
26378
- box-sizing: border-box;
26570
+ &::-webkit-scrollbar-track {
26571
+ background: #E8E8E8;
26572
+ border-radius: 5px;
26573
+ }
26574
+
26575
+ &::-webkit-scrollbar-thumb {
26576
+ background: #D0D0D0;
26577
+ border-radius: 5px;
26379
26578
  }
26380
26579
  `;
26381
- const Controls$3 = styled.div`
26382
- display: flex;
26383
- flex-direction: column;
26384
- width: 100%;
26385
- height: 100%;
26386
- background: white;
26387
- border-radius: 12px;
26388
- `;
26389
- const TooltipDiv$2 = styled.div`
26390
- display: flex;
26391
- background: white;
26392
- padding: 0.375em 0.625em; /* 6px 10px → 0.375em 0.625em */
26393
- margin: 0;
26394
- `;
26395
- const TooltipLabel$2 = styled.p`
26396
- color: #212121;
26397
- font-family: "Poppins", sans-serif;
26398
- font-size: 0.75em; /* 12px → 0.75em */
26399
- font-weight: 400;
26400
- font-style: normal;
26401
- width: max-content;
26402
- line-height: normal;
26403
- margin: 0;
26404
- `;
26405
- const TitleAndValueContainer$1 = styled.div`
26406
- display: flex;
26407
- flex-direction: column;
26408
- padding: 0 1.25em; /* 20px → 1.25em */
26580
+ const CardHeader = styled.div`
26581
+ padding: 16px;
26582
+ position: sticky;
26583
+ top: 0;
26584
+ z-index: 10;
26585
+ background-color: white;
26409
26586
  `;
26410
- const Title$9 = styled.h4`
26587
+ const TotalValue = styled.div`
26411
26588
  font-weight: 500;
26412
- font-size: ${props => props.titleFontSize || '1.125em'}; /* Default: 18px → 1.125em */
26413
- margin: 0;
26414
- @media (max-width: 1536px) {
26415
- font-size: 0.875em; /* 14px → 0.875em */
26416
- }
26417
- @media (max-width: 1366px) {
26418
- font-size: 0.75em; /* 12px → 0.75em */
26419
- }
26420
- `;
26421
- const CurrencySignAndFormattedValueContainer = styled.div`
26589
+ font-size: 40px;
26422
26590
  display: flex;
26423
- align-items: center;
26424
- gap: 0.3125em; /* 5px → 0.3125em */
26425
26591
  align-items: baseline;
26426
- `;
26427
- const CurrencySign$1 = styled.span`
26428
- font-weight: 500;
26429
- font-size: 1em; /* 16px → 1em */
26430
- @media (max-width: 1536px) {
26431
- font-size: 0.875em; /* 14px → 0.875em */
26432
- }
26433
- @media (max-width: 1366px) {
26434
- font-size: 0.6875em; /* 11px → 0.6875em */
26435
- }
26436
- `;
26437
- const FormattedValue$1 = styled.div`
26438
- font-weight: 500;
26439
- font-size: ${props => props.FormattedValueFontSize || '2.5em'}; /* Default: 40px → 2.5em */
26592
+ line-height: 1;
26440
26593
  @media (max-width: 1536px) {
26441
- font-size: 1.5em; /* 24px → 1.5em */
26594
+ font-size: 24px;
26442
26595
  }
26443
26596
  @media (max-width: 1366px) {
26444
- font-size: 1.25em; /* 20px → 1.25em */
26597
+ font-size: 20px;
26445
26598
  }
26446
26599
  `;
26447
- const TextAfterValue = styled.div`
26600
+ const Title$8 = styled.h4`
26601
+ font-size: 18px;
26448
26602
  font-weight: 400;
26449
- font-size: 0.75em; /* 12px → 0.75em */
26603
+ line-height: 1;
26604
+ margin: 0 0 8px;
26450
26605
  @media (max-width: 1536px) {
26451
- font-size: 0.6875em; /* 11px → 0.6875em */
26606
+ font-size: 14px;
26452
26607
  }
26453
26608
  @media (max-width: 1366px) {
26454
- font-size: 0.625em; /* 10px → 0.625em */
26609
+ font-size: 12px;
26455
26610
  }
26456
26611
  `;
26457
- const DoughnutChartAndLegendContainer = styled.div`
26458
- display: flex;
26459
- flex-direction: ${props => props.legendBelow ? 'column' : 'row'};
26460
- gap: 0.75em; /* 12px → 0.75em */
26461
- justify-content: space-between;
26462
- margin-top: auto;
26463
- padding: 0 1.25em; /* 20px → 1.25em */
26464
- margin-bottom: 1.25em; /* 20px → 1.25em */
26465
- `;
26466
- const DoughnutChartContainer = styled.div`
26467
- display: flex;
26468
- align-items: center;
26469
- min-width: 90px;
26470
- min-height: 90px;
26471
- `;
26472
- const LegendContainer$2 = styled.div`
26473
- padding-left: 0.625em; /* 10px → 0.625em */
26474
- display: flex;
26475
- flex-direction: column;
26476
- justify-content: space-evenly;
26477
- `;
26478
- const LegendControlsContainer = styled.div`
26479
- display: flex;
26480
- gap: 0.5em; /* 8px → 0.5em */
26481
- align-items: center;
26482
- margin-bottom: 0.375em; /* 6px → 0.375em */
26483
- `;
26484
- const LegendTitleAndFormatedValueContainer = styled.div`
26485
- flex-grow: 1;
26486
- `;
26487
- styled.div`
26488
- font-size: 0.875rem;
26489
- `;
26490
- const LegendColorRectangle = styled.div`
26491
- width: 0.875rem;
26492
- min-width: 0.875rem;
26493
- height: 0.875rem;
26494
- border-radius: 2px;
26495
- background: ${props => props.color};
26496
- `;
26497
- const LegendTitle = styled.h5`
26498
- font-weight: 400;
26499
- font-size: 1em; /* 16px → 1em */
26500
- gap: 0.3125em; /* 5px → 0.3125em */
26501
- margin: 0;
26502
- display: flex;
26503
- justify-content: space-between;
26612
+ const CurrencySign = styled.span`
26613
+ font-weight: 500;
26614
+ font-size: 16px;
26504
26615
  @media (max-width: 1536px) {
26505
- font-size: 0.75em; /* 11px → 0.6875em */
26616
+ font-size: 14px;
26506
26617
  }
26507
26618
  @media (max-width: 1366px) {
26508
- font-size: 0.625em; /* 10px → 0.625em */
26619
+ font-size: 11px;
26509
26620
  }
26510
26621
  `;
26511
- const LegendFormattedValue = styled.span`
26512
- font-weight: 500;
26513
- font-size: 0.875em; /* 14px → 0.875em */
26514
- white-space: nowrap;
26515
- `;
26516
26622
 
26517
- const TotalDoughnutChart = props => {
26623
+ /* eslint-disable no-unused-vars */
26624
+ const TotalHorizontalCharts = props => {
26518
26625
  const {
26519
- className,
26520
- width,
26521
- height,
26522
26626
  title,
26523
26627
  value,
26524
- rootFont,
26525
- containerPadding,
26526
- addingBenchmark,
26527
26628
  dotCut,
26528
26629
  currencySign,
26529
26630
  currencyType,
26530
- legendData,
26531
- legendBelow,
26532
- itemsPercentagesValueAside,
26533
- itemsBoldedValues,
26534
- itemsValuesSeparateLine,
26535
- textcolor,
26536
- titleFontSize,
26537
- FormattedValueFontSize,
26538
- isPercent,
26539
- hideTitleAndValue,
26631
+ chartsData,
26632
+ showScrollerBarsCount,
26633
+ labelFontSize,
26634
+ labelLimitedLetters,
26635
+ width,
26636
+ height,
26637
+ rightGap,
26638
+ textColor,
26540
26639
  noDataText,
26541
- textAfterValue
26542
- } = props;
26543
- const [DoughnutChartRadius, setDoughnutChartRadius] = useState(0);
26544
- const [zoomResolution, setZoomResolution] = useState(1);
26545
- const DoughnutChartContainerRef = useRef();
26546
- const dotCutTrenty = row => {
26547
- if (!row || !row.value) return null;
26548
- let valueNew = 0;
26549
- if (row?.value && Math.abs(row.value) > 0 && row.value % 1 !== 0) {
26550
- valueNew = row?.value?.toFixed(2);
26551
- } else {
26552
- valueNew = row?.value;
26553
- }
26554
- return dotCut ? getFormattedValue(valueNew) : getNumberWithCommas(valueNew);
26555
- };
26556
- useEffect(() => {
26557
- const handleResize = () => {
26558
- setZoomResolution(window.devicePixelRatio);
26559
- };
26640
+ showPercentAsideValue,
26641
+ isDollar,
26642
+ isPercentage,
26643
+ showDollarSign,
26644
+ className,
26645
+ hideTotalValue,
26646
+ hideTitle
26647
+ } = props;
26648
+ const barBackgrounds = chartsData.map(bg => bg.color);
26649
+ const topHeader = useRef();
26650
+ const wrapper = useRef();
26651
+ const BAR_HEIGHT = 40; // Height of each bar including padding
26652
+ const CHART_PADDING = 40; // Total padding for chart (top + bottom)
26560
26653
 
26561
- // Add event listener for window resize to update zoom resolution
26562
- window.addEventListener('resize', handleResize);
26654
+ // Inside the TotalHorizontalCharts component
26655
+ const calculateChartHeight = () => {
26656
+ if (!chartsData?.length) return 0;
26657
+ if (chartsData.length > showScrollerBarsCount) {
26658
+ return chartsData.length * BAR_HEIGHT + CHART_PADDING;
26659
+ }
26563
26660
 
26564
- // Initial update of zoom resolution
26565
- setZoomResolution(window.devicePixelRatio);
26661
+ // Calculate height to show only specified number of bars
26662
+ const visibleBarsHeight = showScrollerBarsCount * BAR_HEIGHT;
26566
26663
 
26567
- // Clean up the event listener when component unmounts
26568
- return () => {
26569
- window.removeEventListener('resize', handleResize);
26570
- };
26571
- }, []);
26572
- useEffect(() => {
26573
- const MIN_RADIUS = 45;
26574
- if (!DoughnutChartContainerRef) return;
26664
+ // Use the smaller value between:
26665
+ // 1. Height needed for all bars
26666
+ // 2. Height needed for specified number of bars
26667
+ return Math.min(chartsData.length * BAR_HEIGHT + CHART_PADDING, visibleBarsHeight + CHART_PADDING);
26668
+ };
26669
+ const [showLegendTooltip, setShowLegendTooltip] = useState(false);
26670
+ const [tooltipText, setTooltipText] = useState({
26671
+ content: '',
26672
+ clientX: 0,
26673
+ clientY: 0
26674
+ });
26675
+ const CustomizedLabel = props => showPercentAsideValue ? /*#__PURE__*/React$1.createElement("text", {
26676
+ x: props.x + (props.width <= 0 ? -12 : props.width) + 56,
26677
+ y: props.y + 4,
26678
+ dy: props.height / 2,
26679
+ dx: -8,
26680
+ fill: props.stroke,
26681
+ fontSize: 12,
26682
+ fontWeight: 500,
26683
+ textAnchor: "middle"
26684
+ }, ''.concat(getFormattedValue(props.value), getFormattedUnits(props.value)), /*#__PURE__*/React$1.createElement("tspan", {
26685
+ fontWeight: 400
26686
+ }, ` (${(props.value / value * 100).toFixed(0)}%)`)) : /*#__PURE__*/React$1.createElement("text", {
26687
+ x: props.x + (props.width <= 0 ? -12 : props.width) + 40,
26688
+ y: props.y + 4,
26689
+ dy: props.height / 2,
26690
+ dx: -8,
26691
+ fill: props.stroke,
26692
+ fontSize: 12,
26693
+ fontWeight: 400,
26694
+ textAnchor: "middle"
26695
+ }, !isDollar ? ''.concat(getFormattedValue(props.value), isPercentage ? '%' : getFormattedUnits(props.value)) : ''.concat(showDollarSign ? '$' : '', getFormattedValue(props.value), getFormattedUnits(props.value)));
26696
+ const CustomizedTickBarChart = props => {
26575
26697
  const {
26576
- current
26577
- } = DoughnutChartContainerRef;
26578
- if (!current) return;
26579
- const DoughnutChartContainerWidth = current?.clientWidth;
26580
- const DoughnutChartContainerHeight = current?.clientHeight;
26581
- const resolutionFactor = zoomResolution && zoomResolution >= 1 ? zoomResolution : 1;
26582
- let radius = DoughnutChartContainerWidth > DoughnutChartContainerHeight ? DoughnutChartContainerHeight / 2 / resolutionFactor : DoughnutChartContainerWidth / 2 / resolutionFactor;
26583
- if (radius < MIN_RADIUS) {
26584
- radius = MIN_RADIUS;
26585
- }
26586
- setDoughnutChartRadius(radius);
26587
- }, [height, width, DoughnutChartContainerRef?.current?.clientWidth, DoughnutChartContainerRef?.current?.clientHeight, zoomResolution]);
26588
- const displayLegendValue = row => /*#__PURE__*/React$1.createElement(LegendFormattedValue, {
26589
- style: {
26590
- fontWeight: itemsBoldedValues ? '700' : '500'
26591
- }
26592
- }, !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$1.createElement("span", {
26593
- style: {
26594
- fontWeight: itemsBoldedValues ? '700' : '400'
26698
+ x,
26699
+ y,
26700
+ height,
26701
+ payload,
26702
+ fill,
26703
+ orientation,
26704
+ stroke
26705
+ } = props;
26706
+ const handleMouseEnter = content => {
26707
+ setTooltipText(prevState => ({
26708
+ ...prevState,
26709
+ content: content !== prevState.content ? content : prevState.content,
26710
+ clientX: x / 1.2,
26711
+ clientY: y - 20
26712
+ }));
26713
+ setShowLegendTooltip(true);
26714
+ };
26715
+ const handleMouseLeave = () => {
26716
+ if (showLegendTooltip === false) return;
26717
+ setTimeout(() => {
26718
+ setShowLegendTooltip(false);
26719
+ }, 1200);
26720
+ };
26721
+ if (chartsData && chartsData.length > 0 && payload) {
26722
+ const chartsDataLabel = chartsData.filter(item => item.name === payload.value);
26723
+ if (chartsDataLabel && chartsDataLabel.length > 0) {
26724
+ return /*#__PURE__*/React$1.createElement("g", {
26725
+ onMouseEnter: () => handleMouseEnter(payload.value),
26726
+ onMouseLeave: handleMouseLeave
26727
+ }, /*#__PURE__*/React$1.createElement("text", {
26728
+ style: {
26729
+ whiteSpace: 'nowrap'
26730
+ },
26731
+ height: height,
26732
+ x: 20,
26733
+ y: y,
26734
+ fontSize: labelFontSize,
26735
+ orientation: orientation,
26736
+ stroke: stroke,
26737
+ textAnchor: "start"
26738
+ // verticalAnchor="middle"
26739
+ ,
26740
+ fill: fill
26741
+ }, payload.value.length > labelLimitedLetters - 1 ? `${payload.value.slice(0, labelLimitedLetters)}...` : payload.value));
26742
+ }
26743
+ return null;
26595
26744
  }
26596
- }, ' (', `${Math.round(row.value / value * 100)}%)`), isPercent && row.value && `${row.value.toFixed(1)}%`);
26597
- return /*#__PURE__*/React$1.createElement(ControlsContainer$4, {
26598
- className: className,
26745
+ return null;
26746
+ };
26747
+ return /*#__PURE__*/React$1.createElement(ControlsContainer$3, {
26748
+ ref: wrapper,
26599
26749
  height: height,
26600
26750
  width: width,
26601
- rootFont: rootFont,
26602
- containerPadding: containerPadding,
26603
- textcolor: textcolor
26604
- }, legendData.length === 0 || legendData.every(item => item.value === undefined || item.value === null) ? /*#__PURE__*/React$1.createElement(NoDataFoundMessage, {
26605
- className: "NoDataFoundMessage",
26606
- noDataText: noDataText
26607
- }) : /*#__PURE__*/React$1.createElement(Controls$3, {
26608
- className: "Controls",
26609
- height: height,
26610
- width: width
26611
- }, !hideTitleAndValue && /*#__PURE__*/React$1.createElement(TitleAndValueContainer$1, {
26612
- className: "TitleAndValueContainer"
26613
- }, /*#__PURE__*/React$1.createElement(Title$9, {
26614
- className: "Title",
26615
- fontSize: titleFontSize
26616
- }, title), /*#__PURE__*/React$1.createElement(CurrencySignAndFormattedValueContainer, {
26617
- className: "CurrencySignAndFormattedValueContainer"
26618
- }, /*#__PURE__*/React$1.createElement(FormattedValue$1, {
26619
- className: "FormattedValue",
26620
- fontSize: FormattedValueFontSize,
26621
- width: width
26622
- }, /*#__PURE__*/React$1.createElement(CurrencySign$1, {
26751
+ textColor: textColor,
26752
+ scroller: chartsData.length > showScrollerBarsCount ? 'auto' : 'hidden',
26753
+ className: className
26754
+ }, chartsData?.length > 0 ? /*#__PURE__*/React$1.createElement(React$1.Fragment, null, !hideTitle || !hideTotalValue ? /*#__PURE__*/React$1.createElement(CardHeader, {
26755
+ ref: topHeader,
26756
+ className: "CardHeader"
26757
+ }, !hideTitle ? /*#__PURE__*/React$1.createElement(Title$8, null, title) : '', !hideTotalValue ? /*#__PURE__*/React$1.createElement(TotalValue, {
26758
+ className: "TotalValue"
26759
+ }, currencySign && /*#__PURE__*/React$1.createElement(CurrencySign, {
26623
26760
  className: "CurrencySign"
26624
- }, 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$1.createElement(TextAfterValue, {
26625
- className: "TextAfterValue"
26626
- }, textAfterValue) : '', addingBenchmark && /*#__PURE__*/React$1.createElement(Benchmark, null))), /*#__PURE__*/React$1.createElement(DoughnutChartAndLegendContainer, {
26627
- legendBelow: legendBelow
26628
- }, /*#__PURE__*/React$1.createElement(DoughnutChartContainer, {
26629
- width: width,
26630
- height: height,
26631
- ref: DoughnutChartContainerRef
26632
- }, /*#__PURE__*/React$1.createElement(ResponsiveContainer, null, /*#__PURE__*/React$1.createElement(PieChart$1, null, /*#__PURE__*/React$1.createElement(Pie, {
26761
+ }, getCurrencySign(currencyType, value)), dotCut ? getFormattedValue(value && Math.abs(value) > 0 && value % 1 !== 0 ? value?.toFixed(2) : value) : getNumberWithCommas(value), dotCut ? getFormattedUnits(value) : '') : '') : '', /*#__PURE__*/React$1.createElement(ResponsiveContainer, {
26762
+ width: "100%",
26763
+ height: calculateChartHeight()
26764
+ }, /*#__PURE__*/React$1.createElement(BarChart$1, {
26765
+ layout: "vertical",
26766
+ data: chartsData,
26767
+ margin: {
26768
+ top: 10,
26769
+ right: 20,
26770
+ bottom: 20,
26771
+ left: 10
26772
+ }
26773
+ }, /*#__PURE__*/React$1.createElement(XAxis, {
26774
+ type: "number",
26775
+ domain: [0, dataMax => dataMax * rightGap]
26776
+ // allowDataOverflow={false}
26777
+ ,
26778
+ hide: true
26779
+ }), /*#__PURE__*/React$1.createElement(YAxis, {
26780
+ dataKey: "name",
26781
+ type: "category",
26782
+ width: labelLimitedLetters * 10,
26783
+ tickLine: false,
26784
+ axisLine: false,
26785
+ interval: 0,
26786
+ allowDataOverflow: true,
26787
+ tick: CustomizedTickBarChart
26788
+ }), /*#__PURE__*/React$1.createElement(Bar, {
26789
+ dataKey: "value",
26790
+ barSize: 20,
26633
26791
  fill: "#8884d8",
26792
+ barCategoryGap: 10,
26793
+ barGap: 5
26794
+ }, /*#__PURE__*/React$1.createElement(LabelList, {
26634
26795
  dataKey: "value",
26635
- blendStroke: true,
26636
- startAngle: -270,
26637
- data: legendData,
26638
- outerRadius: DoughnutChartRadius - 4,
26639
- innerRadius: DoughnutChartRadius - DoughnutChartRadius / 3
26640
- }, legendData.map(row => /*#__PURE__*/React$1.createElement(Cell, {
26641
- key: `cell-${row.name}`,
26642
- fill: row.color
26643
- }))), /*#__PURE__*/React$1.createElement(Tooltip$2, {
26644
- content: /*#__PURE__*/React$1.createElement(CustomTooltip, {
26645
- value: value,
26646
- isPercent: isPercent
26647
- })
26648
- }), /*#__PURE__*/React$1.createElement(Tooltip$2, null)))), /*#__PURE__*/React$1.createElement(LegendContainer$2, null, legendData.map(row => /*#__PURE__*/React$1.createElement(LegendControlsContainer, {
26649
- key: row.name
26650
- }, /*#__PURE__*/React$1.createElement(LegendColorRectangle, {
26651
- color: row.color
26652
- }), /*#__PURE__*/React$1.createElement(LegendTitleAndFormatedValueContainer, null, /*#__PURE__*/React$1.createElement(LegendTitle, {
26796
+ content: CustomizedLabel
26797
+ }), chartsData.map((entry, index) =>
26798
+ /*#__PURE__*/
26799
+ // eslint-disable-next-line react/no-array-index-key
26800
+ React$1.createElement(Cell, {
26801
+ key: `cell-${index}`,
26802
+ fill: barBackgrounds[index % 20]
26803
+ }))), showLegendTooltip && /*#__PURE__*/React$1.createElement(Tooltip, {
26804
+ direction: "top",
26805
+ content: tooltipText.content,
26806
+ top: tooltipText.clientY,
26807
+ left: tooltipText.clientX,
26653
26808
  style: {
26654
- flexDirection: itemsValuesSeparateLine ? 'column' : 'row',
26655
- alignItems: itemsValuesSeparateLine ? 'baseline' : 'center'
26809
+ pointerEvents: 'none'
26656
26810
  }
26657
- }, row.name, displayLegendValue(row)))))))));
26811
+ })))) : /*#__PURE__*/React$1.createElement(NoDataFoundMessage, {
26812
+ noDataText: noDataText
26813
+ }));
26658
26814
  };
26659
- TotalDoughnutChart.propTypes = {
26815
+ TotalHorizontalCharts.propTypes = {
26660
26816
  className: PropTypes.string,
26661
26817
  title: PropTypes.string,
26662
26818
  value: PropTypes.number,
26663
- rootFont: PropTypes.string,
26664
- containerPadding: PropTypes.string,
26665
- addingBenchmark: PropTypes.bool,
26666
26819
  dotCut: PropTypes.bool,
26667
26820
  currencySign: PropTypes.bool,
26668
26821
  currencyType: PropTypes.string,
26669
- legendData: PropTypes.arrayOf(PropTypes.shape({
26670
- color: PropTypes.string,
26822
+ chartsData: PropTypes.arrayOf(PropTypes.shape({
26823
+ name: PropTypes.string,
26671
26824
  value: PropTypes.number,
26672
- name: PropTypes.string
26673
- })),
26674
- legendBelow: PropTypes.bool,
26675
- itemsPercentagesValueAside: PropTypes.bool,
26676
- itemsBoldedValues: PropTypes.bool,
26677
- itemsValuesSeparateLine: PropTypes.bool,
26825
+ color: PropTypes.string
26826
+ })),
26827
+ showScrollerBarsCount: PropTypes.number,
26828
+ showPercentAsideValue: PropTypes.bool,
26829
+ labelFontSize: PropTypes.number,
26830
+ labelLimitedLetters: PropTypes.number,
26678
26831
  width: PropTypes.string,
26679
26832
  height: PropTypes.string,
26680
- textcolor: PropTypes.string,
26681
- titleFontSize: PropTypes.string,
26682
- FormattedValueFontSize: PropTypes.string,
26683
- isPercent: PropTypes.bool,
26684
- hideTitleAndValue: PropTypes.bool,
26833
+ rightGap: PropTypes.number,
26834
+ textColor: PropTypes.string,
26685
26835
  noDataText: PropTypes.string,
26686
- textAfterValue: PropTypes.string
26836
+ isDollar: PropTypes.bool,
26837
+ isPercentage: PropTypes.bool,
26838
+ showDollarSign: PropTypes.bool,
26839
+ hideTotalValue: PropTypes.bool,
26840
+ hideTitle: PropTypes.bool
26687
26841
  };
26688
- TotalDoughnutChart.defaultProps = {
26842
+ TotalHorizontalCharts.defaultProps = {
26689
26843
  className: '',
26690
- title: '',
26844
+ title: 'SALES',
26691
26845
  value: 0,
26692
- rootFont: '18px',
26693
- containerPadding: '0px',
26694
- addingBenchmark: false,
26695
26846
  dotCut: false,
26696
26847
  currencySign: false,
26697
26848
  currencyType: 'USD',
26698
- legendData: [],
26699
- legendBelow: false,
26700
- itemsPercentagesValueAside: true,
26701
- itemsBoldedValues: true,
26702
- itemsValuesSeparateLine: true,
26849
+ chartsData: [],
26850
+ showScrollerBarsCount: 7,
26851
+ showPercentAsideValue: false,
26852
+ labelFontSize: 10,
26853
+ labelLimitedLetters: 12,
26703
26854
  width: '100%',
26704
26855
  height: '100%',
26705
- textcolor: '#212121',
26706
- titleFontSize: '18px',
26707
- FormattedValueFontSize: '40px',
26708
- isPercent: false,
26709
- hideTitleAndValue: false,
26856
+ rightGap: 1,
26857
+ textColor: '#212121',
26710
26858
  noDataText: 'No Data',
26711
- textAfterValue: ''
26859
+ isDollar: true,
26860
+ isPercentage: false,
26861
+ showDollarSign: true,
26862
+ hideTotalValue: false,
26863
+ hideTitle: false
26712
26864
  };
26713
- function CustomTooltip(_ref) {
26865
+
26866
+ const LampIcon = _ref => {
26714
26867
  let {
26715
- active,
26716
- payload,
26717
- value,
26718
- isPercent = false
26868
+ // eslint-disable-next-line react/prop-types
26869
+ width = '23',
26870
+ // eslint-disable-next-line react/prop-types
26871
+ height = '19',
26872
+ // eslint-disable-next-line react/prop-types
26873
+ fill = '#229E38'
26719
26874
  } = _ref;
26720
- if (active && payload && payload.length) {
26721
- // eslint-disable-next-line no-nested-ternary
26722
- const percent = value && value !== 0 && !isPercent ? (payload[0].value / value * 100).toFixed(1) : value && isPercent ? payload[0].value.toFixed(1) : 0;
26723
- return /*#__PURE__*/React$1.createElement(TooltipDiv$2, null, /*#__PURE__*/React$1.createElement(TooltipLabel$2, null, `${payload[0].name} ${percent}%`));
26724
- }
26725
- }
26726
- CustomTooltip.propTypes = {
26727
- // eslint-disable-next-line react/forbid-prop-types
26728
- active: PropTypes.any,
26729
- // eslint-disable-next-line react/forbid-prop-types
26730
- payload: PropTypes.any,
26731
- // eslint-disable-next-line react/forbid-prop-types
26732
- value: PropTypes.any,
26733
- // eslint-disable-next-line react/forbid-prop-types
26734
- isPercent: PropTypes.any
26735
- };
26736
- CustomTooltip.defaultProps = {
26737
- active: '',
26738
- payload: '',
26739
- value: '',
26740
- isPercent: false
26875
+ return /*#__PURE__*/React$1.createElement("svg", {
26876
+ width: width,
26877
+ height: height,
26878
+ viewBox: "0 0 23 19",
26879
+ fill: "none",
26880
+ xmlns: "http://www.w3.org/2000/svg"
26881
+ }, /*#__PURE__*/React$1.createElement("path", {
26882
+ 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",
26883
+ fill: fill
26884
+ }));
26741
26885
  };
26742
26886
 
26743
- const TooltipContainer$2 = styled.div`
26744
- --tooltip-text-color: black;
26745
- --tooltip-background-color: white;
26746
- --tooltip-margin: 40px;
26747
- --tooltip-arrow-size: 10px;
26748
- position: absolute;
26749
- z-index: 999999;
26750
- top: ${props => props.top};
26751
- left: ${props => props.left};
26752
- `;
26753
- const TooltipWrapper = styled.div`
26754
- display: inline-block;
26755
- position: relative;
26756
- `;
26757
- const TooltipTip = styled.div`
26758
- box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);
26759
- position: absolute;
26760
- border-radius: 4px;
26761
- left: 50%;
26762
- transform: translateX(-50%);
26763
- padding: 8px 12px;
26764
- color: var(--tooltip-text-color);
26765
- background: var(--tooltip-background-color);
26766
- font-size: 10px;
26767
- z-index: 999;
26768
- white-space: nowrap;
26769
-
26770
- /* CSS border triangles */
26771
- &.controls::before {
26772
- content: " ";
26773
- left: 50%;
26774
- border: solid transparent;
26775
- height: 0;
26776
- width: 0;
26777
- position: absolute;
26778
- pointer-events: none;
26779
- border-width: var(--tooltip-arrow-size);
26780
- margin-left: calc(var(--tooltip-arrow-size) * -1);
26781
- }
26782
-
26783
- /* Absolute positioning */
26784
- &.controls.top {
26785
- top: calc(var(--tooltip-margin) * -1);
26786
- }
26787
-
26788
- /* CSS border triangles */
26789
- &.controls.top::before {
26790
- top: 100%;
26791
- border-top-color: var(--tooltip-background-color);
26792
- }
26793
-
26794
- /* Absolute positioning */
26795
- &.controls.right {
26796
- left: calc(70% + var(--tooltip-margin));
26797
- top: 50%;
26798
- transform: translateX(0) translateY(-50%);
26799
- }
26800
-
26801
- /* CSS border triangles */
26802
- &.controls.right::before {
26803
- left: calc(var(--tooltip-arrow-size) * -1);
26804
- top: 50%;
26805
- transform: translateX(0) translateY(-50%);
26806
- border-right-color: var(--tooltip-background-color);
26807
- }
26887
+ const scrollableStyles$5 = `
26888
+ overflow-y: auto;
26808
26889
 
26809
- /* Absolute positioning */
26810
- &.controls.bottom {
26811
- bottom: calc(var(--tooltip-margin) * -1);
26812
- }
26813
- /* CSS border triangles */
26814
- &.controls.bottom::before {
26815
- bottom: 100%;
26816
- border-bottom-color: var(--tooltip-background-color);
26890
+ &::-webkit-scrollbar {
26891
+ width: 8px;
26817
26892
  }
26818
26893
 
26819
- /* Absolute positioning */
26820
- &.controls.left {
26821
- left: auto;
26822
- right: calc(70% + var(--tooltip-margin));
26823
- top: 50%;
26824
- transform: translateX(0) translateY(-50%);
26825
- }
26826
- /* CSS border triangles */
26827
- &.controls.left::before {
26828
- left: auto;
26829
- right: calc(var(--tooltip-arrow-size) * -2);
26830
- top: 50%;
26831
- transform: translateX(0) translateY(-50%);
26832
- border-left-color: var(--tooltip-background-color);
26894
+ &::-webkit-scrollbar-track {
26895
+ background: #E8E8E8;
26896
+ border-radius: 5px;
26833
26897
  }
26834
26898
 
26835
- > ul {
26836
- padding-left: 10px;
26837
- margin: 0;
26899
+ &::-webkit-scrollbar-thumb {
26900
+ background: #D0D0D0;
26901
+ border-radius: 5px;
26838
26902
  }
26839
26903
  `;
26840
-
26841
- const Tooltip = props => {
26842
- const {
26843
- className,
26844
- top,
26845
- left,
26846
- direction,
26847
- content
26848
- } = props;
26849
- return /*#__PURE__*/React$1.createElement(TooltipContainer$2, {
26850
- className: className,
26851
- top: `${top}px`,
26852
- left: `${left}px`
26853
- }, /*#__PURE__*/React$1.createElement(TooltipWrapper, null, /*#__PURE__*/React$1.createElement(TooltipTip, {
26854
- className: `controls ${direction || 'top'}`
26855
- }, content)));
26856
- };
26857
- Tooltip.propTypes = {
26858
- className: PropTypes.string,
26859
- top: PropTypes.number,
26860
- left: PropTypes.number,
26861
- direction: PropTypes.string,
26862
- content: PropTypes.string
26863
- };
26864
- Tooltip.defaultProps = {
26865
- className: '',
26866
- top: 0,
26867
- left: 0,
26868
- direction: 'top',
26869
- content: ''
26870
- };
26871
-
26872
- const ControlsContainer$3 = styled.div`
26904
+ const MainContainer$1 = styled.div`
26905
+ display: flex;
26906
+ flex-direction: row;
26907
+ position: relative;
26873
26908
  font-family: "Poppins", sans-serif;
26874
- background-color: white;
26875
- color: ${props => props.textColor};
26909
+ font-style: normal;
26910
+ font-size: 1rem;
26911
+ border-radius: 12px;
26912
+ padding: 10px;
26876
26913
  width: ${props => props.width};
26877
26914
  height: ${props => props.height};
26878
- /* display: flex;
26879
- flex-direction: column;
26880
- overflow: hidden; */
26881
- overflow-y: ${props => props.scroller};
26882
-
26883
- &::-webkit-scrollbar {
26884
- width: 8px;
26885
- }
26886
-
26887
- &::-webkit-scrollbar-track {
26888
- background: #E8E8E8;
26889
- border-radius: 5px;
26915
+ overflow: auto;
26916
+ ${scrollableStyles$5}
26917
+ `;
26918
+ const RowTitle = styled.h4`
26919
+ display: flex;
26920
+ justify-content: space-between;
26921
+ font-weight: 500;
26922
+ font-size: 18px;
26923
+ margin: 5px 5px 5px 0;
26924
+ @media (max-width: 1536px) {
26925
+ font-size: 15px;
26890
26926
  }
26891
-
26892
- &::-webkit-scrollbar-thumb {
26893
- background: #D0D0D0;
26894
- border-radius: 5px;
26927
+ @media (max-width: 1366px) {
26928
+ font-size: 12px;
26895
26929
  }
26896
26930
  `;
26897
- styled.div`
26898
- overflow-y: auto;
26931
+ const AllRowsContainer = styled.div`
26932
+ display: flex;
26933
+ flex-direction: column;
26934
+ justify-content: space-between;
26935
+ align-items: flex-start;
26936
+ width: 100%;
26899
26937
  height: 100%;
26900
-
26901
- &::-webkit-scrollbar {
26902
- width: 8px;
26903
- }
26904
-
26905
- &::-webkit-scrollbar-track {
26906
- background: #E8E8E8;
26907
- border-radius: 5px;
26938
+ `;
26939
+ const OneRowContainer = styled.div`
26940
+ display: flex;
26941
+ flex-direction: column;
26942
+ width: 100%;
26943
+ height: 100%;
26944
+ `;
26945
+ const ColumnLineSeporatorContainer = styled.div`
26946
+ display: flex;
26947
+ flex-direction: column;
26948
+ background-color: #b1b1b1;
26949
+ align-items: center;
26950
+ height: 1px;
26951
+ width: 100%;
26952
+ &.ColumnLineSeporatorContainer_vertical {
26953
+ margin: 0 30px;
26954
+ height: 100%;
26955
+ width: 1px;
26908
26956
  }
26909
-
26910
- &::-webkit-scrollbar-thumb {
26911
- background: #D0D0D0;
26912
- border-radius: 5px;
26957
+ &.ColumnLineSeporatorContainer_horizontal {
26958
+ margin: 30px 0;
26959
+ min-height: 1px;
26960
+ height: 1px;
26961
+ width: 100%;
26913
26962
  }
26914
26963
  `;
26915
- const CardHeader = styled.div`
26916
- padding: 16px;
26917
- position: sticky;
26918
- top: 0;
26919
- z-index: 10;
26920
- background-color: white;
26964
+ const ColumnLineSeporator = styled.div`
26965
+ min-width: 0.5px;
26966
+ width: 0.5px;
26921
26967
  `;
26922
- const TotalValue = styled.div`
26923
- font-weight: 500;
26924
- font-size: 40px;
26968
+ const FieldsContainer = styled.div`
26925
26969
  display: flex;
26926
- align-items: baseline;
26927
- line-height: 1;
26970
+ flex-direction: row;
26971
+ justify-content: space-between;
26972
+ white-space: nowrap;
26973
+ height: 100%;
26974
+ padding: 30px 0px;
26975
+ `;
26976
+ const OneFieldsContainer = styled.div`
26977
+ display: flex;
26978
+ padding: 4px;
26979
+ gap: 10px;
26980
+ width: 100%;
26981
+ justify-content: flex-start;
26982
+ // padding: ${props => props.padding}; //0 0 0 40px;
26983
+ `;
26984
+ const FieldTitle = styled.h4`
26985
+ font-size: 18px;
26986
+ font-weight: 400;
26987
+ margin: 0;
26928
26988
  @media (max-width: 1536px) {
26929
- font-size: 24px;
26989
+ font-size: 14px;
26930
26990
  }
26931
26991
  @media (max-width: 1366px) {
26932
- font-size: 20px;
26992
+ font-size: 12px;
26933
26993
  }
26934
26994
  `;
26935
- const Title$8 = styled.h4`
26936
- font-size: 18px;
26995
+ const FormattedValue$1 = styled.div`
26937
26996
  font-weight: 400;
26938
- line-height: 1;
26939
- margin: 0 0 8px;
26997
+ font-size: 40px;
26998
+ display: flex;
26999
+ align-items: baseline;
27000
+ min-height: 40px;
27001
+ gap: 2px;
26940
27002
  @media (max-width: 1536px) {
26941
- font-size: 14px;
27003
+ font-size: 24px;
26942
27004
  }
26943
27005
  @media (max-width: 1366px) {
26944
- font-size: 12px;
27006
+ font-size: 20px;
26945
27007
  }
26946
27008
  `;
26947
- const CurrencySign = styled.span`
26948
- font-weight: 500;
27009
+ const TextBeforeAndAfterValue$1 = styled.span`
27010
+ font-weight: 400;
26949
27011
  font-size: 16px;
26950
27012
  @media (max-width: 1536px) {
26951
27013
  font-size: 14px;
@@ -26954,248 +27016,184 @@ const CurrencySign = styled.span`
26954
27016
  font-size: 11px;
26955
27017
  }
26956
27018
  `;
26957
-
26958
- /* eslint-disable no-unused-vars */
26959
- const TotalHorizontalCharts = props => {
26960
- const {
26961
- title,
26962
- value,
26963
- dotCut,
26964
- currencySign,
26965
- currencyType,
26966
- chartsData,
26967
- showScrollerBarsCount,
26968
- labelFontSize,
26969
- labelLimitedLetters,
26970
- width,
26971
- height,
26972
- rightGap,
26973
- textColor,
26974
- noDataText,
26975
- showPercentAsideValue,
26976
- isDollar,
26977
- isPercentage,
26978
- showDollarSign,
26979
- className,
26980
- hideTotalValue,
26981
- hideTitle
26982
- } = props;
26983
- const barBackgrounds = chartsData.map(bg => bg.color);
26984
- const topHeader = useRef();
26985
- const wrapper = useRef();
26986
- const BAR_HEIGHT = 40; // Height of each bar including padding
26987
- const CHART_PADDING = 40; // Total padding for chart (top + bottom)
26988
-
26989
- // Inside the TotalHorizontalCharts component
26990
- const calculateChartHeight = () => {
26991
- if (!chartsData?.length) return 0;
26992
- if (chartsData.length > showScrollerBarsCount) {
26993
- return chartsData.length * BAR_HEIGHT + CHART_PADDING;
27019
+ const FieldTitleAndValueSubContainer = styled.div`
27020
+ display: flex;
27021
+ justify-content: space-around;
27022
+ flex-direction: column;
27023
+ flex-wrap: wrap;
27024
+ width: 100%;
27025
+ `;
27026
+ const InfoTextContainer = styled.div`
27027
+ display: flex;
27028
+ flex-direction: row;
27029
+ width: 100%;
27030
+ height: 100%;
27031
+ overflow:auto;
27032
+ `;
27033
+ const IconContainer = styled.div`
27034
+ display: flex;
27035
+ padding: 5px 10px 0 0;
27036
+ cursor: pointer;
27037
+ `;
27038
+ const InfoTextLabel = styled.div`
27039
+ color: black;
27040
+ font-size: 18px;
27041
+ line-height: 24px;
27042
+ font-weight: 400;
27043
+ width: 100%;
27044
+ overflow: auto;
27045
+ ${scrollableStyles$5}
27046
+ strong {
27047
+ font-weight: 500;
27048
+ color: #212121;
27049
+ @media (max-width: 1536px) {
27050
+ font-size: 14px;
26994
27051
  }
26995
-
26996
- // Calculate height to show only specified number of bars
26997
- const visibleBarsHeight = showScrollerBarsCount * BAR_HEIGHT;
26998
-
26999
- // Use the smaller value between:
27000
- // 1. Height needed for all bars
27001
- // 2. Height needed for specified number of bars
27002
- return Math.min(chartsData.length * BAR_HEIGHT + CHART_PADDING, visibleBarsHeight + CHART_PADDING);
27003
- };
27004
- const [showLegendTooltip, setShowLegendTooltip] = useState(false);
27005
- const [tooltipText, setTooltipText] = useState({
27006
- content: '',
27007
- clientX: 0,
27008
- clientY: 0
27009
- });
27010
- const CustomizedLabel = props => showPercentAsideValue ? /*#__PURE__*/React$1.createElement("text", {
27011
- x: props.x + (props.width <= 0 ? -12 : props.width) + 56,
27012
- y: props.y + 4,
27013
- dy: props.height / 2,
27014
- dx: -8,
27015
- fill: props.stroke,
27016
- fontSize: 12,
27017
- fontWeight: 500,
27018
- textAnchor: "middle"
27019
- }, ''.concat(getFormattedValue(props.value), getFormattedUnits(props.value)), /*#__PURE__*/React$1.createElement("tspan", {
27020
- fontWeight: 400
27021
- }, ` (${(props.value / value * 100).toFixed(0)}%)`)) : /*#__PURE__*/React$1.createElement("text", {
27022
- x: props.x + (props.width <= 0 ? -12 : props.width) + 40,
27023
- y: props.y + 4,
27024
- dy: props.height / 2,
27025
- dx: -8,
27026
- fill: props.stroke,
27027
- fontSize: 12,
27028
- fontWeight: 400,
27029
- textAnchor: "middle"
27030
- }, !isDollar ? ''.concat(getFormattedValue(props.value), isPercentage ? '%' : getFormattedUnits(props.value)) : ''.concat(showDollarSign ? '$' : '', getFormattedValue(props.value), getFormattedUnits(props.value)));
27031
- const CustomizedTickBarChart = props => {
27032
- const {
27033
- x,
27034
- y,
27035
- height,
27036
- payload,
27037
- fill,
27038
- orientation,
27039
- stroke
27040
- } = props;
27041
- const handleMouseEnter = content => {
27042
- setTooltipText(prevState => ({
27043
- ...prevState,
27044
- content: content !== prevState.content ? content : prevState.content,
27045
- clientX: x / 1.2,
27046
- clientY: y - 20
27047
- }));
27048
- setShowLegendTooltip(true);
27049
- };
27050
- const handleMouseLeave = () => {
27051
- if (showLegendTooltip === false) return;
27052
- setTimeout(() => {
27053
- setShowLegendTooltip(false);
27054
- }, 1200);
27055
- };
27056
- if (chartsData && chartsData.length > 0 && payload) {
27057
- const chartsDataLabel = chartsData.filter(item => item.name === payload.value);
27058
- if (chartsDataLabel && chartsDataLabel.length > 0) {
27059
- return /*#__PURE__*/React$1.createElement("g", {
27060
- onMouseEnter: () => handleMouseEnter(payload.value),
27061
- onMouseLeave: handleMouseLeave
27062
- }, /*#__PURE__*/React$1.createElement("text", {
27063
- style: {
27064
- whiteSpace: 'nowrap'
27065
- },
27066
- height: height,
27067
- x: 20,
27068
- y: y,
27069
- fontSize: labelFontSize,
27070
- orientation: orientation,
27071
- stroke: stroke,
27072
- textAnchor: "start"
27073
- // verticalAnchor="middle"
27074
- ,
27075
- fill: fill
27076
- }, payload.value.length > labelLimitedLetters - 1 ? `${payload.value.slice(0, labelLimitedLetters)}...` : payload.value));
27077
- }
27078
- return null;
27052
+ @media (max-width: 1366px) {
27053
+ font-size: 12px;
27079
27054
  }
27080
- return null;
27081
27055
  };
27082
- return /*#__PURE__*/React$1.createElement(ControlsContainer$3, {
27083
- ref: wrapper,
27084
- height: height,
27085
- width: width,
27086
- textColor: textColor,
27087
- scroller: chartsData.length > showScrollerBarsCount ? 'auto' : 'hidden',
27088
- className: className
27089
- }, chartsData?.length > 0 ? /*#__PURE__*/React$1.createElement(React$1.Fragment, null, !hideTitle || !hideTotalValue ? /*#__PURE__*/React$1.createElement(CardHeader, {
27090
- ref: topHeader,
27091
- className: "CardHeader"
27092
- }, !hideTitle ? /*#__PURE__*/React$1.createElement(Title$8, null, title) : '', !hideTotalValue ? /*#__PURE__*/React$1.createElement(TotalValue, {
27093
- className: "TotalValue"
27094
- }, currencySign && /*#__PURE__*/React$1.createElement(CurrencySign, {
27095
- className: "CurrencySign"
27096
- }, getCurrencySign(currencyType, value)), dotCut ? getFormattedValue(value && Math.abs(value) > 0 && value % 1 !== 0 ? value?.toFixed(2) : value) : getNumberWithCommas(value), dotCut ? getFormattedUnits(value) : '') : '') : '', /*#__PURE__*/React$1.createElement(ResponsiveContainer, {
27097
- width: "100%",
27098
- height: calculateChartHeight()
27099
- }, /*#__PURE__*/React$1.createElement(BarChart$1, {
27100
- layout: "vertical",
27101
- data: chartsData,
27102
- margin: {
27103
- top: 10,
27104
- right: 20,
27105
- bottom: 20,
27106
- left: 10
27056
+ p1 {
27057
+ font-weight: 400;
27058
+ color: #726F6F;
27059
+ @media (max-width: 1536px) {
27060
+ font-size: 14px;
27107
27061
  }
27108
- }, /*#__PURE__*/React$1.createElement(XAxis, {
27109
- type: "number",
27110
- domain: [0, dataMax => dataMax * rightGap]
27111
- // allowDataOverflow={false}
27112
- ,
27113
- hide: true
27114
- }), /*#__PURE__*/React$1.createElement(YAxis, {
27115
- dataKey: "name",
27116
- type: "category",
27117
- width: labelLimitedLetters * 10,
27118
- tickLine: false,
27119
- axisLine: false,
27120
- interval: 0,
27121
- allowDataOverflow: true,
27122
- tick: CustomizedTickBarChart
27123
- }), /*#__PURE__*/React$1.createElement(Bar, {
27124
- dataKey: "value",
27125
- barSize: 20,
27126
- fill: "#8884d8",
27127
- barCategoryGap: 10,
27128
- barGap: 5
27129
- }, /*#__PURE__*/React$1.createElement(LabelList, {
27130
- dataKey: "value",
27131
- content: CustomizedLabel
27132
- }), chartsData.map((entry, index) =>
27133
- /*#__PURE__*/
27134
- // eslint-disable-next-line react/no-array-index-key
27135
- React$1.createElement(Cell, {
27136
- key: `cell-${index}`,
27137
- fill: barBackgrounds[index % 20]
27138
- }))), showLegendTooltip && /*#__PURE__*/React$1.createElement(Tooltip, {
27139
- direction: "top",
27140
- content: tooltipText.content,
27141
- top: tooltipText.clientY,
27142
- left: tooltipText.clientX,
27143
- style: {
27144
- pointerEvents: 'none'
27062
+ @media (max-width: 1366px) {
27063
+ font-size: 12px;
27145
27064
  }
27146
- })))) : /*#__PURE__*/React$1.createElement(NoDataFoundMessage, {
27147
- noDataText: noDataText
27148
- }));
27065
+ };
27066
+ `;
27067
+ const OutBanner$1 = styled.div`
27068
+ display: flex;
27069
+ gap: 8px;
27070
+ align-items: center;
27071
+ font-size: 14px;
27072
+ font-weight: 400;
27073
+ color: ${props => props.textColor};
27074
+ cursor: pointer;
27075
+ @media (max-width: 1536px) {
27076
+ font-size: 13px;
27077
+ }
27078
+ @media (max-width: 1366px) {
27079
+ font-size: 12px;
27080
+ }
27081
+ > svg {
27082
+ width: 14px;
27083
+ height: 14px;
27084
+ @media (max-width: 1536px) {
27085
+ width: 13px;
27086
+ height: 13px;
27087
+ }
27088
+ @media (max-width: 1366px) {
27089
+ width: 12px;
27090
+ height: 12px;
27091
+ }
27092
+ }
27093
+ `;
27094
+
27095
+ const MarketShareDescription = props => {
27096
+ const {
27097
+ width,
27098
+ height,
27099
+ marketShareData,
27100
+ iconColor,
27101
+ onBannerClick,
27102
+ dotCut
27103
+ } = props;
27104
+ const displayField = dataItem => {
27105
+ const content = /*#__PURE__*/React$1.createElement(FieldTitleAndValueSubContainer, {
27106
+ className: "FieldTitleAndValueSubContainer"
27107
+ }, /*#__PURE__*/React$1.createElement(FieldTitle, {
27108
+ className: "FieldTitle"
27109
+ }, dataItem.label), /*#__PURE__*/React$1.createElement(FormattedValue$1, {
27110
+ className: "FormattedValue"
27111
+ }, /*#__PURE__*/React$1.createElement(TextBeforeAndAfterValue$1, {
27112
+ className: "TextBeforeAndAfterValue"
27113
+ }, 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$1.createElement(TextBeforeAndAfterValue$1, null, dataItem.textAfter)));
27114
+ return content;
27115
+ };
27116
+ const dispalyRowFields = data => {
27117
+ if (!data && !data.length > 0) return '';
27118
+ const content = /*#__PURE__*/React$1.createElement(FieldsContainer, {
27119
+ className: "FieldsContainer",
27120
+ height: "160px"
27121
+ }, data?.map((item, index) => /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(OneFieldsContainer, {
27122
+ className: "OneFieldsContainer",
27123
+ padding: index === 0 ? '0px' : '0 0 0 40px'
27124
+ }, displayField(item)), data?.length !== index + 1 ? /*#__PURE__*/React$1.createElement(ColumnLineSeporatorContainer, {
27125
+ className: "ColumnLineSeporatorContainer_vertical"
27126
+ }, /*#__PURE__*/React$1.createElement(ColumnLineSeporator, {
27127
+ className: "ColumnLineSeporator"
27128
+ })) : '')));
27129
+ return content;
27130
+ };
27131
+ const displayRows = () => {
27132
+ if (!marketShareData || marketShareData?.length === 0) return '';
27133
+ const content = /*#__PURE__*/React$1.createElement(AllRowsContainer, {
27134
+ className: "AllRowsContainer"
27135
+ }, marketShareData.map((item, index) => /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(OneRowContainer, {
27136
+ className: "OneRowContainer"
27137
+ }, /*#__PURE__*/React$1.createElement(RowTitle, {
27138
+ className: "RowTitle"
27139
+ }, /*#__PURE__*/React$1.createElement(InfoTextLabel, {
27140
+ className: "InfoTextLabel",
27141
+ dangerouslySetInnerHTML: {
27142
+ __html: item.rowTitle
27143
+ }
27144
+ }), item.showBanner && /*#__PURE__*/React$1.createElement(OutBanner$1, {
27145
+ className: "OutBanner",
27146
+ onClick: () => onBannerClick({
27147
+ eventName: 'onBannerClick',
27148
+ rowName: item.name
27149
+ })
27150
+ }, /*#__PURE__*/React$1.createElement(ExportIcon, {
27151
+ color: "#212121"
27152
+ }), "View By Banner")), dispalyRowFields(item.fieldsArray), /*#__PURE__*/React$1.createElement(InfoTextContainer, {
27153
+ className: "InfoTextContainer"
27154
+ }, item.rowFooter && item.rowFooter?.length > 0 ? /*#__PURE__*/React$1.createElement(IconContainer, {
27155
+ className: "IconContainer"
27156
+ }, /*#__PURE__*/React$1.createElement(LampIcon, {
27157
+ width: "23px",
27158
+ height: "19px",
27159
+ fill: iconColor
27160
+ })) : '', /*#__PURE__*/React$1.createElement(InfoTextLabel, {
27161
+ className: "InfoTextLabel",
27162
+ dangerouslySetInnerHTML: {
27163
+ __html: item.rowFooter
27164
+ }
27165
+ }))), marketShareData?.length !== index + 1 ? /*#__PURE__*/React$1.createElement(ColumnLineSeporatorContainer, {
27166
+ className: "ColumnLineSeporatorContainer_horizontal"
27167
+ }, /*#__PURE__*/React$1.createElement(ColumnLineSeporator, {
27168
+ className: "ColumnLineSeporator"
27169
+ })) : '')));
27170
+ return content;
27171
+ };
27172
+ return /*#__PURE__*/React$1.createElement(MainContainer$1, {
27173
+ className: "MainContainer",
27174
+ height: height,
27175
+ width: width
27176
+ }, displayRows());
27149
27177
  };
27150
- TotalHorizontalCharts.propTypes = {
27151
- className: PropTypes.string,
27152
- title: PropTypes.string,
27153
- value: PropTypes.number,
27154
- dotCut: PropTypes.bool,
27155
- currencySign: PropTypes.bool,
27156
- currencyType: PropTypes.string,
27157
- chartsData: PropTypes.arrayOf(PropTypes.shape({
27158
- name: PropTypes.string,
27159
- value: PropTypes.number,
27160
- color: PropTypes.string
27178
+ MarketShareDescription.propTypes = {
27179
+ marketShareData: PropTypes.arrayOf(PropTypes.shape({
27180
+ label: PropTypes.string,
27181
+ checked: PropTypes.bool,
27182
+ disabled: PropTypes.bool
27161
27183
  })),
27162
- showScrollerBarsCount: PropTypes.number,
27163
- showPercentAsideValue: PropTypes.bool,
27164
- labelFontSize: PropTypes.number,
27165
- labelLimitedLetters: PropTypes.number,
27166
- width: PropTypes.string,
27167
27184
  height: PropTypes.string,
27168
- rightGap: PropTypes.number,
27169
- textColor: PropTypes.string,
27170
- noDataText: PropTypes.string,
27171
- isDollar: PropTypes.bool,
27172
- isPercentage: PropTypes.bool,
27173
- showDollarSign: PropTypes.bool,
27174
- hideTotalValue: PropTypes.bool,
27175
- hideTitle: PropTypes.bool
27185
+ width: PropTypes.string,
27186
+ iconColor: PropTypes.string,
27187
+ onBannerClick: PropTypes.func,
27188
+ dotCut: PropTypes.bool
27176
27189
  };
27177
- TotalHorizontalCharts.defaultProps = {
27178
- className: '',
27179
- title: 'SALES',
27180
- value: 0,
27181
- dotCut: false,
27182
- currencySign: false,
27183
- currencyType: 'USD',
27184
- chartsData: [],
27185
- showScrollerBarsCount: 7,
27186
- showPercentAsideValue: false,
27187
- labelFontSize: 10,
27188
- labelLimitedLetters: 12,
27190
+ MarketShareDescription.defaultProps = {
27191
+ marketShareData: [],
27189
27192
  width: '100%',
27190
27193
  height: '100%',
27191
- rightGap: 1,
27192
- textColor: '#212121',
27193
- noDataText: 'No Data',
27194
- isDollar: true,
27195
- isPercentage: false,
27196
- showDollarSign: true,
27197
- hideTotalValue: false,
27198
- hideTitle: false
27194
+ iconColor: '#1B30AA',
27195
+ onBannerClick: () => {},
27196
+ dotCut: false
27199
27197
  };
27200
27198
 
27201
27199
  const ControlsContainer$2 = styled.div`
@@ -28870,10 +28868,11 @@ const LegendContainer = styled.div`
28870
28868
  left: 0;
28871
28869
  text-align: center;
28872
28870
  width: ${props => `${props.width}px`};
28873
- bottom: 30px;
28871
+ bottom: 20px;
28874
28872
  `;
28875
28873
  const Controls$1 = styled.div`
28876
- height: calc(100% - 30px);
28874
+ /* height: calc(100% - 30px); */
28875
+ height: 100%;
28877
28876
  display: flex;
28878
28877
  flex-direction: column;
28879
28878
  background-color: white;
@@ -28889,14 +28888,14 @@ const Title$2 = styled.h5`
28889
28888
  const ChartsWrapper = styled.div`
28890
28889
  flex-grow: 1;
28891
28890
  width: ${props => props.width};
28892
- margin-top: auto;
28891
+ /* margin-top: auto; */
28893
28892
  background-color: white;
28894
28893
  `;
28895
28894
  const LineChartWrapper = styled.div`
28896
- height: 25%;
28895
+ height: 30%;
28897
28896
  `;
28898
28897
  const BarChartWrapper = styled.div`
28899
- height: 75%;
28898
+ height: 70%;
28900
28899
  `;
28901
28900
  const TooltipDiv = styled.div`
28902
28901
  border-radius: 5px;
@@ -29112,7 +29111,7 @@ const DoubleBarSingleLine = props => {
29112
29111
  syncId: "anyId",
29113
29112
  // This synchronizes the charts
29114
29113
  margin: {
29115
- top: 20,
29114
+ top: 0,
29116
29115
  right: 35,
29117
29116
  left: 35,
29118
29117
  bottom: 5
@@ -29717,8 +29716,8 @@ const scrollableStyles$1 = `
29717
29716
  }
29718
29717
  `;
29719
29718
  const CategorySalesPanelContainer = styled.div`
29720
- width: "100%",
29721
- margin: "10px auto"
29719
+ width: "100%";
29720
+ margin: "10px auto";
29722
29721
  `;
29723
29722
  const AccordionContainer = styled.div`
29724
29723
  border-radius: 12px;
@@ -29727,7 +29726,7 @@ const AccordionContainer = styled.div`
29727
29726
  `;
29728
29727
  const CategorySalesContainer = styled.button`
29729
29728
  display: flex;
29730
- justify-content: space-between;
29729
+ /* justify-content: space-between; */
29731
29730
  align-items: center;
29732
29731
  width: 100%;
29733
29732
  font-family: "Poppins", sans-serif;
@@ -29749,7 +29748,7 @@ const ItemSalesContainer = styled.div`
29749
29748
  padding-top: 10px;
29750
29749
  background: #F7F8FA;
29751
29750
  border-top: 1px solid #ddd;
29752
- gap:12px;
29751
+ gap: 12px;
29753
29752
  transition: max-height 0.3s ease-in-out;
29754
29753
  max-height: 250px;
29755
29754
  ${scrollableStyles$1}
@@ -29759,9 +29758,21 @@ const FieldContainer = styled.div`
29759
29758
  display: flex;
29760
29759
  align-items: center;
29761
29760
  padding: 5px 0px;
29762
- width: ${props => props.width};
29763
29761
  font-size: ${props => props.fontSize || '14px'};
29764
29762
  font-weight: ${props => props.fontwidth || 500};
29763
+ &:first-child {
29764
+ width: 40px;
29765
+ }
29766
+ &:nth-child(2) {
29767
+ width: 320px;
29768
+ }
29769
+ &:nth-child(3) {
29770
+ flex-grow: 1;
29771
+ }
29772
+ &:nth-child(4) {
29773
+ width: 21%;
29774
+ margin-left: auto;
29775
+ }
29765
29776
  `;
29766
29777
 
29767
29778
  const ButtonContainer = styled.button`
@@ -29776,7 +29787,7 @@ const ButtonContainer = styled.button`
29776
29787
  opacity: ${props => props.disabled ? "0.4" : "1"};
29777
29788
  cursor: ${props => props.disabled ? "not-allowed" : "pointer"};
29778
29789
  transition: all 0.3s ease-in-out;
29779
- box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
29790
+ box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.2);
29780
29791
 
29781
29792
  &:hover {
29782
29793
  border: ${props => props.disabled ? "1px solid #ddd" : `1px solid ${props.hoverbordercolor}`};
@@ -29858,7 +29869,6 @@ const BannerButton = ({
29858
29869
 
29859
29870
  const ItemSalesPanelContainer = styled.div`
29860
29871
  display: flex;
29861
- flex-direction: row;
29862
29872
  background: #F7F8FA;
29863
29873
  color: #212121;
29864
29874
  transition: max-height 0.3s ease-in-out;
@@ -29867,7 +29877,7 @@ const ItemTitle = styled.h4`
29867
29877
  font-size: 14px;
29868
29878
  font-weight: 400;
29869
29879
  margin: 14px 0px;
29870
- width: 30%
29880
+ min-width: 360px;
29871
29881
  `;
29872
29882
  const BannerIconWrapper = styled.div`
29873
29883
  display: flex;
@@ -29892,11 +29902,15 @@ const ItemSalesPanel = props => {
29892
29902
  banners,
29893
29903
  onBannerClick
29894
29904
  } = props;
29905
+ const truncateString = maxLength => {
29906
+ return itemName[0].length > maxLength ? itemName[0].slice(0, maxLength) + '...' : itemName[0];
29907
+ };
29895
29908
  return /*#__PURE__*/React$1.createElement(ItemSalesPanelContainer, {
29896
29909
  "data-testid": "item-sales-panel-container"
29897
29910
  }, /*#__PURE__*/React$1.createElement(ItemTitle, {
29898
- "data-testid": "item-title"
29899
- }, itemName), (banners || []).map(banner => /*#__PURE__*/React$1.createElement(BannerIconWrapper, {
29911
+ "data-testid": "item-title",
29912
+ title: itemName[0]
29913
+ }, truncateString(35)), (banners || []).map(banner => /*#__PURE__*/React$1.createElement(BannerIconWrapper, {
29900
29914
  "data-testid": "banner-icon-wrapper",
29901
29915
  key: banner
29902
29916
  }, /*#__PURE__*/React$1.createElement(BannerButton, {
@@ -29969,16 +29983,13 @@ const CategorySalesPanel = ({
29969
29983
  "data-testid": "category-sales-container",
29970
29984
  onClick: () => setIsOpen(!isOpen)
29971
29985
  }, /*#__PURE__*/React$1.createElement(FieldContainer, {
29972
- "data-testid": "field-container-dropdown-icon",
29973
- width: "2.4%"
29986
+ "data-testid": "field-container-dropdown-icon"
29974
29987
  }, isOpen ? /*#__PURE__*/React$1.createElement(MenuItemUpIcon, null) : /*#__PURE__*/React$1.createElement(MenuItemRightIcon, null)), /*#__PURE__*/React$1.createElement(FieldContainer, {
29975
29988
  "data-testid": "field-container-category",
29976
- width: "25%",
29977
29989
  fontwidth: 500,
29978
29990
  fontSize: "14px"
29979
29991
  }, categorySales.category), /*#__PURE__*/React$1.createElement(FieldContainer, {
29980
29992
  "data-testid": "field-container-items-counter",
29981
- width: "70%",
29982
29993
  fontwidth: 400,
29983
29994
  fontSize: "20px"
29984
29995
  }, /*#__PURE__*/React$1.createElement(ItemsCounterGraphPanel, {
@@ -29987,7 +29998,6 @@ const CategorySalesPanel = ({
29987
29998
  graphCounterMax: graphCounterMax
29988
29999
  })), /*#__PURE__*/React$1.createElement(FieldContainer, {
29989
30000
  "data-testid": "field-container-value-of-items",
29990
- width: "10%",
29991
30001
  fontwidth: 400,
29992
30002
  fontSize: "14px"
29993
30003
  }, `${displayFormattedValue(categorySales.valueOfItems)}`)), isOpen && /*#__PURE__*/React$1.createElement(AccordionContent, {
@@ -30063,8 +30073,16 @@ const CategorySalesMainContainer = styled.div`
30063
30073
  `;
30064
30074
  const CategoryHeadersContainer = styled.div`
30065
30075
  display: flex;
30066
- flex-direction: row;
30067
- padding: 10px ;
30076
+ padding: 10px;
30077
+ > div {
30078
+ &:first-of-type {
30079
+ padding-left: 40px;
30080
+ box-sizing: border-box;
30081
+ }
30082
+ &:last-of-type {
30083
+ margin-left: auto;
30084
+ }
30085
+ }
30068
30086
  `;
30069
30087
  const CategoryHeader = styled.div`
30070
30088
  display: flex;
@@ -30082,7 +30100,6 @@ const CategorySalesDataContainer = styled.div`
30082
30100
  ${scrollableStyles}
30083
30101
  `;
30084
30102
 
30085
- /* BreakdownPanel */
30086
30103
  const BreakdownPanel = props => {
30087
30104
  const {
30088
30105
  title = '',
@@ -30097,10 +30114,9 @@ const BreakdownPanel = props => {
30097
30114
  }
30098
30115
  } = props;
30099
30116
  const getCategoryHeaderWidth = index => {
30100
- if (index === 0) return "2.5%";
30101
- if (index === 1) return "23.2%";
30102
- if (index === 2) return "64.8%";
30103
- if (index === 3) return "9.5%";
30117
+ if (index === 0) return "360px";
30118
+ if (index === 1) return "auto";
30119
+ if (index === 2) return "21%";
30104
30120
  };
30105
30121
  return /*#__PURE__*/React$1.createElement(BreakdownPanelContainer, {
30106
30122
  "data-testid": "breakdown-panel-container",
@@ -30120,12 +30136,12 @@ const BreakdownPanel = props => {
30120
30136
  "data-testid": "category-sales-main-container"
30121
30137
  }, /*#__PURE__*/React$1.createElement(CategoryHeadersContainer, {
30122
30138
  "data-testid": "category-headers-container"
30123
- }, categoryHeaders && ["", ...categoryHeaders].map((headerTitle, index) => /*#__PURE__*/React$1.createElement(CategoryHeader, {
30139
+ }, categoryHeaders?.map((headerTitle, index) => /*#__PURE__*/React$1.createElement(CategoryHeader, {
30124
30140
  "data-testid": "category-header",
30125
- width: getCategoryHeaderWidth(index),
30126
- key: headerTitle
30141
+ key: headerTitle,
30142
+ width: getCategoryHeaderWidth(index)
30127
30143
  }, headerTitle))), /*#__PURE__*/React$1.createElement(CategorySalesDataContainer, {
30128
- "data-testid": "category-sales-data-container"
30144
+ "data-testid": "caitem-sales-panel-containerer"
30129
30145
  }, data.map((categorySales, index) => /*#__PURE__*/React$1.createElement(CategorySalesPanel, {
30130
30146
  "data-testid": "category-sales-panel",
30131
30147
  key: categorySales.category || index,