@commercetools-uikit/text-input 19.20.0 → 19.21.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.
|
@@ -11,6 +11,7 @@ var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-
|
|
|
11
11
|
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
12
12
|
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
13
13
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
14
|
+
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
14
15
|
var _pt = require('prop-types');
|
|
15
16
|
var _trimInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/trim');
|
|
16
17
|
var utils = require('@commercetools-uikit/utils');
|
|
@@ -32,17 +33,18 @@ var _pt__default = /*#__PURE__*/_interopDefault(_pt);
|
|
|
32
33
|
var _trimInstanceProperty__default = /*#__PURE__*/_interopDefault(_trimInstanceProperty);
|
|
33
34
|
var Constraints__default = /*#__PURE__*/_interopDefault(Constraints);
|
|
34
35
|
|
|
36
|
+
const _excluded = ["horizontalConstraint"];
|
|
35
37
|
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
36
38
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
37
|
-
const
|
|
38
|
-
horizontalConstraint
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
const TextInput = _ref => {
|
|
40
|
+
let _ref$horizontalConstr = _ref.horizontalConstraint,
|
|
41
|
+
horizontalConstraint = _ref$horizontalConstr === void 0 ? 'scale' : _ref$horizontalConstr,
|
|
42
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
41
43
|
if (!props.isReadOnly) {
|
|
42
44
|
process.env.NODE_ENV !== "production" ? utils.warning(typeof props.onChange === 'function', 'TextInput: `onChange` is required when is not read only.') : void 0;
|
|
43
45
|
}
|
|
44
46
|
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
45
|
-
max:
|
|
47
|
+
max: horizontalConstraint,
|
|
46
48
|
children: jsxRuntime.jsx("input", _objectSpread(_objectSpread({
|
|
47
49
|
id: props.id,
|
|
48
50
|
name: props.name,
|
|
@@ -63,7 +65,9 @@ const TextInput = props => {
|
|
|
63
65
|
// https://emotion.sh/docs/css-prop#style-precedence
|
|
64
66
|
,
|
|
65
67
|
className: props.className
|
|
66
|
-
}, utils.filterDataAttributes(
|
|
68
|
+
}, utils.filterDataAttributes(_objectSpread({
|
|
69
|
+
horizontalConstraint
|
|
70
|
+
}, props))), {}, {
|
|
67
71
|
/* ARIA */
|
|
68
72
|
"aria-readonly": props.isReadOnly,
|
|
69
73
|
contentEditable: !props.isReadOnly,
|
|
@@ -94,12 +98,11 @@ TextInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
94
98
|
maxLength: _pt__default["default"].number
|
|
95
99
|
} : {};
|
|
96
100
|
TextInput.displayName = 'TextInput';
|
|
97
|
-
TextInput.defaultProps = defaultProps;
|
|
98
101
|
TextInput.isEmpty = value => !value || _trimInstanceProperty__default["default"](value).call(value).length === 0;
|
|
99
102
|
var TextInput$1 = TextInput;
|
|
100
103
|
|
|
101
104
|
// NOTE: This string will be replaced on build time with the package version.
|
|
102
|
-
var version = "19.
|
|
105
|
+
var version = "19.21.0";
|
|
103
106
|
|
|
104
107
|
exports["default"] = TextInput$1;
|
|
105
108
|
exports.version = version;
|
|
@@ -11,6 +11,7 @@ var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-
|
|
|
11
11
|
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
12
12
|
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
13
13
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
14
|
+
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
14
15
|
require('prop-types');
|
|
15
16
|
var _trimInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/trim');
|
|
16
17
|
var utils = require('@commercetools-uikit/utils');
|
|
@@ -31,15 +32,16 @@ var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defin
|
|
|
31
32
|
var _trimInstanceProperty__default = /*#__PURE__*/_interopDefault(_trimInstanceProperty);
|
|
32
33
|
var Constraints__default = /*#__PURE__*/_interopDefault(Constraints);
|
|
33
34
|
|
|
35
|
+
const _excluded = ["horizontalConstraint"];
|
|
34
36
|
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
35
37
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
36
|
-
const
|
|
37
|
-
horizontalConstraint
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
const TextInput = _ref => {
|
|
39
|
+
let _ref$horizontalConstr = _ref.horizontalConstraint,
|
|
40
|
+
horizontalConstraint = _ref$horizontalConstr === void 0 ? 'scale' : _ref$horizontalConstr,
|
|
41
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
40
42
|
if (!props.isReadOnly) ;
|
|
41
43
|
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
42
|
-
max:
|
|
44
|
+
max: horizontalConstraint,
|
|
43
45
|
children: jsxRuntime.jsx("input", _objectSpread(_objectSpread({
|
|
44
46
|
id: props.id,
|
|
45
47
|
name: props.name,
|
|
@@ -60,7 +62,9 @@ const TextInput = props => {
|
|
|
60
62
|
// https://emotion.sh/docs/css-prop#style-precedence
|
|
61
63
|
,
|
|
62
64
|
className: props.className
|
|
63
|
-
}, utils.filterDataAttributes(
|
|
65
|
+
}, utils.filterDataAttributes(_objectSpread({
|
|
66
|
+
horizontalConstraint
|
|
67
|
+
}, props))), {}, {
|
|
64
68
|
/* ARIA */
|
|
65
69
|
"aria-readonly": props.isReadOnly,
|
|
66
70
|
contentEditable: !props.isReadOnly,
|
|
@@ -71,12 +75,11 @@ const TextInput = props => {
|
|
|
71
75
|
};
|
|
72
76
|
TextInput.propTypes = {};
|
|
73
77
|
TextInput.displayName = 'TextInput';
|
|
74
|
-
TextInput.defaultProps = defaultProps;
|
|
75
78
|
TextInput.isEmpty = value => !value || _trimInstanceProperty__default["default"](value).call(value).length === 0;
|
|
76
79
|
var TextInput$1 = TextInput;
|
|
77
80
|
|
|
78
81
|
// NOTE: This string will be replaced on build time with the package version.
|
|
79
|
-
var version = "19.
|
|
82
|
+
var version = "19.21.0";
|
|
80
83
|
|
|
81
84
|
exports["default"] = TextInput$1;
|
|
82
85
|
exports.version = version;
|
|
@@ -7,6 +7,7 @@ import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js-st
|
|
|
7
7
|
import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/object/define-properties';
|
|
8
8
|
import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
|
|
9
9
|
import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
|
|
10
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/esm/objectWithoutProperties';
|
|
10
11
|
import _pt from 'prop-types';
|
|
11
12
|
import _trimInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/trim';
|
|
12
13
|
import { warning, filterDataAttributes } from '@commercetools-uikit/utils';
|
|
@@ -14,17 +15,18 @@ import Constraints from '@commercetools-uikit/constraints';
|
|
|
14
15
|
import { getInputStyles } from '@commercetools-uikit/input-utils';
|
|
15
16
|
import { jsx } from '@emotion/react/jsx-runtime';
|
|
16
17
|
|
|
18
|
+
const _excluded = ["horizontalConstraint"];
|
|
17
19
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
20
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
|
-
const
|
|
20
|
-
horizontalConstraint
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const TextInput = _ref => {
|
|
22
|
+
let _ref$horizontalConstr = _ref.horizontalConstraint,
|
|
23
|
+
horizontalConstraint = _ref$horizontalConstr === void 0 ? 'scale' : _ref$horizontalConstr,
|
|
24
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
23
25
|
if (!props.isReadOnly) {
|
|
24
26
|
process.env.NODE_ENV !== "production" ? warning(typeof props.onChange === 'function', 'TextInput: `onChange` is required when is not read only.') : void 0;
|
|
25
27
|
}
|
|
26
28
|
return jsx(Constraints.Horizontal, {
|
|
27
|
-
max:
|
|
29
|
+
max: horizontalConstraint,
|
|
28
30
|
children: jsx("input", _objectSpread(_objectSpread({
|
|
29
31
|
id: props.id,
|
|
30
32
|
name: props.name,
|
|
@@ -45,7 +47,9 @@ const TextInput = props => {
|
|
|
45
47
|
// https://emotion.sh/docs/css-prop#style-precedence
|
|
46
48
|
,
|
|
47
49
|
className: props.className
|
|
48
|
-
}, filterDataAttributes(
|
|
50
|
+
}, filterDataAttributes(_objectSpread({
|
|
51
|
+
horizontalConstraint
|
|
52
|
+
}, props))), {}, {
|
|
49
53
|
/* ARIA */
|
|
50
54
|
"aria-readonly": props.isReadOnly,
|
|
51
55
|
contentEditable: !props.isReadOnly,
|
|
@@ -76,11 +80,10 @@ TextInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
76
80
|
maxLength: _pt.number
|
|
77
81
|
} : {};
|
|
78
82
|
TextInput.displayName = 'TextInput';
|
|
79
|
-
TextInput.defaultProps = defaultProps;
|
|
80
83
|
TextInput.isEmpty = value => !value || _trimInstanceProperty(value).call(value).length === 0;
|
|
81
84
|
var TextInput$1 = TextInput;
|
|
82
85
|
|
|
83
86
|
// NOTE: This string will be replaced on build time with the package version.
|
|
84
|
-
var version = "19.
|
|
87
|
+
var version = "19.21.0";
|
|
85
88
|
|
|
86
89
|
export { TextInput$1 as default, version };
|
|
@@ -75,9 +75,8 @@ export type TTextInputProps = {
|
|
|
75
75
|
maxLength?: number;
|
|
76
76
|
};
|
|
77
77
|
declare const TextInput: {
|
|
78
|
-
(props: TTextInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
78
|
+
({ horizontalConstraint, ...props }: TTextInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
79
79
|
displayName: string;
|
|
80
|
-
defaultProps: Pick<TTextInputProps, "horizontalConstraint">;
|
|
81
80
|
isEmpty(value: TTextInputProps["value"]): boolean;
|
|
82
81
|
};
|
|
83
82
|
export default TextInput;
|
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": "19.
|
|
4
|
+
"version": "19.21.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": "19.
|
|
25
|
-
"@commercetools-uikit/design-system": "19.
|
|
26
|
-
"@commercetools-uikit/input-utils": "19.
|
|
27
|
-
"@commercetools-uikit/utils": "19.
|
|
24
|
+
"@commercetools-uikit/constraints": "19.21.0",
|
|
25
|
+
"@commercetools-uikit/design-system": "19.21.0",
|
|
26
|
+
"@commercetools-uikit/input-utils": "19.21.0",
|
|
27
|
+
"@commercetools-uikit/utils": "19.21.0",
|
|
28
28
|
"@emotion/react": "^11.10.5",
|
|
29
29
|
"@emotion/styled": "^11.10.5",
|
|
30
30
|
"prop-types": "15.8.1"
|