Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extended EuiFieldText in EuiSuggestInput #4452

Merged
merged 13 commits into from
Jan 28, 2021
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Added `getDefaultEuiMarkdownProcessingPlugins` method for better control over `EuiMarkdownEditor`'s toolbar UI ([#4383](https://github.com/elastic/eui/pull/4383))
- Changed `EuiOutsideClickDetector` events to be standard event types ([#4434](https://github.com/elastic/eui/pull/4434))
- Added `EuiFieldTextProps` in type definitions for better suggestions ([#4452](https://github.com/elastic/eui/pull/4452))
cchaos marked this conversation as resolved.
Show resolved Hide resolved

**Bug fixes**

Expand Down
35 changes: 18 additions & 17 deletions src/components/suggest/suggest_input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,33 @@
import React, { useState, FunctionComponent } from 'react';
import { CommonProps } from '../common';
import classNames from 'classnames';
import { EuiFieldText } from '../form';
import { EuiFieldText, EuiFieldTextProps } from '../form';
import { EuiToolTip } from '../tool_tip';
import { EuiIcon } from '../icon';
import { EuiInputPopover } from '../popover';
import { EuiSuggestItemProps } from './suggest_item';

export type EuiSuggestInputProps = CommonProps & {
tooltipContent?: string;
export type EuiSuggestInputProps = CommonProps &
EuiFieldTextProps & {
tooltipContent?: string;

/**
* Status of the current query 'unsaved', 'saved', 'unchanged' or 'loading'.
*/
status?: 'unsaved' | 'saved' | 'unchanged' | 'loading';
/**
* Status of the current query 'unsaved', 'saved', 'unchanged' or 'loading'.
*/
status?: 'unsaved' | 'saved' | 'unchanged' | 'loading';

/**
* Element to be appended to the input bar.
*/
append?: JSX.Element;
/**
* Element to be appended to the input bar.
*/
append?: JSX.Element;

/**
* List of suggestions to display using 'suggestItem'.
*/
suggestions: JSX.Element[] | EuiSuggestItemProps[];
/**
* List of suggestions to display using 'suggestItem'.
*/
suggestions: JSX.Element[] | EuiSuggestItemProps[];

sendValue?: Function;
};
sendValue?: Function;
};

interface Status {
icon?: string;
Expand Down