Skip to content

Commit

Permalink
EuiFieldPassword: converted to Typescript (#2683)
Browse files Browse the repository at this point in the history
* Converts EuiFieldPassword to Typescript

* Adds PR number

* Implements suggestion form the PR's review
  • Loading branch information
ffknob authored and thompsongl committed Dec 18, 2019
1 parent 0b9e6bd commit 68a7f27
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 42 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Converted `EuiFieldPassword` to Typescript ([#2683](https://github.com/elastic/eui/pull/2683))
- Converted `EuiHighlight` to Typescript ([#2681](https://github.com/elastic/eui/pull/2681))
- Converted `EuiTextArea` to Typescript ([#2695](https://github.com/elastic/eui/pull/2695))
- Converted `EuiPage` and related child components to TypeScript ([#2669](https://github.com/elastic/eui/pull/2669))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import React from 'react';
import PropTypes from 'prop-types';
import React, { InputHTMLAttributes, Ref, FunctionComponent } from 'react';
import { CommonProps } from '../../common';
import classNames from 'classnames';

import { EuiFormControlLayout } from '../form_control_layout';

import { EuiValidatableControl } from '../validatable_control';

export const EuiFieldPassword = ({
export type EuiFieldPasswordProps = InputHTMLAttributes<HTMLInputElement> &
CommonProps & {
isInvalid?: boolean;
fullWidth?: boolean;
isLoading?: boolean;
compressed?: boolean;
inputRef?: Ref<HTMLInputElement>;
};

export const EuiFieldPassword: FunctionComponent<EuiFieldPasswordProps> = ({
className,
id,
name,
Expand Down Expand Up @@ -51,21 +60,6 @@ export const EuiFieldPassword = ({
);
};

EuiFieldPassword.propTypes = {
name: PropTypes.string,
id: PropTypes.string,
placeholder: PropTypes.string,
value: PropTypes.string,
isInvalid: PropTypes.bool,
fullWidth: PropTypes.bool,
inputRef: PropTypes.func,
isLoading: PropTypes.bool,
/**
* when `true` creates a shorter height input
*/
compressed: PropTypes.bool,
};

EuiFieldPassword.defaultProps = {
value: undefined,
fullWidth: false,
Expand Down
22 changes: 0 additions & 22 deletions src/components/form/field_password/index.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/components/form/field_password/index.js

This file was deleted.

1 change: 1 addition & 0 deletions src/components/form/field_password/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { EuiFieldPassword, EuiFieldPasswordProps } from './field_password';
1 change: 0 additions & 1 deletion src/components/form/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { CommonProps } from '../common';
/// <reference path="./field_number/index.d.ts" />
/// <reference path="./field_password/index.d.ts" />
/// <reference path="./field_search/index.d.ts" />
/// <reference path="./field_text/index.d.ts" />
/// <reference path="./form_row/index.d.ts" />
Expand Down

0 comments on commit 68a7f27

Please sign in to comment.