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 +37 -31
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +37 -31
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -35620,7 +35620,7 @@ const Input$2 = _ref => {
|
|
|
35620
35620
|
disabled,
|
|
35621
35621
|
isDarkerBackground = false,
|
|
35622
35622
|
width,
|
|
35623
|
-
height =
|
|
35623
|
+
height = "50px",
|
|
35624
35624
|
error,
|
|
35625
35625
|
errorMessage,
|
|
35626
35626
|
labelColor,
|
|
@@ -35634,7 +35634,7 @@ const Input$2 = _ref => {
|
|
|
35634
35634
|
maxLength
|
|
35635
35635
|
} = _ref;
|
|
35636
35636
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
35637
|
-
const [inputValue, setInputValue] = React$1.useState(
|
|
35637
|
+
const [inputValue, setInputValue] = React$1.useState("");
|
|
35638
35638
|
const [showPassword, setShowPassword] = React$1.useState(false);
|
|
35639
35639
|
const inputRef = React$1.useRef(null);
|
|
35640
35640
|
const containerRef = React$1.useRef(null);
|
|
@@ -35655,9 +35655,14 @@ const Input$2 = _ref => {
|
|
|
35655
35655
|
inputRef?.current?.focus();
|
|
35656
35656
|
}
|
|
35657
35657
|
onChange({
|
|
35658
|
-
newValue: e.target.value ||
|
|
35658
|
+
newValue: e.target.value || ""
|
|
35659
35659
|
});
|
|
35660
35660
|
};
|
|
35661
|
+
const handleContainerClick = e => {
|
|
35662
|
+
if (onClick && typeof onClick === "function") {
|
|
35663
|
+
onClick(e);
|
|
35664
|
+
}
|
|
35665
|
+
};
|
|
35661
35666
|
const handleFocus = () => {
|
|
35662
35667
|
setIsFocused(true);
|
|
35663
35668
|
if (inputRef?.current) {
|
|
@@ -35681,18 +35686,18 @@ const Input$2 = _ref => {
|
|
|
35681
35686
|
});
|
|
35682
35687
|
};
|
|
35683
35688
|
const getLeftIcon = () => {
|
|
35684
|
-
if (!leftIcon || leftIcon ===
|
|
35685
|
-
return getIcon(leftIcon,
|
|
35689
|
+
if (!leftIcon || leftIcon === "none") return "";
|
|
35690
|
+
return getIcon(leftIcon, "14px", "14px", error ? "red" : labelColor, disabled, "pointer", leftIconOnClickHandler);
|
|
35686
35691
|
};
|
|
35687
35692
|
const getRightIcon = () => {
|
|
35688
|
-
if (!rightIcon || rightIcon ===
|
|
35689
|
-
return getIcon(rightIcon,
|
|
35693
|
+
if (!rightIcon || rightIcon === "none") return "";
|
|
35694
|
+
return getIcon(rightIcon, "14px", "14px", error ? "red" : labelColor, disabled, "pointer", rightIconOnClickHandler);
|
|
35690
35695
|
};
|
|
35691
35696
|
const toggleShowPassword = () => {
|
|
35692
35697
|
setShowPassword(!showPassword);
|
|
35693
35698
|
};
|
|
35694
35699
|
const getPasswordIcon = () => {
|
|
35695
|
-
if (!password) return
|
|
35700
|
+
if (!password) return "";
|
|
35696
35701
|
if (showPassword) {
|
|
35697
35702
|
return /*#__PURE__*/React__default["default"].createElement(IconWrapper$1, {
|
|
35698
35703
|
className: "passwordEyeSlash",
|
|
@@ -35700,16 +35705,16 @@ const Input$2 = _ref => {
|
|
|
35700
35705
|
onClick: toggleShowPassword
|
|
35701
35706
|
}, /*#__PURE__*/React__default["default"].createElement(FaEyeSlash, {
|
|
35702
35707
|
onClick: toggleShowPassword,
|
|
35703
|
-
color: error ?
|
|
35708
|
+
color: error ? "red" : labelColor
|
|
35704
35709
|
}));
|
|
35705
35710
|
}
|
|
35706
|
-
return getIcon(
|
|
35711
|
+
return getIcon("eye", "14px", "14px", error ? "red" : labelColor, disabled, "pointer", toggleShowPassword);
|
|
35707
35712
|
};
|
|
35708
35713
|
|
|
35709
35714
|
// Calculate dynamic height for multiline inputs
|
|
35710
35715
|
const calculateHeight = () => {
|
|
35711
35716
|
if (!multiline) return height;
|
|
35712
|
-
const baseHeight = size ===
|
|
35717
|
+
const baseHeight = size === "small" ? 32 : 52;
|
|
35713
35718
|
const lineHeight = 20;
|
|
35714
35719
|
const padding = 10;
|
|
35715
35720
|
return `${baseHeight + (rows - 1) * lineHeight + padding}px`;
|
|
@@ -35722,7 +35727,8 @@ const Input$2 = _ref => {
|
|
|
35722
35727
|
size: size,
|
|
35723
35728
|
disabled: disabled,
|
|
35724
35729
|
isDarkerBackground: isDarkerBackground,
|
|
35725
|
-
multiline: multiline
|
|
35730
|
+
multiline: multiline,
|
|
35731
|
+
onClick: handleContainerClick
|
|
35726
35732
|
}, /*#__PURE__*/React__default["default"].createElement(InputContainer, {
|
|
35727
35733
|
className: "InputContainer",
|
|
35728
35734
|
labelColor: labelColor,
|
|
@@ -35748,7 +35754,7 @@ const Input$2 = _ref => {
|
|
|
35748
35754
|
isFocused: isFocused,
|
|
35749
35755
|
labelColor: labelColor,
|
|
35750
35756
|
hasValue: inputValue,
|
|
35751
|
-
leftIcon: !multiline ? leftIcon :
|
|
35757
|
+
leftIcon: !multiline ? leftIcon : "none",
|
|
35752
35758
|
disabled: disabled,
|
|
35753
35759
|
isDarkerBackground: isDarkerBackground,
|
|
35754
35760
|
error: error,
|
|
@@ -35758,13 +35764,13 @@ const Input$2 = _ref => {
|
|
|
35758
35764
|
multiline: multiline
|
|
35759
35765
|
}, inputValue ? label : labelEmptyValue || label, required && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
35760
35766
|
style: {
|
|
35761
|
-
color: disabled ?
|
|
35762
|
-
height:
|
|
35767
|
+
color: disabled ? "#D0D0D0" : "red",
|
|
35768
|
+
height: "16px"
|
|
35763
35769
|
}
|
|
35764
35770
|
}, "*")), /*#__PURE__*/React__default["default"].createElement(InputElement, {
|
|
35765
35771
|
className: multiline ? "StyledTextarea" : "StyledInput",
|
|
35766
35772
|
ref: inputRef,
|
|
35767
|
-
type: password && !showPassword ?
|
|
35773
|
+
type: password && !showPassword ? "password" : "text",
|
|
35768
35774
|
value: inputValue,
|
|
35769
35775
|
onChange: handleInputChange,
|
|
35770
35776
|
onClick: handleLabelClick,
|
|
@@ -35772,7 +35778,7 @@ const Input$2 = _ref => {
|
|
|
35772
35778
|
onBlur: handleBlur,
|
|
35773
35779
|
disabled: disabled,
|
|
35774
35780
|
isDarkerBackground: isDarkerBackground,
|
|
35775
|
-
placeholder: isFocused ? placeHolder :
|
|
35781
|
+
placeholder: isFocused ? placeHolder : "",
|
|
35776
35782
|
error: error,
|
|
35777
35783
|
height: calculateHeight(),
|
|
35778
35784
|
isFocused: isFocused,
|
|
@@ -35784,10 +35790,10 @@ const Input$2 = _ref => {
|
|
|
35784
35790
|
width: width
|
|
35785
35791
|
}, errorMessage), multiline && maxLength && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
35786
35792
|
style: {
|
|
35787
|
-
fontSize:
|
|
35788
|
-
color: inputValue.length > maxLength * 0.9 ?
|
|
35789
|
-
textAlign:
|
|
35790
|
-
marginTop:
|
|
35793
|
+
fontSize: "12px",
|
|
35794
|
+
color: inputValue.length > maxLength * 0.9 ? "orange" : "#666",
|
|
35795
|
+
textAlign: "right",
|
|
35796
|
+
marginTop: "4px"
|
|
35791
35797
|
}
|
|
35792
35798
|
}, inputValue.length, "/", maxLength));
|
|
35793
35799
|
};
|
|
@@ -35816,19 +35822,19 @@ Input$2.propTypes = {
|
|
|
35816
35822
|
maxLength: PropTypes.number
|
|
35817
35823
|
};
|
|
35818
35824
|
Input$2.defaultProps = {
|
|
35819
|
-
placeHolder:
|
|
35820
|
-
label:
|
|
35821
|
-
labelEmptyValue:
|
|
35822
|
-
size:
|
|
35823
|
-
labelColor:
|
|
35825
|
+
placeHolder: "Type...",
|
|
35826
|
+
label: "",
|
|
35827
|
+
labelEmptyValue: "",
|
|
35828
|
+
size: "medium",
|
|
35829
|
+
labelColor: "#066768",
|
|
35824
35830
|
required: true,
|
|
35825
|
-
width:
|
|
35831
|
+
width: "300px",
|
|
35826
35832
|
disabled: false,
|
|
35827
35833
|
error: false,
|
|
35828
|
-
errorMessage:
|
|
35829
|
-
selectedValue:
|
|
35830
|
-
leftIcon:
|
|
35831
|
-
rightIcon:
|
|
35834
|
+
errorMessage: "",
|
|
35835
|
+
selectedValue: "",
|
|
35836
|
+
leftIcon: "none",
|
|
35837
|
+
rightIcon: "none",
|
|
35832
35838
|
leftIconOnClick: () => {},
|
|
35833
35839
|
rightIconOnClick: () => {},
|
|
35834
35840
|
onBlur: () => {},
|