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.js CHANGED
@@ -10330,24 +10330,23 @@ const QuarterPopupPicker = ({
10330
10330
  };
10331
10331
 
10332
10332
  /* eslint-disable import/no-extraneous-dependencies */
10333
- const QuarterPicker = _ref => {
10334
- let {
10335
- availableQuarters,
10336
- // ["Q1-2024"]
10337
- label,
10338
- onChange,
10339
- borderRadius,
10340
- required,
10341
- width,
10342
- height,
10343
- placeholder,
10344
- disabled,
10345
- borderColor,
10346
- borderColorFocus,
10347
- textColor,
10348
- selectedValue,
10349
- startYear
10350
- } = _ref;
10333
+ const QuarterPicker = ({
10334
+ availableQuarters,
10335
+ // ["Q1-2024"]
10336
+ label,
10337
+ onChange,
10338
+ borderRadius,
10339
+ required,
10340
+ width,
10341
+ height,
10342
+ placeholder,
10343
+ disabled,
10344
+ borderColor,
10345
+ borderColorFocus,
10346
+ textColor,
10347
+ selectedValue,
10348
+ startYear
10349
+ }) => {
10351
10350
  const [isFocused, setIsFocused] = React$1.useState(false);
10352
10351
  const [isOpen, setIsOpen] = React$1.useState(false);
10353
10352
  const [value, setValue] = React$1.useState('');
@@ -10789,23 +10788,22 @@ const MonthPopupPicker = ({
10789
10788
  };
10790
10789
 
10791
10790
  /* eslint-disable import/no-extraneous-dependencies */
10792
- const MonthPicker = _ref => {
10793
- let {
10794
- availableMonths,
10795
- label,
10796
- onChange,
10797
- borderRadius,
10798
- required,
10799
- width,
10800
- height,
10801
- placeholder,
10802
- disabled,
10803
- borderColor,
10804
- borderColorFocus,
10805
- textColor,
10806
- selectedValue,
10807
- startYear
10808
- } = _ref;
10791
+ const MonthPicker = ({
10792
+ availableMonths,
10793
+ label,
10794
+ onChange,
10795
+ borderRadius,
10796
+ required,
10797
+ width,
10798
+ height,
10799
+ placeholder,
10800
+ disabled,
10801
+ borderColor,
10802
+ borderColorFocus,
10803
+ textColor,
10804
+ selectedValue,
10805
+ startYear
10806
+ }) => {
10809
10807
  const [isFocused, setIsFocused] = React$1.useState(false);
10810
10808
  const [isOpen, setIsOpen] = React$1.useState(false);
10811
10809
  const [value, setValue] = React$1.useState('');
@@ -23916,22 +23914,21 @@ const DeleteIcon = styled__default["default"].div`
23916
23914
  position: absolute;
23917
23915
  `;
23918
23916
 
23919
- const QuickFilterDropdownSingle = _ref => {
23920
- let {
23921
- label,
23922
- hoverColor,
23923
- options,
23924
- selectedValue,
23925
- placeHolder,
23926
- onChange,
23927
- disabled,
23928
- width,
23929
- error,
23930
- errorMessage,
23931
- xIconShow,
23932
- labelColor,
23933
- showLabelOnTop
23934
- } = _ref;
23917
+ const QuickFilterDropdownSingle = ({
23918
+ label,
23919
+ hoverColor,
23920
+ options,
23921
+ selectedValue,
23922
+ placeHolder,
23923
+ onChange,
23924
+ disabled,
23925
+ width,
23926
+ error,
23927
+ errorMessage,
23928
+ xIconShow,
23929
+ labelColor,
23930
+ showLabelOnTop
23931
+ }) => {
23935
23932
  const [isFocused, setIsFocused] = React$1.useState(false);
23936
23933
  const [showOptions, setShowOptions] = React$1.useState(false);
23937
23934
  const [inputValue, setInputValue] = React$1.useState("");
@@ -24328,24 +24325,23 @@ const IconContainer$2 = styled__default["default"].div`
24328
24325
  cursor: pointer;
24329
24326
  `;
24330
24327
 
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;
24328
+ const QuickFilterDropdownMultiSelection = ({
24329
+ label,
24330
+ labelEmptyValue,
24331
+ options,
24332
+ selectedValue,
24333
+ placeHolder,
24334
+ onChange,
24335
+ required,
24336
+ disabled,
24337
+ width,
24338
+ error,
24339
+ errorMessage,
24340
+ labelColor,
24341
+ xIconShow,
24342
+ checkBoxColor,
24343
+ showLabelOnTop
24344
+ }) => {
24349
24345
  const [isFocused, setIsFocused] = React$1.useState(false);
24350
24346
  const [showOptions, setShowOptions] = React$1.useState(false);
24351
24347
  const [inputValue, setInputValue] = React$1.useState('');
@@ -35577,9 +35573,9 @@ const ToggleSlider = styled__default["default"].span`
35577
35573
  }
35578
35574
  `;
35579
35575
 
35580
- /**
35581
- * ToggleSwitch component for on/off states.
35582
- * Supports small/large sizes and disabled state.
35576
+ /**
35577
+ * ToggleSwitch component for on/off states.
35578
+ * Supports small/large sizes and disabled state.
35583
35579
  */
35584
35580
  function ToggleSwitch(_ref) {
35585
35581
  let {
@@ -38132,6 +38128,15 @@ const TableCell = styled__default["default"].td`
38132
38128
  position: relative;
38133
38129
  transition: all 0.3s ease;
38134
38130
 
38131
+ /* Special handling for tag cells - allow wrapping */
38132
+ ${props => props.$fieldType === 'tag' && `
38133
+ white-space: normal;
38134
+ overflow: visible;
38135
+ text-overflow: unset;
38136
+ line-height: 1.5;
38137
+ vertical-align: top;
38138
+ `}
38139
+
38135
38140
  /* CSS-only tooltip */
38136
38141
  &[data-tooltip]:hover::before {
38137
38142
  content: attr(data-tooltip);
@@ -38337,6 +38342,67 @@ const StatusCellCircle = styled__default["default"].div`
38337
38342
  border: 1px solid white;
38338
38343
  background-color: ${props => props.backgroundColor};
38339
38344
  `;
38345
+
38346
+ // NEW TAG STYLES
38347
+ const TagContainer = styled__default["default"].div`
38348
+ display: flex;
38349
+ flex-wrap: wrap;
38350
+ gap: 4px;
38351
+ align-items: flex-start;
38352
+ max-width: 100%;
38353
+ line-height: 1.5;
38354
+ `;
38355
+ const TagChip = styled__default["default"].span`
38356
+ display: inline-flex;
38357
+ align-items: center;
38358
+ padding: 2px 8px;
38359
+ font-size: 12px;
38360
+ font-weight: 500;
38361
+ border-radius: 9999px; /* Tailwind's rounded-full */
38362
+ white-space: nowrap;
38363
+ font-family: "Poppins", sans-serif;
38364
+ border: 1px solid;
38365
+ line-height: 1.3;
38366
+
38367
+ /* Dynamic colors via CSS custom properties */
38368
+ background-color: ${props => props.$backgroundColor || '#F3F4F6'};
38369
+ color: ${props => props.$textColor || '#374151'};
38370
+ border-color: ${props => props.$borderColor || '#9CA3AF'};
38371
+
38372
+ /* Tailwind-style transitions */
38373
+ transition: all 0.15s ease-in-out;
38374
+
38375
+ /* Hover effect for interactive tags */
38376
+ ${props => props.$interactive && `
38377
+ cursor: pointer;
38378
+ &:hover {
38379
+ opacity: 0.8;
38380
+ transform: translateY(-1px);
38381
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
38382
+ }
38383
+ `}
38384
+ `;
38385
+ const TagOverflow = styled__default["default"].span`
38386
+ font-size: 12px;
38387
+ font-weight: 500;
38388
+ color: #6B7280;
38389
+ font-family: "Poppins", sans-serif;
38390
+ cursor: help;
38391
+ display: inline-flex;
38392
+ align-items: center;
38393
+ padding: 2px 4px;
38394
+
38395
+ &:hover {
38396
+ color: #374151;
38397
+ }
38398
+ `;
38399
+ const MultiTagWrapper = styled__default["default"].div`
38400
+ display: flex;
38401
+ flex-wrap: wrap;
38402
+ gap: 4px;
38403
+ max-width: 100%;
38404
+ align-items: flex-start;
38405
+ `;
38340
38406
  const TextareaWrapper = styled__default["default"].div`
38341
38407
  position: relative;
38342
38408
  display: flex;
@@ -38768,6 +38834,12 @@ const TableBody = ({
38768
38834
  height: tooltipHeight
38769
38835
  };
38770
38836
  };
38837
+
38838
+ // Helper function to format tag text
38839
+ const formatTagText = tag => {
38840
+ if (typeof tag !== 'string') return tag;
38841
+ return tag.replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase());
38842
+ };
38771
38843
  const formatValue = (value, column, row, rowIndex) => {
38772
38844
  if (value === null || value === undefined) {
38773
38845
  return '';
@@ -38809,6 +38881,54 @@ const TableBody = ({
38809
38881
  return value.join(', ');
38810
38882
  }
38811
38883
  return value;
38884
+ case 'tag':
38885
+ if (!value) return '';
38886
+ const tagConfig = column.tagConfig || {};
38887
+ const colors = tagConfig.colors || {};
38888
+ const defaultColor = tagConfig.defaultColor || {
38889
+ bg: '#F3F4F6',
38890
+ text: '#374151',
38891
+ border: '#9CA3AF'
38892
+ };
38893
+ const maxDisplay = tagConfig.maxDisplay || 3;
38894
+ const isMultiple = tagConfig.multiple !== false; // Default to true
38895
+
38896
+ // Handle single tag
38897
+ if (typeof value === 'string') {
38898
+ const colorConfig = colors[value] || defaultColor;
38899
+ return /*#__PURE__*/React__default["default"].createElement(TagContainer, null, /*#__PURE__*/React__default["default"].createElement(TagChip, {
38900
+ $backgroundColor: colorConfig.bg,
38901
+ $textColor: colorConfig.text,
38902
+ $borderColor: colorConfig.border,
38903
+ $interactive: false,
38904
+ title: value
38905
+ }, formatTagText(value)));
38906
+ }
38907
+
38908
+ // Handle multiple tags
38909
+ if (Array.isArray(value) && isMultiple) {
38910
+ const visibleTags = value.slice(0, maxDisplay);
38911
+ const remainingCount = value.length - maxDisplay;
38912
+ return /*#__PURE__*/React__default["default"].createElement(TagContainer, null, /*#__PURE__*/React__default["default"].createElement(MultiTagWrapper, null, visibleTags.map((tag, index) => {
38913
+ const colorConfig = colors[tag] || defaultColor;
38914
+ return /*#__PURE__*/React__default["default"].createElement(TagChip, {
38915
+ key: `${tag}-${index}`,
38916
+ $backgroundColor: colorConfig.bg,
38917
+ $textColor: colorConfig.text,
38918
+ $borderColor: colorConfig.border,
38919
+ $interactive: false,
38920
+ title: tag
38921
+ }, formatTagText(tag));
38922
+ }), remainingCount > 0 && /*#__PURE__*/React__default["default"].createElement(TagOverflow, {
38923
+ title: `${remainingCount} more: ${value.slice(maxDisplay).map(tag => formatTagText(tag)).join(', ')}`
38924
+ }, "+", remainingCount)));
38925
+ }
38926
+
38927
+ // Fallback for array treated as single tag
38928
+ if (Array.isArray(value)) {
38929
+ return formatValue(value[0], column, row, rowIndex);
38930
+ }
38931
+ return value;
38812
38932
  case 'packagestatus':
38813
38933
  // Helper function to apply tooltip logic
38814
38934
  const applyTooltipLogic = (element, tooltipText) => {
@@ -38975,7 +39095,7 @@ const TableBody = ({
38975
39095
  el.style.setProperty('--tooltip-left', `${rect.left}px`);
38976
39096
  el.style.setProperty('--tooltip-width', `${rect.width}px`);
38977
39097
  el.style.setProperty('--tooltip-offset', `${offset}px`);
38978
- el.style.setProperty('--tooltip-height', `${offset}px`);
39098
+ el.style.setProperty('--tooltip-height', `${height}px`);
38979
39099
  el.setAttribute('data-tooltip', trashTooltipText);
38980
39100
  }
38981
39101
  }
@@ -39059,10 +39179,14 @@ TableBody.propTypes = {
39059
39179
  onRowClick: PropTypes.func,
39060
39180
  onSendClick: PropTypes.func,
39061
39181
  buttonColor: PropTypes.string,
39182
+ buttonHoverColor: PropTypes.string,
39183
+ selectedColor: PropTypes.string,
39062
39184
  onDeleteClick: PropTypes.func,
39063
- resetFocus: PropTypes.bool,
39185
+ resetFocusIndex: PropTypes.bool,
39186
+ changeFocusIndex: PropTypes.number,
39064
39187
  onFocusChange: PropTypes.func,
39065
39188
  indexToShimmer: PropTypes.number,
39189
+ statuses: PropTypes.array,
39066
39190
  onCommentSave: PropTypes.func,
39067
39191
  commentTextLimit: PropTypes.number,
39068
39192
  ref: PropTypes.object
@@ -52272,16 +52396,19 @@ const DropdownList = styled__default["default"].ul`
52272
52396
  top: 110%;
52273
52397
  `}
52274
52398
  `;
52399
+ const SectionDiv = styled__default["default"].div`
52400
+ &:nth-child(2),
52401
+ &:nth-child(4){
52402
+ border-top: 1px solid #e6e2e2ff;
52403
+ padding-top: 16px;
52404
+ }
52405
+ `;
52275
52406
  const SectionTitle = styled__default["default"].li`
52276
52407
  font-size: 14px;
52277
52408
  color: #bdbdbd;
52278
52409
  padding: 12px 12px 0 12px;
52279
52410
  font-weight: 500;
52280
52411
  pointer-events: none;
52281
- &:not(:first-child) {
52282
- border-top: 1px solid #bdbdbd;
52283
- padding-top: 16px;
52284
- }
52285
52412
  `;
52286
52413
  const DropdownItem = styled__default["default"].li`
52287
52414
  padding: 8px 16px;
@@ -52826,9 +52953,9 @@ const OverlayDropdown = _ref => {
52826
52953
  dropdownMaxHeight: dropdownMaxHeight,
52827
52954
  width: width,
52828
52955
  position: dropdownPosition
52829
- }, dataToRender.map((group, groupIndex) => group.items && group.items.length > 0 && /*#__PURE__*/React__default["default"].createElement("div", {
52956
+ }, dataToRender.map((group, groupIndex) => group.items && group.items.length > 0 && /*#__PURE__*/React__default["default"].createElement(SectionDiv, {
52830
52957
  key: group.overlayCode
52831
- }, /*#__PURE__*/React__default["default"].createElement(SectionTitle, null, group.overlayName), group.items.map(item => /*#__PURE__*/React__default["default"].createElement(DropdownItem, {
52958
+ }, (groupIndex === 0 || groupIndex === 3) && /*#__PURE__*/React__default["default"].createElement(SectionTitle, null, group.overlayName), group.items.map(item => /*#__PURE__*/React__default["default"].createElement(DropdownItem, {
52832
52959
  key: item.value,
52833
52960
  selected: item.value === value,
52834
52961
  selectedColor: selectedColor,