@gravity-ui/dynamic-forms 3.7.0 → 4.0.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/core/components/Form/Controller/Controller.js +2 -2
- package/build/cjs/lib/core/components/Form/Controller/utils.js +45 -34
- package/build/cjs/lib/core/components/Form/DynamicField.js +6 -4
- package/build/cjs/lib/core/components/Form/hooks/useCreateContext.js +2 -2
- package/build/cjs/lib/core/components/Form/hooks/useCreateSearchContext.js +2 -2
- package/build/cjs/lib/core/components/Form/hooks/useIntegrationFF.js +6 -4
- package/build/cjs/lib/core/components/Form/hooks/useMutators.js +11 -7
- package/build/cjs/lib/core/components/Form/hooks/useSearchStore.js +4 -3
- package/build/cjs/lib/core/components/Form/hooks/useStore.js +15 -11
- package/build/cjs/lib/core/components/Form/utils/common.js +14 -11
- package/build/cjs/lib/core/components/View/helpers.js +5 -5
- package/build/cjs/lib/core/components/View/hooks/useComponents.js +2 -2
- package/build/cjs/lib/core/components/View/hooks/useCreateContext.js +2 -2
- package/build/cjs/lib/core/components/View/hooks/useRender.js +4 -3
- package/build/cjs/lib/core/helpers.js +5 -4
- package/build/cjs/lib/kit/components/AccordeonCard/AccordeonCard.js +2 -2
- package/build/cjs/lib/kit/components/Card/Card.css +3 -2
- package/build/cjs/lib/kit/components/Card/Card.js +2 -2
- package/build/cjs/lib/kit/components/CopyButton/CopyButton.js +1 -1
- package/build/cjs/lib/kit/components/ErrorWrapper/ErrorWrapper.css +4 -1
- package/build/cjs/lib/kit/components/GenerateRandomValueButton/GenerateRandomValueButton.js +2 -2
- package/build/cjs/lib/kit/components/Inputs/ArrayBase/ArrayBase.js +2 -2
- package/build/cjs/lib/kit/components/Inputs/CardOneOf/CardOneOf.js +2 -2
- package/build/cjs/lib/kit/components/Inputs/MonacoInput/MonacoInputDialog.css +2 -2
- package/build/cjs/lib/kit/components/Inputs/MultiOneOf/MultiOneOf.js +4 -3
- package/build/cjs/lib/kit/components/Inputs/ObjectBase/ObjectBase.js +4 -3
- package/build/cjs/lib/kit/components/Inputs/ObjectValueInput/ObjectValueInput.js +4 -3
- package/build/cjs/lib/kit/components/Inputs/OneOf/OneOf.js +2 -2
- package/build/cjs/lib/kit/components/Inputs/Secret/Secret.js +4 -3
- package/build/cjs/lib/kit/components/Inputs/TableArrayInput/TableArrayInput.css +8 -2
- package/build/cjs/lib/kit/components/Inputs/TableArrayInput/TableArrayInput.js +4 -3
- package/build/cjs/lib/kit/components/Inputs/Text/Text.js +2 -2
- package/build/cjs/lib/kit/components/Inputs/TextContent/TextContent.css +2 -2
- package/build/cjs/lib/kit/components/Inputs/TextContent/TextContent.js +2 -2
- package/build/cjs/lib/kit/components/Inputs/TextLink/TextLink.js +4 -3
- package/build/cjs/lib/kit/components/Layouts/Row/Row.css +2 -2
- package/build/cjs/lib/kit/components/Layouts/Row/Row.js +2 -2
- package/build/cjs/lib/kit/components/Layouts/Section/Section.css +2 -2
- package/build/cjs/lib/kit/components/LazyLoader/LazyLoader.js +2 -2
- package/build/cjs/lib/kit/components/LongValue/LongValue.css +3 -0
- package/build/cjs/lib/kit/components/LongValue/LongValue.js +1 -1
- package/build/cjs/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.css +2 -2
- package/build/cjs/lib/kit/components/ViewLayouts/ViewAccordeon/ViewAccordeon.js +2 -2
- package/build/cjs/lib/kit/components/ViewLayouts/ViewAccordeonCard/ViewAccordeonCard.js +2 -2
- package/build/cjs/lib/kit/components/ViewLayouts/ViewCardAccordeon.js +2 -2
- package/build/cjs/lib/kit/components/Views/ArrayBaseView/ArrayBaseView.js +2 -2
- package/build/cjs/lib/kit/components/Views/BaseView/BaseView.js +2 -2
- package/build/cjs/lib/kit/components/Views/CardOneOfView.js +2 -2
- package/build/cjs/lib/kit/components/Views/MonacoInputView/MonacoViewDialog.css +1 -1
- package/build/cjs/lib/kit/components/Views/MultiOneOfView/MultiOneOfView.js +2 -2
- package/build/cjs/lib/kit/components/Views/ObjectBaseView/ObjectBaseView.js +2 -2
- package/build/cjs/lib/kit/components/Views/ObjectValueInputView/ObjectValueInputView.js +2 -2
- package/build/cjs/lib/kit/components/Views/OneOfView/OneOfView.js +2 -2
- package/build/cjs/lib/kit/components/Views/TextLinkView/TextLinkView.js +2 -2
- package/build/cjs/lib/kit/hooks/useOneOf/useOneOf.js +5 -4
- package/build/cjs/lib/kit/utils/common.js +30 -25
- package/build/cjs/lib/kit/validators/validators.js +9 -7
- package/build/esm/lib/core/components/Form/Controller/Controller.d.ts +1 -1
- package/build/esm/lib/core/components/Form/Controller/Controller.js +2 -2
- package/build/esm/lib/core/components/Form/Controller/types.d.ts +6 -6
- package/build/esm/lib/core/components/Form/Controller/utils.d.ts +10 -10
- package/build/esm/lib/core/components/Form/Controller/utils.js +45 -34
- package/build/esm/lib/core/components/Form/DynamicField.js +6 -4
- package/build/esm/lib/core/components/Form/hooks/useCreateContext.js +2 -2
- package/build/esm/lib/core/components/Form/hooks/useCreateSearchContext.js +2 -2
- package/build/esm/lib/core/components/Form/hooks/useGenerateRandomValue.d.ts +1 -1
- package/build/esm/lib/core/components/Form/hooks/useIntegrationFF.js +6 -4
- package/build/esm/lib/core/components/Form/hooks/useMutators.js +11 -7
- package/build/esm/lib/core/components/Form/hooks/useSearchStore.js +4 -3
- package/build/esm/lib/core/components/Form/hooks/useStore.js +15 -11
- package/build/esm/lib/core/components/Form/types/array.d.ts +12 -12
- package/build/esm/lib/core/components/Form/types/boolean.d.ts +12 -12
- package/build/esm/lib/core/components/Form/types/config.d.ts +1 -1
- package/build/esm/lib/core/components/Form/types/input.d.ts +13 -13
- package/build/esm/lib/core/components/Form/types/layout.d.ts +5 -5
- package/build/esm/lib/core/components/Form/types/number.d.ts +12 -12
- package/build/esm/lib/core/components/Form/types/object.d.ts +12 -12
- package/build/esm/lib/core/components/Form/types/string.d.ts +12 -12
- package/build/esm/lib/core/components/Form/utils/common.js +14 -11
- package/build/esm/lib/core/components/View/ViewController.d.ts +1 -1
- package/build/esm/lib/core/components/View/helpers.js +5 -5
- package/build/esm/lib/core/components/View/hooks/useComponents.d.ts +1 -1
- package/build/esm/lib/core/components/View/hooks/useComponents.js +2 -2
- package/build/esm/lib/core/components/View/hooks/useCreateContext.js +2 -2
- package/build/esm/lib/core/components/View/hooks/useRender.d.ts +1 -1
- package/build/esm/lib/core/components/View/hooks/useRender.js +4 -3
- package/build/esm/lib/core/helpers.d.ts +5 -5
- package/build/esm/lib/core/helpers.js +5 -4
- package/build/esm/lib/core/types/specs.d.ts +6 -6
- package/build/esm/lib/kit/components/AccordeonCard/AccordeonCard.js +2 -2
- package/build/esm/lib/kit/components/Card/Card.css +3 -2
- package/build/esm/lib/kit/components/Card/Card.js +2 -2
- package/build/esm/lib/kit/components/CopyButton/CopyButton.js +1 -1
- package/build/esm/lib/kit/components/ErrorWrapper/ErrorWrapper.css +4 -1
- package/build/esm/lib/kit/components/GenerateRandomValueButton/GenerateRandomValueButton.js +2 -2
- package/build/esm/lib/kit/components/Inputs/ArrayBase/ArrayBase.js +2 -2
- package/build/esm/lib/kit/components/Inputs/CardOneOf/CardOneOf.js +2 -2
- package/build/esm/lib/kit/components/Inputs/MonacoInput/MonacoInputDialog.css +2 -2
- package/build/esm/lib/kit/components/Inputs/MultiOneOf/MultiOneOf.js +4 -3
- package/build/esm/lib/kit/components/Inputs/ObjectBase/ObjectBase.js +4 -3
- package/build/esm/lib/kit/components/Inputs/ObjectValueInput/ObjectValueInput.js +4 -3
- package/build/esm/lib/kit/components/Inputs/OneOf/OneOf.js +2 -2
- package/build/esm/lib/kit/components/Inputs/Secret/Secret.js +4 -3
- package/build/esm/lib/kit/components/Inputs/TableArrayInput/TableArrayInput.css +8 -2
- package/build/esm/lib/kit/components/Inputs/TableArrayInput/TableArrayInput.js +4 -3
- package/build/esm/lib/kit/components/Inputs/Text/Text.js +2 -2
- package/build/esm/lib/kit/components/Inputs/TextContent/TextContent.css +2 -2
- package/build/esm/lib/kit/components/Inputs/TextContent/TextContent.js +2 -2
- package/build/esm/lib/kit/components/Inputs/TextLink/TextLink.js +4 -3
- package/build/esm/lib/kit/components/Layouts/Accordeon/Accordeon.d.ts +1 -1
- package/build/esm/lib/kit/components/Layouts/AccordeonCard/AccordeonCardForm.d.ts +1 -1
- package/build/esm/lib/kit/components/Layouts/CardAccordeon.d.ts +1 -1
- package/build/esm/lib/kit/components/Layouts/CardSection.d.ts +1 -1
- package/build/esm/lib/kit/components/Layouts/Row/Row.css +2 -2
- package/build/esm/lib/kit/components/Layouts/Row/Row.d.ts +2 -2
- package/build/esm/lib/kit/components/Layouts/Row/Row.js +2 -2
- package/build/esm/lib/kit/components/Layouts/Section/Section.css +2 -2
- package/build/esm/lib/kit/components/Layouts/Section/Section.d.ts +6 -6
- package/build/esm/lib/kit/components/Layouts/TableCell/TableCell.d.ts +1 -1
- package/build/esm/lib/kit/components/Layouts/Transparent/Transparent.d.ts +1 -1
- package/build/esm/lib/kit/components/LazyLoader/LazyLoader.js +2 -2
- package/build/esm/lib/kit/components/LongValue/LongValue.css +3 -0
- package/build/esm/lib/kit/components/LongValue/LongValue.js +1 -1
- package/build/esm/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.css +2 -2
- package/build/esm/lib/kit/components/ViewLayouts/ViewAccordeon/ViewAccordeon.js +2 -2
- package/build/esm/lib/kit/components/ViewLayouts/ViewAccordeonCard/ViewAccordeonCard.js +2 -2
- package/build/esm/lib/kit/components/ViewLayouts/ViewCardAccordeon.js +2 -2
- package/build/esm/lib/kit/components/ViewLayouts/ViewCardSection.d.ts +1 -1
- package/build/esm/lib/kit/components/ViewLayouts/ViewRow/ViewRow.d.ts +1 -1
- package/build/esm/lib/kit/components/ViewLayouts/ViewSection/ViewSection.d.ts +4 -4
- package/build/esm/lib/kit/components/ViewLayouts/ViewTableCell/ViewTableCell.d.ts +1 -1
- package/build/esm/lib/kit/components/ViewLayouts/ViewTransparent/ViewTransparent.d.ts +1 -1
- package/build/esm/lib/kit/components/Views/ArrayBaseView/ArrayBaseView.js +2 -2
- package/build/esm/lib/kit/components/Views/BaseView/BaseView.js +2 -2
- package/build/esm/lib/kit/components/Views/CardOneOfView.js +2 -2
- package/build/esm/lib/kit/components/Views/MonacoInputView/MonacoViewDialog.css +1 -1
- package/build/esm/lib/kit/components/Views/MultiOneOfView/MultiOneOfView.js +2 -2
- package/build/esm/lib/kit/components/Views/ObjectBaseView/ObjectBaseView.js +2 -2
- package/build/esm/lib/kit/components/Views/ObjectValueInputView/ObjectValueInputView.js +2 -2
- package/build/esm/lib/kit/components/Views/OneOfView/OneOfView.js +2 -2
- package/build/esm/lib/kit/components/Views/TextLinkView/TextLinkView.js +2 -2
- package/build/esm/lib/kit/hooks/useOneOf/useOneOf.d.ts +1 -1
- package/build/esm/lib/kit/hooks/useOneOf/useOneOf.js +5 -4
- package/build/esm/lib/kit/utils/common.d.ts +1 -1
- package/build/esm/lib/kit/utils/common.js +30 -25
- package/build/esm/lib/kit/utils/objectInline.d.ts +1 -1
- package/build/esm/lib/kit/validators/validators.js +9 -7
- package/package.json +11 -11
|
@@ -2,7 +2,7 @@ import { LabelProps } from '@gravity-ui/uikit';
|
|
|
2
2
|
import { ColorTextBaseProps } from '@gravity-ui/uikit/build/esm/components/Text/colorText/colorText';
|
|
3
3
|
import { ReadAsMethod, SpecTypes } from '../constants';
|
|
4
4
|
import { ArrayValue, ObjectValue } from './';
|
|
5
|
-
export interface ArraySpec<LinkType = any, InputComponentProps extends Record<string, any> =
|
|
5
|
+
export interface ArraySpec<LinkType = any, InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined> {
|
|
6
6
|
defaultValue?: ArrayValue;
|
|
7
7
|
type: SpecTypes.Array;
|
|
8
8
|
required?: boolean;
|
|
@@ -37,7 +37,7 @@ export interface ArraySpec<LinkType = any, InputComponentProps extends Record<st
|
|
|
37
37
|
layoutProps?: LayoutComponentProps;
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
export interface BooleanSpec<LinkType = any, InputComponentProps extends Record<string, any> =
|
|
40
|
+
export interface BooleanSpec<LinkType = any, InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined> {
|
|
41
41
|
defaultValue?: boolean;
|
|
42
42
|
type: SpecTypes.Boolean;
|
|
43
43
|
required?: boolean;
|
|
@@ -55,7 +55,7 @@ export interface BooleanSpec<LinkType = any, InputComponentProps extends Record<
|
|
|
55
55
|
layoutProps?: LayoutComponentProps;
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
export interface NumberSpec<LinkType = any, InputComponentProps extends Record<string, any> =
|
|
58
|
+
export interface NumberSpec<LinkType = any, InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined> {
|
|
59
59
|
defaultValue?: number;
|
|
60
60
|
type: SpecTypes.Number;
|
|
61
61
|
required?: boolean;
|
|
@@ -78,7 +78,7 @@ export interface NumberSpec<LinkType = any, InputComponentProps extends Record<s
|
|
|
78
78
|
layoutProps?: LayoutComponentProps;
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
export interface ObjectSpec<LinkType = any, InputComponentProps extends Record<string, any> =
|
|
81
|
+
export interface ObjectSpec<LinkType = any, InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined> {
|
|
82
82
|
defaultValue?: ObjectValue;
|
|
83
83
|
type: SpecTypes.Object;
|
|
84
84
|
required?: boolean;
|
|
@@ -103,7 +103,7 @@ export interface ObjectSpec<LinkType = any, InputComponentProps extends Record<s
|
|
|
103
103
|
layoutProps?: LayoutComponentProps;
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
export interface StringSpec<LinkType = any, InputComponentProps extends Record<string, any> =
|
|
106
|
+
export interface StringSpec<LinkType = any, InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined> {
|
|
107
107
|
defaultValue?: string;
|
|
108
108
|
type: SpecTypes.String;
|
|
109
109
|
required?: boolean;
|
|
@@ -158,4 +158,4 @@ export interface StringSpec<LinkType = any, InputComponentProps extends Record<s
|
|
|
158
158
|
generateRandomValueButton?: boolean;
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
|
-
export type Spec = ArraySpec | BooleanSpec | NumberSpec | ObjectSpec | StringSpec
|
|
161
|
+
export type Spec<LinkType = any, InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined> = ArraySpec<LinkType, InputComponentProps, LayoutComponentProps> | BooleanSpec<LinkType, InputComponentProps, LayoutComponentProps> | NumberSpec<LinkType, InputComponentProps, LayoutComponentProps> | ObjectSpec<LinkType, InputComponentProps, LayoutComponentProps> | StringSpec<LinkType, InputComponentProps, LayoutComponentProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ChevronDown } from '@gravity-ui/icons';
|
|
3
3
|
import { Button, Icon, Text } from '@gravity-ui/uikit';
|
|
4
|
-
import
|
|
4
|
+
import isString from 'lodash/isString';
|
|
5
5
|
import { block } from '../../utils';
|
|
6
6
|
import './AccordeonCard.css';
|
|
7
7
|
const b = block('accordeon-card');
|
|
@@ -29,7 +29,7 @@ export const AccordeonCard = ({ className, name, header, description, open: prop
|
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
const currentHeaderVariant = React.useMemo(() => {
|
|
32
|
-
if (!
|
|
32
|
+
if (!isString(header)) {
|
|
33
33
|
return 'body-1';
|
|
34
34
|
}
|
|
35
35
|
if (titleSize === 'm') {
|
|
@@ -48,15 +48,16 @@
|
|
|
48
48
|
margin-left: 10px;
|
|
49
49
|
}
|
|
50
50
|
.df-card__title {
|
|
51
|
+
display: flex;
|
|
51
52
|
max-width: 533px;
|
|
52
53
|
}
|
|
53
54
|
.df-card__note {
|
|
54
55
|
margin-left: 5px;
|
|
55
56
|
}
|
|
56
|
-
.df-card__note .
|
|
57
|
+
.df-card__note .gc-help-popover {
|
|
57
58
|
display: flex;
|
|
58
59
|
}
|
|
59
|
-
.df-card__note .
|
|
60
|
+
.df-card__note .gc-help-popover > span {
|
|
60
61
|
display: flex;
|
|
61
62
|
}
|
|
62
63
|
.df-card__toggler-icon_open {
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { HelpPopover } from '@gravity-ui/components';
|
|
3
3
|
import { ChevronDown } from '@gravity-ui/icons';
|
|
4
4
|
import { Button, Card as CardBase, Icon, Popover, Text } from '@gravity-ui/uikit';
|
|
5
|
-
import
|
|
5
|
+
import isString from 'lodash/isString';
|
|
6
6
|
import { COMMON_POPOVER_PLACEMENT, COMMON_TITLE_MAX_WIDTH } from '../../constants/common';
|
|
7
7
|
import { block } from '../../utils';
|
|
8
8
|
import './Card.css';
|
|
@@ -32,7 +32,7 @@ export const Card = ({ name, title: propsTitle, description, actions, open: prop
|
|
|
32
32
|
const preventEvent = React.useCallback((e) => e.stopPropagation(), []);
|
|
33
33
|
const titlePopoverDisabled = (((_a = titleRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) || 0) <= COMMON_TITLE_MAX_WIDTH;
|
|
34
34
|
const title = React.useMemo(() => {
|
|
35
|
-
if (
|
|
35
|
+
if (isString(propsTitle)) {
|
|
36
36
|
return (React.createElement(React.Fragment, null,
|
|
37
37
|
React.createElement(Popover, { content: propsTitle, disabled: titlePopoverDisabled, placement: COMMON_POPOVER_PLACEMENT },
|
|
38
38
|
React.createElement(Text, { className: b('title'), ellipsis: true, ref: titleRef, variant: "subheader-2" }, propsTitle)),
|
|
@@ -10,7 +10,7 @@ const b = block('copy-button');
|
|
|
10
10
|
*/
|
|
11
11
|
export const CopyButton = ({ spec, value }) => {
|
|
12
12
|
if ((isStringSpec(spec) || isNumberSpec(spec)) && spec.viewSpec.copy) {
|
|
13
|
-
return React.createElement(ClipboardButton, { className: b(), text: `${value}`, size:
|
|
13
|
+
return React.createElement(ClipboardButton, { className: b(), text: `${value}`, size: "s" });
|
|
14
14
|
}
|
|
15
15
|
return null;
|
|
16
16
|
};
|
|
@@ -16,7 +16,10 @@
|
|
|
16
16
|
.df-error-wrapper_error .g-text-area__content:hover:not(.df-error-wrapper-ignore),
|
|
17
17
|
.df-error-wrapper_error .yc-text-input_view_normal:not(.df-error-wrapper-ignore) .yc-text-input__control,
|
|
18
18
|
.df-error-wrapper_error .yc-text-input_view_normal:not(.df-error-wrapper-ignore) .yc-text-input__content,
|
|
19
|
-
.df-error-wrapper_error .
|
|
19
|
+
.df-error-wrapper_error .g-text-input_view_normal:not(.df-error-wrapper-ignore) .g-text-input__control,
|
|
20
|
+
.df-error-wrapper_error .g-text-input_view_normal:not(.df-error-wrapper-ignore) .g-text-input__content,
|
|
21
|
+
.df-error-wrapper_error .yc-checkbox__indicator:not(.df-error-wrapper-ignore)::before,
|
|
22
|
+
.df-error-wrapper_error .g-checkbox__indicator:not(.df-error-wrapper-ignore)::before {
|
|
20
23
|
border-color: var(--g-color-text-danger);
|
|
21
24
|
}
|
|
22
25
|
.df-error-wrapper__error-text {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Button } from '@gravity-ui/uikit';
|
|
3
|
-
import
|
|
3
|
+
import isFunction from 'lodash/isFunction';
|
|
4
4
|
import { useGenerateRandomValue } from '../../../core/components/Form/hooks';
|
|
5
5
|
import i18n from '../../i18n';
|
|
6
6
|
import { block } from '../../utils';
|
|
@@ -8,7 +8,7 @@ import './GenerateRandomValueButton.css';
|
|
|
8
8
|
const b = block('generate-random-value-button');
|
|
9
9
|
export const GenerateRandomValueButton = ({ spec, onChange, }) => {
|
|
10
10
|
const generateRandomValue = useGenerateRandomValue();
|
|
11
|
-
if (
|
|
11
|
+
if (isFunction(generateRandomValue) && spec.viewSpec.generateRandomValueButton) {
|
|
12
12
|
return (React.createElement(Button, { onClick: () => onChange(generateRandomValue(spec)), className: b() }, i18n('button-generate')));
|
|
13
13
|
}
|
|
14
14
|
return null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Plus } from '@gravity-ui/icons';
|
|
3
3
|
import { Button, Icon, Label } from '@gravity-ui/uikit';
|
|
4
|
-
import
|
|
4
|
+
import set from 'lodash/set';
|
|
5
5
|
import { Controller, OBJECT_ARRAY_CNT, OBJECT_ARRAY_FLAG, isBooleanSpec, isCorrectSpec, isNumberSpec, isStringSpec, transformArrIn, } from '../../../../core';
|
|
6
6
|
import { block } from '../../../utils';
|
|
7
7
|
import './ArrayBase.css';
|
|
@@ -25,7 +25,7 @@ export const ArrayBase = ({ spec, name, arrayInput, input }) => {
|
|
|
25
25
|
: `${idx + 1}` });
|
|
26
26
|
return itemSpec;
|
|
27
27
|
}, [spec.items, itemSpecCorrect]);
|
|
28
|
-
const parentOnChange = React.useCallback((childName, childValue, childErrors) => input.onChange((currentValue) =>
|
|
28
|
+
const parentOnChange = React.useCallback((childName, childValue, childErrors) => input.onChange((currentValue) => set(Object.assign({}, currentValue), childName.split(`${input.name}.`).join(''), childValue), childErrors), [input.onChange, input.name]);
|
|
29
29
|
const AddButton = React.useCallback(() => {
|
|
30
30
|
let onClick = () => arrayInput.onItemAdd(undefined);
|
|
31
31
|
let qa = `${name}-add-item`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import set from 'lodash/set';
|
|
3
3
|
import { Card } from '../../';
|
|
4
4
|
import { Controller, isArrayItem, } from '../../../../core';
|
|
5
5
|
import { useErrorChecker, useOneOf } from '../../../hooks';
|
|
@@ -23,7 +23,7 @@ export const CardOneOf = (props) => {
|
|
|
23
23
|
return;
|
|
24
24
|
}, [name, input.onDrop]);
|
|
25
25
|
const parentOnChange = React.useCallback((childName, childValue, childErrors) => {
|
|
26
|
-
const value =
|
|
26
|
+
const value = set({}, childName.split(`${input.name}.`).join(''), childValue);
|
|
27
27
|
input.onChange(value, childErrors);
|
|
28
28
|
}, [input.onChange, input.name]);
|
|
29
29
|
useErrorChecker({ name, meta, open, setOpen });
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
.df-monaco-input-dialog .
|
|
1
|
+
.df-monaco-input-dialog .g-dialog-footer {
|
|
2
2
|
padding: 10px 32px 32px;
|
|
3
3
|
}
|
|
4
4
|
.df-monaco-input-dialog__container {
|
|
5
5
|
border: 1px solid var(--g-color-line-generic);
|
|
6
6
|
}
|
|
7
|
-
.df-monaco-input-dialog__dialog-header .
|
|
7
|
+
.df-monaco-input-dialog__dialog-header .g-dialog-header__caption {
|
|
8
8
|
min-height: 24px;
|
|
9
9
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Select } from '@gravity-ui/uikit';
|
|
3
|
-
import
|
|
3
|
+
import isObjectLike from 'lodash/isObjectLike';
|
|
4
|
+
import set from 'lodash/set';
|
|
4
5
|
import { Controller, } from '../../../../core';
|
|
5
6
|
import { block } from '../../../utils';
|
|
6
7
|
import { GroupIndent } from '../../GroupIndent';
|
|
@@ -19,9 +20,9 @@ export const MultiOneOf = (props) => {
|
|
|
19
20
|
}
|
|
20
21
|
}, [onFocus, onBlur]);
|
|
21
22
|
const parentOnChange = React.useCallback((childName, childValue, childErrors) => {
|
|
22
|
-
onChange((currentValue) =>
|
|
23
|
+
onChange((currentValue) => set(Object.assign({}, currentValue), childName.split(`${name}.`).join(''), childValue), childErrors);
|
|
23
24
|
}, [name, onChange]);
|
|
24
|
-
const specProperties = React.useMemo(() => (
|
|
25
|
+
const specProperties = React.useMemo(() => (isObjectLike(spec.properties) ? spec.properties : {}), [spec.properties]);
|
|
25
26
|
const options = React.useMemo(() => (spec.viewSpec.order || Object.keys(specProperties)).map((value) => {
|
|
26
27
|
var _a, _b;
|
|
27
28
|
const title = ((_a = spec.description) === null || _a === void 0 ? void 0 : _a[value]) ||
|
|
@@ -2,7 +2,8 @@ import { __rest } from "tslib";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Plus } from '@gravity-ui/icons';
|
|
4
4
|
import { Button, Icon } from '@gravity-ui/uikit';
|
|
5
|
-
import
|
|
5
|
+
import isObjectLike from 'lodash/isObjectLike';
|
|
6
|
+
import set from 'lodash/set';
|
|
6
7
|
import { Controller, transformArrIn, } from '../../../../core';
|
|
7
8
|
import { block, filterPropertiesForObjectInline } from '../../../utils';
|
|
8
9
|
import './ObjectBase.css';
|
|
@@ -15,10 +16,10 @@ export const ObjectBase = (_a) => {
|
|
|
15
16
|
React.createElement(Icon, { data: Plus, size: 14 }),
|
|
16
17
|
spec.viewSpec.layoutTitle || null));
|
|
17
18
|
}, [spec.defaultValue, spec.viewSpec.layoutTitle, restProps.input.onChange]);
|
|
18
|
-
const parentOnChange = React.useCallback((childName, childValue, childErrors) => restProps.input.onChange((currentValue) =>
|
|
19
|
+
const parentOnChange = React.useCallback((childName, childValue, childErrors) => restProps.input.onChange((currentValue) => set(Object.assign({}, currentValue), childName.split(`${restProps.input.name}.`).join(''), childValue), childErrors), [restProps.input.onChange, restProps.input.name]);
|
|
19
20
|
const content = React.useMemo(() => {
|
|
20
21
|
if (!spec.properties ||
|
|
21
|
-
!
|
|
22
|
+
!isObjectLike(spec.properties) ||
|
|
22
23
|
!Object.keys(spec.properties || {}).length) {
|
|
23
24
|
return null;
|
|
24
25
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
3
|
+
import set from 'lodash/set';
|
|
3
4
|
import { Controller } from '../../../../core';
|
|
4
5
|
const OBJECT_VALUE_PROPERTY_NAME = 'value';
|
|
5
6
|
export const ObjectValueInput = (props) => {
|
|
6
7
|
var _a;
|
|
7
8
|
const { spec, input, name, Layout } = props;
|
|
8
|
-
const parentOnChange = React.useCallback((childName, childValue, childErrors) => input.onChange((currentValue) =>
|
|
9
|
+
const parentOnChange = React.useCallback((childName, childValue, childErrors) => input.onChange((currentValue) => set(Object.assign({}, currentValue), childName.split(`${name}.`).join(''), childValue), childErrors), [input.onChange, input.name]);
|
|
9
10
|
const childSpec = React.useMemo(() => {
|
|
10
11
|
var _a;
|
|
11
12
|
if ((_a = spec.properties) === null || _a === void 0 ? void 0 : _a[OBJECT_VALUE_PROPERTY_NAME]) {
|
|
12
|
-
const childSpec =
|
|
13
|
+
const childSpec = cloneDeep(spec.properties[OBJECT_VALUE_PROPERTY_NAME]);
|
|
13
14
|
childSpec.viewSpec.layout = 'transparent';
|
|
14
15
|
return childSpec;
|
|
15
16
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import set from 'lodash/set';
|
|
3
3
|
import { GroupIndent } from '../../';
|
|
4
4
|
import { Controller, } from '../../../../core';
|
|
5
5
|
import { useOneOf } from '../../../hooks';
|
|
@@ -10,7 +10,7 @@ const OneOfComponent = (props) => {
|
|
|
10
10
|
var _a;
|
|
11
11
|
const { oneOfValue, specProperties, toggler } = useOneOf({ props });
|
|
12
12
|
const parentOnChange = React.useCallback((childName, childValue, childErrors) => {
|
|
13
|
-
const value =
|
|
13
|
+
const value = set({}, childName.split(`${props.input.name}.`).join(''), childValue);
|
|
14
14
|
props.input.onChange(value, childErrors);
|
|
15
15
|
}, [props.input.onChange, props.input.name]);
|
|
16
16
|
return (React.createElement("div", { className: b({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
3
|
+
import set from 'lodash/set';
|
|
3
4
|
import { Controller } from '../../../../core';
|
|
4
5
|
const SECRET_PROPERTY_NAME = 'raw';
|
|
5
6
|
export const Secret = (props) => {
|
|
@@ -8,13 +9,13 @@ export const Secret = (props) => {
|
|
|
8
9
|
const childSpec = React.useMemo(() => {
|
|
9
10
|
var _a, _b;
|
|
10
11
|
if ((_a = spec.properties) === null || _a === void 0 ? void 0 : _a[SECRET_PROPERTY_NAME]) {
|
|
11
|
-
const childSpec =
|
|
12
|
+
const childSpec = cloneDeep((_b = spec.properties) === null || _b === void 0 ? void 0 : _b[SECRET_PROPERTY_NAME]);
|
|
12
13
|
childSpec.viewSpec.layout = 'transparent';
|
|
13
14
|
return childSpec;
|
|
14
15
|
}
|
|
15
16
|
return undefined;
|
|
16
17
|
}, [spec.properties]);
|
|
17
|
-
const parentOnChange = React.useCallback((childName, childValue, childErrors) => input.onChange((currentValue) =>
|
|
18
|
+
const parentOnChange = React.useCallback((childName, childValue, childErrors) => input.onChange((currentValue) => set(Object.assign({}, currentValue), childName.split(`${input.name}.`).join(''), childValue), childErrors), [input.onChange, input.name]);
|
|
18
19
|
if (!childSpec) {
|
|
19
20
|
return null;
|
|
20
21
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
.df-table-array__table {
|
|
2
2
|
margin-bottom: 10px;
|
|
3
3
|
}
|
|
4
|
-
.df-table-array__table .
|
|
4
|
+
.df-table-array__table .g-table__cell {
|
|
5
5
|
border-bottom: 0px transparent;
|
|
6
6
|
}
|
|
7
|
-
.df-table-array__row .
|
|
7
|
+
.df-table-array__row .g-table__cell {
|
|
8
8
|
border-bottom: 0px transparent;
|
|
9
9
|
border-top: 1px solid var(--g-color-line-generic);
|
|
10
10
|
}
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
display: none;
|
|
13
13
|
}
|
|
14
14
|
.df-table-array__cell .yc-text-input,
|
|
15
|
+
.df-table-array__cell .g-text-input,
|
|
15
16
|
.df-table-array__cell .yc-select-control,
|
|
17
|
+
.df-table-array__cell .g-select-control,
|
|
16
18
|
.df-table-array__cell .yc-select,
|
|
17
19
|
.df-table-array__cell .g-select {
|
|
18
20
|
max-width: 150px;
|
|
@@ -22,10 +24,14 @@
|
|
|
22
24
|
padding-left: 3px;
|
|
23
25
|
}
|
|
24
26
|
.df-table-array__cell_arr .yc-text-input,
|
|
27
|
+
.df-table-array__cell_arr .g-text-input,
|
|
25
28
|
.df-table-array__cell_arr .yc-select-control:not(.df-multi-select),
|
|
29
|
+
.df-table-array__cell_arr .g-select-control:not(.df-multi-select),
|
|
26
30
|
.df-table-array__cell_arr .yc-select:not(.df-multi-select),
|
|
27
31
|
.df-table-array__cell_arr .g-select:not(.df-multi-select), .df-table-array__cell_obj .yc-text-input,
|
|
32
|
+
.df-table-array__cell_obj .g-text-input,
|
|
28
33
|
.df-table-array__cell_obj .yc-select-control:not(.df-multi-select),
|
|
34
|
+
.df-table-array__cell_obj .g-select-control:not(.df-multi-select),
|
|
29
35
|
.df-table-array__cell_obj .yc-select:not(.df-multi-select),
|
|
30
36
|
.df-table-array__cell_obj .g-select:not(.df-multi-select) {
|
|
31
37
|
max-width: unset;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Plus, TrashBin } from '@gravity-ui/icons';
|
|
3
3
|
import { Button, Icon, Table } from '@gravity-ui/uikit';
|
|
4
|
-
import
|
|
4
|
+
import noop from 'lodash/noop';
|
|
5
|
+
import set from 'lodash/set';
|
|
5
6
|
import { Controller, OBJECT_ARRAY_CNT, OBJECT_ARRAY_FLAG, isArraySpec, isBooleanSpec, isObjectSpec, transformArrIn, } from '../../../../core';
|
|
6
7
|
import { useSearchContext } from '../../../../core/components/Form/hooks';
|
|
7
8
|
import { block } from '../../../utils';
|
|
@@ -22,7 +23,7 @@ export const TableArrayInput = ({ spec, name, arrayInput, input }) => {
|
|
|
22
23
|
const onItemRemove = React.useCallback((key) => {
|
|
23
24
|
arrayInput.onItemRemove(key);
|
|
24
25
|
}, [arrayInput.onItemRemove]);
|
|
25
|
-
const parentOnChange = React.useCallback((childName, childValue, childErrors) => input.onChange((currentValue) =>
|
|
26
|
+
const parentOnChange = React.useCallback((childName, childValue, childErrors) => input.onChange((currentValue) => set(Object.assign({}, currentValue), childName.split(`${input.name}.`).join(''), childValue), childErrors), [input.onChange, input.name]);
|
|
26
27
|
const columns = React.useMemo(() => {
|
|
27
28
|
const { items, viewSpec: { table }, } = spec;
|
|
28
29
|
if (!(table === null || table === void 0 ? void 0 : table.length) || !isObjectSpec(items)) {
|
|
@@ -56,7 +57,7 @@ export const TableArrayInput = ({ spec, name, arrayInput, input }) => {
|
|
|
56
57
|
arr: isArraySpec(preparedEntitySpec),
|
|
57
58
|
obj: isObjectSpec(preparedEntitySpec),
|
|
58
59
|
}), key: `${name}.<${key}>.${property}` },
|
|
59
|
-
React.createElement(Controller, { value: (_c = (_b = input.value) === null || _b === void 0 ? void 0 : _b[`<${key}>`]) === null || _c === void 0 ? void 0 : _c[property], spec: preparedEntitySpec, name: `${name}.<${key}>.${property}`, parentOnChange: parentOnChange, parentOnUnmount:
|
|
60
|
+
React.createElement(Controller, { value: (_c = (_b = input.value) === null || _b === void 0 ? void 0 : _b[`<${key}>`]) === null || _c === void 0 ? void 0 : _c[property], spec: preparedEntitySpec, name: `${name}.<${key}>.${property}`, parentOnChange: parentOnChange, parentOnUnmount: noop })));
|
|
60
61
|
},
|
|
61
62
|
}));
|
|
62
63
|
return [idxColumn, ...columns, removeColumn];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PasswordInput } from '@gravity-ui/components';
|
|
3
3
|
import { TextInput } from '@gravity-ui/uikit';
|
|
4
|
-
import
|
|
4
|
+
import isNil from 'lodash/isNil';
|
|
5
5
|
export const Text = ({ name, input: { value, onBlur, onChange, onFocus }, spec, inputProps, }) => {
|
|
6
|
-
const props = Object.assign(Object.assign({ hasClear: true }, inputProps), { value:
|
|
6
|
+
const props = Object.assign(Object.assign({ hasClear: true }, inputProps), { value: isNil(value) ? '' : `${value}`, onBlur: onBlur, onFocus: onFocus, onUpdate: onChange, disabled: spec.viewSpec.disabled, placeholder: spec.viewSpec.placeholder, qa: name });
|
|
7
7
|
if (spec.viewSpec.type === 'password') {
|
|
8
8
|
return (React.createElement(PasswordInput, Object.assign({}, props, { autoComplete: "new-password", showCopyButton: true, showRevealButton: true })));
|
|
9
9
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Label, Text } from '@gravity-ui/uikit';
|
|
4
|
-
import
|
|
4
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
5
5
|
import { block } from '../../../utils';
|
|
6
6
|
import { LazyLoader } from '../../LazyLoader';
|
|
7
7
|
import { loadIcon } from './utils';
|
|
@@ -29,7 +29,7 @@ export const TextContent = (_a) => {
|
|
|
29
29
|
React.createElement(Text, { color: "secondary" }, input.value))) : null));
|
|
30
30
|
}
|
|
31
31
|
if (Layout) {
|
|
32
|
-
const _spec =
|
|
32
|
+
const _spec = cloneDeep(spec);
|
|
33
33
|
if (!(textContentParams === null || textContentParams === void 0 ? void 0 : textContentParams.text)) {
|
|
34
34
|
_spec.viewSpec.layoutDescription = undefined;
|
|
35
35
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
3
|
+
import set from 'lodash/set';
|
|
3
4
|
import { Controller, isStringSpec, } from '../../../../core';
|
|
4
5
|
const TEXT_LINK_PROPERTY_NAME = 'text';
|
|
5
6
|
export const TextLink = (props) => {
|
|
6
7
|
var _a;
|
|
7
8
|
const { spec, input, name, Layout } = props;
|
|
8
|
-
const parentOnChange = React.useCallback((childName, childValue, childErrors) => input.onChange((currentValue) =>
|
|
9
|
+
const parentOnChange = React.useCallback((childName, childValue, childErrors) => input.onChange((currentValue) => set(Object.assign({}, currentValue), childName.split(`${name}.`).join(''), childValue), childErrors), [input.onChange, input.name]);
|
|
9
10
|
const childSpec = React.useMemo(() => {
|
|
10
11
|
var _a;
|
|
11
12
|
if (((_a = spec.properties) === null || _a === void 0 ? void 0 : _a[TEXT_LINK_PROPERTY_NAME]) &&
|
|
12
13
|
isStringSpec(spec.properties[TEXT_LINK_PROPERTY_NAME])) {
|
|
13
|
-
const childSpec =
|
|
14
|
+
const childSpec = cloneDeep(spec.properties[TEXT_LINK_PROPERTY_NAME]);
|
|
14
15
|
childSpec.viewSpec.layout = 'transparent';
|
|
15
16
|
return childSpec;
|
|
16
17
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ArrayLayoutProps, ObjectLayoutProps } from '../../../../core';
|
|
2
|
-
export declare const Accordeon: <T extends ArrayLayoutProps<
|
|
2
|
+
export declare const Accordeon: <T extends ArrayLayoutProps<undefined, undefined> | ObjectLayoutProps<undefined, undefined>>({ name, spec, input, meta, children, }: T) => JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ArrayLayoutProps, ObjectLayoutProps } from '../../../../core';
|
|
2
2
|
import './AccordeonCardForm.css';
|
|
3
|
-
export declare const AccordeonCardForm: <T extends ArrayLayoutProps<
|
|
3
|
+
export declare const AccordeonCardForm: <T extends ArrayLayoutProps<undefined, undefined> | ObjectLayoutProps<undefined, undefined>>({ name, spec, input, children, meta, }: T) => JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FieldValue, LayoutProps, Spec } from '../../../core';
|
|
2
|
-
export declare const CardAccordeon: <T extends FieldValue, S extends Spec
|
|
2
|
+
export declare const CardAccordeon: <T extends FieldValue, S extends Spec<any, undefined, undefined>>({ name, spec, input, meta, children, }: LayoutProps<T, undefined, undefined, S>) => JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FieldValue, LayoutProps, Spec } from '../../../core';
|
|
2
|
-
export declare const CardSection: <T extends FieldValue, S extends Spec
|
|
2
|
+
export declare const CardSection: <T extends FieldValue, S extends Spec<any, undefined, undefined>>({ name, spec, input, meta, children, }: LayoutProps<T, undefined, undefined, S>) => JSX.Element;
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
position: absolute;
|
|
42
42
|
margin-top: 1px;
|
|
43
43
|
}
|
|
44
|
-
.df-row__note-inner .
|
|
44
|
+
.df-row__note-inner .g-help-popover {
|
|
45
45
|
display: flex;
|
|
46
46
|
}
|
|
47
|
-
.df-row__note-inner .
|
|
47
|
+
.df-row__note-inner .g-help-popover > span {
|
|
48
48
|
display: flex;
|
|
49
49
|
}
|
|
50
50
|
.df-row__right {
|
|
@@ -1,4 +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
|
|
4
|
-
export declare const RowVerbose: <T extends FieldValue, S extends Spec
|
|
3
|
+
export declare const Row: <T extends FieldValue, S extends Spec<any, undefined, undefined>>(props: LayoutProps<T, undefined, undefined, S>) => JSX.Element;
|
|
4
|
+
export declare const RowVerbose: <T extends FieldValue, S extends Spec<any, undefined, undefined>>(props: LayoutProps<T, undefined, undefined, S>) => JSX.Element;
|
|
@@ -28,5 +28,5 @@ const RowBase = ({ name, spec, input, meta, verboseDescription, children, }) =>
|
|
|
28
28
|
React.createElement(Icon, { data: TrashBin, size: 16 }))) : null),
|
|
29
29
|
verboseDescription && spec.viewSpec.layoutDescription ? (React.createElement("div", { className: b('description'), dangerouslySetInnerHTML: { __html: spec.viewSpec.layoutDescription } })) : null)));
|
|
30
30
|
};
|
|
31
|
-
export const Row = (props) =>
|
|
32
|
-
export const RowVerbose = (props) =>
|
|
31
|
+
export const Row = (props) => React.createElement(RowBase, Object.assign({}, props));
|
|
32
|
+
export const RowVerbose = (props) => React.createElement(RowBase, Object.assign({ verboseDescription: true }, props));
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
.df-section__note {
|
|
29
29
|
margin-left: 5px;
|
|
30
30
|
}
|
|
31
|
-
.df-section__note .
|
|
31
|
+
.df-section__note .g-help-popover {
|
|
32
32
|
display: flex;
|
|
33
33
|
}
|
|
34
|
-
.df-section__note .
|
|
34
|
+
.df-section__note .g-help-popover > span {
|
|
35
35
|
display: flex;
|
|
36
36
|
}
|
|
37
37
|
.df-section__description {
|
|
@@ -6,10 +6,10 @@ interface SectionProps {
|
|
|
6
6
|
ignoreDescription?: boolean;
|
|
7
7
|
descriptionAsSubtitle?: boolean;
|
|
8
8
|
}
|
|
9
|
-
export declare const Section: <D extends FieldValue, T extends FormValue, S extends Spec
|
|
10
|
-
export declare const Section2: <D extends FieldValue, T extends FormValue, S extends Spec
|
|
11
|
-
export declare const SectionWithSubtitle: <D extends FieldValue, T extends FormValue, S extends Spec
|
|
12
|
-
export declare const SectionWithSubtitle2: <D extends FieldValue, T extends FormValue, S extends Spec
|
|
13
|
-
export declare const Group: <D extends FieldValue, T extends FormValue, S extends Spec
|
|
14
|
-
export declare const Group2: <D extends FieldValue, T extends FormValue, S extends Spec
|
|
9
|
+
export declare const Section: <D extends FieldValue, T extends FormValue, S extends Spec<any, undefined, undefined>>(props: (LayoutProps<D, undefined, undefined, S> | ViewLayoutProps<T, S>) & Pick<SectionProps, "ignoreDescription">) => JSX.Element;
|
|
10
|
+
export declare const Section2: <D extends FieldValue, T extends FormValue, S extends Spec<any, undefined, undefined>>(props: (LayoutProps<D, undefined, undefined, S> | ViewLayoutProps<T, S>) & Pick<SectionProps, "ignoreDescription">) => JSX.Element;
|
|
11
|
+
export declare const SectionWithSubtitle: <D extends FieldValue, T extends FormValue, S extends Spec<any, undefined, undefined>>(props: (LayoutProps<D, undefined, undefined, S> | ViewLayoutProps<T, S>) & Pick<SectionProps, "ignoreDescription">) => JSX.Element;
|
|
12
|
+
export declare const SectionWithSubtitle2: <D extends FieldValue, T extends FormValue, S extends Spec<any, undefined, undefined>>(props: (LayoutProps<D, undefined, undefined, S> | ViewLayoutProps<T, S>) & Pick<SectionProps, "ignoreDescription">) => JSX.Element;
|
|
13
|
+
export declare const Group: <D extends FieldValue, T extends FormValue, S extends Spec<any, undefined, undefined>>(props: (LayoutProps<D, undefined, undefined, S> | ViewLayoutProps<T, S>) & Pick<SectionProps, "ignoreDescription">) => JSX.Element;
|
|
14
|
+
export declare const Group2: <D extends FieldValue, T extends FormValue, S extends Spec<any, undefined, undefined>>(props: (LayoutProps<D, undefined, undefined, S> | ViewLayoutProps<T, S>) & Pick<SectionProps, "ignoreDescription">) => JSX.Element;
|
|
15
15
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FieldValue, LayoutProps, Spec } from '../../../../core';
|
|
2
|
-
export declare const TableCell: <T extends FieldValue, S extends Spec
|
|
2
|
+
export declare const TableCell: <T extends FieldValue, S extends Spec<any, undefined, undefined>>({ name, meta, children, }: LayoutProps<T, undefined, undefined, S>) => JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FieldValue, LayoutProps, Spec } from '../../../../core';
|
|
2
2
|
import './Transparent.css';
|
|
3
|
-
export declare const Transparent: <T extends FieldValue, S extends Spec
|
|
3
|
+
export declare const Transparent: <T extends FieldValue, S extends Spec<any, undefined, undefined>>({ name, spec, input, meta, children, }: LayoutProps<T, undefined, undefined, S>) => JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import isUndefined from 'lodash/isUndefined';
|
|
3
3
|
export const LazyLoader = ({ component, initialFallback = React.createElement(React.Fragment, null), }) => {
|
|
4
4
|
const fallback = React.useRef(() => initialFallback);
|
|
5
5
|
const Component = component;
|
|
6
6
|
const updateFallback = async () => {
|
|
7
7
|
const result = await component._result;
|
|
8
|
-
if (!
|
|
8
|
+
if (!isUndefined(result)) {
|
|
9
9
|
fallback.current = result.default;
|
|
10
10
|
}
|
|
11
11
|
};
|
|
@@ -39,6 +39,6 @@ export const LongValue = ({ value, className }) => {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
return (React.createElement("div", { ref: ref, onClick: long ? handleClick : undefined },
|
|
42
|
+
return (React.createElement("div", { className: b('container'), ref: ref, onClick: long ? handleClick : undefined },
|
|
43
43
|
React.createElement(Text, Object.assign({ className: b({ long }, className), ellipsis: true }, currentTextProperies), value)));
|
|
44
44
|
};
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
.df-simple-vertical-accordeon__tooltip {
|
|
21
21
|
margin: 0px 5px;
|
|
22
22
|
}
|
|
23
|
-
.df-simple-vertical-accordeon__tooltip .
|
|
23
|
+
.df-simple-vertical-accordeon__tooltip .g-help-popover {
|
|
24
24
|
display: flex;
|
|
25
25
|
}
|
|
26
|
-
.df-simple-vertical-accordeon__tooltip .
|
|
26
|
+
.df-simple-vertical-accordeon__tooltip .g-help-popover > span {
|
|
27
27
|
display: flex;
|
|
28
28
|
}
|
|
29
29
|
.df-simple-vertical-accordeon__chevron {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import isBoolean from 'lodash/isBoolean';
|
|
3
3
|
import { isNotEmptyValue } from '../../../utils';
|
|
4
4
|
import { SimpleVerticalAccordeon } from '../../SimpleVerticalAccordeon';
|
|
5
5
|
export const ViewAccordeon = ({ name, value, spec, children, }) => {
|
|
6
|
-
const [open, setOpen] = React.useState(
|
|
6
|
+
const [open, setOpen] = React.useState(isBoolean(spec.viewSpec.layoutOpen) ? spec.viewSpec.layoutOpen : true);
|
|
7
7
|
if (!isNotEmptyValue(value, spec)) {
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import isBoolean from 'lodash/isBoolean';
|
|
3
3
|
import { isNotEmptyValue } from '../../../utils';
|
|
4
4
|
import { AccordeonCard } from '../../AccordeonCard';
|
|
5
5
|
export const ViewAccordeonCard = ({ value, name, spec, children, }) => {
|
|
6
|
-
const [open, setOpen] = React.useState(
|
|
6
|
+
const [open, setOpen] = React.useState(isBoolean(spec.viewSpec.layoutOpen) ? spec.viewSpec.layoutOpen : true);
|
|
7
7
|
if (!isNotEmptyValue(value, spec)) {
|
|
8
8
|
return null;
|
|
9
9
|
}
|