@commercetools-uikit/text-input 15.15.1 → 16.1.0
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.
|
@@ -33,17 +33,14 @@ var _trimInstanceProperty__default = /*#__PURE__*/_interopDefault(_trimInstanceP
|
|
|
33
33
|
var Constraints__default = /*#__PURE__*/_interopDefault(Constraints);
|
|
34
34
|
|
|
35
35
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
36
|
-
|
|
37
36
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
38
37
|
const defaultProps = {
|
|
39
38
|
horizontalConstraint: 'scale'
|
|
40
39
|
};
|
|
41
|
-
|
|
42
40
|
const TextInput = props => {
|
|
43
41
|
if (!props.isReadOnly) {
|
|
44
42
|
process.env.NODE_ENV !== "production" ? utils.warning(typeof props.onChange === 'function', 'TextInput: `onChange` is required when is not read only.') : void 0;
|
|
45
43
|
}
|
|
46
|
-
|
|
47
44
|
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
48
45
|
max: props.horizontalConstraint,
|
|
49
46
|
children: jsxRuntime.jsx("input", _objectSpread(_objectSpread({
|
|
@@ -59,7 +56,8 @@ const TextInput = props => {
|
|
|
59
56
|
readOnly: props.isReadOnly,
|
|
60
57
|
autoFocus: props.isAutofocussed,
|
|
61
58
|
autoComplete: props.autoComplete,
|
|
62
|
-
css: inputUtils.getInputStyles(props)
|
|
59
|
+
css: inputUtils.getInputStyles(props)
|
|
60
|
+
// Allow to override the styles by passing a `className` prop.
|
|
63
61
|
// Custom styles can also be passed using the `css` prop from emotion.
|
|
64
62
|
// https://emotion.sh/docs/css-prop#style-precedence
|
|
65
63
|
,
|
|
@@ -73,7 +71,6 @@ const TextInput = props => {
|
|
|
73
71
|
}))
|
|
74
72
|
});
|
|
75
73
|
};
|
|
76
|
-
|
|
77
74
|
TextInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
78
75
|
id: _pt__default["default"].string,
|
|
79
76
|
autoComplete: _pt__default["default"].string,
|
|
@@ -95,13 +92,11 @@ TextInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
95
92
|
} : {};
|
|
96
93
|
TextInput.displayName = 'TextInput';
|
|
97
94
|
TextInput.defaultProps = defaultProps;
|
|
98
|
-
|
|
99
95
|
TextInput.isEmpty = value => !value || _trimInstanceProperty__default["default"](value).call(value).length === 0;
|
|
100
|
-
|
|
101
96
|
var TextInput$1 = TextInput;
|
|
102
97
|
|
|
103
98
|
// NOTE: This string will be replaced on build time with the package version.
|
|
104
|
-
var version = "
|
|
99
|
+
var version = "16.1.0";
|
|
105
100
|
|
|
106
101
|
exports["default"] = TextInput$1;
|
|
107
102
|
exports.version = version;
|
|
@@ -32,15 +32,12 @@ var _trimInstanceProperty__default = /*#__PURE__*/_interopDefault(_trimInstanceP
|
|
|
32
32
|
var Constraints__default = /*#__PURE__*/_interopDefault(Constraints);
|
|
33
33
|
|
|
34
34
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
35
|
-
|
|
36
35
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
37
36
|
const defaultProps = {
|
|
38
37
|
horizontalConstraint: 'scale'
|
|
39
38
|
};
|
|
40
|
-
|
|
41
39
|
const TextInput = props => {
|
|
42
40
|
if (!props.isReadOnly) ;
|
|
43
|
-
|
|
44
41
|
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
45
42
|
max: props.horizontalConstraint,
|
|
46
43
|
children: jsxRuntime.jsx("input", _objectSpread(_objectSpread({
|
|
@@ -56,7 +53,8 @@ const TextInput = props => {
|
|
|
56
53
|
readOnly: props.isReadOnly,
|
|
57
54
|
autoFocus: props.isAutofocussed,
|
|
58
55
|
autoComplete: props.autoComplete,
|
|
59
|
-
css: inputUtils.getInputStyles(props)
|
|
56
|
+
css: inputUtils.getInputStyles(props)
|
|
57
|
+
// Allow to override the styles by passing a `className` prop.
|
|
60
58
|
// Custom styles can also be passed using the `css` prop from emotion.
|
|
61
59
|
// https://emotion.sh/docs/css-prop#style-precedence
|
|
62
60
|
,
|
|
@@ -70,17 +68,14 @@ const TextInput = props => {
|
|
|
70
68
|
}))
|
|
71
69
|
});
|
|
72
70
|
};
|
|
73
|
-
|
|
74
71
|
TextInput.propTypes = {};
|
|
75
72
|
TextInput.displayName = 'TextInput';
|
|
76
73
|
TextInput.defaultProps = defaultProps;
|
|
77
|
-
|
|
78
74
|
TextInput.isEmpty = value => !value || _trimInstanceProperty__default["default"](value).call(value).length === 0;
|
|
79
|
-
|
|
80
75
|
var TextInput$1 = TextInput;
|
|
81
76
|
|
|
82
77
|
// NOTE: This string will be replaced on build time with the package version.
|
|
83
|
-
var version = "
|
|
78
|
+
var version = "16.1.0";
|
|
84
79
|
|
|
85
80
|
exports["default"] = TextInput$1;
|
|
86
81
|
exports.version = version;
|
|
@@ -15,17 +15,14 @@ import { getInputStyles } from '@commercetools-uikit/input-utils';
|
|
|
15
15
|
import { jsx } from '@emotion/react/jsx-runtime';
|
|
16
16
|
|
|
17
17
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18
|
-
|
|
19
18
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
20
19
|
const defaultProps = {
|
|
21
20
|
horizontalConstraint: 'scale'
|
|
22
21
|
};
|
|
23
|
-
|
|
24
22
|
const TextInput = props => {
|
|
25
23
|
if (!props.isReadOnly) {
|
|
26
24
|
process.env.NODE_ENV !== "production" ? warning(typeof props.onChange === 'function', 'TextInput: `onChange` is required when is not read only.') : void 0;
|
|
27
25
|
}
|
|
28
|
-
|
|
29
26
|
return jsx(Constraints.Horizontal, {
|
|
30
27
|
max: props.horizontalConstraint,
|
|
31
28
|
children: jsx("input", _objectSpread(_objectSpread({
|
|
@@ -41,7 +38,8 @@ const TextInput = props => {
|
|
|
41
38
|
readOnly: props.isReadOnly,
|
|
42
39
|
autoFocus: props.isAutofocussed,
|
|
43
40
|
autoComplete: props.autoComplete,
|
|
44
|
-
css: getInputStyles(props)
|
|
41
|
+
css: getInputStyles(props)
|
|
42
|
+
// Allow to override the styles by passing a `className` prop.
|
|
45
43
|
// Custom styles can also be passed using the `css` prop from emotion.
|
|
46
44
|
// https://emotion.sh/docs/css-prop#style-precedence
|
|
47
45
|
,
|
|
@@ -55,7 +53,6 @@ const TextInput = props => {
|
|
|
55
53
|
}))
|
|
56
54
|
});
|
|
57
55
|
};
|
|
58
|
-
|
|
59
56
|
TextInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
60
57
|
id: _pt.string,
|
|
61
58
|
autoComplete: _pt.string,
|
|
@@ -77,12 +74,10 @@ TextInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
77
74
|
} : {};
|
|
78
75
|
TextInput.displayName = 'TextInput';
|
|
79
76
|
TextInput.defaultProps = defaultProps;
|
|
80
|
-
|
|
81
77
|
TextInput.isEmpty = value => !value || _trimInstanceProperty(value).call(value).length === 0;
|
|
82
|
-
|
|
83
78
|
var TextInput$1 = TextInput;
|
|
84
79
|
|
|
85
80
|
// NOTE: This string will be replaced on build time with the package version.
|
|
86
|
-
var version = "
|
|
81
|
+
var version = "16.1.0";
|
|
87
82
|
|
|
88
83
|
export { TextInput$1 as default, version };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/text-input",
|
|
3
3
|
"description": "A controlled text input component for single-line strings with validation states.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "16.1.0",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@babel/runtime": "^7.20.13",
|
|
23
23
|
"@babel/runtime-corejs3": "^7.20.13",
|
|
24
|
-
"@commercetools-uikit/constraints": "
|
|
25
|
-
"@commercetools-uikit/design-system": "
|
|
26
|
-
"@commercetools-uikit/input-utils": "
|
|
27
|
-
"@commercetools-uikit/utils": "
|
|
24
|
+
"@commercetools-uikit/constraints": "16.1.0",
|
|
25
|
+
"@commercetools-uikit/design-system": "16.1.0",
|
|
26
|
+
"@commercetools-uikit/input-utils": "16.1.0",
|
|
27
|
+
"@commercetools-uikit/utils": "16.1.0",
|
|
28
28
|
"@emotion/react": "^11.10.5",
|
|
29
29
|
"@emotion/styled": "^11.10.5",
|
|
30
30
|
"prop-types": "15.8.1"
|