sag_components 2.0.0-beta159 → 2.0.0-beta160

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
@@ -10375,23 +10375,24 @@ const QuarterPopupPicker = ({
10375
10375
  };
10376
10376
 
10377
10377
  /* eslint-disable import/no-extraneous-dependencies */
10378
- const QuarterPicker = ({
10379
- availableQuarters,
10380
- // ["Q1-2024"]
10381
- label,
10382
- onChange,
10383
- borderRadius,
10384
- required,
10385
- width,
10386
- height,
10387
- placeholder,
10388
- disabled,
10389
- borderColor,
10390
- borderColorFocus,
10391
- textColor,
10392
- selectedValue,
10393
- startYear
10394
- }) => {
10378
+ const QuarterPicker = _ref => {
10379
+ let {
10380
+ availableQuarters,
10381
+ // ["Q1-2024"]
10382
+ label,
10383
+ onChange,
10384
+ borderRadius,
10385
+ required,
10386
+ width,
10387
+ height,
10388
+ placeholder,
10389
+ disabled,
10390
+ borderColor,
10391
+ borderColorFocus,
10392
+ textColor,
10393
+ selectedValue,
10394
+ startYear
10395
+ } = _ref;
10395
10396
  const [isFocused, setIsFocused] = useState(false);
10396
10397
  const [isOpen, setIsOpen] = useState(false);
10397
10398
  const [value, setValue] = useState('');
@@ -10833,22 +10834,23 @@ const MonthPopupPicker = ({
10833
10834
  };
10834
10835
 
10835
10836
  /* eslint-disable import/no-extraneous-dependencies */
10836
- const MonthPicker = ({
10837
- availableMonths,
10838
- label,
10839
- onChange,
10840
- borderRadius,
10841
- required,
10842
- width,
10843
- height,
10844
- placeholder,
10845
- disabled,
10846
- borderColor,
10847
- borderColorFocus,
10848
- textColor,
10849
- selectedValue,
10850
- startYear
10851
- }) => {
10837
+ const MonthPicker = _ref => {
10838
+ let {
10839
+ availableMonths,
10840
+ label,
10841
+ onChange,
10842
+ borderRadius,
10843
+ required,
10844
+ width,
10845
+ height,
10846
+ placeholder,
10847
+ disabled,
10848
+ borderColor,
10849
+ borderColorFocus,
10850
+ textColor,
10851
+ selectedValue,
10852
+ startYear
10853
+ } = _ref;
10852
10854
  const [isFocused, setIsFocused] = useState(false);
10853
10855
  const [isOpen, setIsOpen] = useState(false);
10854
10856
  const [value, setValue] = useState('');
@@ -23959,21 +23961,22 @@ const DeleteIcon = styled.div`
23959
23961
  position: absolute;
23960
23962
  `;
23961
23963
 
23962
- const QuickFilterDropdownSingle = ({
23963
- label,
23964
- hoverColor,
23965
- options,
23966
- selectedValue,
23967
- placeHolder,
23968
- onChange,
23969
- disabled,
23970
- width,
23971
- error,
23972
- errorMessage,
23973
- xIconShow,
23974
- labelColor,
23975
- showLabelOnTop
23976
- }) => {
23964
+ const QuickFilterDropdownSingle = _ref => {
23965
+ let {
23966
+ label,
23967
+ hoverColor,
23968
+ options,
23969
+ selectedValue,
23970
+ placeHolder,
23971
+ onChange,
23972
+ disabled,
23973
+ width,
23974
+ error,
23975
+ errorMessage,
23976
+ xIconShow,
23977
+ labelColor,
23978
+ showLabelOnTop
23979
+ } = _ref;
23977
23980
  const [isFocused, setIsFocused] = useState(false);
23978
23981
  const [showOptions, setShowOptions] = useState(false);
23979
23982
  const [inputValue, setInputValue] = useState("");
@@ -24370,23 +24373,24 @@ const IconContainer$2 = styled.div`
24370
24373
  cursor: pointer;
24371
24374
  `;
24372
24375
 
24373
- const QuickFilterDropdownMultiSelection = ({
24374
- label,
24375
- labelEmptyValue,
24376
- options,
24377
- selectedValue,
24378
- placeHolder,
24379
- onChange,
24380
- required,
24381
- disabled,
24382
- width,
24383
- error,
24384
- errorMessage,
24385
- labelColor,
24386
- xIconShow,
24387
- checkBoxColor,
24388
- showLabelOnTop
24389
- }) => {
24376
+ const QuickFilterDropdownMultiSelection = _ref => {
24377
+ let {
24378
+ label,
24379
+ labelEmptyValue,
24380
+ options,
24381
+ selectedValue,
24382
+ placeHolder,
24383
+ onChange,
24384
+ required,
24385
+ disabled,
24386
+ width,
24387
+ error,
24388
+ errorMessage,
24389
+ labelColor,
24390
+ xIconShow,
24391
+ checkBoxColor,
24392
+ showLabelOnTop
24393
+ } = _ref;
24390
24394
  const [isFocused, setIsFocused] = useState(false);
24391
24395
  const [showOptions, setShowOptions] = useState(false);
24392
24396
  const [inputValue, setInputValue] = useState('');
@@ -35618,9 +35622,9 @@ const ToggleSlider = styled.span`
35618
35622
  }
35619
35623
  `;
35620
35624
 
35621
- /**
35622
- * ToggleSwitch component for on/off states.
35623
- * Supports small/large sizes and disabled state.
35625
+ /**
35626
+ * ToggleSwitch component for on/off states.
35627
+ * Supports small/large sizes and disabled state.
35624
35628
  */
35625
35629
  function ToggleSwitch(_ref) {
35626
35630
  let {
@@ -36722,6 +36726,11 @@ const HeaderCell = styled.th`
36722
36726
  max-width: ${props => props.$maxWidth || '300px'};
36723
36727
  width: auto;
36724
36728
  background-color: white;
36729
+
36730
+ /* Special handling for expand cells - minimal padding */
36731
+ ${props => props.$fieldType === 'expand' && `
36732
+ padding: 12px 8px 12px 0px;
36733
+ `}
36725
36734
  `;
36726
36735
  const ColumnContent = styled.div`
36727
36736
  display: flex;
@@ -37581,7 +37590,8 @@ const TableHeader = ({
37581
37590
  onFilter,
37582
37591
  onSelectAll,
37583
37592
  activeFilters = [],
37584
- activeSorts = []
37593
+ activeSorts = [],
37594
+ expandable = false
37585
37595
  }) => {
37586
37596
  const [focusedFilter, setFocusedFilter] = useState(null);
37587
37597
  const [focusedSort, setFocusedSort] = useState(null);
@@ -38021,7 +38031,11 @@ const TableHeader = ({
38021
38031
  onReset: () => handleSortReset(key)
38022
38032
  });
38023
38033
  };
38024
- return /*#__PURE__*/React$1.createElement(StyledTableHeader, null, /*#__PURE__*/React$1.createElement("tr", null, columns.map((column, index) => /*#__PURE__*/React$1.createElement(HeaderCell, {
38034
+ return /*#__PURE__*/React$1.createElement(StyledTableHeader, null, /*#__PURE__*/React$1.createElement("tr", null, expandable && /*#__PURE__*/React$1.createElement(HeaderCell, {
38035
+ $fieldType: "expand",
38036
+ $minWidth: "16px",
38037
+ $maxWidth: "16px"
38038
+ }, /*#__PURE__*/React$1.createElement(ColumnContent, null, /*#__PURE__*/React$1.createElement(ColumnLabel, null))), columns.map((column, index) => /*#__PURE__*/React$1.createElement(HeaderCell, {
38025
38039
  key: column.key || index,
38026
38040
  $fieldType: column.fieldType?.toLowerCase(),
38027
38041
  $minWidth: column.minWidth,
@@ -38237,6 +38251,11 @@ const TableCell = styled.td`
38237
38251
  vertical-align: top;
38238
38252
  `}
38239
38253
 
38254
+ /* Special handling for expand cells - minimal padding */
38255
+ ${props => props.$fieldType === 'expand' && `
38256
+ padding: 12px 8px 12px 0px;
38257
+ `}
38258
+
38240
38259
  /* CSS-only tooltip */
38241
38260
  &[data-tooltip]:hover::before {
38242
38261
  content: attr(data-tooltip);
@@ -38601,6 +38620,49 @@ const CharacterCount = styled.div`
38601
38620
  transition: color 0.2s ease;
38602
38621
  `;
38603
38622
 
38623
+ // EXPAND STYLES
38624
+ const ExpandIcon = styled.div`
38625
+ cursor: pointer;
38626
+ display: flex;
38627
+ align-items: center;
38628
+ justify-content: center;
38629
+ width: 24px;
38630
+ height: 24px;
38631
+ border-radius: 4px;
38632
+ font-family: "Poppins", sans-serif;
38633
+ transition: all 0.2s ease;
38634
+ user-select: none;
38635
+
38636
+ &:hover {
38637
+ background-color: #f0f0f0;
38638
+
38639
+ svg path {
38640
+ fill: #333;
38641
+ }
38642
+ }
38643
+
38644
+ svg {
38645
+ transition: all 0.2s ease;
38646
+ }
38647
+ `;
38648
+ const ExpandedRow = styled.tr`
38649
+ background-color: ${props => props.$expandedBackgroundColor || '#E6F0F0'};
38650
+
38651
+ &:hover {
38652
+ background-color: ${props => props.$expandedBackgroundColor || '#E6F0F0'};
38653
+ }
38654
+ `;
38655
+ const ExpandedContent = styled.div`
38656
+ padding: 16px;
38657
+ background-color: ${props => props.$expandedBackgroundColor || '#E6F0F0'};
38658
+ border-left: 3px solid #e0e0e0;
38659
+ margin: 0;
38660
+
38661
+ /* Ensure content doesn't interfere with table layout */
38662
+ width: 100%;
38663
+ box-sizing: border-box;
38664
+ `;
38665
+
38604
38666
  // MessageBox.styles.js
38605
38667
  const ModalOverlay = styled.div`
38606
38668
  position: fixed;
@@ -38848,6 +38910,12 @@ const TableBody = ({
38848
38910
  }],
38849
38911
  onCommentSave = () => {},
38850
38912
  commentTextLimit = 150,
38913
+ expandable = false,
38914
+ expandedRows = {},
38915
+ expandedContent = {},
38916
+ onExpandRow = () => {},
38917
+ expandedBackgroundColor = '#E6F0F0',
38918
+ // New prop with default
38851
38919
  ref = null
38852
38920
  }) => {
38853
38921
  const [hoveredRowIndex, setHoveredRowIndex] = useState(null);
@@ -39199,8 +39267,19 @@ const TableBody = ({
39199
39267
  const shouldShowTooltip = (element, content) => {
39200
39268
  return element && element.scrollWidth > element.clientWidth;
39201
39269
  };
39202
- return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(StyledTableBody, null, data.map((row, rowIndex) => /*#__PURE__*/React$1.createElement(TableRow, {
39203
- key: rowIndex,
39270
+
39271
+ // Handle expand click
39272
+ const handleExpandClick = (row, rowIndex, event) => {
39273
+ event.stopPropagation();
39274
+ if (onExpandRow) {
39275
+ // Determine the expand status based on current state
39276
+ const expandStatus = expandedRows[rowIndex] ? 'isClosed' : 'isOpen';
39277
+ onExpandRow(row, rowIndex, expandStatus);
39278
+ }
39279
+ };
39280
+ return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(StyledTableBody, null, data.map((row, rowIndex) => /*#__PURE__*/React$1.createElement(React$1.Fragment, {
39281
+ key: rowIndex
39282
+ }, /*#__PURE__*/React$1.createElement(TableRow, {
39204
39283
  "data-row-index": rowIndex,
39205
39284
  className: indexToShimmer === rowIndex ? 'shimmer-row' : '',
39206
39285
  isFocused: focusedRowIndex === rowIndex,
@@ -39208,7 +39287,22 @@ const TableBody = ({
39208
39287
  onMouseEnter: () => setHoveredRowIndex(rowIndex),
39209
39288
  onMouseLeave: () => setHoveredRowIndex(null),
39210
39289
  onClick: () => handleRowClick(row, rowIndex)
39211
- }, columns.map(column => {
39290
+ }, expandable && /*#__PURE__*/React$1.createElement(TableCell, {
39291
+ $fieldType: "expand",
39292
+ $minWidth: "16px",
39293
+ $maxWidth: "16px"
39294
+ }, /*#__PURE__*/React$1.createElement(ExpandIcon, {
39295
+ onClick: e => handleExpandClick(row, rowIndex, e),
39296
+ $isExpanded: expandedRows[rowIndex] || false
39297
+ }, expandedRows[rowIndex] ? /*#__PURE__*/React$1.createElement(MenuItemOpenIcon, {
39298
+ width: "12",
39299
+ height: "12",
39300
+ color: "#666"
39301
+ }) : /*#__PURE__*/React$1.createElement(ChervronRightIcon, {
39302
+ width: "12",
39303
+ height: "12",
39304
+ fill: "#666"
39305
+ }))), columns.map(column => {
39212
39306
  const value = row[column.key];
39213
39307
  const formattedValue = formatValue(value, column, row, rowIndex);
39214
39308
  return /*#__PURE__*/React$1.createElement(TableCell, {
@@ -39233,7 +39327,13 @@ const TableBody = ({
39233
39327
  $minWidth: column.minWidth,
39234
39328
  $maxWidth: column.maxWidth
39235
39329
  }, formattedValue);
39236
- })))), /*#__PURE__*/React$1.createElement(MessageBox, {
39330
+ })), expandable && expandedRows[rowIndex] && /*#__PURE__*/React$1.createElement(ExpandedRow, {
39331
+ $expandedBackgroundColor: expandedBackgroundColor
39332
+ }, /*#__PURE__*/React$1.createElement(TableCell, {
39333
+ colSpan: columns.length + 1
39334
+ }, /*#__PURE__*/React$1.createElement(ExpandedContent, {
39335
+ $expandedBackgroundColor: expandedBackgroundColor
39336
+ }, expandedContent[rowIndex] || null)))))), /*#__PURE__*/React$1.createElement(MessageBox, {
39237
39337
  title: "Add Comment",
39238
39338
  isOpen: isCommentModalOpen,
39239
39339
  onClose: handleCommentModalClose,
@@ -42552,6 +42652,13 @@ const Table = props => {
42552
42652
  isEditMode = false,
42553
42653
  editRowIndex = -1,
42554
42654
  onCommentSave = () => {},
42655
+ // NEW: Props for expand functionality
42656
+ expandable = false,
42657
+ expandedRows = {},
42658
+ expandedContent = {},
42659
+ onExpandRow = () => {},
42660
+ expandedBackgroundColor = '#E6F0F0',
42661
+ // New prop
42555
42662
  // Accept ref as a regular prop
42556
42663
  ref = null
42557
42664
  } = props;
@@ -42674,7 +42781,8 @@ const Table = props => {
42674
42781
  columns: columns,
42675
42782
  onSort: onSort,
42676
42783
  onFilter: onFilter,
42677
- onSelectAll: onSelectAll
42784
+ onSelectAll: onSelectAll,
42785
+ expandable: expandable
42678
42786
  }), columns.length > 0 && data.length > 0 && /*#__PURE__*/React$1.createElement(TableBody, {
42679
42787
  ref: tableBodyRef,
42680
42788
  columns: columns,
@@ -42689,7 +42797,12 @@ const Table = props => {
42689
42797
  buttonHoverColor: buttonHoverColor,
42690
42798
  resetFocusIndex: resetFocusIndex,
42691
42799
  changeFocusIndex: changeFocusIndex,
42692
- onFocusChange: handleTableFocusChange
42800
+ onFocusChange: handleTableFocusChange,
42801
+ expandable: expandable,
42802
+ expandedRows: expandedRows,
42803
+ expandedContent: expandedContent,
42804
+ onExpandRow: onExpandRow,
42805
+ expandedBackgroundColor: expandedBackgroundColor
42693
42806
  })), data.length === 0 && /*#__PURE__*/React$1.createElement(NoEventsParent, null, /*#__PURE__*/React$1.createElement(NoEventsWrapper, null, showNoDataInSearch ? getNoDataSearchIcon(noDataSearchIcon) : getNoDataIcon(noDataIcon)), /*#__PURE__*/React$1.createElement(NoEventsMessage, null, showNoDataInSearch ? /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("strong", null, noDataInSearchTitle), /*#__PURE__*/React$1.createElement("br", null), noDataInSearchMessage) : /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("strong", null, noEventsTitle), /*#__PURE__*/React$1.createElement("br", null), noEventsSubtitle)), !showNoDataInSearch && showNoEventsButton && /*#__PURE__*/React$1.createElement(Button$1, {
42694
42807
  height: "45px",
42695
42808
  leftIcon: noEventsButtonIcon,