@commercetools-uikit/number-input 12.2.2 → 12.2.6
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-number-input.cjs.dev.js +67 -47
- package/dist/commercetools-uikit-number-input.cjs.prod.js +50 -30
- package/dist/commercetools-uikit-number-input.esm.js +40 -28
- 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 +7 -11
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,51 +48,51 @@ var NumberInput = function NumberInput(props) {
|
|
|
28
48
|
process.env.NODE_ENV !== "production" ? utils.warning(Boolean(props.onChange), 'NumberInput: `onChange` is required when input 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
|
-
})
|
|
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: "number",
|
|
57
|
+
autoComplete: props.autoComplete,
|
|
58
|
+
value: props.value,
|
|
59
|
+
min: props.min,
|
|
60
|
+
max: props.max,
|
|
61
|
+
step: props.step,
|
|
62
|
+
onChange: props.onChange,
|
|
63
|
+
onBlur: props.onBlur,
|
|
64
|
+
onFocus: props.onFocus,
|
|
65
|
+
disabled: props.isDisabled,
|
|
66
|
+
placeholder: props.placeholder,
|
|
67
|
+
css: inputUtils.getInputStyles(props, theme),
|
|
68
|
+
readOnly: props.isReadOnly,
|
|
69
|
+
autoFocus: props.isAutofocussed
|
|
70
|
+
}, utils.filterDataAttributes(props)), {}, {
|
|
71
|
+
/* ARIA */
|
|
72
|
+
"aria-readonly": props.isReadOnly,
|
|
73
|
+
contentEditable: !props.isReadOnly
|
|
74
|
+
}))
|
|
75
|
+
});
|
|
56
76
|
};
|
|
57
77
|
|
|
58
78
|
NumberInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
59
|
-
id: _pt__default[
|
|
60
|
-
name: _pt__default[
|
|
61
|
-
autoComplete: _pt__default[
|
|
62
|
-
placeholder: _pt__default[
|
|
63
|
-
value: _pt__default[
|
|
64
|
-
min: _pt__default[
|
|
65
|
-
max: _pt__default[
|
|
66
|
-
step: _pt__default[
|
|
67
|
-
onChange: _pt__default[
|
|
68
|
-
onBlur: _pt__default[
|
|
69
|
-
onFocus: _pt__default[
|
|
70
|
-
isAutofocussed: _pt__default[
|
|
71
|
-
isDisabled: _pt__default[
|
|
72
|
-
isReadOnly: _pt__default[
|
|
73
|
-
hasError: _pt__default[
|
|
74
|
-
hasWarning: _pt__default[
|
|
75
|
-
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'])
|
|
76
96
|
} : {};
|
|
77
97
|
NumberInput.displayName = 'NumberInput';
|
|
78
98
|
NumberInput.defaultProps = defaultProps;
|
|
@@ -86,7 +106,7 @@ NumberInput.toFormValue = function (numberOrString) {
|
|
|
86
106
|
};
|
|
87
107
|
|
|
88
108
|
NumberInput.isEmpty = function (value) {
|
|
89
|
-
if (typeof value === 'string') return _trimInstanceProperty__default[
|
|
109
|
+
if (typeof value === 'string') return _trimInstanceProperty__default["default"](value).call(value).length === 0;
|
|
90
110
|
if (typeof value === 'number') return isNaN(value);
|
|
91
111
|
return true;
|
|
92
112
|
};
|
|
@@ -99,8 +119,8 @@ NumberInput.hasFractionDigits = function (number) {
|
|
|
99
119
|
|
|
100
120
|
var NumberInput$1 = NumberInput;
|
|
101
121
|
|
|
102
|
-
// NOTE: This string will be replaced
|
|
103
|
-
var version =
|
|
122
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
123
|
+
var version = "12.2.6";
|
|
104
124
|
|
|
105
|
-
exports[
|
|
125
|
+
exports["default"] = NumberInput$1;
|
|
106
126
|
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,31 +45,31 @@ var NumberInput = function NumberInput(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
|
-
})
|
|
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: "number",
|
|
54
|
+
autoComplete: props.autoComplete,
|
|
55
|
+
value: props.value,
|
|
56
|
+
min: props.min,
|
|
57
|
+
max: props.max,
|
|
58
|
+
step: props.step,
|
|
59
|
+
onChange: props.onChange,
|
|
60
|
+
onBlur: props.onBlur,
|
|
61
|
+
onFocus: props.onFocus,
|
|
62
|
+
disabled: props.isDisabled,
|
|
63
|
+
placeholder: props.placeholder,
|
|
64
|
+
css: inputUtils.getInputStyles(props, theme),
|
|
65
|
+
readOnly: props.isReadOnly,
|
|
66
|
+
autoFocus: props.isAutofocussed
|
|
67
|
+
}, utils.filterDataAttributes(props)), {}, {
|
|
68
|
+
/* ARIA */
|
|
69
|
+
"aria-readonly": props.isReadOnly,
|
|
70
|
+
contentEditable: !props.isReadOnly
|
|
71
|
+
}))
|
|
72
|
+
});
|
|
53
73
|
};
|
|
54
74
|
|
|
55
75
|
NumberInput.propTypes = {};
|
|
@@ -65,7 +85,7 @@ NumberInput.toFormValue = function (numberOrString) {
|
|
|
65
85
|
};
|
|
66
86
|
|
|
67
87
|
NumberInput.isEmpty = function (value) {
|
|
68
|
-
if (typeof value === 'string') return _trimInstanceProperty__default[
|
|
88
|
+
if (typeof value === 'string') return _trimInstanceProperty__default["default"](value).call(value).length === 0;
|
|
69
89
|
if (typeof value === 'number') return isNaN(value);
|
|
70
90
|
return true;
|
|
71
91
|
};
|
|
@@ -77,8 +97,8 @@ NumberInput.hasFractionDigits = function (number) {
|
|
|
77
97
|
|
|
78
98
|
var NumberInput$1 = NumberInput;
|
|
79
99
|
|
|
80
|
-
// NOTE: This string will be replaced
|
|
81
|
-
var version =
|
|
100
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
101
|
+
var version = "12.2.6";
|
|
82
102
|
|
|
83
|
-
exports[
|
|
103
|
+
exports["default"] = NumberInput$1;
|
|
84
104
|
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,30 +31,30 @@ var NumberInput = function NumberInput(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
|
-
})
|
|
34
|
+
max: props.horizontalConstraint,
|
|
35
|
+
children: jsx("input", _objectSpread(_objectSpread({
|
|
36
|
+
id: props.id,
|
|
37
|
+
name: props.name,
|
|
38
|
+
type: "number",
|
|
39
|
+
autoComplete: props.autoComplete,
|
|
40
|
+
value: props.value,
|
|
41
|
+
min: props.min,
|
|
42
|
+
max: props.max,
|
|
43
|
+
step: props.step,
|
|
44
|
+
onChange: props.onChange,
|
|
45
|
+
onBlur: props.onBlur,
|
|
46
|
+
onFocus: props.onFocus,
|
|
47
|
+
disabled: props.isDisabled,
|
|
48
|
+
placeholder: props.placeholder,
|
|
49
|
+
css: getInputStyles(props, theme),
|
|
50
|
+
readOnly: props.isReadOnly,
|
|
51
|
+
autoFocus: props.isAutofocussed
|
|
52
|
+
}, filterDataAttributes(props)), {}, {
|
|
53
|
+
/* ARIA */
|
|
54
|
+
"aria-readonly": props.isReadOnly,
|
|
55
|
+
contentEditable: !props.isReadOnly
|
|
56
|
+
}))
|
|
57
|
+
});
|
|
46
58
|
};
|
|
47
59
|
|
|
48
60
|
NumberInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -89,7 +101,7 @@ NumberInput.hasFractionDigits = function (number) {
|
|
|
89
101
|
|
|
90
102
|
var NumberInput$1 = NumberInput;
|
|
91
103
|
|
|
92
|
-
// NOTE: This string will be replaced
|
|
93
|
-
var version =
|
|
104
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
105
|
+
var version = "12.2.6";
|
|
94
106
|
|
|
95
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): 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: "
|
|
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/number-input",
|
|
3
3
|
"description": "A controlled input component for numbers with validation states.",
|
|
4
|
-
"version": "12.2.
|
|
4
|
+
"version": "12.2.6",
|
|
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-number-input.cjs.js",
|
|
20
19
|
"module": "dist/commercetools-uikit-number-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.6",
|
|
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"
|