Commit d3972095 by Vladislav Lagunov

Исправлена ошибка в Zoom

parent b12dd411
......@@ -15,7 +15,7 @@ export type Props = StandardProps<React.HTMLProps<HTMLDivElement>, string> & {
const zoomOnChange = memoize((path: ObjectKey[], onChange: ((x: any, at: ObjectPath) => void)|undefined) => {
return (next, at=[]) => {
onChange && onChange(next, [...at, ...path]);
onChange && onChange(next, [...path, ...at]);
};
})
......
import * as React from 'react';
import { AuthCtx as Ctx } from '~/context';
import { I18nString } from '@bitmaster/utils/gettext';
import { I18nString } from '~/gettext';
import { ObjectPath } from '~/utils';
import * as gettext from '~/gettext';
const hoistNonReactStatics = require('hoist-non-react-statics');
......@@ -14,7 +13,7 @@ export interface FieldProps<Value=any> {
ctx?: Ctx;
value?: Value;
disabled?: Disabled;
error?: Error;
error?: Error|Validation<any>;
FieldWrapper?: React.ComponentType;
onValueChange?(value: Value, at?: ObjectPath): void;
onFocus?(e?: React.SyntheticEvent): void;
......@@ -72,4 +71,7 @@ export type Disabled = boolean|DisabledRecord;
export interface ErrorRecord {
[K: string]: Error;
}
export type Error = boolean|I18nString|string|ErrorRecord|gettext.I18nString;
export type Error = boolean|string|ErrorRecord|I18nString;
export type Validation<A> = Partial<Record<keyof A, Error>>;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment