@onesy/ui-react 1.0.123 → 1.0.124
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/TextField/TextField.js +3 -3
- package/esm/TextField/TextField.js +3 -3
- package/esm/index.js +1 -1
- package/package.json +1 -1
package/TextField/TextField.js
CHANGED
|
@@ -673,10 +673,10 @@ const TextField = react_1.default.forwardRef((props_, ref) => {
|
|
|
673
673
|
}
|
|
674
674
|
}
|
|
675
675
|
const iconButtonPassword = ((0, jsx_runtime_1.jsx)(Tooltip, Object.assign({ name: visible ? l('Hide password') : l('View password'), color: 'inverted' }, { children: (0, jsx_runtime_1.jsx)(IconButton, Object.assign({ onClick: onToggleVisible, color: 'default', size: 'small' }, { children: visible ? (0, jsx_runtime_1.jsx)(IconMaterialPassword2OffW100_1.default, Object.assign({}, iconProps)) : (0, jsx_runtime_1.jsx)(IconMaterialPassword2W100_1.default, Object.assign({}, iconProps)) })) })));
|
|
676
|
-
if (password)
|
|
676
|
+
if (value && password)
|
|
677
677
|
endItems.unshift(iconButtonPassword);
|
|
678
678
|
return endItems;
|
|
679
|
-
}, [visible, onClear, type, end_]);
|
|
679
|
+
}, [value, visible, onClear, type, end_]);
|
|
680
680
|
const valueWithData = value !== undefined && String(value);
|
|
681
681
|
return ((0, jsx_runtime_1.jsxs)(Wrapper, Object.assign({}, WrapperProps, { children: [(0, jsx_runtime_1.jsxs)(Component, Object.assign({ onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onTouchStart: onMouseEnter, onTouchEnd: onMouseLeave, role: 'textbox', "aria-multiline": multiline, "aria-labelledby": refs.ids.label }, ComponentProps, { className: (0, style_react_1.classNames)([
|
|
682
682
|
(0, utils_2.staticClassName)('TextField', theme) && [
|
|
@@ -813,7 +813,7 @@ const TextField = react_1.default.forwardRef((props_, ref) => {
|
|
|
813
813
|
inputProps === null || inputProps === void 0 ? void 0 : inputProps.className,
|
|
814
814
|
multiline && classes.multiline,
|
|
815
815
|
align && classes[`input_align_${align}`]
|
|
816
|
-
]), onFocus: onFocus, onBlur: onBlur, placeholder: placeholder, onChange: onUpdate, value: value !== undefined ? value : '', type: type, autoFocus: autoFocus, autoComplete: autoComplete, readOnly: readOnly, disabled: disabled, style: Object.assign(Object.assign({}, styles.input), inputProps.style) }))] })), sufix !== undefined && ((0, jsx_runtime_1.jsx)(Type, Object.assign({ className: (0, style_react_1.classNames)([
|
|
816
|
+
]), onFocus: onFocus, onBlur: onBlur, placeholder: placeholder, onChange: onUpdate, value: value !== undefined ? value : '', type: type === 'password' && visible ? 'text' : type, autoFocus: autoFocus, autoComplete: autoComplete, readOnly: readOnly, disabled: disabled, style: Object.assign(Object.assign({}, styles.input), inputProps.style) }))] })), sufix !== undefined && ((0, jsx_runtime_1.jsx)(Type, Object.assign({ className: (0, style_react_1.classNames)([
|
|
817
817
|
(0, utils_2.staticClassName)('TextField', theme) && [
|
|
818
818
|
'onesy-TextField-addition',
|
|
819
819
|
'onesy-TextField-sufix'
|
|
@@ -800,9 +800,9 @@ const TextField = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
|
800
800
|
color: "default",
|
|
801
801
|
size: "small"
|
|
802
802
|
}, visible ? /*#__PURE__*/React.createElement(IconMaterialPassword2Off, iconProps) : /*#__PURE__*/React.createElement(IconMaterialPassword2, iconProps)));
|
|
803
|
-
if (password) endItems.unshift(iconButtonPassword);
|
|
803
|
+
if (value && password) endItems.unshift(iconButtonPassword);
|
|
804
804
|
return endItems;
|
|
805
|
-
}, [visible, onClear, type, end_]);
|
|
805
|
+
}, [value, visible, onClear, type, end_]);
|
|
806
806
|
const valueWithData = value !== undefined && String(value);
|
|
807
807
|
return /*#__PURE__*/React.createElement(Wrapper, WrapperProps, /*#__PURE__*/React.createElement(Component, _extends({
|
|
808
808
|
onMouseEnter: onMouseEnter,
|
|
@@ -865,7 +865,7 @@ const TextField = /*#__PURE__*/React.forwardRef((props_, ref) => {
|
|
|
865
865
|
placeholder: placeholder,
|
|
866
866
|
onChange: onUpdate,
|
|
867
867
|
value: value !== undefined ? value : '',
|
|
868
|
-
type: type,
|
|
868
|
+
type: type === 'password' && visible ? 'text' : type,
|
|
869
869
|
autoFocus: autoFocus,
|
|
870
870
|
autoComplete: autoComplete,
|
|
871
871
|
readOnly: readOnly,
|
package/esm/index.js
CHANGED