Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Do not import constants from @material/textfield internals #639

Merged
merged 2 commits into from
Jan 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/text-field/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import * as React from 'react';
import * as classnames from 'classnames';
// @ts-ignore no .d.ts file
import {MDCTextFieldFoundation} from '@material/textfield/dist/mdc.textfield';
// @ts-ignore no .d.ts file
import {VALIDATION_ATTR_WHITELIST} from '@material/textfield/constants';

export interface InputProps<T> {
className: string;
Expand Down Expand Up @@ -58,6 +56,11 @@ declare type ValidationAttrWhiteList =
declare type ValidationAttrWhiteListReact =
Exclude<ValidationAttrWhiteList, 'minlength' | 'maxlength'> | 'minLength' | 'maxLength';

const VALIDATION_ATTR_WHITELIST: ValidationAttrWhiteList[] = [
'pattern', 'min', 'max', 'required', 'step', 'minlength', 'maxlength',
];


export default class Input<T extends {}> extends React.Component<
Props<T>, InputState
> {
Expand Down