@gravity-ui/dynamic-forms 5.9.0 → 5.9.2
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/build/cjs/lib/core/components/Form/Controller/utils.js +2 -2
- package/build/cjs/lib/kit/components/Inputs/TextContent/TextContent.css +1 -0
- package/build/esm/lib/core/components/Form/Controller/utils.js +2 -2
- package/build/esm/lib/kit/components/Inputs/TextContent/TextContent.css +1 -0
- package/package.json +2 -2
|
@@ -113,7 +113,7 @@ const getFieldInitials = ({ name, spec, valueFromParent, initialValue, validate,
|
|
|
113
113
|
value = valueMutator.value;
|
|
114
114
|
}
|
|
115
115
|
if ((0, isNil_1.default)(value)) {
|
|
116
|
-
if (spec.defaultValue) {
|
|
116
|
+
if (!(0, isNil_1.default)(spec.defaultValue)) {
|
|
117
117
|
value = (0, utils_1.transformArrIn)(spec.defaultValue);
|
|
118
118
|
}
|
|
119
119
|
// if the spec with type array or object, and this spec has "required === true",
|
|
@@ -156,7 +156,7 @@ const getFieldMethods = () => {
|
|
|
156
156
|
const error = (validate === null || validate === void 0 ? void 0 : validate((0, utils_1.transformArrOut)(_value))) || errorMutator;
|
|
157
157
|
let value = (0, utils_1.transformArrIn)(_value);
|
|
158
158
|
if ((0, helpers_1.isNumberSpec)(spec) && !error) {
|
|
159
|
-
value = (value ? Number(value)
|
|
159
|
+
value = ((0, isNil_1.default)(value) || value === '' ? undefined : Number(value));
|
|
160
160
|
}
|
|
161
161
|
let newChildErrors = Object.assign({}, state.childErrors);
|
|
162
162
|
if (childErrors) {
|
|
@@ -103,7 +103,7 @@ export const getFieldInitials = ({ name, spec, valueFromParent, initialValue, va
|
|
|
103
103
|
value = valueMutator.value;
|
|
104
104
|
}
|
|
105
105
|
if (isNil(value)) {
|
|
106
|
-
if (spec.defaultValue) {
|
|
106
|
+
if (!isNil(spec.defaultValue)) {
|
|
107
107
|
value = transformArrIn(spec.defaultValue);
|
|
108
108
|
}
|
|
109
109
|
// if the spec with type array or object, and this spec has "required === true",
|
|
@@ -145,7 +145,7 @@ export const getFieldMethods = () => {
|
|
|
145
145
|
const error = (validate === null || validate === void 0 ? void 0 : validate(transformArrOut(_value))) || errorMutator;
|
|
146
146
|
let value = transformArrIn(_value);
|
|
147
147
|
if (isNumberSpec(spec) && !error) {
|
|
148
|
-
value = (value ? Number(value)
|
|
148
|
+
value = (isNil(value) || value === '' ? undefined : Number(value));
|
|
149
149
|
}
|
|
150
150
|
let newChildErrors = Object.assign({}, state.childErrors);
|
|
151
151
|
if (childErrors) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/dynamic-forms",
|
|
3
|
-
"version": "5.9.
|
|
3
|
+
"version": "5.9.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "build/cjs/index.js",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@gravity-ui/prettier-config": "^1.1.0",
|
|
61
61
|
"@gravity-ui/stylelint-config": "^4.0.1",
|
|
62
62
|
"@gravity-ui/tsconfig": "^1.0.0",
|
|
63
|
-
"@gravity-ui/uikit": "^7.
|
|
63
|
+
"@gravity-ui/uikit": "^7.25.0",
|
|
64
64
|
"@playwright/experimental-ct-react": "^1.40.0",
|
|
65
65
|
"@playwright/test": "^1.40.0",
|
|
66
66
|
"@storybook/addon-essentials": "^8.6.4",
|