@commercetools-uikit/money-field 19.12.1 → 19.14.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.
|
@@ -58,8 +58,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
|
|
|
58
58
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
59
59
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
|
|
60
60
|
const sequentialId = utils.createSequentialId('money-field-');
|
|
61
|
-
const sequentialErrorsId = utils.createSequentialId('money-field-error-')();
|
|
62
|
-
const sequentialWarningsId = utils.createSequentialId('money-field-warning-')();
|
|
63
61
|
const hasErrors = errors => {
|
|
64
62
|
var _context;
|
|
65
63
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
@@ -99,6 +97,8 @@ let MoneyField = /*#__PURE__*/function (_Component) {
|
|
|
99
97
|
if (this.props.hintIcon) {
|
|
100
98
|
process.env.NODE_ENV !== "production" ? utils.warning(typeof this.props.hint === 'string' || /*#__PURE__*/react.isValidElement(this.props.hint), 'MoneyField: `hint` is required to be string or ReactNode if hintIcon is present') : void 0;
|
|
101
99
|
}
|
|
100
|
+
const errorsContainerId = `${this.state.id}-errors`;
|
|
101
|
+
const warningsContainerId = `${this.state.id}-warnings`;
|
|
102
102
|
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
103
103
|
max: this.props.horizontalConstraint,
|
|
104
104
|
children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
|
|
@@ -132,15 +132,15 @@ let MoneyField = /*#__PURE__*/function (_Component) {
|
|
|
132
132
|
menuShouldBlockScroll: this.props.menuShouldBlockScroll
|
|
133
133
|
}, utils.filterDataAttributes(this.props)), {}, {
|
|
134
134
|
"aria-invalid": hasError,
|
|
135
|
-
"aria-errormessage":
|
|
135
|
+
"aria-errormessage": errorsContainerId,
|
|
136
136
|
isCurrencyInputDisabled: this.props.isCurrencyInputDisabled
|
|
137
137
|
})), jsxRuntime.jsx(FieldErrors__default["default"], {
|
|
138
|
-
id:
|
|
138
|
+
id: errorsContainerId,
|
|
139
139
|
errors: this.props.errors,
|
|
140
140
|
isVisible: hasError,
|
|
141
141
|
renderError: this.props.renderError
|
|
142
142
|
}), jsxRuntime.jsx(FieldWarnings__default["default"], {
|
|
143
|
-
id:
|
|
143
|
+
id: warningsContainerId,
|
|
144
144
|
warnings: this.props.warnings,
|
|
145
145
|
isVisible: hasWarning,
|
|
146
146
|
renderWarning: this.props.renderWarning
|
|
@@ -204,7 +204,7 @@ MoneyField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
204
204
|
var MoneyField$1 = MoneyField;
|
|
205
205
|
|
|
206
206
|
// NOTE: This string will be replaced on build time with the package version.
|
|
207
|
-
var version = "19.
|
|
207
|
+
var version = "19.14.0";
|
|
208
208
|
|
|
209
209
|
exports["default"] = MoneyField$1;
|
|
210
210
|
exports.version = version;
|
|
@@ -56,8 +56,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
|
|
|
56
56
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
57
57
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
|
|
58
58
|
const sequentialId = utils.createSequentialId('money-field-');
|
|
59
|
-
const sequentialErrorsId = utils.createSequentialId('money-field-error-')();
|
|
60
|
-
const sequentialWarningsId = utils.createSequentialId('money-field-warning-')();
|
|
61
59
|
const hasErrors = errors => {
|
|
62
60
|
var _context;
|
|
63
61
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
@@ -92,6 +90,8 @@ let MoneyField = /*#__PURE__*/function (_Component) {
|
|
|
92
90
|
const hasWarning = MoneyInput__default["default"].isTouched(this.props.touched) && hasWarnings(this.props.warnings);
|
|
93
91
|
if (!this.props.isReadOnly) ;
|
|
94
92
|
if (this.props.hintIcon) ;
|
|
93
|
+
const errorsContainerId = `${this.state.id}-errors`;
|
|
94
|
+
const warningsContainerId = `${this.state.id}-warnings`;
|
|
95
95
|
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
96
96
|
max: this.props.horizontalConstraint,
|
|
97
97
|
children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
|
|
@@ -125,15 +125,15 @@ let MoneyField = /*#__PURE__*/function (_Component) {
|
|
|
125
125
|
menuShouldBlockScroll: this.props.menuShouldBlockScroll
|
|
126
126
|
}, utils.filterDataAttributes(this.props)), {}, {
|
|
127
127
|
"aria-invalid": hasError,
|
|
128
|
-
"aria-errormessage":
|
|
128
|
+
"aria-errormessage": errorsContainerId,
|
|
129
129
|
isCurrencyInputDisabled: this.props.isCurrencyInputDisabled
|
|
130
130
|
})), jsxRuntime.jsx(FieldErrors__default["default"], {
|
|
131
|
-
id:
|
|
131
|
+
id: errorsContainerId,
|
|
132
132
|
errors: this.props.errors,
|
|
133
133
|
isVisible: hasError,
|
|
134
134
|
renderError: this.props.renderError
|
|
135
135
|
}), jsxRuntime.jsx(FieldWarnings__default["default"], {
|
|
136
|
-
id:
|
|
136
|
+
id: warningsContainerId,
|
|
137
137
|
warnings: this.props.warnings,
|
|
138
138
|
isVisible: hasWarning,
|
|
139
139
|
renderWarning: this.props.renderWarning
|
|
@@ -165,7 +165,7 @@ MoneyField.propTypes = {};
|
|
|
165
165
|
var MoneyField$1 = MoneyField;
|
|
166
166
|
|
|
167
167
|
// NOTE: This string will be replaced on build time with the package version.
|
|
168
|
-
var version = "19.
|
|
168
|
+
var version = "19.14.0";
|
|
169
169
|
|
|
170
170
|
exports["default"] = MoneyField$1;
|
|
171
171
|
exports.version = version;
|
|
@@ -32,8 +32,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
|
|
|
32
32
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
33
33
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
|
|
34
34
|
const sequentialId = createSequentialId('money-field-');
|
|
35
|
-
const sequentialErrorsId = createSequentialId('money-field-error-')();
|
|
36
|
-
const sequentialWarningsId = createSequentialId('money-field-warning-')();
|
|
37
35
|
const hasErrors = errors => {
|
|
38
36
|
var _context;
|
|
39
37
|
return errors && _someInstanceProperty(_context = _Object$values(errors)).call(_context, Boolean);
|
|
@@ -73,6 +71,8 @@ let MoneyField = /*#__PURE__*/function (_Component) {
|
|
|
73
71
|
if (this.props.hintIcon) {
|
|
74
72
|
process.env.NODE_ENV !== "production" ? warning(typeof this.props.hint === 'string' || /*#__PURE__*/isValidElement(this.props.hint), 'MoneyField: `hint` is required to be string or ReactNode if hintIcon is present') : void 0;
|
|
75
73
|
}
|
|
74
|
+
const errorsContainerId = `${this.state.id}-errors`;
|
|
75
|
+
const warningsContainerId = `${this.state.id}-warnings`;
|
|
76
76
|
return jsx(Constraints.Horizontal, {
|
|
77
77
|
max: this.props.horizontalConstraint,
|
|
78
78
|
children: jsxs(Spacings.Stack, {
|
|
@@ -106,15 +106,15 @@ let MoneyField = /*#__PURE__*/function (_Component) {
|
|
|
106
106
|
menuShouldBlockScroll: this.props.menuShouldBlockScroll
|
|
107
107
|
}, filterDataAttributes(this.props)), {}, {
|
|
108
108
|
"aria-invalid": hasError,
|
|
109
|
-
"aria-errormessage":
|
|
109
|
+
"aria-errormessage": errorsContainerId,
|
|
110
110
|
isCurrencyInputDisabled: this.props.isCurrencyInputDisabled
|
|
111
111
|
})), jsx(FieldErrors, {
|
|
112
|
-
id:
|
|
112
|
+
id: errorsContainerId,
|
|
113
113
|
errors: this.props.errors,
|
|
114
114
|
isVisible: hasError,
|
|
115
115
|
renderError: this.props.renderError
|
|
116
116
|
}), jsx(FieldWarnings, {
|
|
117
|
-
id:
|
|
117
|
+
id: warningsContainerId,
|
|
118
118
|
warnings: this.props.warnings,
|
|
119
119
|
isVisible: hasWarning,
|
|
120
120
|
renderWarning: this.props.renderWarning
|
|
@@ -178,6 +178,6 @@ MoneyField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
178
178
|
var MoneyField$1 = MoneyField;
|
|
179
179
|
|
|
180
180
|
// NOTE: This string will be replaced on build time with the package version.
|
|
181
|
-
var version = "19.
|
|
181
|
+
var version = "19.14.0";
|
|
182
182
|
|
|
183
183
|
export { MoneyField$1 as default, version };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/money-field",
|
|
3
3
|
"description": "A controlled input component for money values with validation states and a label.",
|
|
4
|
-
"version": "19.
|
|
4
|
+
"version": "19.14.0",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,14 +21,14 @@
|
|
|
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/field-errors": "19.
|
|
27
|
-
"@commercetools-uikit/field-label": "19.
|
|
28
|
-
"@commercetools-uikit/field-warnings": "19.
|
|
29
|
-
"@commercetools-uikit/money-input": "19.
|
|
30
|
-
"@commercetools-uikit/spacings": "19.
|
|
31
|
-
"@commercetools-uikit/utils": "19.
|
|
24
|
+
"@commercetools-uikit/constraints": "19.14.0",
|
|
25
|
+
"@commercetools-uikit/design-system": "19.14.0",
|
|
26
|
+
"@commercetools-uikit/field-errors": "19.14.0",
|
|
27
|
+
"@commercetools-uikit/field-label": "19.14.0",
|
|
28
|
+
"@commercetools-uikit/field-warnings": "19.14.0",
|
|
29
|
+
"@commercetools-uikit/money-input": "19.14.0",
|
|
30
|
+
"@commercetools-uikit/spacings": "19.14.0",
|
|
31
|
+
"@commercetools-uikit/utils": "19.14.0",
|
|
32
32
|
"@emotion/react": "^11.10.5",
|
|
33
33
|
"@emotion/styled": "^11.10.5",
|
|
34
34
|
"lodash": "4.17.21",
|