@commercetools-uikit/field-errors 12.2.3 → 13.0.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.
- package/dist/commercetools-uikit-field-errors.cjs.dev.js +11 -12
- package/dist/commercetools-uikit-field-errors.cjs.prod.js +7 -8
- package/dist/commercetools-uikit-field-errors.esm.js +5 -6
- package/dist/declarations/src/export-types.d.ts +3 -3
- package/dist/declarations/src/field-errors.d.ts +19 -19
- package/dist/declarations/src/index.d.ts +3 -3
- package/dist/declarations/src/messages.d.ts +18 -18
- package/dist/declarations/src/version.d.ts +2 -2
- package/package.json +6 -10
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
6
6
|
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
7
|
-
var _typeof = require('@babel/runtime-corejs3/helpers/typeof');
|
|
8
7
|
var _pt = require('prop-types');
|
|
9
8
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
10
9
|
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
@@ -53,12 +52,12 @@ var messages = reactIntl.defineMessages({
|
|
|
53
52
|
}
|
|
54
53
|
});
|
|
55
54
|
|
|
56
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
55
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); 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; }
|
|
57
56
|
|
|
58
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
57
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
59
58
|
|
|
60
59
|
var isObject = function isObject(obj) {
|
|
61
|
-
return
|
|
60
|
+
return typeof obj === 'object';
|
|
62
61
|
};
|
|
63
62
|
|
|
64
63
|
var FieldErrors = function FieldErrors(props) {
|
|
@@ -67,7 +66,7 @@ var FieldErrors = function FieldErrors(props) {
|
|
|
67
66
|
if (!props.isVisible) return null;
|
|
68
67
|
if (!props.errors || !isObject(props.errors)) return null;
|
|
69
68
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
70
|
-
children: _mapInstanceProperty__default[
|
|
69
|
+
children: _mapInstanceProperty__default["default"](_context = _filterInstanceProperty__default["default"](_context2 = _Object$entries__default["default"](props.errors) // Only render errors which have truthy values, to avoid
|
|
71
70
|
// rendering an error for, e.g. { missing: false }
|
|
72
71
|
).call(_context2, function (_ref) {
|
|
73
72
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
@@ -111,10 +110,10 @@ var FieldErrors = function FieldErrors(props) {
|
|
|
111
110
|
};
|
|
112
111
|
|
|
113
112
|
FieldErrors.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
114
|
-
errors: _pt__default[
|
|
115
|
-
isVisible: _pt__default[
|
|
116
|
-
renderError: _pt__default[
|
|
117
|
-
renderDefaultError: _pt__default[
|
|
113
|
+
errors: _pt__default["default"].objectOf(_pt__default["default"].bool),
|
|
114
|
+
isVisible: _pt__default["default"].bool,
|
|
115
|
+
renderError: _pt__default["default"].func,
|
|
116
|
+
renderDefaultError: _pt__default["default"].func
|
|
118
117
|
} : {};
|
|
119
118
|
FieldErrors.displayName = 'FieldErrors';
|
|
120
119
|
FieldErrors.errorTypes = {
|
|
@@ -124,8 +123,8 @@ FieldErrors.errorTypes = {
|
|
|
124
123
|
};
|
|
125
124
|
var FieldErrors$1 = FieldErrors;
|
|
126
125
|
|
|
127
|
-
// NOTE: This string will be replaced
|
|
128
|
-
var version =
|
|
126
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
127
|
+
var version = "13.0.0";
|
|
129
128
|
|
|
130
|
-
exports[
|
|
129
|
+
exports["default"] = FieldErrors$1;
|
|
131
130
|
exports.version = version;
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
6
6
|
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
7
|
-
var _typeof = require('@babel/runtime-corejs3/helpers/typeof');
|
|
8
7
|
require('prop-types');
|
|
9
8
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
10
9
|
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
@@ -52,12 +51,12 @@ var messages = reactIntl.defineMessages({
|
|
|
52
51
|
}
|
|
53
52
|
});
|
|
54
53
|
|
|
55
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
54
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); 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; }
|
|
56
55
|
|
|
57
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
56
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
58
57
|
|
|
59
58
|
var isObject = function isObject(obj) {
|
|
60
|
-
return
|
|
59
|
+
return typeof obj === 'object';
|
|
61
60
|
};
|
|
62
61
|
|
|
63
62
|
var FieldErrors = function FieldErrors(props) {
|
|
@@ -66,7 +65,7 @@ var FieldErrors = function FieldErrors(props) {
|
|
|
66
65
|
if (!props.isVisible) return null;
|
|
67
66
|
if (!props.errors || !isObject(props.errors)) return null;
|
|
68
67
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
69
|
-
children: _mapInstanceProperty__default[
|
|
68
|
+
children: _mapInstanceProperty__default["default"](_context = _filterInstanceProperty__default["default"](_context2 = _Object$entries__default["default"](props.errors) // Only render errors which have truthy values, to avoid
|
|
70
69
|
// rendering an error for, e.g. { missing: false }
|
|
71
70
|
).call(_context2, function (_ref) {
|
|
72
71
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
@@ -118,8 +117,8 @@ FieldErrors.errorTypes = {
|
|
|
118
117
|
};
|
|
119
118
|
var FieldErrors$1 = FieldErrors;
|
|
120
119
|
|
|
121
|
-
// NOTE: This string will be replaced
|
|
122
|
-
var version =
|
|
120
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
121
|
+
var version = "13.0.0";
|
|
123
122
|
|
|
124
|
-
exports[
|
|
123
|
+
exports["default"] = FieldErrors$1;
|
|
125
124
|
exports.version = version;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
|
|
2
2
|
import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
|
|
3
|
-
import _typeof from '@babel/runtime-corejs3/helpers/esm/typeof';
|
|
4
3
|
import _pt from 'prop-types';
|
|
5
4
|
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
6
5
|
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
|
|
@@ -35,12 +34,12 @@ var messages = defineMessages({
|
|
|
35
34
|
}
|
|
36
35
|
});
|
|
37
36
|
|
|
38
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object);
|
|
37
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
39
38
|
|
|
40
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
39
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
41
40
|
|
|
42
41
|
var isObject = function isObject(obj) {
|
|
43
|
-
return
|
|
42
|
+
return typeof obj === 'object';
|
|
44
43
|
};
|
|
45
44
|
|
|
46
45
|
var FieldErrors = function FieldErrors(props) {
|
|
@@ -106,7 +105,7 @@ FieldErrors.errorTypes = {
|
|
|
106
105
|
};
|
|
107
106
|
var FieldErrors$1 = FieldErrors;
|
|
108
107
|
|
|
109
|
-
// NOTE: This string will be replaced
|
|
110
|
-
var version =
|
|
108
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
109
|
+
var version = "13.0.0";
|
|
111
110
|
|
|
112
111
|
export { FieldErrors$1 as default, version };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { TFieldErrorsProps as FieldErrorsProps, TFieldErrors as FieldErrors } from './field-errors';
|
|
2
|
-
export declare type TFieldErrorsProps = FieldErrorsProps;
|
|
3
|
-
export declare type TFieldErrors = FieldErrors;
|
|
1
|
+
import type { TFieldErrorsProps as FieldErrorsProps, TFieldErrors as FieldErrors } from './field-errors';
|
|
2
|
+
export declare type TFieldErrorsProps = FieldErrorsProps;
|
|
3
|
+
export declare type TFieldErrors = FieldErrors;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
declare type TErrorRenderer = (key: string, error?: boolean) => ReactNode;
|
|
3
|
-
export declare type TFieldErrors = Record<string, boolean>;
|
|
4
|
-
export declare type TFieldErrorsProps = {
|
|
5
|
-
errors?: TFieldErrors;
|
|
6
|
-
isVisible?: boolean;
|
|
7
|
-
renderError?: TErrorRenderer;
|
|
8
|
-
renderDefaultError?: TErrorRenderer;
|
|
9
|
-
};
|
|
10
|
-
declare const FieldErrors: {
|
|
11
|
-
(props: TFieldErrorsProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
12
|
-
displayName: string;
|
|
13
|
-
errorTypes: {
|
|
14
|
-
MISSING: string;
|
|
15
|
-
NEGATIVE: string;
|
|
16
|
-
FRACTIONS: string;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export default FieldErrors;
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
declare type TErrorRenderer = (key: string, error?: boolean) => ReactNode;
|
|
3
|
+
export declare type TFieldErrors = Record<string, boolean>;
|
|
4
|
+
export declare type TFieldErrorsProps = {
|
|
5
|
+
errors?: TFieldErrors;
|
|
6
|
+
isVisible?: boolean;
|
|
7
|
+
renderError?: TErrorRenderer;
|
|
8
|
+
renderDefaultError?: TErrorRenderer;
|
|
9
|
+
};
|
|
10
|
+
declare const FieldErrors: {
|
|
11
|
+
(props: TFieldErrorsProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
displayName: string;
|
|
13
|
+
errorTypes: {
|
|
14
|
+
MISSING: string;
|
|
15
|
+
NEGATIVE: string;
|
|
16
|
+
FRACTIONS: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export default FieldErrors;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default } from './field-errors';
|
|
2
|
-
export { default as version } from './version';
|
|
3
|
-
export * from './export-types';
|
|
1
|
+
export { default } from './field-errors';
|
|
2
|
+
export { default as version } from './version';
|
|
3
|
+
export * from './export-types';
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
missingRequiredField: {
|
|
3
|
-
id: string;
|
|
4
|
-
description: string;
|
|
5
|
-
defaultMessage: string;
|
|
6
|
-
};
|
|
7
|
-
invalidNegativeNumber: {
|
|
8
|
-
id: string;
|
|
9
|
-
description: string;
|
|
10
|
-
defaultMessage: string;
|
|
11
|
-
};
|
|
12
|
-
invalidFractionalNumber: {
|
|
13
|
-
id: string;
|
|
14
|
-
description: string;
|
|
15
|
-
defaultMessage: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export default _default;
|
|
1
|
+
declare const _default: {
|
|
2
|
+
missingRequiredField: {
|
|
3
|
+
id: string;
|
|
4
|
+
description: string;
|
|
5
|
+
defaultMessage: string;
|
|
6
|
+
};
|
|
7
|
+
invalidNegativeNumber: {
|
|
8
|
+
id: string;
|
|
9
|
+
description: string;
|
|
10
|
+
defaultMessage: string;
|
|
11
|
+
};
|
|
12
|
+
invalidFractionalNumber: {
|
|
13
|
+
id: string;
|
|
14
|
+
description: string;
|
|
15
|
+
defaultMessage: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default _default;
|
|
@@ -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/field-errors",
|
|
3
3
|
"description": "Renders errors based on configuration.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "13.0.0",
|
|
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,20 +18,17 @@
|
|
|
19
18
|
"main": "dist/commercetools-uikit-field-errors.cjs.js",
|
|
20
19
|
"module": "dist/commercetools-uikit-field-errors.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/messages": "
|
|
22
|
+
"@babel/runtime": "7.17.2",
|
|
23
|
+
"@babel/runtime-corejs3": "7.17.2",
|
|
24
|
+
"@commercetools-uikit/messages": "13.0.0",
|
|
29
25
|
"@emotion/react": "^11.4.0",
|
|
30
26
|
"@emotion/styled": "^11.3.0",
|
|
31
|
-
"prop-types": "15.
|
|
27
|
+
"prop-types": "15.8.1"
|
|
32
28
|
},
|
|
33
29
|
"devDependencies": {
|
|
34
30
|
"react": "17.0.2",
|
|
35
|
-
"react-intl": "5.
|
|
31
|
+
"react-intl": "5.24.6"
|
|
36
32
|
},
|
|
37
33
|
"peerDependencies": {
|
|
38
34
|
"react": "17.x",
|