diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9703fd0..27ca5d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ on: push: branches: - main - - release-v* + - release/v* jobs: release: diff --git a/src/dialog/Dialog/Dialog.tsx b/src/dialog/Dialog/Dialog.tsx index afdfa5a..492124c 100644 --- a/src/dialog/Dialog/Dialog.tsx +++ b/src/dialog/Dialog/Dialog.tsx @@ -56,8 +56,8 @@ import {CollapsibleSection} from '../CollapsibleSection/CollapsibleSection'; const bDialog = dfCN('dialog'); const bPage = dfCN('page-dialog'); -function composeValidators(...validators: Array>) { - return async (value: T, allValues: object | undefined, state?: FieldState) => { +function composeValidators(...validators: Array>) { + return async (value: T, allValues: FormValuesT, state?: FieldState) => { for (const validate of validators) { try { const res = await validate(value, allValues, state); @@ -179,7 +179,7 @@ export interface ControlField< tooltip?: React.ReactNode; warning?: React.ReactNode; - validator?: ValidatorType; + validator?: ValidatorType; validateFields?: string[]; subscribers?: Updates; diff --git a/src/dialog/types.ts b/src/dialog/types.ts index 9b1534f..b7fb375 100644 --- a/src/dialog/types.ts +++ b/src/dialog/types.ts @@ -1,8 +1,8 @@ import type {FieldState} from 'final-form'; -export type ValidatorType = ( +export type ValidatorType = ( value: T, - allValues?: Record, + allValues?: FormValues, fieldState?: FieldState, ) => PromiseOrValue; @@ -23,7 +23,7 @@ export interface ControlStaticApi { isEmpty?: (value: V) => boolean; getDefaultValue: () => V; hasErrorRenderer?: boolean; - validate?: ValidatorType; + validate?: ValidatorType; format?: (value: V, name: string) => any; isEqual?: (a: V, b: V) => boolean; diff --git a/src/stories/dialog/register/RegisterControls.stories.tsx b/src/stories/dialog/register/RegisterControls.stories.tsx index c881269..7f1cabd 100644 --- a/src/stories/dialog/register/RegisterControls.stories.tsx +++ b/src/stories/dialog/register/RegisterControls.stories.tsx @@ -87,7 +87,7 @@ function Demo() { '\n isEmpty?: (value: V) => boolean;' + '\n getDefaultValue: () => V;' + '\n hasErrorRenderer?: boolean;' + - '\n validate?: ValidatorType;' + + '\n validate?: ValidatorType;' + '\n format?: (value: V, name: string) => any;' + '\n }\n\n'}