sag_components 2.0.0-beta146 → 2.0.0-beta148
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 +207 -80
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +207 -80
- package/dist/index.js.map +1 -1
- package/dist/types/components/OverlayDropdown/OverlayDropdown.style.d.ts +1 -0
- package/dist/types/components/Table/Table.stories.d.ts +85 -25
- package/dist/types/components/Table/TableBody.d.ts +5 -1
- package/dist/types/components/Table/TableBody.styles.d.ts +4 -0
- package/dist/types/components/Table/data.d.ts +167 -4
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -10320,24 +10320,23 @@ const QuarterPopupPicker = ({
|
|
|
10320
10320
|
};
|
|
10321
10321
|
|
|
10322
10322
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
10323
|
-
const QuarterPicker =
|
|
10324
|
-
|
|
10325
|
-
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
|
|
10337
|
-
|
|
10338
|
-
|
|
10339
|
-
|
|
10340
|
-
} = _ref;
|
|
10323
|
+
const QuarterPicker = ({
|
|
10324
|
+
availableQuarters,
|
|
10325
|
+
// ["Q1-2024"]
|
|
10326
|
+
label,
|
|
10327
|
+
onChange,
|
|
10328
|
+
borderRadius,
|
|
10329
|
+
required,
|
|
10330
|
+
width,
|
|
10331
|
+
height,
|
|
10332
|
+
placeholder,
|
|
10333
|
+
disabled,
|
|
10334
|
+
borderColor,
|
|
10335
|
+
borderColorFocus,
|
|
10336
|
+
textColor,
|
|
10337
|
+
selectedValue,
|
|
10338
|
+
startYear
|
|
10339
|
+
}) => {
|
|
10341
10340
|
const [isFocused, setIsFocused] = useState(false);
|
|
10342
10341
|
const [isOpen, setIsOpen] = useState(false);
|
|
10343
10342
|
const [value, setValue] = useState('');
|
|
@@ -10779,23 +10778,22 @@ const MonthPopupPicker = ({
|
|
|
10779
10778
|
};
|
|
10780
10779
|
|
|
10781
10780
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
10782
|
-
const MonthPicker =
|
|
10783
|
-
|
|
10784
|
-
|
|
10785
|
-
|
|
10786
|
-
|
|
10787
|
-
|
|
10788
|
-
|
|
10789
|
-
|
|
10790
|
-
|
|
10791
|
-
|
|
10792
|
-
|
|
10793
|
-
|
|
10794
|
-
|
|
10795
|
-
|
|
10796
|
-
|
|
10797
|
-
|
|
10798
|
-
} = _ref;
|
|
10781
|
+
const MonthPicker = ({
|
|
10782
|
+
availableMonths,
|
|
10783
|
+
label,
|
|
10784
|
+
onChange,
|
|
10785
|
+
borderRadius,
|
|
10786
|
+
required,
|
|
10787
|
+
width,
|
|
10788
|
+
height,
|
|
10789
|
+
placeholder,
|
|
10790
|
+
disabled,
|
|
10791
|
+
borderColor,
|
|
10792
|
+
borderColorFocus,
|
|
10793
|
+
textColor,
|
|
10794
|
+
selectedValue,
|
|
10795
|
+
startYear
|
|
10796
|
+
}) => {
|
|
10799
10797
|
const [isFocused, setIsFocused] = useState(false);
|
|
10800
10798
|
const [isOpen, setIsOpen] = useState(false);
|
|
10801
10799
|
const [value, setValue] = useState('');
|
|
@@ -23906,22 +23904,21 @@ const DeleteIcon = styled.div`
|
|
|
23906
23904
|
position: absolute;
|
|
23907
23905
|
`;
|
|
23908
23906
|
|
|
23909
|
-
const QuickFilterDropdownSingle =
|
|
23910
|
-
|
|
23911
|
-
|
|
23912
|
-
|
|
23913
|
-
|
|
23914
|
-
|
|
23915
|
-
|
|
23916
|
-
|
|
23917
|
-
|
|
23918
|
-
|
|
23919
|
-
|
|
23920
|
-
|
|
23921
|
-
|
|
23922
|
-
|
|
23923
|
-
|
|
23924
|
-
} = _ref;
|
|
23907
|
+
const QuickFilterDropdownSingle = ({
|
|
23908
|
+
label,
|
|
23909
|
+
hoverColor,
|
|
23910
|
+
options,
|
|
23911
|
+
selectedValue,
|
|
23912
|
+
placeHolder,
|
|
23913
|
+
onChange,
|
|
23914
|
+
disabled,
|
|
23915
|
+
width,
|
|
23916
|
+
error,
|
|
23917
|
+
errorMessage,
|
|
23918
|
+
xIconShow,
|
|
23919
|
+
labelColor,
|
|
23920
|
+
showLabelOnTop
|
|
23921
|
+
}) => {
|
|
23925
23922
|
const [isFocused, setIsFocused] = useState(false);
|
|
23926
23923
|
const [showOptions, setShowOptions] = useState(false);
|
|
23927
23924
|
const [inputValue, setInputValue] = useState("");
|
|
@@ -24318,24 +24315,23 @@ const IconContainer$2 = styled.div`
|
|
|
24318
24315
|
cursor: pointer;
|
|
24319
24316
|
`;
|
|
24320
24317
|
|
|
24321
|
-
const QuickFilterDropdownMultiSelection =
|
|
24322
|
-
|
|
24323
|
-
|
|
24324
|
-
|
|
24325
|
-
|
|
24326
|
-
|
|
24327
|
-
|
|
24328
|
-
|
|
24329
|
-
|
|
24330
|
-
|
|
24331
|
-
|
|
24332
|
-
|
|
24333
|
-
|
|
24334
|
-
|
|
24335
|
-
|
|
24336
|
-
|
|
24337
|
-
|
|
24338
|
-
} = _ref;
|
|
24318
|
+
const QuickFilterDropdownMultiSelection = ({
|
|
24319
|
+
label,
|
|
24320
|
+
labelEmptyValue,
|
|
24321
|
+
options,
|
|
24322
|
+
selectedValue,
|
|
24323
|
+
placeHolder,
|
|
24324
|
+
onChange,
|
|
24325
|
+
required,
|
|
24326
|
+
disabled,
|
|
24327
|
+
width,
|
|
24328
|
+
error,
|
|
24329
|
+
errorMessage,
|
|
24330
|
+
labelColor,
|
|
24331
|
+
xIconShow,
|
|
24332
|
+
checkBoxColor,
|
|
24333
|
+
showLabelOnTop
|
|
24334
|
+
}) => {
|
|
24339
24335
|
const [isFocused, setIsFocused] = useState(false);
|
|
24340
24336
|
const [showOptions, setShowOptions] = useState(false);
|
|
24341
24337
|
const [inputValue, setInputValue] = useState('');
|
|
@@ -35567,9 +35563,9 @@ const ToggleSlider = styled.span`
|
|
|
35567
35563
|
}
|
|
35568
35564
|
`;
|
|
35569
35565
|
|
|
35570
|
-
/**
|
|
35571
|
-
* ToggleSwitch component for on/off states.
|
|
35572
|
-
* Supports small/large sizes and disabled state.
|
|
35566
|
+
/**
|
|
35567
|
+
* ToggleSwitch component for on/off states.
|
|
35568
|
+
* Supports small/large sizes and disabled state.
|
|
35573
35569
|
*/
|
|
35574
35570
|
function ToggleSwitch(_ref) {
|
|
35575
35571
|
let {
|
|
@@ -38122,6 +38118,15 @@ const TableCell = styled.td`
|
|
|
38122
38118
|
position: relative;
|
|
38123
38119
|
transition: all 0.3s ease;
|
|
38124
38120
|
|
|
38121
|
+
/* Special handling for tag cells - allow wrapping */
|
|
38122
|
+
${props => props.$fieldType === 'tag' && `
|
|
38123
|
+
white-space: normal;
|
|
38124
|
+
overflow: visible;
|
|
38125
|
+
text-overflow: unset;
|
|
38126
|
+
line-height: 1.5;
|
|
38127
|
+
vertical-align: top;
|
|
38128
|
+
`}
|
|
38129
|
+
|
|
38125
38130
|
/* CSS-only tooltip */
|
|
38126
38131
|
&[data-tooltip]:hover::before {
|
|
38127
38132
|
content: attr(data-tooltip);
|
|
@@ -38327,6 +38332,67 @@ const StatusCellCircle = styled.div`
|
|
|
38327
38332
|
border: 1px solid white;
|
|
38328
38333
|
background-color: ${props => props.backgroundColor};
|
|
38329
38334
|
`;
|
|
38335
|
+
|
|
38336
|
+
// NEW TAG STYLES
|
|
38337
|
+
const TagContainer = styled.div`
|
|
38338
|
+
display: flex;
|
|
38339
|
+
flex-wrap: wrap;
|
|
38340
|
+
gap: 4px;
|
|
38341
|
+
align-items: flex-start;
|
|
38342
|
+
max-width: 100%;
|
|
38343
|
+
line-height: 1.5;
|
|
38344
|
+
`;
|
|
38345
|
+
const TagChip = styled.span`
|
|
38346
|
+
display: inline-flex;
|
|
38347
|
+
align-items: center;
|
|
38348
|
+
padding: 2px 8px;
|
|
38349
|
+
font-size: 12px;
|
|
38350
|
+
font-weight: 500;
|
|
38351
|
+
border-radius: 9999px; /* Tailwind's rounded-full */
|
|
38352
|
+
white-space: nowrap;
|
|
38353
|
+
font-family: "Poppins", sans-serif;
|
|
38354
|
+
border: 1px solid;
|
|
38355
|
+
line-height: 1.3;
|
|
38356
|
+
|
|
38357
|
+
/* Dynamic colors via CSS custom properties */
|
|
38358
|
+
background-color: ${props => props.$backgroundColor || '#F3F4F6'};
|
|
38359
|
+
color: ${props => props.$textColor || '#374151'};
|
|
38360
|
+
border-color: ${props => props.$borderColor || '#9CA3AF'};
|
|
38361
|
+
|
|
38362
|
+
/* Tailwind-style transitions */
|
|
38363
|
+
transition: all 0.15s ease-in-out;
|
|
38364
|
+
|
|
38365
|
+
/* Hover effect for interactive tags */
|
|
38366
|
+
${props => props.$interactive && `
|
|
38367
|
+
cursor: pointer;
|
|
38368
|
+
&:hover {
|
|
38369
|
+
opacity: 0.8;
|
|
38370
|
+
transform: translateY(-1px);
|
|
38371
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
38372
|
+
}
|
|
38373
|
+
`}
|
|
38374
|
+
`;
|
|
38375
|
+
const TagOverflow = styled.span`
|
|
38376
|
+
font-size: 12px;
|
|
38377
|
+
font-weight: 500;
|
|
38378
|
+
color: #6B7280;
|
|
38379
|
+
font-family: "Poppins", sans-serif;
|
|
38380
|
+
cursor: help;
|
|
38381
|
+
display: inline-flex;
|
|
38382
|
+
align-items: center;
|
|
38383
|
+
padding: 2px 4px;
|
|
38384
|
+
|
|
38385
|
+
&:hover {
|
|
38386
|
+
color: #374151;
|
|
38387
|
+
}
|
|
38388
|
+
`;
|
|
38389
|
+
const MultiTagWrapper = styled.div`
|
|
38390
|
+
display: flex;
|
|
38391
|
+
flex-wrap: wrap;
|
|
38392
|
+
gap: 4px;
|
|
38393
|
+
max-width: 100%;
|
|
38394
|
+
align-items: flex-start;
|
|
38395
|
+
`;
|
|
38330
38396
|
const TextareaWrapper = styled.div`
|
|
38331
38397
|
position: relative;
|
|
38332
38398
|
display: flex;
|
|
@@ -38758,6 +38824,12 @@ const TableBody = ({
|
|
|
38758
38824
|
height: tooltipHeight
|
|
38759
38825
|
};
|
|
38760
38826
|
};
|
|
38827
|
+
|
|
38828
|
+
// Helper function to format tag text
|
|
38829
|
+
const formatTagText = tag => {
|
|
38830
|
+
if (typeof tag !== 'string') return tag;
|
|
38831
|
+
return tag.replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase());
|
|
38832
|
+
};
|
|
38761
38833
|
const formatValue = (value, column, row, rowIndex) => {
|
|
38762
38834
|
if (value === null || value === undefined) {
|
|
38763
38835
|
return '';
|
|
@@ -38799,6 +38871,54 @@ const TableBody = ({
|
|
|
38799
38871
|
return value.join(', ');
|
|
38800
38872
|
}
|
|
38801
38873
|
return value;
|
|
38874
|
+
case 'tag':
|
|
38875
|
+
if (!value) return '';
|
|
38876
|
+
const tagConfig = column.tagConfig || {};
|
|
38877
|
+
const colors = tagConfig.colors || {};
|
|
38878
|
+
const defaultColor = tagConfig.defaultColor || {
|
|
38879
|
+
bg: '#F3F4F6',
|
|
38880
|
+
text: '#374151',
|
|
38881
|
+
border: '#9CA3AF'
|
|
38882
|
+
};
|
|
38883
|
+
const maxDisplay = tagConfig.maxDisplay || 3;
|
|
38884
|
+
const isMultiple = tagConfig.multiple !== false; // Default to true
|
|
38885
|
+
|
|
38886
|
+
// Handle single tag
|
|
38887
|
+
if (typeof value === 'string') {
|
|
38888
|
+
const colorConfig = colors[value] || defaultColor;
|
|
38889
|
+
return /*#__PURE__*/React$1.createElement(TagContainer, null, /*#__PURE__*/React$1.createElement(TagChip, {
|
|
38890
|
+
$backgroundColor: colorConfig.bg,
|
|
38891
|
+
$textColor: colorConfig.text,
|
|
38892
|
+
$borderColor: colorConfig.border,
|
|
38893
|
+
$interactive: false,
|
|
38894
|
+
title: value
|
|
38895
|
+
}, formatTagText(value)));
|
|
38896
|
+
}
|
|
38897
|
+
|
|
38898
|
+
// Handle multiple tags
|
|
38899
|
+
if (Array.isArray(value) && isMultiple) {
|
|
38900
|
+
const visibleTags = value.slice(0, maxDisplay);
|
|
38901
|
+
const remainingCount = value.length - maxDisplay;
|
|
38902
|
+
return /*#__PURE__*/React$1.createElement(TagContainer, null, /*#__PURE__*/React$1.createElement(MultiTagWrapper, null, visibleTags.map((tag, index) => {
|
|
38903
|
+
const colorConfig = colors[tag] || defaultColor;
|
|
38904
|
+
return /*#__PURE__*/React$1.createElement(TagChip, {
|
|
38905
|
+
key: `${tag}-${index}`,
|
|
38906
|
+
$backgroundColor: colorConfig.bg,
|
|
38907
|
+
$textColor: colorConfig.text,
|
|
38908
|
+
$borderColor: colorConfig.border,
|
|
38909
|
+
$interactive: false,
|
|
38910
|
+
title: tag
|
|
38911
|
+
}, formatTagText(tag));
|
|
38912
|
+
}), remainingCount > 0 && /*#__PURE__*/React$1.createElement(TagOverflow, {
|
|
38913
|
+
title: `${remainingCount} more: ${value.slice(maxDisplay).map(tag => formatTagText(tag)).join(', ')}`
|
|
38914
|
+
}, "+", remainingCount)));
|
|
38915
|
+
}
|
|
38916
|
+
|
|
38917
|
+
// Fallback for array treated as single tag
|
|
38918
|
+
if (Array.isArray(value)) {
|
|
38919
|
+
return formatValue(value[0], column, row, rowIndex);
|
|
38920
|
+
}
|
|
38921
|
+
return value;
|
|
38802
38922
|
case 'packagestatus':
|
|
38803
38923
|
// Helper function to apply tooltip logic
|
|
38804
38924
|
const applyTooltipLogic = (element, tooltipText) => {
|
|
@@ -38965,7 +39085,7 @@ const TableBody = ({
|
|
|
38965
39085
|
el.style.setProperty('--tooltip-left', `${rect.left}px`);
|
|
38966
39086
|
el.style.setProperty('--tooltip-width', `${rect.width}px`);
|
|
38967
39087
|
el.style.setProperty('--tooltip-offset', `${offset}px`);
|
|
38968
|
-
el.style.setProperty('--tooltip-height', `${
|
|
39088
|
+
el.style.setProperty('--tooltip-height', `${height}px`);
|
|
38969
39089
|
el.setAttribute('data-tooltip', trashTooltipText);
|
|
38970
39090
|
}
|
|
38971
39091
|
}
|
|
@@ -39049,10 +39169,14 @@ TableBody.propTypes = {
|
|
|
39049
39169
|
onRowClick: PropTypes.func,
|
|
39050
39170
|
onSendClick: PropTypes.func,
|
|
39051
39171
|
buttonColor: PropTypes.string,
|
|
39172
|
+
buttonHoverColor: PropTypes.string,
|
|
39173
|
+
selectedColor: PropTypes.string,
|
|
39052
39174
|
onDeleteClick: PropTypes.func,
|
|
39053
|
-
|
|
39175
|
+
resetFocusIndex: PropTypes.bool,
|
|
39176
|
+
changeFocusIndex: PropTypes.number,
|
|
39054
39177
|
onFocusChange: PropTypes.func,
|
|
39055
39178
|
indexToShimmer: PropTypes.number,
|
|
39179
|
+
statuses: PropTypes.array,
|
|
39056
39180
|
onCommentSave: PropTypes.func,
|
|
39057
39181
|
commentTextLimit: PropTypes.number,
|
|
39058
39182
|
ref: PropTypes.object
|
|
@@ -52262,16 +52386,19 @@ const DropdownList = styled.ul`
|
|
|
52262
52386
|
top: 110%;
|
|
52263
52387
|
`}
|
|
52264
52388
|
`;
|
|
52389
|
+
const SectionDiv = styled.div`
|
|
52390
|
+
&:nth-child(2),
|
|
52391
|
+
&:nth-child(4){
|
|
52392
|
+
border-top: 1px solid #e6e2e2ff;
|
|
52393
|
+
padding-top: 16px;
|
|
52394
|
+
}
|
|
52395
|
+
`;
|
|
52265
52396
|
const SectionTitle = styled.li`
|
|
52266
52397
|
font-size: 14px;
|
|
52267
52398
|
color: #bdbdbd;
|
|
52268
52399
|
padding: 12px 12px 0 12px;
|
|
52269
52400
|
font-weight: 500;
|
|
52270
52401
|
pointer-events: none;
|
|
52271
|
-
&:not(:first-child) {
|
|
52272
|
-
border-top: 1px solid #bdbdbd;
|
|
52273
|
-
padding-top: 16px;
|
|
52274
|
-
}
|
|
52275
52402
|
`;
|
|
52276
52403
|
const DropdownItem = styled.li`
|
|
52277
52404
|
padding: 8px 16px;
|
|
@@ -52816,9 +52943,9 @@ const OverlayDropdown = _ref => {
|
|
|
52816
52943
|
dropdownMaxHeight: dropdownMaxHeight,
|
|
52817
52944
|
width: width,
|
|
52818
52945
|
position: dropdownPosition
|
|
52819
|
-
}, dataToRender.map((group, groupIndex) => group.items && group.items.length > 0 && /*#__PURE__*/React$1.createElement(
|
|
52946
|
+
}, dataToRender.map((group, groupIndex) => group.items && group.items.length > 0 && /*#__PURE__*/React$1.createElement(SectionDiv, {
|
|
52820
52947
|
key: group.overlayCode
|
|
52821
|
-
}, /*#__PURE__*/React$1.createElement(SectionTitle, null, group.overlayName), group.items.map(item => /*#__PURE__*/React$1.createElement(DropdownItem, {
|
|
52948
|
+
}, (groupIndex === 0 || groupIndex === 3) && /*#__PURE__*/React$1.createElement(SectionTitle, null, group.overlayName), group.items.map(item => /*#__PURE__*/React$1.createElement(DropdownItem, {
|
|
52822
52949
|
key: item.value,
|
|
52823
52950
|
selected: item.value === value,
|
|
52824
52951
|
selectedColor: selectedColor,
|