@commercetools-uikit/text-input 12.2.3 → 12.2.7
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/dist/commercetools-uikit-text-input.cjs.dev.js +22 -22
- package/dist/commercetools-uikit-text-input.cjs.prod.js +7 -7
- package/dist/commercetools-uikit-text-input.esm.js +2 -2
- package/dist/declarations/src/export-types.d.ts +2 -2
- package/dist/declarations/src/index.d.ts +3 -3
- package/dist/declarations/src/text-input.d.ts +25 -25
- package/dist/declarations/src/version.d.ts +2 -2
- package/package.json +7 -11
|
@@ -34,9 +34,9 @@ var _pt__default = /*#__PURE__*/_interopDefault(_pt);
|
|
|
34
34
|
var _trimInstanceProperty__default = /*#__PURE__*/_interopDefault(_trimInstanceProperty);
|
|
35
35
|
var Constraints__default = /*#__PURE__*/_interopDefault(Constraints);
|
|
36
36
|
|
|
37
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
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
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[
|
|
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; }
|
|
40
40
|
var defaultProps = {
|
|
41
41
|
horizontalConstraint: 'scale'
|
|
42
42
|
};
|
|
@@ -48,7 +48,7 @@ var TextInput = function TextInput(props) {
|
|
|
48
48
|
process.env.NODE_ENV !== "production" ? utils.warning(typeof props.onChange === 'function', 'TextInput: `onChange` is required when is not read only.') : void 0;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
return jsxRuntime.jsx(Constraints__default[
|
|
51
|
+
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
52
52
|
max: props.horizontalConstraint,
|
|
53
53
|
children: jsxRuntime.jsx("input", _objectSpread(_objectSpread({
|
|
54
54
|
id: props.id,
|
|
@@ -77,33 +77,33 @@ var TextInput = function TextInput(props) {
|
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
TextInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
80
|
-
id: _pt__default[
|
|
81
|
-
autoComplete: _pt__default[
|
|
82
|
-
className: _pt__default[
|
|
83
|
-
name: _pt__default[
|
|
84
|
-
value: _pt__default[
|
|
85
|
-
onChange: _pt__default[
|
|
86
|
-
onBlur: _pt__default[
|
|
87
|
-
onFocus: _pt__default[
|
|
88
|
-
isAutofocussed: _pt__default[
|
|
89
|
-
isDisabled: _pt__default[
|
|
90
|
-
isReadOnly: _pt__default[
|
|
91
|
-
hasError: _pt__default[
|
|
92
|
-
hasWarning: _pt__default[
|
|
93
|
-
placeholder: _pt__default[
|
|
94
|
-
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'])
|
|
95
95
|
} : {};
|
|
96
96
|
TextInput.displayName = 'TextInput';
|
|
97
97
|
TextInput.defaultProps = defaultProps;
|
|
98
98
|
|
|
99
99
|
TextInput.isEmpty = function (value) {
|
|
100
|
-
return !value || _trimInstanceProperty__default[
|
|
100
|
+
return !value || _trimInstanceProperty__default["default"](value).call(value).length === 0;
|
|
101
101
|
};
|
|
102
102
|
|
|
103
103
|
var TextInput$1 = TextInput;
|
|
104
104
|
|
|
105
|
-
// NOTE: This string will be replaced
|
|
106
|
-
var version =
|
|
105
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
106
|
+
var version = "12.2.7";
|
|
107
107
|
|
|
108
|
-
exports[
|
|
108
|
+
exports["default"] = TextInput$1;
|
|
109
109
|
exports.version = version;
|
|
@@ -33,9 +33,9 @@ var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defin
|
|
|
33
33
|
var _trimInstanceProperty__default = /*#__PURE__*/_interopDefault(_trimInstanceProperty);
|
|
34
34
|
var Constraints__default = /*#__PURE__*/_interopDefault(Constraints);
|
|
35
35
|
|
|
36
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
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
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[
|
|
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; }
|
|
39
39
|
var defaultProps = {
|
|
40
40
|
horizontalConstraint: 'scale'
|
|
41
41
|
};
|
|
@@ -45,7 +45,7 @@ var TextInput = function TextInput(props) {
|
|
|
45
45
|
|
|
46
46
|
if (!props.isReadOnly) ;
|
|
47
47
|
|
|
48
|
-
return jsxRuntime.jsx(Constraints__default[
|
|
48
|
+
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
49
49
|
max: props.horizontalConstraint,
|
|
50
50
|
children: jsxRuntime.jsx("input", _objectSpread(_objectSpread({
|
|
51
51
|
id: props.id,
|
|
@@ -78,13 +78,13 @@ TextInput.displayName = 'TextInput';
|
|
|
78
78
|
TextInput.defaultProps = defaultProps;
|
|
79
79
|
|
|
80
80
|
TextInput.isEmpty = function (value) {
|
|
81
|
-
return !value || _trimInstanceProperty__default[
|
|
81
|
+
return !value || _trimInstanceProperty__default["default"](value).call(value).length === 0;
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
var TextInput$1 = TextInput;
|
|
85
85
|
|
|
86
|
-
// NOTE: This string will be replaced
|
|
87
|
-
var version =
|
|
86
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
87
|
+
var version = "12.2.7";
|
|
88
88
|
|
|
89
|
-
exports[
|
|
89
|
+
exports["default"] = TextInput$1;
|
|
90
90
|
exports.version = version;
|
|
@@ -84,7 +84,7 @@ TextInput.isEmpty = function (value) {
|
|
|
84
84
|
|
|
85
85
|
var TextInput$1 = TextInput;
|
|
86
86
|
|
|
87
|
-
// NOTE: This string will be replaced
|
|
88
|
-
var version =
|
|
87
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
88
|
+
var version = "12.2.7";
|
|
89
89
|
|
|
90
90
|
export { TextInput$1 as default, version };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { TTextInputProps as TextInputProps } from './text-input';
|
|
2
|
-
export declare type TTextInputProps = TextInputProps;
|
|
1
|
+
import type { TTextInputProps as TextInputProps } from './text-input';
|
|
2
|
+
export declare type TTextInputProps = TextInputProps;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default } from './text-input';
|
|
2
|
-
export { default as version } from './version';
|
|
3
|
-
export * from './export-types';
|
|
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): 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
|
+
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.7",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
"homepage": "https://uikit.commercetools.com",
|
|
12
12
|
"keywords": ["javascript", "design system", "react", "uikit"],
|
|
13
13
|
"license": "MIT",
|
|
14
|
-
"private": false,
|
|
15
14
|
"publishConfig": {
|
|
16
15
|
"access": "public"
|
|
17
16
|
},
|
|
@@ -19,16 +18,13 @@
|
|
|
19
18
|
"main": "dist/commercetools-uikit-text-input.cjs.js",
|
|
20
19
|
"module": "dist/commercetools-uikit-text-input.esm.js",
|
|
21
20
|
"files": ["dist"],
|
|
22
|
-
"scripts": {
|
|
23
|
-
"prepare": "../../../../scripts/version.js replace"
|
|
24
|
-
},
|
|
25
21
|
"dependencies": {
|
|
26
|
-
"@babel/runtime": "7.
|
|
27
|
-
"@babel/runtime-corejs3": "7.
|
|
28
|
-
"@commercetools-uikit/constraints": "12.2.
|
|
29
|
-
"@commercetools-uikit/design-system": "12.2.
|
|
30
|
-
"@commercetools-uikit/input-utils": "12.2.
|
|
31
|
-
"@commercetools-uikit/utils": "12.2.
|
|
22
|
+
"@babel/runtime": "7.16.3",
|
|
23
|
+
"@babel/runtime-corejs3": "7.16.3",
|
|
24
|
+
"@commercetools-uikit/constraints": "12.2.5",
|
|
25
|
+
"@commercetools-uikit/design-system": "12.2.5",
|
|
26
|
+
"@commercetools-uikit/input-utils": "12.2.7",
|
|
27
|
+
"@commercetools-uikit/utils": "12.2.5",
|
|
32
28
|
"@emotion/react": "^11.4.0",
|
|
33
29
|
"@emotion/styled": "^11.3.0",
|
|
34
30
|
"prop-types": "15.7.2"
|