@gravity-ui/dynamic-forms 5.23.0 → 5.24.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 (116) hide show
  1. package/build/cjs/lib/core/types/specs.d.ts +1 -1
  2. package/build/cjs/lib/kit/components/Inputs/MultiSelect/MultiSelect.js +24 -13
  3. package/build/cjs/lib/unstable/core/types/components.d.ts +3 -13
  4. package/build/cjs/lib/unstable/core/types/schema.d.ts +14 -7
  5. package/build/cjs/lib/unstable/core/useSchemaRenderer/types/state.d.ts +3 -0
  6. package/build/cjs/lib/unstable/core/utils/definers.d.ts +27 -13
  7. package/build/cjs/lib/unstable/kit/components/HTMLContent/HTMLContent.d.ts +2 -1
  8. package/build/cjs/lib/unstable/kit/components/HTMLContent/HTMLContent.js +12 -2
  9. package/build/cjs/lib/unstable/kit/components/LayoutContainer/LayoutContainer.css +3 -0
  10. package/build/cjs/lib/unstable/kit/components/LayoutContainer/LayoutContainer.d.ts +1 -0
  11. package/build/cjs/lib/unstable/kit/components/LayoutContainer/LayoutContainer.js +2 -2
  12. package/build/cjs/lib/unstable/kit/entities/Alert/Alert.css +16 -0
  13. package/build/cjs/lib/unstable/kit/entities/Alert/Alert.js +26 -7
  14. package/build/cjs/lib/unstable/kit/entities/ArrayEntity/ArrayEntity.d.ts +0 -1
  15. package/build/cjs/lib/unstable/kit/entities/ArrayEntity/ArrayEntity.js +4 -2
  16. package/build/cjs/lib/unstable/kit/entities/ArrayTable/ArrayTable.d.ts +0 -1
  17. package/build/cjs/lib/unstable/kit/entities/ArrayTable/ArrayTable.js +5 -3
  18. package/build/cjs/lib/unstable/kit/entities/FewOfNested/FewOfNested.css +3 -0
  19. package/build/cjs/lib/unstable/kit/entities/Label/Label.js +4 -4
  20. package/build/cjs/lib/unstable/kit/entities/Monaco/Monaco.js +3 -1
  21. package/build/cjs/lib/unstable/kit/entities/ObjectEntity/ObjectEntity.d.ts +0 -1
  22. package/build/cjs/lib/unstable/kit/entities/ObjectInline/ObjectInline.d.ts +0 -1
  23. package/build/cjs/lib/unstable/kit/entities/OneOfNested/OneOfNested.css +3 -0
  24. package/build/cjs/lib/unstable/kit/entities/TextContent/TextContent.js +4 -4
  25. package/build/cjs/lib/unstable/kit/form-entities/CheckboxGroupInput/CheckboxGroupInput.d.ts +0 -1
  26. package/build/cjs/lib/unstable/kit/form-entities/CheckboxGroupInput/CheckboxGroupInput.js +3 -1
  27. package/build/cjs/lib/unstable/kit/form-entities/CheckboxInput/CheckboxInput.js +3 -1
  28. package/build/cjs/lib/unstable/kit/form-entities/ColorPickerInput/ColorPickerInput.js +3 -1
  29. package/build/cjs/lib/unstable/kit/form-entities/DateInput/DateInput.js +3 -2
  30. package/build/cjs/lib/unstable/kit/form-entities/FileInput/FileInput.js +3 -1
  31. package/build/cjs/lib/unstable/kit/form-entities/MultiSelectInput/MultiSelectInput.js +4 -2
  32. package/build/cjs/lib/unstable/kit/form-entities/NumberInput/NumberInput.js +3 -2
  33. package/build/cjs/lib/unstable/kit/form-entities/NumberWithScaleInput/NumberWithScaleInput.js +3 -2
  34. package/build/cjs/lib/unstable/kit/form-entities/PasswordInput/PasswordInput.js +3 -2
  35. package/build/cjs/lib/unstable/kit/form-entities/RadioGroupInput/RadioGroupInput.js +3 -1
  36. package/build/cjs/lib/unstable/kit/form-entities/RangeSliderInput/RangeSliderInput.js +9 -8
  37. package/build/cjs/lib/unstable/kit/form-entities/SegmentedRadioGroupInput/SegmentedRadioGroupInput.js +3 -1
  38. package/build/cjs/lib/unstable/kit/form-entities/SelectInput/SelectInput.js +4 -2
  39. package/build/cjs/lib/unstable/kit/form-entities/SliderInput/SliderInput.js +3 -1
  40. package/build/cjs/lib/unstable/kit/form-entities/StringInput/StringInput.js +3 -2
  41. package/build/cjs/lib/unstable/kit/form-entities/StringNumberWithScaleInput/StringNumberWithScaleInput.js +4 -3
  42. package/build/cjs/lib/unstable/kit/form-entities/SwitchInput/SwitchInput.js +3 -1
  43. package/build/cjs/lib/unstable/kit/form-entities/TextAreaInput/TextAreaInput.js +3 -2
  44. package/build/cjs/lib/unstable/kit/form-layouts/FormColumn/FormColumn.js +8 -6
  45. package/build/cjs/lib/unstable/kit/form-layouts/FormRow/FormRow.js +8 -6
  46. package/build/cjs/lib/unstable/kit/index.d.ts +1 -0
  47. package/build/cjs/lib/unstable/kit/index.js +1 -0
  48. package/build/cjs/lib/unstable/kit/layouts/Accordeon/Accordeon.js +6 -4
  49. package/build/cjs/lib/unstable/kit/layouts/Card/Card.js +8 -6
  50. package/build/cjs/lib/unstable/kit/layouts/Section/Section.js +8 -6
  51. package/build/cjs/lib/unstable/kit/layouts/Transparent/Transparent.js +5 -3
  52. package/build/cjs/lib/unstable/kit/overview-layouts/OverviewColumn/OverviewColumn.js +7 -5
  53. package/build/cjs/lib/unstable/kit/overview-layouts/OverviewRow/OverviewRow.js +7 -5
  54. package/build/cjs/lib/unstable/kit/utils/index.d.ts +1 -1
  55. package/build/cjs/lib/unstable/kit/utils/index.js +1 -7
  56. package/build/cjs/lib/unstable/kit/utils/transformer.d.ts +10 -17
  57. package/build/cjs/lib/unstable/kit/utils/transformer.js +542 -2778
  58. package/build/esm/lib/core/types/specs.d.ts +1 -1
  59. package/build/esm/lib/kit/components/Inputs/MultiSelect/MultiSelect.js +24 -13
  60. package/build/esm/lib/unstable/core/types/components.d.ts +3 -13
  61. package/build/esm/lib/unstable/core/types/schema.d.ts +14 -7
  62. package/build/esm/lib/unstable/core/useSchemaRenderer/types/state.d.ts +3 -0
  63. package/build/esm/lib/unstable/core/utils/definers.d.ts +27 -13
  64. package/build/esm/lib/unstable/kit/components/HTMLContent/HTMLContent.d.ts +2 -1
  65. package/build/esm/lib/unstable/kit/components/HTMLContent/HTMLContent.js +12 -2
  66. package/build/esm/lib/unstable/kit/components/LayoutContainer/LayoutContainer.css +3 -0
  67. package/build/esm/lib/unstable/kit/components/LayoutContainer/LayoutContainer.d.ts +1 -0
  68. package/build/esm/lib/unstable/kit/components/LayoutContainer/LayoutContainer.js +2 -2
  69. package/build/esm/lib/unstable/kit/entities/Alert/Alert.css +16 -0
  70. package/build/esm/lib/unstable/kit/entities/Alert/Alert.d.ts +1 -0
  71. package/build/esm/lib/unstable/kit/entities/Alert/Alert.js +29 -9
  72. package/build/esm/lib/unstable/kit/entities/ArrayEntity/ArrayEntity.d.ts +0 -1
  73. package/build/esm/lib/unstable/kit/entities/ArrayEntity/ArrayEntity.js +4 -2
  74. package/build/esm/lib/unstable/kit/entities/ArrayTable/ArrayTable.d.ts +0 -1
  75. package/build/esm/lib/unstable/kit/entities/ArrayTable/ArrayTable.js +5 -3
  76. package/build/esm/lib/unstable/kit/entities/FewOfNested/FewOfNested.css +3 -0
  77. package/build/esm/lib/unstable/kit/entities/Label/Label.js +5 -5
  78. package/build/esm/lib/unstable/kit/entities/Monaco/Monaco.js +3 -1
  79. package/build/esm/lib/unstable/kit/entities/ObjectEntity/ObjectEntity.d.ts +0 -1
  80. package/build/esm/lib/unstable/kit/entities/ObjectInline/ObjectInline.d.ts +0 -1
  81. package/build/esm/lib/unstable/kit/entities/OneOfNested/OneOfNested.css +3 -0
  82. package/build/esm/lib/unstable/kit/entities/TextContent/TextContent.js +5 -5
  83. package/build/esm/lib/unstable/kit/form-entities/CheckboxGroupInput/CheckboxGroupInput.d.ts +0 -1
  84. package/build/esm/lib/unstable/kit/form-entities/CheckboxGroupInput/CheckboxGroupInput.js +3 -1
  85. package/build/esm/lib/unstable/kit/form-entities/CheckboxInput/CheckboxInput.js +3 -1
  86. package/build/esm/lib/unstable/kit/form-entities/ColorPickerInput/ColorPickerInput.js +3 -1
  87. package/build/esm/lib/unstable/kit/form-entities/DateInput/DateInput.js +3 -2
  88. package/build/esm/lib/unstable/kit/form-entities/FileInput/FileInput.js +3 -1
  89. package/build/esm/lib/unstable/kit/form-entities/MultiSelectInput/MultiSelectInput.js +4 -2
  90. package/build/esm/lib/unstable/kit/form-entities/NumberInput/NumberInput.js +3 -2
  91. package/build/esm/lib/unstable/kit/form-entities/NumberWithScaleInput/NumberWithScaleInput.js +3 -2
  92. package/build/esm/lib/unstable/kit/form-entities/PasswordInput/PasswordInput.js +3 -2
  93. package/build/esm/lib/unstable/kit/form-entities/RadioGroupInput/RadioGroupInput.js +3 -1
  94. package/build/esm/lib/unstable/kit/form-entities/RangeSliderInput/RangeSliderInput.js +9 -8
  95. package/build/esm/lib/unstable/kit/form-entities/SegmentedRadioGroupInput/SegmentedRadioGroupInput.js +3 -1
  96. package/build/esm/lib/unstable/kit/form-entities/SelectInput/SelectInput.js +4 -2
  97. package/build/esm/lib/unstable/kit/form-entities/SliderInput/SliderInput.js +3 -1
  98. package/build/esm/lib/unstable/kit/form-entities/StringInput/StringInput.js +3 -2
  99. package/build/esm/lib/unstable/kit/form-entities/StringNumberWithScaleInput/StringNumberWithScaleInput.js +4 -3
  100. package/build/esm/lib/unstable/kit/form-entities/SwitchInput/SwitchInput.js +3 -1
  101. package/build/esm/lib/unstable/kit/form-entities/TextAreaInput/TextAreaInput.js +3 -2
  102. package/build/esm/lib/unstable/kit/form-layouts/FormColumn/FormColumn.js +8 -6
  103. package/build/esm/lib/unstable/kit/form-layouts/FormRow/FormRow.js +8 -6
  104. package/build/esm/lib/unstable/kit/index.d.ts +1 -0
  105. package/build/esm/lib/unstable/kit/index.js +1 -0
  106. package/build/esm/lib/unstable/kit/layouts/Accordeon/Accordeon.js +6 -4
  107. package/build/esm/lib/unstable/kit/layouts/Card/Card.js +8 -6
  108. package/build/esm/lib/unstable/kit/layouts/Section/Section.js +8 -6
  109. package/build/esm/lib/unstable/kit/layouts/Transparent/Transparent.js +5 -3
  110. package/build/esm/lib/unstable/kit/overview-layouts/OverviewColumn/OverviewColumn.js +7 -5
  111. package/build/esm/lib/unstable/kit/overview-layouts/OverviewRow/OverviewRow.js +7 -5
  112. package/build/esm/lib/unstable/kit/utils/index.d.ts +1 -1
  113. package/build/esm/lib/unstable/kit/utils/index.js +1 -1
  114. package/build/esm/lib/unstable/kit/utils/transformer.d.ts +10 -17
  115. package/build/esm/lib/unstable/kit/utils/transformer.js +543 -2778
  116. package/package.json +1 -1
@@ -8,7 +8,7 @@ export interface ArraySpec<LinkType = any, InputComponentProps extends Record<st
8
8
  maxLength?: bigint;
9
9
  minLength?: bigint;
10
10
  items?: Spec;
11
- enum?: string[];
11
+ enum?: Array<string | number>;
12
12
  description?: Record<string, string>;
13
13
  validator?: string;
14
14
  viewSpec: {
@@ -13,17 +13,19 @@ export const MultiSelect = ({ name, input, spec, inputProps }) => {
13
13
  var _a;
14
14
  return withCustomOptions
15
15
  ? externalOptions || []
16
- : (_a = spec.enum) === null || _a === void 0 ? void 0 : _a.map((id) => {
17
- var _a, _b, _c, _d, _e;
18
- return ({
19
- id,
20
- value: id,
21
- text: ((_a = spec.description) === null || _a === void 0 ? void 0 : _a[id]) || id,
22
- content: ((_c = (_b = spec.viewSpec.selectParams) === null || _b === void 0 ? void 0 : _b.meta) === null || _c === void 0 ? void 0 : _c[id]) ? (React.createElement("div", { key: id },
23
- React.createElement(Text, null, ((_d = spec.description) === null || _d === void 0 ? void 0 : _d[id]) || id),
24
- React.createElement(Text, { color: "secondary", className: b('meta-text') }, spec.viewSpec.selectParams.meta[id]))) : (((_e = spec.description) === null || _e === void 0 ? void 0 : _e[id]) || id),
25
- key: id,
26
- });
16
+ : (_a = spec.enum) === null || _a === void 0 ? void 0 : _a.map((enumValue) => {
17
+ var _a, _b, _c;
18
+ const value = String(enumValue);
19
+ const text = ((_a = spec.description) === null || _a === void 0 ? void 0 : _a[value]) || value;
20
+ return {
21
+ id: value,
22
+ value,
23
+ text,
24
+ content: ((_c = (_b = spec.viewSpec.selectParams) === null || _b === void 0 ? void 0 : _b.meta) === null || _c === void 0 ? void 0 : _c[value]) ? (React.createElement("div", { key: value },
25
+ React.createElement(Text, null, text),
26
+ React.createElement(Text, { color: "secondary", className: b('meta-text') }, spec.viewSpec.selectParams.meta[value]))) : (text),
27
+ key: value,
28
+ };
27
29
  });
28
30
  }, [
29
31
  spec.enum,
@@ -50,7 +52,16 @@ export const MultiSelect = ({ name, input, spec, inputProps }) => {
50
52
  onBlur();
51
53
  }
52
54
  }, [onFocus, onBlur]);
53
- const _value = React.useMemo(() => transformArrOut(value), [value]);
54
- const handleChange = React.useCallback((value) => onChange(transformArrIn(value)), [onChange]);
55
+ const _value = React.useMemo(() => {
56
+ var _a;
57
+ return (_a = transformArrOut(value)) === null || _a === void 0 ? void 0 : _a.map(String);
58
+ }, [value]);
59
+ const handleChange = React.useCallback((value) => {
60
+ const enumValues = value.map((selectedValue) => {
61
+ var _a, _b;
62
+ return (_b = (_a = spec.enum) === null || _a === void 0 ? void 0 : _a.find((enumValue) => String(enumValue) === selectedValue)) !== null && _b !== void 0 ? _b : selectedValue;
63
+ });
64
+ onChange(transformArrIn(enumValues));
65
+ }, [onChange, spec.enum]);
55
66
  return (React.createElement(Select, Object.assign({ width: "max", className: b(), filterable: filterable, renderOption: renderOption, getOptionHeight: getOptionHeight }, inputProps, { value: _value, options: options, onUpdate: handleChange, onOpenChange: handleToggle, disabled: spec.viewSpec.disabled, placeholder: spec.viewSpec.placeholder, filterPlaceholder: (_d = spec.viewSpec.selectParams) === null || _d === void 0 ? void 0 : _d.filterPlaceholder, multiple: true, qa: name })));
56
67
  };
@@ -3,31 +3,21 @@ import type { FieldRenderProps } from 'react-final-form';
3
3
  import type { SchemaRendererMode } from '../constants';
4
4
  import type { SchemaToValueType } from './helpers';
5
5
  import type { JsonSchema } from './schema';
6
- export interface DefaultNodeLayoutProps {
7
- copy?: boolean;
8
- hidden?: boolean;
9
- open?: boolean;
10
- required?: boolean;
11
- }
12
6
  export interface NodeLayoutProps<Schema extends JsonSchema, Props extends Record<string, any> = {}, Value extends SchemaToValueType<Schema> = SchemaToValueType<Schema>> extends FieldRenderProps<Value | null | undefined> {
13
7
  children: React.ReactNode;
14
8
  headName: string;
15
9
  mode: SchemaRendererMode;
16
- props: DefaultNodeLayoutProps & Partial<Props>;
10
+ props: Partial<Props>;
17
11
  schema: Schema;
18
12
  schemaPath: string;
19
13
  }
20
14
  export type NodeLayout<Schema extends JsonSchema, Props extends Record<string, any> = {}, Value extends SchemaToValueType<Schema> = SchemaToValueType<Schema>> = React.FC<NodeLayoutProps<Schema, Props, Value>>;
21
- export interface DefaultNodeEntityProps {
22
- disabled?: boolean;
23
- required?: boolean;
24
- }
25
15
  export interface NodeEntityProps<Schema extends JsonSchema, Props extends Record<string, any> = {}, LayoutProps extends Record<string, any> = {}, Value extends SchemaToValueType<Schema> = SchemaToValueType<Schema>> extends FieldRenderProps<Value | null | undefined> {
26
16
  Layout?: NodeLayout<Schema, LayoutProps>;
27
17
  headName: string;
28
- layoutProps?: DefaultNodeLayoutProps & Partial<LayoutProps>;
18
+ layoutProps?: Partial<LayoutProps>;
29
19
  mode: SchemaRendererMode;
30
- props: DefaultNodeEntityProps & Partial<Props>;
20
+ props: Partial<Props>;
31
21
  schema: Schema;
32
22
  schemaPath: string;
33
23
  }
@@ -1,25 +1,32 @@
1
1
  import type { JsonSchemaType, NodeType } from '../constants';
2
- import type { DefaultNodeEntityProps, DefaultNodeLayoutProps, NodeEntity, NodeLayout } from './components';
2
+ import type { NodeEntity, NodeLayout } from './components';
3
3
  import type { ErrorMessages, Validator } from './validation';
4
4
  import type { ArrayValue, FieldValue, ObjectValue } from './values';
5
5
  interface NodeParameters<Type extends NodeType, Schema extends JsonSchema> {
6
6
  nodeParameters?: {
7
7
  entity?: string | NodeEntity<Schema>;
8
- entityProps?: DefaultNodeEntityProps & Record<string, any>;
8
+ entityProps?: Record<string, any>;
9
9
  errorMessages?: Omit<ErrorMessages, 'dependencies' | 'required'> & {
10
10
  dependencies?: ErrorMessages['dependencies'] | Record<string, ErrorMessages['dependencies']>;
11
11
  required?: ErrorMessages['required'] | Record<string, ErrorMessages['required']>;
12
12
  };
13
+ flags?: {
14
+ copy?: boolean;
15
+ disabled?: boolean;
16
+ hidden?: boolean;
17
+ open?: boolean;
18
+ required?: boolean;
19
+ };
13
20
  formEntity?: string | NodeEntity<Schema>;
14
- formEntityProps?: DefaultNodeEntityProps & Record<string, any>;
21
+ formEntityProps?: Record<string, any>;
15
22
  formLayout?: string | NodeLayout<Schema>;
16
- formLayoutProps?: DefaultNodeLayoutProps & Record<string, any>;
23
+ formLayoutProps?: Record<string, any>;
17
24
  layout?: string | NodeLayout<Schema>;
18
- layoutProps?: DefaultNodeLayoutProps & Record<string, any>;
25
+ layoutProps?: Record<string, any>;
19
26
  overviewEntity?: string | NodeEntity<Schema>;
20
- overviewEntityProps?: DefaultNodeEntityProps & Record<string, any>;
27
+ overviewEntityProps?: Record<string, any>;
21
28
  overviewLayout?: string | NodeLayout<Schema>;
22
- overviewLayoutProps?: DefaultNodeLayoutProps & Record<string, any>;
29
+ overviewLayoutProps?: Record<string, any>;
23
30
  type?: Type;
24
31
  validator?: string | Validator<Schema>;
25
32
  };
@@ -29,6 +29,9 @@ export interface SchemaRendererState<UserContext extends Record<string, unknown>
29
29
  unsubscribe: (id: string) => void;
30
30
  userContext: {
31
31
  MonacoEditor?: React.ComponentType<MonacoEditorProps>;
32
+ RenderHTMLOrMD?: React.ComponentType<{
33
+ content: string;
34
+ }>;
32
35
  } & UserContext;
33
36
  waiters: Record<string, ValidationWaiter | undefined>;
34
37
  }
@@ -1,5 +1,5 @@
1
1
  import type { NodeType } from '../constants';
2
- import type { DefaultNodeEntityProps, DefaultNodeLayoutProps, ErrorMessages, NodeEntity, NodeLayout, NodesConfig, Validator } from '../types';
2
+ import type { ErrorMessages, NodeEntity, NodeLayout, NodesConfig, Validator } from '../types';
3
3
  import type { EntityKind, ExtractNodeEntityProps, ExtractNodeLayoutProps, LayoutKind, NodeComponentProps, NodeTypeConfigKey, SchemaOfNodeType } from '../types/helpers';
4
4
  export declare const defineNodeEntityConfig: <Component extends NodeEntity<any>>(nodeEntityConfig: {
5
5
  Component: Component;
@@ -20,39 +20,53 @@ export declare const defineNodeLayoutConfig: <Component extends NodeLayout<any>>
20
20
  export declare const createNodeParametersDefiner: <Config extends NodesConfig>(_config: Config) => <Type extends NodeType, const Entity extends NodeTypeConfigKey<Config, Type, "formEntities"> | NodeTypeConfigKey<Config, Type, "overviewEntities"> | NodeEntity<SchemaOfNodeType<Type>> | undefined = undefined, const FormEntity extends NodeTypeConfigKey<Config, Type, "formEntities"> | NodeEntity<SchemaOfNodeType<Type>> | undefined = undefined, const OverviewEntity extends NodeTypeConfigKey<Config, Type, "overviewEntities"> | NodeEntity<SchemaOfNodeType<Type>> | undefined = undefined, const Layout extends NodeTypeConfigKey<Config, Type, "formLayouts"> | NodeTypeConfigKey<Config, Type, "overviewLayouts"> | NodeLayout<SchemaOfNodeType<Type>> | undefined = undefined, const FormLayout extends NodeTypeConfigKey<Config, Type, "formLayouts"> | NodeLayout<SchemaOfNodeType<Type>> | undefined = undefined, const OverviewLayout extends NodeTypeConfigKey<Config, Type, "overviewLayouts"> | NodeLayout<SchemaOfNodeType<Type>> | undefined = undefined, const ValidatorRef extends NodeTypeConfigKey<Config, Type, "validators"> | Validator<SchemaOfNodeType<Type>> | undefined = undefined>(nodeParameters: {
21
21
  type: Type;
22
22
  entity?: NoInfer<NodeTypeConfigKey<Config, Type, "formEntities">> | NoInfer<NodeTypeConfigKey<Config, Type, "overviewEntities">> | NodeEntity<SchemaOfNodeType<Type>> | Entity;
23
- entityProps?: DefaultNodeEntityProps & NodeComponentProps<Config, Type, EntityKind, Entity>;
23
+ entityProps?: NodeComponentProps<Config, Type, EntityKind, Entity>;
24
24
  formEntity?: NoInfer<NodeTypeConfigKey<Config, Type, "formEntities">> | NodeEntity<SchemaOfNodeType<Type>> | FormEntity;
25
- formEntityProps?: DefaultNodeEntityProps & NodeComponentProps<Config, Type, "formEntities", FormEntity>;
25
+ formEntityProps?: NodeComponentProps<Config, Type, "formEntities", FormEntity>;
26
26
  overviewEntity?: NoInfer<NodeTypeConfigKey<Config, Type, "overviewEntities">> | NodeEntity<SchemaOfNodeType<Type>> | OverviewEntity;
27
- overviewEntityProps?: DefaultNodeEntityProps & NodeComponentProps<Config, Type, "overviewEntities", OverviewEntity>;
27
+ overviewEntityProps?: NodeComponentProps<Config, Type, "overviewEntities", OverviewEntity>;
28
28
  layout?: NoInfer<NodeTypeConfigKey<Config, Type, "formLayouts">> | NoInfer<NodeTypeConfigKey<Config, Type, "overviewLayouts">> | NodeLayout<SchemaOfNodeType<Type>> | Layout;
29
- layoutProps?: DefaultNodeLayoutProps & NodeComponentProps<Config, Type, LayoutKind, Layout>;
29
+ layoutProps?: NodeComponentProps<Config, Type, LayoutKind, Layout>;
30
30
  formLayout?: NoInfer<NodeTypeConfigKey<Config, Type, "formLayouts">> | NodeLayout<SchemaOfNodeType<Type>> | FormLayout;
31
- formLayoutProps?: DefaultNodeLayoutProps & NodeComponentProps<Config, Type, "formLayouts", FormLayout>;
31
+ formLayoutProps?: NodeComponentProps<Config, Type, "formLayouts", FormLayout>;
32
32
  overviewLayout?: NoInfer<NodeTypeConfigKey<Config, Type, "overviewLayouts">> | NodeLayout<SchemaOfNodeType<Type>> | OverviewLayout;
33
- overviewLayoutProps?: DefaultNodeLayoutProps & NodeComponentProps<Config, Type, "overviewLayouts", OverviewLayout>;
33
+ overviewLayoutProps?: NodeComponentProps<Config, Type, "overviewLayouts", OverviewLayout>;
34
34
  errorMessages?: Omit<ErrorMessages, "dependencies" | "required"> & {
35
35
  dependencies?: ErrorMessages["dependencies"] | Record<string, ErrorMessages["dependencies"]>;
36
36
  required?: ErrorMessages["required"] | Record<string, ErrorMessages["required"]>;
37
37
  };
38
38
  validator?: NoInfer<NodeTypeConfigKey<Config, Type, "validators">> | Validator<SchemaOfNodeType<Type>> | ValidatorRef;
39
+ flags?: {
40
+ disabled?: boolean;
41
+ copy?: boolean;
42
+ hidden?: boolean;
43
+ open?: boolean;
44
+ required?: boolean;
45
+ };
39
46
  }) => {
40
47
  type: Type;
41
48
  entity?: NoInfer<NodeTypeConfigKey<Config, Type, "formEntities">> | NoInfer<NodeTypeConfigKey<Config, Type, "overviewEntities">> | NodeEntity<SchemaOfNodeType<Type>> | Entity;
42
- entityProps?: DefaultNodeEntityProps & NodeComponentProps<Config, Type, EntityKind, Entity>;
49
+ entityProps?: NodeComponentProps<Config, Type, EntityKind, Entity>;
43
50
  formEntity?: NoInfer<NodeTypeConfigKey<Config, Type, "formEntities">> | NodeEntity<SchemaOfNodeType<Type>> | FormEntity;
44
- formEntityProps?: DefaultNodeEntityProps & NodeComponentProps<Config, Type, "formEntities", FormEntity>;
51
+ formEntityProps?: NodeComponentProps<Config, Type, "formEntities", FormEntity>;
45
52
  overviewEntity?: NoInfer<NodeTypeConfigKey<Config, Type, "overviewEntities">> | NodeEntity<SchemaOfNodeType<Type>> | OverviewEntity;
46
- overviewEntityProps?: DefaultNodeEntityProps & NodeComponentProps<Config, Type, "overviewEntities", OverviewEntity>;
53
+ overviewEntityProps?: NodeComponentProps<Config, Type, "overviewEntities", OverviewEntity>;
47
54
  layout?: NoInfer<NodeTypeConfigKey<Config, Type, "formLayouts">> | NoInfer<NodeTypeConfigKey<Config, Type, "overviewLayouts">> | NodeLayout<SchemaOfNodeType<Type>> | Layout;
48
- layoutProps?: DefaultNodeLayoutProps & NodeComponentProps<Config, Type, LayoutKind, Layout>;
55
+ layoutProps?: NodeComponentProps<Config, Type, LayoutKind, Layout>;
49
56
  formLayout?: NoInfer<NodeTypeConfigKey<Config, Type, "formLayouts">> | NodeLayout<SchemaOfNodeType<Type>> | FormLayout;
50
- formLayoutProps?: DefaultNodeLayoutProps & NodeComponentProps<Config, Type, "formLayouts", FormLayout>;
57
+ formLayoutProps?: NodeComponentProps<Config, Type, "formLayouts", FormLayout>;
51
58
  overviewLayout?: NoInfer<NodeTypeConfigKey<Config, Type, "overviewLayouts">> | NodeLayout<SchemaOfNodeType<Type>> | OverviewLayout;
52
- overviewLayoutProps?: DefaultNodeLayoutProps & NodeComponentProps<Config, Type, "overviewLayouts", OverviewLayout>;
59
+ overviewLayoutProps?: NodeComponentProps<Config, Type, "overviewLayouts", OverviewLayout>;
53
60
  errorMessages?: Omit<ErrorMessages, "dependencies" | "required"> & {
54
61
  dependencies?: ErrorMessages["dependencies"] | Record<string, ErrorMessages["dependencies"]>;
55
62
  required?: ErrorMessages["required"] | Record<string, ErrorMessages["required"]>;
56
63
  };
57
64
  validator?: NoInfer<NodeTypeConfigKey<Config, Type, "validators">> | Validator<SchemaOfNodeType<Type>> | ValidatorRef;
65
+ flags?: {
66
+ disabled?: boolean;
67
+ copy?: boolean;
68
+ hidden?: boolean;
69
+ open?: boolean;
70
+ required?: boolean;
71
+ };
58
72
  };
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { type TextProps } from '@gravity-ui/uikit';
3
3
  export interface HTMLContentProps extends TextProps {
4
- html: string;
4
+ content: string;
5
+ headName?: string;
5
6
  }
6
7
  export declare const HTMLContent: React.FC<HTMLContentProps>;
@@ -1,7 +1,17 @@
1
1
  import { __rest } from "tslib";
2
2
  import React from 'react';
3
3
  import { Text } from '@gravity-ui/uikit';
4
+ import { SchemaRendererEventType, useSchemaRendererState } from '../../../core';
4
5
  export const HTMLContent = (_a) => {
5
- var { html } = _a, restProps = __rest(_a, ["html"]);
6
- return React.createElement(Text, Object.assign({}, restProps, { dangerouslySetInnerHTML: { __html: html } }));
6
+ var _b;
7
+ var { content, headName = '___stub-name' } = _a, restProps = __rest(_a, ["content", "headName"]);
8
+ const state = useSchemaRendererState({
9
+ headName,
10
+ subscriptions: [SchemaRendererEventType.UserContext],
11
+ });
12
+ const RenderHTMLOrMD = (_b = state === null || state === void 0 ? void 0 : state.userContext) === null || _b === void 0 ? void 0 : _b.RenderHTMLOrMD;
13
+ if (RenderHTMLOrMD) {
14
+ return React.createElement(RenderHTMLOrMD, { content: content });
15
+ }
16
+ return React.createElement(Text, Object.assign({}, restProps, { dangerouslySetInnerHTML: { __html: content } }));
7
17
  };
@@ -8,4 +8,7 @@
8
8
  }
9
9
  .sr-layout-container_hide-empty:not(:has([data-fill=populated])) {
10
10
  display: none;
11
+ }
12
+ .sr-layout-container_hidden {
13
+ display: none;
11
14
  }
@@ -4,5 +4,6 @@ import './LayoutContainer.css';
4
4
  export interface LayoutContainerProps extends FlexProps {
5
5
  children: React.ReactNode;
6
6
  hideEmpty?: boolean;
7
+ hidden?: boolean;
7
8
  }
8
9
  export declare const LayoutContainer: React.FC<LayoutContainerProps>;
@@ -5,6 +5,6 @@ import { block } from '../../utils';
5
5
  import './LayoutContainer.css';
6
6
  const b = block('layout-container');
7
7
  export const LayoutContainer = (_a) => {
8
- var { className, children, hideEmpty = false } = _a, restProps = __rest(_a, ["className", "children", "hideEmpty"]);
9
- return (React.createElement(Flex, Object.assign({ className: b({ 'hide-empty': hideEmpty }, className), direction: "column" }, restProps), children));
8
+ var { className, children, hideEmpty = false, hidden = false } = _a, restProps = __rest(_a, ["className", "children", "hideEmpty", "hidden"]);
9
+ return (React.createElement(Flex, Object.assign({ className: b({ 'hide-empty': hideEmpty, hidden }, className), direction: "column" }, restProps), children));
10
10
  };
@@ -0,0 +1,16 @@
1
+ .sr-alert .g-alert__text-content > div {
2
+ gap: 0 !important;
3
+ }
4
+ .sr-alert_expanded .g-alert__text-content > div {
5
+ gap: calc(var(--g-spacing-base) * 2) !important;
6
+ }
7
+ .sr-alert__title {
8
+ cursor: pointer;
9
+ }
10
+ .sr-alert__message {
11
+ height: 0;
12
+ overflow: hidden;
13
+ }
14
+ .sr-alert__message_expanded {
15
+ height: unset;
16
+ }
@@ -1,6 +1,7 @@
1
1
  import * as icons from '@gravity-ui/icons';
2
2
  import { type IconProps, type AlertProps as UIKitAlertProps } from '@gravity-ui/uikit';
3
3
  import type { JsonSchemaString, NodeEntity } from '../../../core';
4
+ import './Alert.css';
4
5
  export interface AlertProps extends UIKitAlertProps {
5
6
  iconName?: keyof typeof icons;
6
7
  iconProps?: Partial<IconProps>;
@@ -1,23 +1,43 @@
1
1
  import { __rest } from "tslib";
2
2
  import React from 'react';
3
3
  import * as icons from '@gravity-ui/icons';
4
- import { Icon, Alert as UIKitAlert, } from '@gravity-ui/uikit';
5
- import { EntityContainer } from '../../components';
6
- export const Alert = ({ props, schema }) => {
7
- const { iconName, iconProps, message } = props, entityRestProps = __rest(props, ["iconName", "iconProps", "message"]);
4
+ import { Flex, Icon, Alert as UIKitAlert, } from '@gravity-ui/uikit';
5
+ import { EntityContainer, HTMLContent } from '../../components';
6
+ import { block } from '../../utils';
7
+ import './Alert.css';
8
+ const b = block('alert');
9
+ export const Alert = ({ headName, props, schema }) => {
10
+ var _a;
11
+ const { iconName, iconProps, message, title: titleProp } = props, entityRestProps = __rest(props, ["iconName", "iconProps", "message", "title"]);
12
+ const { open = true } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
13
+ const [expanded, setExpanded] = React.useState(open);
8
14
  const icon = React.useMemo(() => iconName && icons[iconName] ? (React.createElement(Icon, Object.assign({ data: icons[iconName] }, iconProps))) : undefined, [iconName, iconProps]);
15
+ const title = React.useMemo(() => {
16
+ if (titleProp && typeof titleProp !== 'string') {
17
+ return titleProp;
18
+ }
19
+ const title = typeof titleProp === 'string' ? titleProp : schema.title;
20
+ if (title) {
21
+ return (React.createElement(Flex, { className: b('title'), alignItems: "center", gap: "2", onClick: () => setExpanded(!expanded) },
22
+ React.createElement(HTMLContent, { content: title, headName: headName, variant: "subheader-2" }),
23
+ React.createElement(Icon, { data: expanded ? icons.ChevronUp : icons.ChevronDown, size: 16 })));
24
+ }
25
+ return null;
26
+ }, [headName, schema.title, titleProp, expanded]);
9
27
  const msg = React.useMemo(() => {
10
28
  if (message) {
11
29
  if (typeof message === 'string') {
12
- return React.createElement("span", { dangerouslySetInnerHTML: { __html: message } });
30
+ return (React.createElement("div", { className: b('message', { expanded }) },
31
+ React.createElement(HTMLContent, { content: message, headName: headName })));
13
32
  }
14
33
  return message;
15
34
  }
16
35
  if (schema.description) {
17
- return React.createElement("span", { dangerouslySetInnerHTML: { __html: schema.description } });
36
+ return (React.createElement("div", { className: b('message', { expanded }) },
37
+ React.createElement(HTMLContent, { content: schema.description, headName: headName })));
18
38
  }
19
39
  return undefined;
20
- }, [message, schema.description]);
21
- return (React.createElement(EntityContainer, { stretch: "fit", fill: "populated" },
22
- React.createElement(UIKitAlert, Object.assign({ icon: icon, message: msg }, entityRestProps))));
40
+ }, [expanded, headName, message, schema.description]);
41
+ return (React.createElement(EntityContainer, { className: b({ expanded }), stretch: "fit", fill: "populated" },
42
+ React.createElement(UIKitAlert, Object.assign({ icon: icon, message: msg, title: title }, entityRestProps))));
23
43
  };
@@ -2,6 +2,5 @@ import { type JsonSchemaArray, type NodeEntity } from '../../../core';
2
2
  import './ArrayEntity.css';
3
3
  export interface ArrayEntityProps {
4
4
  addButtonText?: string;
5
- disabled?: boolean;
6
5
  }
7
6
  export declare const ArrayEntity: NodeEntity<JsonSchemaArray, ArrayEntityProps>;
@@ -7,7 +7,9 @@ import { block } from '../../utils';
7
7
  import './ArrayEntity.css';
8
8
  const b = block('array-entity');
9
9
  export const ArrayEntity = ({ headName, input, mode, props, schema, schemaPath, }) => {
10
+ var _a;
10
11
  const { name, onBlur, onChange, onFocus, value } = input;
12
+ const { disabled } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
11
13
  const overviewFlag = mode === SchemaRendererMode.Overview;
12
14
  const addButton = React.useMemo(() => {
13
15
  const itemsSchema = schema.items;
@@ -19,12 +21,12 @@ export const ArrayEntity = ({ headName, input, mode, props, schema, schemaPath,
19
21
  onChange([...(value || []), itemsSchema === null || itemsSchema === void 0 ? void 0 : itemsSchema.default]);
20
22
  onBlur();
21
23
  };
22
- return (React.createElement(Button, { className: b('add-button'), onClick: onClick, disabled: props.disabled || schema.readOnly, qa: `${name}-add-button` },
24
+ return (React.createElement(Button, { className: b('add-button'), onClick: onClick, disabled: disabled || schema.readOnly, qa: `${name}-add-button` },
23
25
  React.createElement(Icon, { data: Plus, size: 14 }),
24
26
  props.addButtonText || null));
25
27
  }, [
26
28
  props.addButtonText,
27
- props.disabled,
29
+ disabled,
28
30
  name,
29
31
  onBlur,
30
32
  onChange,
@@ -3,6 +3,5 @@ import './ArrayTable.css';
3
3
  export interface ArrayTableProps {
4
4
  order?: string[];
5
5
  addButtonText?: string;
6
- disabled?: boolean;
7
6
  }
8
7
  export declare const ArrayTable: NodeEntity<JsonSchemaArray, ArrayTableProps>;
@@ -7,7 +7,9 @@ import { block } from '../../utils';
7
7
  import './ArrayTable.css';
8
8
  const b = block('array-table');
9
9
  export const ArrayTable = ({ headName, input, mode, props, schema, schemaPath, }) => {
10
+ var _a;
10
11
  const { name, onBlur, onChange, onFocus, value } = input;
12
+ const { disabled } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
11
13
  const overviewFlag = mode === SchemaRendererMode.Overview;
12
14
  const addButton = React.useMemo(() => {
13
15
  const itemsSchema = schema.items;
@@ -19,12 +21,12 @@ export const ArrayTable = ({ headName, input, mode, props, schema, schemaPath, }
19
21
  onChange([...(value || []), itemsSchema === null || itemsSchema === void 0 ? void 0 : itemsSchema.default]);
20
22
  onBlur();
21
23
  };
22
- return (React.createElement(Button, { className: b('add-button'), onClick: onClick, disabled: props.disabled || schema.readOnly, qa: `${name}-add-button` },
24
+ return (React.createElement(Button, { className: b('add-button'), onClick: onClick, disabled: disabled || schema.readOnly, qa: `${name}-add-button` },
23
25
  React.createElement(Icon, { data: Plus, size: 14 }),
24
26
  props.addButtonText || null));
25
27
  }, [
26
28
  props.addButtonText,
27
- props.disabled,
29
+ disabled,
28
30
  name,
29
31
  onBlur,
30
32
  onChange,
@@ -76,7 +78,7 @@ export const ArrayTable = ({ headName, input, mode, props, schema, schemaPath, }
76
78
  React.createElement("div", { className: b('column-title') }, (_a = column.schema.title) === null || _a === void 0 ? void 0 : _a.split(' ').map((word, wIndex, array) => (React.createElement("div", { className: b('column-title-word'), key: word },
77
79
  React.createElement(Text, { variant: "subheader-1" }, word),
78
80
  wIndex + 1 === array.length && column.schema.description ? (React.createElement(HelpMark, null,
79
- React.createElement(HTMLContent, { html: column.schema.description }))) : null))))));
81
+ React.createElement(HTMLContent, { content: column.schema.description, headName: headName }))) : null))))));
80
82
  })));
81
83
  const rows = new Array(rowsCount).fill(null).map((_, rIndex) => (React.createElement("div", { className: b('row', { 'with-remove-button': withRemoveButton }), style: { '--columns-count': columns.length }, key: rIndex },
82
84
  React.createElement("div", { className: b('cell') },
@@ -1,6 +1,9 @@
1
1
  .sr-few-of-nested__content {
2
2
  margin-top: calc(var(--g-spacing-base) * 4);
3
3
  }
4
+ .sr-few-of-nested__content:empty {
5
+ display: none;
6
+ }
4
7
  .sr-few-of-nested__content_with-indent {
5
8
  position: relative;
6
9
  padding-left: calc(var(--g-spacing-base) * 7);
@@ -3,8 +3,8 @@ import React from 'react';
3
3
  import * as icons from '@gravity-ui/icons';
4
4
  import { Icon, Label as UIKitLabel, } from '@gravity-ui/uikit';
5
5
  import { SchemaRendererMode } from '../../../core';
6
- import { EntityContainer } from '../../components';
7
- export const Label = ({ input, mode, props, schema }) => {
6
+ import { EntityContainer, HTMLContent } from '../../components';
7
+ export const Label = ({ headName, input, mode, props, schema, }) => {
8
8
  const { value } = input;
9
9
  const { iconName, iconProps, title } = props, restEntityProps = __rest(props, ["iconName", "iconProps", "title"]);
10
10
  const overviewFlag = mode === SchemaRendererMode.Overview;
@@ -12,15 +12,15 @@ export const Label = ({ input, mode, props, schema }) => {
12
12
  const content = React.useMemo(() => {
13
13
  if (title) {
14
14
  if (typeof title === 'string') {
15
- return React.createElement("span", { dangerouslySetInnerHTML: { __html: title } });
15
+ return React.createElement(HTMLContent, { content: title, headName: headName });
16
16
  }
17
17
  return title;
18
18
  }
19
19
  if (schema.description) {
20
- return React.createElement("span", { dangerouslySetInnerHTML: { __html: schema.description } });
20
+ return React.createElement(HTMLContent, { content: schema.description, headName: headName });
21
21
  }
22
22
  return undefined;
23
- }, [title, schema.description]);
23
+ }, [headName, title, schema.description]);
24
24
  return (React.createElement(EntityContainer, { stretch: "fit", fill: "populated" },
25
25
  React.createElement(UIKitLabel, Object.assign({ size: overviewFlag ? 'xs' : 'm', value: value, icon: icon }, restEntityProps), content)));
26
26
  };
@@ -7,7 +7,9 @@ import { block, getBooleanValidationState } from '../../utils';
7
7
  import './Monaco.css';
8
8
  const b = block('monaco');
9
9
  export const Monaco = ({ headName, input, meta, mode, props, schema, }) => {
10
+ var _a;
10
11
  const { name, onBlur, onChange, onFocus, value } = input;
12
+ const { disabled } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
11
13
  const overviewFlag = mode === SchemaRendererMode.Overview;
12
14
  const { language = 'plaintext', options: optionsProps, withDialog = true, ignoreMonacoErrors = false, width = '100%', height = 350 } = props, restEntityProps = __rest(props, ["language", "options", "withDialog", "ignoreMonacoErrors", "width", "height"]);
13
15
  const srState = useSchemaRendererState({
@@ -20,7 +22,7 @@ export const Monaco = ({ headName, input, meta, mode, props, schema, }) => {
20
22
  const innerErrorRef = React.useRef(null);
21
23
  const [dialogOpen, setDialogOpen] = React.useState(false);
22
24
  const toggleDialogOpen = React.useCallback(() => setDialogOpen((f) => !f), []);
23
- const options = React.useMemo(() => (Object.assign({ fontSize: 12, readOnly: overviewFlag || schema.readOnly, formatOnPaste: true, formatOnType: true, contextmenu: false, minimap: { enabled: false }, autoClosingBrackets: 'languageDefined', automaticLayout: true }, optionsProps)), [optionsProps, overviewFlag, schema.readOnly]);
25
+ const options = React.useMemo(() => (Object.assign({ fontSize: 12, readOnly: overviewFlag || disabled || schema.readOnly, formatOnPaste: true, formatOnType: true, contextmenu: false, minimap: { enabled: false }, autoClosingBrackets: 'languageDefined', automaticLayout: true }, optionsProps)), [disabled, optionsProps, overviewFlag, schema.readOnly]);
24
26
  const onUpdate = React.useCallback((value) => {
25
27
  onFocus();
26
28
  onChange(value);
@@ -1,6 +1,5 @@
1
1
  import { type JsonSchemaObject, type NodeEntity } from '../../../core';
2
2
  export interface ObjectEntityProps {
3
- disabled?: boolean;
4
3
  order?: string[];
5
4
  }
6
5
  export declare const ObjectEntity: NodeEntity<JsonSchemaObject, ObjectEntityProps>;
@@ -2,7 +2,6 @@ import { type JsonSchemaObject, type NodeEntity } from '../../../core';
2
2
  import './ObjectInline.css';
3
3
  export interface ObjectInlineProps {
4
4
  delimiter?: string | Record<string, string>;
5
- disabled?: boolean;
6
5
  order?: string[];
7
6
  }
8
7
  export declare const ObjectInline: NodeEntity<JsonSchemaObject, ObjectInlineProps>;
@@ -1,6 +1,9 @@
1
1
  .sr-one-of-nested__content {
2
2
  margin-top: calc(var(--g-spacing-base) * 4);
3
3
  }
4
+ .sr-one-of-nested__content:empty {
5
+ display: none;
6
+ }
4
7
  .sr-one-of-nested__content_with-indent {
5
8
  position: relative;
6
9
  padding-left: calc(var(--g-spacing-base) * 7);
@@ -3,26 +3,26 @@ import React from 'react';
3
3
  import * as icons from '@gravity-ui/icons';
4
4
  import { Icon, Label as UIKitLabel, } from '@gravity-ui/uikit';
5
5
  import { SchemaRendererMode } from '../../../core';
6
- import { EntityContainer } from '../../components';
6
+ import { EntityContainer, HTMLContent } from '../../components';
7
7
  import { block } from '../../utils';
8
8
  import './TextContent.css';
9
9
  const b = block('text-content');
10
- export const TextContent = ({ input, mode, props, schema, }) => {
10
+ export const TextContent = ({ headName, input, mode, props, schema, }) => {
11
11
  const { className, iconName, iconProps, title: titleProp } = props, restEntityProps = __rest(props, ["className", "iconName", "iconProps", "title"]);
12
12
  const overviewFlag = mode === SchemaRendererMode.Overview;
13
13
  const icon = React.useMemo(() => iconName && icons[iconName] ? (React.createElement(Icon, Object.assign({ data: icons[iconName] }, iconProps))) : undefined, [iconName, iconProps]);
14
14
  const content = React.useMemo(() => {
15
15
  if (titleProp) {
16
16
  if (typeof titleProp === 'string') {
17
- return React.createElement("span", { dangerouslySetInnerHTML: { __html: titleProp } });
17
+ return React.createElement(HTMLContent, { content: titleProp, headName: headName });
18
18
  }
19
19
  return titleProp;
20
20
  }
21
21
  if (schema.description) {
22
- return React.createElement("span", { dangerouslySetInnerHTML: { __html: schema.description } });
22
+ return React.createElement(HTMLContent, { content: schema.description, headName: headName });
23
23
  }
24
24
  return undefined;
25
- }, [titleProp, schema.description]);
25
+ }, [headName, titleProp, schema.description]);
26
26
  return (React.createElement(EntityContainer, { stretch: "fit", fill: "populated" },
27
27
  React.createElement(UIKitLabel, Object.assign({ size: overviewFlag ? 'xs' : 'm', value: input.value, icon: icon, className: b(null, className) }, restEntityProps, { theme: "clear" }), content)));
28
28
  };
@@ -4,6 +4,5 @@ export interface CheckboxGroupInputProps {
4
4
  enumDescriptions?: Record<string, string>;
5
5
  optionsDisabled?: Record<string, boolean>;
6
6
  direction?: 'row' | 'column';
7
- disabled?: boolean;
8
7
  }
9
8
  export declare const CheckboxGroupInput: NodeEntity<JsonSchemaArray, CheckboxGroupInputProps>;
@@ -5,8 +5,10 @@ import { block, getBooleanValidationState } from '../../utils';
5
5
  import './CheckboxGroupInput.css';
6
6
  const b = block('checkbox-group-input');
7
7
  export const CheckboxGroupInput = ({ input, props, meta, schema, }) => {
8
+ var _a;
8
9
  const { name, onBlur, onChange, onFocus, value: inputValue } = input;
9
- const { enumDescriptions, direction = 'row', disabled, optionsDisabled } = props;
10
+ const { enumDescriptions, direction = 'row', optionsDisabled } = props;
11
+ const { disabled } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
10
12
  const value = React.useMemo(() => (Array.isArray(inputValue) ? inputValue : []), [inputValue]);
11
13
  const options = React.useMemo(() => {
12
14
  var _a, _b;
@@ -5,12 +5,14 @@ import { block, getBooleanValidationState } from '../../utils';
5
5
  import './CheckboxInput.css';
6
6
  const b = block('checkbox-input');
7
7
  export const CheckboxInput = ({ input, props, meta, schema, }) => {
8
+ var _a;
8
9
  const { name, onBlur, onChange, onFocus, value } = input;
10
+ const { disabled } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
9
11
  const onUpdate = React.useCallback((value) => {
10
12
  onFocus();
11
13
  onChange(value);
12
14
  onBlur();
13
15
  }, [onBlur, onChange, onFocus]);
14
16
  return (React.createElement(EntityContainer, { stretch: "fit", className: b({ error: getBooleanValidationState(meta) }) },
15
- React.createElement(Checkbox, Object.assign({ disabled: schema.readOnly }, props, { checked: value !== null && value !== void 0 ? value : false, onFocus: onFocus, onBlur: onBlur, onUpdate: onUpdate, qa: name }))));
17
+ React.createElement(Checkbox, Object.assign({ disabled: disabled || schema.readOnly }, props, { checked: value !== null && value !== void 0 ? value : false, onFocus: onFocus, onBlur: onBlur, onUpdate: onUpdate, qa: name }))));
16
18
  };