@gravity-ui/dynamic-forms 5.9.2 → 5.9.4

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 (66) hide show
  1. package/build/cjs/lib/core/constants.js +1 -1
  2. package/build/cjs/lib/kit/components/Inputs/ArrayBase/ArrayBase.css +1 -1
  3. package/build/cjs/lib/kit/components/Inputs/DateInput/DateInput.js +2 -2
  4. package/build/cjs/lib/kit/components/Inputs/FileInput/utils.js +1 -2
  5. package/build/cjs/lib/kit/components/Inputs/TimeRangeSelector/components/TimeRangeSelect/TimeRangeSelect.js +1 -1
  6. package/build/cjs/lib/kit/i18n/configure.js +1 -1
  7. package/build/cjs/lib/kit/i18n/en.json +2 -0
  8. package/build/cjs/lib/kit/i18n/ru.json +2 -0
  9. package/build/cjs/lib/kit/utils/objectKeys.js +1 -2
  10. package/build/cjs/lib/kit/validators/messages.js +2 -0
  11. package/build/cjs/lib/kit/validators/validators.js +11 -1
  12. package/build/esm/lib/core/components/Form/Controller/Controller.d.ts +2 -1
  13. package/build/esm/lib/core/components/Form/Controller/types.d.ts +2 -2
  14. package/build/esm/lib/core/components/Form/Controller/utils.d.ts +11 -10
  15. package/build/esm/lib/core/components/Form/hooks/useGenerateRandomValue.d.ts +1 -1
  16. package/build/esm/lib/core/components/Form/hooks/useIntegrationFF.d.ts +2 -1
  17. package/build/esm/lib/core/components/Form/hooks/useSearch/useSearch.d.ts +2 -1
  18. package/build/esm/lib/core/components/Form/types/input.d.ts +2 -2
  19. package/build/esm/lib/core/components/Form/types/layout.d.ts +2 -2
  20. package/build/esm/lib/core/components/Form/utils/common.d.ts +2 -2
  21. package/build/esm/lib/core/components/View/DynamicView.d.ts +1 -1
  22. package/build/esm/lib/core/components/View/ViewController.d.ts +2 -1
  23. package/build/esm/lib/core/components/View/hooks/useComponents.d.ts +1 -1
  24. package/build/esm/lib/core/components/View/hooks/useRender.d.ts +1 -1
  25. package/build/esm/lib/core/components/View/types/layout.d.ts +2 -2
  26. package/build/esm/lib/core/components/View/types/views.d.ts +2 -2
  27. package/build/esm/lib/core/helpers.d.ts +5 -5
  28. package/build/esm/lib/core/types/specs.d.ts +1 -2
  29. package/build/esm/lib/kit/components/Inputs/ArrayBase/ArrayBase.css +1 -1
  30. package/build/esm/lib/kit/components/Inputs/DateInput/DateInput.js +2 -2
  31. package/build/esm/lib/kit/components/Inputs/Text/Text.d.ts +2 -1
  32. package/build/esm/lib/kit/components/Inputs/TimeRangeSelector/components/TimeRangeSelect/TimeRangeSelect.js +1 -1
  33. package/build/esm/lib/kit/components/Inputs/TimeRangeSelector/utils.d.ts +4 -3
  34. package/build/esm/lib/kit/components/Layouts/Accordeon/Accordeon.d.ts +2 -1
  35. package/build/esm/lib/kit/components/Layouts/AccordeonCard/AccordeonCardForm.d.ts +2 -1
  36. package/build/esm/lib/kit/components/Layouts/CardAccordeon.d.ts +2 -1
  37. package/build/esm/lib/kit/components/Layouts/CardSection.d.ts +2 -1
  38. package/build/esm/lib/kit/components/Layouts/Column/Column.d.ts +2 -1
  39. package/build/esm/lib/kit/components/Layouts/Row/Row.d.ts +3 -2
  40. package/build/esm/lib/kit/components/Layouts/Section/Section.d.ts +7 -6
  41. package/build/esm/lib/kit/components/Layouts/TableCell/TableCell.d.ts +2 -1
  42. package/build/esm/lib/kit/components/Layouts/Transparent/Transparent.d.ts +2 -1
  43. package/build/esm/lib/kit/components/LazyLoader/LazyLoader.d.ts +2 -2
  44. package/build/esm/lib/kit/components/SimpleVerticalAccordeon/SimpleVerticalAccordeon.d.ts +3 -3
  45. package/build/esm/lib/kit/components/ViewLayouts/ViewAccordeon/ViewAccordeon.d.ts +2 -1
  46. package/build/esm/lib/kit/components/ViewLayouts/ViewAccordeonCard/ViewAccordeonCard.d.ts +2 -1
  47. package/build/esm/lib/kit/components/ViewLayouts/ViewCardAccordeon.d.ts +2 -1
  48. package/build/esm/lib/kit/components/ViewLayouts/ViewCardSection.d.ts +2 -1
  49. package/build/esm/lib/kit/components/ViewLayouts/ViewColumn/ViewColumn.d.ts +2 -1
  50. package/build/esm/lib/kit/components/ViewLayouts/ViewRow/ViewRow.d.ts +2 -1
  51. package/build/esm/lib/kit/components/ViewLayouts/ViewSection/ViewSection.d.ts +5 -4
  52. package/build/esm/lib/kit/components/ViewLayouts/ViewTableCell/ViewTableCell.d.ts +2 -1
  53. package/build/esm/lib/kit/components/ViewLayouts/ViewTransparent/ViewTransparent.d.ts +2 -1
  54. package/build/esm/lib/kit/components/Views/BaseView/BaseView.d.ts +1 -1
  55. package/build/esm/lib/kit/hooks/useOneOf/useOneOf.d.ts +3 -2
  56. package/build/esm/lib/kit/i18n/en.json +2 -0
  57. package/build/esm/lib/kit/i18n/index.d.ts +1 -1
  58. package/build/esm/lib/kit/i18n/ru.json +2 -0
  59. package/build/esm/lib/kit/utils/common.d.ts +1 -1
  60. package/build/esm/lib/kit/utils/objectInline.d.ts +1 -1
  61. package/build/esm/lib/kit/utils/objectKeys.d.ts +1 -1
  62. package/build/esm/lib/kit/validators/messages.js +2 -0
  63. package/build/esm/lib/kit/validators/types.d.ts +2 -0
  64. package/build/esm/lib/kit/validators/validators.d.ts +2 -0
  65. package/build/esm/lib/kit/validators/validators.js +11 -1
  66. package/package.json +12 -12
@@ -8,4 +8,4 @@ var SpecTypes;
8
8
  SpecTypes["Number"] = "number";
9
9
  SpecTypes["Object"] = "object";
10
10
  SpecTypes["String"] = "string";
11
- })(SpecTypes = exports.SpecTypes || (exports.SpecTypes = {}));
11
+ })(SpecTypes || (exports.SpecTypes = SpecTypes = {}));
@@ -22,7 +22,7 @@
22
22
  align-items: flex-end;
23
23
  }
24
24
  .df-array-base_add-button-right .df-transparent {
25
- align-items: flex-end;
25
+ align-items: flex-start;
26
26
  }
27
27
  .df-array-base__items-wrapper_add-button-down {
28
28
  margin-bottom: var(--df-spacing-inputs, var(--g-spacing-4));
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DateInput = exports.DEFAULT_DATE_FORMAT = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const react_1 = tslib_1.__importStar(require("react"));
5
+ const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const date_components_1 = require("@gravity-ui/date-components");
7
7
  const date_utils_1 = require("@gravity-ui/date-utils");
8
8
  const utils_1 = require("../../../utils");
@@ -13,7 +13,7 @@ const DateInput = ({ name, input, spec, inputProps, }) => {
13
13
  const dateInput = spec.viewSpec.dateInput;
14
14
  const timeZone = (dateInput === null || dateInput === void 0 ? void 0 : dateInput.timeZone) && (0, date_utils_1.isValidTimeZone)(dateInput.timeZone) ? dateInput.timeZone : undefined;
15
15
  const outputFormat = dateInput === null || dateInput === void 0 ? void 0 : dateInput.outputFormat;
16
- const onUpdate = (0, react_1.useCallback)((date) => {
16
+ const onUpdate = react_1.default.useCallback((date) => {
17
17
  if (!date) {
18
18
  onChange(undefined);
19
19
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.readFile = void 0;
3
+ exports.readFile = readFile;
4
4
  function readFile(file, readAsMethod = 'readAsBinaryString') {
5
5
  return new Promise((resolve, reject) => {
6
6
  const reader = new FileReader();
@@ -13,4 +13,3 @@ function readFile(file, readAsMethod = 'readAsBinaryString') {
13
13
  reader[readAsMethod](file);
14
14
  });
15
15
  }
16
- exports.readFile = readFile;
@@ -27,7 +27,7 @@ const TimeRangeSelect = ({ name, spec, options, value, props, handleChange, }) =
27
27
  }
28
28
  return 28;
29
29
  }, [(_a = spec.viewSpec.selectParams) === null || _a === void 0 ? void 0 : _a.meta]);
30
- return (react_1.default.createElement(Row_1.Row, Object.assign({}, Object.assign(Object.assign({}, props), { spec })),
30
+ return (react_1.default.createElement(Row_1.Row, Object.assign({}, props, { spec }),
31
31
  react_1.default.createElement(uikit_1.Select, { className: b('select'), filterable: filterable, value: _value, options: options, onUpdate: handleChange, disabled: spec.viewSpec.disabled, placeholder: spec.viewSpec.placeholder, filterPlaceholder: (_b = spec.viewSpec.selectParams) === null || _b === void 0 ? void 0 : _b.filterPlaceholder, renderOption: renderOption, getOptionHeight: getOptionHeight, qa: name, popupClassName: b('select-popup') })));
32
32
  };
33
33
  exports.TimeRangeSelect = TimeRangeSelect;
@@ -5,7 +5,7 @@ var Lang;
5
5
  (function (Lang) {
6
6
  Lang["Ru"] = "ru";
7
7
  Lang["En"] = "en";
8
- })(Lang = exports.Lang || (exports.Lang = {}));
8
+ })(Lang || (exports.Lang = Lang = {}));
9
9
  let config = {};
10
10
  let subscribers = [];
11
11
  const configure = (newConfig) => {
@@ -41,6 +41,8 @@
41
41
  "label_error-space-start": "Value must not start with a space",
42
42
  "label_error-zero-start": "Value must not start with a zero",
43
43
  "label_error-dot-end": "Value must not end with a dot",
44
+ "label_error-invalid-zero-format": "Invalid zero value format",
45
+ "label_error-zero-end": "Value must not end with a zero",
44
46
  "label_delete": "Delete",
45
47
  "button_cancel": "Close",
46
48
  "button-upload_file": "Upload file",
@@ -41,6 +41,8 @@
41
41
  "label_error-space-start": "Значение не должно начинаться с пробела",
42
42
  "label_error-zero-start": "Значение не должно начинаться с нуля",
43
43
  "label_error-dot-end": "Значение не должно заканчиваться точкой",
44
+ "label_error-invalid-zero-format": "Неверный формат значения нуля",
45
+ "label_error-zero-end": "Значение не должно заканчиваться нулем",
44
46
  "label_delete": "Удалить",
45
47
  "button_cancel": "Закрыть",
46
48
  "button-upload_file": "Загрузить файл",
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.objectKeys = void 0;
3
+ exports.objectKeys = objectKeys;
4
4
  function objectKeys(obj) {
5
5
  return Object.keys(obj);
6
6
  }
7
- exports.objectKeys = objectKeys;
@@ -31,6 +31,8 @@ const getErrorMessages = () => ({
31
31
  SPACE_END: (0, i18n_1.default)('label_error-space-end'),
32
32
  DOT_END: (0, i18n_1.default)('label_error-dot-end'),
33
33
  ZERO_START: (0, i18n_1.default)('label_error-zero-start'),
34
+ INVALID_ZERO_FORMAT: (0, i18n_1.default)('label_error-invalid-zero-format'),
35
+ ZERO_END: (0, i18n_1.default)('label_error-zero-end'),
34
36
  });
35
37
  exports.ErrorMessages = getErrorMessages();
36
38
  (0, configure_1.subscribeConfigure)(() => {
@@ -41,7 +41,7 @@ const getBooleanValidator = (params = {}) => {
41
41
  };
42
42
  exports.getBooleanValidator = getBooleanValidator;
43
43
  const getNumberValidator = (params = {}) => {
44
- const { ignoreRequiredCheck, ignoreSpaceStartCheck, ignoreSpaceEndCheck, ignoreNumberCheck, ignoreMaximumCheck, ignoreMinimumCheck, ignoreIntCheck, ignoreDotEnd, ignoreZeroStart, customErrorMessages, } = params;
44
+ const { ignoreRequiredCheck, ignoreSpaceStartCheck, ignoreSpaceEndCheck, ignoreNumberCheck, ignoreMaximumCheck, ignoreMinimumCheck, ignoreIntCheck, ignoreDotEnd, ignoreZeroStart, ignoreInvalidZeroFormat, ignoreZeroEnd, customErrorMessages, } = params;
45
45
  // eslint-disable-next-line complexity
46
46
  return (spec, value = '') => {
47
47
  const errorMessages = Object.assign(Object.assign({}, validators_1.ErrorMessages), customErrorMessages);
@@ -69,6 +69,16 @@ const getNumberValidator = (params = {}) => {
69
69
  stringValue[2] !== '.'))) {
70
70
  return errorMessages.ZERO_START;
71
71
  }
72
+ if (!ignoreInvalidZeroFormat &&
73
+ stringValue.trim().length > 1 &&
74
+ Number(stringValue.trim()) === 0) {
75
+ return errorMessages.INVALID_ZERO_FORMAT;
76
+ }
77
+ if (!ignoreZeroEnd &&
78
+ !(0, helpers_1.isInt)(stringValue) &&
79
+ stringValue[stringValue.length - 1] === '0') {
80
+ return errorMessages.ZERO_END;
81
+ }
72
82
  }
73
83
  if (!ignoreMaximumCheck &&
74
84
  (0, isNumber_1.default)(spec.maximum) &&
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { FormValue, Spec } from '../../../types';
2
3
  import type { FieldValue, ValidateError } from '../types';
3
4
  export interface ControllerProps<DirtyValue extends FieldValue, SpecType extends Spec> {
@@ -7,4 +8,4 @@ export interface ControllerProps<DirtyValue extends FieldValue, SpecType extends
7
8
  parentOnChange: ((childName: string, childValue: FieldValue, childErrors: Record<string, ValidateError>) => void) | null;
8
9
  parentOnUnmount: ((childName: string) => void) | null;
9
10
  }
10
- export declare const Controller: <DirtyValue extends FieldValue, Value extends FormValue, SpecType extends Spec<any, undefined, undefined>>({ spec: _spec, name, value: valueFromParent, parentOnChange, parentOnUnmount, }: ControllerProps<DirtyValue, SpecType>) => JSX.Element | null;
11
+ export declare const Controller: <DirtyValue extends FieldValue, Value extends FormValue, SpecType extends Spec>({ spec: _spec, name, value: valueFromParent, parentOnChange, parentOnUnmount, }: ControllerProps<DirtyValue, SpecType>) => React.JSX.Element | null;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import type React from 'react';
2
2
  import type { FormValue, Spec } from '../../../types';
3
3
  import type { DynamicFormConfig, DynamicFormMutatorsStore, DynamicFormsContext, FieldRenderProps, FieldValue, IndependentInputEntity, InputEntity, LayoutType, ValidateError } from '../types';
4
4
  export interface GetSpecParams<SpecType extends Spec> {
@@ -63,7 +63,7 @@ export interface ControllerStore<DirtyValue extends FieldValue, Value extends Fo
63
63
  config: DynamicFormConfig;
64
64
  tools: DynamicFormsContext['tools'];
65
65
  mutatorsStore: DynamicFormMutatorsStore;
66
- render: (props: FieldRenderProps<DirtyValue>) => JSX.Element | null;
66
+ render: (props: FieldRenderProps<DirtyValue>) => React.JSX.Element | null;
67
67
  validate: (value?: Value) => ValidateError;
68
68
  parentOnChange: ((childName: string, childValue: FieldValue, childErrors: Record<string, ValidateError>) => void) | null;
69
69
  parentOnUnmount: ((childName: string) => void) | null;
@@ -1,13 +1,14 @@
1
+ import React from 'react';
1
2
  import type { FormValue, Spec } from '../../../types';
2
3
  import type { BaseValidateError, FieldRenderProps, FieldValue, ValidateError } from '../types';
3
4
  import type { ControllerStore, GetComponentsParams, GetComponentsReturn, GetFieldInitialsParams, GetFieldMethodsReturn, GetRenderParams, GetSpecParams, GetValidateParams, InitializeStoreParams, UpdateStoreParams } from './types';
4
- export declare const updateParentStore: <DirtyValue extends FieldValue, Value extends FormValue, SpecType extends Spec<any, undefined, undefined>>(store: ControllerStore<DirtyValue, Value, SpecType>) => void;
5
- export declare const callUnmout: <DirtyValue extends FieldValue, Value extends FormValue, SpecType extends Spec<any, undefined, undefined>>(store: ControllerStore<DirtyValue, Value, SpecType>) => void;
6
- export declare const getSpec: <SpecType extends Spec<any, undefined, undefined>>({ name, spec, mutatorsStore, }: GetSpecParams<SpecType>) => SpecType;
7
- export declare const getComponents: <DirtyValue extends FieldValue, Value extends FormValue, SpecType extends Spec<any, undefined, undefined>>({ spec, config, }: GetComponentsParams<SpecType>) => GetComponentsReturn<DirtyValue, SpecType>;
8
- export declare const getRender: <DirtyValue extends FieldValue, SpecType extends Spec<any, undefined, undefined>>({ name, spec, inputEntity, Layout, }: GetRenderParams<DirtyValue, SpecType>) => (props: FieldRenderProps<DirtyValue>) => JSX.Element | null;
9
- export declare const getValidate: <DirtyValue extends FieldValue, Value extends FormValue, SpecType extends Spec<any, undefined, undefined>>({ spec, config, }: GetValidateParams<SpecType>) => (value?: Value | undefined) => ValidateError;
10
- export declare const getFieldInitials: <DirtyValue extends FieldValue, Value extends FormValue, SpecType extends Spec<any, undefined, undefined>>({ name, spec, valueFromParent, initialValue, validate, mutatorsStore, }: GetFieldInitialsParams<DirtyValue, Value, SpecType>) => {
5
+ export declare const updateParentStore: <DirtyValue extends FieldValue, Value extends FormValue, SpecType extends Spec>(store: ControllerStore<DirtyValue, Value, SpecType>) => void;
6
+ export declare const callUnmout: <DirtyValue extends FieldValue, Value extends FormValue, SpecType extends Spec>(store: ControllerStore<DirtyValue, Value, SpecType>) => void;
7
+ export declare const getSpec: <SpecType extends Spec>({ name, spec, mutatorsStore, }: GetSpecParams<SpecType>) => SpecType;
8
+ export declare const getComponents: <DirtyValue extends FieldValue, Value extends FormValue, SpecType extends Spec>({ spec, config, }: GetComponentsParams<SpecType>) => GetComponentsReturn<DirtyValue, SpecType>;
9
+ export declare const getRender: <DirtyValue extends FieldValue, SpecType extends Spec>({ name, spec, inputEntity, Layout, }: GetRenderParams<DirtyValue, SpecType>) => (props: FieldRenderProps<DirtyValue>) => React.JSX.Element | null;
10
+ export declare const getValidate: <DirtyValue extends FieldValue, Value extends FormValue, SpecType extends Spec>({ spec, config, }: GetValidateParams<SpecType>) => (value?: Value) => ValidateError;
11
+ export declare const getFieldInitials: <DirtyValue extends FieldValue, Value extends FormValue, SpecType extends Spec>({ name, spec, valueFromParent, initialValue, validate, mutatorsStore, }: GetFieldInitialsParams<DirtyValue, Value, SpecType>) => {
11
12
  initialValue: DirtyValue;
12
13
  active: boolean;
13
14
  dirty: boolean;
@@ -21,6 +22,6 @@ export declare const getFieldInitials: <DirtyValue extends FieldValue, Value ext
21
22
  visited: boolean;
22
23
  childErrors: {};
23
24
  };
24
- export declare const getFieldMethods: <DirtyValue extends FieldValue, Value extends FormValue, SpecType extends Spec<any, undefined, undefined>>() => GetFieldMethodsReturn<DirtyValue, Value, SpecType>;
25
- export declare const initializeStore: <DirtyValue extends FieldValue, Value extends FormValue, SpecType extends Spec<any, undefined, undefined>>({ name, spec: _spec, mutatorsStore, config, valueFromParent, tools, parentOnChange, parentOnUnmount, }: InitializeStoreParams<DirtyValue, SpecType>) => ControllerStore<DirtyValue, Value, SpecType>;
26
- export declare const updateStore: <DirtyValue extends FieldValue, Value extends FormValue, SpecType extends Spec<any, undefined, undefined>>({ store, setStore, spec: _spec, name, parentOnChange, parentOnUnmount, mutatorsStore, valueFromParent, config, tools, methodOnChange, }: UpdateStoreParams<DirtyValue, Value, SpecType>) => void;
25
+ export declare const getFieldMethods: <DirtyValue extends FieldValue, Value extends FormValue, SpecType extends Spec>() => GetFieldMethodsReturn<DirtyValue, Value, SpecType>;
26
+ export declare const initializeStore: <DirtyValue extends FieldValue, Value extends FormValue, SpecType extends Spec>({ name, spec: _spec, mutatorsStore, config, valueFromParent, tools, parentOnChange, parentOnUnmount, }: InitializeStoreParams<DirtyValue, SpecType>) => ControllerStore<DirtyValue, Value, SpecType>;
27
+ export declare const updateStore: <DirtyValue extends FieldValue, Value extends FormValue, SpecType extends Spec>({ store, setStore, spec: _spec, name, parentOnChange, parentOnUnmount, mutatorsStore, valueFromParent, config, tools, methodOnChange, }: UpdateStoreParams<DirtyValue, Value, SpecType>) => void;
@@ -1 +1 @@
1
- export declare const useGenerateRandomValue: () => ((spec: import("../../..").StringSpec<any, undefined, undefined>) => string) | undefined;
1
+ export declare const useGenerateRandomValue: () => ((spec: import("../../..").StringSpec) => string) | undefined;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { DynamicFieldStore, FieldValue } from '../types';
2
3
  interface UseIntegrationFFParams {
3
4
  store: DynamicFieldStore;
@@ -5,5 +6,5 @@ interface UseIntegrationFFParams {
5
6
  destroyOnUnregister?: boolean;
6
7
  storeSubscriber?: (store: FieldValue) => void;
7
8
  }
8
- export declare const useIntegrationFF: ({ store, withoutDebounce, destroyOnUnregister, storeSubscriber, }: UseIntegrationFFParams) => JSX.Element;
9
+ export declare const useIntegrationFF: ({ store, withoutDebounce, destroyOnUnregister, storeSubscriber, }: UseIntegrationFFParams) => React.JSX.Element;
9
10
  export {};
@@ -1,4 +1,5 @@
1
+ import React from 'react';
1
2
  import type { Spec } from '../../../../types';
2
3
  import type { FieldValue } from '../../types';
3
4
  import './useSearch.css';
4
- export declare const useSearch: (spec: Spec, value: FieldValue, name: string) => (children: JSX.Element | null) => JSX.Element | null;
5
+ export declare const useSearch: (spec: Spec, value: FieldValue, name: string) => (children: React.JSX.Element | null) => React.JSX.Element | null;
@@ -10,8 +10,8 @@ export type IndependentInputProps<Value extends FieldValue, InputComponentProps
10
10
  Layout: LayoutType<Value, InputComponentProps, LayoutComponentProps, SpecType> | undefined;
11
11
  layoutProps?: LayoutComponentProps;
12
12
  } & InputProps<Value, InputComponentProps, LayoutComponentProps, SpecType>;
13
- export type InputType<Value extends FieldValue, InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined, SpecType extends Spec<undefined, InputComponentProps, LayoutComponentProps> = Spec> = (props: InputProps<Value, InputComponentProps, LayoutComponentProps, SpecType>) => React.ReactElement | null;
14
- export type IndependentInputType<Value extends FieldValue, InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined, SpecType extends Spec<undefined, InputComponentProps, LayoutComponentProps> = Spec> = (props: IndependentInputProps<Value, InputComponentProps, LayoutComponentProps, SpecType>) => React.ReactElement | null;
13
+ export type InputType<Value extends FieldValue, InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined, SpecType extends Spec<undefined, InputComponentProps, LayoutComponentProps> = Spec> = (props: InputProps<Value, InputComponentProps, LayoutComponentProps, SpecType>) => React.ReactNode | Promise<React.ReactNode>;
14
+ export type IndependentInputType<Value extends FieldValue, InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined, SpecType extends Spec<undefined, InputComponentProps, LayoutComponentProps> = Spec> = (props: IndependentInputProps<Value, InputComponentProps, LayoutComponentProps, SpecType>) => React.ReactNode | Promise<React.ReactNode>;
15
15
  export type InputEntity<Value extends FieldValue, InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined, SpecType extends Spec<undefined, InputComponentProps, LayoutComponentProps> = Spec> = {
16
16
  Component: InputType<Value, InputComponentProps, LayoutComponentProps, SpecType>;
17
17
  independent?: false;
@@ -2,8 +2,8 @@ import type React from 'react';
2
2
  import type { Spec } from '../../../types';
3
3
  import type { FieldValue, InputProps } from './';
4
4
  export type LayoutProps<Value extends FieldValue, InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined, SpecType extends Spec<undefined, InputComponentProps, LayoutComponentProps> = Spec> = {
5
- children: React.ReactElement;
5
+ children: React.ReactNode;
6
6
  layoutProps?: LayoutComponentProps;
7
7
  } & Omit<InputProps<Value, InputComponentProps, LayoutComponentProps, SpecType>, 'inputProps'>;
8
- export type LayoutType<Value extends FieldValue, InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined, SpecType extends Spec<undefined, InputComponentProps, LayoutComponentProps> = Spec> = (props: LayoutProps<Value, InputComponentProps, LayoutComponentProps, SpecType>) => React.ReactElement | null;
8
+ export type LayoutType<Value extends FieldValue, InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined, SpecType extends Spec<undefined, InputComponentProps, LayoutComponentProps> = Spec> = (props: LayoutProps<Value, InputComponentProps, LayoutComponentProps, SpecType>) => React.ReactNode | Promise<React.ReactNode>;
9
9
  export type LayoutsMap<Value extends FieldValue, SpecType extends Spec<undefined, any, any> = Spec> = Record<string, LayoutType<Value, any, any, SpecType> | undefined>;
@@ -1,6 +1,6 @@
1
1
  import type { FormValue, Spec } from '../../../types';
2
2
  export declare const isCorrectConfig: (candidate: any) => boolean;
3
- export declare const transformArrIn: <Type extends FormValue, ReturnType_1 extends FormValue = Type>(value: Type) => ReturnType_1;
4
- export declare const transformArrOut: <Type extends FormValue, ReturnType_1 extends FormValue = Type>(value: Type) => ReturnType_1;
3
+ export declare const transformArrIn: <Type extends FormValue, ReturnType extends FormValue = Type>(value: Type) => ReturnType;
4
+ export declare const transformArrOut: <Type extends FormValue, ReturnType extends FormValue = Type>(value: Type) => ReturnType;
5
5
  export declare const isArrayItem: (name: string) => boolean;
6
6
  export declare const withGenerateButton: (spec: Spec) => boolean | undefined;
@@ -14,4 +14,4 @@ export interface DynamicViewProps {
14
14
  showLayoutDescription?: boolean;
15
15
  shared?: Record<string, any>;
16
16
  }
17
- export declare const DynamicView: ({ value, spec, config, Link, Monaco, showLayoutDescription, shared: externalShared, }: DynamicViewProps) => JSX.Element | null;
17
+ export declare const DynamicView: ({ value, spec, config, Link, Monaco, showLayoutDescription, shared: externalShared, }: DynamicViewProps) => React.JSX.Element | null;
@@ -1,6 +1,7 @@
1
+ import React from 'react';
1
2
  import type { Spec } from '../../types';
2
3
  export interface ViewControllerProps<SpecType extends Spec> {
3
4
  spec: SpecType;
4
5
  name: string;
5
6
  }
6
- export declare const ViewController: <SpecType extends Spec<any, undefined, undefined>>({ spec, name, }: ViewControllerProps<SpecType>) => JSX.Element;
7
+ export declare const ViewController: <SpecType extends Spec>({ spec, name, }: ViewControllerProps<SpecType>) => React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import type { FormValue, Spec } from '../../../types';
2
2
  import type { DynamicViewConfig, IndependentViewEntity, ViewEntity, ViewLayoutType } from '../types';
3
- export declare const useComponents: <Value extends FormValue, SpecType extends Spec<any, undefined, undefined>>(spec: SpecType, config: DynamicViewConfig) => {
3
+ export declare const useComponents: <Value extends FormValue, SpecType extends Spec>(spec: SpecType, config: DynamicViewConfig) => {
4
4
  viewEntity: ViewEntity<Value, SpecType> | IndependentViewEntity<Value, SpecType> | undefined;
5
5
  Layout: ViewLayoutType<Value, SpecType> | undefined;
6
6
  };
@@ -12,4 +12,4 @@ export interface UseRenderParams<Value extends FormValue, SpecType extends Spec>
12
12
  link: SpecType['viewSpec']['link'];
13
13
  }>;
14
14
  }
15
- export declare const useRender: <Value extends FormValue, SpecType extends Spec<any, undefined, undefined>>({ value, name, spec, viewEntity, Layout, Link, }: UseRenderParams<Value, SpecType>) => JSX.Element | null;
15
+ export declare const useRender: <Value extends FormValue, SpecType extends Spec>({ value, name, spec, viewEntity, Layout, Link, }: UseRenderParams<Value, SpecType>) => React.JSX.Element | null;
@@ -2,7 +2,7 @@ import type React from 'react';
2
2
  import type { FormValue, Spec } from '../../../';
3
3
  import type { ViewProps } from './';
4
4
  export type ViewLayoutProps<Value extends FormValue, SpecType extends Spec<undefined, undefined, Record<string, any> | undefined> = Spec> = {
5
- children: React.ReactElement;
5
+ children: React.ReactNode;
6
6
  } & ViewProps<Value, SpecType>;
7
- export type ViewLayoutType<Value extends FormValue, SpecType extends Spec> = (props: ViewLayoutProps<Value, SpecType>) => React.ReactElement | null;
7
+ export type ViewLayoutType<Value extends FormValue, SpecType extends Spec> = (props: ViewLayoutProps<Value, SpecType>) => React.ReactNode | Promise<React.ReactNode>;
8
8
  export type ViewLayoutsMap<Value extends FormValue, SpecType extends Spec> = Record<string, ViewLayoutType<Value, SpecType> | undefined>;
@@ -10,8 +10,8 @@ export type ViewProps<Value extends FormValue, SpecType extends Spec<undefined,
10
10
  export type IndependentViewProps<Value extends FormValue, SpecType extends Spec> = {
11
11
  Layout: ViewLayoutType<Value, SpecType> | undefined;
12
12
  } & ViewProps<Value, SpecType>;
13
- export type ViewType<Value extends FormValue, SpecType extends Spec> = (props: ViewProps<Value, SpecType>) => React.ReactElement | null;
14
- export type IndependentViewType<Value extends FormValue, SpecType extends Spec> = (props: IndependentViewProps<Value, SpecType>) => React.ReactElement | null;
13
+ export type ViewType<Value extends FormValue, SpecType extends Spec> = (props: ViewProps<Value, SpecType>) => React.ReactNode | Promise<React.ReactNode>;
14
+ export type IndependentViewType<Value extends FormValue, SpecType extends Spec> = (props: IndependentViewProps<Value, SpecType>) => React.ReactNode | Promise<React.ReactNode>;
15
15
  export type ViewEntity<Value extends FormValue, SpecType extends Spec> = {
16
16
  Component: ViewType<Value, SpecType>;
17
17
  independent?: false;
@@ -1,7 +1,7 @@
1
1
  import type { ArraySpec, BooleanSpec, NumberSpec, ObjectSpec, StringSpec } from './types';
2
2
  export declare const isCorrectSpec: (candidate: any) => boolean;
3
- export declare const isArraySpec: (candidate: any) => candidate is ArraySpec<any, undefined, undefined>;
4
- export declare const isBooleanSpec: (candidate: any) => candidate is BooleanSpec<any, undefined, undefined>;
5
- export declare const isNumberSpec: (candidate: any) => candidate is NumberSpec<any, undefined, undefined>;
6
- export declare const isObjectSpec: (candidate: any) => candidate is ObjectSpec<any, undefined, undefined>;
7
- export declare const isStringSpec: (candidate: any) => candidate is StringSpec<any, undefined, undefined>;
3
+ export declare const isArraySpec: (candidate: any) => candidate is ArraySpec;
4
+ export declare const isBooleanSpec: (candidate: any) => candidate is BooleanSpec;
5
+ export declare const isNumberSpec: (candidate: any) => candidate is NumberSpec;
6
+ export declare const isObjectSpec: (candidate: any) => candidate is ObjectSpec;
7
+ export declare const isStringSpec: (candidate: any) => candidate is StringSpec;
@@ -1,5 +1,4 @@
1
1
  import type { AlertProps, ButtonSize, LabelProps, TextProps } from '@gravity-ui/uikit';
2
- import type { ColorTextBaseProps } from '@gravity-ui/uikit/build/esm/components/Text/colorText/colorText';
3
2
  import type { ReadAsMethod, SpecTypes } from '../constants';
4
3
  import type { ArrayValue, ObjectValue } from './';
5
4
  export interface ArraySpec<LinkType = any, InputComponentProps extends Record<string, any> | undefined = undefined, LayoutComponentProps extends Record<string, any> | undefined = undefined> {
@@ -154,7 +153,7 @@ export interface StringSpec<LinkType = any, InputComponentProps extends Record<s
154
153
  themeLabel?: LabelProps['theme'];
155
154
  text: string;
156
155
  icon?: string;
157
- iconColor?: ColorTextBaseProps['color'];
156
+ iconColor?: TextProps['color'];
158
157
  titleAlert?: string;
159
158
  themeAlert?: AlertProps['theme'];
160
159
  viewAlert?: AlertProps['view'];
@@ -22,7 +22,7 @@
22
22
  align-items: flex-end;
23
23
  }
24
24
  .df-array-base_add-button-right .df-transparent {
25
- align-items: flex-end;
25
+ align-items: flex-start;
26
26
  }
27
27
  .df-array-base__items-wrapper_add-button-down {
28
28
  margin-bottom: var(--df-spacing-inputs, var(--g-spacing-4));
@@ -1,4 +1,4 @@
1
- import React, { useCallback } from 'react';
1
+ import React from 'react';
2
2
  import { DatePicker } from '@gravity-ui/date-components';
3
3
  import { dateTimeParse, isValidTimeZone } from '@gravity-ui/date-utils';
4
4
  import { block } from '../../../utils';
@@ -10,7 +10,7 @@ export const DateInput = ({ name, input, spec, inputProps, }) => {
10
10
  const dateInput = spec.viewSpec.dateInput;
11
11
  const timeZone = (dateInput === null || dateInput === void 0 ? void 0 : dateInput.timeZone) && isValidTimeZone(dateInput.timeZone) ? dateInput.timeZone : undefined;
12
12
  const outputFormat = dateInput === null || dateInput === void 0 ? void 0 : dateInput.outputFormat;
13
- const onUpdate = useCallback((date) => {
13
+ const onUpdate = React.useCallback((date) => {
14
14
  if (!date) {
15
15
  onChange(undefined);
16
16
  }
@@ -1,5 +1,6 @@
1
+ import React from 'react';
1
2
  import type { TextInputProps as TextInputBaseProps } from '@gravity-ui/uikit';
2
3
  import type { NumberInputProps, StringInputProps } from '../../../../core';
3
4
  export interface TextProps extends Omit<TextInputBaseProps, 'value' | 'onBlur' | 'onFocus' | 'onUpdate' | 'disabled' | 'placeholder' | 'qa'> {
4
5
  }
5
- export declare const Text: <T extends NumberInputProps<TextProps> | StringInputProps<TextProps>>({ name, input: { value, onBlur, onChange, onFocus }, spec, inputProps, }: T) => JSX.Element;
6
+ export declare const Text: <T extends NumberInputProps<TextProps> | StringInputProps<TextProps>>({ name, input: { value, onBlur, onChange, onFocus }, spec, inputProps, }: T) => React.JSX.Element;
@@ -24,6 +24,6 @@ export const TimeRangeSelect = ({ name, spec, options, value, props, handleChang
24
24
  }
25
25
  return 28;
26
26
  }, [(_a = spec.viewSpec.selectParams) === null || _a === void 0 ? void 0 : _a.meta]);
27
- return (React.createElement(Row, Object.assign({}, Object.assign(Object.assign({}, props), { spec })),
27
+ return (React.createElement(Row, Object.assign({}, props, { spec }),
28
28
  React.createElement(Select, { className: b('select'), filterable: filterable, value: _value, options: options, onUpdate: handleChange, disabled: spec.viewSpec.disabled, placeholder: spec.viewSpec.placeholder, filterPlaceholder: (_b = spec.viewSpec.selectParams) === null || _b === void 0 ? void 0 : _b.filterPlaceholder, renderOption: renderOption, getOptionHeight: getOptionHeight, qa: name, popupClassName: b('select-popup') })));
29
29
  };
@@ -1,10 +1,11 @@
1
+ import React from 'react';
1
2
  export declare const filterTimeArray: (times: {
2
3
  id: string;
3
4
  value: string;
4
- content: string | JSX.Element;
5
+ content: string | React.JSX.Element;
5
6
  key: string;
6
- }[], cutoff: string, direction: 'greater' | 'less') => {
7
- content: string | JSX.Element;
7
+ }[], cutoff: string, direction: "greater" | "less") => {
8
+ content: string | React.JSX.Element;
8
9
  disabled: boolean;
9
10
  id: string;
10
11
  value: string;
@@ -1,7 +1,8 @@
1
+ import React from 'react';
1
2
  import type { TextProps } from '@gravity-ui/uikit';
2
3
  import type { ArrayLayoutProps, ObjectLayoutProps } from '../../../../core';
3
4
  interface AccordeonLayoutProps {
4
5
  variantTitle?: TextProps['variant'];
5
6
  }
6
- export declare const Accordeon: <T extends ArrayLayoutProps<Record<string, any> | undefined, AccordeonLayoutProps | undefined> | ObjectLayoutProps<Record<string, any> | undefined, AccordeonLayoutProps | undefined>>({ name, spec, input, meta, children, }: T) => JSX.Element;
7
+ export declare const Accordeon: <T extends ArrayLayoutProps<Record<string, any> | undefined, AccordeonLayoutProps | undefined> | ObjectLayoutProps<Record<string, any> | undefined, AccordeonLayoutProps | undefined>>({ name, spec, input, meta, children, }: T) => React.JSX.Element;
7
8
  export {};
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { ArrayLayoutProps, ObjectLayoutProps } from '../../../../core';
2
3
  import './AccordeonCardForm.css';
3
- export declare const AccordeonCardForm: <T extends ArrayLayoutProps<undefined, undefined> | ObjectLayoutProps<undefined, undefined>>({ name, spec, input, children, meta, }: T) => JSX.Element;
4
+ export declare const AccordeonCardForm: <T extends ArrayLayoutProps | ObjectLayoutProps>({ name, spec, input, children, meta, }: T) => React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import React from 'react';
1
2
  import type { FieldValue, LayoutProps, Spec } from '../../../core';
2
- export declare const CardAccordeon: <T extends FieldValue, S extends Spec<any, undefined, undefined>>({ name, spec, input, meta, children, }: LayoutProps<T, undefined, undefined, S>) => JSX.Element;
3
+ export declare const CardAccordeon: <T extends FieldValue, S extends Spec>({ name, spec, input, meta, children, }: LayoutProps<T, undefined, undefined, S>) => React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import React from 'react';
1
2
  import type { FieldValue, LayoutProps, Spec } from '../../../core';
2
- export declare const CardSection: <T extends FieldValue, S extends Spec<any, undefined, undefined>>({ name, spec, input, meta, children, }: LayoutProps<T, undefined, undefined, S>) => JSX.Element;
3
+ export declare const CardSection: <T extends FieldValue, S extends Spec>({ name, spec, input, meta, children, }: LayoutProps<T, undefined, undefined, S>) => React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { FieldValue, LayoutProps, Spec } from '../../../../core';
2
3
  import './Column.css';
3
- export declare const Column: <T extends FieldValue, S extends Spec<any, undefined, undefined>>(props: LayoutProps<T, undefined, undefined, S>) => JSX.Element;
4
+ export declare const Column: <T extends FieldValue, S extends Spec>(props: LayoutProps<T, undefined, undefined, S>) => React.JSX.Element;
@@ -1,4 +1,5 @@
1
+ import React from 'react';
1
2
  import type { FieldValue, LayoutProps, Spec } from '../../../../core';
2
3
  import './Row.css';
3
- export declare const Row: <T extends FieldValue, S extends Spec<any, undefined, undefined>>(props: LayoutProps<T, undefined, undefined, S>) => JSX.Element;
4
- export declare const RowVerbose: <T extends FieldValue, S extends Spec<any, undefined, undefined>>(props: LayoutProps<T, undefined, undefined, S>) => JSX.Element;
4
+ export declare const Row: <T extends FieldValue, S extends Spec>(props: LayoutProps<T, undefined, undefined, S>) => React.JSX.Element;
5
+ export declare const RowVerbose: <T extends FieldValue, S extends Spec>(props: LayoutProps<T, undefined, undefined, S>) => React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { FieldValue, FormValue, LayoutProps, Spec, ViewLayoutProps } from '../../../../core';
2
3
  import './Section.css';
3
4
  interface SectionProps {
@@ -6,10 +7,10 @@ interface SectionProps {
6
7
  ignoreDescription?: boolean;
7
8
  descriptionAsSubtitle?: boolean;
8
9
  }
9
- export declare const Section: <D extends FieldValue, T extends FormValue, S extends Spec<any, undefined, undefined>>(props: (LayoutProps<D, undefined, undefined, S> | ViewLayoutProps<T, S>) & Pick<SectionProps, "ignoreDescription">) => JSX.Element;
10
- export declare const Section2: <D extends FieldValue, T extends FormValue, S extends Spec<any, undefined, undefined>>(props: (LayoutProps<D, undefined, undefined, S> | ViewLayoutProps<T, S>) & Pick<SectionProps, "ignoreDescription">) => JSX.Element;
11
- export declare const SectionWithSubtitle: <D extends FieldValue, T extends FormValue, S extends Spec<any, undefined, undefined>>(props: (LayoutProps<D, undefined, undefined, S> | ViewLayoutProps<T, S>) & Pick<SectionProps, "ignoreDescription">) => JSX.Element;
12
- export declare const SectionWithSubtitle2: <D extends FieldValue, T extends FormValue, S extends Spec<any, undefined, undefined>>(props: (LayoutProps<D, undefined, undefined, S> | ViewLayoutProps<T, S>) & Pick<SectionProps, "ignoreDescription">) => JSX.Element;
13
- export declare const Group: <D extends FieldValue, T extends FormValue, S extends Spec<any, undefined, undefined>>(props: (LayoutProps<D, undefined, undefined, S> | ViewLayoutProps<T, S>) & Pick<SectionProps, "ignoreDescription">) => JSX.Element;
14
- export declare const Group2: <D extends FieldValue, T extends FormValue, S extends Spec<any, undefined, undefined>>(props: (LayoutProps<D, undefined, undefined, S> | ViewLayoutProps<T, S>) & Pick<SectionProps, "ignoreDescription">) => JSX.Element;
10
+ export declare const Section: <D extends FieldValue, T extends FormValue, S extends Spec>(props: (LayoutProps<D, undefined, undefined, S> | ViewLayoutProps<T, S>) & Pick<SectionProps, "ignoreDescription">) => React.JSX.Element;
11
+ export declare const Section2: <D extends FieldValue, T extends FormValue, S extends Spec>(props: (LayoutProps<D, undefined, undefined, S> | ViewLayoutProps<T, S>) & Pick<SectionProps, "ignoreDescription">) => React.JSX.Element;
12
+ export declare const SectionWithSubtitle: <D extends FieldValue, T extends FormValue, S extends Spec>(props: (LayoutProps<D, undefined, undefined, S> | ViewLayoutProps<T, S>) & Pick<SectionProps, "ignoreDescription">) => React.JSX.Element;
13
+ export declare const SectionWithSubtitle2: <D extends FieldValue, T extends FormValue, S extends Spec>(props: (LayoutProps<D, undefined, undefined, S> | ViewLayoutProps<T, S>) & Pick<SectionProps, "ignoreDescription">) => React.JSX.Element;
14
+ export declare const Group: <D extends FieldValue, T extends FormValue, S extends Spec>(props: (LayoutProps<D, undefined, undefined, S> | ViewLayoutProps<T, S>) & Pick<SectionProps, "ignoreDescription">) => React.JSX.Element;
15
+ export declare const Group2: <D extends FieldValue, T extends FormValue, S extends Spec>(props: (LayoutProps<D, undefined, undefined, S> | ViewLayoutProps<T, S>) & Pick<SectionProps, "ignoreDescription">) => React.JSX.Element;
15
16
  export {};
@@ -1,2 +1,3 @@
1
+ import React from 'react';
1
2
  import type { FieldValue, LayoutProps, Spec } from '../../../../core';
2
- export declare const TableCell: <T extends FieldValue, S extends Spec<any, undefined, undefined>>({ name, meta, children, }: LayoutProps<T, undefined, undefined, S>) => JSX.Element;
3
+ export declare const TableCell: <T extends FieldValue, S extends Spec>({ name, meta, children, }: LayoutProps<T, undefined, undefined, S>) => React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { FieldValue, LayoutProps, Spec } from '../../../../core';
2
3
  import './Transparent.css';
3
- export declare const Transparent: <T extends FieldValue, S extends Spec<any, undefined, undefined>>({ name, spec, input, meta, children, }: LayoutProps<T, undefined, undefined, S>) => JSX.Element;
4
+ export declare const Transparent: <T extends FieldValue, S extends Spec>({ name, spec, input, meta, children, }: LayoutProps<T, undefined, undefined, S>) => React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  export type LazyLoaderProps = {
3
3
  component: React.LazyExoticComponent<React.ComponentType<any>>;
4
- initialFallback?: JSX.Element;
4
+ initialFallback?: React.JSX.Element;
5
5
  };
6
- export declare const LazyLoader: ({ component, initialFallback, }: LazyLoaderProps) => JSX.Element;
6
+ export declare const LazyLoader: ({ component, initialFallback, }: LazyLoaderProps) => React.JSX.Element;
@@ -30,12 +30,12 @@ export declare class SimpleVerticalAccordeon extends React.Component<SimpleVerti
30
30
  open: boolean;
31
31
  withBranchView: boolean;
32
32
  };
33
- componentRef: React.RefObject<HTMLDivElement>;
34
- titleRef: React.RefObject<HTMLElement>;
33
+ componentRef: React.RefObject<HTMLDivElement | null>;
34
+ titleRef: React.RefObject<HTMLElement | null>;
35
35
  constructor(props: SimpleVerticalAccordeonProps);
36
36
  componentDidUpdate(prevProps: Readonly<SimpleVerticalAccordeonProps>): void;
37
37
  componentDidMount(): void;
38
- render(): false | JSX.Element | null;
38
+ render(): false | React.JSX.Element | null;
39
39
  checkVisibility: () => void;
40
40
  private handleClick;
41
41
  private getTitle;
@@ -1,7 +1,8 @@
1
+ import React from 'react';
1
2
  import type { TextProps } from '@gravity-ui/uikit';
2
3
  import type { ArrayValue, ObjectValue, Spec, ViewLayoutProps } from '../../../../core';
3
4
  interface ViewAccordeonLayoutProps {
4
5
  variantTitle?: TextProps['variant'];
5
6
  }
6
- export declare const ViewAccordeon: <T extends ViewLayoutProps<ArrayValue | ObjectValue, Spec<any, any, ViewAccordeonLayoutProps>>>({ name, value, spec, children, }: T) => JSX.Element | null;
7
+ export declare const ViewAccordeon: <T extends ViewLayoutProps<ArrayValue | ObjectValue, Spec<any, any, ViewAccordeonLayoutProps>>>({ name, value, spec, children, }: T) => React.JSX.Element | null;
7
8
  export {};
@@ -1,2 +1,3 @@
1
+ import React from 'react';
1
2
  import type { ArrayViewLayoutProps, ObjectViewLayoutProps } from '../../../../core';
2
- export declare const ViewAccordeonCard: <T extends ArrayViewLayoutProps | ObjectViewLayoutProps>({ value, name, spec, children, }: T) => JSX.Element | null;
3
+ export declare const ViewAccordeonCard: <T extends ArrayViewLayoutProps | ObjectViewLayoutProps>({ value, name, spec, children, }: T) => React.JSX.Element | null;
@@ -1,2 +1,3 @@
1
+ import React from 'react';
1
2
  import type { ArrayViewLayoutProps, ObjectViewLayoutProps } from '../../../core';
2
- export declare const ViewCardAccordeon: <T extends ArrayViewLayoutProps | ObjectViewLayoutProps>({ name, value, spec, children, }: T) => JSX.Element | null;
3
+ export declare const ViewCardAccordeon: <T extends ArrayViewLayoutProps | ObjectViewLayoutProps>({ name, value, spec, children, }: T) => React.JSX.Element | null;
@@ -1,2 +1,3 @@
1
+ import React from 'react';
1
2
  import type { FormValue, Spec, ViewLayoutProps } from '../../../core';
2
- export declare const ViewCardSection: <T extends FormValue, S extends Spec<any, undefined, undefined>>({ name, value, spec, children, }: ViewLayoutProps<T, S>) => JSX.Element | null;
3
+ export declare const ViewCardSection: <T extends FormValue, S extends Spec>({ name, value, spec, children, }: ViewLayoutProps<T, S>) => React.JSX.Element | null;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { FormValue, Spec, ViewLayoutProps } from '../../../../core';
2
3
  import './ViewColumn.css';
3
- export declare const ViewColumn: <T extends FormValue, S extends Spec<any, undefined, undefined>>({ value, spec, children, }: ViewLayoutProps<T, S>) => JSX.Element | null;
4
+ export declare const ViewColumn: <T extends FormValue, S extends Spec>({ value, spec, children, }: ViewLayoutProps<T, S>) => React.JSX.Element | null;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { FormValue, Spec, ViewLayoutProps } from '../../../../core';
2
3
  import './ViewRow.css';
3
- export declare const ViewRow: <T extends FormValue, S extends Spec<any, undefined, undefined>>({ value, spec, children, }: ViewLayoutProps<T, S>) => JSX.Element | null;
4
+ export declare const ViewRow: <T extends FormValue, S extends Spec>({ value, spec, children, }: ViewLayoutProps<T, S>) => React.JSX.Element | null;
@@ -1,5 +1,6 @@
1
+ import React from 'react';
1
2
  import type { FormValue, Spec, ViewLayoutProps } from '../../../../core';
2
- export declare const ViewSection: <T extends FormValue, S extends Spec<any, undefined, undefined>>(props: ViewLayoutProps<T, S>) => JSX.Element | null;
3
- export declare const ViewSection2: <T extends FormValue, S extends Spec<any, undefined, undefined>>(props: ViewLayoutProps<T, S>) => JSX.Element | null;
4
- export declare const ViewGroup: <T extends FormValue, S extends Spec<any, undefined, undefined>>(props: ViewLayoutProps<T, S>) => JSX.Element | null;
5
- export declare const ViewGroup2: <T extends FormValue, S extends Spec<any, undefined, undefined>>(props: ViewLayoutProps<T, S>) => JSX.Element | null;
3
+ export declare const ViewSection: <T extends FormValue, S extends Spec>(props: ViewLayoutProps<T, S>) => React.JSX.Element | null;
4
+ export declare const ViewSection2: <T extends FormValue, S extends Spec>(props: ViewLayoutProps<T, S>) => React.JSX.Element | null;
5
+ export declare const ViewGroup: <T extends FormValue, S extends Spec>(props: ViewLayoutProps<T, S>) => React.JSX.Element | null;
6
+ export declare const ViewGroup2: <T extends FormValue, S extends Spec>(props: ViewLayoutProps<T, S>) => React.JSX.Element | null;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { FormValue, Spec, ViewLayoutProps } from '../../../../core';
2
3
  import './ViewTableCell.css';
3
- export declare const ViewTableCell: <T extends FormValue, S extends Spec<any, undefined, undefined>>({ value, spec, children, }: ViewLayoutProps<T, S>) => JSX.Element;
4
+ export declare const ViewTableCell: <T extends FormValue, S extends Spec>({ value, spec, children, }: ViewLayoutProps<T, S>) => React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { FormValue, Spec, ViewLayoutProps } from '../../../../core';
2
3
  import './ViewTransparent.css';
3
- export declare const ViewTransparent: <T extends FormValue, S extends Spec<any, undefined, undefined>>({ value, spec, children, }: ViewLayoutProps<T, S>) => JSX.Element | null;
4
+ export declare const ViewTransparent: <T extends FormValue, S extends Spec>({ value, spec, children, }: ViewLayoutProps<T, S>) => React.JSX.Element | null;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import type { BooleanViewProps, NumberViewProps, StringViewProps } from '../../../../core';
3
- export declare const BaseView: <T extends BooleanViewProps | NumberViewProps | StringViewProps>({ value, spec, linkValue, }: React.PropsWithChildren<T>) => JSX.Element;
3
+ export declare const BaseView: <T extends BooleanViewProps | NumberViewProps | StringViewProps>({ value, spec, linkValue, }: React.PropsWithChildren<T>) => React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { ObjectIndependentInputProps } from '../../../core';
2
3
  import './useOneOf.css';
3
4
  export interface UseOneOfParams {
@@ -7,6 +8,6 @@ export interface UseOneOfParams {
7
8
  export declare const useOneOf: ({ props, onTogglerChange }: UseOneOfParams) => {
8
9
  oneOfValue: string;
9
10
  specProperties: Record<string, import("../../../core").Spec<any, undefined, undefined>>;
10
- toggler: JSX.Element;
11
- togglerInput: JSX.Element;
11
+ toggler: React.JSX.Element;
12
+ togglerInput: React.JSX.Element;
12
13
  };
@@ -41,6 +41,8 @@
41
41
  "label_error-space-start": "Value must not start with a space",
42
42
  "label_error-zero-start": "Value must not start with a zero",
43
43
  "label_error-dot-end": "Value must not end with a dot",
44
+ "label_error-invalid-zero-format": "Invalid zero value format",
45
+ "label_error-zero-end": "Value must not end with a zero",
44
46
  "label_delete": "Delete",
45
47
  "button_cancel": "Close",
46
48
  "button-upload_file": "Upload file",
@@ -1,2 +1,2 @@
1
- declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
1
+ declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params) => string;
2
2
  export default _default;
@@ -41,6 +41,8 @@
41
41
  "label_error-space-start": "Значение не должно начинаться с пробела",
42
42
  "label_error-zero-start": "Значение не должно начинаться с нуля",
43
43
  "label_error-dot-end": "Значение не должно заканчиваться точкой",
44
+ "label_error-invalid-zero-format": "Неверный формат значения нуля",
45
+ "label_error-zero-end": "Значение не должно заканчиваться нулем",
44
46
  "label_delete": "Удалить",
45
47
  "button_cancel": "Закрыть",
46
48
  "button-upload_file": "Загрузить файл",
@@ -1,4 +1,4 @@
1
1
  import type { FormValue, Spec, StringSpec } from '../../core';
2
2
  export declare const isNotEmptyValue: (value: FormValue | undefined, spec: Spec | undefined) => boolean;
3
- export declare const prepareSpec: <Type extends Spec<any, undefined, undefined>>(spec: Type, parseJsonDefaultValue?: boolean, overridePatternError?: ((pattern?: string) => string) | undefined) => Type;
3
+ export declare const prepareSpec: <Type extends Spec>(spec: Type, parseJsonDefaultValue?: boolean, overridePatternError?: (pattern?: string) => string) => Type;
4
4
  export declare const isCorrectSizeParams: (spec: StringSpec) => boolean;
@@ -1,4 +1,4 @@
1
1
  import type { Spec } from '../../core';
2
2
  export declare const filterPropertiesForObjectInline: (properties: Record<string, Spec>) => {
3
- [k: string]: Spec<any, undefined, undefined>;
3
+ [k: string]: Spec;
4
4
  };
@@ -1,4 +1,4 @@
1
1
  type Dictionary<T> = Record<string, T>;
2
2
  type KeysOf<T> = T extends Dictionary<unknown> ? `${Exclude<keyof T, symbol>}` : never;
3
- export declare function objectKeys<T extends Dictionary<unknown>>(obj: T): KeysOf<T>[];
3
+ export declare function objectKeys<T extends Dictionary<unknown>>(obj: T): Array<KeysOf<T>>;
4
4
  export {};
@@ -27,6 +27,8 @@ const getErrorMessages = () => ({
27
27
  SPACE_END: i18n('label_error-space-end'),
28
28
  DOT_END: i18n('label_error-dot-end'),
29
29
  ZERO_START: i18n('label_error-zero-start'),
30
+ INVALID_ZERO_FORMAT: i18n('label_error-invalid-zero-format'),
31
+ ZERO_END: i18n('label_error-zero-end'),
30
32
  });
31
33
  export let ErrorMessages = getErrorMessages();
32
34
  subscribeConfigure(() => {
@@ -13,4 +13,6 @@ export interface ErrorMessagesType {
13
13
  SPACE_END: string;
14
14
  DOT_END: string;
15
15
  ZERO_START: string;
16
+ INVALID_ZERO_FORMAT: string;
17
+ ZERO_END: string;
16
18
  }
@@ -21,6 +21,8 @@ export interface GetNumberValidatorParams extends CommonValidatorParams {
21
21
  ignoreIntCheck?: boolean;
22
22
  ignoreDotEnd?: boolean;
23
23
  ignoreZeroStart?: boolean;
24
+ ignoreInvalidZeroFormat?: boolean;
25
+ ignoreZeroEnd?: boolean;
24
26
  }
25
27
  export declare const getNumberValidator: (params?: GetNumberValidatorParams) => (spec: NumberSpec, value?: string | number) => string | false;
26
28
  export interface GetObjectValidatorParams extends CommonValidatorParams {
@@ -35,7 +35,7 @@ export const getBooleanValidator = (params = {}) => {
35
35
  };
36
36
  };
37
37
  export const getNumberValidator = (params = {}) => {
38
- const { ignoreRequiredCheck, ignoreSpaceStartCheck, ignoreSpaceEndCheck, ignoreNumberCheck, ignoreMaximumCheck, ignoreMinimumCheck, ignoreIntCheck, ignoreDotEnd, ignoreZeroStart, customErrorMessages, } = params;
38
+ const { ignoreRequiredCheck, ignoreSpaceStartCheck, ignoreSpaceEndCheck, ignoreNumberCheck, ignoreMaximumCheck, ignoreMinimumCheck, ignoreIntCheck, ignoreDotEnd, ignoreZeroStart, ignoreInvalidZeroFormat, ignoreZeroEnd, customErrorMessages, } = params;
39
39
  // eslint-disable-next-line complexity
40
40
  return (spec, value = '') => {
41
41
  const errorMessages = Object.assign(Object.assign({}, ErrorMessages), customErrorMessages);
@@ -63,6 +63,16 @@ export const getNumberValidator = (params = {}) => {
63
63
  stringValue[2] !== '.'))) {
64
64
  return errorMessages.ZERO_START;
65
65
  }
66
+ if (!ignoreInvalidZeroFormat &&
67
+ stringValue.trim().length > 1 &&
68
+ Number(stringValue.trim()) === 0) {
69
+ return errorMessages.INVALID_ZERO_FORMAT;
70
+ }
71
+ if (!ignoreZeroEnd &&
72
+ !isInt(stringValue) &&
73
+ stringValue[stringValue.length - 1] === '0') {
74
+ return errorMessages.ZERO_END;
75
+ }
66
76
  }
67
77
  if (!ignoreMaximumCheck &&
68
78
  isNumber(spec.maximum) &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/dynamic-forms",
3
- "version": "5.9.2",
3
+ "version": "5.9.4",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "main": "build/cjs/index.js",
@@ -54,8 +54,8 @@
54
54
  "devDependencies": {
55
55
  "@babel/preset-env": "^7.20.2",
56
56
  "@babel/preset-typescript": "^7.18.6",
57
- "@commitlint/cli": "^17.0.0",
58
- "@commitlint/config-conventional": "^17.0.0",
57
+ "@commitlint/cli": "^20.1.0",
58
+ "@commitlint/config-conventional": "^20.0.0",
59
59
  "@gravity-ui/eslint-config": "^3.3.0",
60
60
  "@gravity-ui/prettier-config": "^1.1.0",
61
61
  "@gravity-ui/stylelint-config": "^4.0.1",
@@ -75,8 +75,8 @@
75
75
  "@testing-library/user-event": "^14.4.3",
76
76
  "@types/jest": "^29.5.0",
77
77
  "@types/lodash": "^4.14.180",
78
- "@types/react": "^18.0.28",
79
- "@types/react-dom": "^18.0.11",
78
+ "@types/react": "^19.0.0",
79
+ "@types/react-dom": "^19.0.0",
80
80
  "@types/react-is": "^17.0.3",
81
81
  "@types/uuid": "^9.0.4",
82
82
  "@vitejs/plugin-react": "^4.2.0",
@@ -99,10 +99,10 @@
99
99
  "postcss": "^8.4.19",
100
100
  "prettier": "^3.0.3",
101
101
  "randexp": "^0.5.3",
102
- "react": "^18.2.0",
103
- "react-dom": "^18.2.0",
102
+ "react": "^19.2.0",
103
+ "react-dom": "^19.2.0",
104
104
  "react-final-form": "^6.5.3",
105
- "react-is": "^18.2.0",
105
+ "react-is": "^19.2.0",
106
106
  "react-monaco-editor": "^0.46.0",
107
107
  "rimraf": "5.0.5",
108
108
  "sass": "^1.57.1",
@@ -112,16 +112,16 @@
112
112
  "stylelint": "^15.10.3",
113
113
  "stylelint-scss": "^5.1.0",
114
114
  "ts-jest": "^29.0.5",
115
- "typescript": "^4.9.5",
115
+ "typescript": "^5.8.4",
116
116
  "uuid": "^9.0.1"
117
117
  },
118
118
  "peerDependencies": {
119
119
  "@gravity-ui/uikit": "^7.0.0",
120
120
  "final-form": "^4.20.2",
121
- "react": "^16.0.0 || ^17.0.0 || ^18.0.0",
122
- "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0",
121
+ "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
122
+ "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
123
123
  "react-final-form": "^6.5.3",
124
- "react-is": "^16.0.0 || ^17.0.0 || ^18.0.0"
124
+ "react-is": "^17.0.0 || ^18.0.0 || ^19.0.0"
125
125
  },
126
126
  "nano-staged": {
127
127
  "*.{scss}": [