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 +189 -76
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +189 -76
- package/dist/index.js.map +1 -1
- package/dist/types/components/Table/Table.stories.d.ts +89 -54
- package/dist/types/components/Table/TableBody.d.ts +6 -1
- package/dist/types/components/Table/TableBody.styles.d.ts +3 -0
- package/dist/types/components/Table/TableHeader.d.ts +2 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10385,23 +10385,24 @@ const QuarterPopupPicker = ({
|
|
|
10385
10385
|
};
|
|
10386
10386
|
|
|
10387
10387
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
10388
|
-
const QuarterPicker =
|
|
10389
|
-
|
|
10390
|
-
|
|
10391
|
-
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
|
|
10401
|
-
|
|
10402
|
-
|
|
10403
|
-
|
|
10404
|
-
|
|
10388
|
+
const QuarterPicker = _ref => {
|
|
10389
|
+
let {
|
|
10390
|
+
availableQuarters,
|
|
10391
|
+
// ["Q1-2024"]
|
|
10392
|
+
label,
|
|
10393
|
+
onChange,
|
|
10394
|
+
borderRadius,
|
|
10395
|
+
required,
|
|
10396
|
+
width,
|
|
10397
|
+
height,
|
|
10398
|
+
placeholder,
|
|
10399
|
+
disabled,
|
|
10400
|
+
borderColor,
|
|
10401
|
+
borderColorFocus,
|
|
10402
|
+
textColor,
|
|
10403
|
+
selectedValue,
|
|
10404
|
+
startYear
|
|
10405
|
+
} = _ref;
|
|
10405
10406
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
10406
10407
|
const [isOpen, setIsOpen] = React$1.useState(false);
|
|
10407
10408
|
const [value, setValue] = React$1.useState('');
|
|
@@ -10843,22 +10844,23 @@ const MonthPopupPicker = ({
|
|
|
10843
10844
|
};
|
|
10844
10845
|
|
|
10845
10846
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
10846
|
-
const MonthPicker =
|
|
10847
|
-
|
|
10848
|
-
|
|
10849
|
-
|
|
10850
|
-
|
|
10851
|
-
|
|
10852
|
-
|
|
10853
|
-
|
|
10854
|
-
|
|
10855
|
-
|
|
10856
|
-
|
|
10857
|
-
|
|
10858
|
-
|
|
10859
|
-
|
|
10860
|
-
|
|
10861
|
-
|
|
10847
|
+
const MonthPicker = _ref => {
|
|
10848
|
+
let {
|
|
10849
|
+
availableMonths,
|
|
10850
|
+
label,
|
|
10851
|
+
onChange,
|
|
10852
|
+
borderRadius,
|
|
10853
|
+
required,
|
|
10854
|
+
width,
|
|
10855
|
+
height,
|
|
10856
|
+
placeholder,
|
|
10857
|
+
disabled,
|
|
10858
|
+
borderColor,
|
|
10859
|
+
borderColorFocus,
|
|
10860
|
+
textColor,
|
|
10861
|
+
selectedValue,
|
|
10862
|
+
startYear
|
|
10863
|
+
} = _ref;
|
|
10862
10864
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
10863
10865
|
const [isOpen, setIsOpen] = React$1.useState(false);
|
|
10864
10866
|
const [value, setValue] = React$1.useState('');
|
|
@@ -23969,21 +23971,22 @@ const DeleteIcon = styled__default["default"].div`
|
|
|
23969
23971
|
position: absolute;
|
|
23970
23972
|
`;
|
|
23971
23973
|
|
|
23972
|
-
const QuickFilterDropdownSingle =
|
|
23973
|
-
|
|
23974
|
-
|
|
23975
|
-
|
|
23976
|
-
|
|
23977
|
-
|
|
23978
|
-
|
|
23979
|
-
|
|
23980
|
-
|
|
23981
|
-
|
|
23982
|
-
|
|
23983
|
-
|
|
23984
|
-
|
|
23985
|
-
|
|
23986
|
-
|
|
23974
|
+
const QuickFilterDropdownSingle = _ref => {
|
|
23975
|
+
let {
|
|
23976
|
+
label,
|
|
23977
|
+
hoverColor,
|
|
23978
|
+
options,
|
|
23979
|
+
selectedValue,
|
|
23980
|
+
placeHolder,
|
|
23981
|
+
onChange,
|
|
23982
|
+
disabled,
|
|
23983
|
+
width,
|
|
23984
|
+
error,
|
|
23985
|
+
errorMessage,
|
|
23986
|
+
xIconShow,
|
|
23987
|
+
labelColor,
|
|
23988
|
+
showLabelOnTop
|
|
23989
|
+
} = _ref;
|
|
23987
23990
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
23988
23991
|
const [showOptions, setShowOptions] = React$1.useState(false);
|
|
23989
23992
|
const [inputValue, setInputValue] = React$1.useState("");
|
|
@@ -24380,23 +24383,24 @@ const IconContainer$2 = styled__default["default"].div`
|
|
|
24380
24383
|
cursor: pointer;
|
|
24381
24384
|
`;
|
|
24382
24385
|
|
|
24383
|
-
const QuickFilterDropdownMultiSelection =
|
|
24384
|
-
|
|
24385
|
-
|
|
24386
|
-
|
|
24387
|
-
|
|
24388
|
-
|
|
24389
|
-
|
|
24390
|
-
|
|
24391
|
-
|
|
24392
|
-
|
|
24393
|
-
|
|
24394
|
-
|
|
24395
|
-
|
|
24396
|
-
|
|
24397
|
-
|
|
24398
|
-
|
|
24399
|
-
|
|
24386
|
+
const QuickFilterDropdownMultiSelection = _ref => {
|
|
24387
|
+
let {
|
|
24388
|
+
label,
|
|
24389
|
+
labelEmptyValue,
|
|
24390
|
+
options,
|
|
24391
|
+
selectedValue,
|
|
24392
|
+
placeHolder,
|
|
24393
|
+
onChange,
|
|
24394
|
+
required,
|
|
24395
|
+
disabled,
|
|
24396
|
+
width,
|
|
24397
|
+
error,
|
|
24398
|
+
errorMessage,
|
|
24399
|
+
labelColor,
|
|
24400
|
+
xIconShow,
|
|
24401
|
+
checkBoxColor,
|
|
24402
|
+
showLabelOnTop
|
|
24403
|
+
} = _ref;
|
|
24400
24404
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
24401
24405
|
const [showOptions, setShowOptions] = React$1.useState(false);
|
|
24402
24406
|
const [inputValue, setInputValue] = React$1.useState('');
|
|
@@ -35628,9 +35632,9 @@ const ToggleSlider = styled__default["default"].span`
|
|
|
35628
35632
|
}
|
|
35629
35633
|
`;
|
|
35630
35634
|
|
|
35631
|
-
/**
|
|
35632
|
-
* ToggleSwitch component for on/off states.
|
|
35633
|
-
* Supports small/large sizes and disabled state.
|
|
35635
|
+
/**
|
|
35636
|
+
* ToggleSwitch component for on/off states.
|
|
35637
|
+
* Supports small/large sizes and disabled state.
|
|
35634
35638
|
*/
|
|
35635
35639
|
function ToggleSwitch(_ref) {
|
|
35636
35640
|
let {
|
|
@@ -36732,6 +36736,11 @@ const HeaderCell = styled__default["default"].th`
|
|
|
36732
36736
|
max-width: ${props => props.$maxWidth || '300px'};
|
|
36733
36737
|
width: auto;
|
|
36734
36738
|
background-color: white;
|
|
36739
|
+
|
|
36740
|
+
/* Special handling for expand cells - minimal padding */
|
|
36741
|
+
${props => props.$fieldType === 'expand' && `
|
|
36742
|
+
padding: 12px 8px 12px 0px;
|
|
36743
|
+
`}
|
|
36735
36744
|
`;
|
|
36736
36745
|
const ColumnContent = styled__default["default"].div`
|
|
36737
36746
|
display: flex;
|
|
@@ -37591,7 +37600,8 @@ const TableHeader = ({
|
|
|
37591
37600
|
onFilter,
|
|
37592
37601
|
onSelectAll,
|
|
37593
37602
|
activeFilters = [],
|
|
37594
|
-
activeSorts = []
|
|
37603
|
+
activeSorts = [],
|
|
37604
|
+
expandable = false
|
|
37595
37605
|
}) => {
|
|
37596
37606
|
const [focusedFilter, setFocusedFilter] = React$1.useState(null);
|
|
37597
37607
|
const [focusedSort, setFocusedSort] = React$1.useState(null);
|
|
@@ -38031,7 +38041,11 @@ const TableHeader = ({
|
|
|
38031
38041
|
onReset: () => handleSortReset(key)
|
|
38032
38042
|
});
|
|
38033
38043
|
};
|
|
38034
|
-
return /*#__PURE__*/React__default["default"].createElement(StyledTableHeader, null, /*#__PURE__*/React__default["default"].createElement("tr", null,
|
|
38044
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledTableHeader, null, /*#__PURE__*/React__default["default"].createElement("tr", null, expandable && /*#__PURE__*/React__default["default"].createElement(HeaderCell, {
|
|
38045
|
+
$fieldType: "expand",
|
|
38046
|
+
$minWidth: "16px",
|
|
38047
|
+
$maxWidth: "16px"
|
|
38048
|
+
}, /*#__PURE__*/React__default["default"].createElement(ColumnContent, null, /*#__PURE__*/React__default["default"].createElement(ColumnLabel, null))), columns.map((column, index) => /*#__PURE__*/React__default["default"].createElement(HeaderCell, {
|
|
38035
38049
|
key: column.key || index,
|
|
38036
38050
|
$fieldType: column.fieldType?.toLowerCase(),
|
|
38037
38051
|
$minWidth: column.minWidth,
|
|
@@ -38247,6 +38261,11 @@ const TableCell = styled__default["default"].td`
|
|
|
38247
38261
|
vertical-align: top;
|
|
38248
38262
|
`}
|
|
38249
38263
|
|
|
38264
|
+
/* Special handling for expand cells - minimal padding */
|
|
38265
|
+
${props => props.$fieldType === 'expand' && `
|
|
38266
|
+
padding: 12px 8px 12px 0px;
|
|
38267
|
+
`}
|
|
38268
|
+
|
|
38250
38269
|
/* CSS-only tooltip */
|
|
38251
38270
|
&[data-tooltip]:hover::before {
|
|
38252
38271
|
content: attr(data-tooltip);
|
|
@@ -38611,6 +38630,49 @@ const CharacterCount = styled__default["default"].div`
|
|
|
38611
38630
|
transition: color 0.2s ease;
|
|
38612
38631
|
`;
|
|
38613
38632
|
|
|
38633
|
+
// EXPAND STYLES
|
|
38634
|
+
const ExpandIcon = styled__default["default"].div`
|
|
38635
|
+
cursor: pointer;
|
|
38636
|
+
display: flex;
|
|
38637
|
+
align-items: center;
|
|
38638
|
+
justify-content: center;
|
|
38639
|
+
width: 24px;
|
|
38640
|
+
height: 24px;
|
|
38641
|
+
border-radius: 4px;
|
|
38642
|
+
font-family: "Poppins", sans-serif;
|
|
38643
|
+
transition: all 0.2s ease;
|
|
38644
|
+
user-select: none;
|
|
38645
|
+
|
|
38646
|
+
&:hover {
|
|
38647
|
+
background-color: #f0f0f0;
|
|
38648
|
+
|
|
38649
|
+
svg path {
|
|
38650
|
+
fill: #333;
|
|
38651
|
+
}
|
|
38652
|
+
}
|
|
38653
|
+
|
|
38654
|
+
svg {
|
|
38655
|
+
transition: all 0.2s ease;
|
|
38656
|
+
}
|
|
38657
|
+
`;
|
|
38658
|
+
const ExpandedRow = styled__default["default"].tr`
|
|
38659
|
+
background-color: ${props => props.$expandedBackgroundColor || '#E6F0F0'};
|
|
38660
|
+
|
|
38661
|
+
&:hover {
|
|
38662
|
+
background-color: ${props => props.$expandedBackgroundColor || '#E6F0F0'};
|
|
38663
|
+
}
|
|
38664
|
+
`;
|
|
38665
|
+
const ExpandedContent = styled__default["default"].div`
|
|
38666
|
+
padding: 16px;
|
|
38667
|
+
background-color: ${props => props.$expandedBackgroundColor || '#E6F0F0'};
|
|
38668
|
+
border-left: 3px solid #e0e0e0;
|
|
38669
|
+
margin: 0;
|
|
38670
|
+
|
|
38671
|
+
/* Ensure content doesn't interfere with table layout */
|
|
38672
|
+
width: 100%;
|
|
38673
|
+
box-sizing: border-box;
|
|
38674
|
+
`;
|
|
38675
|
+
|
|
38614
38676
|
// MessageBox.styles.js
|
|
38615
38677
|
const ModalOverlay = styled__default["default"].div`
|
|
38616
38678
|
position: fixed;
|
|
@@ -38858,6 +38920,12 @@ const TableBody = ({
|
|
|
38858
38920
|
}],
|
|
38859
38921
|
onCommentSave = () => {},
|
|
38860
38922
|
commentTextLimit = 150,
|
|
38923
|
+
expandable = false,
|
|
38924
|
+
expandedRows = {},
|
|
38925
|
+
expandedContent = {},
|
|
38926
|
+
onExpandRow = () => {},
|
|
38927
|
+
expandedBackgroundColor = '#E6F0F0',
|
|
38928
|
+
// New prop with default
|
|
38861
38929
|
ref = null
|
|
38862
38930
|
}) => {
|
|
38863
38931
|
const [hoveredRowIndex, setHoveredRowIndex] = React$1.useState(null);
|
|
@@ -39209,8 +39277,19 @@ const TableBody = ({
|
|
|
39209
39277
|
const shouldShowTooltip = (element, content) => {
|
|
39210
39278
|
return element && element.scrollWidth > element.clientWidth;
|
|
39211
39279
|
};
|
|
39212
|
-
|
|
39213
|
-
|
|
39280
|
+
|
|
39281
|
+
// Handle expand click
|
|
39282
|
+
const handleExpandClick = (row, rowIndex, event) => {
|
|
39283
|
+
event.stopPropagation();
|
|
39284
|
+
if (onExpandRow) {
|
|
39285
|
+
// Determine the expand status based on current state
|
|
39286
|
+
const expandStatus = expandedRows[rowIndex] ? 'isClosed' : 'isOpen';
|
|
39287
|
+
onExpandRow(row, rowIndex, expandStatus);
|
|
39288
|
+
}
|
|
39289
|
+
};
|
|
39290
|
+
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, {
|
|
39291
|
+
key: rowIndex
|
|
39292
|
+
}, /*#__PURE__*/React__default["default"].createElement(TableRow, {
|
|
39214
39293
|
"data-row-index": rowIndex,
|
|
39215
39294
|
className: indexToShimmer === rowIndex ? 'shimmer-row' : '',
|
|
39216
39295
|
isFocused: focusedRowIndex === rowIndex,
|
|
@@ -39218,7 +39297,22 @@ const TableBody = ({
|
|
|
39218
39297
|
onMouseEnter: () => setHoveredRowIndex(rowIndex),
|
|
39219
39298
|
onMouseLeave: () => setHoveredRowIndex(null),
|
|
39220
39299
|
onClick: () => handleRowClick(row, rowIndex)
|
|
39221
|
-
},
|
|
39300
|
+
}, expandable && /*#__PURE__*/React__default["default"].createElement(TableCell, {
|
|
39301
|
+
$fieldType: "expand",
|
|
39302
|
+
$minWidth: "16px",
|
|
39303
|
+
$maxWidth: "16px"
|
|
39304
|
+
}, /*#__PURE__*/React__default["default"].createElement(ExpandIcon, {
|
|
39305
|
+
onClick: e => handleExpandClick(row, rowIndex, e),
|
|
39306
|
+
$isExpanded: expandedRows[rowIndex] || false
|
|
39307
|
+
}, expandedRows[rowIndex] ? /*#__PURE__*/React__default["default"].createElement(MenuItemOpenIcon, {
|
|
39308
|
+
width: "12",
|
|
39309
|
+
height: "12",
|
|
39310
|
+
color: "#666"
|
|
39311
|
+
}) : /*#__PURE__*/React__default["default"].createElement(ChervronRightIcon, {
|
|
39312
|
+
width: "12",
|
|
39313
|
+
height: "12",
|
|
39314
|
+
fill: "#666"
|
|
39315
|
+
}))), columns.map(column => {
|
|
39222
39316
|
const value = row[column.key];
|
|
39223
39317
|
const formattedValue = formatValue(value, column, row, rowIndex);
|
|
39224
39318
|
return /*#__PURE__*/React__default["default"].createElement(TableCell, {
|
|
@@ -39243,7 +39337,13 @@ const TableBody = ({
|
|
|
39243
39337
|
$minWidth: column.minWidth,
|
|
39244
39338
|
$maxWidth: column.maxWidth
|
|
39245
39339
|
}, formattedValue);
|
|
39246
|
-
}))
|
|
39340
|
+
})), expandable && expandedRows[rowIndex] && /*#__PURE__*/React__default["default"].createElement(ExpandedRow, {
|
|
39341
|
+
$expandedBackgroundColor: expandedBackgroundColor
|
|
39342
|
+
}, /*#__PURE__*/React__default["default"].createElement(TableCell, {
|
|
39343
|
+
colSpan: columns.length + 1
|
|
39344
|
+
}, /*#__PURE__*/React__default["default"].createElement(ExpandedContent, {
|
|
39345
|
+
$expandedBackgroundColor: expandedBackgroundColor
|
|
39346
|
+
}, expandedContent[rowIndex] || null)))))), /*#__PURE__*/React__default["default"].createElement(MessageBox, {
|
|
39247
39347
|
title: "Add Comment",
|
|
39248
39348
|
isOpen: isCommentModalOpen,
|
|
39249
39349
|
onClose: handleCommentModalClose,
|
|
@@ -42562,6 +42662,13 @@ const Table = props => {
|
|
|
42562
42662
|
isEditMode = false,
|
|
42563
42663
|
editRowIndex = -1,
|
|
42564
42664
|
onCommentSave = () => {},
|
|
42665
|
+
// NEW: Props for expand functionality
|
|
42666
|
+
expandable = false,
|
|
42667
|
+
expandedRows = {},
|
|
42668
|
+
expandedContent = {},
|
|
42669
|
+
onExpandRow = () => {},
|
|
42670
|
+
expandedBackgroundColor = '#E6F0F0',
|
|
42671
|
+
// New prop
|
|
42565
42672
|
// Accept ref as a regular prop
|
|
42566
42673
|
ref = null
|
|
42567
42674
|
} = props;
|
|
@@ -42684,7 +42791,8 @@ const Table = props => {
|
|
|
42684
42791
|
columns: columns,
|
|
42685
42792
|
onSort: onSort,
|
|
42686
42793
|
onFilter: onFilter,
|
|
42687
|
-
onSelectAll: onSelectAll
|
|
42794
|
+
onSelectAll: onSelectAll,
|
|
42795
|
+
expandable: expandable
|
|
42688
42796
|
}), columns.length > 0 && data.length > 0 && /*#__PURE__*/React__default["default"].createElement(TableBody, {
|
|
42689
42797
|
ref: tableBodyRef,
|
|
42690
42798
|
columns: columns,
|
|
@@ -42699,7 +42807,12 @@ const Table = props => {
|
|
|
42699
42807
|
buttonHoverColor: buttonHoverColor,
|
|
42700
42808
|
resetFocusIndex: resetFocusIndex,
|
|
42701
42809
|
changeFocusIndex: changeFocusIndex,
|
|
42702
|
-
onFocusChange: handleTableFocusChange
|
|
42810
|
+
onFocusChange: handleTableFocusChange,
|
|
42811
|
+
expandable: expandable,
|
|
42812
|
+
expandedRows: expandedRows,
|
|
42813
|
+
expandedContent: expandedContent,
|
|
42814
|
+
onExpandRow: onExpandRow,
|
|
42815
|
+
expandedBackgroundColor: expandedBackgroundColor
|
|
42703
42816
|
})), 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, {
|
|
42704
42817
|
height: "45px",
|
|
42705
42818
|
leftIcon: noEventsButtonIcon,
|