@gravity-ui/dynamic-forms 5.29.2 → 5.30.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/unstable/kit/components/EntityContainer/EntityContainer.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/entities/FewOfNested/FewOfNested.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/entities/FewOfNested/FewOfNested.js +8 -3
- package/build/cjs/lib/unstable/kit/entities/OneOfNested/OneOfNested.d.ts +1 -0
- package/build/cjs/lib/unstable/kit/entities/OneOfNested/OneOfNested.js +8 -3
- package/build/cjs/lib/unstable/kit/form-entities/SegmentedRadioGroupInput/SegmentedRadioGroupInput.css +9 -4
- package/build/cjs/lib/unstable/kit/form-entities/SegmentedRadioGroupInput/SegmentedRadioGroupInput.js +14 -15
- package/build/cjs/lib/unstable/kit/form-layouts/FormColumn/FormColumn.js +1 -1
- package/build/cjs/lib/unstable/kit/form-layouts/FormRow/FormRow.js +1 -1
- package/build/cjs/lib/unstable/kit/layouts/Accordeon/Accordeon.js +1 -1
- package/build/cjs/lib/unstable/kit/layouts/Card/Card.js +1 -1
- package/build/cjs/lib/unstable/kit/layouts/Section/Section.js +1 -1
- package/build/esm/lib/unstable/kit/components/EntityContainer/EntityContainer.d.ts +1 -0
- package/build/esm/lib/unstable/kit/entities/FewOfNested/FewOfNested.d.ts +1 -0
- package/build/esm/lib/unstable/kit/entities/FewOfNested/FewOfNested.js +8 -3
- package/build/esm/lib/unstable/kit/entities/OneOfNested/OneOfNested.d.ts +1 -0
- package/build/esm/lib/unstable/kit/entities/OneOfNested/OneOfNested.js +8 -3
- package/build/esm/lib/unstable/kit/form-entities/SegmentedRadioGroupInput/SegmentedRadioGroupInput.css +9 -4
- package/build/esm/lib/unstable/kit/form-entities/SegmentedRadioGroupInput/SegmentedRadioGroupInput.js +14 -15
- package/build/esm/lib/unstable/kit/form-layouts/FormColumn/FormColumn.js +1 -1
- package/build/esm/lib/unstable/kit/form-layouts/FormRow/FormRow.js +1 -1
- package/build/esm/lib/unstable/kit/layouts/Accordeon/Accordeon.js +1 -1
- package/build/esm/lib/unstable/kit/layouts/Card/Card.js +1 -1
- package/build/esm/lib/unstable/kit/layouts/Section/Section.js +1 -1
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import { type FlexProps } from '@gravity-ui/uikit';
|
|
|
3
3
|
export interface EntityContainerProps extends FlexProps {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
fill?: 'populated' | 'empty' | 'by-child';
|
|
6
|
+
ref?: React.ComponentPropsWithRef<'div'>['ref'];
|
|
6
7
|
stretch: 'max' | 'fit' | 'by-child';
|
|
7
8
|
}
|
|
8
9
|
export declare const EntityContainer: React.FC<EntityContainerProps>;
|
|
@@ -10,7 +10,7 @@ const utils_1 = require("../../utils");
|
|
|
10
10
|
const b = (0, utils_1.block)('few-of-nested');
|
|
11
11
|
const FewOfNested = ({ Layout, headName, input, layoutProps, meta, mode, props, schema, schemaPath, }) => {
|
|
12
12
|
const { name, value } = input;
|
|
13
|
-
const { togglerArrayRemoveButton = false, toggler: togglerSchema = {}, withIndent = false, } = props;
|
|
13
|
+
const { togglerArrayRemoveButton = false, toggler: togglerSchema = {}, withIndent = false, order, } = props;
|
|
14
14
|
const overviewFlag = mode === core_1.SchemaRendererMode.Overview;
|
|
15
15
|
const srState = (0, core_1.useSchemaRendererState)({
|
|
16
16
|
headName,
|
|
@@ -20,8 +20,13 @@ const FewOfNested = ({ Layout, headName, input, layoutProps, meta, mode, props,
|
|
|
20
20
|
if (value && Object.keys(value).length) {
|
|
21
21
|
return Object.keys(value);
|
|
22
22
|
}
|
|
23
|
-
if (!overviewFlag
|
|
24
|
-
|
|
23
|
+
if (!overviewFlag) {
|
|
24
|
+
if ((order === null || order === void 0 ? void 0 : order[0]) !== undefined) {
|
|
25
|
+
return [order[0]];
|
|
26
|
+
}
|
|
27
|
+
if (schema.properties && Object.keys(schema.properties).length) {
|
|
28
|
+
return [Object.keys(schema.properties)[0]];
|
|
29
|
+
}
|
|
25
30
|
}
|
|
26
31
|
return [];
|
|
27
32
|
});
|
|
@@ -9,7 +9,7 @@ const utils_1 = require("../../utils");
|
|
|
9
9
|
const b = (0, utils_1.block)('one-of-nested');
|
|
10
10
|
const OneOfNested = ({ Layout, headName, input, layoutProps, meta, mode, props, schema, schemaPath, }) => {
|
|
11
11
|
const { name, value } = input;
|
|
12
|
-
const { booleanToKey, togglerArrayRemoveButton = false, toggler: togglerSchema = {}, withIndent = false, } = props;
|
|
12
|
+
const { booleanToKey, togglerArrayRemoveButton = false, toggler: togglerSchema = {}, withIndent = false, order, } = props;
|
|
13
13
|
const overviewFlag = mode === core_1.SchemaRendererMode.Overview;
|
|
14
14
|
const srState = (0, core_1.useSchemaRendererState)({
|
|
15
15
|
headName,
|
|
@@ -19,8 +19,13 @@ const OneOfNested = ({ Layout, headName, input, layoutProps, meta, mode, props,
|
|
|
19
19
|
if (value && Object.keys(value).length) {
|
|
20
20
|
return Object.keys(value)[0];
|
|
21
21
|
}
|
|
22
|
-
if (!overviewFlag
|
|
23
|
-
|
|
22
|
+
if (!overviewFlag) {
|
|
23
|
+
if ((order === null || order === void 0 ? void 0 : order[0]) !== undefined) {
|
|
24
|
+
return order[0];
|
|
25
|
+
}
|
|
26
|
+
if (schema.properties) {
|
|
27
|
+
return Object.keys(schema.properties)[0];
|
|
28
|
+
}
|
|
24
29
|
}
|
|
25
30
|
return undefined;
|
|
26
31
|
});
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
.sr-segmented-radio-group-input {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
1
4
|
.sr-segmented-radio-group-input_error .g-segmented-radio-group .g-segmented-radio-group__option_checked:hover::after {
|
|
2
5
|
border: 1px solid var(--g-color-text-danger);
|
|
3
6
|
}
|
|
4
7
|
.sr-segmented-radio-group-input_error .g-segmented-radio-group .g-segmented-radio-group__option_checked::after {
|
|
5
8
|
border: 1px solid var(--g-color-text-danger);
|
|
6
9
|
}
|
|
7
|
-
.sr-segmented-radio-group-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
.sr-segmented-radio-group-input__checker {
|
|
11
|
+
position: absolute;
|
|
12
|
+
left: 0;
|
|
13
|
+
top: 0;
|
|
14
|
+
width: max-content;
|
|
15
|
+
visibility: hidden;
|
|
11
16
|
}
|
|
@@ -14,7 +14,8 @@ const SegmentedRadioGroupInput = (_a) => {
|
|
|
14
14
|
const { name, onBlur, onChange, onFocus, value } = input;
|
|
15
15
|
const { enumDescriptions, optionsDisabled } = props, restEntityProps = tslib_1.__rest(props, ["enumDescriptions", "optionsDisabled"]);
|
|
16
16
|
const { disabled } = ((_b = schema.nodeParameters) === null || _b === void 0 ? void 0 : _b.flags) || {};
|
|
17
|
-
const
|
|
17
|
+
const containerRef = react_1.default.useRef(null);
|
|
18
|
+
const controlRef = react_1.default.useRef(null);
|
|
18
19
|
const [overflowed, setOverflowed] = react_1.default.useState(false);
|
|
19
20
|
const options = react_1.default.useMemo(() => {
|
|
20
21
|
var _a;
|
|
@@ -30,27 +31,25 @@ const SegmentedRadioGroupInput = (_a) => {
|
|
|
30
31
|
onBlur();
|
|
31
32
|
}, [onBlur, onChange, onFocus]);
|
|
32
33
|
react_1.default.useLayoutEffect(() => {
|
|
33
|
-
const
|
|
34
|
-
|
|
34
|
+
const container = containerRef.current;
|
|
35
|
+
const control = controlRef.current;
|
|
36
|
+
if (!container || !control) {
|
|
35
37
|
return;
|
|
36
38
|
}
|
|
37
39
|
const measure = () => {
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
return node.scrollWidth > node.clientWidth;
|
|
44
|
-
}));
|
|
40
|
+
const GAP = 48; // little bit more than potential remove button width + spacing
|
|
41
|
+
const containerWidth = container.offsetWidth - GAP;
|
|
42
|
+
const controlWidth = control.offsetWidth;
|
|
43
|
+
setOverflowed(controlWidth > containerWidth);
|
|
45
44
|
};
|
|
46
45
|
measure();
|
|
47
46
|
const observer = new ResizeObserver(measure);
|
|
48
|
-
observer.observe(
|
|
47
|
+
observer.observe(container);
|
|
49
48
|
return () => observer.disconnect();
|
|
50
49
|
}, [options]);
|
|
51
|
-
return (react_1.default.createElement(components_1.EntityContainer, { stretch: "max" },
|
|
52
|
-
overflowed ? (react_1.default.createElement(SelectInput_1.SelectInput, Object.assign({ input: input, meta: meta, props: props, schema: schema }, restProps))) :
|
|
53
|
-
react_1.default.createElement(
|
|
54
|
-
react_1.default.createElement(uikit_1.SegmentedRadioGroup, Object.assign({ ref:
|
|
50
|
+
return (react_1.default.createElement(components_1.EntityContainer, { ref: containerRef, className: b({ error: (0, utils_1.getBooleanValidationState)(meta) }), stretch: "max" },
|
|
51
|
+
overflowed ? (react_1.default.createElement(SelectInput_1.SelectInput, Object.assign({ input: input, meta: meta, props: props, schema: schema }, restProps))) : (react_1.default.createElement(uikit_1.SegmentedRadioGroup, Object.assign({ width: "max", disabled: disabled || schema.readOnly, options: options }, restEntityProps, { value: value, onFocus: onFocus, onBlur: onBlur, onUpdate: onUpdate, qa: name }))),
|
|
52
|
+
react_1.default.createElement("div", { className: b('checker') },
|
|
53
|
+
react_1.default.createElement(uikit_1.SegmentedRadioGroup, Object.assign({ ref: controlRef, width: "max", disabled: disabled || schema.readOnly, options: options }, restEntityProps)))));
|
|
55
54
|
};
|
|
56
55
|
exports.SegmentedRadioGroupInput = SegmentedRadioGroupInput;
|
|
@@ -26,7 +26,7 @@ const FormColumn = ({ children, headName, input, meta, schema, props, }) => {
|
|
|
26
26
|
return (react_1.default.createElement(components_1.LayoutContainer, { className: b(), gap: 2, hidden: hidden },
|
|
27
27
|
react_1.default.createElement(uikit_1.Flex, { direction: "column", gap: 0.5 },
|
|
28
28
|
react_1.default.createElement("div", { className: b('top') },
|
|
29
|
-
react_1.default.createElement(uikit_1.Text, { className: b('title', { required }), wordBreak: "break-word" }, schema.title),
|
|
29
|
+
react_1.default.createElement(uikit_1.Text, { className: b('title', { required }), variant: "subheader-1", color: "complementary", wordBreak: "break-word" }, schema.title),
|
|
30
30
|
tooltip,
|
|
31
31
|
react_1.default.createElement(components_1.ArrayRemoveButton, { name: input.name, headName: headName })),
|
|
32
32
|
bottomDescription),
|
|
@@ -25,7 +25,7 @@ const FormRow = ({ children, headName, input, meta, schema, props, }) => {
|
|
|
25
25
|
}, [headName, schema.description, props.descriptionType]);
|
|
26
26
|
return (react_1.default.createElement(components_1.LayoutContainer, { className: b(), direction: "row", alignItems: "flex-start", gap: 2, hidden: hidden },
|
|
27
27
|
react_1.default.createElement("div", { className: b('left') },
|
|
28
|
-
react_1.default.createElement(uikit_1.Text, { className: b('title', { required }), wordBreak: "break-word" }, schema.title),
|
|
28
|
+
react_1.default.createElement(uikit_1.Text, { className: b('title', { required }), variant: "subheader-1", color: "complementary", wordBreak: "break-word" }, schema.title),
|
|
29
29
|
tooltip),
|
|
30
30
|
react_1.default.createElement(uikit_1.Flex, { className: b('right'), direction: "column", gap: 0.5, grow: 1 },
|
|
31
31
|
react_1.default.createElement(uikit_1.Flex, { grow: 1, gap: 2 },
|
|
@@ -14,7 +14,7 @@ const Accordeon = ({ children, headName, input, meta, mode, schema, props, }) =>
|
|
|
14
14
|
const { titleProps, togglerProps, withIndent = false, withDefaultSummary = false } = props, restLayoutProps = tslib_1.__rest(props, ["titleProps", "togglerProps", "withIndent", "withDefaultSummary"]);
|
|
15
15
|
const { copy, required, hidden, open } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
|
|
16
16
|
const overviewFlag = mode === core_1.SchemaRendererMode.Overview;
|
|
17
|
-
const summary = react_1.default.useMemo(() => (react_1.default.createElement(uikit_1.Text, Object.assign({}, titleProps, { className: b('title', { required: required && !overviewFlag }, titleProps === null || titleProps === void 0 ? void 0 : titleProps.className) }), schema.title)), [overviewFlag, required, schema.title, titleProps]);
|
|
17
|
+
const summary = react_1.default.useMemo(() => (react_1.default.createElement(uikit_1.Text, Object.assign({ variant: "subheader-1", color: "complementary" }, titleProps, { className: b('title', { required: required && !overviewFlag }, titleProps === null || titleProps === void 0 ? void 0 : titleProps.className) }), schema.title)), [overviewFlag, required, schema.title, titleProps]);
|
|
18
18
|
const helpMark = react_1.default.useMemo(() => {
|
|
19
19
|
if (schema.description) {
|
|
20
20
|
return (react_1.default.createElement(uikit_1.HelpMark, null,
|
|
@@ -37,7 +37,7 @@ const Card = ({ children, headName, input, meta, mode, schema, props, }) => {
|
|
|
37
37
|
react_1.default.createElement(uikit_1.Flex, { className: b('header'), direction: "column", justifyContent: "center" },
|
|
38
38
|
react_1.default.createElement(uikit_1.Flex, { justifyContent: "space-between", alignItems: "center" },
|
|
39
39
|
react_1.default.createElement(uikit_1.Flex, { alignItems: "center", gap: 2 },
|
|
40
|
-
react_1.default.createElement(uikit_1.Text, { variant: "subheader-1", className: b('title', { required: required && !overviewFlag }) }, schema.title),
|
|
40
|
+
react_1.default.createElement(uikit_1.Text, { variant: "subheader-1", color: "complementary", className: b('title', { required: required && !overviewFlag }) }, schema.title),
|
|
41
41
|
tooltip),
|
|
42
42
|
react_1.default.createElement(uikit_1.Flex, { className: b('header-actions'), alignItems: "center", gap: 2 },
|
|
43
43
|
overviewFlag ? (react_1.default.createElement(components_1.CopyButton, { className: b('copy-button'), copy: copy, value: input.value })) : null,
|
|
@@ -30,7 +30,7 @@ const Section = ({ children, headName, input, meta, mode, schema, props, }) => {
|
|
|
30
30
|
react_1.default.createElement(uikit_1.Flex, { direction: "column", gap: 4 },
|
|
31
31
|
react_1.default.createElement(uikit_1.Flex, { direction: "column" },
|
|
32
32
|
react_1.default.createElement(uikit_1.Flex, { className: b('header'), gap: 2, alignItems: "center" },
|
|
33
|
-
react_1.default.createElement(uikit_1.Text, Object.assign({ variant: "subheader-1" }, restLayoutProps, { className: b('title', { required: required && !overviewFlag }, restLayoutProps === null || restLayoutProps === void 0 ? void 0 : restLayoutProps.className) }), schema.title),
|
|
33
|
+
react_1.default.createElement(uikit_1.Text, Object.assign({ variant: "subheader-1", color: "complementary" }, restLayoutProps, { className: b('title', { required: required && !overviewFlag }, restLayoutProps === null || restLayoutProps === void 0 ? void 0 : restLayoutProps.className) }), schema.title),
|
|
34
34
|
tooltip,
|
|
35
35
|
overviewFlag ? (react_1.default.createElement(components_1.CopyButton, { className: b('copy-button'), copy: copy, value: input.value })) : null,
|
|
36
36
|
overviewFlag ? null : (react_1.default.createElement(components_1.ArrayRemoveButton, { name: input.name, headName: headName }))),
|
|
@@ -4,6 +4,7 @@ import './EntityContainer.css';
|
|
|
4
4
|
export interface EntityContainerProps extends FlexProps {
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
fill?: 'populated' | 'empty' | 'by-child';
|
|
7
|
+
ref?: React.ComponentPropsWithRef<'div'>['ref'];
|
|
7
8
|
stretch: 'max' | 'fit' | 'by-child';
|
|
8
9
|
}
|
|
9
10
|
export declare const EntityContainer: React.FC<EntityContainerProps>;
|
|
@@ -7,7 +7,7 @@ import './FewOfNested.css';
|
|
|
7
7
|
const b = block('few-of-nested');
|
|
8
8
|
export const FewOfNested = ({ Layout, headName, input, layoutProps, meta, mode, props, schema, schemaPath, }) => {
|
|
9
9
|
const { name, value } = input;
|
|
10
|
-
const { togglerArrayRemoveButton = false, toggler: togglerSchema = {}, withIndent = false, } = props;
|
|
10
|
+
const { togglerArrayRemoveButton = false, toggler: togglerSchema = {}, withIndent = false, order, } = props;
|
|
11
11
|
const overviewFlag = mode === SchemaRendererMode.Overview;
|
|
12
12
|
const srState = useSchemaRendererState({
|
|
13
13
|
headName,
|
|
@@ -17,8 +17,13 @@ export const FewOfNested = ({ Layout, headName, input, layoutProps, meta, mode,
|
|
|
17
17
|
if (value && Object.keys(value).length) {
|
|
18
18
|
return Object.keys(value);
|
|
19
19
|
}
|
|
20
|
-
if (!overviewFlag
|
|
21
|
-
|
|
20
|
+
if (!overviewFlag) {
|
|
21
|
+
if ((order === null || order === void 0 ? void 0 : order[0]) !== undefined) {
|
|
22
|
+
return [order[0]];
|
|
23
|
+
}
|
|
24
|
+
if (schema.properties && Object.keys(schema.properties).length) {
|
|
25
|
+
return [Object.keys(schema.properties)[0]];
|
|
26
|
+
}
|
|
22
27
|
}
|
|
23
28
|
return [];
|
|
24
29
|
});
|
|
@@ -6,7 +6,7 @@ import './OneOfNested.css';
|
|
|
6
6
|
const b = block('one-of-nested');
|
|
7
7
|
export const OneOfNested = ({ Layout, headName, input, layoutProps, meta, mode, props, schema, schemaPath, }) => {
|
|
8
8
|
const { name, value } = input;
|
|
9
|
-
const { booleanToKey, togglerArrayRemoveButton = false, toggler: togglerSchema = {}, withIndent = false, } = props;
|
|
9
|
+
const { booleanToKey, togglerArrayRemoveButton = false, toggler: togglerSchema = {}, withIndent = false, order, } = props;
|
|
10
10
|
const overviewFlag = mode === SchemaRendererMode.Overview;
|
|
11
11
|
const srState = useSchemaRendererState({
|
|
12
12
|
headName,
|
|
@@ -16,8 +16,13 @@ export const OneOfNested = ({ Layout, headName, input, layoutProps, meta, mode,
|
|
|
16
16
|
if (value && Object.keys(value).length) {
|
|
17
17
|
return Object.keys(value)[0];
|
|
18
18
|
}
|
|
19
|
-
if (!overviewFlag
|
|
20
|
-
|
|
19
|
+
if (!overviewFlag) {
|
|
20
|
+
if ((order === null || order === void 0 ? void 0 : order[0]) !== undefined) {
|
|
21
|
+
return order[0];
|
|
22
|
+
}
|
|
23
|
+
if (schema.properties) {
|
|
24
|
+
return Object.keys(schema.properties)[0];
|
|
25
|
+
}
|
|
21
26
|
}
|
|
22
27
|
return undefined;
|
|
23
28
|
});
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
.sr-segmented-radio-group-input {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
1
4
|
.sr-segmented-radio-group-input_error .g-segmented-radio-group .g-segmented-radio-group__option_checked:hover::after {
|
|
2
5
|
border: 1px solid var(--g-color-text-danger);
|
|
3
6
|
}
|
|
4
7
|
.sr-segmented-radio-group-input_error .g-segmented-radio-group .g-segmented-radio-group__option_checked::after {
|
|
5
8
|
border: 1px solid var(--g-color-text-danger);
|
|
6
9
|
}
|
|
7
|
-
.sr-segmented-radio-group-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
.sr-segmented-radio-group-input__checker {
|
|
11
|
+
position: absolute;
|
|
12
|
+
left: 0;
|
|
13
|
+
top: 0;
|
|
14
|
+
width: max-content;
|
|
15
|
+
visibility: hidden;
|
|
11
16
|
}
|
|
@@ -12,7 +12,8 @@ export const SegmentedRadioGroupInput = (_a) => {
|
|
|
12
12
|
const { name, onBlur, onChange, onFocus, value } = input;
|
|
13
13
|
const { enumDescriptions, optionsDisabled } = props, restEntityProps = __rest(props, ["enumDescriptions", "optionsDisabled"]);
|
|
14
14
|
const { disabled } = ((_b = schema.nodeParameters) === null || _b === void 0 ? void 0 : _b.flags) || {};
|
|
15
|
-
const
|
|
15
|
+
const containerRef = React.useRef(null);
|
|
16
|
+
const controlRef = React.useRef(null);
|
|
16
17
|
const [overflowed, setOverflowed] = React.useState(false);
|
|
17
18
|
const options = React.useMemo(() => {
|
|
18
19
|
var _a;
|
|
@@ -28,26 +29,24 @@ export const SegmentedRadioGroupInput = (_a) => {
|
|
|
28
29
|
onBlur();
|
|
29
30
|
}, [onBlur, onChange, onFocus]);
|
|
30
31
|
React.useLayoutEffect(() => {
|
|
31
|
-
const
|
|
32
|
-
|
|
32
|
+
const container = containerRef.current;
|
|
33
|
+
const control = controlRef.current;
|
|
34
|
+
if (!container || !control) {
|
|
33
35
|
return;
|
|
34
36
|
}
|
|
35
37
|
const measure = () => {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
return node.scrollWidth > node.clientWidth;
|
|
42
|
-
}));
|
|
38
|
+
const GAP = 48; // little bit more than potential remove button width + spacing
|
|
39
|
+
const containerWidth = container.offsetWidth - GAP;
|
|
40
|
+
const controlWidth = control.offsetWidth;
|
|
41
|
+
setOverflowed(controlWidth > containerWidth);
|
|
43
42
|
};
|
|
44
43
|
measure();
|
|
45
44
|
const observer = new ResizeObserver(measure);
|
|
46
|
-
observer.observe(
|
|
45
|
+
observer.observe(container);
|
|
47
46
|
return () => observer.disconnect();
|
|
48
47
|
}, [options]);
|
|
49
|
-
return (React.createElement(EntityContainer, { stretch: "max" },
|
|
50
|
-
overflowed ? (React.createElement(SelectInput, Object.assign({ input: input, meta: meta, props: props, schema: schema }, restProps))) :
|
|
51
|
-
React.createElement(
|
|
52
|
-
React.createElement(SegmentedRadioGroup, Object.assign({ ref:
|
|
48
|
+
return (React.createElement(EntityContainer, { ref: containerRef, className: b({ error: getBooleanValidationState(meta) }), stretch: "max" },
|
|
49
|
+
overflowed ? (React.createElement(SelectInput, Object.assign({ input: input, meta: meta, props: props, schema: schema }, restProps))) : (React.createElement(SegmentedRadioGroup, Object.assign({ width: "max", disabled: disabled || schema.readOnly, options: options }, restEntityProps, { value: value, onFocus: onFocus, onBlur: onBlur, onUpdate: onUpdate, qa: name }))),
|
|
50
|
+
React.createElement("div", { className: b('checker') },
|
|
51
|
+
React.createElement(SegmentedRadioGroup, Object.assign({ ref: controlRef, width: "max", disabled: disabled || schema.readOnly, options: options }, restEntityProps)))));
|
|
53
52
|
};
|
|
@@ -23,7 +23,7 @@ export const FormColumn = ({ children, headName, input, meta, schema, props, })
|
|
|
23
23
|
return (React.createElement(LayoutContainer, { className: b(), gap: 2, hidden: hidden },
|
|
24
24
|
React.createElement(Flex, { direction: "column", gap: 0.5 },
|
|
25
25
|
React.createElement("div", { className: b('top') },
|
|
26
|
-
React.createElement(Text, { className: b('title', { required }), wordBreak: "break-word" }, schema.title),
|
|
26
|
+
React.createElement(Text, { className: b('title', { required }), variant: "subheader-1", color: "complementary", wordBreak: "break-word" }, schema.title),
|
|
27
27
|
tooltip,
|
|
28
28
|
React.createElement(ArrayRemoveButton, { name: input.name, headName: headName })),
|
|
29
29
|
bottomDescription),
|
|
@@ -22,7 +22,7 @@ export const FormRow = ({ children, headName, input, meta, schema, props, }) =>
|
|
|
22
22
|
}, [headName, schema.description, props.descriptionType]);
|
|
23
23
|
return (React.createElement(LayoutContainer, { className: b(), direction: "row", alignItems: "flex-start", gap: 2, hidden: hidden },
|
|
24
24
|
React.createElement("div", { className: b('left') },
|
|
25
|
-
React.createElement(Text, { className: b('title', { required }), wordBreak: "break-word" }, schema.title),
|
|
25
|
+
React.createElement(Text, { className: b('title', { required }), variant: "subheader-1", color: "complementary", wordBreak: "break-word" }, schema.title),
|
|
26
26
|
tooltip),
|
|
27
27
|
React.createElement(Flex, { className: b('right'), direction: "column", gap: 0.5, grow: 1 },
|
|
28
28
|
React.createElement(Flex, { grow: 1, gap: 2 },
|
|
@@ -12,7 +12,7 @@ export const Accordeon = ({ children, headName, input, meta, mode, schema, props
|
|
|
12
12
|
const { titleProps, togglerProps, withIndent = false, withDefaultSummary = false } = props, restLayoutProps = __rest(props, ["titleProps", "togglerProps", "withIndent", "withDefaultSummary"]);
|
|
13
13
|
const { copy, required, hidden, open } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
|
|
14
14
|
const overviewFlag = mode === SchemaRendererMode.Overview;
|
|
15
|
-
const summary = React.useMemo(() => (React.createElement(Text, Object.assign({}, titleProps, { className: b('title', { required: required && !overviewFlag }, titleProps === null || titleProps === void 0 ? void 0 : titleProps.className) }), schema.title)), [overviewFlag, required, schema.title, titleProps]);
|
|
15
|
+
const summary = React.useMemo(() => (React.createElement(Text, Object.assign({ variant: "subheader-1", color: "complementary" }, titleProps, { className: b('title', { required: required && !overviewFlag }, titleProps === null || titleProps === void 0 ? void 0 : titleProps.className) }), schema.title)), [overviewFlag, required, schema.title, titleProps]);
|
|
16
16
|
const helpMark = React.useMemo(() => {
|
|
17
17
|
if (schema.description) {
|
|
18
18
|
return (React.createElement(HelpMark, null,
|
|
@@ -35,7 +35,7 @@ export const Card = ({ children, headName, input, meta, mode, schema, props, })
|
|
|
35
35
|
React.createElement(Flex, { className: b('header'), direction: "column", justifyContent: "center" },
|
|
36
36
|
React.createElement(Flex, { justifyContent: "space-between", alignItems: "center" },
|
|
37
37
|
React.createElement(Flex, { alignItems: "center", gap: 2 },
|
|
38
|
-
React.createElement(Text, { variant: "subheader-1", className: b('title', { required: required && !overviewFlag }) }, schema.title),
|
|
38
|
+
React.createElement(Text, { variant: "subheader-1", color: "complementary", className: b('title', { required: required && !overviewFlag }) }, schema.title),
|
|
39
39
|
tooltip),
|
|
40
40
|
React.createElement(Flex, { className: b('header-actions'), alignItems: "center", gap: 2 },
|
|
41
41
|
overviewFlag ? (React.createElement(CopyButton, { className: b('copy-button'), copy: copy, value: input.value })) : null,
|
|
@@ -28,7 +28,7 @@ export const Section = ({ children, headName, input, meta, mode, schema, props,
|
|
|
28
28
|
React.createElement(Flex, { direction: "column", gap: 4 },
|
|
29
29
|
React.createElement(Flex, { direction: "column" },
|
|
30
30
|
React.createElement(Flex, { className: b('header'), gap: 2, alignItems: "center" },
|
|
31
|
-
React.createElement(Text, Object.assign({ variant: "subheader-1" }, restLayoutProps, { className: b('title', { required: required && !overviewFlag }, restLayoutProps === null || restLayoutProps === void 0 ? void 0 : restLayoutProps.className) }), schema.title),
|
|
31
|
+
React.createElement(Text, Object.assign({ variant: "subheader-1", color: "complementary" }, restLayoutProps, { className: b('title', { required: required && !overviewFlag }, restLayoutProps === null || restLayoutProps === void 0 ? void 0 : restLayoutProps.className) }), schema.title),
|
|
32
32
|
tooltip,
|
|
33
33
|
overviewFlag ? (React.createElement(CopyButton, { className: b('copy-button'), copy: copy, value: input.value })) : null,
|
|
34
34
|
overviewFlag ? null : (React.createElement(ArrayRemoveButton, { name: input.name, headName: headName }))),
|