@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: {
@@ -16,17 +16,19 @@ const MultiSelect = ({ name, input, spec, inputProps }) => {
16
16
  var _a;
17
17
  return withCustomOptions
18
18
  ? externalOptions || []
19
- : (_a = spec.enum) === null || _a === void 0 ? void 0 : _a.map((id) => {
20
- var _a, _b, _c, _d, _e;
21
- return ({
22
- id,
23
- value: id,
24
- text: ((_a = spec.description) === null || _a === void 0 ? void 0 : _a[id]) || id,
25
- content: ((_c = (_b = spec.viewSpec.selectParams) === null || _b === void 0 ? void 0 : _b.meta) === null || _c === void 0 ? void 0 : _c[id]) ? (react_1.default.createElement("div", { key: id },
26
- react_1.default.createElement(uikit_1.Text, null, ((_d = spec.description) === null || _d === void 0 ? void 0 : _d[id]) || id),
27
- react_1.default.createElement(uikit_1.Text, { color: "secondary", className: b('meta-text') }, spec.viewSpec.selectParams.meta[id]))) : (((_e = spec.description) === null || _e === void 0 ? void 0 : _e[id]) || id),
28
- key: id,
29
- });
19
+ : (_a = spec.enum) === null || _a === void 0 ? void 0 : _a.map((enumValue) => {
20
+ var _a, _b, _c;
21
+ const value = String(enumValue);
22
+ const text = ((_a = spec.description) === null || _a === void 0 ? void 0 : _a[value]) || value;
23
+ return {
24
+ id: value,
25
+ value,
26
+ text,
27
+ content: ((_c = (_b = spec.viewSpec.selectParams) === null || _b === void 0 ? void 0 : _b.meta) === null || _c === void 0 ? void 0 : _c[value]) ? (react_1.default.createElement("div", { key: value },
28
+ react_1.default.createElement(uikit_1.Text, null, text),
29
+ react_1.default.createElement(uikit_1.Text, { color: "secondary", className: b('meta-text') }, spec.viewSpec.selectParams.meta[value]))) : (text),
30
+ key: value,
31
+ };
30
32
  });
31
33
  }, [
32
34
  spec.enum,
@@ -53,8 +55,17 @@ const MultiSelect = ({ name, input, spec, inputProps }) => {
53
55
  onBlur();
54
56
  }
55
57
  }, [onFocus, onBlur]);
56
- const _value = react_1.default.useMemo(() => (0, core_1.transformArrOut)(value), [value]);
57
- const handleChange = react_1.default.useCallback((value) => onChange((0, core_1.transformArrIn)(value)), [onChange]);
58
+ const _value = react_1.default.useMemo(() => {
59
+ var _a;
60
+ return (_a = (0, core_1.transformArrOut)(value)) === null || _a === void 0 ? void 0 : _a.map(String);
61
+ }, [value]);
62
+ const handleChange = react_1.default.useCallback((value) => {
63
+ const enumValues = value.map((selectedValue) => {
64
+ var _a, _b;
65
+ return (_b = (_a = spec.enum) === null || _a === void 0 ? void 0 : _a.find((enumValue) => String(enumValue) === selectedValue)) !== null && _b !== void 0 ? _b : selectedValue;
66
+ });
67
+ onChange((0, core_1.transformArrIn)(enumValues));
68
+ }, [onChange, spec.enum]);
58
69
  return (react_1.default.createElement(uikit_1.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 })));
59
70
  };
60
71
  exports.MultiSelect = MultiSelect;
@@ -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>;
@@ -4,8 +4,18 @@ exports.HTMLContent = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const uikit_1 = require("@gravity-ui/uikit");
7
+ const core_1 = require("../../../core");
7
8
  const HTMLContent = (_a) => {
8
- var { html } = _a, restProps = tslib_1.__rest(_a, ["html"]);
9
- return react_1.default.createElement(uikit_1.Text, Object.assign({}, restProps, { dangerouslySetInnerHTML: { __html: html } }));
9
+ var _b;
10
+ var { content, headName = '___stub-name' } = _a, restProps = tslib_1.__rest(_a, ["content", "headName"]);
11
+ const state = (0, core_1.useSchemaRendererState)({
12
+ headName,
13
+ subscriptions: [core_1.SchemaRendererEventType.UserContext],
14
+ });
15
+ const RenderHTMLOrMD = (_b = state === null || state === void 0 ? void 0 : state.userContext) === null || _b === void 0 ? void 0 : _b.RenderHTMLOrMD;
16
+ if (RenderHTMLOrMD) {
17
+ return react_1.default.createElement(RenderHTMLOrMD, { content: content });
18
+ }
19
+ return react_1.default.createElement(uikit_1.Text, Object.assign({}, restProps, { dangerouslySetInnerHTML: { __html: content } }));
10
20
  };
11
21
  exports.HTMLContent = HTMLContent;
@@ -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
  }
@@ -3,5 +3,6 @@ import { type FlexProps } from '@gravity-ui/uikit';
3
3
  export interface LayoutContainerProps extends FlexProps {
4
4
  children: React.ReactNode;
5
5
  hideEmpty?: boolean;
6
+ hidden?: boolean;
6
7
  }
7
8
  export declare const LayoutContainer: React.FC<LayoutContainerProps>;
@@ -7,7 +7,7 @@ const uikit_1 = require("@gravity-ui/uikit");
7
7
  const utils_1 = require("../../utils");
8
8
  const b = (0, utils_1.block)('layout-container');
9
9
  const LayoutContainer = (_a) => {
10
- var { className, children, hideEmpty = false } = _a, restProps = tslib_1.__rest(_a, ["className", "children", "hideEmpty"]);
11
- return (react_1.default.createElement(uikit_1.Flex, Object.assign({ className: b({ 'hide-empty': hideEmpty }, className), direction: "column" }, restProps), children));
10
+ var { className, children, hideEmpty = false, hidden = false } = _a, restProps = tslib_1.__rest(_a, ["className", "children", "hideEmpty", "hidden"]);
11
+ return (react_1.default.createElement(uikit_1.Flex, Object.assign({ className: b({ 'hide-empty': hideEmpty, hidden }, className), direction: "column" }, restProps), children));
12
12
  };
13
13
  exports.LayoutContainer = LayoutContainer;
@@ -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
+ }
@@ -6,22 +6,41 @@ const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const icons = tslib_1.__importStar(require("@gravity-ui/icons"));
7
7
  const uikit_1 = require("@gravity-ui/uikit");
8
8
  const components_1 = require("../../components");
9
- const Alert = ({ props, schema }) => {
10
- const { iconName, iconProps, message } = props, entityRestProps = tslib_1.__rest(props, ["iconName", "iconProps", "message"]);
9
+ const utils_1 = require("../../utils");
10
+ const b = (0, utils_1.block)('alert');
11
+ const Alert = ({ headName, props, schema }) => {
12
+ var _a;
13
+ const { iconName, iconProps, message, title: titleProp } = props, entityRestProps = tslib_1.__rest(props, ["iconName", "iconProps", "message", "title"]);
14
+ const { open = true } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
15
+ const [expanded, setExpanded] = react_1.default.useState(open);
11
16
  const icon = react_1.default.useMemo(() => iconName && icons[iconName] ? (react_1.default.createElement(uikit_1.Icon, Object.assign({ data: icons[iconName] }, iconProps))) : undefined, [iconName, iconProps]);
17
+ const title = react_1.default.useMemo(() => {
18
+ if (titleProp && typeof titleProp !== 'string') {
19
+ return titleProp;
20
+ }
21
+ const title = typeof titleProp === 'string' ? titleProp : schema.title;
22
+ if (title) {
23
+ return (react_1.default.createElement(uikit_1.Flex, { className: b('title'), alignItems: "center", gap: "2", onClick: () => setExpanded(!expanded) },
24
+ react_1.default.createElement(components_1.HTMLContent, { content: title, headName: headName, variant: "subheader-2" }),
25
+ react_1.default.createElement(uikit_1.Icon, { data: expanded ? icons.ChevronUp : icons.ChevronDown, size: 16 })));
26
+ }
27
+ return null;
28
+ }, [headName, schema.title, titleProp, expanded]);
12
29
  const msg = react_1.default.useMemo(() => {
13
30
  if (message) {
14
31
  if (typeof message === 'string') {
15
- return react_1.default.createElement("span", { dangerouslySetInnerHTML: { __html: message } });
32
+ return (react_1.default.createElement("div", { className: b('message', { expanded }) },
33
+ react_1.default.createElement(components_1.HTMLContent, { content: message, headName: headName })));
16
34
  }
17
35
  return message;
18
36
  }
19
37
  if (schema.description) {
20
- return react_1.default.createElement("span", { dangerouslySetInnerHTML: { __html: schema.description } });
38
+ return (react_1.default.createElement("div", { className: b('message', { expanded }) },
39
+ react_1.default.createElement(components_1.HTMLContent, { content: schema.description, headName: headName })));
21
40
  }
22
41
  return undefined;
23
- }, [message, schema.description]);
24
- return (react_1.default.createElement(components_1.EntityContainer, { stretch: "fit", fill: "populated" },
25
- react_1.default.createElement(uikit_1.Alert, Object.assign({ icon: icon, message: msg }, entityRestProps))));
42
+ }, [expanded, headName, message, schema.description]);
43
+ return (react_1.default.createElement(components_1.EntityContainer, { className: b({ expanded }), stretch: "fit", fill: "populated" },
44
+ react_1.default.createElement(uikit_1.Alert, Object.assign({ icon: icon, message: msg, title: title }, entityRestProps))));
26
45
  };
27
46
  exports.Alert = Alert;
@@ -1,6 +1,5 @@
1
1
  import { type JsonSchemaArray, type NodeEntity } from '../../../core';
2
2
  export interface ArrayEntityProps {
3
3
  addButtonText?: string;
4
- disabled?: boolean;
5
4
  }
6
5
  export declare const ArrayEntity: NodeEntity<JsonSchemaArray, ArrayEntityProps>;
@@ -10,7 +10,9 @@ const components_1 = require("../../components");
10
10
  const utils_1 = require("../../utils");
11
11
  const b = (0, utils_1.block)('array-entity');
12
12
  const ArrayEntity = ({ headName, input, mode, props, schema, schemaPath, }) => {
13
+ var _a;
13
14
  const { name, onBlur, onChange, onFocus, value } = input;
15
+ const { disabled } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
14
16
  const overviewFlag = mode === core_1.SchemaRendererMode.Overview;
15
17
  const addButton = react_1.default.useMemo(() => {
16
18
  const itemsSchema = schema.items;
@@ -22,12 +24,12 @@ const ArrayEntity = ({ headName, input, mode, props, schema, schemaPath, }) => {
22
24
  onChange([...(value || []), itemsSchema === null || itemsSchema === void 0 ? void 0 : itemsSchema.default]);
23
25
  onBlur();
24
26
  };
25
- return (react_1.default.createElement(uikit_1.Button, { className: b('add-button'), onClick: onClick, disabled: props.disabled || schema.readOnly, qa: `${name}-add-button` },
27
+ return (react_1.default.createElement(uikit_1.Button, { className: b('add-button'), onClick: onClick, disabled: disabled || schema.readOnly, qa: `${name}-add-button` },
26
28
  react_1.default.createElement(uikit_1.Icon, { data: icons_1.Plus, size: 14 }),
27
29
  props.addButtonText || null));
28
30
  }, [
29
31
  props.addButtonText,
30
- props.disabled,
32
+ disabled,
31
33
  name,
32
34
  onBlur,
33
35
  onChange,
@@ -2,6 +2,5 @@ import { type JsonSchemaArray, type NodeEntity } from '../../../core';
2
2
  export interface ArrayTableProps {
3
3
  order?: string[];
4
4
  addButtonText?: string;
5
- disabled?: boolean;
6
5
  }
7
6
  export declare const ArrayTable: NodeEntity<JsonSchemaArray, ArrayTableProps>;
@@ -10,7 +10,9 @@ const components_1 = require("../../components");
10
10
  const utils_1 = require("../../utils");
11
11
  const b = (0, utils_1.block)('array-table');
12
12
  const ArrayTable = ({ headName, input, mode, props, schema, schemaPath, }) => {
13
+ var _a;
13
14
  const { name, onBlur, onChange, onFocus, value } = input;
15
+ const { disabled } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
14
16
  const overviewFlag = mode === core_1.SchemaRendererMode.Overview;
15
17
  const addButton = react_1.default.useMemo(() => {
16
18
  const itemsSchema = schema.items;
@@ -22,12 +24,12 @@ const ArrayTable = ({ headName, input, mode, props, schema, schemaPath, }) => {
22
24
  onChange([...(value || []), itemsSchema === null || itemsSchema === void 0 ? void 0 : itemsSchema.default]);
23
25
  onBlur();
24
26
  };
25
- return (react_1.default.createElement(uikit_1.Button, { className: b('add-button'), onClick: onClick, disabled: props.disabled || schema.readOnly, qa: `${name}-add-button` },
27
+ return (react_1.default.createElement(uikit_1.Button, { className: b('add-button'), onClick: onClick, disabled: disabled || schema.readOnly, qa: `${name}-add-button` },
26
28
  react_1.default.createElement(uikit_1.Icon, { data: icons_1.Plus, size: 14 }),
27
29
  props.addButtonText || null));
28
30
  }, [
29
31
  props.addButtonText,
30
- props.disabled,
32
+ disabled,
31
33
  name,
32
34
  onBlur,
33
35
  onChange,
@@ -79,7 +81,7 @@ const ArrayTable = ({ headName, input, mode, props, schema, schemaPath, }) => {
79
81
  react_1.default.createElement("div", { className: b('column-title') }, (_a = column.schema.title) === null || _a === void 0 ? void 0 : _a.split(' ').map((word, wIndex, array) => (react_1.default.createElement("div", { className: b('column-title-word'), key: word },
80
82
  react_1.default.createElement(uikit_1.Text, { variant: "subheader-1" }, word),
81
83
  wIndex + 1 === array.length && column.schema.description ? (react_1.default.createElement(uikit_1.HelpMark, null,
82
- react_1.default.createElement(components_1.HTMLContent, { html: column.schema.description }))) : null))))));
84
+ react_1.default.createElement(components_1.HTMLContent, { content: column.schema.description, headName: headName }))) : null))))));
83
85
  })));
84
86
  const rows = new Array(rowsCount).fill(null).map((_, rIndex) => (react_1.default.createElement("div", { className: b('row', { 'with-remove-button': withRemoveButton }), style: { '--columns-count': columns.length }, key: rIndex },
85
87
  react_1.default.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);
@@ -7,7 +7,7 @@ const icons = tslib_1.__importStar(require("@gravity-ui/icons"));
7
7
  const uikit_1 = require("@gravity-ui/uikit");
8
8
  const core_1 = require("../../../core");
9
9
  const components_1 = require("../../components");
10
- const Label = ({ input, mode, props, schema }) => {
10
+ const Label = ({ headName, input, mode, props, schema, }) => {
11
11
  const { value } = input;
12
12
  const { iconName, iconProps, title } = props, restEntityProps = tslib_1.__rest(props, ["iconName", "iconProps", "title"]);
13
13
  const overviewFlag = mode === core_1.SchemaRendererMode.Overview;
@@ -15,15 +15,15 @@ const Label = ({ input, mode, props, schema }) => {
15
15
  const content = react_1.default.useMemo(() => {
16
16
  if (title) {
17
17
  if (typeof title === 'string') {
18
- return react_1.default.createElement("span", { dangerouslySetInnerHTML: { __html: title } });
18
+ return react_1.default.createElement(components_1.HTMLContent, { content: title, headName: headName });
19
19
  }
20
20
  return title;
21
21
  }
22
22
  if (schema.description) {
23
- return react_1.default.createElement("span", { dangerouslySetInnerHTML: { __html: schema.description } });
23
+ return react_1.default.createElement(components_1.HTMLContent, { content: schema.description, headName: headName });
24
24
  }
25
25
  return undefined;
26
- }, [title, schema.description]);
26
+ }, [headName, title, schema.description]);
27
27
  return (react_1.default.createElement(components_1.EntityContainer, { stretch: "fit", fill: "populated" },
28
28
  react_1.default.createElement(uikit_1.Label, Object.assign({ size: overviewFlag ? 'xs' : 'm', value: value, icon: icon }, restEntityProps), content)));
29
29
  };
@@ -9,7 +9,9 @@ const components_1 = require("../../components");
9
9
  const utils_1 = require("../../utils");
10
10
  const b = (0, utils_1.block)('monaco');
11
11
  const Monaco = ({ headName, input, meta, mode, props, schema, }) => {
12
+ var _a;
12
13
  const { name, onBlur, onChange, onFocus, value } = input;
14
+ const { disabled } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
13
15
  const overviewFlag = mode === core_1.SchemaRendererMode.Overview;
14
16
  const { language = 'plaintext', options: optionsProps, withDialog = true, ignoreMonacoErrors = false, width = '100%', height = 350 } = props, restEntityProps = tslib_1.__rest(props, ["language", "options", "withDialog", "ignoreMonacoErrors", "width", "height"]);
15
17
  const srState = (0, core_1.useSchemaRendererState)({
@@ -22,7 +24,7 @@ const Monaco = ({ headName, input, meta, mode, props, schema, }) => {
22
24
  const innerErrorRef = react_1.default.useRef(null);
23
25
  const [dialogOpen, setDialogOpen] = react_1.default.useState(false);
24
26
  const toggleDialogOpen = react_1.default.useCallback(() => setDialogOpen((f) => !f), []);
25
- const options = react_1.default.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]);
27
+ const options = react_1.default.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]);
26
28
  const onUpdate = react_1.default.useCallback((value) => {
27
29
  onFocus();
28
30
  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>;
@@ -1,7 +1,6 @@
1
1
  import { type JsonSchemaObject, type NodeEntity } from '../../../core';
2
2
  export interface ObjectInlineProps {
3
3
  delimiter?: string | Record<string, string>;
4
- disabled?: boolean;
5
4
  order?: string[];
6
5
  }
7
6
  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);
@@ -9,22 +9,22 @@ const core_1 = require("../../../core");
9
9
  const components_1 = require("../../components");
10
10
  const utils_1 = require("../../utils");
11
11
  const b = (0, utils_1.block)('text-content');
12
- const TextContent = ({ input, mode, props, schema, }) => {
12
+ const TextContent = ({ headName, input, mode, props, schema, }) => {
13
13
  const { className, iconName, iconProps, title: titleProp } = props, restEntityProps = tslib_1.__rest(props, ["className", "iconName", "iconProps", "title"]);
14
14
  const overviewFlag = mode === core_1.SchemaRendererMode.Overview;
15
15
  const icon = react_1.default.useMemo(() => iconName && icons[iconName] ? (react_1.default.createElement(uikit_1.Icon, Object.assign({ data: icons[iconName] }, iconProps))) : undefined, [iconName, iconProps]);
16
16
  const content = react_1.default.useMemo(() => {
17
17
  if (titleProp) {
18
18
  if (typeof titleProp === 'string') {
19
- return react_1.default.createElement("span", { dangerouslySetInnerHTML: { __html: titleProp } });
19
+ return react_1.default.createElement(components_1.HTMLContent, { content: titleProp, headName: headName });
20
20
  }
21
21
  return titleProp;
22
22
  }
23
23
  if (schema.description) {
24
- return react_1.default.createElement("span", { dangerouslySetInnerHTML: { __html: schema.description } });
24
+ return react_1.default.createElement(components_1.HTMLContent, { content: schema.description, headName: headName });
25
25
  }
26
26
  return undefined;
27
- }, [titleProp, schema.description]);
27
+ }, [headName, titleProp, schema.description]);
28
28
  return (react_1.default.createElement(components_1.EntityContainer, { stretch: "fit", fill: "populated" },
29
29
  react_1.default.createElement(uikit_1.Label, Object.assign({ size: overviewFlag ? 'xs' : 'm', value: input.value, icon: icon, className: b(null, className) }, restEntityProps, { theme: "clear" }), content)));
30
30
  };
@@ -3,6 +3,5 @@ export interface CheckboxGroupInputProps {
3
3
  enumDescriptions?: Record<string, string>;
4
4
  optionsDisabled?: Record<string, boolean>;
5
5
  direction?: 'row' | 'column';
6
- disabled?: boolean;
7
6
  }
8
7
  export declare const CheckboxGroupInput: NodeEntity<JsonSchemaArray, CheckboxGroupInputProps>;
@@ -8,8 +8,10 @@ const components_1 = require("../../components");
8
8
  const utils_1 = require("../../utils");
9
9
  const b = (0, utils_1.block)('checkbox-group-input');
10
10
  const CheckboxGroupInput = ({ input, props, meta, schema, }) => {
11
+ var _a;
11
12
  const { name, onBlur, onChange, onFocus, value: inputValue } = input;
12
- const { enumDescriptions, direction = 'row', disabled, optionsDisabled } = props;
13
+ const { enumDescriptions, direction = 'row', optionsDisabled } = props;
14
+ const { disabled } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
13
15
  const value = react_1.default.useMemo(() => (Array.isArray(inputValue) ? inputValue : []), [inputValue]);
14
16
  const options = react_1.default.useMemo(() => {
15
17
  var _a, _b;
@@ -8,13 +8,15 @@ const components_1 = require("../../components");
8
8
  const utils_1 = require("../../utils");
9
9
  const b = (0, utils_1.block)('checkbox-input');
10
10
  const CheckboxInput = ({ input, props, meta, schema, }) => {
11
+ var _a;
11
12
  const { name, onBlur, onChange, onFocus, value } = input;
13
+ const { disabled } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
12
14
  const onUpdate = react_1.default.useCallback((value) => {
13
15
  onFocus();
14
16
  onChange(value);
15
17
  onBlur();
16
18
  }, [onBlur, onChange, onFocus]);
17
19
  return (react_1.default.createElement(components_1.EntityContainer, { stretch: "fit", className: b({ error: (0, utils_1.getBooleanValidationState)(meta) }) },
18
- react_1.default.createElement(uikit_1.Checkbox, Object.assign({ disabled: schema.readOnly }, props, { checked: value !== null && value !== void 0 ? value : false, onFocus: onFocus, onBlur: onBlur, onUpdate: onUpdate, qa: name }))));
20
+ react_1.default.createElement(uikit_1.Checkbox, Object.assign({ disabled: disabled || schema.readOnly }, props, { checked: value !== null && value !== void 0 ? value : false, onFocus: onFocus, onBlur: onBlur, onUpdate: onUpdate, qa: name }))));
19
21
  };
20
22
  exports.CheckboxInput = CheckboxInput;
@@ -8,8 +8,10 @@ const components_1 = require("../../components");
8
8
  const utils_1 = require("../../utils");
9
9
  const b = (0, utils_1.block)('color-picker-input');
10
10
  const ColorPickerInput = ({ input, props, meta, schema, }) => {
11
+ var _a;
11
12
  const { name, onBlur, onChange, onFocus, value } = input;
12
13
  const { onOpenChange: onOpenChangeProps } = props, restEntityProps = tslib_1.__rest(props, ["onOpenChange"]);
14
+ const { disabled } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
13
15
  const onOpenChange = react_1.default.useCallback((open) => {
14
16
  onOpenChangeProps === null || onOpenChangeProps === void 0 ? void 0 : onOpenChangeProps(open);
15
17
  if (open) {
@@ -20,6 +22,6 @@ const ColorPickerInput = ({ input, props, meta, schema, }) => {
20
22
  }
21
23
  }, [onBlur, onFocus, onOpenChangeProps]);
22
24
  return (react_1.default.createElement(components_1.EntityContainer, { stretch: "max", className: b({ error: (0, utils_1.getBooleanValidationState)(meta) }) },
23
- react_1.default.createElement(unstable_1.unstable_ColorPicker, Object.assign({ disabled: schema.readOnly }, restEntityProps, { value: value !== null && value !== void 0 ? value : '', onUpdate: onChange, onOpenChange: onOpenChange, "data-qa": name }))));
25
+ react_1.default.createElement(unstable_1.unstable_ColorPicker, Object.assign({ disabled: disabled || schema.readOnly }, restEntityProps, { value: value !== null && value !== void 0 ? value : '', onUpdate: onChange, onOpenChange: onOpenChange, "data-qa": name }))));
24
26
  };
25
27
  exports.ColorPickerInput = ColorPickerInput;