@commercetools-uikit/number-input 12.2.3 → 12.2.4
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-number-input.cjs.dev.js +23 -23
- package/dist/commercetools-uikit-number-input.cjs.prod.js +6 -6
- package/dist/commercetools-uikit-number-input.esm.js +1 -1
- package/dist/declarations/src/export-types.d.ts +2 -2
- package/dist/declarations/src/index.d.ts +3 -3
- package/dist/declarations/src/number-input.d.ts +29 -29
- package/dist/declarations/src/version.d.ts +2 -2
- package/package.json +6 -6
|
@@ -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 NumberInput = function NumberInput(props) {
|
|
|
48
48
|
process.env.NODE_ENV !== "production" ? utils.warning(Boolean(props.onChange), 'NumberInput: `onChange` is required when input 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,
|
|
@@ -76,23 +76,23 @@ var NumberInput = function NumberInput(props) {
|
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
NumberInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
79
|
-
id: _pt__default[
|
|
80
|
-
name: _pt__default[
|
|
81
|
-
autoComplete: _pt__default[
|
|
82
|
-
placeholder: _pt__default[
|
|
83
|
-
value: _pt__default[
|
|
84
|
-
min: _pt__default[
|
|
85
|
-
max: _pt__default[
|
|
86
|
-
step: _pt__default[
|
|
87
|
-
onChange: _pt__default[
|
|
88
|
-
onBlur: _pt__default[
|
|
89
|
-
onFocus: _pt__default[
|
|
90
|
-
isAutofocussed: _pt__default[
|
|
91
|
-
isDisabled: _pt__default[
|
|
92
|
-
isReadOnly: _pt__default[
|
|
93
|
-
hasError: _pt__default[
|
|
94
|
-
hasWarning: _pt__default[
|
|
95
|
-
horizontalConstraint: _pt__default[
|
|
79
|
+
id: _pt__default["default"].string,
|
|
80
|
+
name: _pt__default["default"].string,
|
|
81
|
+
autoComplete: _pt__default["default"].string,
|
|
82
|
+
placeholder: _pt__default["default"].string,
|
|
83
|
+
value: _pt__default["default"].oneOfType([_pt__default["default"].string, _pt__default["default"].number]).isRequired,
|
|
84
|
+
min: _pt__default["default"].number,
|
|
85
|
+
max: _pt__default["default"].number,
|
|
86
|
+
step: _pt__default["default"].oneOfType([_pt__default["default"].number, _pt__default["default"].oneOf(['any'])]),
|
|
87
|
+
onChange: _pt__default["default"].func,
|
|
88
|
+
onBlur: _pt__default["default"].func,
|
|
89
|
+
onFocus: _pt__default["default"].func,
|
|
90
|
+
isAutofocussed: _pt__default["default"].bool,
|
|
91
|
+
isDisabled: _pt__default["default"].bool,
|
|
92
|
+
isReadOnly: _pt__default["default"].bool,
|
|
93
|
+
hasError: _pt__default["default"].bool,
|
|
94
|
+
hasWarning: _pt__default["default"].bool,
|
|
95
|
+
horizontalConstraint: _pt__default["default"].oneOf([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto'])
|
|
96
96
|
} : {};
|
|
97
97
|
NumberInput.displayName = 'NumberInput';
|
|
98
98
|
NumberInput.defaultProps = defaultProps;
|
|
@@ -106,7 +106,7 @@ NumberInput.toFormValue = function (numberOrString) {
|
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
NumberInput.isEmpty = function (value) {
|
|
109
|
-
if (typeof value === 'string') return _trimInstanceProperty__default[
|
|
109
|
+
if (typeof value === 'string') return _trimInstanceProperty__default["default"](value).call(value).length === 0;
|
|
110
110
|
if (typeof value === 'number') return isNaN(value);
|
|
111
111
|
return true;
|
|
112
112
|
};
|
|
@@ -120,7 +120,7 @@ NumberInput.hasFractionDigits = function (number) {
|
|
|
120
120
|
var NumberInput$1 = NumberInput;
|
|
121
121
|
|
|
122
122
|
// NOTE: This string will be replaced in the `prepare` script by the `scripts/version.js` file.
|
|
123
|
-
var version = '12.2.
|
|
123
|
+
var version = '12.2.4';
|
|
124
124
|
|
|
125
|
-
exports[
|
|
125
|
+
exports["default"] = NumberInput$1;
|
|
126
126
|
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 NumberInput = function NumberInput(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,
|
|
@@ -85,7 +85,7 @@ NumberInput.toFormValue = function (numberOrString) {
|
|
|
85
85
|
};
|
|
86
86
|
|
|
87
87
|
NumberInput.isEmpty = function (value) {
|
|
88
|
-
if (typeof value === 'string') return _trimInstanceProperty__default[
|
|
88
|
+
if (typeof value === 'string') return _trimInstanceProperty__default["default"](value).call(value).length === 0;
|
|
89
89
|
if (typeof value === 'number') return isNaN(value);
|
|
90
90
|
return true;
|
|
91
91
|
};
|
|
@@ -98,7 +98,7 @@ NumberInput.hasFractionDigits = function (number) {
|
|
|
98
98
|
var NumberInput$1 = NumberInput;
|
|
99
99
|
|
|
100
100
|
// NOTE: This string will be replaced in the `prepare` script by the `scripts/version.js` file.
|
|
101
|
-
var version = '12.2.
|
|
101
|
+
var version = '12.2.4';
|
|
102
102
|
|
|
103
|
-
exports[
|
|
103
|
+
exports["default"] = NumberInput$1;
|
|
104
104
|
exports.version = version;
|
|
@@ -102,6 +102,6 @@ NumberInput.hasFractionDigits = function (number) {
|
|
|
102
102
|
var NumberInput$1 = NumberInput;
|
|
103
103
|
|
|
104
104
|
// NOTE: This string will be replaced in the `prepare` script by the `scripts/version.js` file.
|
|
105
|
-
var version = '12.2.
|
|
105
|
+
var version = '12.2.4';
|
|
106
106
|
|
|
107
107
|
export { NumberInput$1 as default, version };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { TNumberInputProps as NumberInputProps } from './number-input';
|
|
2
|
-
export declare type TNumberInputProps = NumberInputProps;
|
|
1
|
+
import type { TNumberInputProps as NumberInputProps } from './number-input';
|
|
2
|
+
export declare type TNumberInputProps = NumberInputProps;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default } from './number-input';
|
|
2
|
-
export { default as version } from './version';
|
|
3
|
-
export * from './export-types';
|
|
1
|
+
export { default } from './number-input';
|
|
2
|
+
export { default as version } from './version';
|
|
3
|
+
export * from './export-types';
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { ChangeEventHandler, FocusEventHandler } from 'react';
|
|
2
|
-
export declare type TNumberInputProps = {
|
|
3
|
-
id?: string;
|
|
4
|
-
name?: string;
|
|
5
|
-
autoComplete?: string;
|
|
6
|
-
placeholder?: string;
|
|
7
|
-
value: string | number;
|
|
8
|
-
min?: number;
|
|
9
|
-
max?: number;
|
|
10
|
-
step?: number | 'any';
|
|
11
|
-
onChange?: ChangeEventHandler;
|
|
12
|
-
onBlur?: FocusEventHandler;
|
|
13
|
-
onFocus?: FocusEventHandler;
|
|
14
|
-
isAutofocussed?: boolean;
|
|
15
|
-
isDisabled?: boolean;
|
|
16
|
-
isReadOnly?: boolean;
|
|
17
|
-
hasError?: boolean;
|
|
18
|
-
hasWarning?: boolean;
|
|
19
|
-
horizontalConstraint?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
|
|
20
|
-
};
|
|
21
|
-
declare const NumberInput: {
|
|
22
|
-
(props: TNumberInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
23
|
-
displayName: string;
|
|
24
|
-
defaultProps: Pick<TNumberInputProps, "horizontalConstraint">;
|
|
25
|
-
toFormValue(numberOrString: number | string): string | number;
|
|
26
|
-
isEmpty(value: number | string): boolean;
|
|
27
|
-
hasFractionDigits(number: number | string): boolean;
|
|
28
|
-
};
|
|
29
|
-
export default NumberInput;
|
|
1
|
+
import { ChangeEventHandler, FocusEventHandler } from 'react';
|
|
2
|
+
export declare type TNumberInputProps = {
|
|
3
|
+
id?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
autoComplete?: string;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
value: string | number;
|
|
8
|
+
min?: number;
|
|
9
|
+
max?: number;
|
|
10
|
+
step?: number | 'any';
|
|
11
|
+
onChange?: ChangeEventHandler;
|
|
12
|
+
onBlur?: FocusEventHandler;
|
|
13
|
+
onFocus?: FocusEventHandler;
|
|
14
|
+
isAutofocussed?: boolean;
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
isReadOnly?: boolean;
|
|
17
|
+
hasError?: boolean;
|
|
18
|
+
hasWarning?: boolean;
|
|
19
|
+
horizontalConstraint?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
|
|
20
|
+
};
|
|
21
|
+
declare const NumberInput: {
|
|
22
|
+
(props: TNumberInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
23
|
+
displayName: string;
|
|
24
|
+
defaultProps: Pick<TNumberInputProps, "horizontalConstraint">;
|
|
25
|
+
toFormValue(numberOrString: number | string): string | number;
|
|
26
|
+
isEmpty(value: number | string): boolean;
|
|
27
|
+
hasFractionDigits(number: number | string): boolean;
|
|
28
|
+
};
|
|
29
|
+
export default NumberInput;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "12.2.
|
|
2
|
-
export default _default;
|
|
1
|
+
declare const _default: "12.2.4";
|
|
2
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/number-input",
|
|
3
3
|
"description": "A controlled input component for numbers with validation states.",
|
|
4
|
-
"version": "12.2.
|
|
4
|
+
"version": "12.2.4",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"prepare": "../../../../scripts/version.js replace"
|
|
24
24
|
},
|
|
25
25
|
"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.
|
|
26
|
+
"@babel/runtime": "7.15.4",
|
|
27
|
+
"@babel/runtime-corejs3": "7.15.4",
|
|
28
|
+
"@commercetools-uikit/constraints": "12.2.4",
|
|
29
|
+
"@commercetools-uikit/design-system": "12.2.4",
|
|
30
|
+
"@commercetools-uikit/input-utils": "12.2.4",
|
|
31
31
|
"@commercetools-uikit/utils": "12.2.0",
|
|
32
32
|
"@emotion/react": "^11.4.0",
|
|
33
33
|
"@emotion/styled": "^11.3.0",
|