mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
[@types/react-material-ui-form-validator 2.0.9] Added missing SelectValidator export. (#39396)
* Added missing export for SelectValidator * fixed linting errors * added ValidatorComponent definition * changed indentention of props to make it more readable
This commit is contained in:
committed by
Jesse Trinity
parent
db42458e8a
commit
5e724a89a8
+5
-4
@@ -5,8 +5,8 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.1
|
||||
|
||||
import * as React from "react";
|
||||
import { TextFieldProps } from "material-ui";
|
||||
import * as React from 'react';
|
||||
import { SelectFieldProps, TextFieldProps } from 'material-ui';
|
||||
|
||||
export interface ValidatorFormProps {
|
||||
className?: string;
|
||||
@@ -32,5 +32,6 @@ export interface ValidatorComponentProps {
|
||||
withRequiredValidator?: boolean;
|
||||
[key: string]: any;
|
||||
}
|
||||
export class ValidatorComponent extends React.Component<ValidatorComponentProps & TextFieldProps> {}
|
||||
export class TextValidator extends ValidatorComponent {}
|
||||
export class ValidatorComponent extends React.Component<ValidatorComponentProps> {}
|
||||
export class TextValidator extends React.Component<ValidatorComponentProps & TextFieldProps> {}
|
||||
export class SelectValidator extends React.Component<ValidatorComponentProps & SelectFieldProps> {}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import * as React from 'react';
|
||||
import {
|
||||
SelectValidator,
|
||||
TextValidator,
|
||||
ValidatorComponent,
|
||||
ValidatorForm
|
||||
} from 'react-material-ui-form-validator';
|
||||
import { MenuItem } from 'material-ui';
|
||||
|
||||
class Test extends React.Component {
|
||||
onSubmitted = (event: React.FormEvent) => {
|
||||
@@ -36,6 +38,18 @@ class Test extends React.Component {
|
||||
validatorListener={this.onValidate}
|
||||
withRequiredValidator={true}
|
||||
/>
|
||||
<SelectValidator
|
||||
errorMessages={['Field is required']}
|
||||
validators={['required']}
|
||||
name={'Field'}
|
||||
value={'option1'}
|
||||
validatorListener={this.onValidate}
|
||||
withRequiredValidator={true}
|
||||
>
|
||||
<MenuItem value="option1">Option1</MenuItem>
|
||||
<MenuItem value="option2">Option2</MenuItem>
|
||||
<MenuItem value="option3">Option3</MenuItem>
|
||||
</SelectValidator>
|
||||
<TextValidator
|
||||
name="textValidator"
|
||||
value="value"
|
||||
|
||||
Reference in New Issue
Block a user