@commercetools-uikit/number-field 20.5.0 → 20.6.1
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
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!-- THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -->
|
|
2
|
-
<!-- This file is created by the `
|
|
2
|
+
<!-- This file is created by the `pnpm generate-readme` script. -->
|
|
3
3
|
|
|
4
4
|
# NumberField
|
|
5
5
|
|
|
@@ -10,7 +10,7 @@ A controlled input component for numbers with validation states and a label.
|
|
|
10
10
|
## Installation
|
|
11
11
|
|
|
12
12
|
```
|
|
13
|
-
|
|
13
|
+
pnpm add @commercetools-uikit/number-field
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
```
|
|
@@ -20,7 +20,7 @@ npm --save install @commercetools-uikit/number-field
|
|
|
20
20
|
Additionally install the peer dependencies (if not present)
|
|
21
21
|
|
|
22
22
|
```
|
|
23
|
-
|
|
23
|
+
pnpm add react
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
```
|
|
@@ -147,8 +147,8 @@ let NumberField = /*#__PURE__*/function (_Component) {
|
|
|
147
147
|
}
|
|
148
148
|
const hasError = this.props.touched && hasErrors(this.props.errors);
|
|
149
149
|
const hasWarning = this.props.touched && hasWarnings(this.props.warnings);
|
|
150
|
-
const errorsContainerId =
|
|
151
|
-
const warningsContainerId =
|
|
150
|
+
const errorsContainerId = `${this.state.id}-errors`;
|
|
151
|
+
const warningsContainerId = `${this.state.id}-warnings`;
|
|
152
152
|
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
153
153
|
max: this.props.horizontalConstraint,
|
|
154
154
|
children: jsxRuntime.jsxs(Stack__default["default"], {
|
|
@@ -188,13 +188,9 @@ let NumberField = /*#__PURE__*/function (_Component) {
|
|
|
188
188
|
id: errorsContainerId,
|
|
189
189
|
errors: this.props.errors,
|
|
190
190
|
isVisible: hasError,
|
|
191
|
-
renderError: (key, error) =>
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
// Custom errors take precedence over the default errors
|
|
195
|
-
((_this$props$renderErr = (_this$props = this.props).renderError) === null || _this$props$renderErr === void 0 ? void 0 : _this$props$renderErr.call(_this$props, key, error)) || this.renderError(key)
|
|
196
|
-
);
|
|
197
|
-
}
|
|
191
|
+
renderError: (key, error) =>
|
|
192
|
+
// Custom errors take precedence over the default errors
|
|
193
|
+
this.props.renderError?.(key, error) || this.renderError(key)
|
|
198
194
|
}), jsxRuntime.jsx(FieldWarnings__default["default"], {
|
|
199
195
|
id: warningsContainerId,
|
|
200
196
|
warnings: this.props.warnings,
|
|
@@ -227,7 +223,7 @@ NumberField.getDerivedStateFromProps = (props, state) => ({
|
|
|
227
223
|
var NumberField$1 = NumberField;
|
|
228
224
|
|
|
229
225
|
// NOTE: This string will be replaced on build time with the package version.
|
|
230
|
-
var version = "20.
|
|
226
|
+
var version = "20.6.1";
|
|
231
227
|
|
|
232
228
|
exports["default"] = NumberField$1;
|
|
233
229
|
exports.version = version;
|
|
@@ -143,8 +143,8 @@ let NumberField = /*#__PURE__*/function (_Component) {
|
|
|
143
143
|
if (this.props.hintIcon) ;
|
|
144
144
|
const hasError = this.props.touched && hasErrors(this.props.errors);
|
|
145
145
|
const hasWarning = this.props.touched && hasWarnings(this.props.warnings);
|
|
146
|
-
const errorsContainerId =
|
|
147
|
-
const warningsContainerId =
|
|
146
|
+
const errorsContainerId = `${this.state.id}-errors`;
|
|
147
|
+
const warningsContainerId = `${this.state.id}-warnings`;
|
|
148
148
|
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
149
149
|
max: this.props.horizontalConstraint,
|
|
150
150
|
children: jsxRuntime.jsxs(Stack__default["default"], {
|
|
@@ -184,13 +184,9 @@ let NumberField = /*#__PURE__*/function (_Component) {
|
|
|
184
184
|
id: errorsContainerId,
|
|
185
185
|
errors: this.props.errors,
|
|
186
186
|
isVisible: hasError,
|
|
187
|
-
renderError: (key, error) =>
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
// Custom errors take precedence over the default errors
|
|
191
|
-
((_this$props$renderErr = (_this$props = this.props).renderError) === null || _this$props$renderErr === void 0 ? void 0 : _this$props$renderErr.call(_this$props, key, error)) || this.renderError(key)
|
|
192
|
-
);
|
|
193
|
-
}
|
|
187
|
+
renderError: (key, error) =>
|
|
188
|
+
// Custom errors take precedence over the default errors
|
|
189
|
+
this.props.renderError?.(key, error) || this.renderError(key)
|
|
194
190
|
}), jsxRuntime.jsx(FieldWarnings__default["default"], {
|
|
195
191
|
id: warningsContainerId,
|
|
196
192
|
warnings: this.props.warnings,
|
|
@@ -223,7 +219,7 @@ NumberField.getDerivedStateFromProps = (props, state) => ({
|
|
|
223
219
|
var NumberField$1 = NumberField;
|
|
224
220
|
|
|
225
221
|
// NOTE: This string will be replaced on build time with the package version.
|
|
226
|
-
var version = "20.
|
|
222
|
+
var version = "20.6.1";
|
|
227
223
|
|
|
228
224
|
exports["default"] = NumberField$1;
|
|
229
225
|
exports.version = version;
|
|
@@ -123,8 +123,8 @@ let NumberField = /*#__PURE__*/function (_Component) {
|
|
|
123
123
|
}
|
|
124
124
|
const hasError = this.props.touched && hasErrors(this.props.errors);
|
|
125
125
|
const hasWarning = this.props.touched && hasWarnings(this.props.warnings);
|
|
126
|
-
const errorsContainerId =
|
|
127
|
-
const warningsContainerId =
|
|
126
|
+
const errorsContainerId = `${this.state.id}-errors`;
|
|
127
|
+
const warningsContainerId = `${this.state.id}-warnings`;
|
|
128
128
|
return jsx(Constraints.Horizontal, {
|
|
129
129
|
max: this.props.horizontalConstraint,
|
|
130
130
|
children: jsxs(Stack, {
|
|
@@ -164,13 +164,9 @@ let NumberField = /*#__PURE__*/function (_Component) {
|
|
|
164
164
|
id: errorsContainerId,
|
|
165
165
|
errors: this.props.errors,
|
|
166
166
|
isVisible: hasError,
|
|
167
|
-
renderError: (key, error) =>
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
// Custom errors take precedence over the default errors
|
|
171
|
-
((_this$props$renderErr = (_this$props = this.props).renderError) === null || _this$props$renderErr === void 0 ? void 0 : _this$props$renderErr.call(_this$props, key, error)) || this.renderError(key)
|
|
172
|
-
);
|
|
173
|
-
}
|
|
167
|
+
renderError: (key, error) =>
|
|
168
|
+
// Custom errors take precedence over the default errors
|
|
169
|
+
this.props.renderError?.(key, error) || this.renderError(key)
|
|
174
170
|
}), jsx(FieldWarnings, {
|
|
175
171
|
id: warningsContainerId,
|
|
176
172
|
warnings: this.props.warnings,
|
|
@@ -203,6 +199,6 @@ NumberField.getDerivedStateFromProps = (props, state) => ({
|
|
|
203
199
|
var NumberField$1 = NumberField;
|
|
204
200
|
|
|
205
201
|
// NOTE: This string will be replaced on build time with the package version.
|
|
206
|
-
var version = "20.
|
|
202
|
+
var version = "20.6.1";
|
|
207
203
|
|
|
208
204
|
export { NumberField$1 as default, version };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/number-field",
|
|
3
3
|
"description": "A controlled input component for numbers with validation states and a label.",
|
|
4
|
-
"version": "20.
|
|
4
|
+
"version": "20.6.1",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -9,7 +9,13 @@
|
|
|
9
9
|
"directory": "packages/components/fields/number-field"
|
|
10
10
|
},
|
|
11
11
|
"homepage": "https://uikit.commercetools.com",
|
|
12
|
-
"keywords": [
|
|
12
|
+
"keywords": [
|
|
13
|
+
"javascript",
|
|
14
|
+
"typescript",
|
|
15
|
+
"design-system",
|
|
16
|
+
"react",
|
|
17
|
+
"uikit"
|
|
18
|
+
],
|
|
13
19
|
"license": "MIT",
|
|
14
20
|
"publishConfig": {
|
|
15
21
|
"access": "public"
|
|
@@ -17,26 +23,29 @@
|
|
|
17
23
|
"sideEffects": false,
|
|
18
24
|
"main": "dist/commercetools-uikit-number-field.cjs.js",
|
|
19
25
|
"module": "dist/commercetools-uikit-number-field.esm.js",
|
|
20
|
-
"files": [
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
21
29
|
"dependencies": {
|
|
22
30
|
"@babel/runtime": "^7.20.13",
|
|
23
31
|
"@babel/runtime-corejs3": "^7.20.13",
|
|
24
|
-
"@commercetools-uikit/constraints": "20.5.0",
|
|
25
|
-
"@commercetools-uikit/design-system": "20.5.0",
|
|
26
|
-
"@commercetools-uikit/field-errors": "20.5.0",
|
|
27
|
-
"@commercetools-uikit/field-label": "20.5.0",
|
|
28
|
-
"@commercetools-uikit/field-warnings": "20.5.0",
|
|
29
|
-
"@commercetools-uikit/number-input": "20.5.0",
|
|
30
|
-
"@commercetools-uikit/spacings-stack": "20.5.0",
|
|
31
|
-
"@commercetools-uikit/utils": "20.5.0",
|
|
32
32
|
"@emotion/react": "^11.10.5",
|
|
33
33
|
"@emotion/styled": "^11.10.5",
|
|
34
|
-
"react-intl": "^7.1.4"
|
|
34
|
+
"react-intl": "^7.1.4",
|
|
35
|
+
"@commercetools-uikit/design-system": "^20.6.1",
|
|
36
|
+
"@commercetools-uikit/constraints": "^20.6.1",
|
|
37
|
+
"@commercetools-uikit/field-errors": "^20.6.1",
|
|
38
|
+
"@commercetools-uikit/field-warnings": "^20.6.1",
|
|
39
|
+
"@commercetools-uikit/field-label": "^20.6.1",
|
|
40
|
+
"@commercetools-uikit/number-input": "^20.6.1",
|
|
41
|
+
"@commercetools-uikit/spacings-stack": "^20.6.1",
|
|
42
|
+
"@commercetools-uikit/utils": "^20.6.1"
|
|
35
43
|
},
|
|
36
44
|
"devDependencies": {
|
|
37
|
-
"
|
|
45
|
+
"prop-types": "^15.8.1",
|
|
46
|
+
"react": "19.2.6"
|
|
38
47
|
},
|
|
39
48
|
"peerDependencies": {
|
|
40
49
|
"react": "19.x"
|
|
41
50
|
}
|
|
42
|
-
}
|
|
51
|
+
}
|