react-autosuggest

change theme to allow inline styles
This commit is contained in:
cwmoo740 2017-10-26 13:38:50 -04:00
parent 0fca415085
commit e030d2140c
2 changed files with 8 additions and 17 deletions

View File

@ -9,6 +9,7 @@
// TypeScript Version: 2.3
import * as React from 'react';
declare class Autosuggest extends React.Component<Autosuggest.AutosuggestProps> {}
export = Autosuggest;
@ -57,22 +58,11 @@ declare namespace Autosuggest {
method: 'click' | 'enter';
}
interface Theme {
container?: string;
containerOpen?: string;
input?: string;
inputOpen?: string;
inputFocused?: string;
suggestionsContainer?: string;
suggestionsContainerOpen?: string;
suggestionsList?: string;
suggestion?: string;
suggestionFirst?: string;
suggestionHighlighted?: string;
sectionContainer?: string;
sectionContainerFirst?: string;
sectionTitle?: string;
}
type ThemeKey = 'container' | 'containerOpen' | 'input' | 'inputOpen' | 'inputFocused' | 'suggestionsContainer' |
'suggestionsContainerOpen' | 'suggestionsList' | 'suggestion' | 'suggestionFirst' | 'suggestionHighlighted' |
'sectionContainer' | 'sectionContainerFirst' | 'sectionTitle';
type Theme = Partial<Record<ThemeKey, string | React.CSSProperties>>;
interface AutosuggestProps extends React.Props<Autosuggest> {
suggestions: any[];

View File

@ -85,7 +85,8 @@ export class ReactAutosuggestBasicTest extends React.Component<any, any> {
const theme = {
input: 'themed-input-class',
container: 'themed-container-class',
suggestionFocused: 'active'
suggestionFocused: 'active',
sectionTitle: { color: 'blue' }
};
return <Autosuggest