@gravity-ui/dynamic-forms 5.23.1 → 5.25.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 (142) hide show
  1. package/build/cjs/lib/kit/i18n/en.json +34 -0
  2. package/build/cjs/lib/kit/i18n/ru.json +34 -0
  3. package/build/cjs/lib/unstable/core/SchemaRendererNode/SchemaRendererNode.js +25 -19
  4. package/build/cjs/lib/unstable/core/SchemaRendererNode/utils.d.ts +3 -0
  5. package/build/cjs/lib/unstable/core/SchemaRendererNode/utils.js +25 -1
  6. package/build/cjs/lib/unstable/core/types/components.d.ts +3 -13
  7. package/build/cjs/lib/unstable/core/types/schema.d.ts +14 -7
  8. package/build/cjs/lib/unstable/core/types/validation.d.ts +1 -1
  9. package/build/cjs/lib/unstable/core/useSchemaRenderer/types/state.d.ts +3 -0
  10. package/build/cjs/lib/unstable/core/useSchemaRenderer/useSchemaRenderer.js +1 -1
  11. package/build/cjs/lib/unstable/core/utils/definers.d.ts +27 -13
  12. package/build/cjs/lib/unstable/kit/components/HTMLContent/HTMLContent.d.ts +2 -1
  13. package/build/cjs/lib/unstable/kit/components/HTMLContent/HTMLContent.js +12 -2
  14. package/build/cjs/lib/unstable/kit/components/LayoutContainer/LayoutContainer.css +3 -0
  15. package/build/cjs/lib/unstable/kit/components/LayoutContainer/LayoutContainer.d.ts +1 -0
  16. package/build/cjs/lib/unstable/kit/components/LayoutContainer/LayoutContainer.js +2 -2
  17. package/build/cjs/lib/unstable/kit/constants/index.d.ts +1 -0
  18. package/build/cjs/lib/unstable/kit/constants/index.js +3 -1
  19. package/build/cjs/lib/unstable/kit/constants/messages.d.ts +2 -0
  20. package/build/cjs/lib/unstable/kit/constants/messages.js +89 -0
  21. package/build/cjs/lib/unstable/kit/entities/Alert/Alert.css +16 -0
  22. package/build/cjs/lib/unstable/kit/entities/Alert/Alert.js +26 -7
  23. package/build/cjs/lib/unstable/kit/entities/ArrayEntity/ArrayEntity.d.ts +0 -1
  24. package/build/cjs/lib/unstable/kit/entities/ArrayEntity/ArrayEntity.js +4 -2
  25. package/build/cjs/lib/unstable/kit/entities/ArrayTable/ArrayTable.d.ts +0 -1
  26. package/build/cjs/lib/unstable/kit/entities/ArrayTable/ArrayTable.js +7 -5
  27. package/build/cjs/lib/unstable/kit/entities/FewOfNested/FewOfNested.css +3 -0
  28. package/build/cjs/lib/unstable/kit/entities/Label/Label.js +4 -4
  29. package/build/cjs/lib/unstable/kit/entities/Monaco/Monaco.js +3 -1
  30. package/build/cjs/lib/unstable/kit/entities/ObjectEntity/ObjectEntity.d.ts +0 -1
  31. package/build/cjs/lib/unstable/kit/entities/ObjectInline/ObjectInline.d.ts +0 -1
  32. package/build/cjs/lib/unstable/kit/entities/OneOfNested/OneOfNested.css +3 -0
  33. package/build/cjs/lib/unstable/kit/entities/TextContent/TextContent.js +4 -4
  34. package/build/cjs/lib/unstable/kit/form-entities/CheckboxGroupInput/CheckboxGroupInput.d.ts +0 -1
  35. package/build/cjs/lib/unstable/kit/form-entities/CheckboxGroupInput/CheckboxGroupInput.js +3 -1
  36. package/build/cjs/lib/unstable/kit/form-entities/CheckboxInput/CheckboxInput.js +3 -1
  37. package/build/cjs/lib/unstable/kit/form-entities/ColorPickerInput/ColorPickerInput.js +3 -1
  38. package/build/cjs/lib/unstable/kit/form-entities/DateInput/DateInput.js +3 -2
  39. package/build/cjs/lib/unstable/kit/form-entities/FileInput/FileInput.js +3 -1
  40. package/build/cjs/lib/unstable/kit/form-entities/MultiSelectInput/MultiSelectInput.js +4 -2
  41. package/build/cjs/lib/unstable/kit/form-entities/NumberInput/NumberInput.js +3 -2
  42. package/build/cjs/lib/unstable/kit/form-entities/NumberWithScaleInput/NumberWithScaleInput.js +3 -2
  43. package/build/cjs/lib/unstable/kit/form-entities/PasswordInput/PasswordInput.js +3 -2
  44. package/build/cjs/lib/unstable/kit/form-entities/RadioGroupInput/RadioGroupInput.js +3 -1
  45. package/build/cjs/lib/unstable/kit/form-entities/RangeSliderInput/RangeSliderInput.js +9 -8
  46. package/build/cjs/lib/unstable/kit/form-entities/SegmentedRadioGroupInput/SegmentedRadioGroupInput.css +4 -0
  47. package/build/cjs/lib/unstable/kit/form-entities/SegmentedRadioGroupInput/SegmentedRadioGroupInput.d.ts +1 -1
  48. package/build/cjs/lib/unstable/kit/form-entities/SegmentedRadioGroupInput/SegmentedRadioGroupInput.js +30 -3
  49. package/build/cjs/lib/unstable/kit/form-entities/SelectInput/SelectInput.d.ts +1 -2
  50. package/build/cjs/lib/unstable/kit/form-entities/SelectInput/SelectInput.js +4 -2
  51. package/build/cjs/lib/unstable/kit/form-entities/SliderInput/SliderInput.js +3 -1
  52. package/build/cjs/lib/unstable/kit/form-entities/StringInput/StringInput.js +3 -2
  53. package/build/cjs/lib/unstable/kit/form-entities/StringNumberWithScaleInput/StringNumberWithScaleInput.js +4 -3
  54. package/build/cjs/lib/unstable/kit/form-entities/SwitchInput/SwitchInput.js +3 -1
  55. package/build/cjs/lib/unstable/kit/form-entities/TextAreaInput/TextAreaInput.js +3 -2
  56. package/build/cjs/lib/unstable/kit/form-layouts/FormColumn/FormColumn.js +8 -6
  57. package/build/cjs/lib/unstable/kit/form-layouts/FormRow/FormRow.css +3 -0
  58. package/build/cjs/lib/unstable/kit/form-layouts/FormRow/FormRow.js +8 -6
  59. package/build/cjs/lib/unstable/kit/index.d.ts +1 -0
  60. package/build/cjs/lib/unstable/kit/index.js +1 -0
  61. package/build/cjs/lib/unstable/kit/layouts/Accordeon/Accordeon.js +33 -29
  62. package/build/cjs/lib/unstable/kit/layouts/Card/Card.js +8 -6
  63. package/build/cjs/lib/unstable/kit/layouts/Section/Section.js +8 -6
  64. package/build/cjs/lib/unstable/kit/layouts/Transparent/Transparent.js +5 -3
  65. package/build/cjs/lib/unstable/kit/overview-layouts/OverviewColumn/OverviewColumn.js +7 -5
  66. package/build/cjs/lib/unstable/kit/overview-layouts/OverviewRow/OverviewRow.js +7 -5
  67. package/build/cjs/lib/unstable/kit/utils/index.d.ts +1 -1
  68. package/build/cjs/lib/unstable/kit/utils/index.js +1 -7
  69. package/build/cjs/lib/unstable/kit/utils/transformer.d.ts +10 -17
  70. package/build/cjs/lib/unstable/kit/utils/transformer.js +543 -2773
  71. package/build/esm/lib/kit/i18n/en.json +34 -0
  72. package/build/esm/lib/kit/i18n/ru.json +34 -0
  73. package/build/esm/lib/unstable/core/SchemaRendererNode/SchemaRendererNode.js +26 -20
  74. package/build/esm/lib/unstable/core/SchemaRendererNode/utils.d.ts +3 -0
  75. package/build/esm/lib/unstable/core/SchemaRendererNode/utils.js +22 -0
  76. package/build/esm/lib/unstable/core/types/components.d.ts +3 -13
  77. package/build/esm/lib/unstable/core/types/schema.d.ts +14 -7
  78. package/build/esm/lib/unstable/core/types/validation.d.ts +1 -1
  79. package/build/esm/lib/unstable/core/useSchemaRenderer/types/state.d.ts +3 -0
  80. package/build/esm/lib/unstable/core/useSchemaRenderer/useSchemaRenderer.js +1 -1
  81. package/build/esm/lib/unstable/core/utils/definers.d.ts +27 -13
  82. package/build/esm/lib/unstable/kit/components/HTMLContent/HTMLContent.d.ts +2 -1
  83. package/build/esm/lib/unstable/kit/components/HTMLContent/HTMLContent.js +12 -2
  84. package/build/esm/lib/unstable/kit/components/LayoutContainer/LayoutContainer.css +3 -0
  85. package/build/esm/lib/unstable/kit/components/LayoutContainer/LayoutContainer.d.ts +1 -0
  86. package/build/esm/lib/unstable/kit/components/LayoutContainer/LayoutContainer.js +2 -2
  87. package/build/esm/lib/unstable/kit/constants/index.d.ts +1 -0
  88. package/build/esm/lib/unstable/kit/constants/index.js +1 -0
  89. package/build/esm/lib/unstable/kit/constants/messages.d.ts +2 -0
  90. package/build/esm/lib/unstable/kit/constants/messages.js +85 -0
  91. package/build/esm/lib/unstable/kit/entities/Alert/Alert.css +16 -0
  92. package/build/esm/lib/unstable/kit/entities/Alert/Alert.d.ts +1 -0
  93. package/build/esm/lib/unstable/kit/entities/Alert/Alert.js +29 -9
  94. package/build/esm/lib/unstable/kit/entities/ArrayEntity/ArrayEntity.d.ts +0 -1
  95. package/build/esm/lib/unstable/kit/entities/ArrayEntity/ArrayEntity.js +4 -2
  96. package/build/esm/lib/unstable/kit/entities/ArrayTable/ArrayTable.d.ts +0 -1
  97. package/build/esm/lib/unstable/kit/entities/ArrayTable/ArrayTable.js +7 -5
  98. package/build/esm/lib/unstable/kit/entities/FewOfNested/FewOfNested.css +3 -0
  99. package/build/esm/lib/unstable/kit/entities/Label/Label.js +5 -5
  100. package/build/esm/lib/unstable/kit/entities/Monaco/Monaco.js +3 -1
  101. package/build/esm/lib/unstable/kit/entities/ObjectEntity/ObjectEntity.d.ts +0 -1
  102. package/build/esm/lib/unstable/kit/entities/ObjectInline/ObjectInline.d.ts +0 -1
  103. package/build/esm/lib/unstable/kit/entities/OneOfNested/OneOfNested.css +3 -0
  104. package/build/esm/lib/unstable/kit/entities/TextContent/TextContent.js +5 -5
  105. package/build/esm/lib/unstable/kit/form-entities/CheckboxGroupInput/CheckboxGroupInput.d.ts +0 -1
  106. package/build/esm/lib/unstable/kit/form-entities/CheckboxGroupInput/CheckboxGroupInput.js +3 -1
  107. package/build/esm/lib/unstable/kit/form-entities/CheckboxInput/CheckboxInput.js +3 -1
  108. package/build/esm/lib/unstable/kit/form-entities/ColorPickerInput/ColorPickerInput.js +3 -1
  109. package/build/esm/lib/unstable/kit/form-entities/DateInput/DateInput.js +3 -2
  110. package/build/esm/lib/unstable/kit/form-entities/FileInput/FileInput.js +3 -1
  111. package/build/esm/lib/unstable/kit/form-entities/MultiSelectInput/MultiSelectInput.js +4 -2
  112. package/build/esm/lib/unstable/kit/form-entities/NumberInput/NumberInput.js +3 -2
  113. package/build/esm/lib/unstable/kit/form-entities/NumberWithScaleInput/NumberWithScaleInput.js +3 -2
  114. package/build/esm/lib/unstable/kit/form-entities/PasswordInput/PasswordInput.js +3 -2
  115. package/build/esm/lib/unstable/kit/form-entities/RadioGroupInput/RadioGroupInput.js +3 -1
  116. package/build/esm/lib/unstable/kit/form-entities/RangeSliderInput/RangeSliderInput.js +9 -8
  117. package/build/esm/lib/unstable/kit/form-entities/SegmentedRadioGroupInput/SegmentedRadioGroupInput.css +4 -0
  118. package/build/esm/lib/unstable/kit/form-entities/SegmentedRadioGroupInput/SegmentedRadioGroupInput.d.ts +1 -1
  119. package/build/esm/lib/unstable/kit/form-entities/SegmentedRadioGroupInput/SegmentedRadioGroupInput.js +30 -3
  120. package/build/esm/lib/unstable/kit/form-entities/SelectInput/SelectInput.d.ts +1 -2
  121. package/build/esm/lib/unstable/kit/form-entities/SelectInput/SelectInput.js +4 -2
  122. package/build/esm/lib/unstable/kit/form-entities/SliderInput/SliderInput.js +3 -1
  123. package/build/esm/lib/unstable/kit/form-entities/StringInput/StringInput.js +3 -2
  124. package/build/esm/lib/unstable/kit/form-entities/StringNumberWithScaleInput/StringNumberWithScaleInput.js +4 -3
  125. package/build/esm/lib/unstable/kit/form-entities/SwitchInput/SwitchInput.js +3 -1
  126. package/build/esm/lib/unstable/kit/form-entities/TextAreaInput/TextAreaInput.js +3 -2
  127. package/build/esm/lib/unstable/kit/form-layouts/FormColumn/FormColumn.js +8 -6
  128. package/build/esm/lib/unstable/kit/form-layouts/FormRow/FormRow.css +3 -0
  129. package/build/esm/lib/unstable/kit/form-layouts/FormRow/FormRow.js +8 -6
  130. package/build/esm/lib/unstable/kit/index.d.ts +1 -0
  131. package/build/esm/lib/unstable/kit/index.js +1 -0
  132. package/build/esm/lib/unstable/kit/layouts/Accordeon/Accordeon.js +33 -29
  133. package/build/esm/lib/unstable/kit/layouts/Card/Card.js +8 -6
  134. package/build/esm/lib/unstable/kit/layouts/Section/Section.js +8 -6
  135. package/build/esm/lib/unstable/kit/layouts/Transparent/Transparent.js +5 -3
  136. package/build/esm/lib/unstable/kit/overview-layouts/OverviewColumn/OverviewColumn.js +7 -5
  137. package/build/esm/lib/unstable/kit/overview-layouts/OverviewRow/OverviewRow.js +7 -5
  138. package/build/esm/lib/unstable/kit/utils/index.d.ts +1 -1
  139. package/build/esm/lib/unstable/kit/utils/index.js +1 -1
  140. package/build/esm/lib/unstable/kit/utils/transformer.d.ts +10 -17
  141. package/build/esm/lib/unstable/kit/utils/transformer.js +544 -2773
  142. package/package.json +1 -1
@@ -3,11 +3,13 @@ import React from 'react';
3
3
  import { Flex, Select, Text } from '@gravity-ui/uikit';
4
4
  import isString from 'lodash/isString';
5
5
  import { EntityContainer } from '../../components';
6
+ import { DASH } from '../../constants';
6
7
  import { getValidationState } from '../../utils';
7
8
  export const SelectInput = ({ input, meta, props, schema, }) => {
8
- var _a, _b;
9
+ var _a, _b, _c;
9
10
  const { name, onBlur, onChange, onFocus, value: inputValue } = input;
10
11
  const { enumDescriptions, optionsMeta } = props, restEntityProps = __rest(props, ["enumDescriptions", "optionsMeta"]);
12
+ const { disabled } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
11
13
  const value = React.useMemo(() => (isString(inputValue) ? [inputValue] : undefined), [inputValue]);
12
14
  const onUpdate = React.useCallback((v) => onChange(v[0]), [onChange]);
13
15
  const options = React.useMemo(() => {
@@ -27,5 +29,5 @@ export const SelectInput = ({ input, meta, props, schema, }) => {
27
29
  const renderOption = React.useCallback((option) => (React.createElement(React.Fragment, { key: option.value }, option.content || option.text || option.value)), []);
28
30
  const getOptionHeight = React.useCallback((option) => { var _a; return (((_a = option.data) === null || _a === void 0 ? void 0 : _a.optionMeta) ? 44 : 28); }, []);
29
31
  return (React.createElement(EntityContainer, { stretch: "max" },
30
- React.createElement(Select, Object.assign({ width: "max", options: options, filterable: (((_a = schema.enum) === null || _a === void 0 ? void 0 : _a.length) || 0) > 9, renderOption: renderOption, getOptionHeight: getOptionHeight, placeholder: ((_b = schema.examples) === null || _b === void 0 ? void 0 : _b[0]) || '', disabled: schema.readOnly }, restEntityProps, { value: value, onFocus: onFocus, onBlur: onBlur, onUpdate: onUpdate, errorMessage: undefined, validationState: getValidationState(meta), qa: name }))));
32
+ React.createElement(Select, Object.assign({ width: "max", options: options, filterable: (((_b = schema.enum) === null || _b === void 0 ? void 0 : _b.length) || 0) > 9, renderOption: renderOption, getOptionHeight: getOptionHeight, placeholder: ((_c = schema.examples) === null || _c === void 0 ? void 0 : _c[0]) || DASH, disabled: disabled || schema.readOnly }, restEntityProps, { value: value, onFocus: onFocus, onBlur: onBlur, onUpdate: onUpdate, errorMessage: undefined, validationState: getValidationState(meta), qa: name }))));
31
33
  };
@@ -3,7 +3,9 @@ import { Slider } from '@gravity-ui/uikit';
3
3
  import { EntityContainer } from '../../components';
4
4
  import { getValidationState } from '../../utils';
5
5
  export const SliderInput = ({ input, meta, props, schema, }) => {
6
+ var _a;
6
7
  const { name, onBlur, onChange, onFocus, value: inputValue } = input;
8
+ const { disabled } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
7
9
  const value = isNaN(Number(inputValue)) ? undefined : Number(inputValue);
8
10
  const onUpdate = React.useCallback((next) => {
9
11
  if (Array.isArray(next)) {
@@ -12,5 +14,5 @@ export const SliderInput = ({ input, meta, props, schema, }) => {
12
14
  onChange(next);
13
15
  }, [onChange]);
14
16
  return (React.createElement(EntityContainer, { stretch: "max" },
15
- React.createElement(Slider, Object.assign({ min: schema.minimum, max: schema.maximum, step: 1, marks: 2, disabled: schema.readOnly, tooltipDisplay: "on" }, props, { value: value, onFocus: onFocus, onBlur: onBlur, onUpdate: onUpdate, errorMessage: undefined, validationState: getValidationState(meta), qa: name }))));
17
+ React.createElement(Slider, Object.assign({ min: schema.minimum, max: schema.maximum, step: 1, marks: 2, disabled: disabled || schema.readOnly, tooltipDisplay: "on" }, props, { value: value, onFocus: onFocus, onBlur: onBlur, onUpdate: onUpdate, errorMessage: undefined, validationState: getValidationState(meta), qa: name }))));
16
18
  };
@@ -5,7 +5,8 @@ import { block, getBooleanValidationState, getValidationState } from '../../util
5
5
  import './StringInput.css';
6
6
  const b = block('string-input');
7
7
  export const StringInput = ({ input, meta, props, schema, }) => {
8
- var _a, _b;
8
+ var _a, _b, _c;
9
+ const { disabled } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
9
10
  return (React.createElement(EntityContainer, { stretch: "max", className: b({ error: getBooleanValidationState(meta) }) },
10
- React.createElement(TextInput, Object.assign({ placeholder: (_a = schema.examples) === null || _a === void 0 ? void 0 : _a[0], disabled: schema.readOnly, hasClear: true }, props, { value: (_b = input.value) !== null && _b !== void 0 ? _b : '', onFocus: input.onFocus, onBlur: input.onBlur, onUpdate: input.onChange, errorMessage: undefined, validationState: getValidationState(meta), qa: input.name, type: "text" }))));
11
+ React.createElement(TextInput, Object.assign({ placeholder: (_b = schema.examples) === null || _b === void 0 ? void 0 : _b[0], disabled: disabled || schema.readOnly, hasClear: true }, props, { value: (_c = input.value) !== null && _c !== void 0 ? _c : '', onFocus: input.onFocus, onBlur: input.onBlur, onUpdate: input.onChange, errorMessage: undefined, validationState: getValidationState(meta), qa: input.name, type: "text" }))));
11
12
  };
@@ -7,9 +7,10 @@ import { block, getBooleanValidationState, getValidationState, isStringNumber }
7
7
  import './StringNumberWithScaleInput.css';
8
8
  const b = block('string-number-with-scale-input');
9
9
  export const StringNumberWithScaleInput = ({ input, meta, props, schema }) => {
10
- var _a;
10
+ var _a, _b;
11
11
  const { name, onBlur, onChange, onFocus, value: inputValue } = input;
12
12
  const { defaultType, viewType, scale } = props, restEntityProps = __rest(props, ["defaultType", "viewType", "scale"]);
13
+ const { disabled } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
13
14
  const scaleKit = React.useMemo(() => {
14
15
  if (scale) {
15
16
  const preparedScale = {};
@@ -72,7 +73,7 @@ export const StringNumberWithScaleInput = ({ input, meta, props, schema }) => {
72
73
  }, [inputValue, onChange, scaleKit === null || scaleKit === void 0 ? void 0 : scaleKit.scale, scaleValue, schema]);
73
74
  return (React.createElement(EntityContainer, { stretch: "max", className: b({ error: getBooleanValidationState(meta) }), direction: "row", gap: 2 },
74
75
  React.createElement("div", { className: b('input') },
75
- React.createElement(TextInput, Object.assign({ placeholder: `${((_a = schema.examples) === null || _a === void 0 ? void 0 : _a[0]) || ''}`, disabled: schema.readOnly, hasClear: true }, restEntityProps, preparedInputProps, { onBlur: onBlur, onFocus: onFocus, errorMessage: undefined, validationState: getValidationState(meta), qa: name }))),
76
+ React.createElement(TextInput, Object.assign({ placeholder: `${((_b = schema.examples) === null || _b === void 0 ? void 0 : _b[0]) || ''}`, disabled: disabled || schema.readOnly, hasClear: true }, restEntityProps, preparedInputProps, { onBlur: onBlur, onFocus: onFocus, errorMessage: undefined, validationState: getValidationState(meta), qa: name }))),
76
77
  scaleOptions.length ? (React.createElement("div", { style: { width: scaleKit === null || scaleKit === void 0 ? void 0 : scaleKit.minScaleLength } },
77
- React.createElement(Select, { width: "max", options: scaleOptions, value: scaleValue, onUpdate: setScaleValue, multiple: false, disabled: schema.readOnly || meta.error, qa: `${name}-scale` }))) : null));
78
+ React.createElement(Select, { width: "max", options: scaleOptions, value: scaleValue, onUpdate: setScaleValue, multiple: false, disabled: disabled || schema.readOnly || meta.error, qa: `${name}-scale` }))) : null));
78
79
  };
@@ -5,12 +5,14 @@ import { block, getBooleanValidationState } from '../../utils';
5
5
  import './SwitchInput.css';
6
6
  const b = block('switch-input');
7
7
  export const SwitchInput = ({ input, meta, props, 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) }), justifyContent: "center" },
15
- React.createElement(Switch, 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(Switch, 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
  };
@@ -5,7 +5,8 @@ import { block, getBooleanValidationState, getValidationState } from '../../util
5
5
  import './TextAreaInput.css';
6
6
  const b = block('text-area-input');
7
7
  export const TextAreaInput = ({ input, meta, props, schema, }) => {
8
- var _a, _b;
8
+ var _a, _b, _c;
9
+ const { disabled } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
9
10
  return (React.createElement(EntityContainer, { stretch: "max", className: b({ error: getBooleanValidationState(meta) }) },
10
- React.createElement(TextArea, Object.assign({ maxRows: 20, minRows: 0, placeholder: (_a = schema.examples) === null || _a === void 0 ? void 0 : _a[0], disabled: schema.readOnly, hasClear: true }, props, { value: (_b = input.value) !== null && _b !== void 0 ? _b : '', onFocus: input.onFocus, onBlur: input.onBlur, onUpdate: input.onChange, errorMessage: undefined, validationState: getValidationState(meta), qa: input.name }))));
11
+ React.createElement(TextArea, Object.assign({ maxRows: 20, minRows: 0, placeholder: (_b = schema.examples) === null || _b === void 0 ? void 0 : _b[0], disabled: disabled || schema.readOnly, hasClear: true }, props, { value: (_c = input.value) !== null && _c !== void 0 ? _c : '', onFocus: input.onFocus, onBlur: input.onBlur, onUpdate: input.onChange, errorMessage: undefined, validationState: getValidationState(meta), qa: input.name }))));
11
12
  };
@@ -5,23 +5,25 @@ import { block, getValidationState } from '../../utils';
5
5
  import './FormColumn.css';
6
6
  const b = block('form-column');
7
7
  export const FormColumn = ({ children, headName, input, meta, schema, props, }) => {
8
+ var _a;
9
+ const { hidden, required } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
8
10
  const tooltip = React.useMemo(() => {
9
11
  if (!schema.description || props.descriptionType === 'bottom') {
10
12
  return null;
11
13
  }
12
14
  return (React.createElement(HelpMark, { className: b('help-mark') },
13
- React.createElement(HTMLContent, { html: schema.description })));
14
- }, [schema.description, props.descriptionType]);
15
+ React.createElement(HTMLContent, { content: schema.description, headName: headName })));
16
+ }, [headName, schema.description, props.descriptionType]);
15
17
  const bottomDescription = React.useMemo(() => {
16
18
  if (!schema.description || props.descriptionType !== 'bottom') {
17
19
  return null;
18
20
  }
19
- return React.createElement(HTMLContent, { html: schema.description, color: "secondary" });
20
- }, [schema.description, props.descriptionType]);
21
- return (React.createElement(LayoutContainer, { className: b(), gap: 2 },
21
+ return React.createElement(HTMLContent, { content: schema.description, headName: headName, color: "secondary" });
22
+ }, [headName, schema.description, props.descriptionType]);
23
+ return (React.createElement(LayoutContainer, { className: b(), gap: 2, hidden: hidden },
22
24
  React.createElement(Flex, { direction: "column", gap: 0.5 },
23
25
  React.createElement("div", { className: b('top') },
24
- React.createElement(Text, { className: b('title', { required: props.required }), wordBreak: "break-word" }, schema.title),
26
+ React.createElement(Text, { className: b('title', { required }), wordBreak: "break-word" }, schema.title),
25
27
  tooltip,
26
28
  React.createElement(ArrayRemoveButton, { name: input.name, headName: headName })),
27
29
  bottomDescription),
@@ -22,4 +22,7 @@
22
22
  }
23
23
  .sr-form-row__help-mark {
24
24
  margin-top: 1.5px;
25
+ }
26
+ .sr-form-row__right {
27
+ max-width: calc(100% - 180px - var(--g-spacing-base) * 2);
25
28
  }
@@ -5,22 +5,24 @@ import { block, getValidationState } from '../../utils';
5
5
  import './FormRow.css';
6
6
  const b = block('form-row');
7
7
  export const FormRow = ({ children, headName, input, meta, schema, props, }) => {
8
+ var _a;
9
+ const { hidden, required } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
8
10
  const tooltip = React.useMemo(() => {
9
11
  if (!schema.description || props.descriptionType === 'bottom') {
10
12
  return null;
11
13
  }
12
14
  return (React.createElement(HelpMark, { className: b('help-mark') },
13
- React.createElement(HTMLContent, { html: schema.description })));
14
- }, [schema.description, props.descriptionType]);
15
+ React.createElement(HTMLContent, { content: schema.description, headName: headName })));
16
+ }, [headName, schema.description, props.descriptionType]);
15
17
  const bottomDescription = React.useMemo(() => {
16
18
  if (!schema.description || props.descriptionType !== 'bottom') {
17
19
  return null;
18
20
  }
19
- return React.createElement(HTMLContent, { html: schema.description, color: "secondary" });
20
- }, [schema.description, props.descriptionType]);
21
- return (React.createElement(LayoutContainer, { className: b(), direction: "row", alignItems: "flex-start", gap: 2 },
21
+ return React.createElement(HTMLContent, { content: schema.description, headName: headName, color: "secondary" });
22
+ }, [headName, schema.description, props.descriptionType]);
23
+ return (React.createElement(LayoutContainer, { className: b(), direction: "row", alignItems: "flex-start", gap: 2, hidden: hidden },
22
24
  React.createElement("div", { className: b('left') },
23
- React.createElement(Text, { className: b('title', { required: props.required }), wordBreak: "break-word" }, schema.title),
25
+ React.createElement(Text, { className: b('title', { required }), wordBreak: "break-word" }, schema.title),
24
26
  tooltip),
25
27
  React.createElement(Flex, { className: b('right'), direction: "column", gap: 0.5, grow: 1 },
26
28
  React.createElement(Flex, { grow: 1, gap: 2 },
@@ -3,6 +3,7 @@ export * from './constants';
3
3
  export * from './entities';
4
4
  export * from './form-entities';
5
5
  export * from './form-layouts';
6
+ export * from './layouts';
6
7
  export * from './overview-entities';
7
8
  export * from './overview-layouts';
8
9
  export * from './utils/common';
@@ -3,6 +3,7 @@ export * from './constants';
3
3
  export * from './entities';
4
4
  export * from './form-entities';
5
5
  export * from './form-layouts';
6
+ export * from './layouts';
6
7
  export * from './overview-entities';
7
8
  export * from './overview-layouts';
8
9
  export * from './utils/common';
@@ -8,36 +8,40 @@ import { block, getValidationState } from '../../utils';
8
8
  import './Accordeon.css';
9
9
  const b = block('accordeon');
10
10
  export const Accordeon = ({ children, headName, input, meta, mode, schema, props, }) => {
11
- const { copy, required, titleProps, togglerProps, withIndent = false, withDefaultSummary = false } = props, restLayoutProps = __rest(props, ["copy", "required", "titleProps", "togglerProps", "withIndent", "withDefaultSummary"]);
11
+ var _a;
12
+ const { titleProps, togglerProps, withIndent = false, withDefaultSummary = false } = props, restLayoutProps = __rest(props, ["titleProps", "togglerProps", "withIndent", "withDefaultSummary"]);
13
+ const { copy, required, hidden, open } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
12
14
  const overviewFlag = mode === SchemaRendererMode.Overview;
13
- const summary = React.useMemo(() => {
14
- const stopPropagation = (event) => {
15
- event.stopPropagation();
16
- };
17
- return (React.createElement(Flex, { alignItems: "center", gap: 2 },
18
- withDefaultSummary ? (React.createElement(Text, Object.assign({}, titleProps, { className: b('title', { required: required && !overviewFlag }, titleProps === null || titleProps === void 0 ? void 0 : titleProps.className) }), schema.title)) : (React.createElement(Disclosure.Summary, null, (props) => (React.createElement(Button, Object.assign({}, togglerProps, { className: b('toggler', togglerProps === null || togglerProps === void 0 ? void 0 : togglerProps.className) }),
19
- React.createElement(Flex, { alignItems: "center", gap: 2, height: "100%" },
20
- React.createElement(Icon, { data: props.expanded ? ChevronUp : ChevronDown }),
21
- React.createElement(Text, Object.assign({}, titleProps, { className: b('title', { required: required && !overviewFlag }, titleProps === null || titleProps === void 0 ? void 0 : titleProps.className) }), schema.title)))))),
22
- schema.description ? (React.createElement(HelpMark, { onClick: stopPropagation },
23
- React.createElement(HTMLContent, { html: schema.description }))) : null,
24
- overviewFlag ? (React.createElement(CopyButton, { className: b('copy-button'), copy: copy, value: input.value })) : null,
25
- overviewFlag ? null : (React.createElement(ArrayRemoveButton, { name: input.name, headName: headName, onClick: stopPropagation }))));
26
- }, [
27
- copy,
28
- headName,
29
- input.name,
30
- input.value,
31
- overviewFlag,
32
- required,
33
- schema.title,
34
- schema.description,
35
- titleProps,
36
- togglerProps,
37
- withDefaultSummary,
38
- ]);
39
- return (React.createElement(LayoutContainer, { className: b({ 'without-default-summary': !withDefaultSummary }), hideEmpty: overviewFlag },
40
- React.createElement(Disclosure, Object.assign({ summary: summary, defaultExpanded: true }, restLayoutProps),
15
+ const summary = React.useMemo(() => (React.createElement(Text, Object.assign({}, titleProps, { className: b('title', { required: required && !overviewFlag }, titleProps === null || titleProps === void 0 ? void 0 : titleProps.className) }), schema.title)), [overviewFlag, required, schema.title, titleProps]);
16
+ const helpMark = React.useMemo(() => {
17
+ if (schema.description) {
18
+ return (React.createElement(HelpMark, null,
19
+ React.createElement(HTMLContent, { content: schema.description, headName: headName })));
20
+ }
21
+ return null;
22
+ }, [schema.description, headName]);
23
+ const copyButton = React.useMemo(() => {
24
+ if (overviewFlag) {
25
+ return React.createElement(CopyButton, { className: b('copy-button'), copy: copy, value: input.value });
26
+ }
27
+ return null;
28
+ }, [overviewFlag, copy, input.value]);
29
+ const removeButton = React.useMemo(() => {
30
+ if (overviewFlag) {
31
+ return null;
32
+ }
33
+ return React.createElement(ArrayRemoveButton, { name: input.name, headName: headName });
34
+ }, [overviewFlag, input.name, headName]);
35
+ return (React.createElement(LayoutContainer, { className: b({ 'without-default-summary': !withDefaultSummary }), hideEmpty: overviewFlag, hidden: hidden },
36
+ React.createElement(Disclosure, Object.assign({ defaultExpanded: open, summary: summary }, restLayoutProps),
37
+ React.createElement(Disclosure.Summary, null, ({ expanded, onClick }, defaultSummary) => (React.createElement(Flex, { minHeight: "28px", alignItems: "center", gap: 2 },
38
+ withDefaultSummary ? (defaultSummary) : (React.createElement(Button, Object.assign({}, togglerProps, { onClick: onClick, className: b('toggler', togglerProps === null || togglerProps === void 0 ? void 0 : togglerProps.className) }),
39
+ React.createElement(Flex, { alignItems: "center", gap: 2, height: "100%" },
40
+ React.createElement(Icon, { data: expanded ? ChevronUp : ChevronDown }),
41
+ summary))),
42
+ helpMark,
43
+ copyButton,
44
+ removeButton))),
41
45
  React.createElement(Flex, { direction: "column", gap: 0.5, grow: 1 },
42
46
  React.createElement("div", { className: b('content', { 'with-indent': withIndent }) }, children),
43
47
  overviewFlag ? null : (React.createElement(EntityError, { errorMessage: meta.error, validationState: getValidationState(meta) }))))));
@@ -8,7 +8,9 @@ import { block, getValidationState } from '../../utils';
8
8
  import './Card.css';
9
9
  const b = block('card');
10
10
  export const Card = ({ children, headName, input, meta, mode, schema, props, }) => {
11
- const { copy, descriptionType = 'tooltip', likeAccordeon = true, open = true, required } = props, restLayoutProps = __rest(props, ["copy", "descriptionType", "likeAccordeon", "open", "required"]);
11
+ var _a;
12
+ const { descriptionType = 'tooltip', likeAccordeon = true } = props, restLayoutProps = __rest(props, ["descriptionType", "likeAccordeon"]);
13
+ const { copy, required, hidden, open = true } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
12
14
  const overviewFlag = mode === SchemaRendererMode.Overview;
13
15
  const [visible, setVisible] = React.useState(likeAccordeon ? open : true);
14
16
  const toggleVisible = React.useCallback(() => {
@@ -19,15 +21,15 @@ export const Card = ({ children, headName, input, meta, mode, schema, props, })
19
21
  return null;
20
22
  }
21
23
  return (React.createElement(HelpMark, null,
22
- React.createElement(HTMLContent, { html: schema.description })));
23
- }, [schema.description, descriptionType]);
24
+ React.createElement(HTMLContent, { content: schema.description, headName: headName })));
25
+ }, [headName, schema.description, descriptionType]);
24
26
  const bottomDescription = React.useMemo(() => {
25
27
  if (!schema.description || descriptionType !== 'bottom' || overviewFlag) {
26
28
  return null;
27
29
  }
28
- return React.createElement(HTMLContent, { html: schema.description, color: "secondary" });
29
- }, [schema.description, descriptionType, overviewFlag]);
30
- return (React.createElement(LayoutContainer, { className: b(), hideEmpty: overviewFlag },
30
+ return React.createElement(HTMLContent, { content: schema.description, headName: headName, color: "secondary" });
31
+ }, [headName, schema.description, descriptionType, overviewFlag]);
32
+ return (React.createElement(LayoutContainer, { className: b(), hideEmpty: overviewFlag, hidden: hidden },
31
33
  React.createElement(UIKitCard, Object.assign({}, restLayoutProps, { className: b('card') }),
32
34
  React.createElement("div", { className: b('inner', { hidden: !visible }) },
33
35
  React.createElement(Flex, { className: b('header'), direction: "column", justifyContent: "center" },
@@ -7,22 +7,24 @@ import { block, getValidationState } from '../../utils';
7
7
  import './Section.css';
8
8
  const b = block('section');
9
9
  export const Section = ({ children, headName, input, meta, mode, schema, props, }) => {
10
- const { copy, descriptionType = 'tooltip', required, withIndent = false } = props, restLayoutProps = __rest(props, ["copy", "descriptionType", "required", "withIndent"]);
10
+ var _a;
11
+ const { descriptionType = 'tooltip', withIndent = false } = props, restLayoutProps = __rest(props, ["descriptionType", "withIndent"]);
12
+ const { copy, required, hidden } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
11
13
  const overviewFlag = mode === SchemaRendererMode.Overview;
12
14
  const tooltip = React.useMemo(() => {
13
15
  if (!schema.description || descriptionType === 'bottom') {
14
16
  return null;
15
17
  }
16
18
  return (React.createElement(HelpMark, null,
17
- React.createElement(HTMLContent, { html: schema.description })));
18
- }, [schema.description, descriptionType]);
19
+ React.createElement(HTMLContent, { content: schema.description, headName: headName })));
20
+ }, [headName, schema.description, descriptionType]);
19
21
  const bottomDescription = React.useMemo(() => {
20
22
  if (!schema.description || descriptionType !== 'bottom' || overviewFlag) {
21
23
  return null;
22
24
  }
23
- return (React.createElement(HTMLContent, { className: spacing({ mb: 2 }), html: schema.description, color: "secondary" }));
24
- }, [schema.description, descriptionType, overviewFlag]);
25
- return (React.createElement(LayoutContainer, { className: b(), gap: 0.5, hideEmpty: overviewFlag },
25
+ return (React.createElement(HTMLContent, { className: spacing({ mb: 2 }), content: schema.description, color: "secondary", headName: headName }));
26
+ }, [headName, schema.description, descriptionType, overviewFlag]);
27
+ return (React.createElement(LayoutContainer, { className: b(), gap: 0.5, hideEmpty: overviewFlag, hidden: hidden },
26
28
  React.createElement(Flex, { direction: "column", gap: 4 },
27
29
  React.createElement(Flex, { direction: "column" },
28
30
  React.createElement(Flex, { className: b('header'), gap: 2, alignItems: "center" },
@@ -6,12 +6,14 @@ import { ArrayRemoveButton, CopyButton, EntityError, LayoutContainer } from '../
6
6
  import { block, getValidationState } from '../../utils';
7
7
  import './Transparent.css';
8
8
  const b = block('transparent');
9
- export const Transparent = ({ children, headName, input, meta, mode, props, }) => {
9
+ export const Transparent = ({ children, headName, input, meta, mode, props, schema, }) => {
10
+ var _a;
11
+ const { copy, hidden } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
10
12
  const overviewFlag = mode === SchemaRendererMode.Overview;
11
- return (React.createElement(LayoutContainer, { className: b(), gap: 0.5, hideEmpty: isBoolean(props.hideEmpty) ? props.hideEmpty : overviewFlag },
13
+ return (React.createElement(LayoutContainer, { className: b(), gap: 0.5, hideEmpty: isBoolean(props.hideEmpty) ? props.hideEmpty : overviewFlag, hidden: hidden },
12
14
  React.createElement(Flex, { gap: 2 },
13
15
  children,
14
16
  overviewFlag ? null : React.createElement(ArrayRemoveButton, { name: input.name, headName: headName }),
15
- overviewFlag ? (React.createElement(CopyButton, { className: b('copy-button'), copy: props.copy, value: input.value })) : null),
17
+ overviewFlag ? (React.createElement(CopyButton, { className: b('copy-button'), copy: copy, value: input.value })) : null),
16
18
  overviewFlag ? null : (React.createElement(EntityError, { errorMessage: meta.error, validationState: getValidationState(meta) }))));
17
19
  };
@@ -4,15 +4,17 @@ import { CopyButton, HTMLContent, LayoutContainer } from '../../components';
4
4
  import { block } from '../../utils';
5
5
  import './OverviewColumn.css';
6
6
  const b = block('overview-column');
7
- export const OverviewColumn = ({ children, input, schema, props }) => {
7
+ export const OverviewColumn = ({ children, headName, input, schema }) => {
8
+ var _a;
9
+ const { copy, hidden } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
8
10
  const tooltip = React.useMemo(() => {
9
11
  if (!schema.description) {
10
12
  return null;
11
13
  }
12
14
  return (React.createElement(HelpMark, { className: b('help-mark') },
13
- React.createElement(HTMLContent, { html: schema.description })));
14
- }, [schema.description]);
15
- return (React.createElement(LayoutContainer, { className: b(), gap: 2, hideEmpty: true },
15
+ React.createElement(HTMLContent, { content: schema.description, headName: headName })));
16
+ }, [headName, schema.description]);
17
+ return (React.createElement(LayoutContainer, { className: b(), gap: 2, hidden: hidden, hideEmpty: true },
16
18
  React.createElement(Flex, { direction: "column", gap: 0.5, grow: 1 },
17
19
  React.createElement("div", { className: b('top') },
18
20
  React.createElement(Text, { className: b('title'), color: "secondary", wordBreak: "break-word" }, schema.title),
@@ -20,5 +22,5 @@ export const OverviewColumn = ({ children, input, schema, props }) => {
20
22
  React.createElement(Flex, { className: b('bottom'), direction: "column", gap: 0.5, grow: 1 },
21
23
  React.createElement(Flex, { grow: 1, gap: 2 },
22
24
  children,
23
- React.createElement(CopyButton, { className: b('copy-button'), copy: props.copy, value: input.value })))));
25
+ React.createElement(CopyButton, { className: b('copy-button'), copy: copy, value: input.value })))));
24
26
  };
@@ -4,15 +4,17 @@ import { CopyButton, HTMLContent, LayoutContainer } from '../../components';
4
4
  import { block } from '../../utils';
5
5
  import './OverviewRow.css';
6
6
  const b = block('overview-row');
7
- export const OverviewRow = ({ children, input, schema, props }) => {
7
+ export const OverviewRow = ({ children, headName, input, schema }) => {
8
+ var _a;
9
+ const { copy, hidden } = ((_a = schema.nodeParameters) === null || _a === void 0 ? void 0 : _a.flags) || {};
8
10
  const tooltip = React.useMemo(() => {
9
11
  if (!schema.description) {
10
12
  return null;
11
13
  }
12
14
  return (React.createElement(HelpMark, { className: b('help-mark') },
13
- React.createElement(HTMLContent, { html: schema.description })));
14
- }, [schema.description]);
15
- return (React.createElement(LayoutContainer, { className: b(), direction: "row", alignItems: "flex-start", gap: 2, hideEmpty: true },
15
+ React.createElement(HTMLContent, { content: schema.description, headName: headName })));
16
+ }, [headName, schema.description]);
17
+ return (React.createElement(LayoutContainer, { className: b(), direction: "row", alignItems: "flex-start", gap: 2, hidden: hidden, hideEmpty: true },
16
18
  React.createElement("div", { className: b('left') },
17
19
  React.createElement(Text, { className: b('title'), color: "secondary", wordBreak: "break-all" }, schema.title),
18
20
  tooltip,
@@ -20,5 +22,5 @@ export const OverviewRow = ({ children, input, schema, props }) => {
20
22
  React.createElement(Flex, { className: b('right'), direction: "column", gap: 0.5, grow: 1 },
21
23
  React.createElement(Flex, { grow: 1, gap: 2 },
22
24
  children,
23
- React.createElement(CopyButton, { className: b('copy-button'), copy: props.copy, value: input.value })))));
25
+ React.createElement(CopyButton, { className: b('copy-button'), copy: copy, value: input.value })))));
24
26
  };
@@ -1,4 +1,4 @@
1
1
  export { block } from './cn';
2
2
  export { getArrayItemIndex, getArrayItemParentName, getBooleanValidationState, getValidationState, isArrayItem, isStringInt, isStringFloat, isStringNumber, isTupleItem, } from './common';
3
3
  export { parseDate } from './date';
4
- export { specToJsonSchema, layoutRules, arrayInputTypeRules, booleanInputTypeRules, numberInputTypeRules, objectInputTypeRules, stringInputTypeRules, } from './transformer';
4
+ export { specToJsonSchema } from './transformer';
@@ -1,4 +1,4 @@
1
1
  export { block } from './cn';
2
2
  export { getArrayItemIndex, getArrayItemParentName, getBooleanValidationState, getValidationState, isArrayItem, isStringInt, isStringFloat, isStringNumber, isTupleItem, } from './common';
3
3
  export { parseDate } from './date';
4
- export { specToJsonSchema, layoutRules, arrayInputTypeRules, booleanInputTypeRules, numberInputTypeRules, objectInputTypeRules, stringInputTypeRules, } from './transformer';
4
+ export { specToJsonSchema } from './transformer';
@@ -1,18 +1,11 @@
1
- import { type ArraySpec, type BooleanSpec, type NumberSpec, type ObjectSpec, type Spec, type StringSpec } from '../../../core';
2
- import { type JsonSchema, type JsonSchemaAny } from '../../core';
3
- export declare const layoutRules: Record<string, (spec: Spec, mutableSchema: JsonSchema, ctx?: SpecToJsonSchemaContenxt) => void>;
4
- export declare const arrayInputTypeRules: Record<string, (spec: ArraySpec, mutableSchema: JsonSchema, ctx?: SpecToJsonSchemaContenxt) => void>;
5
- export declare const booleanInputTypeRules: Record<string, (spec: BooleanSpec, mutableSchema: JsonSchema, ctx?: SpecToJsonSchemaContenxt) => void>;
6
- export declare const numberInputTypeRules: Record<string, (spec: NumberSpec, mutableSchema: JsonSchema, ctx?: SpecToJsonSchemaContenxt) => void>;
7
- export declare const objectInputTypeRules: Record<string, (spec: ObjectSpec, mutableSchema: JsonSchema, ctx?: SpecToJsonSchemaContenxt) => void>;
8
- export declare const stringInputTypeRules: Record<string, (spec: StringSpec, mutableSchema: JsonSchema, ctx?: SpecToJsonSchemaContenxt) => void>;
9
- interface SpecToJsonSchemaContenxt {
10
- arrayInputTypeRules?: typeof arrayInputTypeRules;
11
- booleanInputTypeRules?: typeof booleanInputTypeRules;
12
- numberInputTypeRules?: typeof numberInputTypeRules;
13
- objectInputTypeRules?: typeof objectInputTypeRules;
14
- stringInputTypeRules?: typeof stringInputTypeRules;
15
- layoutRules?: typeof layoutRules;
16
- }
17
- export declare function specToJsonSchema(spec: Spec, jsonSchema?: JsonSchemaAny, ctx?: SpecToJsonSchemaContenxt): JsonSchema;
1
+ import { type Spec } from '../../../core';
2
+ import { type ErrorMessages, type JsonSchema } from '../../core';
3
+ type Rules = Record<string, (spec: Spec, mutableSchema: JsonSchema, rules: {
4
+ specRules: Rules;
5
+ viewSpecRules: Rules;
6
+ }, errorMessages: ErrorMessages) => void>;
7
+ export declare function specToJsonSchema(spec: Spec, mutableSchema?: JsonSchema, rules?: {
8
+ specRules: Rules;
9
+ viewSpecRules: Rules;
10
+ }, errorMessages?: ErrorMessages): JsonSchema;
18
11
  export {};