@gravity-ui/dynamic-forms 1.0.1 → 1.1.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/CHANGELOG.md +19 -0
- package/build/cjs/lib/core/components/Form/hooks/useField.js +10 -2
- package/build/cjs/lib/core/components/Form/hooks/useStore.js +1 -8
- package/build/cjs/lib/kit/components/Layouts/Row/Row.css +9 -0
- package/build/cjs/lib/kit/components/Layouts/Row/Row.js +11 -6
- package/build/cjs/lib/kit/constants/config.js +5 -0
- package/build/esm/lib/core/components/Form/hooks/useField.js +10 -2
- package/build/esm/lib/core/components/Form/hooks/useStore.d.ts +0 -1
- package/build/esm/lib/core/components/Form/hooks/useStore.js +1 -8
- package/build/esm/lib/core/components/Form/types/context.d.ts +0 -1
- package/build/esm/lib/kit/components/Layouts/Row/Row.css +9 -0
- package/build/esm/lib/kit/components/Layouts/Row/Row.d.ts +2 -1
- package/build/esm/lib/kit/components/Layouts/Row/Row.js +9 -5
- package/build/esm/lib/kit/constants/config.js +6 -1
- package/package.json +8 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.1.0](https://github.com/gravity-ui/dynamic-forms/compare/v1.0.2...v1.1.0) (2023-03-19)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add `row_verbose` layout ([#7](https://github.com/gravity-ui/dynamic-forms/issues/7)) ([a3030e1](https://github.com/gravity-ui/dynamic-forms/commit/a3030e105708c41211339d8ddd0b21e0b16cebfa))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* fix store errors ([#11](https://github.com/gravity-ui/dynamic-forms/issues/11)) ([3ed0d8e](https://github.com/gravity-ui/dynamic-forms/commit/3ed0d8e7cb4faefad351c5551b48461e7f6fd529))
|
|
14
|
+
|
|
15
|
+
## [1.0.2](https://github.com/gravity-ui/dynamic-forms/compare/v1.0.1...v1.0.2) (2023-03-15)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* updated package.json ([#5](https://github.com/gravity-ui/dynamic-forms/issues/5)) ([233053d](https://github.com/gravity-ui/dynamic-forms/commit/233053dbdef63a2416f3abd442dcda9cdd0ff3de))
|
|
21
|
+
|
|
3
22
|
## [1.0.1](https://github.com/gravity-ui/dynamic-forms/compare/v1.0.0...v1.0.1) (2023-03-14)
|
|
4
23
|
|
|
5
24
|
|
|
@@ -53,7 +53,15 @@ const useField = ({ name, spec, initialValue, validate: propsValidate, tools, pa
|
|
|
53
53
|
const _value = lodash_1.default.isFunction(valOrSetter) ? valOrSetter(state.value) : valOrSetter;
|
|
54
54
|
const error = validate === null || validate === void 0 ? void 0 : validate(_value);
|
|
55
55
|
const value = (0, helpers_2.transformArrIn)(_value);
|
|
56
|
-
|
|
56
|
+
let newChildErrors = Object.assign({}, state.childErrors);
|
|
57
|
+
if (childErrors) {
|
|
58
|
+
const nearestChildName = lodash_1.default.keys(childErrors).sort((a, b) => a.length - b.length)[0];
|
|
59
|
+
if (nearestChildName) {
|
|
60
|
+
const existingСhildNames = lodash_1.default.keys(newChildErrors).filter((childName) => childName.startsWith(nearestChildName));
|
|
61
|
+
newChildErrors = Object.assign(Object.assign({}, lodash_1.default.omit(newChildErrors, existingСhildNames)), childErrors);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return Object.assign(Object.assign({}, state), { dirty: !lodash_1.default.isEqual(value, initialValue), error, invalid: Boolean(error), modified: true, pristine: value === initialValue, touched: true, valid: !error, value, visited: true, childErrors: newChildErrors });
|
|
57
65
|
});
|
|
58
66
|
};
|
|
59
67
|
const onDrop = () => {
|
|
@@ -125,7 +133,7 @@ const useField = ({ name, spec, initialValue, validate: propsValidate, tools, pa
|
|
|
125
133
|
react_1.default.useEffect(() => {
|
|
126
134
|
firstRenderRef.current = false;
|
|
127
135
|
return () => {
|
|
128
|
-
tools.
|
|
136
|
+
(parentOnChange ? parentOnChange : tools.onChange)(name, state.value, { [name]: false });
|
|
129
137
|
};
|
|
130
138
|
}, []);
|
|
131
139
|
return renderProps;
|
|
@@ -5,7 +5,6 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
7
7
|
const react_final_form_1 = require("react-final-form");
|
|
8
|
-
const constants_1 = require("../constants");
|
|
9
8
|
const helpers_1 = require("../helpers");
|
|
10
9
|
const useStore = (name) => {
|
|
11
10
|
const form = (0, react_final_form_1.useForm)();
|
|
@@ -50,13 +49,7 @@ const useStore = (name) => {
|
|
|
50
49
|
}, [store.name, store.errors]);
|
|
51
50
|
const tools = react_1.default.useMemo(() => ({
|
|
52
51
|
initialValue: store.initialValue,
|
|
53
|
-
onChange: (name, value, errors) => setStore((store) => (Object.assign(Object.assign({}, store), { values: lodash_1.default.set(Object.assign({}, store.values), name, value), errors:
|
|
54
|
-
onUnmount: (name) => setStore((store) => {
|
|
55
|
-
const value = lodash_1.default.get(store.values, name);
|
|
56
|
-
const values = value && value !== constants_1.REMOVED_ITEM
|
|
57
|
-
? Object.assign({}, lodash_1.default.set(store.values, name, undefined)) : store.values;
|
|
58
|
-
return Object.assign(Object.assign({}, store), { values, errors: Object.assign({}, lodash_1.default.omit(store.errors, Object.keys(store.errors).filter((key) => key.startsWith(name)))) });
|
|
59
|
-
}),
|
|
52
|
+
onChange: (name, value, errors) => setStore((store) => (Object.assign(Object.assign({}, store), { values: lodash_1.default.set(Object.assign({}, store.values), name, value), errors: errors || {} }))),
|
|
60
53
|
submitFailed,
|
|
61
54
|
}), [store.initialValue, setStore, submitFailed]);
|
|
62
55
|
const change = react_1.default.useCallback(lodash_1.default.debounce((value) => {
|
|
@@ -43,9 +43,18 @@
|
|
|
43
43
|
}
|
|
44
44
|
.df-row__right {
|
|
45
45
|
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
46
47
|
flex-grow: 1;
|
|
47
48
|
margin-left: 15px;
|
|
48
49
|
}
|
|
50
|
+
.df-row__right-inner {
|
|
51
|
+
display: flex;
|
|
52
|
+
}
|
|
53
|
+
.df-row__description {
|
|
54
|
+
margin-top: 10px;
|
|
55
|
+
color: var(--yc-color-text-secondary);
|
|
56
|
+
word-break: break-word;
|
|
57
|
+
}
|
|
49
58
|
.df-row__remove-button {
|
|
50
59
|
margin-left: 5px;
|
|
51
60
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Row = void 0;
|
|
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
6
|
const icons_1 = require("@gravity-ui/icons");
|
|
@@ -9,7 +9,7 @@ const core_1 = require("../../../../core");
|
|
|
9
9
|
const components_1 = require("../../../components");
|
|
10
10
|
const utils_1 = require("../../../utils");
|
|
11
11
|
const b = (0, utils_1.block)('row');
|
|
12
|
-
const
|
|
12
|
+
const RowBase = ({ name, spec, input, meta, verboseDescription, children, }) => {
|
|
13
13
|
const arrayItem = react_1.default.useMemo(() => (0, core_1.isArrayItem)(name), [name]);
|
|
14
14
|
return (react_1.default.createElement("div", { className: b({ 'extra-width': (0, core_1.isArraySpec)(spec) || arrayItem }) },
|
|
15
15
|
react_1.default.createElement("div", { className: b('left') },
|
|
@@ -17,11 +17,16 @@ const Row = ({ name, spec, input, meta, children, }) => {
|
|
|
17
17
|
react_1.default.createElement("div", { className: b('title') },
|
|
18
18
|
spec.viewSpec.layoutTitle,
|
|
19
19
|
spec.required && react_1.default.createElement("span", { className: b('required-mark') }, "*")),
|
|
20
|
-
spec.viewSpec.layoutDescription ? (react_1.default.createElement("div", { className: b('note') },
|
|
20
|
+
!verboseDescription && spec.viewSpec.layoutDescription ? (react_1.default.createElement("div", { className: b('note') },
|
|
21
21
|
react_1.default.createElement(uikit_1.HelpPopover, { htmlContent: spec.viewSpec.layoutDescription, placement: ['bottom', 'top'] }))) : null)),
|
|
22
22
|
react_1.default.createElement("div", { className: b('right') },
|
|
23
|
-
react_1.default.createElement(
|
|
24
|
-
|
|
25
|
-
react_1.default.createElement(uikit_1.
|
|
23
|
+
react_1.default.createElement("div", { className: b('right-inner') },
|
|
24
|
+
react_1.default.createElement(components_1.ErrorWrapper, { name: name, meta: meta, withoutChildErrorStyles: (0, core_1.isArraySpec)(spec) || (0, core_1.isObjectSpec)(spec) }, children),
|
|
25
|
+
arrayItem ? (react_1.default.createElement(uikit_1.Button, { view: "flat", className: b('remove-button'), onClick: input.onDrop },
|
|
26
|
+
react_1.default.createElement(uikit_1.Icon, { data: icons_1.Xmark, size: 16 }))) : null),
|
|
27
|
+
verboseDescription && spec.viewSpec.layoutDescription ? (react_1.default.createElement("div", { className: b('description'), dangerouslySetInnerHTML: { __html: spec.viewSpec.layoutDescription } })) : null)));
|
|
26
28
|
};
|
|
29
|
+
const Row = (props) => (react_1.default.createElement(RowBase, Object.assign({}, props)));
|
|
27
30
|
exports.Row = Row;
|
|
31
|
+
const RowVerbose = (props) => (react_1.default.createElement(RowBase, Object.assign({ verboseDescription: true }, props)));
|
|
32
|
+
exports.RowVerbose = RowVerbose;
|
|
@@ -12,6 +12,7 @@ exports.dynamicConfig = {
|
|
|
12
12
|
},
|
|
13
13
|
layouts: {
|
|
14
14
|
row: components_1.Row,
|
|
15
|
+
row_verbose: components_1.RowVerbose,
|
|
15
16
|
accordeon: components_1.Accordeon,
|
|
16
17
|
section: components_1.Section,
|
|
17
18
|
section2: components_1.Section2,
|
|
@@ -32,6 +33,7 @@ exports.dynamicConfig = {
|
|
|
32
33
|
},
|
|
33
34
|
layouts: {
|
|
34
35
|
row: components_1.Row,
|
|
36
|
+
row_verbose: components_1.RowVerbose,
|
|
35
37
|
table_item: components_1.TableCell,
|
|
36
38
|
},
|
|
37
39
|
validators: {
|
|
@@ -44,6 +46,7 @@ exports.dynamicConfig = {
|
|
|
44
46
|
},
|
|
45
47
|
layouts: {
|
|
46
48
|
row: components_1.Row,
|
|
49
|
+
row_verbose: components_1.RowVerbose,
|
|
47
50
|
table_item: components_1.TableCell,
|
|
48
51
|
transparent: components_1.Transparent,
|
|
49
52
|
},
|
|
@@ -60,6 +63,7 @@ exports.dynamicConfig = {
|
|
|
60
63
|
},
|
|
61
64
|
layouts: {
|
|
62
65
|
row: components_1.Row,
|
|
66
|
+
row_verbose: components_1.RowVerbose,
|
|
63
67
|
accordeon: components_1.Accordeon,
|
|
64
68
|
section: components_1.Section,
|
|
65
69
|
section2: components_1.Section2,
|
|
@@ -85,6 +89,7 @@ exports.dynamicConfig = {
|
|
|
85
89
|
},
|
|
86
90
|
layouts: {
|
|
87
91
|
row: components_1.Row,
|
|
92
|
+
row_verbose: components_1.RowVerbose,
|
|
88
93
|
table_item: components_1.TableCell,
|
|
89
94
|
transparent: components_1.Transparent,
|
|
90
95
|
section: components_1.Section,
|
|
@@ -49,7 +49,15 @@ export const useField = ({ name, spec, initialValue, validate: propsValidate, to
|
|
|
49
49
|
const _value = _.isFunction(valOrSetter) ? valOrSetter(state.value) : valOrSetter;
|
|
50
50
|
const error = validate === null || validate === void 0 ? void 0 : validate(_value);
|
|
51
51
|
const value = transformArrIn(_value);
|
|
52
|
-
|
|
52
|
+
let newChildErrors = Object.assign({}, state.childErrors);
|
|
53
|
+
if (childErrors) {
|
|
54
|
+
const nearestChildName = _.keys(childErrors).sort((a, b) => a.length - b.length)[0];
|
|
55
|
+
if (nearestChildName) {
|
|
56
|
+
const existingСhildNames = _.keys(newChildErrors).filter((childName) => childName.startsWith(nearestChildName));
|
|
57
|
+
newChildErrors = Object.assign(Object.assign({}, _.omit(newChildErrors, existingСhildNames)), childErrors);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return Object.assign(Object.assign({}, state), { dirty: !_.isEqual(value, initialValue), error, invalid: Boolean(error), modified: true, pristine: value === initialValue, touched: true, valid: !error, value, visited: true, childErrors: newChildErrors });
|
|
53
61
|
});
|
|
54
62
|
};
|
|
55
63
|
const onDrop = () => {
|
|
@@ -121,7 +129,7 @@ export const useField = ({ name, spec, initialValue, validate: propsValidate, to
|
|
|
121
129
|
React.useEffect(() => {
|
|
122
130
|
firstRenderRef.current = false;
|
|
123
131
|
return () => {
|
|
124
|
-
tools.
|
|
132
|
+
(parentOnChange ? parentOnChange : tools.onChange)(name, state.value, { [name]: false });
|
|
125
133
|
};
|
|
126
134
|
}, []);
|
|
127
135
|
return renderProps;
|
|
@@ -9,7 +9,6 @@ export declare const useStore: (name: string) => {
|
|
|
9
9
|
tools: {
|
|
10
10
|
initialValue: FieldObjectValue;
|
|
11
11
|
onChange: (name: string, value: FieldValue, errors?: Record<string, ValidateError>) => void;
|
|
12
|
-
onUnmount: (name: string) => void;
|
|
13
12
|
submitFailed: boolean;
|
|
14
13
|
};
|
|
15
14
|
watcher: JSX.Element;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import _ from 'lodash';
|
|
3
3
|
import { Field as FinalFormField, useForm } from 'react-final-form';
|
|
4
|
-
import { REMOVED_ITEM } from '../constants';
|
|
5
4
|
import { transformArrIn, transformArrOut } from '../helpers';
|
|
6
5
|
export const useStore = (name) => {
|
|
7
6
|
const form = useForm();
|
|
@@ -46,13 +45,7 @@ export const useStore = (name) => {
|
|
|
46
45
|
}, [store.name, store.errors]);
|
|
47
46
|
const tools = React.useMemo(() => ({
|
|
48
47
|
initialValue: store.initialValue,
|
|
49
|
-
onChange: (name, value, errors) => setStore((store) => (Object.assign(Object.assign({}, store), { values: _.set(Object.assign({}, store.values), name, value), errors:
|
|
50
|
-
onUnmount: (name) => setStore((store) => {
|
|
51
|
-
const value = _.get(store.values, name);
|
|
52
|
-
const values = value && value !== REMOVED_ITEM
|
|
53
|
-
? Object.assign({}, _.set(store.values, name, undefined)) : store.values;
|
|
54
|
-
return Object.assign(Object.assign({}, store), { values, errors: Object.assign({}, _.omit(store.errors, Object.keys(store.errors).filter((key) => key.startsWith(name)))) });
|
|
55
|
-
}),
|
|
48
|
+
onChange: (name, value, errors) => setStore((store) => (Object.assign(Object.assign({}, store), { values: _.set(Object.assign({}, store.values), name, value), errors: errors || {} }))),
|
|
56
49
|
submitFailed,
|
|
57
50
|
}), [store.initialValue, setStore, submitFailed]);
|
|
58
51
|
const change = React.useCallback(_.debounce((value) => {
|
|
@@ -43,9 +43,18 @@
|
|
|
43
43
|
}
|
|
44
44
|
.df-row__right {
|
|
45
45
|
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
46
47
|
flex-grow: 1;
|
|
47
48
|
margin-left: 15px;
|
|
48
49
|
}
|
|
50
|
+
.df-row__right-inner {
|
|
51
|
+
display: flex;
|
|
52
|
+
}
|
|
53
|
+
.df-row__description {
|
|
54
|
+
margin-top: 10px;
|
|
55
|
+
color: var(--yc-color-text-secondary);
|
|
56
|
+
word-break: break-word;
|
|
57
|
+
}
|
|
49
58
|
.df-row__remove-button {
|
|
50
59
|
margin-left: 5px;
|
|
51
60
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { FieldValue, LayoutProps, Spec } from '../../../../core';
|
|
2
2
|
import './Row.css';
|
|
3
|
-
export declare const Row: <T extends FieldValue, S extends Spec>(
|
|
3
|
+
export declare const Row: <T extends FieldValue, S extends Spec>(props: LayoutProps<T, S>) => JSX.Element;
|
|
4
|
+
export declare const RowVerbose: <T extends FieldValue, S extends Spec>(props: LayoutProps<T, S>) => JSX.Element;
|
|
@@ -6,7 +6,7 @@ import { ErrorWrapper } from '../../../components';
|
|
|
6
6
|
import { block } from '../../../utils';
|
|
7
7
|
import './Row.css';
|
|
8
8
|
const b = block('row');
|
|
9
|
-
|
|
9
|
+
const RowBase = ({ name, spec, input, meta, verboseDescription, children, }) => {
|
|
10
10
|
const arrayItem = React.useMemo(() => isArrayItem(name), [name]);
|
|
11
11
|
return (React.createElement("div", { className: b({ 'extra-width': isArraySpec(spec) || arrayItem }) },
|
|
12
12
|
React.createElement("div", { className: b('left') },
|
|
@@ -14,10 +14,14 @@ export const Row = ({ name, spec, input, meta, children, }) => {
|
|
|
14
14
|
React.createElement("div", { className: b('title') },
|
|
15
15
|
spec.viewSpec.layoutTitle,
|
|
16
16
|
spec.required && React.createElement("span", { className: b('required-mark') }, "*")),
|
|
17
|
-
spec.viewSpec.layoutDescription ? (React.createElement("div", { className: b('note') },
|
|
17
|
+
!verboseDescription && spec.viewSpec.layoutDescription ? (React.createElement("div", { className: b('note') },
|
|
18
18
|
React.createElement(HelpPopover, { htmlContent: spec.viewSpec.layoutDescription, placement: ['bottom', 'top'] }))) : null)),
|
|
19
19
|
React.createElement("div", { className: b('right') },
|
|
20
|
-
React.createElement(
|
|
21
|
-
|
|
22
|
-
React.createElement(
|
|
20
|
+
React.createElement("div", { className: b('right-inner') },
|
|
21
|
+
React.createElement(ErrorWrapper, { name: name, meta: meta, withoutChildErrorStyles: isArraySpec(spec) || isObjectSpec(spec) }, children),
|
|
22
|
+
arrayItem ? (React.createElement(Button, { view: "flat", className: b('remove-button'), onClick: input.onDrop },
|
|
23
|
+
React.createElement(Icon, { data: Xmark, size: 16 }))) : null),
|
|
24
|
+
verboseDescription && spec.viewSpec.layoutDescription ? (React.createElement("div", { className: b('description'), dangerouslySetInnerHTML: { __html: spec.viewSpec.layoutDescription } })) : null)));
|
|
23
25
|
};
|
|
26
|
+
export const Row = (props) => (React.createElement(RowBase, Object.assign({}, props)));
|
|
27
|
+
export const RowVerbose = (props) => (React.createElement(RowBase, Object.assign({ verboseDescription: true }, props)));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Accordeon, AccordeonCardLayout, ArrayBase, ArrayBaseView, BaseView, CardAccordeon, CardOneOf, CardOneOfView, CardSection, Checkbox, Group, Group2, MonacoInput, MonacoInputCard, MonacoView, MonacoViewCard, MultiSelect, MultiSelectView, NumberWithScale, NumberWithScaleView, ObjectBase, ObjectBaseView, OneOf, OneOfCard, OneOfCardView, OneOfView, Row, Row2, Secret, Section, Section2, SectionCard, SectionCard2, SectionWithSubtitle, SectionWithSubtitle2, Select, TableArrayInput, TableArrayView, TableCell, Text, TextArea, TextAreaView, TextContent, Transparent, ViewAccordeon, ViewAccordeonCard, ViewCardAccordeon, ViewCardSection, ViewGroup, ViewGroup2, ViewRow, ViewRow2, ViewSection, ViewSection2, ViewSectionCard, ViewSectionCard2, ViewTableCell, ViewTransparent, } from '../components';
|
|
1
|
+
import { Accordeon, AccordeonCardLayout, ArrayBase, ArrayBaseView, BaseView, CardAccordeon, CardOneOf, CardOneOfView, CardSection, Checkbox, Group, Group2, MonacoInput, MonacoInputCard, MonacoView, MonacoViewCard, MultiSelect, MultiSelectView, NumberWithScale, NumberWithScaleView, ObjectBase, ObjectBaseView, OneOf, OneOfCard, OneOfCardView, OneOfView, Row, Row2, RowVerbose, Secret, Section, Section2, SectionCard, SectionCard2, SectionWithSubtitle, SectionWithSubtitle2, Select, TableArrayInput, TableArrayView, TableCell, Text, TextArea, TextAreaView, TextContent, Transparent, ViewAccordeon, ViewAccordeonCard, ViewCardAccordeon, ViewCardSection, ViewGroup, ViewGroup2, ViewRow, ViewRow2, ViewSection, ViewSection2, ViewSectionCard, ViewSectionCard2, ViewTableCell, ViewTransparent, } from '../components';
|
|
2
2
|
import { getArrayValidator, getBooleanValidator, getNumberValidator, getObjectValidator, getStringValidator, } from '../validators';
|
|
3
3
|
export const dynamicConfig = {
|
|
4
4
|
array: {
|
|
@@ -9,6 +9,7 @@ export const dynamicConfig = {
|
|
|
9
9
|
},
|
|
10
10
|
layouts: {
|
|
11
11
|
row: Row,
|
|
12
|
+
row_verbose: RowVerbose,
|
|
12
13
|
accordeon: Accordeon,
|
|
13
14
|
section: Section,
|
|
14
15
|
section2: Section2,
|
|
@@ -29,6 +30,7 @@ export const dynamicConfig = {
|
|
|
29
30
|
},
|
|
30
31
|
layouts: {
|
|
31
32
|
row: Row,
|
|
33
|
+
row_verbose: RowVerbose,
|
|
32
34
|
table_item: TableCell,
|
|
33
35
|
},
|
|
34
36
|
validators: {
|
|
@@ -41,6 +43,7 @@ export const dynamicConfig = {
|
|
|
41
43
|
},
|
|
42
44
|
layouts: {
|
|
43
45
|
row: Row,
|
|
46
|
+
row_verbose: RowVerbose,
|
|
44
47
|
table_item: TableCell,
|
|
45
48
|
transparent: Transparent,
|
|
46
49
|
},
|
|
@@ -57,6 +60,7 @@ export const dynamicConfig = {
|
|
|
57
60
|
},
|
|
58
61
|
layouts: {
|
|
59
62
|
row: Row,
|
|
63
|
+
row_verbose: RowVerbose,
|
|
60
64
|
accordeon: Accordeon,
|
|
61
65
|
section: Section,
|
|
62
66
|
section2: Section2,
|
|
@@ -82,6 +86,7 @@ export const dynamicConfig = {
|
|
|
82
86
|
},
|
|
83
87
|
layouts: {
|
|
84
88
|
row: Row,
|
|
89
|
+
row_verbose: RowVerbose,
|
|
85
90
|
table_item: TableCell,
|
|
86
91
|
transparent: Transparent,
|
|
87
92
|
section: Section,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/dynamic-forms",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "build/cjs/index.js",
|
|
@@ -35,15 +35,18 @@
|
|
|
35
35
|
"start": "start-storybook",
|
|
36
36
|
"prepublishOnly": "npm run build"
|
|
37
37
|
},
|
|
38
|
-
"dependencies": {
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@gravity-ui/i18n": "^1.0.0",
|
|
40
|
+
"@gravity-ui/icons": "^1.1.0",
|
|
41
|
+
"bem-cn-lite": "^4.0.0",
|
|
42
|
+
"lodash": "^4.17.20"
|
|
43
|
+
},
|
|
39
44
|
"devDependencies": {
|
|
40
45
|
"@commitlint/cli": "^17.0.0",
|
|
41
46
|
"@commitlint/config-conventional": "^17.0.0",
|
|
42
47
|
"@babel/preset-env": "^7.20.2",
|
|
43
48
|
"@babel/preset-typescript": "^7.18.6",
|
|
44
49
|
"@gravity-ui/eslint-config": "^2.0.0",
|
|
45
|
-
"@gravity-ui/i18n": "^1.0.0",
|
|
46
|
-
"@gravity-ui/icons": "^1.1.0",
|
|
47
50
|
"@gravity-ui/prettier-config": "^1.0.1",
|
|
48
51
|
"@gravity-ui/stylelint-config": "^2.0.0",
|
|
49
52
|
"@gravity-ui/tsconfig": "^1.0.0",
|
|
@@ -55,7 +58,6 @@
|
|
|
55
58
|
"@types/react": "^18.0.28",
|
|
56
59
|
"@types/react-dom": "^18.0.11",
|
|
57
60
|
"@types/react-is": "^17.0.3",
|
|
58
|
-
"bem-cn-lite": "^4.0.0",
|
|
59
61
|
"css-loader": "^5.2.6",
|
|
60
62
|
"eslint": "^8.27.0",
|
|
61
63
|
"final-form": "^4.20.2",
|
|
@@ -65,7 +67,6 @@
|
|
|
65
67
|
"gulp-replace": "^1.1.4",
|
|
66
68
|
"gulp-typescript": "^6.0.0-alpha.1",
|
|
67
69
|
"husky": "^7.0.4",
|
|
68
|
-
"lodash": "^4.17.20",
|
|
69
70
|
"monaco-editor": "^0.30.1",
|
|
70
71
|
"monaco-editor-webpack-plugin": "^6.0.0",
|
|
71
72
|
"npm-run-all": "^4.1.5",
|
|
@@ -85,12 +86,8 @@
|
|
|
85
86
|
"typescript": "^4.9.5"
|
|
86
87
|
},
|
|
87
88
|
"peerDependencies": {
|
|
88
|
-
"@gravity-ui/
|
|
89
|
-
"@gravity-ui/icons": "^1.1.0",
|
|
90
|
-
"@gravity-ui/uikit": "^4.1.0",
|
|
91
|
-
"bem-cn-lite": "^4.0.0",
|
|
89
|
+
"@gravity-ui/uikit": "^3.0.0 || ^4.0.0",
|
|
92
90
|
"final-form": "^4.20.2",
|
|
93
|
-
"lodash": "^4.17.20",
|
|
94
91
|
"react": "^16.0.0 || ^17.0.0 || ^18.0.0",
|
|
95
92
|
"react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0",
|
|
96
93
|
"react-final-form": "^6.5.3",
|