MaterialAutoSuggestInputComponent<T> class

See material_auto_suggest_input.md for an overview of the component. See examples for usage.

Inheritance
Implemented types
Mixed-in types
Annotations
  • @Component(selector: 'material-auto-suggest-input', providers: [ExistingProvider(HasDisabled, MaterialAutoSuggestInputComponent), ExistingProvider(HasRenderer, MaterialAutoSuggestInputComponent), ExistingProvider(SelectionContainer, MaterialAutoSuggestInputComponent), ExistingProvider(HighlightProvider, MaterialAutoSuggestInputComponent), ExistingProvider(DropdownHandle, MaterialAutoSuggestInputComponent), ExistingProvider(HasFactoryRenderer, MaterialAutoSuggestInputComponent), ExistingProvider(Focusable, MaterialAutoSuggestInputComponent), ExistingProvider(PopupSizeProvider, MaterialAutoSuggestInputComponent)], directives: [ActiveItemDirective, ButtonDirective, CachingDeferredContentDirective, DynamicComponent, FocusTrapComponent, KeyboardOnlyFocusIndicatorDirective, MaterialIconComponent, materialInputDirectives, MaterialListComponent, MaterialSelectDropdownItemComponent, MaterialPopupComponent, MaterialSpinnerComponent, MaterialTooltipDirective, PopupSourceDirective, NgFor, NgIf, StopPropagationDirective], directiveTypes: [Typed<MaterialSelectDropdownItemComponent<String>>(on: 'emptyLabel'), Typed<MaterialSelectDropdownItemComponent>.of([#T])], templateUrl: 'material_auto_suggest_input.html', styleUrls: ['material_auto_suggest_input.scss.css', 'material_input_wrapper.scss.css'], visibility: Visibility.all)

Constructors

MaterialAutoSuggestInputComponent(@Optional() @Self() NgControl? cd, @Optional() IdGenerator? idGenerator, ChangeDetectorRef changeDetector, @Optional() @SkipSelf() PopupSizeProvider? popupSizeDelegate)
factory
MaterialAutoSuggestInputComponent.protected(NgControl? _cd, IdGenerator idGenerator, ChangeDetectorRef _changeDetector, [PopupSizeProvider? _popupSizeDelegate])

Properties

accessibleItemActivation bool
Whether suggestions should be smartly activated / highlighted.
getter/setter pair
activeModel ActiveItemModel<T?>
Keeps track of the item matching the filter as the suggestions are being updated.
final
ariaLabel String
The label to use for assistive technology.
getter/setter pairinherited
autoDismiss bool?
getter/setter pairoverride
characterCounter CharacterCounter
A custom character counter function.
getter/setter pairinherited
checkValid ValidityCheck
getter/setter pairinherited
clearIconTooltip String
Tooltip shown on clear icon.
getter/setter pair
closeOnActivate bool
Whether to cause dropdown to be closed on activation.
getter/setter pair
closeOnEnter bool
Whether to close on enter even for string non matching options.
getter/setter pair
constrainToViewport bool
Whether to clamp the popup position so that it never goes offscreen.
getter/setter pair
deselectOnActivate bool
Whether to deselect a selected item on click or keyboard enter.
no setter
disabled bool
Whether this input is disabled.
getter/setter pairinherited
displayBottomPanel bool
Whether to display error, hint text, and character counter panel.
getter/setter pairinherited
emptyPlaceholder String
Text to show if the options list is empty and not loading.
getter/setter pair
enforceSpaceConstraints bool
Whether the popup should automatically reposition itself based on space available relative to the viewport.
getter/setter pair
error String
Error to be displayed.
getter/setter pairinherited
errorText String?
no setter
factoryRenderer FactoryRenderer<RendersValue, T>?
Specifies the componentRenderer to use to determine the component for rendering an item. Specifies the factoryRenderer to use to determine the factory for rendering an item.
getter/setter pairoverride
filterSuggestions bool
Allow filtering of suggestions as the user is typing.
getter/setter pair
floatingLabel bool
Whether or not the label "floats".
getter/setter pairinherited
hasClearIconTooltip bool
no setter
hasCustomLabelRenderer bool
no setter
hashCode int
The hash code for this object.
no setterinherited
hasOptions bool
no setter
hideCheckbox bool
Whether to hide the checkbox before the selection item for multi-select.
getter/setter pair
highlightComponentRenderer ComponentRenderer<RendersValue, dynamic>
finalinherited
highlightFactoryRenderer FactoryRenderer<RendersValue, dynamic>
finalinherited
highlightMatchFromStartOfWord bool
Whether matches should only highlight at the start of words.
no getterinherited
highlightOptions bool
Whether to highlight options. Default value is true.
getter/setter pair
highlightQuery String
The query to highlight.
no setterinherited
highlightRenderer ItemRenderer<T>?
no setterinherited
hintText String
The hint to be shown on the input.
getter/setter pairinherited
input MaterialInputComponent?
no getter
inputAutocomplete String
The autocomplete attribute for the inner input element.
getter/setter pair
inputId String
final
inputText String
Filters suggestion list according to input.
getter/setter pairoverride
isMultiSelect bool
no setterinherited
isRtl bool?
Whether the direction of the component is RTL.
getter/setter pairinherited
isSingleSelect bool
no setterinherited
itemRenderer ItemRenderer<T>?
A simple function to render the an item to string. @override
getter/setter pairinherited-getteroverride-setter
label String
The label to use on the input.
getter/setter pairinherited
labelFactory FactoryRenderer<RendersValue, dynamic>?
Custom factory for rendering suggestion labels.
getter/setter pair
leadingGlyph String
Any persistent glyph to show before the input box.
getter/setter pairinherited
leadingText String
Any text to show at the leading edge of the input -- e.g. a currency symbol or similar.
getter/setter pairinherited
limit ← dynamic
How many suggestions to show.
no getter
loading bool
When turned on and no suggestions available, show loading indicator in the suggestions dropdown.
getter/setter pair
maxCount int
Maximum allowed characters for character counting input box.
getter/setter pairinherited
onBlur Stream<void>
Fired when this component loses focus.
no setter
onClear Stream<void>
Fired when the close icon is clicked.
no setter
onFocus Stream<FocusEvent>
Fired when the input gains focus.
no setter
onInputBlur Stream<void>
Fired when the nested MaterialInputComponent fires a blur event.
no setter
optionHighlighter Highlighter?
Function which returns a list of HighlightedTextSegment for the given query and value.
getter/setter pairinherited
options SelectionOptions<T>
The available options for this container.
getter/setter pairinherited-getteroverride-setter
optionsInput ← dynamic
Sets the available options for the selection component.
no getteroverride
popupId String
final
popupMatchInputWidth bool
Whether or not the suggestion popup width is at least as wide as the input width.
getter/setter pair
popupPositions List<RelativePosition>
List of positions to try and draw the suggest popup.
getter/setter pair
popupShadowCssClass String
A custom CSS class for suggestion popup contents.
getter/setter pair
required bool
Whether or not the input is required.
getter/setter pairinherited
requiredErrorMsg String
Custom error message to show when the field is required and blank.
getter/setter pairinherited
rightAlign bool
Whether the input contents should be always right aligned.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selection SelectionModel<T>
The selection model this container represents.
getter/setter pairinherited-getteroverride-setter
selectionChange Stream
Emits the selected value(s) whenever selection changes.
no setterinherited
selectionInput ← dynamic
Sets the selected value or selection model for the selection component.
no getterinherited
shouldClearInputOnSelection bool
Whether to clear the input text once the item is selected from the menu.
getter/setter pair
shouldClearSelectionOnInput bool
Whether to clear the selected value from the selection model when the input text changes.
getter/setter pair
showClearIcon bool
Show or hide the trailing close icon.
getter/setter pair
showEmptyPlaceholder bool
no setter
showHintOnlyOnFocus bool
Whether or not the hint text will be displayed when the input is not focused.
getter/setter pairinherited
showLoadingSpinner bool
no setter
showPopup bool
Used to control the visibility of the suggestion popup.
getter/setter pair
showPopupChange Stream<bool>
Publishes event when the showPopup changes.
no setter
slide String?
Direction of popup scaling.
getter/setter pair
textChanged Stream<String>
Publishes events when input text changes (on keypress.)
no setter
trackByIndexFn → TrackByFn
Function for use by NgFor for optionGroup to avoid recreating the DOM for the optionGroup.
final
trailingGlyph String
Any persistent glyph to show at the end of the input box.
getter/setter pairinherited
trailingText String
Any text to show at the trailing edge of the input -- e.g. a currency symbol or similar.
getter/setter pairinherited
visibleSuggestionGroups List<OptionGroup>
The suggestions that match the current input text.
no setter
width int
Preset width, 1 through 5. By default, width #0 is used. Each width multiplies the base block width (64px on desktop and tablet) by 1.5, 3, 5, 6, 7, respectively to obtain a predictable width. Set to 0 to have the list expand to fit its content. Note: The spec clearly lays out predefined list sizes so use the default, expanding size, sparingly.
getter/setter pairinherited

Methods

attributeToString(Object? value) String?
call(dynamic _) → dynamic
Act as a validator. TODO(google): Please don't add validation support this way.
close() → void
override
emitSelectionChange() → void
inherited
focus() → void
Item/component focuses itself
override
getMaxHeight(num positionY, num viewportHeight) num
The max height.
override
getMaxWidth(num positionX, num viewportWidth) num
The max width.
override
getMinHeight(num positionY, num viewportHeight) num
The min height.
override
getMinWidth(num positionX, num viewportWidth) num
The min width.
override
handleBackspaceKey(KeyboardEvent event) → void
Return focus to the textbox and delete a character.
override
handleBlur(FocusEvent event) → void
handleChange(String newValue) → void
handleCharCodeKey(KeyboardEvent event) → void
inherited
handleClick(Event event) → void
handleDeleteKey(KeyboardEvent event) → void
inherited
handleDownKey(KeyboardEvent event) → void
override
handleEndKey(KeyboardEvent event) → void
inherited
handleEnterKey(KeyboardEvent event) → void
override
handleEscapeKey(KeyboardEvent event) → void
inherited
handleFocus(FocusEvent event) → void
handleHomeKey(KeyboardEvent event) → void
inherited
handleLeftKey(KeyboardEvent event) → void
inherited
handlePageDown(KeyboardEvent event) → void
override
handlePageUp(KeyboardEvent event) → void
override
handleRightKey(KeyboardEvent event) → void
inherited
handleSpaceKey(KeyboardEvent event) → void
Toggle an active list item in multi-select comboboxes.
override
handleUpKey(KeyboardEvent event) → void
override
highlightOption(Object? item) List<HighlightedTextSegment>
inherited
isOptionDisabled(T? item) bool
An option is disabled if the options implements Selectable, but the item is not selectable.
isOptionHidden(T item) bool
Whether an option is hidden.
ngAfterChanges() → void
ngOnDestroy() → void
Executed before the directive is removed from the DOM and destroyed.
ngOnInit() → void
Executed after the first change detection run for a directive.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onClearIcon() → void
onDisabledChanged(bool? isDisabled) → void
This function is called when the control status changes to or from "DISABLED".
onKeyDown(KeyboardEvent event) → void
Keydown callback used to handle arrow keys.
inherited
onKeyPress(KeyboardEvent event) → void
Keypress callback used to handle enter and space keys.
inherited
onKeyUp(KeyboardEvent event) → void
Keyup callback used to handle escape keys.
inherited
onListItemSelected(dynamic item) → void
open() → void
override
registerOnChange(InputChangeCallback? callback) → void
Set the function to be called when the control receives a change event.
registerOnTouched(TouchFunction _) → void
Set the function to be called when the control is touched.
toggle() → void
override
toString() String
A string representation of this object.
inherited
writeValue(Object newValue) → void
Write a new value to the element.

Operators

operator ==(Object other) bool
The equality operator.
inherited