@gravity-ui/dynamic-forms 3.4.1 → 3.5.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/build/cjs/lib/core/components/Form/Controller/utils.js +3 -5
- package/build/cjs/lib/kit/components/AccordeonCard/AccordeonCard.css +0 -9
- package/build/cjs/lib/kit/components/AccordeonCard/AccordeonCard.js +10 -3
- package/build/cjs/lib/kit/components/Card/Card.css +0 -6
- package/build/cjs/lib/kit/components/Card/Card.js +1 -1
- package/build/cjs/lib/kit/components/Inputs/FileInput/FileInput.css +0 -4
- package/build/cjs/lib/kit/components/Inputs/FileInput/FileInput.js +1 -1
- package/build/cjs/lib/kit/components/Inputs/MonacoInput/MonacoHeader.css +0 -5
- package/build/cjs/lib/kit/components/Inputs/MonacoInput/MonacoHeader.js +1 -1
- package/build/cjs/lib/kit/components/Inputs/TextContent/TextContent.js +1 -1
- package/build/cjs/lib/kit/components/Layouts/Row/Row.js +2 -2
- package/build/cjs/lib/kit/components/Layouts/Section/Section.js +1 -1
- package/build/cjs/lib/kit/components/LongValue/LongValue.css +0 -6
- package/build/cjs/lib/kit/components/LongValue/LongValue.js +12 -1
- package/build/cjs/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.css +0 -15
- package/build/cjs/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.js +14 -3
- package/build/cjs/lib/kit/components/ViewLayouts/ViewRow/ViewRow.css +0 -6
- package/build/cjs/lib/kit/components/ViewLayouts/ViewRow/ViewRow.js +2 -1
- package/build/cjs/lib/kit/components/Views/NumberWithScaleView/NumberWithScaleView.js +1 -3
- package/build/cjs/lib/kit/components/Views/TextAreaView/TextAreaView.css +0 -8
- package/build/cjs/lib/kit/components/Views/TextAreaView/TextAreaView.js +1 -1
- package/build/esm/lib/core/components/Form/Controller/utils.js +3 -5
- package/build/esm/lib/kit/components/AccordeonCard/AccordeonCard.css +0 -9
- package/build/esm/lib/kit/components/AccordeonCard/AccordeonCard.js +11 -4
- package/build/esm/lib/kit/components/Card/Card.css +0 -6
- package/build/esm/lib/kit/components/Card/Card.js +2 -2
- package/build/esm/lib/kit/components/Inputs/FileInput/FileInput.css +0 -4
- package/build/esm/lib/kit/components/Inputs/FileInput/FileInput.js +2 -2
- package/build/esm/lib/kit/components/Inputs/MonacoInput/MonacoHeader.css +0 -5
- package/build/esm/lib/kit/components/Inputs/MonacoInput/MonacoHeader.js +2 -2
- package/build/esm/lib/kit/components/Inputs/TextContent/TextContent.js +1 -1
- package/build/esm/lib/kit/components/Layouts/Row/Row.js +3 -3
- package/build/esm/lib/kit/components/Layouts/Section/Section.js +2 -2
- package/build/esm/lib/kit/components/LongValue/LongValue.css +0 -6
- package/build/esm/lib/kit/components/LongValue/LongValue.js +12 -1
- package/build/esm/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.css +0 -15
- package/build/esm/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.d.ts +1 -0
- package/build/esm/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.js +15 -4
- package/build/esm/lib/kit/components/ViewLayouts/ViewRow/ViewRow.css +0 -6
- package/build/esm/lib/kit/components/ViewLayouts/ViewRow/ViewRow.js +2 -1
- package/build/esm/lib/kit/components/Views/NumberWithScaleView/NumberWithScaleView.js +2 -4
- package/build/esm/lib/kit/components/Views/TextAreaView/TextAreaView.css +0 -8
- package/build/esm/lib/kit/components/Views/TextAreaView/TextAreaView.js +2 -2
- package/package.json +1 -1
|
@@ -288,11 +288,9 @@ const updateStore = ({ store, setStore, spec: _spec, name, parentOnChange, paren
|
|
|
288
288
|
parentOnChange,
|
|
289
289
|
parentOnUnmount,
|
|
290
290
|
})), { state: store.state });
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
: {})));
|
|
295
|
-
}
|
|
291
|
+
nextStore = methodOnChange(nextStore, Object.assign({ valOrSetter: (value) => valueMutatorUpdated ? valueMutator.value : value }, (errorMutatorUpdated
|
|
292
|
+
? { errorMutator: errorMutator.value }
|
|
293
|
+
: {})));
|
|
296
294
|
setStore(nextStore);
|
|
297
295
|
}
|
|
298
296
|
else if (updateNonCritical) {
|
|
@@ -47,15 +47,6 @@
|
|
|
47
47
|
justify-content: center;
|
|
48
48
|
order: -1;
|
|
49
49
|
}
|
|
50
|
-
.df-accordeon-card__header-content-title {
|
|
51
|
-
font-weight: 700;
|
|
52
|
-
}
|
|
53
|
-
.df-accordeon-card__header-content-title_size_s {
|
|
54
|
-
font-size: 13px;
|
|
55
|
-
}
|
|
56
|
-
.df-accordeon-card__header-content-title_size_m {
|
|
57
|
-
font-size: 16px;
|
|
58
|
-
}
|
|
59
50
|
.df-accordeon-card__header-content-description {
|
|
60
51
|
margin-top: 12px;
|
|
61
52
|
color: var(--g-color-text-complementary);
|
|
@@ -31,15 +31,22 @@ const AccordeonCard = ({ className, name, header, description, open: propsOpen,
|
|
|
31
31
|
accordeonRef.current.classList.add('df-accordeon-card_empty');
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
+
const currentHeaderVariant = react_1.default.useMemo(() => {
|
|
35
|
+
if (!lodash_1.default.isString(header)) {
|
|
36
|
+
return 'body-1';
|
|
37
|
+
}
|
|
38
|
+
if (titleSize === 'm') {
|
|
39
|
+
return 'subheader-2';
|
|
40
|
+
}
|
|
41
|
+
return 'subheader-1';
|
|
42
|
+
}, [titleSize]);
|
|
34
43
|
return (react_1.default.createElement("div", { ref: accordeonRef, className: b({ empty: Boolean(emptyBody) }, className) },
|
|
35
44
|
react_1.default.createElement("div", { className: b('header', {
|
|
36
45
|
open: open && !emptyBody,
|
|
37
46
|
'without-action': ignoreHeaderToggle || alwaysOpen,
|
|
38
47
|
}), onClick: !ignoreHeaderToggle && !alwaysOpen ? handleToggle : undefined },
|
|
39
48
|
react_1.default.createElement("div", { className: b('header-content') },
|
|
40
|
-
react_1.default.createElement(
|
|
41
|
-
? b('header-content-title', { size: titleSize })
|
|
42
|
-
: undefined }, header),
|
|
49
|
+
react_1.default.createElement(uikit_1.Text, { variant: currentHeaderVariant }, header),
|
|
43
50
|
description ? (react_1.default.createElement("span", { className: b('header-content-description'), dangerouslySetInnerHTML: { __html: description } })) : null),
|
|
44
51
|
!emptyBody && !alwaysOpen ? (react_1.default.createElement("div", { className: b('header-toggle-btn'), onClick: preventEvent },
|
|
45
52
|
headerActionsTemplate ? (react_1.default.createElement("div", { className: b('interal-actions') }, headerActionsTemplate)) : null,
|
|
@@ -48,12 +48,6 @@
|
|
|
48
48
|
margin-left: 10px;
|
|
49
49
|
}
|
|
50
50
|
.df-card__title {
|
|
51
|
-
font-size: var(--g-text-subheader-2-font-size);
|
|
52
|
-
font-weight: var(--g-text-subheader-font-weight);
|
|
53
|
-
line-height: var(--g-text-subheader-2-line-height);
|
|
54
|
-
white-space: nowrap;
|
|
55
|
-
overflow: hidden;
|
|
56
|
-
text-overflow: ellipsis;
|
|
57
51
|
max-width: 533px;
|
|
58
52
|
}
|
|
59
53
|
.df-card__note {
|
|
@@ -38,7 +38,7 @@ const Card = ({ name, title: propsTitle, description, actions, open: propsOpen,
|
|
|
38
38
|
if (lodash_1.default.isString(propsTitle)) {
|
|
39
39
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
40
40
|
react_1.default.createElement(uikit_1.Popover, { content: propsTitle, disabled: titlePopoverDisabled, placement: common_1.COMMON_POPOVER_PLACEMENT },
|
|
41
|
-
react_1.default.createElement(
|
|
41
|
+
react_1.default.createElement(uikit_1.Text, { className: b('title'), ellipsis: true, ref: titleRef, variant: "subheader-2" }, propsTitle)),
|
|
42
42
|
description ? (react_1.default.createElement("div", { className: b('note') },
|
|
43
43
|
react_1.default.createElement(components_1.HelpPopover, { htmlContent: description, placement: common_1.COMMON_POPOVER_PLACEMENT }))) : null));
|
|
44
44
|
}
|
|
@@ -43,7 +43,7 @@ const FileInput = ({ name, input, spec }) => {
|
|
|
43
43
|
return (react_1.default.createElement("div", { className: b() },
|
|
44
44
|
react_1.default.createElement(uikit_1.Button, { disabled: spec.viewSpec.disabled, onClick: handleClick, qa: `${name}-file-upload` }, (0, i18n_1.default)('button-upload_file')),
|
|
45
45
|
react_1.default.createElement("input", { type: "file", ref: inputRef, autoComplete: "off", disabled: spec.viewSpec.disabled, onChange: handleInputChange, className: b('input'), tabIndex: -1, accept: (_b = spec.viewSpec.fileInput) === null || _b === void 0 ? void 0 : _b.accept }),
|
|
46
|
-
react_1.default.createElement(
|
|
46
|
+
react_1.default.createElement(uikit_1.Text, { className: b('file-name'), ellipsis: true, color: "secondary" }, fileNameContent),
|
|
47
47
|
value ? (react_1.default.createElement(uikit_1.Button, { view: "flat", onClick: handleReset, disabled: spec.viewSpec.disabled, qa: `${name}-file-remove` },
|
|
48
48
|
react_1.default.createElement(uikit_1.Icon, { data: icons_1.Xmark, size: 16 }))) : null));
|
|
49
49
|
};
|
|
@@ -10,5 +10,5 @@ const b = (0, utils_1.block)('monaco-header');
|
|
|
10
10
|
const MonacoHeader = ({ language, editButton }) => (react_1.default.createElement("div", { className: b() },
|
|
11
11
|
react_1.default.createElement("div", null,
|
|
12
12
|
react_1.default.createElement(uikit_1.Icon, { data: icons_1.File, size: 18 }),
|
|
13
|
-
react_1.default.createElement(
|
|
13
|
+
react_1.default.createElement(uikit_1.Text, { variant: "body-3" }, language)), editButton !== null && editButton !== void 0 ? editButton : null));
|
|
14
14
|
exports.MonacoHeader = MonacoHeader;
|
|
@@ -27,7 +27,7 @@ const TextContent = (_a) => {
|
|
|
27
27
|
iconLib ? (react_1.default.createElement(uikit_1.Text, { color: (_b = spec.viewSpec.textContentParams) === null || _b === void 0 ? void 0 : _b.iconColor, className: b('icon') }, iconLib)) : null,
|
|
28
28
|
content,
|
|
29
29
|
input.value ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
30
|
-
react_1.default.createElement(
|
|
30
|
+
react_1.default.createElement(uikit_1.Text, { className: b('separator') }, ":"),
|
|
31
31
|
react_1.default.createElement(uikit_1.Text, { color: "secondary" }, input.value))) : null));
|
|
32
32
|
}
|
|
33
33
|
if (Layout) {
|
|
@@ -16,9 +16,9 @@ const RowBase = ({ name, spec, input, meta, verboseDescription, children, }) =>
|
|
|
16
16
|
return (react_1.default.createElement("div", { className: b() },
|
|
17
17
|
react_1.default.createElement("div", { className: b('left') },
|
|
18
18
|
react_1.default.createElement("div", { className: b('left-inner') },
|
|
19
|
-
react_1.default.createElement(
|
|
19
|
+
react_1.default.createElement(uikit_1.Text, { className: b('title', { required: spec.required }) }, spec.viewSpec.layoutTitle),
|
|
20
20
|
!verboseDescription && spec.viewSpec.layoutDescription ? (react_1.default.createElement("span", { className: b('note') },
|
|
21
|
-
react_1.default.createElement(
|
|
21
|
+
react_1.default.createElement(uikit_1.Text, { className: b('note-inner') },
|
|
22
22
|
react_1.default.createElement(components_1.HelpPopover, { htmlContent: spec.viewSpec.layoutDescription, placement: ['bottom', 'top'] })))) : null)),
|
|
23
23
|
react_1.default.createElement("div", { className: b('right') },
|
|
24
24
|
react_1.default.createElement("div", { className: b('right-inner') },
|
|
@@ -31,7 +31,7 @@ const SectionBase = (_a) => {
|
|
|
31
31
|
} }));
|
|
32
32
|
}
|
|
33
33
|
else {
|
|
34
|
-
description = (react_1.default.createElement(
|
|
34
|
+
description = (react_1.default.createElement(uikit_1.Text, { className: b('note') },
|
|
35
35
|
react_1.default.createElement(components_1.HelpPopover, { htmlContent: spec.viewSpec.layoutDescription, placement: ['bottom', 'top'] })));
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.LongValue = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const uikit_1 = require("@gravity-ui/uikit");
|
|
6
7
|
const utils_1 = require("../../utils");
|
|
7
8
|
const b = (0, utils_1.block)('long-value');
|
|
8
9
|
const LongValue = ({ value, className }) => {
|
|
@@ -11,6 +12,15 @@ const LongValue = ({ value, className }) => {
|
|
|
11
12
|
const [open, setOpen] = react_1.default.useState(false);
|
|
12
13
|
const [long, setLong] = react_1.default.useState(false);
|
|
13
14
|
const handleClick = react_1.default.useCallback(() => setOpen((f) => !f), [setOpen]);
|
|
15
|
+
const currentTextProperies = react_1.default.useMemo(() => {
|
|
16
|
+
let wordBreak;
|
|
17
|
+
let whiteSpace;
|
|
18
|
+
if (open) {
|
|
19
|
+
wordBreak = 'break-all';
|
|
20
|
+
whiteSpace = 'break-spaces';
|
|
21
|
+
}
|
|
22
|
+
return { wordBreak, whiteSpace };
|
|
23
|
+
}, [open]);
|
|
14
24
|
react_1.default.useEffect(() => {
|
|
15
25
|
if (ref.current) {
|
|
16
26
|
if (value !== prevValue.current) {
|
|
@@ -32,6 +42,7 @@ const LongValue = ({ value, className }) => {
|
|
|
32
42
|
}
|
|
33
43
|
}
|
|
34
44
|
});
|
|
35
|
-
return (react_1.default.createElement("div", { ref: ref,
|
|
45
|
+
return (react_1.default.createElement("div", { ref: ref, onClick: long ? handleClick : undefined },
|
|
46
|
+
react_1.default.createElement(uikit_1.Text, Object.assign({ className: b({ long }, className), ellipsis: true }, currentTextProperies), value)));
|
|
36
47
|
};
|
|
37
48
|
exports.LongValue = LongValue;
|
|
@@ -17,21 +17,6 @@
|
|
|
17
17
|
margin-left: -13px;
|
|
18
18
|
max-width: 533px;
|
|
19
19
|
}
|
|
20
|
-
.df-simple-vertical-accordeon__title {
|
|
21
|
-
font-weight: 500;
|
|
22
|
-
}
|
|
23
|
-
.df-simple-vertical-accordeon__title_size_s {
|
|
24
|
-
margin-bottom: 0;
|
|
25
|
-
font-size: var(--g-text-body-1-font-size);
|
|
26
|
-
}
|
|
27
|
-
.df-simple-vertical-accordeon__title_size_m {
|
|
28
|
-
margin-bottom: 1px;
|
|
29
|
-
font-size: var(--g-text-body2-font-size);
|
|
30
|
-
}
|
|
31
|
-
.df-simple-vertical-accordeon__title_size_l {
|
|
32
|
-
margin-bottom: 2px;
|
|
33
|
-
font-size: var(--g-text-body3-font-size);
|
|
34
|
-
}
|
|
35
20
|
.df-simple-vertical-accordeon__tooltip {
|
|
36
21
|
margin: 0px 5px;
|
|
37
22
|
}
|
|
@@ -52,7 +52,7 @@ class SimpleVerticalAccordeon extends react_1.default.Component {
|
|
|
52
52
|
}
|
|
53
53
|
render() {
|
|
54
54
|
var _a;
|
|
55
|
-
const {
|
|
55
|
+
const { children, headerActionsTemplate, className, contentClassName, buttonClassName, hideInsteadOfDestroy, withBranchView, viewLayout, name, } = this.props;
|
|
56
56
|
const { open, hidden, isFirstRender } = this.state;
|
|
57
57
|
const content = hideInsteadOfDestroy ? (react_1.default.createElement("div", { ref: this.componentRef, className: b('body', { hidden: !open }) }, children)) : (open && (react_1.default.createElement("div", { ref: this.componentRef, className: b('body', contentClassName) }, children)));
|
|
58
58
|
if (viewLayout && !isFirstRender && hidden) {
|
|
@@ -60,11 +60,12 @@ class SimpleVerticalAccordeon extends react_1.default.Component {
|
|
|
60
60
|
}
|
|
61
61
|
const title = this.getTitle();
|
|
62
62
|
const titlePopoverDisabled = (((_a = this.titleRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) || 0) <= TITLE_TEXT_MAX_WIDTH;
|
|
63
|
+
const currentTitleVariant = this.getCurrentTitleVariant();
|
|
63
64
|
return (Boolean(react_1.default.Children.count(children)) && (react_1.default.createElement("div", { className: b({ branch: withBranchView, view: viewLayout }, className) },
|
|
64
65
|
react_1.default.createElement("div", { className: b('header') },
|
|
65
66
|
react_1.default.createElement(uikit_1.Popover, { content: title, disabled: titlePopoverDisabled, placement: common_1.COMMON_POPOVER_PLACEMENT },
|
|
66
67
|
react_1.default.createElement(uikit_1.Button, { view: "flat", className: b('header-inner', buttonClassName), onClick: this.handleClick, qa: `${name}-accordeon-toggler`, width: "auto" },
|
|
67
|
-
react_1.default.createElement(
|
|
68
|
+
react_1.default.createElement(uikit_1.Text, { variant: currentTitleVariant }, title),
|
|
68
69
|
react_1.default.createElement(uikit_1.Icon, { data: icons_1.ChevronDown, className: b('chevron', { open }), size: 16 }))),
|
|
69
70
|
this.getTooltip(),
|
|
70
71
|
headerActionsTemplate ? headerActionsTemplate : null),
|
|
@@ -77,9 +78,19 @@ class SimpleVerticalAccordeon extends react_1.default.Component {
|
|
|
77
78
|
}
|
|
78
79
|
return this.state.open ? openTitle : title;
|
|
79
80
|
}
|
|
81
|
+
getCurrentTitleVariant() {
|
|
82
|
+
const { titleSize } = this.props;
|
|
83
|
+
if (titleSize === 'm') {
|
|
84
|
+
return 'body-2';
|
|
85
|
+
}
|
|
86
|
+
if (titleSize === 'l') {
|
|
87
|
+
return 'body-3';
|
|
88
|
+
}
|
|
89
|
+
return 'body-1';
|
|
90
|
+
}
|
|
80
91
|
getTooltip() {
|
|
81
92
|
const { note } = this.props;
|
|
82
|
-
return note ? (react_1.default.createElement(
|
|
93
|
+
return note ? (react_1.default.createElement(uikit_1.Text, { className: b('tooltip') },
|
|
83
94
|
react_1.default.createElement(components_1.HelpPopover, { htmlContent: note, placement: ['bottom', 'top'] }))) : null;
|
|
84
95
|
}
|
|
85
96
|
}
|
|
@@ -14,12 +14,6 @@
|
|
|
14
14
|
align-items: baseline;
|
|
15
15
|
overflow: hidden;
|
|
16
16
|
}
|
|
17
|
-
.df-view-row__title {
|
|
18
|
-
white-space: nowrap;
|
|
19
|
-
overflow: hidden;
|
|
20
|
-
text-overflow: ellipsis;
|
|
21
|
-
color: var(--g-color-text-secondary);
|
|
22
|
-
}
|
|
23
17
|
.df-view-row__dots {
|
|
24
18
|
min-width: 40px;
|
|
25
19
|
flex-grow: 1;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ViewRow = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const uikit_1 = require("@gravity-ui/uikit");
|
|
6
7
|
const kit_1 = require("../../../../kit");
|
|
7
8
|
const utils_1 = require("../../../utils");
|
|
8
9
|
const b = (0, utils_1.block)('view-row');
|
|
@@ -12,7 +13,7 @@ const ViewRow = ({ value, spec, children, }) => {
|
|
|
12
13
|
}
|
|
13
14
|
return (react_1.default.createElement("div", { className: b() },
|
|
14
15
|
react_1.default.createElement("div", { className: b('left') },
|
|
15
|
-
react_1.default.createElement(
|
|
16
|
+
react_1.default.createElement(uikit_1.Text, { whiteSpace: "nowrap", color: "secondary", ellipsis: true }, spec.viewSpec.layoutTitle),
|
|
16
17
|
react_1.default.createElement("div", { className: b('dots') })),
|
|
17
18
|
react_1.default.createElement("div", { className: b('right') }, children),
|
|
18
19
|
react_1.default.createElement(kit_1.CopyButton, { spec: spec, value: value })));
|
|
@@ -12,9 +12,7 @@ const NumberWithScaleViewBase = ({ spec, value }) => {
|
|
|
12
12
|
const { scale } = spec.viewSpec.sizeParams;
|
|
13
13
|
return (react_1.default.createElement("div", { className: b() },
|
|
14
14
|
react_1.default.createElement(uikit_1.Popover, { placement: ['bottom', 'top'], content: initialValue, className: b('tooltip-container'), contentClassName: b('tooltip'), disabled: initialValue.length < 26 }, initialValue),
|
|
15
|
-
react_1.default.createElement(
|
|
16
|
-
" ",
|
|
17
|
-
scale[initialType].title)));
|
|
15
|
+
react_1.default.createElement(uikit_1.Text, { className: b('size') }, scale[initialType].title)));
|
|
18
16
|
};
|
|
19
17
|
const NumberWithScaleView = (props) => (0, utils_1.isCorrectSizeParams)(props.spec) && props.value ? react_1.default.createElement(NumberWithScaleViewBase, Object.assign({}, props)) : null;
|
|
20
18
|
exports.NumberWithScaleView = NumberWithScaleView;
|
|
@@ -4,14 +4,6 @@
|
|
|
4
4
|
.df-text-area-view_active {
|
|
5
5
|
cursor: pointer;
|
|
6
6
|
}
|
|
7
|
-
.df-text-area-view__text-view {
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
text-overflow: ellipsis;
|
|
10
|
-
}
|
|
11
|
-
.df-text-area-view__text-view_open {
|
|
12
|
-
white-space: pre-wrap;
|
|
13
|
-
overflow-wrap: break-word;
|
|
14
|
-
}
|
|
15
7
|
.df-text-area-view__chevron {
|
|
16
8
|
margin: 3px;
|
|
17
9
|
}
|
|
@@ -14,7 +14,7 @@ const TextAreaView = ({ value = '' }) => {
|
|
|
14
14
|
setIsOpen(!isOpen);
|
|
15
15
|
}, [isOpen]);
|
|
16
16
|
return (react_1.default.createElement("div", { className: b({ active: isValueLong }), onClick: isValueLong ? handleClick : undefined },
|
|
17
|
-
react_1.default.createElement(
|
|
17
|
+
react_1.default.createElement(uikit_1.Text, { ellipsis: true, whiteSpace: isOpen ? 'break-spaces' : undefined }, value),
|
|
18
18
|
isValueLong ? (react_1.default.createElement("div", null,
|
|
19
19
|
react_1.default.createElement(uikit_1.Icon, { data: icons_1.ChevronDown, className: b('chevron', { open: isOpen }), size: 16 }))) : null));
|
|
20
20
|
};
|
|
@@ -275,11 +275,9 @@ export const updateStore = ({ store, setStore, spec: _spec, name, parentOnChange
|
|
|
275
275
|
parentOnChange,
|
|
276
276
|
parentOnUnmount,
|
|
277
277
|
})), { state: store.state });
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
: {})));
|
|
282
|
-
}
|
|
278
|
+
nextStore = methodOnChange(nextStore, Object.assign({ valOrSetter: (value) => valueMutatorUpdated ? valueMutator.value : value }, (errorMutatorUpdated
|
|
279
|
+
? { errorMutator: errorMutator.value }
|
|
280
|
+
: {})));
|
|
283
281
|
setStore(nextStore);
|
|
284
282
|
}
|
|
285
283
|
else if (updateNonCritical) {
|
|
@@ -47,15 +47,6 @@
|
|
|
47
47
|
justify-content: center;
|
|
48
48
|
order: -1;
|
|
49
49
|
}
|
|
50
|
-
.df-accordeon-card__header-content-title {
|
|
51
|
-
font-weight: 700;
|
|
52
|
-
}
|
|
53
|
-
.df-accordeon-card__header-content-title_size_s {
|
|
54
|
-
font-size: 13px;
|
|
55
|
-
}
|
|
56
|
-
.df-accordeon-card__header-content-title_size_m {
|
|
57
|
-
font-size: 16px;
|
|
58
|
-
}
|
|
59
50
|
.df-accordeon-card__header-content-description {
|
|
60
51
|
margin-top: 12px;
|
|
61
52
|
color: var(--g-color-text-complementary);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ChevronDown } from '@gravity-ui/icons';
|
|
3
|
-
import { Button, Icon } from '@gravity-ui/uikit';
|
|
3
|
+
import { Button, Icon, Text } from '@gravity-ui/uikit';
|
|
4
4
|
import _ from 'lodash';
|
|
5
5
|
import { block } from '../../utils';
|
|
6
6
|
import './AccordeonCard.css';
|
|
@@ -28,15 +28,22 @@ export const AccordeonCard = ({ className, name, header, description, open: prop
|
|
|
28
28
|
accordeonRef.current.classList.add('df-accordeon-card_empty');
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
+
const currentHeaderVariant = React.useMemo(() => {
|
|
32
|
+
if (!_.isString(header)) {
|
|
33
|
+
return 'body-1';
|
|
34
|
+
}
|
|
35
|
+
if (titleSize === 'm') {
|
|
36
|
+
return 'subheader-2';
|
|
37
|
+
}
|
|
38
|
+
return 'subheader-1';
|
|
39
|
+
}, [titleSize]);
|
|
31
40
|
return (React.createElement("div", { ref: accordeonRef, className: b({ empty: Boolean(emptyBody) }, className) },
|
|
32
41
|
React.createElement("div", { className: b('header', {
|
|
33
42
|
open: open && !emptyBody,
|
|
34
43
|
'without-action': ignoreHeaderToggle || alwaysOpen,
|
|
35
44
|
}), onClick: !ignoreHeaderToggle && !alwaysOpen ? handleToggle : undefined },
|
|
36
45
|
React.createElement("div", { className: b('header-content') },
|
|
37
|
-
React.createElement(
|
|
38
|
-
? b('header-content-title', { size: titleSize })
|
|
39
|
-
: undefined }, header),
|
|
46
|
+
React.createElement(Text, { variant: currentHeaderVariant }, header),
|
|
40
47
|
description ? (React.createElement("span", { className: b('header-content-description'), dangerouslySetInnerHTML: { __html: description } })) : null),
|
|
41
48
|
!emptyBody && !alwaysOpen ? (React.createElement("div", { className: b('header-toggle-btn'), onClick: preventEvent },
|
|
42
49
|
headerActionsTemplate ? (React.createElement("div", { className: b('interal-actions') }, headerActionsTemplate)) : null,
|
|
@@ -48,12 +48,6 @@
|
|
|
48
48
|
margin-left: 10px;
|
|
49
49
|
}
|
|
50
50
|
.df-card__title {
|
|
51
|
-
font-size: var(--g-text-subheader-2-font-size);
|
|
52
|
-
font-weight: var(--g-text-subheader-font-weight);
|
|
53
|
-
line-height: var(--g-text-subheader-2-line-height);
|
|
54
|
-
white-space: nowrap;
|
|
55
|
-
overflow: hidden;
|
|
56
|
-
text-overflow: ellipsis;
|
|
57
51
|
max-width: 533px;
|
|
58
52
|
}
|
|
59
53
|
.df-card__note {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { HelpPopover } from '@gravity-ui/components';
|
|
3
3
|
import { ChevronDown } from '@gravity-ui/icons';
|
|
4
|
-
import { Button, Card as CardBase, Icon, Popover } from '@gravity-ui/uikit';
|
|
4
|
+
import { Button, Card as CardBase, Icon, Popover, Text } from '@gravity-ui/uikit';
|
|
5
5
|
import _ from 'lodash';
|
|
6
6
|
import { COMMON_POPOVER_PLACEMENT, COMMON_TITLE_MAX_WIDTH } from '../../constants/common';
|
|
7
7
|
import { block } from '../../utils';
|
|
@@ -35,7 +35,7 @@ export const Card = ({ name, title: propsTitle, description, actions, open: prop
|
|
|
35
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
|
-
React.createElement(
|
|
38
|
+
React.createElement(Text, { className: b('title'), ellipsis: true, ref: titleRef, variant: "subheader-2" }, propsTitle)),
|
|
39
39
|
description ? (React.createElement("div", { className: b('note') },
|
|
40
40
|
React.createElement(HelpPopover, { htmlContent: description, placement: COMMON_POPOVER_PLACEMENT }))) : null));
|
|
41
41
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Xmark } from '@gravity-ui/icons';
|
|
3
|
-
import { Button, Icon, Label } from '@gravity-ui/uikit';
|
|
3
|
+
import { Button, Icon, Label, Text } from '@gravity-ui/uikit';
|
|
4
4
|
import i18n from '../../../../kit/i18n';
|
|
5
5
|
import { block } from '../../../utils';
|
|
6
6
|
import { readFile } from './utils';
|
|
@@ -40,7 +40,7 @@ export const FileInput = ({ name, input, spec }) => {
|
|
|
40
40
|
return (React.createElement("div", { className: b() },
|
|
41
41
|
React.createElement(Button, { disabled: spec.viewSpec.disabled, onClick: handleClick, qa: `${name}-file-upload` }, i18n('button-upload_file')),
|
|
42
42
|
React.createElement("input", { type: "file", ref: inputRef, autoComplete: "off", disabled: spec.viewSpec.disabled, onChange: handleInputChange, className: b('input'), tabIndex: -1, accept: (_b = spec.viewSpec.fileInput) === null || _b === void 0 ? void 0 : _b.accept }),
|
|
43
|
-
React.createElement(
|
|
43
|
+
React.createElement(Text, { className: b('file-name'), ellipsis: true, color: "secondary" }, fileNameContent),
|
|
44
44
|
value ? (React.createElement(Button, { view: "flat", onClick: handleReset, disabled: spec.viewSpec.disabled, qa: `${name}-file-remove` },
|
|
45
45
|
React.createElement(Icon, { data: Xmark, size: 16 }))) : null));
|
|
46
46
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { File } from '@gravity-ui/icons';
|
|
3
|
-
import { Icon } from '@gravity-ui/uikit';
|
|
3
|
+
import { Icon, Text } from '@gravity-ui/uikit';
|
|
4
4
|
import { block } from '../../../utils';
|
|
5
5
|
import './MonacoHeader.css';
|
|
6
6
|
const b = block('monaco-header');
|
|
7
7
|
export const MonacoHeader = ({ language, editButton }) => (React.createElement("div", { className: b() },
|
|
8
8
|
React.createElement("div", null,
|
|
9
9
|
React.createElement(Icon, { data: File, size: 18 }),
|
|
10
|
-
React.createElement(
|
|
10
|
+
React.createElement(Text, { variant: "body-3" }, language)), editButton !== null && editButton !== void 0 ? editButton : null));
|
|
@@ -25,7 +25,7 @@ export const TextContent = (_a) => {
|
|
|
25
25
|
iconLib ? (React.createElement(Text, { color: (_b = spec.viewSpec.textContentParams) === null || _b === void 0 ? void 0 : _b.iconColor, className: b('icon') }, iconLib)) : null,
|
|
26
26
|
content,
|
|
27
27
|
input.value ? (React.createElement(React.Fragment, null,
|
|
28
|
-
React.createElement(
|
|
28
|
+
React.createElement(Text, { className: b('separator') }, ":"),
|
|
29
29
|
React.createElement(Text, { color: "secondary" }, input.value))) : null));
|
|
30
30
|
}
|
|
31
31
|
if (Layout) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { HelpPopover } from '@gravity-ui/components';
|
|
3
3
|
import { TrashBin } from '@gravity-ui/icons';
|
|
4
|
-
import { Button, Icon } from '@gravity-ui/uikit';
|
|
4
|
+
import { Button, Icon, Text } from '@gravity-ui/uikit';
|
|
5
5
|
import { isArrayItem, isArraySpec, isObjectSpec, withGenerateButton, } from '../../../../core';
|
|
6
6
|
import { ErrorWrapper, GenerateRandomValueButton } from '../../../components';
|
|
7
7
|
import { block } from '../../../utils';
|
|
@@ -13,9 +13,9 @@ const RowBase = ({ name, spec, input, meta, verboseDescription, children, }) =>
|
|
|
13
13
|
return (React.createElement("div", { className: b() },
|
|
14
14
|
React.createElement("div", { className: b('left') },
|
|
15
15
|
React.createElement("div", { className: b('left-inner') },
|
|
16
|
-
React.createElement(
|
|
16
|
+
React.createElement(Text, { className: b('title', { required: spec.required }) }, spec.viewSpec.layoutTitle),
|
|
17
17
|
!verboseDescription && spec.viewSpec.layoutDescription ? (React.createElement("span", { className: b('note') },
|
|
18
|
-
React.createElement(
|
|
18
|
+
React.createElement(Text, { className: b('note-inner') },
|
|
19
19
|
React.createElement(HelpPopover, { htmlContent: spec.viewSpec.layoutDescription, placement: ['bottom', 'top'] })))) : null)),
|
|
20
20
|
React.createElement("div", { className: b('right') },
|
|
21
21
|
React.createElement("div", { className: b('right-inner') },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { HelpPopover } from '@gravity-ui/components';
|
|
4
|
-
import { Popover } from '@gravity-ui/uikit';
|
|
4
|
+
import { Popover, Text } from '@gravity-ui/uikit';
|
|
5
5
|
import { GroupIndent } from '../../';
|
|
6
6
|
import { COMMON_POPOVER_PLACEMENT, COMMON_TITLE_MAX_WIDTH, ErrorWrapper } from '../../../';
|
|
7
7
|
import { isArraySpec, isObjectSpec, } from '../../../../core';
|
|
@@ -29,7 +29,7 @@ const SectionBase = (_a) => {
|
|
|
29
29
|
} }));
|
|
30
30
|
}
|
|
31
31
|
else {
|
|
32
|
-
description = (React.createElement(
|
|
32
|
+
description = (React.createElement(Text, { className: b('note') },
|
|
33
33
|
React.createElement(HelpPopover, { htmlContent: spec.viewSpec.layoutDescription, placement: ['bottom', 'top'] })));
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { Text } from '@gravity-ui/uikit';
|
|
2
3
|
import { block } from '../../utils';
|
|
3
4
|
import './LongValue.css';
|
|
4
5
|
const b = block('long-value');
|
|
@@ -8,6 +9,15 @@ export const LongValue = ({ value, className }) => {
|
|
|
8
9
|
const [open, setOpen] = React.useState(false);
|
|
9
10
|
const [long, setLong] = React.useState(false);
|
|
10
11
|
const handleClick = React.useCallback(() => setOpen((f) => !f), [setOpen]);
|
|
12
|
+
const currentTextProperies = React.useMemo(() => {
|
|
13
|
+
let wordBreak;
|
|
14
|
+
let whiteSpace;
|
|
15
|
+
if (open) {
|
|
16
|
+
wordBreak = 'break-all';
|
|
17
|
+
whiteSpace = 'break-spaces';
|
|
18
|
+
}
|
|
19
|
+
return { wordBreak, whiteSpace };
|
|
20
|
+
}, [open]);
|
|
11
21
|
React.useEffect(() => {
|
|
12
22
|
if (ref.current) {
|
|
13
23
|
if (value !== prevValue.current) {
|
|
@@ -29,5 +39,6 @@ export const LongValue = ({ value, className }) => {
|
|
|
29
39
|
}
|
|
30
40
|
}
|
|
31
41
|
});
|
|
32
|
-
return (React.createElement("div", { ref: ref,
|
|
42
|
+
return (React.createElement("div", { ref: ref, onClick: long ? handleClick : undefined },
|
|
43
|
+
React.createElement(Text, Object.assign({ className: b({ long }, className), ellipsis: true }, currentTextProperies), value)));
|
|
33
44
|
};
|
|
@@ -17,21 +17,6 @@
|
|
|
17
17
|
margin-left: -13px;
|
|
18
18
|
max-width: 533px;
|
|
19
19
|
}
|
|
20
|
-
.df-simple-vertical-accordeon__title {
|
|
21
|
-
font-weight: 500;
|
|
22
|
-
}
|
|
23
|
-
.df-simple-vertical-accordeon__title_size_s {
|
|
24
|
-
margin-bottom: 0;
|
|
25
|
-
font-size: var(--g-text-body-1-font-size);
|
|
26
|
-
}
|
|
27
|
-
.df-simple-vertical-accordeon__title_size_m {
|
|
28
|
-
margin-bottom: 1px;
|
|
29
|
-
font-size: var(--g-text-body2-font-size);
|
|
30
|
-
}
|
|
31
|
-
.df-simple-vertical-accordeon__title_size_l {
|
|
32
|
-
margin-bottom: 2px;
|
|
33
|
-
font-size: var(--g-text-body3-font-size);
|
|
34
|
-
}
|
|
35
20
|
.df-simple-vertical-accordeon__tooltip {
|
|
36
21
|
margin: 0px 5px;
|
|
37
22
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { HelpPopover } from '@gravity-ui/components';
|
|
3
3
|
import { ChevronDown } from '@gravity-ui/icons';
|
|
4
|
-
import { Button, Icon, Popover } from '@gravity-ui/uikit';
|
|
4
|
+
import { Button, Icon, Popover, Text } from '@gravity-ui/uikit';
|
|
5
5
|
import { COMMON_POPOVER_PLACEMENT } from '../../constants/common';
|
|
6
6
|
import { block } from '../../utils';
|
|
7
7
|
import './SimpleVerticalAccordeon.css';
|
|
@@ -49,7 +49,7 @@ export class SimpleVerticalAccordeon extends React.Component {
|
|
|
49
49
|
}
|
|
50
50
|
render() {
|
|
51
51
|
var _a;
|
|
52
|
-
const {
|
|
52
|
+
const { children, headerActionsTemplate, className, contentClassName, buttonClassName, hideInsteadOfDestroy, withBranchView, viewLayout, name, } = this.props;
|
|
53
53
|
const { open, hidden, isFirstRender } = this.state;
|
|
54
54
|
const content = hideInsteadOfDestroy ? (React.createElement("div", { ref: this.componentRef, className: b('body', { hidden: !open }) }, children)) : (open && (React.createElement("div", { ref: this.componentRef, className: b('body', contentClassName) }, children)));
|
|
55
55
|
if (viewLayout && !isFirstRender && hidden) {
|
|
@@ -57,11 +57,12 @@ export class SimpleVerticalAccordeon extends React.Component {
|
|
|
57
57
|
}
|
|
58
58
|
const title = this.getTitle();
|
|
59
59
|
const titlePopoverDisabled = (((_a = this.titleRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) || 0) <= TITLE_TEXT_MAX_WIDTH;
|
|
60
|
+
const currentTitleVariant = this.getCurrentTitleVariant();
|
|
60
61
|
return (Boolean(React.Children.count(children)) && (React.createElement("div", { className: b({ branch: withBranchView, view: viewLayout }, className) },
|
|
61
62
|
React.createElement("div", { className: b('header') },
|
|
62
63
|
React.createElement(Popover, { content: title, disabled: titlePopoverDisabled, placement: COMMON_POPOVER_PLACEMENT },
|
|
63
64
|
React.createElement(Button, { view: "flat", className: b('header-inner', buttonClassName), onClick: this.handleClick, qa: `${name}-accordeon-toggler`, width: "auto" },
|
|
64
|
-
React.createElement(
|
|
65
|
+
React.createElement(Text, { variant: currentTitleVariant }, title),
|
|
65
66
|
React.createElement(Icon, { data: ChevronDown, className: b('chevron', { open }), size: 16 }))),
|
|
66
67
|
this.getTooltip(),
|
|
67
68
|
headerActionsTemplate ? headerActionsTemplate : null),
|
|
@@ -74,9 +75,19 @@ export class SimpleVerticalAccordeon extends React.Component {
|
|
|
74
75
|
}
|
|
75
76
|
return this.state.open ? openTitle : title;
|
|
76
77
|
}
|
|
78
|
+
getCurrentTitleVariant() {
|
|
79
|
+
const { titleSize } = this.props;
|
|
80
|
+
if (titleSize === 'm') {
|
|
81
|
+
return 'body-2';
|
|
82
|
+
}
|
|
83
|
+
if (titleSize === 'l') {
|
|
84
|
+
return 'body-3';
|
|
85
|
+
}
|
|
86
|
+
return 'body-1';
|
|
87
|
+
}
|
|
77
88
|
getTooltip() {
|
|
78
89
|
const { note } = this.props;
|
|
79
|
-
return note ? (React.createElement(
|
|
90
|
+
return note ? (React.createElement(Text, { className: b('tooltip') },
|
|
80
91
|
React.createElement(HelpPopover, { htmlContent: note, placement: ['bottom', 'top'] }))) : null;
|
|
81
92
|
}
|
|
82
93
|
}
|
|
@@ -14,12 +14,6 @@
|
|
|
14
14
|
align-items: baseline;
|
|
15
15
|
overflow: hidden;
|
|
16
16
|
}
|
|
17
|
-
.df-view-row__title {
|
|
18
|
-
white-space: nowrap;
|
|
19
|
-
overflow: hidden;
|
|
20
|
-
text-overflow: ellipsis;
|
|
21
|
-
color: var(--g-color-text-secondary);
|
|
22
|
-
}
|
|
23
17
|
.df-view-row__dots {
|
|
24
18
|
min-width: 40px;
|
|
25
19
|
flex-grow: 1;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { Text } from '@gravity-ui/uikit';
|
|
2
3
|
import { CopyButton } from '../../../../kit';
|
|
3
4
|
import { block, isNotEmptyValue } from '../../../utils';
|
|
4
5
|
import './ViewRow.css';
|
|
@@ -9,7 +10,7 @@ export const ViewRow = ({ value, spec, children, }) => {
|
|
|
9
10
|
}
|
|
10
11
|
return (React.createElement("div", { className: b() },
|
|
11
12
|
React.createElement("div", { className: b('left') },
|
|
12
|
-
React.createElement(
|
|
13
|
+
React.createElement(Text, { whiteSpace: "nowrap", color: "secondary", ellipsis: true }, spec.viewSpec.layoutTitle),
|
|
13
14
|
React.createElement("div", { className: b('dots') })),
|
|
14
15
|
React.createElement("div", { className: b('right') }, children),
|
|
15
16
|
React.createElement(CopyButton, { spec: spec, value: value })));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Popover } from '@gravity-ui/uikit';
|
|
2
|
+
import { Popover, Text } from '@gravity-ui/uikit';
|
|
3
3
|
import { block, isCorrectSizeParams } from '../../../utils';
|
|
4
4
|
import { useInitial } from '../../Inputs/NumberWithScale/useInitial';
|
|
5
5
|
import './NumberWithScaleView.css';
|
|
@@ -9,8 +9,6 @@ const NumberWithScaleViewBase = ({ spec, value }) => {
|
|
|
9
9
|
const { scale } = spec.viewSpec.sizeParams;
|
|
10
10
|
return (React.createElement("div", { className: b() },
|
|
11
11
|
React.createElement(Popover, { placement: ['bottom', 'top'], content: initialValue, className: b('tooltip-container'), contentClassName: b('tooltip'), disabled: initialValue.length < 26 }, initialValue),
|
|
12
|
-
React.createElement(
|
|
13
|
-
" ",
|
|
14
|
-
scale[initialType].title)));
|
|
12
|
+
React.createElement(Text, { className: b('size') }, scale[initialType].title)));
|
|
15
13
|
};
|
|
16
14
|
export const NumberWithScaleView = (props) => isCorrectSizeParams(props.spec) && props.value ? React.createElement(NumberWithScaleViewBase, Object.assign({}, props)) : null;
|
|
@@ -4,14 +4,6 @@
|
|
|
4
4
|
.df-text-area-view_active {
|
|
5
5
|
cursor: pointer;
|
|
6
6
|
}
|
|
7
|
-
.df-text-area-view__text-view {
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
text-overflow: ellipsis;
|
|
10
|
-
}
|
|
11
|
-
.df-text-area-view__text-view_open {
|
|
12
|
-
white-space: pre-wrap;
|
|
13
|
-
overflow-wrap: break-word;
|
|
14
|
-
}
|
|
15
7
|
.df-text-area-view__chevron {
|
|
16
8
|
margin: 3px;
|
|
17
9
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ChevronDown } from '@gravity-ui/icons';
|
|
3
|
-
import { Icon } from '@gravity-ui/uikit';
|
|
3
|
+
import { Icon, Text } from '@gravity-ui/uikit';
|
|
4
4
|
import { block } from '../../../utils';
|
|
5
5
|
import './TextAreaView.css';
|
|
6
6
|
const b = block('text-area-view');
|
|
@@ -11,7 +11,7 @@ export const TextAreaView = ({ value = '' }) => {
|
|
|
11
11
|
setIsOpen(!isOpen);
|
|
12
12
|
}, [isOpen]);
|
|
13
13
|
return (React.createElement("div", { className: b({ active: isValueLong }), onClick: isValueLong ? handleClick : undefined },
|
|
14
|
-
React.createElement(
|
|
14
|
+
React.createElement(Text, { ellipsis: true, whiteSpace: isOpen ? 'break-spaces' : undefined }, value),
|
|
15
15
|
isValueLong ? (React.createElement("div", null,
|
|
16
16
|
React.createElement(Icon, { data: ChevronDown, className: b('chevron', { open: isOpen }), size: 16 }))) : null));
|
|
17
17
|
};
|