UNPKG

@massds/mayflower-react

Version:

React versions of Mayflower design system UI components

76 lines (75 loc) 2.81 kB
/** * InputTextFuzzy module. * @module @massds/mayflower-react/InputTextFuzzy * @requires module:@massds/mayflower-assets/scss/01-atoms/input-typeahead * @requires module:@massds/mayflower-assets/scss/01-atoms/input-fuzzy * @requires module:@massds/mayflower-assets/scss/01-atoms/helper-text */ import React from 'react'; export interface InputTextFuzzyProps { /** The id of the typeahead element. */ id: string; /** The label text above the input text box. */ label?: string; /** The placeholder text to appear in the input text box. */ placeholder?: string; /** Style the input with a box outline. */ boxed?: boolean; /** The keys within options that will be searched (part of fuseOptions). * https://fusejs.io/api/options.html#keys */ keys: string | object[]; /** An array of objects representing all searchable values. */ options: object[]; /** Any Fusejs options to override the default options set in this component. * API doc: https://fusejs.io/api/options.html * */ fuseOptions?: object; /** Disables input. */ disabled?: boolean; /** Function that runs after changes to the input happen. */ onChange?(...args: unknown[]): unknown; onFocus?(...args: unknown[]): unknown; onBlur?(...args: unknown[]): unknown; /** Function that runs after a suggestion has been clicked. */ onSuggestionClick?(...args: unknown[]): unknown; /** Custom keydown callback */ onKeyDown?(...args: unknown[]): unknown; /** The default value for the select box. */ selected?: string; /** The id of the the input tag */ inputId?: string; /** By default all options will be rendered as suggestions on input focus */ renderDefaultSuggestion?: boolean; /** Focus on typeahead input */ autoFocusInput?: boolean; } declare class InputTextFuzzy extends React.Component<InputTextFuzzyProps> { constructor(props: any); onSuggestionsFetchRequested: ({ value }: { value: any; }) => void; onSuggestionsClearRequested: () => void; onSuggestionSelected: (event: any, { suggestion, method }: { suggestion: any; method: any; }) => void; getSuggestionValue: (suggestion: any) => any; handleChange: (event: any, { newValue, method }: { newValue: any; method: any; }) => void; handleBlur: (event: any) => void; handleKeyPress: (event: any) => void; handleFocus: (event: any) => void; optionsToSuggestions: (options: any) => any; shouldRenderSuggestions: (value: any) => boolean; renderItem: (suggestion: any) => any; renderItemsContainer: ({ children, containerProps }: { children: any; containerProps: any; }) => any; render(): any; } export default InputTextFuzzy;