@megha-ui/react 1.3.140 → 1.3.141
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.
|
@@ -136,6 +136,6 @@ const TextInput = ({ value = "", name, id, onChange = () => { }, onKeyDown = ()
|
|
|
136
136
|
const asteriskStyle = {
|
|
137
137
|
color: asteriskColor,
|
|
138
138
|
};
|
|
139
|
-
return (_jsxs("div", { style: { display: "flex", flexDirection: "column" }, children: [
|
|
139
|
+
return label ? (_jsxs("div", { style: { display: "flex", flexDirection: "column" }, children: [_jsxs("p", { style: labelStyle, children: [label, required && _jsx("span", { style: asteriskStyle, children: " *" })] }), _jsxs("div", { style: Object.assign(Object.assign({}, textInputWrapperStyle), extraWrapperStyle), className: `${wrapperClass} custom-border`, children: [icon && iconPosition === "left" && _jsx("div", { style: iconStyle, children: icon }), _jsx("input", { ref: inputRef, type: type, value: value, name: name, id: id, placeholder: placeholder, onChange: handleInputChange, onBlur: handleBlur, onFocus: handleFocus, onKeyDown: handleKeyDown, style: Object.assign(Object.assign({}, textInputStyle), extraInputStyle), className: className, disabled: disabled, autoComplete: autoComplete, maxLength: maxLength, readOnly: readOnly, required: required }), isClear && value && (_jsx("div", { style: clearIconStyle, onClick: handleClear, id: clearId, title: "Clear", children: clearIcon ? clearIcon : _jsx(MdClose, {}) })), icon && iconPosition === "right" && (_jsx("div", { style: iconStyle, children: icon }))] })] })) : (_jsxs("div", { style: Object.assign(Object.assign({}, textInputWrapperStyle), extraWrapperStyle), className: `${wrapperClass} custom-border`, children: [icon && iconPosition === "left" && _jsx("div", { style: iconStyle, children: icon }), _jsx("input", { ref: inputRef, type: type, value: value, name: name, id: id, placeholder: placeholder, onChange: handleInputChange, onBlur: handleBlur, onFocus: handleFocus, onKeyDown: handleKeyDown, style: Object.assign(Object.assign({}, textInputStyle), extraInputStyle), className: className, disabled: disabled, autoComplete: autoComplete, maxLength: maxLength, readOnly: readOnly, required: required }), isClear && value && (_jsx("div", { style: clearIconStyle, onClick: handleClear, id: clearId, title: "Clear", children: clearIcon ? clearIcon : _jsx(MdClose, {}) })), icon && iconPosition === "right" && _jsx("div", { style: iconStyle, children: icon })] }));
|
|
140
140
|
};
|
|
141
141
|
export default TextInput;
|
package/package.json
CHANGED