sag_components 2.0.0-beta176 → 2.0.0-beta178

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -10555,24 +10555,23 @@ const QuarterPopupPicker = ({
10555
10555
  };
10556
10556
 
10557
10557
  /* eslint-disable import/no-extraneous-dependencies */
10558
- const QuarterPicker = _ref => {
10559
- let {
10560
- availableQuarters,
10561
- // ["Q1-2024"]
10562
- label,
10563
- onChange,
10564
- borderRadius,
10565
- required,
10566
- width,
10567
- height,
10568
- placeholder,
10569
- disabled,
10570
- borderColor,
10571
- borderColorFocus,
10572
- textColor,
10573
- selectedValue,
10574
- startYear
10575
- } = _ref;
10558
+ const QuarterPicker = ({
10559
+ availableQuarters,
10560
+ // ["Q1-2024"]
10561
+ label,
10562
+ onChange,
10563
+ borderRadius,
10564
+ required,
10565
+ width,
10566
+ height,
10567
+ placeholder,
10568
+ disabled,
10569
+ borderColor,
10570
+ borderColorFocus,
10571
+ textColor,
10572
+ selectedValue,
10573
+ startYear
10574
+ }) => {
10576
10575
  const [isFocused, setIsFocused] = React$1.useState(false);
10577
10576
  const [isOpen, setIsOpen] = React$1.useState(false);
10578
10577
  const [value, setValue] = React$1.useState('');
@@ -35410,18 +35409,19 @@ const MainContainer = styled__default["default"].div`
35410
35409
  display: flex;
35411
35410
  flex-direction: column;
35412
35411
  align-content: center;
35413
- justify-content: center;
35412
+ justify-content: flex-start;
35414
35413
  align-items: flex-start;
35415
- width: ${props => props.width || '300px'};
35414
+ width: ${props => props.width || '300px'};
35415
+ height: ${props => props.height || '45px'};
35416
35416
  font-family: "Poppins", sans-serif;
35417
35417
  font-weight: 400;
35418
35418
  font-size: 14px;
35419
35419
  border-radius: ${props => props.size === 'small' ? '8px' : '12px'};
35420
35420
  padding: 0;
35421
35421
  cursor: ${props => props.disabled ? 'not-allowed' : 'default'};
35422
+ min-height: ${props => props.multiline ? '80px' : 'auto'};
35422
35423
  `;
35423
35424
  const Label$3 = styled__default["default"].label`
35424
-
35425
35425
  font-size: ${props => props.isFocused || props.hasValue ? '14px' : '14px'};
35426
35426
  font-weight: 400;
35427
35427
  padding-inline-end: 5px;
@@ -35431,8 +35431,18 @@ const Label$3 = styled__default["default"].label`
35431
35431
  color: ${props => props.error ? 'red' : props.disabled ? '#D0D0D0' : props.labelColor};
35432
35432
  background-color: ${props => props.disabled && props.isDarkerBackground ? '#F2F2F2' : '#fff'};
35433
35433
  position: absolute;
35434
- top: ${props => props.isFocused || props.hasValue ? '0px' : props.size === 'medium' ? '27px' : '17px'};
35435
- left: ${props => props.isFocused || props.hasValue ? '23px' : props.leftIcon && props.leftIcon !== 'none' ? '42px' : '16px'};
35434
+ top: ${props => {
35435
+ if (props.multiline) {
35436
+ return props.isFocused || props.hasValue ? '0px' : '20px';
35437
+ }
35438
+ return props.isFocused || props.hasValue ? '0px' : props.size === 'medium' ? '27px' : '17px';
35439
+ }};
35440
+ left: ${props => {
35441
+ if (props.multiline) {
35442
+ return props.isFocused || props.hasValue ? '23px' : '16px';
35443
+ }
35444
+ return props.isFocused || props.hasValue ? '23px' : props.leftIcon && props.leftIcon !== 'none' ? '42px' : '16px';
35445
+ }};
35436
35446
  font-family: Poppins;
35437
35447
  transform: translateY(-50%);
35438
35448
  transition: top 0.3s ease, font-size 0.3s ease, color 0.3s ease;
@@ -35449,17 +35459,17 @@ const InputContainer = styled__default["default"].div`
35449
35459
  display: flex;
35450
35460
  flex-wrap: nowrap;
35451
35461
  justify-content: flex-start;
35452
- align-content: center;
35462
+ align-content: ${props => props.multiline ? 'flex-start' : 'center'};
35453
35463
  white-space: pre-wrap;
35454
- align-items: center;
35464
+ align-items: ${props => props.multiline ? 'flex-start' : 'center'};
35455
35465
  overflow: hidden;
35456
- padding: 0 16px;
35457
- gap: 14px;
35466
+ padding: ${props => props.multiline ? '16px' : '0 16px'};
35467
+ gap: ${props => props.multiline ? '0' : '14px'};
35458
35468
  width: 100%;
35459
35469
  height: 100%;
35460
35470
  box-sizing: border-box;
35461
35471
  background-color: ${props => props.disabled && props.isDarkerBackground ? '#F2F2F2' : '#fff'};
35462
- border: 1px solid ${props => props.disabled ? '#D0D0D0' : props.error ? 'red' : '#B1B1B1'};
35472
+ border: 1px solid ${props => props.disabled ? '#D0D0D0' : props.error ? 'red' : '#B1B1B1'};
35463
35473
  font-family: "Poppins", sans-serif;
35464
35474
  font-weight: 400;
35465
35475
  font-size: 14px;
@@ -35471,10 +35481,9 @@ const InputContainer = styled__default["default"].div`
35471
35481
  border: 1px solid ${props => props.disabled ? '#D0D0D0' : props.error ? 'red' : props.labelColor || '#212121'};
35472
35482
  }
35473
35483
 
35474
- &:focus {
35484
+ &:focus-within {
35475
35485
  border: 1px solid ${props => props.disabled ? '#D0D0D0' : props.error ? 'red' : props.labelColor || '#212121'};
35476
35486
  }
35477
-
35478
35487
  `;
35479
35488
  const InputSubContainer = styled__default["default"].div`
35480
35489
  display: flex;
@@ -35482,13 +35491,16 @@ const InputSubContainer = styled__default["default"].div`
35482
35491
  flex-wrap: nowrap;
35483
35492
  align-content: center;
35484
35493
  align-items: flex-start;
35485
- justify-content: center;
35494
+ justify-content: ${props => props.multiline ? 'flex-start' : 'center'};
35486
35495
  white-space: pre-wrap;
35487
35496
  overflow: hidden;
35488
- padding: 5px 0;
35497
+ padding: ${props => props.multiline ? '5px 0 0 0' : '5px 0'};
35489
35498
  width: 100%;
35490
- height: 100%;
35491
- min-height: ${props => props.size === 'medium' ? '52px' : '32px'};
35499
+ height: ${props => props.height || '45px'};
35500
+ min-height: ${props => {
35501
+ if (props.multiline) return 'auto';
35502
+ return props.size === 'medium' ? '52px' : '32px';
35503
+ }};
35492
35504
  box-sizing: border-box;
35493
35505
  background-color: ${props => props.disabled && props.isDarkerBackground ? '#F2F2F2' : '#fff'};
35494
35506
  border-radius: ${props => props.size === 'small' ? '8px' : '12px'};
@@ -35498,14 +35510,59 @@ const InputSubContainer = styled__default["default"].div`
35498
35510
  `;
35499
35511
  const StyledInput = styled__default["default"].input`
35500
35512
  width: calc(100% - 10px);
35501
- height: 20px;
35513
+ height: ${props => props.height || '20px'};
35502
35514
  font-weight: 400;
35503
35515
  font-size: 14px;
35504
35516
  outline: none;
35505
35517
  color: ${props => props.disabled ? '#D0D0D0' : '#212121'};
35506
35518
  background-color: ${props => props.disabled && props.isDarkerBackground ? '#F2F2F2' : '#fff'};
35507
35519
  border: none;
35508
- cursor: ${props => props.disabled ? 'not-allowed' : 'pointer'};
35520
+ cursor: ${props => props.disabled ? 'not-allowed' : 'text'};
35521
+ font-family: "Poppins", sans-serif;
35522
+ `;
35523
+ const StyledTextarea = styled__default["default"].textarea`
35524
+ width: 100%;
35525
+ min-height: 60px;
35526
+ font-weight: 400;
35527
+ font-size: 14px;
35528
+ outline: none;
35529
+ color: ${props => props.disabled ? '#D0D0D0' : '#212121'};
35530
+ background-color: ${props => props.disabled && props.isDarkerBackground ? '#F2F2F2' : '#fff'};
35531
+ border: none;
35532
+ cursor: ${props => props.disabled ? 'not-allowed' : 'text'};
35533
+ font-family: "Poppins", sans-serif;
35534
+ resize: vertical;
35535
+ line-height: 1.4;
35536
+ padding: 0;
35537
+ margin-top: 10px;
35538
+
35539
+ &::placeholder {
35540
+ color: #999;
35541
+ font-style: italic;
35542
+ }
35543
+
35544
+ &:focus {
35545
+ outline: none;
35546
+ }
35547
+
35548
+ /* Remove default textarea styling */
35549
+ &::-webkit-scrollbar {
35550
+ width: 6px;
35551
+ }
35552
+
35553
+ &::-webkit-scrollbar-track {
35554
+ background: #f1f1f1;
35555
+ border-radius: 3px;
35556
+ }
35557
+
35558
+ &::-webkit-scrollbar-thumb {
35559
+ background: #c1c1c1;
35560
+ border-radius: 3px;
35561
+ }
35562
+
35563
+ &::-webkit-scrollbar-thumb:hover {
35564
+ background: #a8a8a8;
35565
+ }
35509
35566
  `;
35510
35567
  const ErrorMessage = styled__default["default"].div`
35511
35568
  font-size: 12px;
@@ -35538,6 +35595,7 @@ const Input$2 = _ref => {
35538
35595
  disabled,
35539
35596
  isDarkerBackground = false,
35540
35597
  width,
35598
+ height = '50px',
35541
35599
  error,
35542
35600
  errorMessage,
35543
35601
  labelColor,
@@ -35545,7 +35603,12 @@ const Input$2 = _ref => {
35545
35603
  rightIcon,
35546
35604
  password,
35547
35605
  leftIconOnClick,
35548
- rightIconOnClick
35606
+ rightIconOnClick,
35607
+ multiline = false,
35608
+ // New prop to enable textarea mode
35609
+ rows = 3,
35610
+ // New prop for textarea rows
35611
+ maxLength // New prop for character limit
35549
35612
  } = _ref;
35550
35613
  const [isFocused, setIsFocused] = React$1.useState(false);
35551
35614
  const [inputValue, setInputValue] = React$1.useState('');
@@ -35619,12 +35682,24 @@ const Input$2 = _ref => {
35619
35682
  }
35620
35683
  return getIcon('eye', '14px', '14px', error ? 'red' : labelColor, disabled, 'pointer', toggleShowPassword);
35621
35684
  };
35685
+
35686
+ // Calculate dynamic height for multiline inputs
35687
+ const calculateHeight = () => {
35688
+ if (!multiline) return height;
35689
+ const baseHeight = size === 'small' ? 32 : 52;
35690
+ const lineHeight = 20;
35691
+ const padding = 10;
35692
+ return `${baseHeight + (rows - 1) * lineHeight + padding}px`;
35693
+ };
35694
+ const InputElement = multiline ? StyledTextarea : StyledInput;
35622
35695
  return /*#__PURE__*/React__default["default"].createElement(MainContainer, {
35623
35696
  className: "MainContainer",
35624
35697
  width: width,
35698
+ height: calculateHeight(),
35625
35699
  size: size,
35626
35700
  disabled: disabled,
35627
- isDarkerBackground: isDarkerBackground
35701
+ isDarkerBackground: isDarkerBackground,
35702
+ multiline: multiline
35628
35703
  }, /*#__PURE__*/React__default["default"].createElement(InputContainer, {
35629
35704
  className: "InputContainer",
35630
35705
  labelColor: labelColor,
@@ -35632,8 +35707,9 @@ const Input$2 = _ref => {
35632
35707
  isDarkerBackground: isDarkerBackground,
35633
35708
  error: error,
35634
35709
  isFocused: isFocused,
35635
- size: size
35636
- }, getLeftIcon(), /*#__PURE__*/React__default["default"].createElement(InputSubContainer, {
35710
+ size: size,
35711
+ multiline: multiline
35712
+ }, !multiline && getLeftIcon(), /*#__PURE__*/React__default["default"].createElement(InputSubContainer, {
35637
35713
  className: "InputSubContainer",
35638
35714
  ref: containerRef,
35639
35715
  labelColor: labelColor,
@@ -35641,26 +35717,29 @@ const Input$2 = _ref => {
35641
35717
  isDarkerBackground: isDarkerBackground,
35642
35718
  error: error,
35643
35719
  onClick: handleLabelClick,
35644
- size: size
35720
+ height: calculateHeight(),
35721
+ size: size,
35722
+ multiline: multiline
35645
35723
  }, /*#__PURE__*/React__default["default"].createElement(Label$3, {
35646
35724
  className: "Label",
35647
35725
  isFocused: isFocused,
35648
35726
  labelColor: labelColor,
35649
35727
  hasValue: inputValue,
35650
- leftIcon: leftIcon,
35728
+ leftIcon: !multiline ? leftIcon : 'none',
35651
35729
  disabled: disabled,
35652
35730
  isDarkerBackground: isDarkerBackground,
35653
35731
  error: error,
35654
35732
  errorMessage: errorMessage,
35655
35733
  onClick: handleLabelClick,
35656
- size: size
35734
+ size: size,
35735
+ multiline: multiline
35657
35736
  }, inputValue ? label : labelEmptyValue || label, required && /*#__PURE__*/React__default["default"].createElement("span", {
35658
35737
  style: {
35659
35738
  color: disabled ? '#D0D0D0' : 'red',
35660
35739
  height: '16px'
35661
35740
  }
35662
- }, "*")), /*#__PURE__*/React__default["default"].createElement(StyledInput, {
35663
- className: "StyledInput",
35741
+ }, "*")), /*#__PURE__*/React__default["default"].createElement(InputElement, {
35742
+ className: multiline ? "StyledTextarea" : "StyledInput",
35664
35743
  ref: inputRef,
35665
35744
  type: password && !showPassword ? 'password' : 'text',
35666
35745
  value: inputValue,
@@ -35672,11 +35751,22 @@ const Input$2 = _ref => {
35672
35751
  isDarkerBackground: isDarkerBackground,
35673
35752
  placeholder: isFocused ? placeHolder : '',
35674
35753
  error: error,
35675
- isFocused: isFocused
35676
- })), password ? getPasswordIcon() : getRightIcon()), error && errorMessage?.length > 0 && /*#__PURE__*/React__default["default"].createElement(ErrorMessage, {
35754
+ height: calculateHeight(),
35755
+ isFocused: isFocused,
35756
+ rows: multiline ? rows : undefined,
35757
+ maxLength: maxLength,
35758
+ multiline: multiline
35759
+ })), !multiline && (password ? getPasswordIcon() : getRightIcon())), error && errorMessage?.length > 0 && /*#__PURE__*/React__default["default"].createElement(ErrorMessage, {
35677
35760
  className: "ErrorMessage",
35678
35761
  width: width
35679
- }, errorMessage));
35762
+ }, errorMessage), multiline && maxLength && /*#__PURE__*/React__default["default"].createElement("div", {
35763
+ style: {
35764
+ fontSize: '12px',
35765
+ color: inputValue.length > maxLength * 0.9 ? 'orange' : '#666',
35766
+ textAlign: 'right',
35767
+ marginTop: '4px'
35768
+ }
35769
+ }, inputValue.length, "/", maxLength));
35680
35770
  };
35681
35771
  Input$2.propTypes = {
35682
35772
  placeHolder: PropTypes.string,
@@ -35696,7 +35786,10 @@ Input$2.propTypes = {
35696
35786
  onBlur: PropTypes.func,
35697
35787
  leftIcon: PropTypes.string,
35698
35788
  rightIcon: PropTypes.string,
35699
- password: PropTypes.bool
35789
+ password: PropTypes.bool,
35790
+ multiline: PropTypes.bool,
35791
+ rows: PropTypes.number,
35792
+ maxLength: PropTypes.number
35700
35793
  };
35701
35794
  Input$2.defaultProps = {
35702
35795
  placeHolder: 'Type...',
@@ -35715,7 +35808,10 @@ Input$2.defaultProps = {
35715
35808
  leftIconOnClick: () => {},
35716
35809
  rightIconOnClick: () => {},
35717
35810
  onBlur: () => {},
35718
- password: false
35811
+ password: false,
35812
+ multiline: false,
35813
+ rows: 3,
35814
+ maxLength: undefined
35719
35815
  };
35720
35816
 
35721
35817
  const ToggleSwitchLabel = styled__default["default"].label`
@@ -35723,12 +35819,9 @@ const ToggleSwitchLabel = styled__default["default"].label`
35723
35819
  position: relative;
35724
35820
  cursor: pointer;
35725
35821
  user-select: none;
35726
- opacity: ${_ref => {
35727
- let {
35728
- disabled
35729
- } = _ref;
35730
- return disabled ? 0.5 : 1;
35731
- }};
35822
+ opacity: ${({
35823
+ disabled
35824
+ }) => disabled ? 0.5 : 1};
35732
35825
  `;
35733
35826
  const ToggleInput = styled__default["default"].input`
35734
35827
  display: none;
@@ -35736,19 +35829,15 @@ const ToggleInput = styled__default["default"].input`
35736
35829
  const ToggleSlider = styled__default["default"].span`
35737
35830
  display: block;
35738
35831
  position: relative;
35739
- background: ${_ref2 => {
35740
- let {
35741
- checked,
35742
- disabled
35743
- } = _ref2;
35744
- return checked ? disabled ? "#7bb1b0" : "#006d6a" : "#cfd8dc";
35745
- }};
35832
+ background: ${({
35833
+ checked,
35834
+ disabled
35835
+ }) => checked ? disabled ? "#7bb1b0" : "#006d6a" : "#cfd8dc"};
35746
35836
  border-radius: 999px;
35747
35837
  transition: background 0.2s;
35748
- ${_ref3 => {
35749
- let {
35750
- size
35751
- } = _ref3;
35838
+ ${({
35839
+ size
35840
+ }) => {
35752
35841
  switch (size) {
35753
35842
  case "s":
35754
35843
  return styled.css`width: 40px; height: 20px;`;
@@ -35767,10 +35856,9 @@ const ToggleSlider = styled__default["default"].span`
35767
35856
  background: #fff;
35768
35857
  border-radius: 50%;
35769
35858
  transition: left 0.2s, width 0.2s, height 0.2s;
35770
- ${_ref4 => {
35771
- let {
35772
- size
35773
- } = _ref4;
35859
+ ${({
35860
+ size
35861
+ }) => {
35774
35862
  switch (size) {
35775
35863
  case "s":
35776
35864
  return styled.css`width: 14px; height: 14px;`;
@@ -35780,11 +35868,10 @@ const ToggleSlider = styled__default["default"].span`
35780
35868
  return styled.css`width: 20px; height: 20px;`;
35781
35869
  }
35782
35870
  }}
35783
- left: ${_ref5 => {
35784
- let {
35785
- checked,
35786
- size
35787
- } = _ref5;
35871
+ left: ${({
35872
+ checked,
35873
+ size
35874
+ }) => {
35788
35875
  if (!checked) return "3px";
35789
35876
  switch (size) {
35790
35877
  case "s":
@@ -37767,7 +37854,9 @@ const TableHeader = ({
37767
37854
  onSelectAll,
37768
37855
  activeFilters = [],
37769
37856
  activeSorts = [],
37770
- expandable = false
37857
+ expandable = false,
37858
+ onHeaderCheckboxClick = () => {},
37859
+ headerCheckboxStates = {}
37771
37860
  }) => {
37772
37861
  const [focusedFilter, setFocusedFilter] = React$1.useState(null);
37773
37862
  const [focusedSort, setFocusedSort] = React$1.useState(null);
@@ -38117,6 +38206,20 @@ const TableHeader = ({
38117
38206
  return isFocused || isActive || hasSelection;
38118
38207
  };
38119
38208
 
38209
+ // Handle header checkbox click
38210
+ const handleHeaderCheckboxClick = (columnKey, event) => {
38211
+ // Don't prevent the default checkbox behavior
38212
+ const newValue = event.target.checked;
38213
+
38214
+ // Fire the callback with column info and new value - let parent handle state
38215
+ if (onHeaderCheckboxClick) {
38216
+ onHeaderCheckboxClick({
38217
+ columnName: columnKey,
38218
+ checked: newValue
38219
+ });
38220
+ }
38221
+ };
38222
+
38120
38223
  // Update showColumnFilter to pass current filterSelections to stateless FilterPop
38121
38224
  const showColumnFilter = column => {
38122
38225
  const {
@@ -38220,7 +38323,24 @@ const TableHeader = ({
38220
38323
  type: "checkbox",
38221
38324
  onChange: e => handleCheckboxChange(column.key, e.target.checked),
38222
38325
  "data-column": column.key
38223
- }), /*#__PURE__*/React__default["default"].createElement(ColumnLabel, null, column.title), (column.filter || column.sort) && /*#__PURE__*/React__default["default"].createElement(ColumnActions, null, column.sort && /*#__PURE__*/React__default["default"].createElement(IconButton, {
38326
+ }), column.fieldType?.toLowerCase() === 'checkbox' && column.showCheckboxInTitle !== false && /*#__PURE__*/React__default["default"].createElement(ColumnCheckbox, {
38327
+ type: "checkbox",
38328
+ checked: headerCheckboxStates[column.key] || false,
38329
+ onChange: e => handleHeaderCheckboxClick(column.key, e),
38330
+ "data-column": column.key,
38331
+ style: {
38332
+ width: '18px',
38333
+ height: '18px',
38334
+ marginLeft: '10px',
38335
+ // Moved 5px more to the right (was 5px)
38336
+ cursor: 'pointer',
38337
+ accentColor: '#066768',
38338
+ // Use the same green color as row checkboxes
38339
+ display: 'flex',
38340
+ alignItems: 'center',
38341
+ justifyContent: 'center'
38342
+ }
38343
+ }), column.fieldType?.toLowerCase() !== 'checkbox' && /*#__PURE__*/React__default["default"].createElement(ColumnLabel, null, column.title), (column.filter || column.sort) && /*#__PURE__*/React__default["default"].createElement(ColumnActions, null, column.sort && /*#__PURE__*/React__default["default"].createElement(IconButton, {
38224
38344
  ref: el => iconRefs.current[`sort-${column.key}`] = el,
38225
38345
  onClick: () => handleSort(column.key),
38226
38346
  onMouseEnter: () => setFocusedSort(column.key),
@@ -39196,8 +39316,19 @@ const DropdownButton$1 = styled__default["default"].button`
39196
39316
  align-items: center;
39197
39317
  justify-content: space-between;
39198
39318
  width: 100%;
39199
- min-width: 120px;
39200
- background-color: ${props => props.$isRowFocused || props.$isRowHovered ? props.$selectedColor : "white"};
39319
+ min-width: 120px;
39320
+ background-color: ${props => {
39321
+ // When row is being hovered (regardless of focus state), use hover color
39322
+ if (props.$isRowHovered) {
39323
+ return props.$selectedColor; // Use selected color for row hover
39324
+ }
39325
+ // Row focused/selected state (only when NOT hovering the row) - should use selected color
39326
+ if (props.$isRowFocused) {
39327
+ return props.$selectedColor; // Use selected color when row is focused/selected
39328
+ }
39329
+ // Default
39330
+ return 'white';
39331
+ }};
39201
39332
  border: none;
39202
39333
  border-radius: 0;
39203
39334
  font-family: "Poppins", sans-serif;
@@ -39230,7 +39361,22 @@ const DropdownIcon = styled__default["default"].div`
39230
39361
  justify-content: center;
39231
39362
  width: 20px;
39232
39363
  height: 20px;
39233
- background-color: ${props => props.$isRowFocused || props.$isRowHovered ? '#B4D1D2' : 'white'};
39364
+ background-color: ${props => {
39365
+ // Highest Priority: dropdown-specific hover takes precedence over everything
39366
+ if (props.$isDropdownHovered) {
39367
+ return '#B4D1D2'; // Green color when specifically hovering this dropdown
39368
+ }
39369
+ // When row is being hovered (regardless of focus state), other dropdowns should use hover color
39370
+ if (props.$isRowHovered) {
39371
+ return '#E6F0F0'; // Light gray when row is hovered but not this specific dropdown
39372
+ }
39373
+ // Row focused/selected state (only when NOT hovering the row) - should use green color
39374
+ if (props.$isRowFocused) {
39375
+ return '#B4D1D2'; // Green color when row is focused/selected but not being hovered
39376
+ }
39377
+ // Default
39378
+ return 'white';
39379
+ }};
39234
39380
  border-radius: 4px;
39235
39381
  margin-left: 8px;
39236
39382
  transition: all 0.2s ease;
@@ -39242,8 +39388,14 @@ const DropdownIcon = styled__default["default"].div`
39242
39388
  const DropdownMenu = styled__default["default"].div`
39243
39389
  position: absolute;
39244
39390
  top: calc(100%);
39245
- left: 0;
39246
- right: 0;
39391
+ ${props => {
39392
+ if (props.$dropdownOptionsAlignment === 'left') {
39393
+ return props.$dropdownOptionsWidth ? `left: 0; width: ${props.$dropdownOptionsWidth};` : 'left: 0; right: 0;';
39394
+ } else {
39395
+ // Default: right alignment
39396
+ return props.$dropdownOptionsWidth ? `right: 0; width: ${props.$dropdownOptionsWidth};` : 'left: 0; right: 0;';
39397
+ }
39398
+ }}
39247
39399
  z-index: 1000;
39248
39400
  background-color: white;
39249
39401
  border: none;
@@ -39312,23 +39464,41 @@ const Dropdown = ({
39312
39464
  maxDropdownHeight,
39313
39465
  isRowFocused = false,
39314
39466
  isRowHovered = false,
39315
- selectedColor
39467
+ selectedColor,
39468
+ dropdownOptionsWidth,
39469
+ dropdownOptionsAlignment = 'right',
39470
+ placeholder = 'Select...'
39316
39471
  }) => {
39317
- return /*#__PURE__*/React__default["default"].createElement(DropdownContainer$1, null, /*#__PURE__*/React__default["default"].createElement(DropdownButton$1, {
39472
+ const [isDropdownHovered, setIsDropdownHovered] = React$1.useState(false);
39473
+
39474
+ // Reset dropdown hover state when dropdown closes
39475
+ React$1.useEffect(() => {
39476
+ if (!isOpen) {
39477
+ setIsDropdownHovered(false);
39478
+ }
39479
+ }, [isOpen]);
39480
+ return /*#__PURE__*/React__default["default"].createElement(DropdownContainer$1, {
39481
+ onMouseEnter: () => setIsDropdownHovered(true),
39482
+ onMouseLeave: () => setIsDropdownHovered(false)
39483
+ }, /*#__PURE__*/React__default["default"].createElement(DropdownButton$1, {
39318
39484
  onClick: onToggle,
39319
39485
  $isOpen: isOpen,
39320
39486
  $isRowFocused: isRowFocused,
39487
+ $isRowHovered: isRowHovered,
39321
39488
  $selectedColor: selectedColor
39322
39489
  }, /*#__PURE__*/React__default["default"].createElement("span", null, displayText), /*#__PURE__*/React__default["default"].createElement(DropdownIcon, {
39323
39490
  $isOpen: isOpen,
39324
39491
  $isRowFocused: isRowFocused,
39325
- $isRowHovered: isRowHovered
39492
+ $isRowHovered: isRowHovered,
39493
+ $isDropdownHovered: isDropdownHovered
39326
39494
  }, /*#__PURE__*/React__default["default"].createElement(MenuItemOpenIcon, {
39327
39495
  width: "10",
39328
39496
  height: "6",
39329
39497
  color: "#212121"
39330
39498
  }))), isOpen && /*#__PURE__*/React__default["default"].createElement(DropdownMenu, {
39331
- $maxDropdownHeight: maxDropdownHeight
39499
+ $maxDropdownHeight: maxDropdownHeight,
39500
+ $dropdownOptionsWidth: dropdownOptionsWidth,
39501
+ $dropdownOptionsAlignment: dropdownOptionsAlignment
39332
39502
  }, options.map((option, index) => /*#__PURE__*/React__default["default"].createElement(DropdownOption, {
39333
39503
  key: index,
39334
39504
  onClick: e => onOptionSelect(option, e),
@@ -39352,7 +39522,10 @@ Dropdown.propTypes = {
39352
39522
  maxDropdownHeight: PropTypes.string,
39353
39523
  isRowFocused: PropTypes.bool,
39354
39524
  isRowHovered: PropTypes.bool,
39355
- selectedColor: PropTypes.string
39525
+ selectedColor: PropTypes.string,
39526
+ dropdownOptionsWidth: PropTypes.string,
39527
+ dropdownOptionsAlignment: PropTypes.oneOf(['left', 'right']),
39528
+ placeholder: PropTypes.string
39356
39529
  };
39357
39530
 
39358
39531
  // TableBody.jsx
@@ -39391,6 +39564,8 @@ const TableBody = ({
39391
39564
  expandedBackgroundColor = '#E6F0F0',
39392
39565
  // New prop with default
39393
39566
  onDropdownSelected = () => {},
39567
+ onCheckboxClick = () => {},
39568
+ onHeaderCheckboxClick = () => {},
39394
39569
  ref = null
39395
39570
  }) => {
39396
39571
  const [hoveredRowIndex, setHoveredRowIndex] = React$1.useState(null);
@@ -39740,10 +39915,13 @@ const TableBody = ({
39740
39915
  const isOpen = openDropdowns[dropdownKey] || false;
39741
39916
  const dropdownOptions = column.dropdownOptions || [];
39742
39917
  const maxDropdownHeight = column.maxDropdownHeight || '200px';
39918
+ const dropdownOptionsWidth = column.dropdownOptionsWidth; // Get from column config
39919
+ const dropdownOptionsAlignment = column.dropdownOptionsAlignment || 'right'; // Get from column config, default to 'right'
39920
+ const placeholder = column.placeholder || 'Select...'; // Get from column config, default to 'Select...'
39743
39921
 
39744
39922
  // Find the current selected option to display its label
39745
39923
  const currentOption = dropdownOptions.find(option => option.value === value);
39746
- const displayText = currentOption ? currentOption.label : value || 'Select...';
39924
+ const displayText = currentOption ? currentOption.label : value || placeholder;
39747
39925
  return /*#__PURE__*/React__default["default"].createElement(Dropdown, {
39748
39926
  isOpen: isOpen,
39749
39927
  options: dropdownOptions,
@@ -39752,10 +39930,37 @@ const TableBody = ({
39752
39930
  onToggle: e => handleDropdownClick(rowIndex, column.key, e),
39753
39931
  onOptionSelect: (option, e) => handleDropdownOptionClick(row, rowIndex, column.key, option, e),
39754
39932
  maxDropdownHeight: maxDropdownHeight,
39933
+ dropdownOptionsWidth: dropdownOptionsWidth,
39934
+ dropdownOptionsAlignment: dropdownOptionsAlignment,
39935
+ placeholder: placeholder,
39755
39936
  isRowFocused: focusedRowIndex === rowIndex,
39756
39937
  isRowHovered: hoveredRowIndex === rowIndex,
39757
39938
  selectedColor: selectedColor
39758
39939
  });
39940
+ case 'checkbox':
39941
+ const isChecked = Boolean(value); // Convert to boolean
39942
+
39943
+ return /*#__PURE__*/React__default["default"].createElement("div", {
39944
+ style: {
39945
+ display: 'flex',
39946
+ alignItems: 'center',
39947
+ justifyContent: 'center',
39948
+ width: '100%',
39949
+ height: '100%'
39950
+ }
39951
+ }, /*#__PURE__*/React__default["default"].createElement("input", {
39952
+ type: "checkbox",
39953
+ checked: isChecked,
39954
+ onChange: e => handleCheckboxClick(row, column.key, e),
39955
+ onClick: e => e.stopPropagation() // Prevent row click on checkbox click
39956
+ ,
39957
+ style: {
39958
+ width: '18px',
39959
+ height: '18px',
39960
+ cursor: 'pointer',
39961
+ accentColor: buttonColor // Use the theme color for checkbox
39962
+ }
39963
+ }));
39759
39964
  default:
39760
39965
  // Treat default as text
39761
39966
  return value.toString();
@@ -39775,6 +39980,28 @@ const TableBody = ({
39775
39980
  }
39776
39981
  };
39777
39982
 
39983
+ // Handle checkbox click
39984
+ const handleCheckboxClick = (row, columnKey, event) => {
39985
+ event.stopPropagation();
39986
+ const currentValue = row[columnKey];
39987
+ const newValue = !currentValue; // Toggle the value
39988
+
39989
+ // Create updated row with new checkbox value
39990
+ const updatedRow = {
39991
+ ...row,
39992
+ [columnKey]: newValue
39993
+ };
39994
+
39995
+ // Fire the onCheckboxClick event with updated row
39996
+ if (onCheckboxClick) {
39997
+ onCheckboxClick({
39998
+ fullRow: updatedRow,
39999
+ columnName: columnKey,
40000
+ checked: newValue
40001
+ });
40002
+ }
40003
+ };
40004
+
39778
40005
  // Handle dropdown click
39779
40006
  const handleDropdownClick = (rowIndex, columnKey, event) => {
39780
40007
  event.stopPropagation();
@@ -39911,6 +40138,8 @@ TableBody.propTypes = {
39911
40138
  onCommentSave: PropTypes.func,
39912
40139
  commentTextLimit: PropTypes.number,
39913
40140
  onDropdownSelected: PropTypes.func,
40141
+ onCheckboxClick: PropTypes.func,
40142
+ onHeaderCheckboxClick: PropTypes.func,
39914
40143
  ref: PropTypes.object
39915
40144
  };
39916
40145
  TableBody.displayName = 'TableBody';
@@ -43270,6 +43499,9 @@ const Table = props => {
43270
43499
  expandedBackgroundColor = '#E6F0F0',
43271
43500
  // New prop
43272
43501
  onDropdownSelected = () => {},
43502
+ onCheckboxClick = () => {},
43503
+ onHeaderCheckboxClick = () => {},
43504
+ headerCheckboxStates = {},
43273
43505
  // Accept ref as a regular prop
43274
43506
  ref = null
43275
43507
  } = props;
@@ -43396,7 +43628,9 @@ const Table = props => {
43396
43628
  onSort: onSort,
43397
43629
  onFilter: onFilter,
43398
43630
  onSelectAll: onSelectAll,
43399
- expandable: expandable
43631
+ expandable: expandable,
43632
+ onHeaderCheckboxClick: onHeaderCheckboxClick,
43633
+ headerCheckboxStates: headerCheckboxStates
43400
43634
  }), columns.length > 0 && data.length > 0 && /*#__PURE__*/React__default["default"].createElement(TableBody, {
43401
43635
  ref: tableBodyRef,
43402
43636
  columns: columns,
@@ -43417,7 +43651,9 @@ const Table = props => {
43417
43651
  expandedContent: expandedContent,
43418
43652
  onExpandRow: onExpandRow,
43419
43653
  expandedBackgroundColor: expandedBackgroundColor,
43420
- onDropdownSelected: onDropdownSelected
43654
+ onDropdownSelected: onDropdownSelected,
43655
+ onCheckboxClick: onCheckboxClick,
43656
+ onHeaderCheckboxClick: onHeaderCheckboxClick
43421
43657
  })), data.length === 0 && /*#__PURE__*/React__default["default"].createElement(NoEventsParent, null, /*#__PURE__*/React__default["default"].createElement(NoEventsWrapper, null, showNoDataInSearch ? getNoDataSearchIcon(noDataSearchIcon) : getNoDataIcon(noDataIcon)), /*#__PURE__*/React__default["default"].createElement(NoEventsMessage, null, showNoDataInSearch ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("strong", null, noDataInSearchTitle), /*#__PURE__*/React__default["default"].createElement("br", null), noDataInSearchMessage) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("strong", null, noEventsTitle), /*#__PURE__*/React__default["default"].createElement("br", null), noEventsSubtitle)), !showNoDataInSearch && showNoEventsButton && /*#__PURE__*/React__default["default"].createElement(Button$1, {
43422
43658
  height: "45px",
43423
43659
  leftIcon: noEventsButtonIcon,