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.js CHANGED
@@ -24328,23 +24328,24 @@ const IconContainer$2 = styled__default["default"].div`
24328
24328
  cursor: pointer;
24329
24329
  `;
24330
24330
 
24331
- const QuickFilterDropdownMultiSelection = ({
24332
- label,
24333
- labelEmptyValue,
24334
- options,
24335
- selectedValue,
24336
- placeHolder,
24337
- onChange,
24338
- required,
24339
- disabled,
24340
- width,
24341
- error,
24342
- errorMessage,
24343
- labelColor,
24344
- xIconShow,
24345
- checkBoxColor,
24346
- showLabelOnTop
24347
- }) => {
24331
+ const QuickFilterDropdownMultiSelection = _ref => {
24332
+ let {
24333
+ label,
24334
+ labelEmptyValue,
24335
+ options,
24336
+ selectedValue,
24337
+ placeHolder,
24338
+ onChange,
24339
+ required,
24340
+ disabled,
24341
+ width,
24342
+ error,
24343
+ errorMessage,
24344
+ labelColor,
24345
+ xIconShow,
24346
+ checkBoxColor,
24347
+ showLabelOnTop
24348
+ } = _ref;
24348
24349
  const [isFocused, setIsFocused] = React$1.useState(false);
24349
24350
  const [showOptions, setShowOptions] = React$1.useState(false);
24350
24351
  const [inputValue, setInputValue] = React$1.useState('');
@@ -38131,6 +38132,15 @@ const TableCell = styled__default["default"].td`
38131
38132
  position: relative;
38132
38133
  transition: all 0.3s ease;
38133
38134
 
38135
+ /* Special handling for tag cells - allow wrapping */
38136
+ ${props => props.$fieldType === 'tag' && `
38137
+ white-space: normal;
38138
+ overflow: visible;
38139
+ text-overflow: unset;
38140
+ line-height: 1.5;
38141
+ vertical-align: top;
38142
+ `}
38143
+
38134
38144
  /* CSS-only tooltip */
38135
38145
  &[data-tooltip]:hover::before {
38136
38146
  content: attr(data-tooltip);
@@ -38336,6 +38346,67 @@ const StatusCellCircle = styled__default["default"].div`
38336
38346
  border: 1px solid white;
38337
38347
  background-color: ${props => props.backgroundColor};
38338
38348
  `;
38349
+
38350
+ // NEW TAG STYLES
38351
+ const TagContainer = styled__default["default"].div`
38352
+ display: flex;
38353
+ flex-wrap: wrap;
38354
+ gap: 4px;
38355
+ align-items: flex-start;
38356
+ max-width: 100%;
38357
+ line-height: 1.5;
38358
+ `;
38359
+ const TagChip = styled__default["default"].span`
38360
+ display: inline-flex;
38361
+ align-items: center;
38362
+ padding: 2px 8px;
38363
+ font-size: 12px;
38364
+ font-weight: 500;
38365
+ border-radius: 9999px; /* Tailwind's rounded-full */
38366
+ white-space: nowrap;
38367
+ font-family: "Poppins", sans-serif;
38368
+ border: 1px solid;
38369
+ line-height: 1.3;
38370
+
38371
+ /* Dynamic colors via CSS custom properties */
38372
+ background-color: ${props => props.$backgroundColor || '#F3F4F6'};
38373
+ color: ${props => props.$textColor || '#374151'};
38374
+ border-color: ${props => props.$borderColor || '#9CA3AF'};
38375
+
38376
+ /* Tailwind-style transitions */
38377
+ transition: all 0.15s ease-in-out;
38378
+
38379
+ /* Hover effect for interactive tags */
38380
+ ${props => props.$interactive && `
38381
+ cursor: pointer;
38382
+ &:hover {
38383
+ opacity: 0.8;
38384
+ transform: translateY(-1px);
38385
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
38386
+ }
38387
+ `}
38388
+ `;
38389
+ const TagOverflow = styled__default["default"].span`
38390
+ font-size: 12px;
38391
+ font-weight: 500;
38392
+ color: #6B7280;
38393
+ font-family: "Poppins", sans-serif;
38394
+ cursor: help;
38395
+ display: inline-flex;
38396
+ align-items: center;
38397
+ padding: 2px 4px;
38398
+
38399
+ &:hover {
38400
+ color: #374151;
38401
+ }
38402
+ `;
38403
+ const MultiTagWrapper = styled__default["default"].div`
38404
+ display: flex;
38405
+ flex-wrap: wrap;
38406
+ gap: 4px;
38407
+ max-width: 100%;
38408
+ align-items: flex-start;
38409
+ `;
38339
38410
  const TextareaWrapper = styled__default["default"].div`
38340
38411
  position: relative;
38341
38412
  display: flex;
@@ -38767,6 +38838,12 @@ const TableBody = ({
38767
38838
  height: tooltipHeight
38768
38839
  };
38769
38840
  };
38841
+
38842
+ // Helper function to format tag text
38843
+ const formatTagText = tag => {
38844
+ if (typeof tag !== 'string') return tag;
38845
+ return tag.replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase());
38846
+ };
38770
38847
  const formatValue = (value, column, row, rowIndex) => {
38771
38848
  if (value === null || value === undefined) {
38772
38849
  return '';
@@ -38808,6 +38885,54 @@ const TableBody = ({
38808
38885
  return value.join(', ');
38809
38886
  }
38810
38887
  return value;
38888
+ case 'tag':
38889
+ if (!value) return '';
38890
+ const tagConfig = column.tagConfig || {};
38891
+ const colors = tagConfig.colors || {};
38892
+ const defaultColor = tagConfig.defaultColor || {
38893
+ bg: '#F3F4F6',
38894
+ text: '#374151',
38895
+ border: '#9CA3AF'
38896
+ };
38897
+ const maxDisplay = tagConfig.maxDisplay || 3;
38898
+ const isMultiple = tagConfig.multiple !== false; // Default to true
38899
+
38900
+ // Handle single tag
38901
+ if (typeof value === 'string') {
38902
+ const colorConfig = colors[value] || defaultColor;
38903
+ return /*#__PURE__*/React__default["default"].createElement(TagContainer, null, /*#__PURE__*/React__default["default"].createElement(TagChip, {
38904
+ $backgroundColor: colorConfig.bg,
38905
+ $textColor: colorConfig.text,
38906
+ $borderColor: colorConfig.border,
38907
+ $interactive: false,
38908
+ title: value
38909
+ }, formatTagText(value)));
38910
+ }
38911
+
38912
+ // Handle multiple tags
38913
+ if (Array.isArray(value) && isMultiple) {
38914
+ const visibleTags = value.slice(0, maxDisplay);
38915
+ const remainingCount = value.length - maxDisplay;
38916
+ return /*#__PURE__*/React__default["default"].createElement(TagContainer, null, /*#__PURE__*/React__default["default"].createElement(MultiTagWrapper, null, visibleTags.map((tag, index) => {
38917
+ const colorConfig = colors[tag] || defaultColor;
38918
+ return /*#__PURE__*/React__default["default"].createElement(TagChip, {
38919
+ key: `${tag}-${index}`,
38920
+ $backgroundColor: colorConfig.bg,
38921
+ $textColor: colorConfig.text,
38922
+ $borderColor: colorConfig.border,
38923
+ $interactive: false,
38924
+ title: tag
38925
+ }, formatTagText(tag));
38926
+ }), remainingCount > 0 && /*#__PURE__*/React__default["default"].createElement(TagOverflow, {
38927
+ title: `${remainingCount} more: ${value.slice(maxDisplay).map(tag => formatTagText(tag)).join(', ')}`
38928
+ }, "+", remainingCount)));
38929
+ }
38930
+
38931
+ // Fallback for array treated as single tag
38932
+ if (Array.isArray(value)) {
38933
+ return formatValue(value[0], column, row, rowIndex);
38934
+ }
38935
+ return value;
38811
38936
  case 'packagestatus':
38812
38937
  // Helper function to apply tooltip logic
38813
38938
  const applyTooltipLogic = (element, tooltipText) => {
@@ -38974,7 +39099,7 @@ const TableBody = ({
38974
39099
  el.style.setProperty('--tooltip-left', `${rect.left}px`);
38975
39100
  el.style.setProperty('--tooltip-width', `${rect.width}px`);
38976
39101
  el.style.setProperty('--tooltip-offset', `${offset}px`);
38977
- el.style.setProperty('--tooltip-height', `${offset}px`);
39102
+ el.style.setProperty('--tooltip-height', `${height}px`);
38978
39103
  el.setAttribute('data-tooltip', trashTooltipText);
38979
39104
  }
38980
39105
  }
@@ -39058,10 +39183,14 @@ TableBody.propTypes = {
39058
39183
  onRowClick: PropTypes.func,
39059
39184
  onSendClick: PropTypes.func,
39060
39185
  buttonColor: PropTypes.string,
39186
+ buttonHoverColor: PropTypes.string,
39187
+ selectedColor: PropTypes.string,
39061
39188
  onDeleteClick: PropTypes.func,
39062
- resetFocus: PropTypes.bool,
39189
+ resetFocusIndex: PropTypes.bool,
39190
+ changeFocusIndex: PropTypes.number,
39063
39191
  onFocusChange: PropTypes.func,
39064
39192
  indexToShimmer: PropTypes.number,
39193
+ statuses: PropTypes.array,
39065
39194
  onCommentSave: PropTypes.func,
39066
39195
  commentTextLimit: PropTypes.number,
39067
39196
  ref: PropTypes.object
@@ -52272,21 +52401,33 @@ const DropdownList = styled__default["default"].ul`
52272
52401
  `}
52273
52402
  `;
52274
52403
  const SectionDiv = styled__default["default"].div`
52275
- &:nth-child(2),
52276
- &:nth-child(4){
52277
- border-top: 1px solid #e6e2e2ff;
52278
- padding-top: 16px;
52404
+ ${({
52405
+ $showBorder
52406
+ }) => {
52407
+ switch ($showBorder) {
52408
+ case 'Template Offer':
52409
+ return styled.css`border-top: 1px solid #e6e2e2ff;
52410
+ margin-top: 8px;`;
52411
+ case 'Last defined by you':
52412
+ return styled.css`border-bottom: 1px solid #e6e2e2ff;
52413
+ padding-bottom: 8px;
52414
+ margin-bottom: 8px;`;
52415
+ default:
52416
+ return styled.css`border-top: none`;
52279
52417
  }
52418
+ }}
52280
52419
  `;
52281
52420
  const SectionTitle = styled__default["default"].li`
52282
52421
  font-size: 14px;
52283
52422
  color: #bdbdbd;
52284
- padding: 12px 12px 0 12px;
52423
+ padding: 8px 12px 0 12px;
52424
+ margin: 8px 12px 0 12px;
52285
52425
  font-weight: 500;
52286
52426
  pointer-events: none;
52427
+ list-style: none;
52287
52428
  `;
52288
52429
  const DropdownItem = styled__default["default"].li`
52289
- padding: 8px 16px;
52430
+ padding: 8px 12px;
52290
52431
  cursor: pointer;
52291
52432
  display: flex;
52292
52433
  align-items: center;
@@ -52828,9 +52969,10 @@ const OverlayDropdown = _ref => {
52828
52969
  dropdownMaxHeight: dropdownMaxHeight,
52829
52970
  width: width,
52830
52971
  position: dropdownPosition
52831
- }, dataToRender.map((group, groupIndex) => group.items && group.items.length > 0 && /*#__PURE__*/React__default["default"].createElement(SectionDiv, {
52972
+ }, dataToRender.map((group, groupIndex) => group.items?.length > 0 && /*#__PURE__*/React__default["default"].createElement(SectionDiv, {
52973
+ $showBorder: group.overlayName,
52832
52974
  key: group.overlayCode
52833
- }, (groupIndex === 0 || groupIndex === 3) && /*#__PURE__*/React__default["default"].createElement(SectionTitle, null, group.overlayName), group.items.map(item => /*#__PURE__*/React__default["default"].createElement(DropdownItem, {
52975
+ }, ['Template Offer', 'Last defined by you'].includes(group.overlayName) && /*#__PURE__*/React__default["default"].createElement(SectionTitle, null, group.overlayName), group.items.map(item => /*#__PURE__*/React__default["default"].createElement(DropdownItem, {
52834
52976
  key: item.value,
52835
52977
  selected: item.value === value,
52836
52978
  selectedColor: selectedColor,