sag_components 2.0.0-beta171 → 2.0.0-beta173

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
@@ -24023,21 +24023,22 @@ const DeleteIcon = styled__default["default"].div`
24023
24023
  position: absolute;
24024
24024
  `;
24025
24025
 
24026
- const QuickFilterDropdownSingle = ({
24027
- label,
24028
- hoverColor,
24029
- options,
24030
- selectedValue,
24031
- placeHolder,
24032
- onChange,
24033
- disabled,
24034
- width,
24035
- error,
24036
- errorMessage,
24037
- xIconShow,
24038
- labelColor,
24039
- showLabelOnTop
24040
- }) => {
24026
+ const QuickFilterDropdownSingle = _ref => {
24027
+ let {
24028
+ label,
24029
+ hoverColor,
24030
+ options,
24031
+ selectedValue,
24032
+ placeHolder,
24033
+ onChange,
24034
+ disabled,
24035
+ width,
24036
+ error,
24037
+ errorMessage,
24038
+ xIconShow,
24039
+ labelColor,
24040
+ showLabelOnTop
24041
+ } = _ref;
24041
24042
  const [isFocused, setIsFocused] = React$1.useState(false);
24042
24043
  const [showOptions, setShowOptions] = React$1.useState(false);
24043
24044
  const [inputValue, setInputValue] = React$1.useState("");
@@ -24434,23 +24435,24 @@ const IconContainer$2 = styled__default["default"].div`
24434
24435
  cursor: pointer;
24435
24436
  `;
24436
24437
 
24437
- const QuickFilterDropdownMultiSelection = ({
24438
- label,
24439
- labelEmptyValue,
24440
- options,
24441
- selectedValue,
24442
- placeHolder,
24443
- onChange,
24444
- required,
24445
- disabled,
24446
- width,
24447
- error,
24448
- errorMessage,
24449
- labelColor,
24450
- xIconShow,
24451
- checkBoxColor,
24452
- showLabelOnTop
24453
- }) => {
24438
+ const QuickFilterDropdownMultiSelection = _ref => {
24439
+ let {
24440
+ label,
24441
+ labelEmptyValue,
24442
+ options,
24443
+ selectedValue,
24444
+ placeHolder,
24445
+ onChange,
24446
+ required,
24447
+ disabled,
24448
+ width,
24449
+ error,
24450
+ errorMessage,
24451
+ labelColor,
24452
+ xIconShow,
24453
+ checkBoxColor,
24454
+ showLabelOnTop
24455
+ } = _ref;
24454
24456
  const [isFocused, setIsFocused] = React$1.useState(false);
24455
24457
  const [showOptions, setShowOptions] = React$1.useState(false);
24456
24458
  const [inputValue, setInputValue] = React$1.useState('');
@@ -35688,9 +35690,9 @@ const ToggleSlider = styled__default["default"].span`
35688
35690
  }
35689
35691
  `;
35690
35692
 
35691
- /**
35692
- * ToggleSwitch component for on/off states.
35693
- * Supports small/large sizes and disabled state.
35693
+ /**
35694
+ * ToggleSwitch component for on/off states.
35695
+ * Supports small/large sizes and disabled state.
35694
35696
  */
35695
35697
  function ToggleSwitch(_ref) {
35696
35698
  let {
@@ -38232,7 +38234,7 @@ const shimmerAnimation = styled.css`
38232
38234
  }
38233
38235
  `;
38234
38236
  const StyledTableBody = styled__default["default"].tbody`
38235
- background-color: white;
38237
+ background-color: ${props => props.$isRowFocused ? props.$selectedColor : "white"};
38236
38238
  font-family: "Poppins", sans-serif;
38237
38239
  position: relative;
38238
38240
  `;
@@ -38245,6 +38247,11 @@ const TableRow = styled__default["default"].tr`
38245
38247
 
38246
38248
  &:hover {
38247
38249
  background-color: #e6f0f0;
38250
+
38251
+ /* Update dropdown buttons when row is hovered */
38252
+ button {
38253
+ background-color: #e6f0f0 !important;
38254
+ }
38248
38255
  }
38249
38256
 
38250
38257
  &:last-child {
@@ -38265,7 +38272,7 @@ styled__default["default"].div`
38265
38272
  background-color: white;
38266
38273
  color: #333;
38267
38274
  padding: 10px 16px;
38268
- border-radius: 4px;
38275
+ border-radius: 0;
38269
38276
  font-family: "Poppins", sans-serif;
38270
38277
  font-size: 14px;
38271
38278
  font-weight: 400;
@@ -38321,6 +38328,12 @@ const TableCell = styled__default["default"].td`
38321
38328
  ${props => props.$fieldType === 'expand' && `
38322
38329
  padding: 12px 8px 12px 0px;
38323
38330
  `}
38331
+
38332
+ /* Special handling for dropdown cells - ensure proper overflow */
38333
+ ${props => props.$fieldType === 'dropdown' && `
38334
+ overflow: visible;
38335
+ position: relative;
38336
+ `}
38324
38337
 
38325
38338
  /* CSS-only tooltip */
38326
38339
  &[data-tooltip]:hover::before {
@@ -38719,9 +38732,7 @@ const ExpandedRow = styled__default["default"].tr`
38719
38732
  }
38720
38733
  `;
38721
38734
  const ExpandedContent = styled__default["default"].div`
38722
- padding: 16px;
38723
38735
  background-color: ${props => props.$expandedBackgroundColor || '#E6F0F0'};
38724
- border-left: 3px solid #e0e0e0;
38725
38736
  margin: 0;
38726
38737
 
38727
38738
  /* Ensure content doesn't interfere with table layout */
@@ -38729,6 +38740,124 @@ const ExpandedContent = styled__default["default"].div`
38729
38740
  box-sizing: border-box;
38730
38741
  `;
38731
38742
 
38743
+ // DROPDOWN STYLES
38744
+ const DropdownContainer$1 = styled__default["default"].div`
38745
+ position: relative;
38746
+ display: inline-block;
38747
+ width: 100%;
38748
+ font-family: "Poppins", sans-serif;
38749
+ `;
38750
+ const DropdownButton$1 = styled__default["default"].button`
38751
+ display: flex;
38752
+ align-items: center;
38753
+ justify-content: space-between;
38754
+ width: 100%;
38755
+ min-width: 120px;
38756
+ background-color: ${props => props.$isRowFocused ? props.$selectedColor : "white"};
38757
+ border: none;
38758
+ border-radius: 0;
38759
+ font-family: "Poppins", sans-serif;
38760
+ font-size: 14px;
38761
+ font-weight: 400;
38762
+ color: #212121;
38763
+ cursor: pointer;
38764
+ transition: all 0.2s ease;
38765
+
38766
+ &:hover {
38767
+ background-color: #D1E7E7;
38768
+ }
38769
+
38770
+ &:focus {
38771
+ outline: none;
38772
+ background-color: #E6F0F0;
38773
+ }
38774
+
38775
+ span {
38776
+ overflow: hidden;
38777
+ text-overflow: ellipsis;
38778
+ white-space: nowrap;
38779
+ text-align: left;
38780
+ flex: 1;
38781
+ }
38782
+ `;
38783
+ const DropdownIcon = styled__default["default"].div`
38784
+ display: flex;
38785
+ align-items: center;
38786
+ justify-content: center;
38787
+ width: 20px;
38788
+ height: 20px;
38789
+ background-color: ${props => props.$isRowFocused || props.$isRowHovered ? '#B4D1D2' : 'white'};
38790
+ border-radius: 4px;
38791
+ margin-left: 8px;
38792
+ transition: all 0.2s ease;
38793
+
38794
+ ${props => props.$isOpen && `
38795
+ transform: rotate(180deg);
38796
+ `}
38797
+ `;
38798
+ const DropdownMenu = styled__default["default"].div`
38799
+ position: absolute;
38800
+ top: calc(100%);
38801
+ left: 0;
38802
+ right: 0;
38803
+ z-index: 1000;
38804
+ background-color: white;
38805
+ border: none;
38806
+ border-radius: 0;
38807
+ box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
38808
+ font-family: "Poppins", sans-serif;
38809
+ max-height: ${props => props.$maxDropdownHeight || '200px'};
38810
+ overflow-y: auto;
38811
+ padding: 16px;
38812
+
38813
+ /* Custom scrollbar */
38814
+ &::-webkit-scrollbar {
38815
+ width: 4px;
38816
+ }
38817
+
38818
+ &::-webkit-scrollbar-track {
38819
+ background: transparent;
38820
+ }
38821
+
38822
+ &::-webkit-scrollbar-thumb {
38823
+ background: #cbd5e1;
38824
+ border-radius: 2px;
38825
+ }
38826
+
38827
+ &::-webkit-scrollbar-thumb:hover {
38828
+ background: #94a3b8;
38829
+ }
38830
+ `;
38831
+ const DropdownOption = styled__default["default"].div`
38832
+ display: flex;
38833
+ align-items: center;
38834
+ justify-content: space-between;
38835
+ padding: 8px;
38836
+ font-size: 14px;
38837
+ font-weight: 400;
38838
+ color: #374151;
38839
+ cursor: pointer;
38840
+ transition: all 0.15s ease;
38841
+ border-radius: 0;
38842
+ border-left: 3px solid transparent;
38843
+ background-color: white;
38844
+
38845
+ &:hover {
38846
+ background-color: #E6F0F0;
38847
+ }
38848
+
38849
+ ${props => props.$isSelected && `
38850
+ background-color: #B4D1D2;
38851
+ color: #374151;
38852
+ font-weight: 500;
38853
+ border-left: 3px solid #066768;
38854
+
38855
+ &:hover {
38856
+ background-color: #A3C9CA;
38857
+ }
38858
+ `}
38859
+ `;
38860
+
38732
38861
  // MessageBox.styles.js
38733
38862
  const ModalOverlay = styled__default["default"].div`
38734
38863
  position: fixed;
@@ -38982,12 +39111,14 @@ const TableBody = ({
38982
39111
  onExpandRow = () => {},
38983
39112
  expandedBackgroundColor = '#E6F0F0',
38984
39113
  // New prop with default
39114
+ onDropdownSelected = () => {},
38985
39115
  ref = null
38986
39116
  }) => {
38987
39117
  const [hoveredRowIndex, setHoveredRowIndex] = React$1.useState(null);
38988
39118
  const [focusedRowIndex, setFocusedRowIndex] = React$1.useState(null);
38989
39119
  const [isCommentModalOpen, setIsCommentModalOpen] = React$1.useState(false);
38990
39120
  const [currentCommentRow, setCurrentCommentRow] = React$1.useState(null);
39121
+ const [openDropdowns, setOpenDropdowns] = React$1.useState({});
38991
39122
 
38992
39123
  // TextArea logic states
38993
39124
  const [commentText, setCommentText] = React$1.useState('');
@@ -39325,6 +39456,39 @@ const TableBody = ({
39325
39456
  }));
39326
39457
  }
39327
39458
  return null;
39459
+ case 'dropdown':
39460
+ const dropdownKey = `${rowIndex}-${column.key}`;
39461
+ const isOpen = openDropdowns[dropdownKey] || false;
39462
+ const dropdownOptions = column.dropdownOptions || [];
39463
+ const maxDropdownHeight = column.maxDropdownHeight || '200px';
39464
+
39465
+ // Find the current selected option to display its label
39466
+ const currentOption = dropdownOptions.find(option => option.value === value);
39467
+ const displayText = currentOption ? currentOption.label : value || 'Select...';
39468
+ return /*#__PURE__*/React__default["default"].createElement(DropdownContainer$1, null, /*#__PURE__*/React__default["default"].createElement(DropdownButton$1, {
39469
+ onClick: e => handleDropdownClick(rowIndex, column.key, e),
39470
+ $isOpen: isOpen,
39471
+ $isRowFocused: focusedRowIndex === rowIndex,
39472
+ $selectedColor: selectedColor
39473
+ }, /*#__PURE__*/React__default["default"].createElement("span", null, displayText), /*#__PURE__*/React__default["default"].createElement(DropdownIcon, {
39474
+ $isOpen: isOpen,
39475
+ $isRowFocused: focusedRowIndex === rowIndex,
39476
+ $isRowHovered: hoveredRowIndex === rowIndex
39477
+ }, /*#__PURE__*/React__default["default"].createElement(MenuItemOpenIcon, {
39478
+ width: "10",
39479
+ height: "6",
39480
+ color: "#212121"
39481
+ }))), isOpen && /*#__PURE__*/React__default["default"].createElement(DropdownMenu, {
39482
+ $maxDropdownHeight: maxDropdownHeight
39483
+ }, dropdownOptions.map((option, index) => /*#__PURE__*/React__default["default"].createElement(DropdownOption, {
39484
+ key: index,
39485
+ onClick: e => handleDropdownOptionClick(row, rowIndex, column.key, option, e),
39486
+ $isSelected: option.value === value
39487
+ }, /*#__PURE__*/React__default["default"].createElement("span", null, option.label), option.value === value && /*#__PURE__*/React__default["default"].createElement(OkIcon, {
39488
+ width: "24",
39489
+ height: "24",
39490
+ color: "#066768"
39491
+ })))));
39328
39492
  default:
39329
39493
  // Treat default as text
39330
39494
  return value.toString();
@@ -39343,6 +39507,44 @@ const TableBody = ({
39343
39507
  onExpandRow(row, rowIndex, expandStatus);
39344
39508
  }
39345
39509
  };
39510
+
39511
+ // Handle dropdown click
39512
+ const handleDropdownClick = (rowIndex, columnKey, event) => {
39513
+ event.stopPropagation();
39514
+ const dropdownKey = `${rowIndex}-${columnKey}`;
39515
+ setOpenDropdowns(prev => ({
39516
+ ...prev,
39517
+ [dropdownKey]: !prev[dropdownKey]
39518
+ }));
39519
+ };
39520
+
39521
+ // Handle dropdown option selection
39522
+ const handleDropdownOptionClick = (row, rowIndex, columnKey, selectedOption, event) => {
39523
+ event.stopPropagation();
39524
+ const dropdownKey = `${rowIndex}-${columnKey}`;
39525
+
39526
+ // Close the dropdown
39527
+ setOpenDropdowns(prev => ({
39528
+ ...prev,
39529
+ [dropdownKey]: false
39530
+ }));
39531
+
39532
+ // Fire the onDropdownSelected event
39533
+ if (onDropdownSelected) {
39534
+ onDropdownSelected(row, selectedOption);
39535
+ }
39536
+ };
39537
+
39538
+ // Close all dropdowns when clicking outside
39539
+ React__default["default"].useEffect(() => {
39540
+ const handleClickOutside = () => {
39541
+ setOpenDropdowns({});
39542
+ };
39543
+ document.addEventListener('click', handleClickOutside);
39544
+ return () => {
39545
+ document.removeEventListener('click', handleClickOutside);
39546
+ };
39547
+ }, []);
39346
39548
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(StyledTableBody, null, data.map((row, rowIndex) => /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, {
39347
39549
  key: rowIndex
39348
39550
  }, /*#__PURE__*/React__default["default"].createElement(TableRow, {
@@ -39441,6 +39643,7 @@ TableBody.propTypes = {
39441
39643
  statuses: PropTypes.array,
39442
39644
  onCommentSave: PropTypes.func,
39443
39645
  commentTextLimit: PropTypes.number,
39646
+ onDropdownSelected: PropTypes.func,
39444
39647
  ref: PropTypes.object
39445
39648
  };
39446
39649
  TableBody.displayName = 'TableBody';
@@ -42799,6 +43002,7 @@ const Table = props => {
42799
43002
  onExpandRow = () => {},
42800
43003
  expandedBackgroundColor = '#E6F0F0',
42801
43004
  // New prop
43005
+ onDropdownSelected = () => {},
42802
43006
  // Accept ref as a regular prop
42803
43007
  ref = null
42804
43008
  } = props;
@@ -42945,7 +43149,8 @@ const Table = props => {
42945
43149
  expandedRows: expandedRows,
42946
43150
  expandedContent: expandedContent,
42947
43151
  onExpandRow: onExpandRow,
42948
- expandedBackgroundColor: expandedBackgroundColor
43152
+ expandedBackgroundColor: expandedBackgroundColor,
43153
+ onDropdownSelected: onDropdownSelected
42949
43154
  })), 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, {
42950
43155
  height: "45px",
42951
43156
  leftIcon: noEventsButtonIcon,