@gravity-ui/dynamic-forms 1.10.0 → 1.11.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/build/cjs/lib/kit/components/Card/Card.js +1 -2
- package/build/cjs/lib/kit/components/Inputs/MonacoInput/MonacoHeader.css +1 -1
- package/build/cjs/lib/kit/components/Inputs/TextArea/TextArea.js +1 -1
- package/build/cjs/lib/kit/components/Layouts/Row/Row.js +3 -4
- package/build/cjs/lib/kit/components/Layouts/Section/Section.js +2 -2
- package/build/cjs/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.js +1 -2
- package/build/cjs/lib/kit/utils/common.js +2 -1
- package/build/esm/lib/kit/components/Card/Card.js +1 -2
- package/build/esm/lib/kit/components/Inputs/MonacoInput/MonacoHeader.css +1 -1
- package/build/esm/lib/kit/components/Inputs/TextArea/TextArea.js +2 -2
- package/build/esm/lib/kit/components/Layouts/Row/Row.js +1 -2
- package/build/esm/lib/kit/components/Layouts/Section/Section.js +1 -1
- package/build/esm/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.js +1 -2
- package/build/esm/lib/kit/utils/common.js +3 -2
- package/package.json +4 -5
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Card = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const components_1 = require("@gravity-ui/components");
|
|
7
6
|
const icons_1 = require("@gravity-ui/icons");
|
|
8
7
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
9
8
|
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
@@ -35,7 +34,7 @@ const Card = ({ name, title: propsTitle, description, actions, open: propsOpen,
|
|
|
35
34
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
36
35
|
react_1.default.createElement("div", { className: b('title') }, propsTitle),
|
|
37
36
|
description ? (react_1.default.createElement("div", { className: b('note') },
|
|
38
|
-
react_1.default.createElement(
|
|
37
|
+
react_1.default.createElement(uikit_1.HelpPopover, { htmlContent: description, placement: ['bottom', 'top'] }))) : null));
|
|
39
38
|
}
|
|
40
39
|
return propsTitle;
|
|
41
40
|
}, [propsTitle, description]);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
justify-content: space-between;
|
|
5
5
|
padding: 15px;
|
|
6
6
|
align-items: center;
|
|
7
|
-
background-color: var(--yc-color-
|
|
7
|
+
background-color: var(--yc-color-private-black-50-solid);
|
|
8
8
|
}
|
|
9
9
|
.df-monaco-header_card {
|
|
10
10
|
border-bottom: 1px solid var(--yc-color-line-generic);
|
|
@@ -6,6 +6,6 @@ const react_1 = tslib_1.__importDefault(require("react"));
|
|
|
6
6
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
7
7
|
const TextArea = ({ name, input, spec }) => {
|
|
8
8
|
const { value, onBlur, onChange, onFocus } = input;
|
|
9
|
-
return (react_1.default.createElement(uikit_1.
|
|
9
|
+
return (react_1.default.createElement(uikit_1.TextInput, { value: value, onBlur: onBlur, onFocus: onFocus, onUpdate: onChange, maxRows: 20, minRows: 8, hasClear: true, disabled: spec.viewSpec.disabled, multiline: true, placeholder: spec.viewSpec.placeholder, qa: name }));
|
|
10
10
|
};
|
|
11
11
|
exports.TextArea = TextArea;
|
|
@@ -3,11 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RowVerbose = exports.Row = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const components_1 = require("@gravity-ui/components");
|
|
7
6
|
const icons_1 = require("@gravity-ui/icons");
|
|
8
7
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
9
8
|
const core_1 = require("../../../../core");
|
|
10
|
-
const
|
|
9
|
+
const components_1 = require("../../../components");
|
|
11
10
|
const utils_1 = require("../../../utils");
|
|
12
11
|
const b = (0, utils_1.block)('row');
|
|
13
12
|
const RowBase = ({ name, spec, input, meta, verboseDescription, children, }) => {
|
|
@@ -18,10 +17,10 @@ const RowBase = ({ name, spec, input, meta, verboseDescription, children, }) =>
|
|
|
18
17
|
react_1.default.createElement("span", { className: b('title', { required: spec.required }) }, spec.viewSpec.layoutTitle),
|
|
19
18
|
!verboseDescription && spec.viewSpec.layoutDescription ? (react_1.default.createElement("span", { className: b('note') },
|
|
20
19
|
react_1.default.createElement("span", { className: b('note-inner') },
|
|
21
|
-
react_1.default.createElement(
|
|
20
|
+
react_1.default.createElement(uikit_1.HelpPopover, { htmlContent: spec.viewSpec.layoutDescription, placement: ['bottom', 'top'] })))) : null)),
|
|
22
21
|
react_1.default.createElement("div", { className: b('right') },
|
|
23
22
|
react_1.default.createElement("div", { className: b('right-inner') },
|
|
24
|
-
react_1.default.createElement(
|
|
23
|
+
react_1.default.createElement(components_1.ErrorWrapper, { name: name, meta: meta, withoutChildErrorStyles: (0, core_1.isArraySpec)(spec) || (0, core_1.isObjectSpec)(spec) }, children),
|
|
25
24
|
arrayItem ? (react_1.default.createElement(uikit_1.Button, { view: "flat", className: b('remove-button'), onClick: input.onDrop, qa: `${name}-remove-item` },
|
|
26
25
|
react_1.default.createElement(uikit_1.Icon, { data: icons_1.Xmark, size: 16 }))) : null),
|
|
27
26
|
verboseDescription && spec.viewSpec.layoutDescription ? (react_1.default.createElement("div", { className: b('description'), dangerouslySetInnerHTML: { __html: spec.viewSpec.layoutDescription } })) : null)));
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Group2 = exports.Group = exports.SectionWithSubtitle2 = exports.SectionWithSubtitle = exports.Section2 = exports.Section = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const
|
|
6
|
+
const uikit_1 = require("@gravity-ui/uikit");
|
|
7
7
|
const __1 = require("../../");
|
|
8
8
|
const __2 = require("../../../");
|
|
9
9
|
const core_1 = require("../../../../core");
|
|
@@ -29,7 +29,7 @@ const SectionBase = (_a) => {
|
|
|
29
29
|
}
|
|
30
30
|
else {
|
|
31
31
|
description = (react_1.default.createElement("div", { className: b('note') },
|
|
32
|
-
react_1.default.createElement(
|
|
32
|
+
react_1.default.createElement(uikit_1.HelpPopover, { htmlContent: spec.viewSpec.layoutDescription, placement: ['bottom', 'top'] })));
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
return (react_1.default.createElement("section", { className: b() },
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SimpleVerticalAccordeon = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
const components_1 = require("@gravity-ui/components");
|
|
7
6
|
const icons_1 = require("@gravity-ui/icons");
|
|
8
7
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
9
8
|
const utils_1 = require("../../utils");
|
|
@@ -73,7 +72,7 @@ class SimpleVerticalAccordeon extends react_1.default.Component {
|
|
|
73
72
|
getTooltip() {
|
|
74
73
|
const { note } = this.props;
|
|
75
74
|
return note ? (react_1.default.createElement("span", { className: b('tooltip') },
|
|
76
|
-
react_1.default.createElement(
|
|
75
|
+
react_1.default.createElement(uikit_1.HelpPopover, { htmlContent: note, placement: ['bottom', 'top'] }))) : null;
|
|
77
76
|
}
|
|
78
77
|
}
|
|
79
78
|
exports.SimpleVerticalAccordeon = SimpleVerticalAccordeon;
|
|
@@ -52,7 +52,8 @@ const prepareSpec = (spec, parseJsonDefaultValue) => {
|
|
|
52
52
|
_defaultValue = undefined;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
if (typeof _defaultValue === result.type
|
|
55
|
+
if (typeof _defaultValue === result.type ||
|
|
56
|
+
(lodash_1.default.isArray(_defaultValue) && result.type === core_1.SpecTypes.Array)) {
|
|
56
57
|
result.defaultValue = _defaultValue;
|
|
57
58
|
}
|
|
58
59
|
else {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { HelpPopover } from '@gravity-ui/components';
|
|
3
2
|
import { ChevronDown } from '@gravity-ui/icons';
|
|
4
|
-
import { Button, Card as CardBase, Icon } from '@gravity-ui/uikit';
|
|
3
|
+
import { Button, Card as CardBase, HelpPopover, Icon } from '@gravity-ui/uikit';
|
|
5
4
|
import _ from 'lodash';
|
|
6
5
|
import { block } from '../../utils';
|
|
7
6
|
import './Card.css';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
justify-content: space-between;
|
|
5
5
|
padding: 15px;
|
|
6
6
|
align-items: center;
|
|
7
|
-
background-color: var(--yc-color-
|
|
7
|
+
background-color: var(--yc-color-private-black-50-solid);
|
|
8
8
|
}
|
|
9
9
|
.df-monaco-header_card {
|
|
10
10
|
border-bottom: 1px solid var(--yc-color-line-generic);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { TextInput as TextInputBase } from '@gravity-ui/uikit';
|
|
3
3
|
export const TextArea = ({ name, input, spec }) => {
|
|
4
4
|
const { value, onBlur, onChange, onFocus } = input;
|
|
5
|
-
return (React.createElement(
|
|
5
|
+
return (React.createElement(TextInputBase, { value: value, onBlur: onBlur, onFocus: onFocus, onUpdate: onChange, maxRows: 20, minRows: 8, hasClear: true, disabled: spec.viewSpec.disabled, multiline: true, placeholder: spec.viewSpec.placeholder, qa: name }));
|
|
6
6
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { HelpPopover } from '@gravity-ui/components';
|
|
3
2
|
import { Xmark } from '@gravity-ui/icons';
|
|
4
|
-
import { Button, Icon } from '@gravity-ui/uikit';
|
|
3
|
+
import { Button, HelpPopover, Icon } from '@gravity-ui/uikit';
|
|
5
4
|
import { isArrayItem, isArraySpec, isObjectSpec, } from '../../../../core';
|
|
6
5
|
import { ErrorWrapper } from '../../../components';
|
|
7
6
|
import { block } from '../../../utils';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { HelpPopover } from '@gravity-ui/
|
|
3
|
+
import { HelpPopover } from '@gravity-ui/uikit';
|
|
4
4
|
import { GroupIndent } from '../../';
|
|
5
5
|
import { ErrorWrapper } from '../../../';
|
|
6
6
|
import { isArraySpec, isObjectSpec, } from '../../../../core';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { HelpPopover } from '@gravity-ui/components';
|
|
3
2
|
import { ChevronDown } from '@gravity-ui/icons';
|
|
4
|
-
import { Button, Icon } from '@gravity-ui/uikit';
|
|
3
|
+
import { Button, HelpPopover, Icon } from '@gravity-ui/uikit';
|
|
5
4
|
import { block } from '../../utils';
|
|
6
5
|
import './SimpleVerticalAccordeon.css';
|
|
7
6
|
const b = block('simple-vertical-accordeon');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
|
-
import { isArraySpec, isObjectSpec, isStringSpec, } from '../../core';
|
|
2
|
+
import { SpecTypes, isArraySpec, isObjectSpec, isStringSpec, } from '../../core';
|
|
3
3
|
import { isFloat } from '../validators/helpers';
|
|
4
4
|
import { divide } from './bigIntMath';
|
|
5
5
|
export const isNotEmptyValue = (value, spec) => {
|
|
@@ -47,7 +47,8 @@ export const prepareSpec = (spec, parseJsonDefaultValue) => {
|
|
|
47
47
|
_defaultValue = undefined;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
if (typeof _defaultValue === result.type
|
|
50
|
+
if (typeof _defaultValue === result.type ||
|
|
51
|
+
(_.isArray(_defaultValue) && result.type === SpecTypes.Array)) {
|
|
51
52
|
result.defaultValue = _defaultValue;
|
|
52
53
|
}
|
|
53
54
|
else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/dynamic-forms",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "build/cjs/index.js",
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
"prepublishOnly": "npm run build"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@gravity-ui/components": "^2.0.0",
|
|
41
40
|
"@gravity-ui/i18n": "^1.0.0",
|
|
42
41
|
"@gravity-ui/icons": "^2.1.0",
|
|
43
42
|
"bem-cn-lite": "^4.0.0",
|
|
@@ -48,11 +47,11 @@
|
|
|
48
47
|
"@babel/preset-typescript": "^7.18.6",
|
|
49
48
|
"@commitlint/cli": "^17.0.0",
|
|
50
49
|
"@commitlint/config-conventional": "^17.0.0",
|
|
51
|
-
"@gravity-ui/eslint-config": "^2.
|
|
50
|
+
"@gravity-ui/eslint-config": "^2.0.0",
|
|
52
51
|
"@gravity-ui/prettier-config": "^1.0.1",
|
|
53
52
|
"@gravity-ui/stylelint-config": "^2.0.0",
|
|
54
53
|
"@gravity-ui/tsconfig": "^1.0.0",
|
|
55
|
-
"@gravity-ui/uikit": "^
|
|
54
|
+
"@gravity-ui/uikit": "^4.10.0",
|
|
56
55
|
"@storybook/addon-essentials": "^7.0.27",
|
|
57
56
|
"@storybook/preset-scss": "^1.0.3",
|
|
58
57
|
"@storybook/react": "^7.0.27",
|
|
@@ -98,7 +97,7 @@
|
|
|
98
97
|
"typescript": "^4.9.5"
|
|
99
98
|
},
|
|
100
99
|
"peerDependencies": {
|
|
101
|
-
"@gravity-ui/uikit": "^
|
|
100
|
+
"@gravity-ui/uikit": "^4.0.0",
|
|
102
101
|
"final-form": "^4.20.2",
|
|
103
102
|
"react": "^16.0.0 || ^17.0.0 || ^18.0.0",
|
|
104
103
|
"react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0",
|