Skip to content

Commit 1f16de0

Browse files
committed
v2.0.0-beta.8
1 parent 0c00e79 commit 1f16de0

11 files changed

+566
-484
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file. Dates are d
44

55
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
66

7+
#### [v2.0.0-beta.7](https://github.com/formsy/formsy-react/compare/v2.0.0-beta.6...v2.0.0-beta.7)
8+
9+
> 14 December 2019
10+
11+
- Dependabot Automatic Library Bumps [`#305`](https://github.com/formsy/formsy-react/pull/305)
12+
- Updated API.md to make emphasis in the double quote validation argument [`#304`](https://github.com/formsy/formsy-react/pull/304)
13+
- Fix wrapper unregister on unmount. [`#282`](https://github.com/formsy/formsy-react/pull/282)
14+
- Fix wrapper unregister on unmount. (#282) [`#261`](https://github.com/formsy/formsy-react/issues/261)
15+
716
#### [v2.0.0-beta.6](https://github.com/formsy/formsy-react/compare/v2.0.0-beta.5...v2.0.0-beta.6)
817

918
> 28 October 2019

dist/Wrapper.d.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3-
import { Validations, RequiredValidation, Value } from './interfaces';
3+
import { RequiredValidation, Validations } from './interfaces';
44
declare const propTypes: {
55
innerRef: PropTypes.Requireable<(...args: any[]) => any>;
66
name: PropTypes.Validator<string>;
77
required: PropTypes.Requireable<string | boolean | object>;
88
validations: PropTypes.Requireable<string | object>;
99
value: PropTypes.Requireable<any>;
1010
};
11-
export interface WrapperProps {
11+
export interface WrapperProps<V> {
1212
innerRef?: (ref: any) => void;
1313
name: string;
14-
required?: RequiredValidation;
14+
required?: RequiredValidation<V>;
1515
validationError?: any;
1616
validationErrors?: any;
17-
validations?: Validations | string;
18-
value?: Value;
17+
validations?: Validations<V>;
18+
value?: V;
1919
}
20-
export interface WrapperState {
20+
export interface WrapperState<V> {
2121
[key: string]: unknown;
2222
externalError: null;
2323
formSubmitted: boolean;
@@ -26,9 +26,9 @@ export interface WrapperState {
2626
isValid: boolean;
2727
pristineValue: any;
2828
validationError: any[];
29-
value: any;
29+
value: V;
3030
}
31-
export interface PassDownProps extends WrapperProps {
31+
export interface InjectedProps<V> {
3232
errorMessage: any;
3333
errorMessages: any;
3434
hasValue: boolean;
@@ -37,13 +37,14 @@ export interface PassDownProps extends WrapperProps {
3737
isPristine: boolean;
3838
isRequired: boolean;
3939
isValid: boolean;
40-
isValidValue: (value: Value) => boolean;
40+
isValidValue: (value: V) => boolean;
4141
ref?: any;
4242
resetValue: any;
4343
setValidations: any;
44-
setValue: (value: Value) => void;
44+
setValue: (value: V) => void;
4545
showError: boolean;
4646
showRequired: boolean;
4747
}
48+
export declare type PassDownProps<V> = WrapperProps<V> & InjectedProps<V>;
4849
export { propTypes };
49-
export default function <T>(WrappedComponent: React.ComponentType<T & PassDownProps>): React.ComponentType<T & WrapperProps>;
50+
export default function <T, V>(WrappedComponent: React.ComponentType<T & PassDownProps<V>>): React.ComponentType<Omit<T & WrapperProps<V>, keyof InjectedProps<V>>>;

0 commit comments

Comments
 (0)