sag_components 2.0.0-beta293 → 2.0.0-beta295

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
@@ -42584,6 +42584,7 @@ const Dropdown = ({
42584
42584
  isOpen,
42585
42585
  options,
42586
42586
  selectedValue,
42587
+ // Can now be an array for multi-select
42587
42588
  displayText,
42588
42589
  onToggle,
42589
42590
  onOptionSelect,
@@ -42593,16 +42594,79 @@ const Dropdown = ({
42593
42594
  selectedColor,
42594
42595
  dropdownOptionsWidth,
42595
42596
  dropdownOptionsAlignment = 'right',
42596
- placeholder = 'Select...'
42597
+ placeholder = 'Select...',
42598
+ multiSelect = true,
42599
+ // New prop to enable/disable multi-select
42600
+ showSelectAll = true // New prop to show/hide "Select All" option
42597
42601
  }) => {
42598
42602
  const [isDropdownHovered, setIsDropdownHovered] = React$1.useState(false);
42599
42603
 
42604
+ // Normalize selectedValue to always be an array for consistency
42605
+ const selectedValues = Array.isArray(selectedValue) ? selectedValue : selectedValue ? [selectedValue] : [];
42606
+
42600
42607
  // Reset dropdown hover state when dropdown closes
42601
42608
  React$1.useEffect(() => {
42602
42609
  if (!isOpen) {
42603
42610
  setIsDropdownHovered(false);
42604
42611
  }
42605
42612
  }, [isOpen]);
42613
+
42614
+ // Check if an option is selected
42615
+ const isOptionSelected = optionValue => {
42616
+ return selectedValues.includes(optionValue);
42617
+ };
42618
+
42619
+ // Check if all options are selected
42620
+ const areAllSelected = () => {
42621
+ return options.length > 0 && options.every(option => isOptionSelected(option.value));
42622
+ };
42623
+
42624
+ // Handle option click
42625
+ const handleOptionClick = (option, e) => {
42626
+ e.stopPropagation();
42627
+ if (!multiSelect) {
42628
+ // Single select mode - close dropdown after selection
42629
+ onOptionSelect(option, e);
42630
+ return;
42631
+ }
42632
+
42633
+ // Multi-select mode - keep dropdown open
42634
+ onOptionSelect(option, e);
42635
+ };
42636
+
42637
+ // Handle "Select All" click
42638
+ const handleSelectAllClick = e => {
42639
+ e.stopPropagation();
42640
+ if (areAllSelected()) {
42641
+ // Deselect all
42642
+ onOptionSelect({
42643
+ value: 'none',
42644
+ label: 'Deselect All',
42645
+ isSelectAll: true
42646
+ }, e);
42647
+ } else {
42648
+ // Select all
42649
+ onOptionSelect({
42650
+ value: 'all',
42651
+ label: 'Select All',
42652
+ isSelectAll: true
42653
+ }, e);
42654
+ }
42655
+ };
42656
+
42657
+ // Generate display text based on selections
42658
+ const getDisplayText = () => {
42659
+ if (selectedValues.length === 0) {
42660
+ return placeholder;
42661
+ }
42662
+
42663
+ // if (selectedValues.length === 1) {
42664
+ // const selectedOption = options.find(opt => opt.value === selectedValues[0]);
42665
+ // return selectedOption ? selectedOption.label : displayText;
42666
+ // }
42667
+
42668
+ return `${selectedValues.map(val => options.find(opt => opt.value === val).label).join(', ')}`;
42669
+ };
42606
42670
  return /*#__PURE__*/React__default["default"].createElement(DropdownContainer$1, {
42607
42671
  onMouseEnter: () => setIsDropdownHovered(true),
42608
42672
  onMouseLeave: () => setIsDropdownHovered(false)
@@ -42612,7 +42676,7 @@ const Dropdown = ({
42612
42676
  $isRowFocused: isRowFocused,
42613
42677
  $isRowHovered: isRowHovered,
42614
42678
  $selectedColor: selectedColor
42615
- }, /*#__PURE__*/React__default["default"].createElement("span", null, displayText), /*#__PURE__*/React__default["default"].createElement(DropdownIcon, {
42679
+ }, /*#__PURE__*/React__default["default"].createElement("span", null, displayText || getDisplayText()), /*#__PURE__*/React__default["default"].createElement(DropdownIcon, {
42616
42680
  $isOpen: isOpen,
42617
42681
  $isRowFocused: isRowFocused,
42618
42682
  $isRowHovered: isRowHovered,
@@ -42625,11 +42689,22 @@ const Dropdown = ({
42625
42689
  $maxDropdownHeight: maxDropdownHeight,
42626
42690
  $dropdownOptionsWidth: dropdownOptionsWidth,
42627
42691
  $dropdownOptionsAlignment: dropdownOptionsAlignment
42628
- }, options.map((option, index) => /*#__PURE__*/React__default["default"].createElement(DropdownOption, {
42692
+ }, multiSelect && showSelectAll && options.length > 0 && /*#__PURE__*/React__default["default"].createElement(DropdownOption, {
42693
+ onClick: handleSelectAllClick,
42694
+ $isSelected: areAllSelected(),
42695
+ style: {
42696
+ borderBottom: '1px solid #E5E7EB',
42697
+ fontWeight: '500'
42698
+ }
42699
+ }, /*#__PURE__*/React__default["default"].createElement("span", null, areAllSelected() ? 'Deselect All' : 'Select All'), areAllSelected() && /*#__PURE__*/React__default["default"].createElement(OkIcon, {
42700
+ width: "24",
42701
+ height: "24",
42702
+ color: "#066768"
42703
+ })), options.map((option, index) => /*#__PURE__*/React__default["default"].createElement(DropdownOption, {
42629
42704
  key: index,
42630
- onClick: e => onOptionSelect(option, e),
42631
- $isSelected: option.value === selectedValue
42632
- }, /*#__PURE__*/React__default["default"].createElement("span", null, option.label), option.value === selectedValue && /*#__PURE__*/React__default["default"].createElement(OkIcon, {
42705
+ onClick: e => handleOptionClick(option, e),
42706
+ $isSelected: isOptionSelected(option.value)
42707
+ }, /*#__PURE__*/React__default["default"].createElement("span", null, option.label), isOptionSelected(option.value) && /*#__PURE__*/React__default["default"].createElement(OkIcon, {
42633
42708
  width: "24",
42634
42709
  height: "24",
42635
42710
  color: "#066768"
@@ -42641,8 +42716,8 @@ Dropdown.propTypes = {
42641
42716
  value: PropTypes.string.isRequired,
42642
42717
  label: PropTypes.string.isRequired
42643
42718
  })).isRequired,
42644
- selectedValue: PropTypes.string,
42645
- displayText: PropTypes.string.isRequired,
42719
+ selectedValue: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
42720
+ displayText: PropTypes.string,
42646
42721
  onToggle: PropTypes.func.isRequired,
42647
42722
  onOptionSelect: PropTypes.func.isRequired,
42648
42723
  maxDropdownHeight: PropTypes.string,
@@ -42651,7 +42726,9 @@ Dropdown.propTypes = {
42651
42726
  selectedColor: PropTypes.string,
42652
42727
  dropdownOptionsWidth: PropTypes.string,
42653
42728
  dropdownOptionsAlignment: PropTypes.oneOf(['left', 'right']),
42654
- placeholder: PropTypes.string
42729
+ placeholder: PropTypes.string,
42730
+ multiSelect: PropTypes.bool,
42731
+ showSelectAll: PropTypes.bool
42655
42732
  };
42656
42733
 
42657
42734
  const HeroIcon = ({
@@ -42807,44 +42884,31 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
42807
42884
  isEditMode = false,
42808
42885
  editRowIndex = -1
42809
42886
  }, ref) => {
42810
- // MOVE ALL VALIDATION TO THE VERY TOP BEFORE ANY HOOKS
42811
42887
  if (!Array.isArray(data) || !Array.isArray(columns)) {
42812
42888
  console.warn("TableBody: Invalid data or columns prop");
42813
42889
  return null;
42814
42890
  }
42815
-
42816
- // NOW ALL THE HOOKS CAN BE CALLED SAFELY
42817
42891
  const [hoveredRowIndex, setHoveredRowIndex] = React$1.useState(null);
42818
42892
  const [focusedRowIndex, setFocusedRowIndex] = React$1.useState(null);
42819
42893
  const [isCommentModalOpen, setIsCommentModalOpen] = React$1.useState(false);
42820
42894
  const [currentCommentRow, setCurrentCommentRow] = React$1.useState(null);
42821
42895
  const [openDropdowns, setOpenDropdowns] = React$1.useState({});
42822
-
42823
- // TextArea logic states
42824
42896
  const [commentText, setCommentText] = React$1.useState("");
42825
42897
  const [isFocused, setIsFocused] = React$1.useState(false);
42826
42898
  const [hasUserInteracted, setHasUserInteracted] = React$1.useState(false);
42827
42899
  const [hasInitialValue, setHasInitialValue] = React$1.useState(false);
42828
-
42829
- // Shimmer state - manage shimmer effect at the top level
42830
42900
  const [shimmerRowIndex, setShimmerRowIndex] = React$1.useState(-1);
42831
42901
  const [shimmerStartTime, setShimmerStartTime] = React$1.useState(null);
42832
-
42833
- // Helper function to get nested values from objects (e.g., "status.PackageStatusDescription")
42834
42902
  const getNestedValue = (obj, path) => {
42835
42903
  if (!path || typeof path !== 'string') return undefined;
42836
42904
  return path.split('.').reduce((current, key) => {
42837
42905
  return current && current[key] !== undefined ? current[key] : undefined;
42838
42906
  }, obj);
42839
42907
  };
42840
-
42841
- // Handle shimmer effect changes
42842
42908
  React$1.useEffect(() => {
42843
42909
  if (indexToShimmer >= 0) {
42844
42910
  setShimmerRowIndex(indexToShimmer);
42845
42911
  setShimmerStartTime(Date.now());
42846
-
42847
- // Auto-stop shimmer after 5 seconds
42848
42912
  const timeout = setTimeout(() => {
42849
42913
  setShimmerRowIndex(-1);
42850
42914
  setShimmerStartTime(null);
@@ -42855,8 +42919,6 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
42855
42919
  setShimmerStartTime(null);
42856
42920
  }
42857
42921
  }, [indexToShimmer]);
42858
-
42859
- // Expose methods to parent component via ref
42860
42922
  React$1.useImperativeHandle(ref, () => ({
42861
42923
  clearFocus: () => {
42862
42924
  setFocusedRowIndex(null);
@@ -42892,8 +42954,6 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
42892
42954
  setFocusedRowIndex(changeFocusIndex);
42893
42955
  }
42894
42956
  }, [changeFocusIndex]);
42895
-
42896
- // Close all dropdowns when clicking outside
42897
42957
  React$1.useEffect(() => {
42898
42958
  const handleClickOutside = () => {
42899
42959
  setOpenDropdowns({});
@@ -42903,8 +42963,6 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
42903
42963
  document.removeEventListener("click", handleClickOutside);
42904
42964
  };
42905
42965
  }, []);
42906
-
42907
- // HANDLE SPECIAL CASE: EMPTY DATA AFTER ALL HOOKS
42908
42966
  if (data.length === 0) {
42909
42967
  return /*#__PURE__*/React__default["default"].createElement(StyledTableBody, {
42910
42968
  ref: ref
@@ -42912,8 +42970,6 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
42912
42970
  colSpan: columns.length
42913
42971
  }, "No data available")));
42914
42972
  }
42915
-
42916
- // Handle row click for focus state
42917
42973
  const handleRowClick = (row, rowIndex) => {
42918
42974
  if (isEditMode && editRowIndex !== -1) {
42919
42975
  return;
@@ -42923,8 +42979,6 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
42923
42979
  onRowClick(row, rowIndex);
42924
42980
  }
42925
42981
  };
42926
-
42927
- // TextArea handlers
42928
42982
  const handleTextChange = e => {
42929
42983
  const text = e.target.value;
42930
42984
  if (text.length <= commentTextLimit) {
@@ -42940,16 +42994,12 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
42940
42994
  const handleBlur = () => {
42941
42995
  setIsFocused(false);
42942
42996
  };
42943
-
42944
- // Handle comment save
42945
42997
  const handleCommentSave = () => {
42946
42998
  if (currentCommentRow !== null) {
42947
42999
  onCommentSave(currentCommentRow, commentText);
42948
43000
  }
42949
43001
  handleCommentModalClose();
42950
43002
  };
42951
-
42952
- // Handle comment modal close
42953
43003
  const handleCommentModalClose = () => {
42954
43004
  setCommentText("");
42955
43005
  setHasUserInteracted(false);
@@ -42957,17 +43007,12 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
42957
43007
  setCurrentCommentRow(null);
42958
43008
  setIsCommentModalOpen(false);
42959
43009
  };
42960
-
42961
- // Determine if save button should be enabled
42962
43010
  const isSaveEnabled = hasUserInteracted && (commentText.length > 0 || hasInitialValue);
42963
-
42964
- // Helper function to format tag text
42965
43011
  const formatTagText = tag => {
42966
43012
  if (typeof tag !== "string") return String(tag || "");
42967
43013
  return tag.replace(/-/g, " ").replace(/\b\w/g, l => l.toUpperCase());
42968
43014
  };
42969
43015
  const formatValue = (value, column, row, rowIndex) => {
42970
- // Add safety checks at the start
42971
43016
  if (!column) {
42972
43017
  console.warn('formatValue called with null/undefined column');
42973
43018
  return "";
@@ -42976,8 +43021,6 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
42976
43021
  if ((value === null || value === undefined) && column?.fieldType?.toLowerCase() !== "comments" && column?.fieldType?.toLowerCase() !== "editable") {
42977
43022
  return "";
42978
43023
  }
42979
-
42980
- // Find the tooltip text for the current value - can be used for different fieldTypes
42981
43024
  const getTooltipText = value => {
42982
43025
  try {
42983
43026
  if (column?.tooltipText && Array.isArray(column.tooltipText)) {
@@ -43030,8 +43073,6 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
43030
43073
  } else {
43031
43074
  formattedDate = String(value || "");
43032
43075
  }
43033
-
43034
- // Check if this column should check for expiration
43035
43076
  if (column.checkExpiration !== false && value && isDateExpired(value)) {
43036
43077
  return /*#__PURE__*/React__default["default"].createElement("span", {
43037
43078
  style: {
@@ -43101,15 +43142,12 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
43101
43142
  }
43102
43143
  case "dotindicator":
43103
43144
  try {
43104
- // Check if value is an object with show and color properties
43105
43145
  if (!value || typeof value !== 'object') return null;
43106
43146
  const {
43107
43147
  show,
43108
43148
  color,
43109
43149
  tooltip
43110
43150
  } = value;
43111
-
43112
- // Only show the dot if show is true
43113
43151
  if (!show) return null;
43114
43152
  return /*#__PURE__*/React__default["default"].createElement(DotIndicatorWrapper, {
43115
43153
  ref: el => {
@@ -43189,7 +43227,6 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
43189
43227
  }
43190
43228
  };
43191
43229
  const tooltipText = getTooltipText(value);
43192
- // Handle array values (like PackageStatusName)
43193
43230
  const processedValue = Array.isArray(value) ? value[0] : value;
43194
43231
  const lowerValue = String(processedValue || "").toLowerCase();
43195
43232
  if (lowerValue === "empty") {
@@ -43402,12 +43439,24 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
43402
43439
  const dropdownOptionsWidth = column.dropdownOptionsWidth;
43403
43440
  const dropdownOptionsAlignment = column.dropdownOptionsAlignment || "right";
43404
43441
  const placeholder = column.placeholder || "Select...";
43405
- const currentOption = dropdownOptions.find(option => option && option.value === value);
43406
- const displayText = currentOption ? currentOption.label : value || placeholder;
43442
+ const isMultiSelect = column.multiSelect !== false;
43443
+ const showSelectAll = column.showSelectAll !== false;
43444
+ const normalizedValue = Array.isArray(value) ? value : value ? [value] : [];
43445
+ let displayText;
43446
+ if (normalizedValue.length === 0) {
43447
+ displayText = placeholder;
43448
+ } else if (normalizedValue.length === dropdownOptions.length && dropdownOptions.length > 0) {
43449
+ displayText = 'All Selected';
43450
+ } else if (normalizedValue.length === 1) {
43451
+ const selectedOption = dropdownOptions.find(opt => opt.value === normalizedValue[0]);
43452
+ displayText = selectedOption ? selectedOption.label : placeholder;
43453
+ } else {
43454
+ displayText = `${normalizedValue.map(val => dropdownOptions.find(opt => opt.value === val).label).join(', ')}`;
43455
+ }
43407
43456
  return /*#__PURE__*/React__default["default"].createElement(Dropdown, {
43408
43457
  isOpen: isOpen,
43409
43458
  options: dropdownOptions,
43410
- selectedValue: value,
43459
+ selectedValue: normalizedValue,
43411
43460
  displayText: displayText,
43412
43461
  onToggle: e => handleDropdownClick(rowIndex, column.key, e),
43413
43462
  onOptionSelect: (option, e) => handleDropdownOptionClick(row, rowIndex, column.key, option, e),
@@ -43417,7 +43466,9 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
43417
43466
  placeholder: placeholder,
43418
43467
  isRowFocused: focusedRowIndex === rowIndex,
43419
43468
  isRowHovered: hoveredRowIndex === rowIndex,
43420
- selectedColor: selectedColor
43469
+ selectedColor: selectedColor,
43470
+ multiSelect: isMultiSelect,
43471
+ showSelectAll: showSelectAll
43421
43472
  });
43422
43473
  } catch (e) {
43423
43474
  console.warn('Error formatting dropdown:', e);
@@ -43426,8 +43477,6 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
43426
43477
  case "checkbox":
43427
43478
  try {
43428
43479
  const isChecked = Boolean(value);
43429
- // Check if this specific checkbox should be disabled
43430
- // Format: checkboxDisabled_{columnKey} or checkboxDisabled (for backward compatibility)
43431
43480
  const isDisabled = row[`checkboxDisabled_${column.key}`] === true || column.key && row[`checkboxDisabled_${column.key}`] === true;
43432
43481
  return /*#__PURE__*/React__default["default"].createElement("div", {
43433
43482
  style: {
@@ -43480,8 +43529,6 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
43480
43529
  const shouldShowTooltip = (element, content) => {
43481
43530
  return element && element.scrollWidth > element.clientWidth;
43482
43531
  };
43483
-
43484
- // Handle expand click
43485
43532
  const handleExpandClick = (row, rowIndex, event) => {
43486
43533
  event.stopPropagation();
43487
43534
  if (onExpandRow) {
@@ -43489,8 +43536,6 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
43489
43536
  onExpandRow(row, rowIndex, expandStatus);
43490
43537
  }
43491
43538
  };
43492
-
43493
- // Handle checkbox click
43494
43539
  const handleCheckboxClick = (row, columnKey, event) => {
43495
43540
  event.stopPropagation();
43496
43541
  const currentValue = row[columnKey];
@@ -43507,8 +43552,6 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
43507
43552
  });
43508
43553
  }
43509
43554
  };
43510
-
43511
- // Handle dropdown click
43512
43555
  const handleDropdownClick = (rowIndex, columnKey, event) => {
43513
43556
  event.stopPropagation();
43514
43557
  const dropdownKey = `${rowIndex}-${columnKey}`;
@@ -43517,17 +43560,66 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
43517
43560
  [dropdownKey]: !prev[dropdownKey]
43518
43561
  }));
43519
43562
  };
43520
-
43521
- // Handle dropdown option selection
43522
43563
  const handleDropdownOptionClick = (row, rowIndex, columnKey, selectedOption, event) => {
43523
43564
  event.stopPropagation();
43565
+ const column = columns.find(col => col.key === columnKey);
43566
+ const isMultiSelect = column?.multiSelect !== false;
43567
+ if (selectedOption.isSelectAll) {
43568
+ const dropdownKey = `${rowIndex}-${columnKey}`;
43569
+ if (selectedOption.value === 'all') {
43570
+ const allValues = column.dropdownOptions.map(opt => opt.value);
43571
+ if (onDropdownSelected) {
43572
+ onDropdownSelected(row, {
43573
+ value: allValues,
43574
+ label: 'All Selected',
43575
+ isSelectAll: true
43576
+ }, columnKey);
43577
+ }
43578
+ } else {
43579
+ if (onDropdownSelected) {
43580
+ onDropdownSelected(row, {
43581
+ value: [],
43582
+ label: 'None Selected',
43583
+ isSelectAll: true
43584
+ }, columnKey);
43585
+ }
43586
+ }
43587
+ if (isMultiSelect) {
43588
+ setOpenDropdowns(prev => ({
43589
+ ...prev,
43590
+ [dropdownKey]: true
43591
+ }));
43592
+ } else {
43593
+ setOpenDropdowns(prev => ({
43594
+ ...prev,
43595
+ [dropdownKey]: false
43596
+ }));
43597
+ }
43598
+ return;
43599
+ }
43524
43600
  const dropdownKey = `${rowIndex}-${columnKey}`;
43525
- setOpenDropdowns(prev => ({
43526
- ...prev,
43527
- [dropdownKey]: false
43528
- }));
43529
- if (onDropdownSelected) {
43530
- onDropdownSelected(row, selectedOption, columnKey);
43601
+ if (isMultiSelect) {
43602
+ const currentValues = Array.isArray(row[columnKey]) ? row[columnKey] : row[columnKey] ? [row[columnKey]] : [];
43603
+ const newValues = currentValues.includes(selectedOption.value) ? currentValues.filter(v => v !== selectedOption.value) : [...currentValues, selectedOption.value];
43604
+ if (onDropdownSelected) {
43605
+ onDropdownSelected(row, {
43606
+ ...selectedOption,
43607
+ value: newValues,
43608
+ selectedValues: newValues
43609
+ }, columnKey);
43610
+ }
43611
+ setOpenDropdowns(prev => ({
43612
+ ...prev,
43613
+ [dropdownKey]: true
43614
+ }));
43615
+ } else {
43616
+ setOpenDropdowns(prev => ({
43617
+ ...prev,
43618
+ [dropdownKey]: false
43619
+ }));
43620
+ if (onDropdownSelected) {
43621
+ onDropdownSelected(row, selectedOption, columnKey);
43622
+ }
43531
43623
  }
43532
43624
  };
43533
43625
  const handleEditableClick = (row, columnKey, currentValue, rowIndex) => {
@@ -43540,15 +43632,13 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
43540
43632
  });
43541
43633
  }
43542
43634
  };
43543
-
43544
- // Helper function to check if date is expired (past current date)
43545
43635
  const isDateExpired = dateString => {
43546
43636
  if (!dateString) return false;
43547
43637
  try {
43548
43638
  const date = new Date(dateString);
43549
43639
  if (isNaN(date.getTime())) return false;
43550
43640
  const today = new Date();
43551
- today.setHours(0, 0, 0, 0); // Reset time to start of day for fair comparison
43641
+ today.setHours(0, 0, 0, 0);
43552
43642
  date.setHours(0, 0, 0, 0);
43553
43643
  return date < today;
43554
43644
  } catch (error) {
@@ -43558,7 +43648,6 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
43558
43648
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(StyledTableBody, {
43559
43649
  ref: ref
43560
43650
  }, data.map((row, rowIndex) => {
43561
- // Skip invalid rows
43562
43651
  if (!row || typeof row !== 'object') {
43563
43652
  console.warn(`Invalid row at index ${rowIndex}:`, row);
43564
43653
  return null;
@@ -43602,18 +43691,13 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
43602
43691
  }
43603
43692
  let value, formattedValue;
43604
43693
  try {
43605
- // Support nested keys like "status.PackageStatusDescription"
43606
43694
  value = column.key.includes('.') ? getNestedValue(row, column.key) : row[column.key];
43607
43695
  formattedValue = formatValue(value, column, row, rowIndex) || "";
43608
43696
  } catch (e) {
43609
43697
  console.error("Error formatting value:", e);
43610
43698
  formattedValue = "";
43611
43699
  }
43612
-
43613
- // Check if this is a text-based field for shimmer rendering
43614
43700
  const isTextBasedField = column.fieldType?.toLowerCase() === "text" || column.fieldType?.toLowerCase() === "currency" || column.fieldType?.toLowerCase() === "number" || column.fieldType?.toLowerCase() === "percentage" || column.fieldType?.toLowerCase() === "date" || !column.fieldType;
43615
-
43616
- // Determine if shimmer should be applied
43617
43701
  const shouldShimmer = isTextBasedField && rowIndex === shimmerRowIndex && shimmerStartTime !== null;
43618
43702
  return /*#__PURE__*/React__default["default"].createElement(TableCell, {
43619
43703
  key: `${column.key}-${rowIndex}`,
@@ -47011,16 +47095,16 @@ const NothingToTrackIcon = ({
47011
47095
  // Table.jsx
47012
47096
  const Table = props => {
47013
47097
  const {
47014
- width = '100%',
47015
- height = 'auto',
47016
- tableTitle = 'All Events',
47017
- tableBackground = '#FFFFFF',
47098
+ width = "100%",
47099
+ height = "auto",
47100
+ tableTitle = "All Events",
47101
+ tableBackground = "#FFFFFF",
47018
47102
  data = [],
47019
47103
  counter = 0,
47020
47104
  hideRowsCounter = false,
47021
47105
  onButtonClick = () => {},
47022
- buttonColor = '#066768',
47023
- buttonHoverColor = '#388586',
47106
+ buttonColor = "#066768",
47107
+ buttonHoverColor = "#388586",
47024
47108
  columns = [],
47025
47109
  onRowClick = () => {},
47026
47110
  onSort,
@@ -47028,14 +47112,14 @@ const Table = props => {
47028
47112
  onSelectAll,
47029
47113
  showSideButton = true,
47030
47114
  onSideButtonClick = () => {},
47031
- sideButtonColor = '#066768',
47032
- sideButtonHoverColor = '#388586',
47033
- selectedColor = '#B4D1D2',
47115
+ sideButtonColor = "#066768",
47116
+ sideButtonHoverColor = "#388586",
47117
+ selectedColor = "#B4D1D2",
47034
47118
  children = null,
47035
- tableBodyHeight = '728px',
47119
+ tableBodyHeight = "728px",
47036
47120
  isLoading = false,
47037
47121
  isLoadingSpinner = false,
47038
- isLoadingText = 'Loading Events...',
47122
+ isLoadingText = "Loading Events...",
47039
47123
  onLastRowsReached = () => {},
47040
47124
  lastRowsThreshold = 3,
47041
47125
  onSendClick = () => {},
@@ -47065,17 +47149,17 @@ const Table = props => {
47065
47149
  expandedRows = {},
47066
47150
  expandedContent = {},
47067
47151
  onExpandRow = () => {},
47068
- expandedBackgroundColor = '#E6F0F0',
47152
+ expandedBackgroundColor = "#E6F0F0",
47069
47153
  onDropdownSelected = () => {},
47070
47154
  onCheckboxClick = () => {},
47071
47155
  onHeaderCheckboxClick = () => {},
47072
47156
  headerCheckboxStates = {},
47073
47157
  disableCheckboxTooltipText = "",
47074
47158
  onHeroClick = () => {},
47075
- dotIndicatorColor = '#34D399',
47159
+ dotIndicatorColor = "#34D399",
47076
47160
  onEditableClick = () => {},
47161
+ activeFilters = {},
47077
47162
  resetFiltersKey = 0,
47078
- // NEW: Add this prop
47079
47163
  ref = null,
47080
47164
  titleSize,
47081
47165
  subTitleSize
@@ -47120,8 +47204,8 @@ const Table = props => {
47120
47204
  }
47121
47205
  }
47122
47206
  };
47123
- scrollWrapper.addEventListener('scroll', handleScroll);
47124
- return () => scrollWrapper.removeEventListener('scroll', handleScroll);
47207
+ scrollWrapper.addEventListener("scroll", handleScroll);
47208
+ return () => scrollWrapper.removeEventListener("scroll", handleScroll);
47125
47209
  }, [onLastRowsReached, data.length, lastRowsThreshold, hasTriggered]);
47126
47210
  React$1.useEffect(() => {
47127
47211
  if (!clearFocusOnOutsideClick || isEditMode) return;
@@ -47132,9 +47216,9 @@ const Table = props => {
47132
47216
  }
47133
47217
  }
47134
47218
  };
47135
- document.addEventListener('mousedown', handleOutsideClick);
47219
+ document.addEventListener("mousedown", handleOutsideClick);
47136
47220
  return () => {
47137
- document.removeEventListener('mousedown', handleOutsideClick);
47221
+ document.removeEventListener("mousedown", handleOutsideClick);
47138
47222
  };
47139
47223
  }, [clearFocusOnOutsideClick, isEditMode]);
47140
47224
  const getNoDataIcon = icon => {
@@ -47165,7 +47249,7 @@ const Table = props => {
47165
47249
  width: width,
47166
47250
  height: height,
47167
47251
  backgroundColor: tableBackground
47168
- }, /*#__PURE__*/React__default["default"].createElement(NoInfoFound, null, /*#__PURE__*/React__default["default"].createElement(TableTop, null, /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(Title$7, null, tableTitle), !hideRowsCounter && /*#__PURE__*/React__default["default"].createElement(SubTitle, null, data.length === 0 ? 'No Events' : `${counter} Events`)), showSideButton && /*#__PURE__*/React__default["default"].createElement(Button$1, {
47252
+ }, /*#__PURE__*/React__default["default"].createElement(NoInfoFound, null, /*#__PURE__*/React__default["default"].createElement(TableTop, null, /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(Title$7, null, tableTitle), !hideRowsCounter && /*#__PURE__*/React__default["default"].createElement(SubTitle, null, data.length === 0 ? "No Events" : `${counter} Events`)), showSideButton && /*#__PURE__*/React__default["default"].createElement(Button$1, {
47169
47253
  height: "45px",
47170
47254
  leftIcon: "Plus",
47171
47255
  text: "New Event",
@@ -47190,7 +47274,8 @@ const Table = props => {
47190
47274
  expandable: expandable,
47191
47275
  onHeaderCheckboxClick: onHeaderCheckboxClick,
47192
47276
  headerCheckboxStates: headerCheckboxStates,
47193
- resetFiltersKey: resetFiltersKey
47277
+ resetFiltersKey: resetFiltersKey,
47278
+ activeFilters: activeFilters
47194
47279
  }), columns.length > 0 && data.length > 0 && /*#__PURE__*/React__default["default"].createElement(TableBody, {
47195
47280
  ref: tableBodyRef,
47196
47281
  columns: columns,
@@ -47245,7 +47330,7 @@ const Table = props => {
47245
47330
  id: "LoaderWrapper"
47246
47331
  }, /*#__PURE__*/React__default["default"].createElement(Loader, null)))));
47247
47332
  };
47248
- Table.displayName = 'Table';
47333
+ Table.displayName = "Table";
47249
47334
 
47250
47335
  const Card = styled.styled.div`
47251
47336
  background: ${props => props.backgroundColor};