MaterialInputComponent class
material-input
is a single- or multi-line text field where user can enter
input. It can optionally have a label.
NOTE: Clients must declare materialInputDirectives in their directives list
instead of MaterialInputComponent.
Attributes:
type
-- The type of the input. Defaults to "text". Other supported values are "email", "password", "url", "number", "tel", and "search". (Inputs of type "number" also use materialNumberInputDirectives)multiple
-- Whether the user can enter multiple values, separated by commas. This attribute only applies when type = "email", otherwise it is ignored.role
-- The role attribute for the input element.
- Inheritance
-
- Object
- FocusableMixin
- BaseMaterialInput
- BaseSingleLineInputComponent
- MaterialInputComponent
- Implemented types
- Annotations
-
- @Component(selector: 'material-input:not(material-input[multiline])', changeDetection: ChangeDetectionStrategy.onPush, providers: [DeferredValidator, ExistingProvider.forToken(NG_VALIDATORS, DeferredValidator), ExistingProvider(ReferenceDirective, MaterialInputComponent), ExistingProvider(Focusable, MaterialInputComponent), ExistingProvider(HasDisabled, MaterialInputComponent), ExistingProvider(BaseMaterialInput, MaterialInputComponent)], templateUrl: 'material_input.html', styleUrls: ['material_input.scss.css'], directives: [DefaultValueAccessor, FocusableDirective, MaterialIconComponent, NgFor, NgIf, NgModel, NgSwitch, NgSwitchWhen], visibility: Visibility.all)
Constructors
- MaterialInputComponent(@Attribute('type') String? type, @Attribute('multiple') String? multiple, @Self() @Optional() NgControl? cd, ChangeDetectorRef changeDetector, DeferredValidator validator)
Properties
- ariaDescribedBy ↔ String?
-
Controls the aria-describedby attribute on the input element.
getter/setter pairinherited
- ariaLabel → String?
-
no setterinherited
- bottomPanelState ↔ BottomPanelState
-
Controls what section of the BottomPanel is displayed.
getter/setter pairinherited
- characterCounter ← Function?
-
A custom character counter function.
no getterinherited
- checkValid ↔ ValidityCheck
-
getter/setter pairinherited
- disabled ↔ bool
-
Whether or not this input is disabled (readonly input.)
getter/setter pairinherited
- displayBottomPanel ↔ bool
-
Whether to display error, hint text, and character counter panel.
getter/setter pairinherited
- elementRef → Element?
-
Container element for popup positioning.
no setterinherited
- emptyState → BottomPanelState
-
Template accessors for the BottomPanelState
finalinherited
- error ↔ String?
-
Error to be displayed.
getter/setter pairinherited
- errorMessage → String?
-
no setterinherited
- errorMsg ↔ String?
-
The error msg to be shown on the input if it has more than maxCount
characters.
getter/setter pairinherited
- errorRenderer ↔ ErrorFn?
-
A function which takes in an error map, and returns another map, replacing
errors with human readable text.
getter/setter pairinherited
- errorState → BottomPanelState
-
finalinherited
- errorTextId → String
-
finalinherited
- floatingLabel ↔ bool
-
Whether or not the label "floats".
getter/setter pairinherited
- floatingLabelVisible → bool
-
Whether the floating label is visible.
no setterinherited
- focusable ← Focusable?
-
no getterinherited
- focused ↔ bool
-
Whether the input box is focused.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasLeadingGlyph → bool
-
no setterinherited
- hasLeadingText → bool
-
no setterinherited
- hasTrailingGlyph → bool
-
no setterinherited
- hasTrailingText → bool
-
no setterinherited
- hasVisibleText → bool
-
no setterinherited
- hintState → BottomPanelState
-
finalinherited
- hintText ↔ String?
-
The hint to be shown on the input.
getter/setter pairinherited
- inputAriaActivedescendent ↔ String?
-
The ID of an element which should be assigned to the inner input element's
aria-activedescendant attribute.
getter/setter pairinherited
- inputAriaAutocomplete ↔ String?
-
The autocomplete method applied to the inner input element.
getter/setter pairinherited
- inputAriaControls ↔ String?
-
The ID of an element which should be assigned to the inner input element's
aria-controls attribute.
getter/setter pairinherited
- inputAriaDescribedBy ← String
-
The ID of an element which should be assigned to the inner input element's
aria-describedby attribute.
no getterinherited
- inputAriaExpanded ↔ bool?
-
Whether or not the expandable element referred to by inputAriaOwns is
currently visible.
getter/setter pairinherited
- inputAriaHasPopup ↔ String?
-
The value for the input element's aria-haspopup attribute, indicating that
the element referred to by inputAriaOwns is expandable.
getter/setter pairinherited
- inputAriaLabel ↔ String?
-
The label to be used for assistive technologies.
getter/setter pairinherited
- inputAriaOwns ↔ String?
-
The ID of an element which should be assigned to the inner input element's
aria-owns attribute.
getter/setter pairinherited
- inputAutocomplete ↔ String?
-
The autocomplete attribute for the inner input element.
getter/setter pairinherited
- inputEl ↔ HtmlElement?
-
getter/setter pairinherited
- inputRef → HtmlElement?
-
The underlying element.
no setterinherited
- inputTabIndex → int
-
Input element tabindex.
no setterinherited
- inputText ↔ String
-
getter/setter pairinherited
- inputTextLength → int
-
no setterinherited
- invalid → bool
-
no setterinherited
- label ↔ String?
-
The label for this input.
getter/setter pairinherited
- labelAnimated → bool
-
Whether the floating label is animated to float above the input box.
no setterinherited
- labelAnimationReset → bool
-
Whether to reverse the animation of the label floating above.
no setterinherited
- labelId → String?
-
no setterinherited
- labelVisible → bool
-
no setterinherited
- leadingGlyph ↔ String?
-
Any symbol to show at the leading edge of the input -- e.g. a URL link
icon or similar.
getter/setter pairinherited
- leadingGlyphAriaLabel ↔ String?
-
Aria label used for the leading glyph.
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
- maxCount ↔ int
-
Maximum allowed characters for character counting input box.
getter/setter pairinherited
- multiple ↔ bool
-
Whether the user can enter multiple values, separated by commas.
getter/setter pairinherited
- numeric → bool
-
no setterinherited
-
onBlur
→ Stream<
FocusEvent> -
Publishes events when a blur event is fired.
no setterinherited
-
onChange
→ Stream<
String?> -
Publishes events when a change event is fired. (On enter, or on blur.)
no setterinherited
-
onFocus
→ Stream<
FocusEvent> -
Event when the element is focused.
no setterinherited
-
onKeypress
→ Stream<
String> -
Publishes events whenever input text changes (each keypress).
no setterinherited
- popupSourceEl ↔ Element?
-
getter/setter pairinherited
- 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
- role ↔ String?
-
The role to assign to the inner input element.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showCharacterCount ↔ bool
-
Display character count even if maxCount is null.
getter/setter pairinherited
- showHintOnlyOnFocus ↔ bool
-
Whether or not the hint text will be displayed when the input is not
focused.
getter/setter pairinherited
- trailingGlyph ↔ String?
-
Any symbol to show at the trailing edge of the input -- e.g. a URL link
icon or similar.
getter/setter pairinherited
- trailingGlyphAriaLabel ↔ String?
-
Aria label used for the trailing glyph.
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
- type ↔ String?
-
Type of input.
getter/setter pairinherited
- underlineAnimated → bool
-
Whether underline of the input box is animated.
no setterinherited
- useNativeValidation ↔ bool
-
Enable native validation (e.g. for type="url").
getter/setter pairinherited
Methods
-
attributeToString(
Object? value) → String? -
call(
AbstractControl _) → Map< String, dynamic> ? -
inherited
-
focus(
) → void -
Item/component focuses itself
inherited
-
handleChange(
Event? event, InputElement? element) → void -
inherited
-
handleFocus(
FocusEvent event) → void -
inherited
-
inputBlurAction(
dynamic event, dynamic valid, dynamic validationMessage) → void -
inherited
-
inputChange(
dynamic newValue, dynamic valid, dynamic validationMessage) → void -
inherited
-
inputFocusAction(
dynamic event) → void -
inherited
-
inputKeypress(
dynamic newValue, dynamic valid, dynamic validationMessage) → void -
inherited
-
msgCharacterCounter(
int currentCount, int? maxCount) → String -
The message to display when character counter is shown.
inherited
-
msgCharacterCounterAriaLabel(
int currentCount, int? maxCount) → String -
The aria label to use for the character limit label.
inherited
-
ngAfterViewInit(
) → void -
inherited
-
ngOnDestroy(
) → void -
Executed before the directive is removed from the DOM and destroyed.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
selectAll(
) → void -
Selects all of the input's content.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateBottomPanelState(
) → void -
inherited
-
updateInputTextLength(
) → void -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- hostClass → const String
- hostTabIndex → const int