@gravity-ui/dynamic-forms 4.16.1 → 5.0.0-beta.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.
Files changed (57) hide show
  1. package/build/cjs/lib/kit/components/Card/Card.css +4 -2
  2. package/build/cjs/lib/kit/components/Card/Card.js +4 -3
  3. package/build/cjs/lib/kit/components/Inputs/CardOneOf/CardOneOf.js +2 -8
  4. package/build/cjs/lib/kit/components/Inputs/CheckboxGroup/CheckboxGroup.css +3 -0
  5. package/build/cjs/lib/kit/components/Inputs/TableArrayInput/TableArrayInput.js +4 -2
  6. package/build/cjs/lib/kit/components/Inputs/Text/Text.js +1 -2
  7. package/build/cjs/lib/kit/components/Inputs/TextContent/TextContent.js +1 -1
  8. package/build/cjs/lib/kit/components/Layouts/Column/Column.js +7 -5
  9. package/build/cjs/lib/kit/components/Layouts/Row/Row.js +7 -5
  10. package/build/cjs/lib/kit/components/Layouts/Section/Section.css +4 -6
  11. package/build/cjs/lib/kit/components/Layouts/Section/Section.js +4 -3
  12. package/build/cjs/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.css +3 -0
  13. package/build/cjs/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.js +4 -3
  14. package/build/cjs/lib/kit/components/TogglerCard/TogglerCard.js +4 -2
  15. package/build/cjs/lib/kit/components/ViewLayouts/ViewColumn/ViewColumn.js +4 -2
  16. package/build/cjs/lib/kit/components/ViewLayouts/ViewRow/ViewRow.js +4 -2
  17. package/build/cjs/lib/kit/components/Views/CardOneOfView.js +3 -13
  18. package/build/cjs/lib/kit/components/Views/CheckboxGroupView/CheckboxGroupView.css +7 -5
  19. package/build/cjs/lib/kit/components/Views/CheckboxGroupView/CheckboxGroupView.js +4 -3
  20. package/build/cjs/lib/kit/components/Views/MultiOneOfView/MultiOneOfView.css +7 -5
  21. package/build/cjs/lib/kit/components/Views/MultiOneOfView/MultiOneOfView.js +3 -1
  22. package/build/cjs/lib/kit/components/Views/MultiSelectView/MultiSelectView.css +7 -5
  23. package/build/cjs/lib/kit/components/Views/MultiSelectView/MultiSelectView.js +3 -1
  24. package/build/cjs/lib/kit/components/Views/NumberWithScaleView/NumberWithScaleView.css +6 -4
  25. package/build/cjs/lib/kit/components/Views/NumberWithScaleView/NumberWithScaleView.js +2 -1
  26. package/build/cjs/lib/kit/components/Views/TableArrayView/TableArrayView.js +4 -2
  27. package/build/cjs/lib/kit/hooks/useOneOf/useOneOf.js +1 -1
  28. package/build/cjs/lib/kit/utils/common.js +8 -5
  29. package/build/esm/lib/kit/components/Card/Card.css +4 -2
  30. package/build/esm/lib/kit/components/Card/Card.js +5 -4
  31. package/build/esm/lib/kit/components/Inputs/CardOneOf/CardOneOf.js +2 -8
  32. package/build/esm/lib/kit/components/Inputs/CheckboxGroup/CheckboxGroup.css +3 -0
  33. package/build/esm/lib/kit/components/Inputs/TableArrayInput/TableArrayInput.js +5 -3
  34. package/build/esm/lib/kit/components/Inputs/Text/Text.js +2 -3
  35. package/build/esm/lib/kit/components/Inputs/TextContent/TextContent.js +1 -1
  36. package/build/esm/lib/kit/components/Layouts/Column/Column.js +5 -3
  37. package/build/esm/lib/kit/components/Layouts/Row/Row.js +5 -3
  38. package/build/esm/lib/kit/components/Layouts/Section/Section.css +4 -6
  39. package/build/esm/lib/kit/components/Layouts/Section/Section.js +5 -4
  40. package/build/esm/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.css +3 -0
  41. package/build/esm/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.js +5 -4
  42. package/build/esm/lib/kit/components/TogglerCard/TogglerCard.js +5 -3
  43. package/build/esm/lib/kit/components/ViewLayouts/ViewColumn/ViewColumn.js +5 -3
  44. package/build/esm/lib/kit/components/ViewLayouts/ViewRow/ViewRow.js +5 -3
  45. package/build/esm/lib/kit/components/Views/CardOneOfView.js +3 -13
  46. package/build/esm/lib/kit/components/Views/CheckboxGroupView/CheckboxGroupView.css +7 -5
  47. package/build/esm/lib/kit/components/Views/CheckboxGroupView/CheckboxGroupView.js +5 -4
  48. package/build/esm/lib/kit/components/Views/MultiOneOfView/MultiOneOfView.css +7 -5
  49. package/build/esm/lib/kit/components/Views/MultiOneOfView/MultiOneOfView.js +4 -2
  50. package/build/esm/lib/kit/components/Views/MultiSelectView/MultiSelectView.css +7 -5
  51. package/build/esm/lib/kit/components/Views/MultiSelectView/MultiSelectView.js +4 -2
  52. package/build/esm/lib/kit/components/Views/NumberWithScaleView/NumberWithScaleView.css +6 -4
  53. package/build/esm/lib/kit/components/Views/NumberWithScaleView/NumberWithScaleView.js +2 -1
  54. package/build/esm/lib/kit/components/Views/TableArrayView/TableArrayView.js +5 -3
  55. package/build/esm/lib/kit/hooks/useOneOf/useOneOf.js +2 -2
  56. package/build/esm/lib/kit/utils/common.js +8 -5
  57. package/package.json +5 -6
@@ -42,7 +42,7 @@ const isNotEmptyValue = (value, spec) => {
42
42
  };
43
43
  exports.isNotEmptyValue = isNotEmptyValue;
44
44
  const prepareSpec = (spec, parseJsonDefaultValue, overridePatternError) => {
45
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
45
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
46
46
  if ((0, isObjectLike_1.default)(spec)) {
47
47
  const result = (0, cloneDeep_1.default)(spec);
48
48
  if ((0, isString_1.default)(result.type)) {
@@ -54,7 +54,7 @@ const prepareSpec = (spec, parseJsonDefaultValue, overridePatternError) => {
54
54
  try {
55
55
  _defaultValue = JSON.parse(result.defaultValue);
56
56
  }
57
- catch (_k) {
57
+ catch (_l) {
58
58
  _defaultValue = undefined;
59
59
  }
60
60
  }
@@ -75,14 +75,17 @@ const prepareSpec = (spec, parseJsonDefaultValue, overridePatternError) => {
75
75
  if ((0, isString_1.default)((_c = result.viewSpec) === null || _c === void 0 ? void 0 : _c.addButtonPosition)) {
76
76
  result.viewSpec.addButtonPosition = result.viewSpec.addButtonPosition.toLowerCase();
77
77
  }
78
- if ((0, isString_1.default)((_e = (_d = result.viewSpec) === null || _d === void 0 ? void 0 : _d.oneOfParams) === null || _e === void 0 ? void 0 : _e.toggler)) {
78
+ if ((0, isString_1.default)((_d = result.viewSpec) === null || _d === void 0 ? void 0 : _d.themeLabel)) {
79
+ result.viewSpec.textContentParams = Object.assign(Object.assign({}, result.viewSpec.textContentParams), { themeLabel: result.viewSpec.themeLabel.toLowerCase() });
80
+ }
81
+ if ((0, isString_1.default)((_f = (_e = result.viewSpec) === null || _e === void 0 ? void 0 : _e.oneOfParams) === null || _f === void 0 ? void 0 : _f.toggler)) {
79
82
  result.viewSpec.oneOfParams.toggler = result.viewSpec.oneOfParams.toggler.toLowerCase();
80
83
  }
81
- if ((0, isString_1.default)((_g = (_f = result.viewSpec) === null || _f === void 0 ? void 0 : _f.textContentParams) === null || _g === void 0 ? void 0 : _g.themeLabel)) {
84
+ if ((0, isString_1.default)((_h = (_g = result.viewSpec) === null || _g === void 0 ? void 0 : _g.textContentParams) === null || _h === void 0 ? void 0 : _h.themeLabel)) {
82
85
  result.viewSpec.textContentParams.themeLabel =
83
86
  result.viewSpec.textContentParams.themeLabel.toLowerCase();
84
87
  }
85
- if ((0, isString_1.default)((_j = (_h = result.viewSpec) === null || _h === void 0 ? void 0 : _h.textContentParams) === null || _j === void 0 ? void 0 : _j.themeAlert)) {
88
+ if ((0, isString_1.default)((_k = (_j = result.viewSpec) === null || _j === void 0 ? void 0 : _j.textContentParams) === null || _k === void 0 ? void 0 : _k.themeAlert)) {
86
89
  result.viewSpec.textContentParams.themeAlert =
87
90
  result.viewSpec.textContentParams.themeAlert.toLowerCase();
88
91
  }
@@ -70,8 +70,10 @@
70
70
  max-width: var(--df-card-title-max-width, 533px);
71
71
  height: var(--df-card-title-height, var(--g-spacing-5));
72
72
  }
73
- .df-card__title-popover {
74
- height: var(--df-card-title-popover-height, var(--g-spacing-5));
73
+ .df-card__popover {
74
+ padding: var(--g-spacing-2);
75
+ overflow-wrap: break-word;
76
+ max-width: 300px;
75
77
  }
76
78
  .df-card__note {
77
79
  margin-left: var(--df-card-note-margin-left, 5px);
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
- import { HelpPopover } from '@gravity-ui/components';
3
2
  import { ChevronDown } from '@gravity-ui/icons';
4
- import { Button, Card as CardBase, Icon, Popover, Text } from '@gravity-ui/uikit';
3
+ import { Button, Card as CardBase, HelpMark, Icon, Popover, Text } from '@gravity-ui/uikit';
5
4
  import isString from 'lodash/isString';
6
5
  import { COMMON_POPOVER_PLACEMENT, COMMON_TITLE_MAX_WIDTH } from '../../constants/common';
7
6
  import { block } from '../../utils';
@@ -34,10 +33,12 @@ export const Card = ({ name, title: propsTitle, description, actions, open: prop
34
33
  const title = React.useMemo(() => {
35
34
  if (isString(propsTitle)) {
36
35
  return (React.createElement(React.Fragment, null,
37
- React.createElement(Popover, { content: propsTitle, disabled: titlePopoverDisabled, placement: COMMON_POPOVER_PLACEMENT, className: b('title-popover') },
36
+ React.createElement(Popover, { content: propsTitle, disabled: titlePopoverDisabled, placement: COMMON_POPOVER_PLACEMENT, className: b('popover') },
38
37
  React.createElement(Text, { className: b('title'), ellipsis: true, ref: titleRef, variant: "subheader-2" }, propsTitle)),
39
38
  description ? (React.createElement("div", { className: b('note') },
40
- React.createElement(HelpPopover, { htmlContent: description, placement: COMMON_POPOVER_PLACEMENT }))) : null));
39
+ React.createElement(HelpMark, { popoverProps: {
40
+ placement: COMMON_POPOVER_PLACEMENT,
41
+ } }, description))) : null));
41
42
  }
42
43
  return propsTitle;
43
44
  }, [propsTitle, titlePopoverDisabled, description]);
@@ -7,7 +7,7 @@ import { Row } from '../../Layouts';
7
7
  import { RemoveButton } from '../../RemoveButton';
8
8
  export const CardOneOf = (props) => {
9
9
  var _a;
10
- const { input, meta, spec, name, Layout } = props;
10
+ const { input, meta, spec, name } = props;
11
11
  const [open, setOpen] = React.useState(true);
12
12
  const onToggle = React.useCallback(() => setOpen((f) => !f), [setOpen]);
13
13
  const onOpen = React.useCallback(() => setOpen(true), [setOpen]);
@@ -15,13 +15,7 @@ export const CardOneOf = (props) => {
15
15
  props,
16
16
  onTogglerChange: onOpen,
17
17
  });
18
- const toggler = React.useMemo(() => {
19
- const togglerProps = Object.assign(Object.assign({}, props), { name: '__stub-name', children: togglerInput });
20
- if (Layout) {
21
- return React.createElement(Layout, Object.assign({}, togglerProps));
22
- }
23
- return React.createElement(Row, Object.assign({}, togglerProps));
24
- }, [togglerInput, props, Layout]);
18
+ const toggler = React.useMemo(() => (React.createElement(Row, Object.assign({}, props, { name: "__stub-name" }), togglerInput)), [togglerInput, props]);
25
19
  const actions = React.useMemo(() => {
26
20
  if (isArrayItem(name)) {
27
21
  return React.createElement(RemoveButton, { onDrop: input.onDrop, name: name });
@@ -22,6 +22,9 @@
22
22
  align-items: center;
23
23
  height: var(--df-checkbox-height, 28px);
24
24
  }
25
+ .df-checkbox-group .g-control-label__text {
26
+ margin-inline-start: var(--df-checkbox-margint-start, 5px);
27
+ }
25
28
  .df-checkbox-group > *:not(:last-child) {
26
29
  margin-right: var(--df-checkbox-group-child-margin-right, 6px);
27
30
  }
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
2
  import { Plus, TrashBin } from '@gravity-ui/icons';
3
- import { Button, Flex, Icon, Table } from '@gravity-ui/uikit';
4
- import { HelpPopover } from '@gravity-ui/components';
3
+ import { Button, Flex, HelpMark, Icon, Table } from '@gravity-ui/uikit';
5
4
  import noop from 'lodash/noop';
6
5
  import set from 'lodash/set';
7
6
  import { Controller, OBJECT_ARRAY_CNT, OBJECT_ARRAY_FLAG, isArraySpec, isBooleanSpec, isObjectSpec, transformArrIn, } from '../../../../core';
8
7
  import { useSearchContext } from '../../../../core/components/Form/hooks';
9
8
  import { block } from '../../../utils';
9
+ import { COMMON_POPOVER_PLACEMENT } from '../../../constants/common';
10
10
  import './TableArrayInput.css';
11
11
  const b = block('table-array');
12
12
  export const TableArrayInput = ({ spec, name, arrayInput, input }) => {
@@ -49,7 +49,9 @@ export const TableArrayInput = ({ spec, name, arrayInput, input }) => {
49
49
  ? label
50
50
  : () => (React.createElement(Flex, { gap: 0.5, alignItems: "center" },
51
51
  label,
52
- React.createElement(HelpPopover, { htmlContent: description, placement: ['bottom', 'top'] }))),
52
+ React.createElement(HelpMark, { popoverProps: {
53
+ placement: COMMON_POPOVER_PLACEMENT,
54
+ } }, description))),
53
55
  template: ({ key, }, idx) => {
54
56
  var _a, _b, _c;
55
57
  const entitySpec = (_a = items === null || items === void 0 ? void 0 : items.properties) === null || _a === void 0 ? void 0 : _a[property];
@@ -1,11 +1,10 @@
1
1
  import React from 'react';
2
- import { PasswordInput } from '@gravity-ui/components';
3
- import { TextInput } from '@gravity-ui/uikit';
2
+ import { PasswordInput, TextInput } from '@gravity-ui/uikit';
4
3
  import isNil from 'lodash/isNil';
5
4
  export const Text = ({ name, input: { value, onBlur, onChange, onFocus }, spec, inputProps, }) => {
6
5
  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
6
  if (spec.viewSpec.type === 'password') {
8
- return (React.createElement(PasswordInput, Object.assign({}, props, { autoComplete: "new-password", showCopyButton: true, showRevealButton: true })));
7
+ return React.createElement(PasswordInput, Object.assign({}, props, { autoComplete: "new-password" }));
9
8
  }
10
9
  return React.createElement(TextInput, Object.assign({}, props, { type: "text" }));
11
10
  };
@@ -14,7 +14,7 @@ export const TextContentComponent = ({ spec, value, Layout, }) => {
14
14
  if (!text) {
15
15
  return null;
16
16
  }
17
- const iconLib = (textContentParams === null || textContentParams === void 0 ? void 0 : textContentParams.icon) ? (React.createElement(LazyLoader, { component: loadIcon(textContentParams === null || textContentParams === void 0 ? void 0 : textContentParams.icon) })) : null;
17
+ const iconLib = (textContentParams === null || textContentParams === void 0 ? void 0 : textContentParams.icon) ? (React.createElement(LazyLoader, { component: loadIcon(textContentParams === null || textContentParams === void 0 ? void 0 : textContentParams.icon) })) : undefined;
18
18
  let content = React.createElement("span", { dangerouslySetInnerHTML: { __html: text } });
19
19
  if (textContentParams === null || textContentParams === void 0 ? void 0 : textContentParams.themeAlert) {
20
20
  const titleAlert = (textContentParams === null || textContentParams === void 0 ? void 0 : textContentParams.titleAlert) || !isEmpty(textContentParams === null || textContentParams === void 0 ? void 0 : textContentParams.titleAlert)
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
- import { HelpPopover } from '@gravity-ui/components';
3
2
  import { TrashBin } from '@gravity-ui/icons';
4
- import { Button, Icon, Text } from '@gravity-ui/uikit';
3
+ import { Button, HelpMark, Icon, Text } from '@gravity-ui/uikit';
5
4
  import { isArrayItem, isArraySpec, isObjectSpec, withGenerateButton, } from '../../../../core';
6
5
  import { ErrorWrapper, GenerateRandomValueButton } from '../../../components';
7
6
  import { block } from '../../../utils';
7
+ import { COMMON_POPOVER_PLACEMENT } from '../../../constants/common';
8
8
  import './Column.css';
9
9
  const b = block('column');
10
10
  const ColumnBase = ({ name, spec, input, meta, children, }) => {
@@ -16,7 +16,9 @@ const ColumnBase = ({ name, spec, input, meta, children, }) => {
16
16
  React.createElement(Text, { className: b('title', { required: spec.required }) }, spec.viewSpec.layoutTitle),
17
17
  spec.viewSpec.layoutDescription ? (React.createElement("span", { className: b('note') },
18
18
  React.createElement(Text, { className: b('note-inner') },
19
- React.createElement(HelpPopover, { htmlContent: spec.viewSpec.layoutDescription, placement: ['bottom', 'top'] })))) : null)),
19
+ React.createElement(HelpMark, { popoverProps: {
20
+ placement: COMMON_POPOVER_PLACEMENT,
21
+ } }, spec.viewSpec.layoutDescription)))) : null)),
20
22
  React.createElement("div", { className: b('second-row') },
21
23
  React.createElement("div", { className: b('second-row-inner') },
22
24
  React.createElement(ErrorWrapper, { name: name, meta: meta, withoutChildErrorStyles:
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
- import { HelpPopover } from '@gravity-ui/components';
3
2
  import { TrashBin } from '@gravity-ui/icons';
4
- import { Button, Icon, Text } from '@gravity-ui/uikit';
3
+ import { Button, HelpMark, Icon, Text } from '@gravity-ui/uikit';
5
4
  import { isArrayItem, isArraySpec, isObjectSpec, withGenerateButton, } from '../../../../core';
6
5
  import { ErrorWrapper, GenerateRandomValueButton } from '../../../components';
7
6
  import { block } from '../../../utils';
7
+ import { COMMON_POPOVER_PLACEMENT } from '../../../constants/common';
8
8
  import './Row.css';
9
9
  const b = block('row');
10
10
  const RowBase = ({ name, spec, input, meta, verboseDescription, children, }) => {
@@ -16,7 +16,9 @@ const RowBase = ({ name, spec, input, meta, verboseDescription, children, }) =>
16
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
18
  React.createElement(Text, { className: b('note-inner') },
19
- React.createElement(HelpPopover, { htmlContent: spec.viewSpec.layoutDescription, placement: ['bottom', 'top'] })))) : null)),
19
+ React.createElement(HelpMark, { popoverProps: {
20
+ placement: COMMON_POPOVER_PLACEMENT,
21
+ } }, spec.viewSpec.layoutDescription)))) : null)),
20
22
  React.createElement("div", { className: b('right') },
21
23
  React.createElement("div", { className: b('right-inner') },
22
24
  React.createElement(ErrorWrapper, { name: name, meta: meta, withoutChildErrorStyles:
@@ -37,12 +37,10 @@
37
37
  .df-section__title {
38
38
  max-width: var(--df-section-title-max-width, 533px);
39
39
  }
40
- .df-section__title-popover {
41
- display: flex;
42
- align-items: center;
43
- }
44
- .df-section__title-popover .g-popover__handler {
45
- display: flex;
40
+ .df-section__popover {
41
+ padding: var(--g-spacing-2);
42
+ overflow-wrap: break-word;
43
+ max-width: 300px;
46
44
  }
47
45
  .df-section__note {
48
46
  margin-left: var(--df-section-note-margin-left, 5px);
@@ -1,7 +1,6 @@
1
1
  import { __rest } from "tslib";
2
2
  import React from 'react';
3
- import { HelpPopover } from '@gravity-ui/components';
4
- import { Popover, Text } from '@gravity-ui/uikit';
3
+ import { HelpMark, Popover, Text } from '@gravity-ui/uikit';
5
4
  import { GroupIndent } from '../../';
6
5
  import { RemoveButton } from '../../RemoveButton';
7
6
  import { COMMON_POPOVER_PLACEMENT, COMMON_TITLE_MAX_WIDTH, ErrorWrapper } from '../../../';
@@ -38,7 +37,9 @@ const SectionBase = (_a) => {
38
37
  }
39
38
  else {
40
39
  description = (React.createElement(Text, { className: b('note') },
41
- React.createElement(HelpPopover, { htmlContent: spec.viewSpec.layoutDescription, placement: ['bottom', 'top'] })));
40
+ React.createElement(HelpMark, { popoverProps: {
41
+ placement: COMMON_POPOVER_PLACEMENT,
42
+ } }, spec.viewSpec.layoutDescription)));
42
43
  }
43
44
  }
44
45
  const layoutTitle = spec.viewSpec.layoutTitle;
@@ -48,7 +49,7 @@ const SectionBase = (_a) => {
48
49
  'with-popover': !descriptionAsSubtitle,
49
50
  size: titleSize,
50
51
  }) },
51
- React.createElement(Popover, { className: b('title-popover'), content: layoutTitle, placement: COMMON_POPOVER_PLACEMENT, disabled: layoutTitlePopoverDisabled },
52
+ React.createElement(Popover, { className: b('popover'), content: layoutTitle, placement: COMMON_POPOVER_PLACEMENT, disabled: layoutTitlePopoverDisabled },
52
53
  React.createElement(Text, { className: b('title'), variant: titleSize === 'm' ? 'body-2' : 'body-1', ref: titleRef, ellipsis: true }, layoutTitle)),
53
54
  description,
54
55
  removeButton)) : null,
@@ -42,6 +42,9 @@
42
42
  .df-simple-vertical-accordeon__tooltip {
43
43
  margin: var(--df-simple-vertical-accordeon-tooltip-margin, var(--g-spacing-0) 5px);
44
44
  }
45
+ .df-simple-vertical-accordeon__popover {
46
+ padding: var(--g-spacing-2);
47
+ }
45
48
  .df-simple-vertical-accordeon__chevron {
46
49
  transform: rotate(-90deg);
47
50
  }
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
- import { HelpPopover } from '@gravity-ui/components';
3
2
  import { ChevronDown } from '@gravity-ui/icons';
4
- import { Button, Icon, Popover, Text } from '@gravity-ui/uikit';
3
+ import { Button, HelpMark, Icon, Popover, Text } from '@gravity-ui/uikit';
5
4
  import { COMMON_POPOVER_PLACEMENT } from '../../constants/common';
6
5
  import { block } from '../../utils';
7
6
  import './SimpleVerticalAccordeon.css';
@@ -60,7 +59,7 @@ export class SimpleVerticalAccordeon extends React.Component {
60
59
  const currentTitleVariant = this.getCurrentTitleVariant();
61
60
  return (Boolean(React.Children.count(children)) && (React.createElement("div", { className: b({ branch: withBranchView, view: viewLayout }, className) },
62
61
  React.createElement("div", { className: b('header') },
63
- React.createElement(Popover, { content: title, disabled: titlePopoverDisabled, placement: COMMON_POPOVER_PLACEMENT },
62
+ React.createElement(Popover, { content: title, disabled: titlePopoverDisabled, placement: COMMON_POPOVER_PLACEMENT, className: b('popover'), hasArrow: true },
64
63
  React.createElement(Button, { view: "flat", className: b('header-inner', buttonClassName), onClick: this.handleClick, qa: `${name}-accordeon-toggler`, width: "auto" },
65
64
  React.createElement(Text, { variant: currentTitleVariant }, title),
66
65
  React.createElement(Icon, { data: ChevronDown, className: b('chevron', { open }), size: 16 }))),
@@ -88,7 +87,9 @@ export class SimpleVerticalAccordeon extends React.Component {
88
87
  getTooltip() {
89
88
  const { note } = this.props;
90
89
  return note ? (React.createElement(Text, { className: b('tooltip') },
91
- React.createElement(HelpPopover, { htmlContent: note, placement: ['bottom', 'top'] }))) : null;
90
+ React.createElement(HelpMark, { popoverProps: {
91
+ placement: COMMON_POPOVER_PLACEMENT,
92
+ } }, note))) : null;
92
93
  }
93
94
  }
94
95
  SimpleVerticalAccordeon.defaultProps = {
@@ -1,13 +1,15 @@
1
1
  import React from 'react';
2
- import { HelpPopover } from '@gravity-ui/components';
3
- import { Card, Text } from '@gravity-ui/uikit';
2
+ import { Card, HelpMark, Text } from '@gravity-ui/uikit';
4
3
  import { block } from '../../utils';
4
+ import { COMMON_POPOVER_PLACEMENT } from '../../constants/common';
5
5
  import './TogglerCard.css';
6
6
  const b = block('toggler-card');
7
7
  export const TogglerCard = ({ description, title, text, onClick, disabled, selected, }) => {
8
8
  return (React.createElement(Card, { onClick: onClick, type: "selection", disabled: disabled ? !selected : disabled, selected: selected, size: "m", className: b() },
9
9
  React.createElement("div", { className: b('header') },
10
10
  React.createElement(Text, { variant: "subheader-2", ellipsis: true }, title),
11
- description ? (React.createElement(HelpPopover, { htmlContent: description, placement: ['bottom', 'top'] })) : null),
11
+ description ? (React.createElement(HelpMark, { popoverProps: {
12
+ placement: COMMON_POPOVER_PLACEMENT,
13
+ } }, description)) : null),
12
14
  React.createElement(Text, { variant: "body-1", color: "secondary", className: b('text') }, text)));
13
15
  };
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import { Text } from '@gravity-ui/uikit';
3
- import { HelpPopover } from '@gravity-ui/components';
2
+ import { HelpMark, Text } from '@gravity-ui/uikit';
4
3
  import { useDynamicFormsCtx } from '../../../../core';
5
4
  import { CopyButton } from '../../../../kit';
6
5
  import { block, isNotEmptyValue } from '../../../utils';
6
+ import { COMMON_POPOVER_PLACEMENT } from '../../../constants/common';
7
7
  import './ViewColumn.css';
8
8
  const b = block('view-column');
9
9
  export const ViewColumn = ({ value, spec, children, }) => {
@@ -14,7 +14,9 @@ export const ViewColumn = ({ value, spec, children, }) => {
14
14
  return (React.createElement("div", { className: b() },
15
15
  React.createElement("div", { className: b('first-row') },
16
16
  React.createElement(Text, { color: "secondary", ellipsis: true }, spec.viewSpec.layoutTitle),
17
- showLayoutDescription && spec.viewSpec.layoutDescription ? (React.createElement(HelpPopover, { className: b('note'), htmlContent: spec.viewSpec.layoutDescription, placement: ['bottom', 'top'] })) : null),
17
+ showLayoutDescription && spec.viewSpec.layoutDescription ? (React.createElement(HelpMark, { className: b('note'), popoverProps: {
18
+ placement: COMMON_POPOVER_PLACEMENT,
19
+ } }, spec.viewSpec.layoutDescription)) : null),
18
20
  React.createElement("div", { className: b('second-row') }, children),
19
21
  React.createElement(CopyButton, { spec: spec, value: value })));
20
22
  };
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import { Text } from '@gravity-ui/uikit';
3
- import { HelpPopover } from '@gravity-ui/components';
2
+ import { HelpMark, Text } from '@gravity-ui/uikit';
4
3
  import { useDynamicFormsCtx } from '../../../../core';
5
4
  import { CopyButton } from '../../../../kit';
6
5
  import { block, isNotEmptyValue } from '../../../utils';
6
+ import { COMMON_POPOVER_PLACEMENT } from '../../../constants/common';
7
7
  import './ViewRow.css';
8
8
  const b = block('view-row');
9
9
  export const ViewRow = ({ value, spec, children, }) => {
@@ -14,7 +14,9 @@ export const ViewRow = ({ value, spec, children, }) => {
14
14
  return (React.createElement("div", { className: b() },
15
15
  React.createElement("div", { className: b('left') },
16
16
  React.createElement(Text, { whiteSpace: "nowrap", color: "secondary", ellipsis: true }, spec.viewSpec.layoutTitle),
17
- showLayoutDescription && spec.viewSpec.layoutDescription ? (React.createElement(HelpPopover, { className: b('note'), htmlContent: spec.viewSpec.layoutDescription, placement: ['bottom', 'top'] })) : null,
17
+ showLayoutDescription && spec.viewSpec.layoutDescription ? (React.createElement(HelpMark, { className: b('note'), popoverProps: {
18
+ placement: COMMON_POPOVER_PLACEMENT,
19
+ } }, spec.viewSpec.layoutDescription)) : null,
18
20
  React.createElement("div", { className: b('dots') })),
19
21
  React.createElement("div", { className: b('right') }, children),
20
22
  React.createElement(CopyButton, { spec: spec, value: value })));
@@ -3,7 +3,7 @@ import isObjectLike from 'lodash/isObjectLike';
3
3
  import { Card, ViewRow } from '../';
4
4
  import { ViewController } from '../../../core';
5
5
  export const CardOneOfView = (props) => {
6
- const { value = {}, spec, name, Layout } = props;
6
+ const { value = {}, spec, name } = props;
7
7
  const [open, setOpen] = React.useState(true);
8
8
  const onToggle = React.useCallback(() => setOpen((f) => !f), [setOpen]);
9
9
  const specProperties = React.useMemo(() => (isObjectLike(spec.properties) ? spec.properties : {}), [spec.properties]);
@@ -14,18 +14,8 @@ export const CardOneOfView = (props) => {
14
14
  ((_b = specProperties[valueKey]) === null || _b === void 0 ? void 0 : _b.viewSpec.layoutTitle) ||
15
15
  valueKey);
16
16
  }, [valueKey, spec.description, specProperties]);
17
- const title = React.useMemo(() => {
18
- const titleProps = {
19
- spec: spec,
20
- value: valueName,
21
- name: name,
22
- children: React.createElement(React.Fragment, null, valueName),
23
- };
24
- if (Layout) {
25
- return React.createElement(Layout, Object.assign({}, titleProps));
26
- }
27
- return React.createElement(ViewRow, Object.assign({}, titleProps));
28
- }, [spec, name, valueName, Layout]);
17
+ const title = React.useMemo(() => (React.createElement(ViewRow, { spec: spec, value: valueName, name: name },
18
+ React.createElement(React.Fragment, null, valueName))), [spec, name, valueName]);
29
19
  if (!value || !Object.keys(value).length) {
30
20
  return null;
31
21
  }
@@ -30,16 +30,18 @@
30
30
  .df-checkbox-group-view_vertical > *:not(:last-child) {
31
31
  margin: var(--df-checkbox-group-view-vertical-child-margin, var(--g-spacing-0) var(--g-spacing-0) 6px);
32
32
  }
33
- .df-checkbox-group-view__tooltip {
33
+ .df-checkbox-group-view__popover {
34
+ padding: var(--g-spacing-2);
34
35
  overflow-wrap: break-word;
36
+ max-width: 300px;
35
37
  }
36
- .df-checkbox-group-view__tooltip-container {
37
- max-width: var(--df-tooltip-container-max-width, 100%);
38
+ .df-checkbox-group-view__item {
39
+ max-width: var(--df-popover-item-max-width, 100%);
38
40
  overflow: hidden;
39
41
  text-overflow: ellipsis;
40
42
  display: block;
41
- margin-bottom: var(--df-tooltip-container-margin-bottom, 6px);
43
+ margin-bottom: var(--df-popover-item-margin-bottom, 6px);
42
44
  }
43
- .df-checkbox-group-view__tooltip-container:last-child {
45
+ .df-checkbox-group-view__item:last-child {
44
46
  margin-bottom: var(--df-spacing-last-child, var(--g-spacing-0));
45
47
  }
@@ -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 { COMMON_POPOVER_PLACEMENT } from '../../../constants/common';
4
4
  import { block } from '../../../utils';
5
5
  import './CheckboxGroupView.css';
@@ -9,7 +9,8 @@ export const CheckboxGroupView = ({ spec, value = [] }) => {
9
9
  const _value = value;
10
10
  const items = React.useMemo(() => _value.map((item) => { var _a; return ((_a = spec.description) === null || _a === void 0 ? void 0 : _a[item]) || item; }), [spec.description, _value]);
11
11
  const verticalPlacement = React.useMemo(() => { var _a; return ((_a = spec.viewSpec.checkboxGroupParams) === null || _a === void 0 ? void 0 : _a.placement) === 'vertical'; }, [(_a = spec.viewSpec.checkboxGroupParams) === null || _a === void 0 ? void 0 : _a.placement]);
12
- return (React.createElement("div", { className: b({ vertical: verticalPlacement }) }, items.map((item, idx) => (React.createElement(Popover, { placement: COMMON_POPOVER_PLACEMENT, key: item, content: item, className: b('tooltip-container'), contentClassName: b('tooltip'), disabled: item.length < 51 },
13
- item,
14
- !verticalPlacement && idx !== items.length - 1 ? ', ' : null)))));
12
+ return (React.createElement("div", { className: b({ vertical: verticalPlacement }) }, items.map((item, idx) => (React.createElement(Popover, { placement: COMMON_POPOVER_PLACEMENT, content: item, className: b('popover'), key: item, hasArrow: true, disabled: item.length < 51 },
13
+ React.createElement(Text, { className: b('item') },
14
+ item,
15
+ !verticalPlacement && idx !== items.length - 1 ? ', ' : null))))));
15
16
  };
@@ -17,17 +17,19 @@
17
17
  }
18
18
  */
19
19
  /* Border-radius */
20
- .df-multi-oneof-view__tooltip {
20
+ .df-multi-oneof-view__popover {
21
+ padding: var(--g-spacing-2);
21
22
  overflow-wrap: break-word;
23
+ max-width: 300px;
22
24
  }
23
- .df-multi-oneof-view__tooltip-container {
24
- max-width: var(--df-tooltip-container-max-width, 100%);
25
+ .df-multi-oneof-view__item {
26
+ max-width: var(--df-popover-item-max-width, 100%);
25
27
  overflow: hidden;
26
28
  text-overflow: ellipsis;
27
29
  display: block;
28
- margin-bottom: var(--df-tooltip-container-margin-bottom, 6px);
30
+ margin-bottom: var(--df-popover-item-margin-bottom, 6px);
29
31
  }
30
- .df-multi-oneof-view__tooltip-container:last-child {
32
+ .df-multi-oneof-view__item:last-child {
31
33
  margin-bottom: var(--df-spacing-last-child, var(--g-spacing-0));
32
34
  }
33
35
  .df-multi-oneof-view__content_multiple-values > .df-group-indent {
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
- import { Popover } from '@gravity-ui/uikit';
2
+ import { Popover, Text } from '@gravity-ui/uikit';
3
3
  import isObjectLike from 'lodash/isObjectLike';
4
4
  import { ViewController } from '../../../../core';
5
5
  import { block } from '../../../utils';
6
6
  import { GroupIndent } from '../../GroupIndent';
7
+ import { COMMON_POPOVER_PLACEMENT } from '../../../constants/common';
7
8
  import './MultiOneOfView.css';
8
9
  const b = block('multi-oneof-view');
9
10
  export const MultiOneOfView = (props) => {
@@ -20,7 +21,8 @@ export const MultiOneOfView = (props) => {
20
21
  }), [spec.description, specProperties, values]);
21
22
  const selectView = React.useMemo(() => {
22
23
  const selectView = (React.createElement(React.Fragment, null, items.map((item) => {
23
- return (React.createElement(Popover, { placement: ['bottom', 'top'], key: item, content: item, className: b('tooltip-container'), contentClassName: b('tooltip'), disabled: item.length < 51 }, item));
24
+ return (React.createElement(Popover, { placement: COMMON_POPOVER_PLACEMENT, content: item, className: b('popover'), disabled: item.length < 51, hasArrow: true, key: item },
25
+ React.createElement(Text, { className: b('item') }, item)));
24
26
  })));
25
27
  if (Layout) {
26
28
  return (React.createElement(Layout, Object.assign({}, props, { value: values }), selectView));
@@ -17,16 +17,18 @@
17
17
  }
18
18
  */
19
19
  /* Border-radius */
20
- .df-multiselect-view__tooltip {
20
+ .df-multiselect-view__popover {
21
+ padding: var(--g-spacing-2);
21
22
  overflow-wrap: break-word;
23
+ max-width: 300px;
22
24
  }
23
- .df-multiselect-view__tooltip-container {
24
- max-width: var(--df-tooltip-container-max-width, 100%);
25
+ .df-multiselect-view__item {
26
+ max-width: var(--df-popover-item-max-width, 100%);
25
27
  overflow: hidden;
26
28
  text-overflow: ellipsis;
27
29
  display: block;
28
- margin-bottom: var(--df-tooltip-container-margin-bottom, 6px);
30
+ margin-bottom: var(--df-popover-item-margin-bottom, 6px);
29
31
  }
30
- .df-multiselect-view__tooltip-container:last-child {
32
+ .df-multiselect-view__item:last-child {
31
33
  margin-bottom: var(--df-spacing-last-child, var(--g-spacing-0));
32
34
  }
@@ -1,10 +1,12 @@
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 } from '../../../utils';
4
+ import { COMMON_POPOVER_PLACEMENT } from '../../../constants/common';
4
5
  import './MultiSelectView.css';
5
6
  const b = block('multiselect-view');
6
7
  export const MultiSelectView = ({ spec, value = [] }) => {
7
8
  const _value = value;
8
9
  const items = React.useMemo(() => _value.map((item) => { var _a; return ((_a = spec.description) === null || _a === void 0 ? void 0 : _a[item]) || item; }), [spec.description, _value]);
9
- return (React.createElement(React.Fragment, null, items.map((item) => (React.createElement(Popover, { placement: ['bottom', 'top'], key: item, content: item, className: b('tooltip-container'), contentClassName: b('tooltip'), disabled: item.length < 51 }, item)))));
10
+ return (React.createElement(React.Fragment, null, items.map((item) => (React.createElement(Popover, { placement: COMMON_POPOVER_PLACEMENT, content: item, className: b('popover'), disabled: item.length < 51, hasArrow: true, key: item },
11
+ React.createElement(Text, { className: b('item') }, item))))));
10
12
  };
@@ -20,14 +20,16 @@
20
20
  .df-number-with-scale-view {
21
21
  display: flex;
22
22
  }
23
- .df-number-with-scale-view__tooltip {
23
+ .df-number-with-scale-view__popover {
24
+ padding: var(--g-spacing-2);
24
25
  overflow-wrap: break-word;
26
+ max-width: 300px;
25
27
  }
26
- .df-number-with-scale-view__tooltip-container {
27
- white-space: nowrap;
28
+ .df-number-with-scale-view__item {
29
+ max-width: var(--df-popover-item-max-width, 100%);
28
30
  overflow: hidden;
29
31
  text-overflow: ellipsis;
30
- max-width: var(--df-tooltip-container-max-width, 100%);
32
+ display: block;
31
33
  }
32
34
  .df-number-with-scale-view__size {
33
35
  margin-left: var(--df-number-with-scale-view-size-margin-left, var(--g-spacing-half));
@@ -8,7 +8,8 @@ const NumberWithScaleViewBase = ({ spec, value }) => {
8
8
  const { initialValue, initialType } = useInitial(value || '', spec, [value]);
9
9
  const { scale } = spec.viewSpec.sizeParams;
10
10
  return (React.createElement("div", { className: b() },
11
- React.createElement(Popover, { placement: ['bottom', 'top'], content: initialValue, className: b('tooltip-container'), contentClassName: b('tooltip'), disabled: initialValue.length < 26 }, initialValue),
11
+ React.createElement(Popover, { placement: ['bottom', 'top'], content: initialValue, className: b('popover'), disabled: initialValue.length < 26, hasArrow: true },
12
+ React.createElement(Text, { className: b('item') }, initialValue)),
12
13
  React.createElement(Text, { className: b('size') }, scale[initialType].title)));
13
14
  };
14
15
  export const NumberWithScaleView = (props) => isCorrectSizeParams(props.spec) && props.value ? React.createElement(NumberWithScaleViewBase, Object.assign({}, props)) : null;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import { Flex, Table } from '@gravity-ui/uikit';
2
+ import { Flex, HelpMark, Table } from '@gravity-ui/uikit';
3
3
  import { ViewController, isArraySpec, isBooleanSpec, isObjectSpec, useDynamicFormsCtx, } from '../../../../core';
4
4
  import { block } from '../../../utils';
5
+ import { COMMON_POPOVER_PLACEMENT } from '../../../constants/common';
5
6
  import './TableArrayView.css';
6
- import { HelpPopover } from '@gravity-ui/components';
7
7
  const b = block('table-array-view');
8
8
  export const TableArrayView = ({ value = [], spec, name }) => {
9
9
  const { showLayoutDescription } = useDynamicFormsCtx();
@@ -23,7 +23,9 @@ export const TableArrayView = ({ value = [], spec, name }) => {
23
23
  name: description && showLayoutDescription
24
24
  ? () => (React.createElement(Flex, { gap: 0.5, alignItems: "center" },
25
25
  label,
26
- React.createElement(HelpPopover, { htmlContent: description, placement: ['bottom', 'top'] })))
26
+ React.createElement(HelpMark, { popoverProps: {
27
+ placement: COMMON_POPOVER_PLACEMENT,
28
+ } }, description)))
27
29
  : label,
28
30
  template: (_, idx) => {
29
31
  var _a;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Checkbox, RadioButton, Select } from '@gravity-ui/uikit';
2
+ import { Checkbox, SegmentedRadioGroup, Select } from '@gravity-ui/uikit';
3
3
  import isObjectLike from 'lodash/isObjectLike';
4
4
  import some from 'lodash/some';
5
5
  import { TogglerCard } from '../../components';
@@ -96,7 +96,7 @@ export const useOneOf = ({ props, onTogglerChange }) => {
96
96
  return (React.createElement("div", { className: b('checkbox') },
97
97
  React.createElement(Checkbox, { checked: checkboxValue, onUpdate: onCheckboxChange, disabled: spec.viewSpec.disabled, qa: name })));
98
98
  }
99
- return (React.createElement(RadioButton, { value: oneOfValue, onChange: (event) => onOneOfChange([event.target.value]), disabled: spec.viewSpec.disabled, qa: name }, options.map((option) => (React.createElement(RadioButton.Option, { key: option.value, value: option.value }, option.title)))));
99
+ return (React.createElement(SegmentedRadioGroup, { value: oneOfValue, onChange: (event) => onOneOfChange([event.target.value]), disabled: spec.viewSpec.disabled, qa: name }, options.map((option) => (React.createElement(SegmentedRadioGroup.Option, { key: option.value, value: option.value }, option.title)))));
100
100
  }, [
101
101
  togglerType,
102
102
  oneOfValue,