@commercetools-uikit/text-input 12.2.1 → 12.2.5
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/README.md +0 -1
- package/dist/commercetools-uikit-text-input.cjs.dev.js +68 -46
- package/dist/commercetools-uikit-text-input.cjs.prod.js +53 -31
- package/dist/commercetools-uikit-text-input.esm.js +44 -31
- package/dist/declarations/src/export-types.d.ts +2 -0
- package/dist/declarations/src/index.d.ts +3 -4
- package/dist/declarations/src/text-input.d.ts +25 -25
- package/dist/declarations/src/version.d.ts +2 -2
- package/package.json +16 -13
package/README.md
CHANGED
|
@@ -2,7 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
6
|
+
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
7
|
+
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
8
|
+
var _Object$getOwnPropertyDescriptor = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
|
|
9
|
+
var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
|
|
10
|
+
var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
|
|
11
|
+
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
12
|
+
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
13
|
+
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
6
14
|
var _pt = require('prop-types');
|
|
7
15
|
var _trimInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/trim');
|
|
8
16
|
require('react');
|
|
@@ -10,13 +18,25 @@ var react = require('@emotion/react');
|
|
|
10
18
|
var utils = require('@commercetools-uikit/utils');
|
|
11
19
|
var Constraints = require('@commercetools-uikit/constraints');
|
|
12
20
|
var inputUtils = require('@commercetools-uikit/input-utils');
|
|
21
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
13
22
|
|
|
14
23
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
15
24
|
|
|
25
|
+
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
26
|
+
var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
|
|
27
|
+
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
28
|
+
var _Object$getOwnPropertyDescriptor__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptor);
|
|
29
|
+
var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty);
|
|
30
|
+
var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
|
|
31
|
+
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
32
|
+
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
16
33
|
var _pt__default = /*#__PURE__*/_interopDefault(_pt);
|
|
17
34
|
var _trimInstanceProperty__default = /*#__PURE__*/_interopDefault(_trimInstanceProperty);
|
|
18
35
|
var Constraints__default = /*#__PURE__*/_interopDefault(Constraints);
|
|
19
36
|
|
|
37
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (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; }
|
|
38
|
+
|
|
39
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default["default"](_context = ownKeys(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context2; _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; }
|
|
20
40
|
var defaultProps = {
|
|
21
41
|
horizontalConstraint: 'scale'
|
|
22
42
|
};
|
|
@@ -28,60 +48,62 @@ var TextInput = function TextInput(props) {
|
|
|
28
48
|
process.env.NODE_ENV !== "production" ? utils.warning(typeof props.onChange === 'function', 'TextInput: `onChange` is required when is not read only.') : void 0;
|
|
29
49
|
}
|
|
30
50
|
|
|
31
|
-
return
|
|
32
|
-
max: props.horizontalConstraint
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
})
|
|
51
|
+
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
52
|
+
max: props.horizontalConstraint,
|
|
53
|
+
children: jsxRuntime.jsx("input", _objectSpread(_objectSpread({
|
|
54
|
+
id: props.id,
|
|
55
|
+
name: props.name,
|
|
56
|
+
type: "text",
|
|
57
|
+
value: props.value,
|
|
58
|
+
onChange: props.onChange,
|
|
59
|
+
onBlur: props.onBlur,
|
|
60
|
+
onFocus: props.onFocus,
|
|
61
|
+
disabled: props.isDisabled,
|
|
62
|
+
placeholder: props.placeholder,
|
|
63
|
+
readOnly: props.isReadOnly,
|
|
64
|
+
autoFocus: props.isAutofocussed,
|
|
65
|
+
autoComplete: props.autoComplete,
|
|
66
|
+
css: inputUtils.getInputStyles(props, theme) // Allow to override the styles by passing a `className` prop.
|
|
67
|
+
// Custom styles can also be passed using the `css` prop from emotion.
|
|
68
|
+
// https://emotion.sh/docs/css-prop#style-precedence
|
|
69
|
+
,
|
|
70
|
+
className: props.className
|
|
71
|
+
}, utils.filterDataAttributes(props)), {}, {
|
|
72
|
+
/* ARIA */
|
|
73
|
+
"aria-readonly": props.isReadOnly,
|
|
74
|
+
contentEditable: !props.isReadOnly
|
|
75
|
+
}))
|
|
76
|
+
});
|
|
57
77
|
};
|
|
58
78
|
|
|
59
79
|
TextInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
60
|
-
id: _pt__default[
|
|
61
|
-
autoComplete: _pt__default[
|
|
62
|
-
className: _pt__default[
|
|
63
|
-
name: _pt__default[
|
|
64
|
-
value: _pt__default[
|
|
65
|
-
onChange: _pt__default[
|
|
66
|
-
onBlur: _pt__default[
|
|
67
|
-
onFocus: _pt__default[
|
|
68
|
-
isAutofocussed: _pt__default[
|
|
69
|
-
isDisabled: _pt__default[
|
|
70
|
-
isReadOnly: _pt__default[
|
|
71
|
-
hasError: _pt__default[
|
|
72
|
-
hasWarning: _pt__default[
|
|
73
|
-
placeholder: _pt__default[
|
|
74
|
-
horizontalConstraint: _pt__default[
|
|
80
|
+
id: _pt__default["default"].string,
|
|
81
|
+
autoComplete: _pt__default["default"].string,
|
|
82
|
+
className: _pt__default["default"].string,
|
|
83
|
+
name: _pt__default["default"].string,
|
|
84
|
+
value: _pt__default["default"].string.isRequired,
|
|
85
|
+
onChange: _pt__default["default"].func,
|
|
86
|
+
onBlur: _pt__default["default"].func,
|
|
87
|
+
onFocus: _pt__default["default"].func,
|
|
88
|
+
isAutofocussed: _pt__default["default"].bool,
|
|
89
|
+
isDisabled: _pt__default["default"].bool,
|
|
90
|
+
isReadOnly: _pt__default["default"].bool,
|
|
91
|
+
hasError: _pt__default["default"].bool,
|
|
92
|
+
hasWarning: _pt__default["default"].bool,
|
|
93
|
+
placeholder: _pt__default["default"].string,
|
|
94
|
+
horizontalConstraint: _pt__default["default"].oneOf([3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto'])
|
|
75
95
|
} : {};
|
|
76
96
|
TextInput.displayName = 'TextInput';
|
|
77
97
|
TextInput.defaultProps = defaultProps;
|
|
78
98
|
|
|
79
99
|
TextInput.isEmpty = function (value) {
|
|
80
|
-
return !value || _trimInstanceProperty__default[
|
|
100
|
+
return !value || _trimInstanceProperty__default["default"](value).call(value).length === 0;
|
|
81
101
|
};
|
|
82
102
|
|
|
83
|
-
|
|
84
|
-
|
|
103
|
+
var TextInput$1 = TextInput;
|
|
104
|
+
|
|
105
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
106
|
+
var version = "12.2.5";
|
|
85
107
|
|
|
86
|
-
exports
|
|
108
|
+
exports["default"] = TextInput$1;
|
|
87
109
|
exports.version = version;
|
|
@@ -2,7 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
6
|
+
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
7
|
+
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
8
|
+
var _Object$getOwnPropertyDescriptor = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
|
|
9
|
+
var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
|
|
10
|
+
var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
|
|
11
|
+
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
12
|
+
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
13
|
+
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
6
14
|
require('prop-types');
|
|
7
15
|
var _trimInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/trim');
|
|
8
16
|
require('react');
|
|
@@ -10,12 +18,24 @@ var react = require('@emotion/react');
|
|
|
10
18
|
var utils = require('@commercetools-uikit/utils');
|
|
11
19
|
var Constraints = require('@commercetools-uikit/constraints');
|
|
12
20
|
var inputUtils = require('@commercetools-uikit/input-utils');
|
|
21
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
13
22
|
|
|
14
23
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
15
24
|
|
|
25
|
+
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
26
|
+
var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
|
|
27
|
+
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
28
|
+
var _Object$getOwnPropertyDescriptor__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptor);
|
|
29
|
+
var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty);
|
|
30
|
+
var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
|
|
31
|
+
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
32
|
+
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
16
33
|
var _trimInstanceProperty__default = /*#__PURE__*/_interopDefault(_trimInstanceProperty);
|
|
17
34
|
var Constraints__default = /*#__PURE__*/_interopDefault(Constraints);
|
|
18
35
|
|
|
36
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (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; }
|
|
37
|
+
|
|
38
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default["default"](_context = ownKeys(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context2; _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; }
|
|
19
39
|
var defaultProps = {
|
|
20
40
|
horizontalConstraint: 'scale'
|
|
21
41
|
};
|
|
@@ -25,32 +45,32 @@ var TextInput = function TextInput(props) {
|
|
|
25
45
|
|
|
26
46
|
if (!props.isReadOnly) ;
|
|
27
47
|
|
|
28
|
-
return
|
|
29
|
-
max: props.horizontalConstraint
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
})
|
|
48
|
+
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
49
|
+
max: props.horizontalConstraint,
|
|
50
|
+
children: jsxRuntime.jsx("input", _objectSpread(_objectSpread({
|
|
51
|
+
id: props.id,
|
|
52
|
+
name: props.name,
|
|
53
|
+
type: "text",
|
|
54
|
+
value: props.value,
|
|
55
|
+
onChange: props.onChange,
|
|
56
|
+
onBlur: props.onBlur,
|
|
57
|
+
onFocus: props.onFocus,
|
|
58
|
+
disabled: props.isDisabled,
|
|
59
|
+
placeholder: props.placeholder,
|
|
60
|
+
readOnly: props.isReadOnly,
|
|
61
|
+
autoFocus: props.isAutofocussed,
|
|
62
|
+
autoComplete: props.autoComplete,
|
|
63
|
+
css: inputUtils.getInputStyles(props, theme) // Allow to override the styles by passing a `className` prop.
|
|
64
|
+
// Custom styles can also be passed using the `css` prop from emotion.
|
|
65
|
+
// https://emotion.sh/docs/css-prop#style-precedence
|
|
66
|
+
,
|
|
67
|
+
className: props.className
|
|
68
|
+
}, utils.filterDataAttributes(props)), {}, {
|
|
69
|
+
/* ARIA */
|
|
70
|
+
"aria-readonly": props.isReadOnly,
|
|
71
|
+
contentEditable: !props.isReadOnly
|
|
72
|
+
}))
|
|
73
|
+
});
|
|
54
74
|
};
|
|
55
75
|
|
|
56
76
|
TextInput.propTypes = {};
|
|
@@ -58,11 +78,13 @@ TextInput.displayName = 'TextInput';
|
|
|
58
78
|
TextInput.defaultProps = defaultProps;
|
|
59
79
|
|
|
60
80
|
TextInput.isEmpty = function (value) {
|
|
61
|
-
return !value || _trimInstanceProperty__default[
|
|
81
|
+
return !value || _trimInstanceProperty__default["default"](value).call(value).length === 0;
|
|
62
82
|
};
|
|
63
83
|
|
|
64
|
-
|
|
65
|
-
|
|
84
|
+
var TextInput$1 = TextInput;
|
|
85
|
+
|
|
86
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
87
|
+
var version = "12.2.5";
|
|
66
88
|
|
|
67
|
-
exports
|
|
89
|
+
exports["default"] = TextInput$1;
|
|
68
90
|
exports.version = version;
|
|
@@ -1,12 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
2
|
+
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
3
|
+
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
|
|
4
|
+
import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor';
|
|
5
|
+
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/for-each';
|
|
6
|
+
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
|
|
7
|
+
import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/object/define-properties';
|
|
8
|
+
import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
|
|
9
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
|
|
2
10
|
import _pt from 'prop-types';
|
|
3
11
|
import _trimInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/trim';
|
|
4
12
|
import 'react';
|
|
5
|
-
import { useTheme
|
|
13
|
+
import { useTheme } from '@emotion/react';
|
|
6
14
|
import { warning, filterDataAttributes } from '@commercetools-uikit/utils';
|
|
7
15
|
import Constraints from '@commercetools-uikit/constraints';
|
|
8
16
|
import { getInputStyles } from '@commercetools-uikit/input-utils';
|
|
17
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
9
18
|
|
|
19
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
20
|
+
|
|
21
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty(_context = ownKeys(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context2; _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
10
22
|
var defaultProps = {
|
|
11
23
|
horizontalConstraint: 'scale'
|
|
12
24
|
};
|
|
@@ -19,31 +31,31 @@ var TextInput = function TextInput(props) {
|
|
|
19
31
|
}
|
|
20
32
|
|
|
21
33
|
return jsx(Constraints.Horizontal, {
|
|
22
|
-
max: props.horizontalConstraint
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
})
|
|
34
|
+
max: props.horizontalConstraint,
|
|
35
|
+
children: jsx("input", _objectSpread(_objectSpread({
|
|
36
|
+
id: props.id,
|
|
37
|
+
name: props.name,
|
|
38
|
+
type: "text",
|
|
39
|
+
value: props.value,
|
|
40
|
+
onChange: props.onChange,
|
|
41
|
+
onBlur: props.onBlur,
|
|
42
|
+
onFocus: props.onFocus,
|
|
43
|
+
disabled: props.isDisabled,
|
|
44
|
+
placeholder: props.placeholder,
|
|
45
|
+
readOnly: props.isReadOnly,
|
|
46
|
+
autoFocus: props.isAutofocussed,
|
|
47
|
+
autoComplete: props.autoComplete,
|
|
48
|
+
css: getInputStyles(props, theme) // Allow to override the styles by passing a `className` prop.
|
|
49
|
+
// Custom styles can also be passed using the `css` prop from emotion.
|
|
50
|
+
// https://emotion.sh/docs/css-prop#style-precedence
|
|
51
|
+
,
|
|
52
|
+
className: props.className
|
|
53
|
+
}, filterDataAttributes(props)), {}, {
|
|
54
|
+
/* ARIA */
|
|
55
|
+
"aria-readonly": props.isReadOnly,
|
|
56
|
+
contentEditable: !props.isReadOnly
|
|
57
|
+
}))
|
|
58
|
+
});
|
|
47
59
|
};
|
|
48
60
|
|
|
49
61
|
TextInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -70,8 +82,9 @@ TextInput.isEmpty = function (value) {
|
|
|
70
82
|
return !value || _trimInstanceProperty(value).call(value).length === 0;
|
|
71
83
|
};
|
|
72
84
|
|
|
73
|
-
|
|
74
|
-
|
|
85
|
+
var TextInput$1 = TextInput;
|
|
86
|
+
|
|
87
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
88
|
+
var version = "12.2.5";
|
|
75
89
|
|
|
76
|
-
export default
|
|
77
|
-
export { version };
|
|
90
|
+
export { TextInput$1 as default, version };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export { default } from './
|
|
3
|
-
export
|
|
4
|
-
export declare type TTextInputProps = TextInputProps;
|
|
1
|
+
export { default } from './text-input';
|
|
2
|
+
export { default as version } from './version';
|
|
3
|
+
export * from './export-types';
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { FocusEventHandler, ChangeEventHandler } from 'react';
|
|
2
|
-
export declare type TTextInputProps = {
|
|
3
|
-
id?: string;
|
|
4
|
-
autoComplete?: string;
|
|
5
|
-
className?: string;
|
|
6
|
-
name?: string;
|
|
7
|
-
value: string;
|
|
8
|
-
onChange?: ChangeEventHandler;
|
|
9
|
-
onBlur?: FocusEventHandler;
|
|
10
|
-
onFocus?: FocusEventHandler;
|
|
11
|
-
isAutofocussed?: boolean;
|
|
12
|
-
isDisabled?: boolean;
|
|
13
|
-
isReadOnly?: boolean;
|
|
14
|
-
hasError?: boolean;
|
|
15
|
-
hasWarning?: boolean;
|
|
16
|
-
placeholder?: string;
|
|
17
|
-
horizontalConstraint?: 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
|
|
18
|
-
};
|
|
19
|
-
declare const TextInput: {
|
|
20
|
-
(props: TTextInputProps): JSX.Element;
|
|
21
|
-
displayName: string;
|
|
22
|
-
defaultProps: Pick<TTextInputProps, "horizontalConstraint">;
|
|
23
|
-
isEmpty(value: TTextInputProps['value']): boolean;
|
|
24
|
-
};
|
|
25
|
-
export default TextInput;
|
|
1
|
+
import { FocusEventHandler, ChangeEventHandler } from 'react';
|
|
2
|
+
export declare type TTextInputProps = {
|
|
3
|
+
id?: string;
|
|
4
|
+
autoComplete?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
value: string;
|
|
8
|
+
onChange?: ChangeEventHandler;
|
|
9
|
+
onBlur?: FocusEventHandler;
|
|
10
|
+
onFocus?: FocusEventHandler;
|
|
11
|
+
isAutofocussed?: boolean;
|
|
12
|
+
isDisabled?: boolean;
|
|
13
|
+
isReadOnly?: boolean;
|
|
14
|
+
hasError?: boolean;
|
|
15
|
+
hasWarning?: boolean;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
horizontalConstraint?: 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
|
|
18
|
+
};
|
|
19
|
+
declare const TextInput: {
|
|
20
|
+
(props: TTextInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
21
|
+
displayName: string;
|
|
22
|
+
defaultProps: Pick<TTextInputProps, "horizontalConstraint">;
|
|
23
|
+
isEmpty(value: TTextInputProps['value']): boolean;
|
|
24
|
+
};
|
|
25
|
+
export default TextInput;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "
|
|
2
|
-
export default _default;
|
|
1
|
+
declare const _default: "__@UI_KIT_PACKAGE/VERSION_OF_RELEASE__";
|
|
2
|
+
export default _default;
|
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": "12.2.
|
|
4
|
+
"version": "12.2.5",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -9,26 +9,29 @@
|
|
|
9
9
|
"directory": "packages/components/inputs/text-input"
|
|
10
10
|
},
|
|
11
11
|
"homepage": "https://uikit.commercetools.com",
|
|
12
|
-
"keywords": [
|
|
12
|
+
"keywords": [
|
|
13
|
+
"javascript",
|
|
14
|
+
"design system",
|
|
15
|
+
"react",
|
|
16
|
+
"uikit"
|
|
17
|
+
],
|
|
13
18
|
"license": "MIT",
|
|
14
|
-
"private": false,
|
|
15
19
|
"publishConfig": {
|
|
16
20
|
"access": "public"
|
|
17
21
|
},
|
|
18
22
|
"sideEffects": false,
|
|
19
23
|
"main": "dist/commercetools-uikit-text-input.cjs.js",
|
|
20
24
|
"module": "dist/commercetools-uikit-text-input.esm.js",
|
|
21
|
-
"files": [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
25
28
|
"dependencies": {
|
|
26
|
-
"@babel/runtime": "7.
|
|
27
|
-
"@babel/runtime-corejs3": "7.
|
|
28
|
-
"@commercetools-uikit/constraints": "12.2.
|
|
29
|
-
"@commercetools-uikit/design-system": "12.
|
|
30
|
-
"@commercetools-uikit/input-utils": "12.2.
|
|
31
|
-
"@commercetools-uikit/utils": "12.2.
|
|
29
|
+
"@babel/runtime": "7.16.3",
|
|
30
|
+
"@babel/runtime-corejs3": "7.16.3",
|
|
31
|
+
"@commercetools-uikit/constraints": "12.2.5",
|
|
32
|
+
"@commercetools-uikit/design-system": "12.2.5",
|
|
33
|
+
"@commercetools-uikit/input-utils": "12.2.5",
|
|
34
|
+
"@commercetools-uikit/utils": "12.2.5",
|
|
32
35
|
"@emotion/react": "^11.4.0",
|
|
33
36
|
"@emotion/styled": "^11.3.0",
|
|
34
37
|
"prop-types": "15.7.2"
|