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 CHANGED
@@ -10320,24 +10320,23 @@ const QuarterPopupPicker = ({
10320
10320
  };
10321
10321
 
10322
10322
  /* eslint-disable import/no-extraneous-dependencies */
10323
- const QuarterPicker = _ref => {
10324
- let {
10325
- availableQuarters,
10326
- // ["Q1-2024"]
10327
- label,
10328
- onChange,
10329
- borderRadius,
10330
- required,
10331
- width,
10332
- height,
10333
- placeholder,
10334
- disabled,
10335
- borderColor,
10336
- borderColorFocus,
10337
- textColor,
10338
- selectedValue,
10339
- startYear
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 = _ref => {
10783
- let {
10784
- availableMonths,
10785
- label,
10786
- onChange,
10787
- borderRadius,
10788
- required,
10789
- width,
10790
- height,
10791
- placeholder,
10792
- disabled,
10793
- borderColor,
10794
- borderColorFocus,
10795
- textColor,
10796
- selectedValue,
10797
- startYear
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 = _ref => {
23910
- let {
23911
- label,
23912
- hoverColor,
23913
- options,
23914
- selectedValue,
23915
- placeHolder,
23916
- onChange,
23917
- disabled,
23918
- width,
23919
- error,
23920
- errorMessage,
23921
- xIconShow,
23922
- labelColor,
23923
- showLabelOnTop
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 = _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;
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', `${offset}px`);
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
- resetFocus: PropTypes.bool,
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("div", {
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,