sag_components 2.0.0-beta147 → 2.0.0-beta149

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
@@ -24318,23 +24318,24 @@ const IconContainer$2 = styled.div`
24318
24318
  cursor: pointer;
24319
24319
  `;
24320
24320
 
24321
- const QuickFilterDropdownMultiSelection = ({
24322
- label,
24323
- labelEmptyValue,
24324
- options,
24325
- selectedValue,
24326
- placeHolder,
24327
- onChange,
24328
- required,
24329
- disabled,
24330
- width,
24331
- error,
24332
- errorMessage,
24333
- labelColor,
24334
- xIconShow,
24335
- checkBoxColor,
24336
- showLabelOnTop
24337
- }) => {
24321
+ const QuickFilterDropdownMultiSelection = _ref => {
24322
+ let {
24323
+ label,
24324
+ labelEmptyValue,
24325
+ options,
24326
+ selectedValue,
24327
+ placeHolder,
24328
+ onChange,
24329
+ required,
24330
+ disabled,
24331
+ width,
24332
+ error,
24333
+ errorMessage,
24334
+ labelColor,
24335
+ xIconShow,
24336
+ checkBoxColor,
24337
+ showLabelOnTop
24338
+ } = _ref;
24338
24339
  const [isFocused, setIsFocused] = useState(false);
24339
24340
  const [showOptions, setShowOptions] = useState(false);
24340
24341
  const [inputValue, setInputValue] = useState('');
@@ -38121,6 +38122,15 @@ const TableCell = styled.td`
38121
38122
  position: relative;
38122
38123
  transition: all 0.3s ease;
38123
38124
 
38125
+ /* Special handling for tag cells - allow wrapping */
38126
+ ${props => props.$fieldType === 'tag' && `
38127
+ white-space: normal;
38128
+ overflow: visible;
38129
+ text-overflow: unset;
38130
+ line-height: 1.5;
38131
+ vertical-align: top;
38132
+ `}
38133
+
38124
38134
  /* CSS-only tooltip */
38125
38135
  &[data-tooltip]:hover::before {
38126
38136
  content: attr(data-tooltip);
@@ -38326,6 +38336,67 @@ const StatusCellCircle = styled.div`
38326
38336
  border: 1px solid white;
38327
38337
  background-color: ${props => props.backgroundColor};
38328
38338
  `;
38339
+
38340
+ // NEW TAG STYLES
38341
+ const TagContainer = styled.div`
38342
+ display: flex;
38343
+ flex-wrap: wrap;
38344
+ gap: 4px;
38345
+ align-items: flex-start;
38346
+ max-width: 100%;
38347
+ line-height: 1.5;
38348
+ `;
38349
+ const TagChip = styled.span`
38350
+ display: inline-flex;
38351
+ align-items: center;
38352
+ padding: 2px 8px;
38353
+ font-size: 12px;
38354
+ font-weight: 500;
38355
+ border-radius: 9999px; /* Tailwind's rounded-full */
38356
+ white-space: nowrap;
38357
+ font-family: "Poppins", sans-serif;
38358
+ border: 1px solid;
38359
+ line-height: 1.3;
38360
+
38361
+ /* Dynamic colors via CSS custom properties */
38362
+ background-color: ${props => props.$backgroundColor || '#F3F4F6'};
38363
+ color: ${props => props.$textColor || '#374151'};
38364
+ border-color: ${props => props.$borderColor || '#9CA3AF'};
38365
+
38366
+ /* Tailwind-style transitions */
38367
+ transition: all 0.15s ease-in-out;
38368
+
38369
+ /* Hover effect for interactive tags */
38370
+ ${props => props.$interactive && `
38371
+ cursor: pointer;
38372
+ &:hover {
38373
+ opacity: 0.8;
38374
+ transform: translateY(-1px);
38375
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
38376
+ }
38377
+ `}
38378
+ `;
38379
+ const TagOverflow = styled.span`
38380
+ font-size: 12px;
38381
+ font-weight: 500;
38382
+ color: #6B7280;
38383
+ font-family: "Poppins", sans-serif;
38384
+ cursor: help;
38385
+ display: inline-flex;
38386
+ align-items: center;
38387
+ padding: 2px 4px;
38388
+
38389
+ &:hover {
38390
+ color: #374151;
38391
+ }
38392
+ `;
38393
+ const MultiTagWrapper = styled.div`
38394
+ display: flex;
38395
+ flex-wrap: wrap;
38396
+ gap: 4px;
38397
+ max-width: 100%;
38398
+ align-items: flex-start;
38399
+ `;
38329
38400
  const TextareaWrapper = styled.div`
38330
38401
  position: relative;
38331
38402
  display: flex;
@@ -38757,6 +38828,12 @@ const TableBody = ({
38757
38828
  height: tooltipHeight
38758
38829
  };
38759
38830
  };
38831
+
38832
+ // Helper function to format tag text
38833
+ const formatTagText = tag => {
38834
+ if (typeof tag !== 'string') return tag;
38835
+ return tag.replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase());
38836
+ };
38760
38837
  const formatValue = (value, column, row, rowIndex) => {
38761
38838
  if (value === null || value === undefined) {
38762
38839
  return '';
@@ -38798,6 +38875,54 @@ const TableBody = ({
38798
38875
  return value.join(', ');
38799
38876
  }
38800
38877
  return value;
38878
+ case 'tag':
38879
+ if (!value) return '';
38880
+ const tagConfig = column.tagConfig || {};
38881
+ const colors = tagConfig.colors || {};
38882
+ const defaultColor = tagConfig.defaultColor || {
38883
+ bg: '#F3F4F6',
38884
+ text: '#374151',
38885
+ border: '#9CA3AF'
38886
+ };
38887
+ const maxDisplay = tagConfig.maxDisplay || 3;
38888
+ const isMultiple = tagConfig.multiple !== false; // Default to true
38889
+
38890
+ // Handle single tag
38891
+ if (typeof value === 'string') {
38892
+ const colorConfig = colors[value] || defaultColor;
38893
+ return /*#__PURE__*/React$1.createElement(TagContainer, null, /*#__PURE__*/React$1.createElement(TagChip, {
38894
+ $backgroundColor: colorConfig.bg,
38895
+ $textColor: colorConfig.text,
38896
+ $borderColor: colorConfig.border,
38897
+ $interactive: false,
38898
+ title: value
38899
+ }, formatTagText(value)));
38900
+ }
38901
+
38902
+ // Handle multiple tags
38903
+ if (Array.isArray(value) && isMultiple) {
38904
+ const visibleTags = value.slice(0, maxDisplay);
38905
+ const remainingCount = value.length - maxDisplay;
38906
+ return /*#__PURE__*/React$1.createElement(TagContainer, null, /*#__PURE__*/React$1.createElement(MultiTagWrapper, null, visibleTags.map((tag, index) => {
38907
+ const colorConfig = colors[tag] || defaultColor;
38908
+ return /*#__PURE__*/React$1.createElement(TagChip, {
38909
+ key: `${tag}-${index}`,
38910
+ $backgroundColor: colorConfig.bg,
38911
+ $textColor: colorConfig.text,
38912
+ $borderColor: colorConfig.border,
38913
+ $interactive: false,
38914
+ title: tag
38915
+ }, formatTagText(tag));
38916
+ }), remainingCount > 0 && /*#__PURE__*/React$1.createElement(TagOverflow, {
38917
+ title: `${remainingCount} more: ${value.slice(maxDisplay).map(tag => formatTagText(tag)).join(', ')}`
38918
+ }, "+", remainingCount)));
38919
+ }
38920
+
38921
+ // Fallback for array treated as single tag
38922
+ if (Array.isArray(value)) {
38923
+ return formatValue(value[0], column, row, rowIndex);
38924
+ }
38925
+ return value;
38801
38926
  case 'packagestatus':
38802
38927
  // Helper function to apply tooltip logic
38803
38928
  const applyTooltipLogic = (element, tooltipText) => {
@@ -38964,7 +39089,7 @@ const TableBody = ({
38964
39089
  el.style.setProperty('--tooltip-left', `${rect.left}px`);
38965
39090
  el.style.setProperty('--tooltip-width', `${rect.width}px`);
38966
39091
  el.style.setProperty('--tooltip-offset', `${offset}px`);
38967
- el.style.setProperty('--tooltip-height', `${offset}px`);
39092
+ el.style.setProperty('--tooltip-height', `${height}px`);
38968
39093
  el.setAttribute('data-tooltip', trashTooltipText);
38969
39094
  }
38970
39095
  }
@@ -39048,10 +39173,14 @@ TableBody.propTypes = {
39048
39173
  onRowClick: PropTypes.func,
39049
39174
  onSendClick: PropTypes.func,
39050
39175
  buttonColor: PropTypes.string,
39176
+ buttonHoverColor: PropTypes.string,
39177
+ selectedColor: PropTypes.string,
39051
39178
  onDeleteClick: PropTypes.func,
39052
- resetFocus: PropTypes.bool,
39179
+ resetFocusIndex: PropTypes.bool,
39180
+ changeFocusIndex: PropTypes.number,
39053
39181
  onFocusChange: PropTypes.func,
39054
39182
  indexToShimmer: PropTypes.number,
39183
+ statuses: PropTypes.array,
39055
39184
  onCommentSave: PropTypes.func,
39056
39185
  commentTextLimit: PropTypes.number,
39057
39186
  ref: PropTypes.object
@@ -52262,21 +52391,33 @@ const DropdownList = styled.ul`
52262
52391
  `}
52263
52392
  `;
52264
52393
  const SectionDiv = styled.div`
52265
- &:nth-child(2),
52266
- &:nth-child(4){
52267
- border-top: 1px solid #e6e2e2ff;
52268
- padding-top: 16px;
52394
+ ${({
52395
+ $showBorder
52396
+ }) => {
52397
+ switch ($showBorder) {
52398
+ case 'Template Offer':
52399
+ return css`border-top: 1px solid #e6e2e2ff;
52400
+ margin-top: 8px;`;
52401
+ case 'Last defined by you':
52402
+ return css`border-bottom: 1px solid #e6e2e2ff;
52403
+ padding-bottom: 8px;
52404
+ margin-bottom: 8px;`;
52405
+ default:
52406
+ return css`border-top: none`;
52269
52407
  }
52408
+ }}
52270
52409
  `;
52271
52410
  const SectionTitle = styled.li`
52272
52411
  font-size: 14px;
52273
52412
  color: #bdbdbd;
52274
- padding: 12px 12px 0 12px;
52413
+ padding: 8px 12px 0 12px;
52414
+ margin: 8px 12px 0 12px;
52275
52415
  font-weight: 500;
52276
52416
  pointer-events: none;
52417
+ list-style: none;
52277
52418
  `;
52278
52419
  const DropdownItem = styled.li`
52279
- padding: 8px 16px;
52420
+ padding: 8px 12px;
52280
52421
  cursor: pointer;
52281
52422
  display: flex;
52282
52423
  align-items: center;
@@ -52818,9 +52959,10 @@ const OverlayDropdown = _ref => {
52818
52959
  dropdownMaxHeight: dropdownMaxHeight,
52819
52960
  width: width,
52820
52961
  position: dropdownPosition
52821
- }, dataToRender.map((group, groupIndex) => group.items && group.items.length > 0 && /*#__PURE__*/React$1.createElement(SectionDiv, {
52962
+ }, dataToRender.map((group, groupIndex) => group.items?.length > 0 && /*#__PURE__*/React$1.createElement(SectionDiv, {
52963
+ $showBorder: group.overlayName,
52822
52964
  key: group.overlayCode
52823
- }, (groupIndex === 0 || groupIndex === 3) && /*#__PURE__*/React$1.createElement(SectionTitle, null, group.overlayName), group.items.map(item => /*#__PURE__*/React$1.createElement(DropdownItem, {
52965
+ }, ['Template Offer', 'Last defined by you'].includes(group.overlayName) && /*#__PURE__*/React$1.createElement(SectionTitle, null, group.overlayName), group.items.map(item => /*#__PURE__*/React$1.createElement(DropdownItem, {
52824
52966
  key: item.value,
52825
52967
  selected: item.value === value,
52826
52968
  selectedColor: selectedColor,