@commercetools-uikit/field-warnings 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.
|
@@ -23,7 +23,9 @@ const FieldWarnings = props => {
|
|
|
23
23
|
var _context, _context2;
|
|
24
24
|
if (!props.isVisible) return null;
|
|
25
25
|
if (!props.warnings || !isObject(props.warnings)) return null;
|
|
26
|
-
return jsxRuntime.jsx(
|
|
26
|
+
return jsxRuntime.jsx("div", {
|
|
27
|
+
id: props.id,
|
|
28
|
+
role: "status",
|
|
27
29
|
children: _mapInstanceProperty__default["default"](_context = _filterInstanceProperty__default["default"](_context2 = _Object$entries__default["default"](props.warnings)
|
|
28
30
|
// Only render warnings which have truthy values, to avoid
|
|
29
31
|
// rendering a warning that has falsy values.
|
|
@@ -41,14 +43,12 @@ const FieldWarnings = props => {
|
|
|
41
43
|
// Render a custom warning if one was provided.
|
|
42
44
|
// Custom warnings take precedence over the default warnings
|
|
43
45
|
if (warningElement) return jsxRuntime.jsx(messages.WarningMessage, {
|
|
44
|
-
id: props.id,
|
|
45
46
|
children: warningElement
|
|
46
47
|
}, key);
|
|
47
48
|
const defaultWarningElement = props.renderDefaultWarning ? props.renderDefaultWarning(key, warning) : null;
|
|
48
49
|
// Render a default warning if one was provided.
|
|
49
50
|
// Default warnings take precedence over the known warnings
|
|
50
51
|
if (defaultWarningElement) return jsxRuntime.jsx(messages.WarningMessage, {
|
|
51
|
-
id: props.id,
|
|
52
52
|
children: defaultWarningElement
|
|
53
53
|
}, key);
|
|
54
54
|
// Render nothing in case the warning is not known and no custom warning
|
|
@@ -68,7 +68,7 @@ FieldWarnings.displayName = 'FieldWarnings';
|
|
|
68
68
|
var FieldWarnings$1 = FieldWarnings;
|
|
69
69
|
|
|
70
70
|
// NOTE: This string will be replaced on build time with the package version.
|
|
71
|
-
var version = "19.
|
|
71
|
+
var version = "19.14.0";
|
|
72
72
|
|
|
73
73
|
exports["default"] = FieldWarnings$1;
|
|
74
74
|
exports.version = version;
|
|
@@ -22,7 +22,9 @@ const FieldWarnings = props => {
|
|
|
22
22
|
var _context, _context2;
|
|
23
23
|
if (!props.isVisible) return null;
|
|
24
24
|
if (!props.warnings || !isObject(props.warnings)) return null;
|
|
25
|
-
return jsxRuntime.jsx(
|
|
25
|
+
return jsxRuntime.jsx("div", {
|
|
26
|
+
id: props.id,
|
|
27
|
+
role: "status",
|
|
26
28
|
children: _mapInstanceProperty__default["default"](_context = _filterInstanceProperty__default["default"](_context2 = _Object$entries__default["default"](props.warnings)
|
|
27
29
|
// Only render warnings which have truthy values, to avoid
|
|
28
30
|
// rendering a warning that has falsy values.
|
|
@@ -40,14 +42,12 @@ const FieldWarnings = props => {
|
|
|
40
42
|
// Render a custom warning if one was provided.
|
|
41
43
|
// Custom warnings take precedence over the default warnings
|
|
42
44
|
if (warningElement) return jsxRuntime.jsx(messages.WarningMessage, {
|
|
43
|
-
id: props.id,
|
|
44
45
|
children: warningElement
|
|
45
46
|
}, key);
|
|
46
47
|
const defaultWarningElement = props.renderDefaultWarning ? props.renderDefaultWarning(key, warning) : null;
|
|
47
48
|
// Render a default warning if one was provided.
|
|
48
49
|
// Default warnings take precedence over the known warnings
|
|
49
50
|
if (defaultWarningElement) return jsxRuntime.jsx(messages.WarningMessage, {
|
|
50
|
-
id: props.id,
|
|
51
51
|
children: defaultWarningElement
|
|
52
52
|
}, key);
|
|
53
53
|
// Render nothing in case the warning is not known and no custom warning
|
|
@@ -61,7 +61,7 @@ FieldWarnings.displayName = 'FieldWarnings';
|
|
|
61
61
|
var FieldWarnings$1 = FieldWarnings;
|
|
62
62
|
|
|
63
63
|
// NOTE: This string will be replaced on build time with the package version.
|
|
64
|
-
var version = "19.
|
|
64
|
+
var version = "19.14.0";
|
|
65
65
|
|
|
66
66
|
exports["default"] = FieldWarnings$1;
|
|
67
67
|
exports.version = version;
|
|
@@ -5,14 +5,16 @@ import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/insta
|
|
|
5
5
|
import _Object$entries from '@babel/runtime-corejs3/core-js-stable/object/entries';
|
|
6
6
|
import 'react';
|
|
7
7
|
import { WarningMessage } from '@commercetools-uikit/messages';
|
|
8
|
-
import { jsx
|
|
8
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
9
9
|
|
|
10
10
|
const isObject = obj => typeof obj === 'object';
|
|
11
11
|
const FieldWarnings = props => {
|
|
12
12
|
var _context, _context2;
|
|
13
13
|
if (!props.isVisible) return null;
|
|
14
14
|
if (!props.warnings || !isObject(props.warnings)) return null;
|
|
15
|
-
return jsx(
|
|
15
|
+
return jsx("div", {
|
|
16
|
+
id: props.id,
|
|
17
|
+
role: "status",
|
|
16
18
|
children: _mapInstanceProperty(_context = _filterInstanceProperty(_context2 = _Object$entries(props.warnings)
|
|
17
19
|
// Only render warnings which have truthy values, to avoid
|
|
18
20
|
// rendering a warning that has falsy values.
|
|
@@ -30,14 +32,12 @@ const FieldWarnings = props => {
|
|
|
30
32
|
// Render a custom warning if one was provided.
|
|
31
33
|
// Custom warnings take precedence over the default warnings
|
|
32
34
|
if (warningElement) return jsx(WarningMessage, {
|
|
33
|
-
id: props.id,
|
|
34
35
|
children: warningElement
|
|
35
36
|
}, key);
|
|
36
37
|
const defaultWarningElement = props.renderDefaultWarning ? props.renderDefaultWarning(key, warning) : null;
|
|
37
38
|
// Render a default warning if one was provided.
|
|
38
39
|
// Default warnings take precedence over the known warnings
|
|
39
40
|
if (defaultWarningElement) return jsx(WarningMessage, {
|
|
40
|
-
id: props.id,
|
|
41
41
|
children: defaultWarningElement
|
|
42
42
|
}, key);
|
|
43
43
|
// Render nothing in case the warning is not known and no custom warning
|
|
@@ -57,6 +57,6 @@ FieldWarnings.displayName = 'FieldWarnings';
|
|
|
57
57
|
var FieldWarnings$1 = FieldWarnings;
|
|
58
58
|
|
|
59
59
|
// NOTE: This string will be replaced on build time with the package version.
|
|
60
|
-
var version = "19.
|
|
60
|
+
var version = "19.14.0";
|
|
61
61
|
|
|
62
62
|
export { FieldWarnings$1 as default, version };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/field-warnings",
|
|
3
3
|
"description": "Renders warnings based on configuration.",
|
|
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,7 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@babel/runtime": "^7.20.13",
|
|
23
23
|
"@babel/runtime-corejs3": "^7.20.13",
|
|
24
|
-
"@commercetools-uikit/messages": "19.
|
|
24
|
+
"@commercetools-uikit/messages": "19.14.0",
|
|
25
25
|
"@emotion/react": "^11.10.5",
|
|
26
26
|
"@emotion/styled": "^11.10.5",
|
|
27
27
|
"prop-types": "15.8.1"
|