@desynova-digital/components 8.13.5 → 8.13.6
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.
|
@@ -51,12 +51,12 @@ var PasswordToggleButton = _styledComponents2.default.div(_templateObject3);
|
|
|
51
51
|
var CountWrappper = _styledComponents2.default.div(_templateObject4);
|
|
52
52
|
|
|
53
53
|
var InputText = function InputText(_ref) {
|
|
54
|
-
var
|
|
54
|
+
var maxLength = _ref.maxLength,
|
|
55
55
|
defaultValue = _ref.defaultValue,
|
|
56
56
|
type = _ref.type,
|
|
57
57
|
showLengthCount = _ref.showLengthCount,
|
|
58
58
|
capitalizeFirstLetter = _ref.capitalizeFirstLetter,
|
|
59
|
-
props = _objectWithoutProperties(_ref, ['
|
|
59
|
+
props = _objectWithoutProperties(_ref, ['maxLength', 'defaultValue', 'type', 'showLengthCount', 'capitalizeFirstLetter']);
|
|
60
60
|
|
|
61
61
|
var _useState = (0, _react.useState)(true),
|
|
62
62
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -89,7 +89,7 @@ var InputText = function InputText(_ref) {
|
|
|
89
89
|
return _react2.default.createElement(
|
|
90
90
|
InputTextDiv,
|
|
91
91
|
{ theme: props.theme, capitalizeFirstLetter: capitalizeFirstLetter || '' },
|
|
92
|
-
_react2.default.createElement(InputText.Element, _extends({ type: hidden ? type : 'text', value: props.value, defaultValue: defaultValue }, props, { maxLength:
|
|
92
|
+
_react2.default.createElement(InputText.Element, _extends({ type: hidden ? type : 'text', value: props.value, defaultValue: defaultValue }, props, { maxLength: maxLength || '' })),
|
|
93
93
|
props.label ? _react2.default.createElement(
|
|
94
94
|
'label',
|
|
95
95
|
{
|
|
@@ -103,12 +103,12 @@ var InputText = function InputText(_ref) {
|
|
|
103
103
|
{ value: props.value, theme: props.theme, error: props.error },
|
|
104
104
|
errorMesssage
|
|
105
105
|
) : '',
|
|
106
|
-
|
|
106
|
+
maxLength && showLengthCount && _react2.default.createElement(
|
|
107
107
|
CountWrappper,
|
|
108
108
|
null,
|
|
109
109
|
props.value.length,
|
|
110
110
|
'/',
|
|
111
|
-
|
|
111
|
+
maxLength
|
|
112
112
|
),
|
|
113
113
|
type == 'password' || passwordButton ? _react2.default.createElement(
|
|
114
114
|
PasswordToggleButton,
|
|
@@ -195,8 +195,8 @@ InputText.propTypes = {
|
|
|
195
195
|
/** The (HTML) type for the input. */
|
|
196
196
|
type: _propTypes2.default.string,
|
|
197
197
|
value: _propTypes2.default.string,
|
|
198
|
-
/** The (HTML)
|
|
199
|
-
|
|
198
|
+
/** The (HTML) maxLength for the input. */
|
|
199
|
+
maxLength: _propTypes2.default.number,
|
|
200
200
|
showLengthCount: _propTypes2.default.bool,
|
|
201
201
|
capitalizeFirstLetter: _propTypes2.default.bool,
|
|
202
202
|
theme: _propTypes2.default.oneOf(['light', 'dark'])
|
|
@@ -211,7 +211,7 @@ InputText.defaultProps = {
|
|
|
211
211
|
error: null,
|
|
212
212
|
onChange: null,
|
|
213
213
|
type: 'text',
|
|
214
|
-
//
|
|
214
|
+
// maxLength: 50,
|
|
215
215
|
theme: 'light',
|
|
216
216
|
value: '',
|
|
217
217
|
showLengthCount: false
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@desynova-digital/components",
|
|
3
|
-
"version": "8.13.
|
|
3
|
+
"version": "8.13.6",
|
|
4
4
|
"description": "Components for Desynova Digital",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "desynova-digital",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": "desynova-digital",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@desynova-digital/tokens": "8.13.
|
|
10
|
+
"@desynova-digital/tokens": "8.13.6",
|
|
11
11
|
"prop-types": "^15.7.2",
|
|
12
12
|
"styled-components": "^4.3.2"
|
|
13
13
|
},
|