sag_components 2.0.0-beta185 → 2.0.0-beta187

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
@@ -35610,7 +35610,7 @@ const Input$2 = _ref => {
35610
35610
  disabled,
35611
35611
  isDarkerBackground = false,
35612
35612
  width,
35613
- height = '50px',
35613
+ height = "50px",
35614
35614
  error,
35615
35615
  errorMessage,
35616
35616
  labelColor,
@@ -35624,7 +35624,7 @@ const Input$2 = _ref => {
35624
35624
  maxLength
35625
35625
  } = _ref;
35626
35626
  const [isFocused, setIsFocused] = useState(false);
35627
- const [inputValue, setInputValue] = useState('');
35627
+ const [inputValue, setInputValue] = useState("");
35628
35628
  const [showPassword, setShowPassword] = useState(false);
35629
35629
  const inputRef = useRef(null);
35630
35630
  const containerRef = useRef(null);
@@ -35645,9 +35645,14 @@ const Input$2 = _ref => {
35645
35645
  inputRef?.current?.focus();
35646
35646
  }
35647
35647
  onChange({
35648
- newValue: e.target.value || ''
35648
+ newValue: e.target.value || ""
35649
35649
  });
35650
35650
  };
35651
+ const handleContainerClick = e => {
35652
+ if (onClick && typeof onClick === "function") {
35653
+ onClick(e);
35654
+ }
35655
+ };
35651
35656
  const handleFocus = () => {
35652
35657
  setIsFocused(true);
35653
35658
  if (inputRef?.current) {
@@ -35671,18 +35676,18 @@ const Input$2 = _ref => {
35671
35676
  });
35672
35677
  };
35673
35678
  const getLeftIcon = () => {
35674
- if (!leftIcon || leftIcon === 'none') return '';
35675
- return getIcon(leftIcon, '14px', '14px', error ? 'red' : labelColor, disabled, 'pointer', leftIconOnClickHandler);
35679
+ if (!leftIcon || leftIcon === "none") return "";
35680
+ return getIcon(leftIcon, "14px", "14px", error ? "red" : labelColor, disabled, "pointer", leftIconOnClickHandler);
35676
35681
  };
35677
35682
  const getRightIcon = () => {
35678
- if (!rightIcon || rightIcon === 'none') return '';
35679
- return getIcon(rightIcon, '14px', '14px', error ? 'red' : labelColor, disabled, 'pointer', rightIconOnClickHandler);
35683
+ if (!rightIcon || rightIcon === "none") return "";
35684
+ return getIcon(rightIcon, "14px", "14px", error ? "red" : labelColor, disabled, "pointer", rightIconOnClickHandler);
35680
35685
  };
35681
35686
  const toggleShowPassword = () => {
35682
35687
  setShowPassword(!showPassword);
35683
35688
  };
35684
35689
  const getPasswordIcon = () => {
35685
- if (!password) return '';
35690
+ if (!password) return "";
35686
35691
  if (showPassword) {
35687
35692
  return /*#__PURE__*/React$1.createElement(IconWrapper$1, {
35688
35693
  className: "passwordEyeSlash",
@@ -35690,16 +35695,16 @@ const Input$2 = _ref => {
35690
35695
  onClick: toggleShowPassword
35691
35696
  }, /*#__PURE__*/React$1.createElement(FaEyeSlash, {
35692
35697
  onClick: toggleShowPassword,
35693
- color: error ? 'red' : labelColor
35698
+ color: error ? "red" : labelColor
35694
35699
  }));
35695
35700
  }
35696
- return getIcon('eye', '14px', '14px', error ? 'red' : labelColor, disabled, 'pointer', toggleShowPassword);
35701
+ return getIcon("eye", "14px", "14px", error ? "red" : labelColor, disabled, "pointer", toggleShowPassword);
35697
35702
  };
35698
35703
 
35699
35704
  // Calculate dynamic height for multiline inputs
35700
35705
  const calculateHeight = () => {
35701
35706
  if (!multiline) return height;
35702
- const baseHeight = size === 'small' ? 32 : 52;
35707
+ const baseHeight = size === "small" ? 32 : 52;
35703
35708
  const lineHeight = 20;
35704
35709
  const padding = 10;
35705
35710
  return `${baseHeight + (rows - 1) * lineHeight + padding}px`;
@@ -35712,7 +35717,8 @@ const Input$2 = _ref => {
35712
35717
  size: size,
35713
35718
  disabled: disabled,
35714
35719
  isDarkerBackground: isDarkerBackground,
35715
- multiline: multiline
35720
+ multiline: multiline,
35721
+ onClick: handleContainerClick
35716
35722
  }, /*#__PURE__*/React$1.createElement(InputContainer, {
35717
35723
  className: "InputContainer",
35718
35724
  labelColor: labelColor,
@@ -35738,7 +35744,7 @@ const Input$2 = _ref => {
35738
35744
  isFocused: isFocused,
35739
35745
  labelColor: labelColor,
35740
35746
  hasValue: inputValue,
35741
- leftIcon: !multiline ? leftIcon : 'none',
35747
+ leftIcon: !multiline ? leftIcon : "none",
35742
35748
  disabled: disabled,
35743
35749
  isDarkerBackground: isDarkerBackground,
35744
35750
  error: error,
@@ -35748,13 +35754,13 @@ const Input$2 = _ref => {
35748
35754
  multiline: multiline
35749
35755
  }, inputValue ? label : labelEmptyValue || label, required && /*#__PURE__*/React$1.createElement("span", {
35750
35756
  style: {
35751
- color: disabled ? '#D0D0D0' : 'red',
35752
- height: '16px'
35757
+ color: disabled ? "#D0D0D0" : "red",
35758
+ height: "16px"
35753
35759
  }
35754
35760
  }, "*")), /*#__PURE__*/React$1.createElement(InputElement, {
35755
35761
  className: multiline ? "StyledTextarea" : "StyledInput",
35756
35762
  ref: inputRef,
35757
- type: password && !showPassword ? 'password' : 'text',
35763
+ type: password && !showPassword ? "password" : "text",
35758
35764
  value: inputValue,
35759
35765
  onChange: handleInputChange,
35760
35766
  onClick: handleLabelClick,
@@ -35762,7 +35768,7 @@ const Input$2 = _ref => {
35762
35768
  onBlur: handleBlur,
35763
35769
  disabled: disabled,
35764
35770
  isDarkerBackground: isDarkerBackground,
35765
- placeholder: isFocused ? placeHolder : '',
35771
+ placeholder: isFocused ? placeHolder : "",
35766
35772
  error: error,
35767
35773
  height: calculateHeight(),
35768
35774
  isFocused: isFocused,
@@ -35774,10 +35780,10 @@ const Input$2 = _ref => {
35774
35780
  width: width
35775
35781
  }, errorMessage), multiline && maxLength && /*#__PURE__*/React$1.createElement("div", {
35776
35782
  style: {
35777
- fontSize: '12px',
35778
- color: inputValue.length > maxLength * 0.9 ? 'orange' : '#666',
35779
- textAlign: 'right',
35780
- marginTop: '4px'
35783
+ fontSize: "12px",
35784
+ color: inputValue.length > maxLength * 0.9 ? "orange" : "#666",
35785
+ textAlign: "right",
35786
+ marginTop: "4px"
35781
35787
  }
35782
35788
  }, inputValue.length, "/", maxLength));
35783
35789
  };
@@ -35806,19 +35812,19 @@ Input$2.propTypes = {
35806
35812
  maxLength: PropTypes.number
35807
35813
  };
35808
35814
  Input$2.defaultProps = {
35809
- placeHolder: 'Type...',
35810
- label: '',
35811
- labelEmptyValue: '',
35812
- size: 'medium',
35813
- labelColor: '#066768',
35815
+ placeHolder: "Type...",
35816
+ label: "",
35817
+ labelEmptyValue: "",
35818
+ size: "medium",
35819
+ labelColor: "#066768",
35814
35820
  required: true,
35815
- width: '300px',
35821
+ width: "300px",
35816
35822
  disabled: false,
35817
35823
  error: false,
35818
- errorMessage: '',
35819
- selectedValue: '',
35820
- leftIcon: 'none',
35821
- rightIcon: 'none',
35824
+ errorMessage: "",
35825
+ selectedValue: "",
35826
+ leftIcon: "none",
35827
+ rightIcon: "none",
35822
35828
  leftIconOnClick: () => {},
35823
35829
  rightIconOnClick: () => {},
35824
35830
  onBlur: () => {},