sag_components 2.0.0-beta251 → 2.0.0-beta253

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
@@ -10591,23 +10591,24 @@ const QuarterPopupPicker = ({
10591
10591
  };
10592
10592
 
10593
10593
  /* eslint-disable import/no-extraneous-dependencies */
10594
- const QuarterPicker = ({
10595
- availableQuarters,
10596
- // ["Q1-2024"]
10597
- label,
10598
- onChange,
10599
- borderRadius,
10600
- required,
10601
- width,
10602
- height,
10603
- placeholder,
10604
- disabled,
10605
- borderColor,
10606
- borderColorFocus,
10607
- textColor,
10608
- selectedValue,
10609
- startYear
10610
- }) => {
10594
+ const QuarterPicker = _ref => {
10595
+ let {
10596
+ availableQuarters,
10597
+ // ["Q1-2024"]
10598
+ label,
10599
+ onChange,
10600
+ borderRadius,
10601
+ required,
10602
+ width,
10603
+ height,
10604
+ placeholder,
10605
+ disabled,
10606
+ borderColor,
10607
+ borderColorFocus,
10608
+ textColor,
10609
+ selectedValue,
10610
+ startYear
10611
+ } = _ref;
10611
10612
  const [isFocused, setIsFocused] = React$1.useState(false);
10612
10613
  const [isOpen, setIsOpen] = React$1.useState(false);
10613
10614
  const [value, setValue] = React$1.useState('');
@@ -11049,22 +11050,23 @@ const MonthPopupPicker = ({
11049
11050
  };
11050
11051
 
11051
11052
  /* eslint-disable import/no-extraneous-dependencies */
11052
- const MonthPicker = ({
11053
- availableMonths,
11054
- label,
11055
- onChange,
11056
- borderRadius,
11057
- required,
11058
- width,
11059
- height,
11060
- placeholder,
11061
- disabled,
11062
- borderColor,
11063
- borderColorFocus,
11064
- textColor,
11065
- selectedValue,
11066
- startYear
11067
- }) => {
11053
+ const MonthPicker = _ref => {
11054
+ let {
11055
+ availableMonths,
11056
+ label,
11057
+ onChange,
11058
+ borderRadius,
11059
+ required,
11060
+ width,
11061
+ height,
11062
+ placeholder,
11063
+ disabled,
11064
+ borderColor,
11065
+ borderColorFocus,
11066
+ textColor,
11067
+ selectedValue,
11068
+ startYear
11069
+ } = _ref;
11068
11070
  const [isFocused, setIsFocused] = React$1.useState(false);
11069
11071
  const [isOpen, setIsOpen] = React$1.useState(false);
11070
11072
  const [value, setValue] = React$1.useState('');
@@ -24175,21 +24177,22 @@ const DeleteIcon = styled__default["default"].div`
24175
24177
  position: absolute;
24176
24178
  `;
24177
24179
 
24178
- const QuickFilterDropdownSingle = ({
24179
- label,
24180
- hoverColor,
24181
- options,
24182
- selectedValue,
24183
- placeHolder,
24184
- onChange,
24185
- disabled,
24186
- width,
24187
- error,
24188
- errorMessage,
24189
- xIconShow,
24190
- labelColor,
24191
- showLabelOnTop
24192
- }) => {
24180
+ const QuickFilterDropdownSingle = _ref => {
24181
+ let {
24182
+ label,
24183
+ hoverColor,
24184
+ options,
24185
+ selectedValue,
24186
+ placeHolder,
24187
+ onChange,
24188
+ disabled,
24189
+ width,
24190
+ error,
24191
+ errorMessage,
24192
+ xIconShow,
24193
+ labelColor,
24194
+ showLabelOnTop
24195
+ } = _ref;
24193
24196
  const [isFocused, setIsFocused] = React$1.useState(false);
24194
24197
  const [showOptions, setShowOptions] = React$1.useState(false);
24195
24198
  const [inputValue, setInputValue] = React$1.useState("");
@@ -24646,25 +24649,26 @@ const IconContainer$2 = styled__default["default"].div`
24646
24649
  cursor: pointer;
24647
24650
  `;
24648
24651
 
24649
- const QuickFilterDropdownMultiSelection = ({
24650
- label,
24651
- labelEmptyValue,
24652
- options,
24653
- selectedValue,
24654
- placeHolder,
24655
- onChange,
24656
- required,
24657
- disabled,
24658
- width,
24659
- height,
24660
- error,
24661
- errorMessage,
24662
- labelColor,
24663
- xIconShow,
24664
- checkBoxColor,
24665
- showLabelOnTop,
24666
- dropdownHeight
24667
- }) => {
24652
+ const QuickFilterDropdownMultiSelection = _ref => {
24653
+ let {
24654
+ label,
24655
+ labelEmptyValue,
24656
+ options,
24657
+ selectedValue,
24658
+ placeHolder,
24659
+ onChange,
24660
+ required,
24661
+ disabled,
24662
+ width,
24663
+ height,
24664
+ error,
24665
+ errorMessage,
24666
+ labelColor,
24667
+ xIconShow,
24668
+ checkBoxColor,
24669
+ showLabelOnTop,
24670
+ dropdownHeight
24671
+ } = _ref;
24668
24672
  const [isFocused, setIsFocused] = React$1.useState(false);
24669
24673
  const [showOptions, setShowOptions] = React$1.useState(false);
24670
24674
  const [inputValue, setInputValue] = React$1.useState('');
@@ -35776,6 +35780,9 @@ const StyledInput = styled__default["default"].input`
35776
35780
  border: none;
35777
35781
  cursor: ${props => props.disabled ? 'not-allowed' : 'text'};
35778
35782
  font-family: "Poppins", sans-serif;
35783
+ overflow: hidden;
35784
+ text-overflow: ellipsis;
35785
+ white-space: nowrap;
35779
35786
  `;
35780
35787
  const StyledTextarea = styled__default["default"].textarea`
35781
35788
  width: 100%;
@@ -35872,11 +35879,19 @@ const Input$2 = _ref => {
35872
35879
  const [isFocused, setIsFocused] = React$1.useState(false);
35873
35880
  const [inputValue, setInputValue] = React$1.useState("");
35874
35881
  const [showPassword, setShowPassword] = React$1.useState(false);
35882
+ const [isOverflowing, setIsOverflowing] = React$1.useState(false);
35875
35883
  const inputRef = React$1.useRef(null);
35876
35884
  const containerRef = React$1.useRef(null);
35877
35885
  React$1.useEffect(() => {
35878
35886
  setInputValue(selectedValue);
35879
35887
  }, [selectedValue]);
35888
+ React$1.useEffect(() => {
35889
+ if (inputRef?.current && !multiline && !isFocused) {
35890
+ const element = inputRef.current;
35891
+ const hasOverflow = element.scrollWidth > element.clientWidth;
35892
+ setIsOverflowing(hasOverflow);
35893
+ }
35894
+ }, [inputValue, multiline, width, isFocused]);
35880
35895
  const handleLabelClick = () => {
35881
35896
  if (disabled) return;
35882
35897
  setIsFocused(true);
@@ -35970,7 +35985,8 @@ const Input$2 = _ref => {
35970
35985
  disabled: disabled,
35971
35986
  isDarkerBackground: isDarkerBackground,
35972
35987
  multiline: multiline,
35973
- onClick: handleContainerClick
35988
+ onClick: handleContainerClick,
35989
+ title: isOverflowing && inputValue && !isFocused ? inputValue : ""
35974
35990
  }, /*#__PURE__*/React__default["default"].createElement(InputContainer, {
35975
35991
  className: "InputContainer",
35976
35992
  labelColor: labelColor,
@@ -36162,9 +36178,9 @@ const ToggleSlider = styled__default["default"].span`
36162
36178
  }
36163
36179
  `;
36164
36180
 
36165
- /**
36166
- * ToggleSwitch component for on/off states.
36167
- * Supports small/large sizes and disabled state.
36181
+ /**
36182
+ * ToggleSwitch component for on/off states.
36183
+ * Supports small/large sizes and disabled state.
36168
36184
  */
36169
36185
  function ToggleSwitch(_ref) {
36170
36186
  let {
@@ -42856,14 +42872,27 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
42856
42872
  return `${value || 0}%`;
42857
42873
  case "date":
42858
42874
  try {
42875
+ let formattedDate = value;
42859
42876
  if (column.format === "MM/DD/YYYY" && value) {
42860
42877
  const date = new Date(value);
42861
42878
  if (isNaN(date.getTime())) {
42862
42879
  return String(value);
42863
42880
  }
42864
- return `${(date.getMonth() + 1).toString().padStart(2, "0")}/${date.getDate().toString().padStart(2, "0")}/${date.getFullYear()}`;
42881
+ formattedDate = `${(date.getMonth() + 1).toString().padStart(2, "0")}/${date.getDate().toString().padStart(2, "0")}/${date.getFullYear()}`;
42882
+ } else {
42883
+ formattedDate = String(value || "");
42865
42884
  }
42866
- return String(value || "");
42885
+
42886
+ // Check if this column should check for expiration
42887
+ if (column.checkExpiration !== false && value && isDateExpired(value)) {
42888
+ return /*#__PURE__*/React__default["default"].createElement("span", {
42889
+ style: {
42890
+ color: "#D23630",
42891
+ textDecoration: "line-through"
42892
+ }
42893
+ }, formattedDate);
42894
+ }
42895
+ return formattedDate;
42867
42896
  } catch (e) {
42868
42897
  console.warn('Error formatting date:', e);
42869
42898
  return String(value || "");
@@ -43367,7 +43396,21 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
43367
43396
  rowIndex: rowIndex
43368
43397
  });
43369
43398
  }
43370
- console.log('handler--------', row, columnKey, currentValue, rowIndex);
43399
+ };
43400
+
43401
+ // Helper function to check if date is expired (past current date)
43402
+ const isDateExpired = dateString => {
43403
+ if (!dateString) return false;
43404
+ try {
43405
+ const date = new Date(dateString);
43406
+ if (isNaN(date.getTime())) return false;
43407
+ const today = new Date();
43408
+ today.setHours(0, 0, 0, 0); // Reset time to start of day for fair comparison
43409
+ date.setHours(0, 0, 0, 0);
43410
+ return date < today;
43411
+ } catch (error) {
43412
+ return false;
43413
+ }
43371
43414
  };
43372
43415
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(StyledTableBody, {
43373
43416
  ref: ref