API reference for Angular Material list
import {MatListModule} from '@angular/material/list';
Directives
MatListOption
Selector: mat-list-option
Exported as: matListOptionProperties
Name | Description |
---|---|
@Input()
|
Theme color of the list option. This sets the color of the checkbox/radio. This API is supported in M2 themes only, it has no effect in M3 themes. For color customization in M3, see https://material.angular.io/components/list/styling. For information on applying color variants in M3, see https://material.angular.io/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants |
@Input()
|
Whether ripples for list items are disabled. |
@Input()
|
Whether the list-item is disabled. |
@Input()
|
The number of lines this list item should reserve space for. If not specified, lines are inferred based on the projected content. Explicitly specifying the number of lines is useful if you want to acquire additional space and enable the wrapping of text. The unscoped text content of a list item will always be able to take up the remaining space of the item, unless it represents the title. A maximum of three lines is supported as per the Material Design specification. |
@Input()
|
Whether the option is selected. |
@Input()
|
Whether the label should appear before or after the checkbox/radio. Defaults to 'after' |
@Input()
|
Value of the option |
@Input()
Deprecated
|
Whether the label should appear before or after the checkbox/radio. Defaults to 'after' |
Methods
focus | |
---|---|
Allows for programmatic focusing of the option. |
getLabel | |
---|---|
Gets the text label of the list option. Used for the typeahead functionality in the list. |
toggle | |
---|---|
Toggles the selection state of the option. |
MatActionList
Selector: mat-action-list
Exported as: matActionListProperties
Name | Description |
---|---|
@Input()
|
Whether ripples for all list items is disabled. |
@Input()
|
Whether the entire list is disabled. When disabled, the list itself and each of its list items are disabled. |
MatList
Selector: mat-list
Exported as: matListProperties
Name | Description |
---|---|
@Input()
|
Whether ripples for all list items is disabled. |
@Input()
|
Whether the entire list is disabled. When disabled, the list itself and each of its list items are disabled. |
MatListItem
Selector: mat-list-item a[mat-list-item] button[mat-list-item]
Exported as: matListItemProperties
Name | Description |
---|---|
@Input()
|
Indicates whether an item in a |
@Input()
|
Whether ripples for list items are disabled. |
@Input()
|
Whether the list-item is disabled. |
@Input()
|
The number of lines this list item should reserve space for. If not specified, lines are inferred based on the projected content. Explicitly specifying the number of lines is useful if you want to acquire additional space and enable the wrapping of text. The unscoped text content of a list item will always be able to take up the remaining space of the item, unless it represents the title. A maximum of three lines is supported as per the Material Design specification. |
MatNavList
Selector: mat-nav-list
Exported as: matNavListProperties
Name | Description |
---|---|
@Input()
|
Whether ripples for all list items is disabled. |
@Input()
|
Whether the entire list is disabled. When disabled, the list itself and each of its list items are disabled. |
MatSelectionList
Selector: mat-selection-list
Exported as: matSelectionListProperties
Name | Description |
---|---|
@Input()
|
Theme color of the selection list. This sets the checkbox color for all list options. This API is supported in M2 themes only, it has no effect in M3 themes. For color customization in M3, see https://material.angular.io/components/list/styling. For information on applying color variants in M3, see https://material.angular.io/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants |
@Input()
|
Function used for comparing an option against the selected value when determining which options should appear as selected. The first argument is the value of an options. The second one is a value from the selected value. A boolean must be returned. |
@Input()
|
Whether ripples for all list items is disabled. |
@Input()
|
Whether the entire selection list is disabled. When true, each list item is also disabled and each list item is removed from the tab order (has tabindex="-1"). |
@Input()
|
Whether radio indicator for all list items is hidden. |
@Input()
|
Whether selection is limited to one or multiple items (default multiple). |
@Output()
|
Emits a change event whenever the selected state of an option changes. |
|
The option components contained within this selection-list. |
|
The currently selected options. |
Methods
deselectAll | |
---|---|
Deselects all of the options. Returns the options that changed as a result. |
|
Returns | |
MatListOption[]
|
|
focus | |
---|---|
Focuses the selection list. |
|
Parameters | |
options? FocusOptions
|
|
selectAll | |
---|---|
Selects all of the options. Returns the options that changed as a result. |
|
Returns | |
MatListOption[]
|
|
MatListItemTitle
Directive capturing the title of a list item. A list item usually consists of a title and optional secondary or tertiary lines.
Text content for the title never wraps. There can only be a single title per list item.
Selector: [matListItemTitle]
MatListItemLine
Directive capturing a line in a list item. A list item usually consists of a title and optional secondary or tertiary lines.
Text content inside a line never wraps. There can be at maximum two lines per list item.
Selector: [matListItemLine]
MatListItemMeta
Directive matching an optional meta section for list items.
List items can reserve space at the end of an item to display a control, button or additional text content.
Selector: [matListItemMeta]
MatListItemAvatar
Directive matching an optional avatar within a list item.
List items can reserve space at the beginning of an item to display an avatar.
Selector: [matListItemAvatar]
MatListItemIcon
Directive matching an optional icon within a list item.
List items can reserve space at the beginning of an item to display an icon.
Selector: [matListItemIcon]
Classes
MatSelectionListChange
Change event that is being fired whenever the selected state of an option changes.
Properties
Name | Description |
---|---|
|
Reference to the options that have been changed. |
|
Reference to the selection list that emitted the event. |
Interfaces
MatListConfig
Object that can be used to configure the default options for the list module.
Properties
Name | Description |
---|---|
|
Whether icon indicators should be hidden for single-selection. |
Type aliases
MatListOptionTogglePosition
Type describing possible positions of a checkbox or radio in a list option with respect to the list item's text.
type MatListOptionTogglePosition = 'before' | 'after';
Constants
MAT_LIST
Injection token that can be used to inject instances of MatList
. It serves as
alternative token to the actual MatList
class which could cause unnecessary
retention of the class and its component metadata.
const MAT_LIST: InjectionToken<MatList>;
MAT_NAV_LIST
Injection token that can be used to inject instances of MatNavList
. It serves as
alternative token to the actual MatNavList
class which could cause unnecessary
retention of the class and its component metadata.
const MAT_NAV_LIST: InjectionToken<MatNavList>;
MAT_SELECTION_LIST_VALUE_ACCESSOR
const MAT_SELECTION_LIST_VALUE_ACCESSOR: any;
MAT_LIST_CONFIG
Injection token that can be used to provide the default options for the list module.
const MAT_LIST_CONFIG: InjectionToken<MatListConfig>;
API reference for Angular Material list-testing
import {MatSubheaderHarness} from '@angular/material/list/testing';
Classes
MatSubheaderHarness
extends
ComponentHarness
Harness for interacting with a list subheader.
Properties
Name | Description |
---|---|
|
Methods
async
getText
|
|
---|---|
Gets the full text content of the list item (including text from any font icons). |
|
Returns | |
Promise<string>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
static
with
|
|
---|---|
Parameters | |
options SubheaderHarnessFilters = {}
|
|
Returns | |
HarnessPredicate<MatSubheaderHarness>
|
|
MatActionListHarness
Harness for interacting with a action-list in tests.
Properties
Name | Description |
---|---|
|
The selector for the host element of a |
Methods
getItems | |
---|---|
Gets a list of harnesses representing the items in this list. |
|
Parameters | |
filters? F
|
Optional filters used to narrow which harnesses are included |
Returns | |
Promise<C[]>
|
The list of items matching the given filters. |
getItemsGroupedByDividers | |
---|---|
Gets a list of sub-lists representing the list items grouped by dividers. If the list has no dividers it is represented as a list with a single sub-list. |
|
Parameters | |
filters? F
|
Optional filters used to narrow which list item harnesses are included |
Returns | |
Promise<C[][]>
|
The list of items matching the given filters, grouped into sub-lists by divider. |
getItemsGroupedBySubheader | |
---|---|
Gets a list of |
|
Parameters | |
filters? F
|
Optional filters used to narrow which list item harnesses are included |
Returns | |
Promise<ListSection<C>[]>
|
The list of items matching the given filters, grouped into sections by subheader. |
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item: false; subheader: false; divider: false; }
|
|
Returns | |
Promise<[
]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item?: false | F; subheader: false; divider: false; }
|
|
Returns | |
Promise<C[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item: false; subheader?: false | SubheaderHarnessFilters; divider: false; }
|
|
Returns | |
Promise<MatSubheaderHarness[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item: false; subheader: false; divider?: false | DividerHarnessFilters; }
|
|
Returns | |
Promise<MatDividerHarness[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item?: false | F; subheader?: false | SubheaderHarnessFilters; divider: false; }
|
|
Returns | |
Promise<(C | MatSubheaderHarness)[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item?: false | F; subheader: false; divider?: false | DividerHarnessFilters; }
|
|
Returns | |
Promise<(C | MatDividerHarness)[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item: false; subheader?: false | SubheaderHarnessFilters; divider?: false | DividerHarnessFilters; }
|
|
Returns | |
Promise<(MatSubheaderHarness | MatDividerHarness)[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters? { item?: false | F; subheader?: false | SubheaderHarnessFilters; divider?: false | DividerHarnessFilters; }
|
|
Returns | |
Promise<(C | MatSubheaderHarness | MatDividerHarness)[]>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options ActionListHarnessFilters = {}
|
Options for filtering which action list instances are considered a match. |
Returns | |
HarnessPredicate<T>
|
a |
MatActionListItemHarness
Harness for interacting with an action list item.
Properties
Name | Description |
---|---|
|
The selector for the host element of a |
Methods
async
blur
|
|
---|---|
Blurs the action list item. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
click
|
|
---|---|
Clicks on the action list item. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
focus
|
|
---|---|
Focuses the action list item. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
getAllChildLoaders
|
|
---|---|
Parameters | |
selector S
|
|
Returns | |
Promise<HarnessLoader[]>
|
|
async
getAllHarnesses
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T[]>
|
|
async
getChildLoader
|
|
---|---|
Parameters | |
selector S
|
|
Returns | |
Promise<HarnessLoader>
|
|
getFullText | |
---|---|
Gets the full text content of the list item, excluding text from icons and avatars. |
|
Returns | |
Promise<string>
|
|
async
getHarness
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T>
|
|
async
getHarnessOrNull
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T | null>
|
|
getSecondaryText | |
---|---|
Gets the secondary line text of the list item. Null if the list item does not have a secondary line. |
|
Returns | |
Promise<string | null>
|
|
getTertiaryText | |
---|---|
Gets the tertiary line text of the list item. Null if the list item does not have a tertiary line. |
|
Returns | |
Promise<string | null>
|
|
getTitle | |
---|---|
Gets the title of the list item. |
|
Returns | |
Promise<string>
|
|
getType | |
---|---|
Gets the type of the list item, currently describing how many lines there are. |
|
Returns | |
Promise<MatListItemType>
|
|
hasAvatar | |
---|---|
Whether this list item has an avatar. |
|
Returns | |
Promise<boolean>
|
|
async
hasHarness
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<boolean>
|
|
hasIcon | |
---|---|
Whether this list item has an icon. |
|
Returns | |
Promise<boolean>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
isDisabled | |
---|---|
Whether the list item is disabled. |
|
Returns | |
Promise<boolean>
|
|
async
isFocused
|
|
---|---|
Whether the action list item is focused. |
|
Returns | |
Promise<boolean>
|
|
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options ActionListItemHarnessFilters = {}
|
Options for filtering which action list item instances are considered a match. |
Returns | |
HarnessPredicate<T>
|
a |
Deprecated
getText
|
|
---|---|
Gets the full text content of the list item, excluding text from icons and avatars. |
|
Returns | |
Promise<string>
|
|
MatListHarness
Harness for interacting with a list in tests.
Properties
Name | Description |
---|---|
|
The selector for the host element of a |
Methods
getItems | |
---|---|
Gets a list of harnesses representing the items in this list. |
|
Parameters | |
filters? F
|
Optional filters used to narrow which harnesses are included |
Returns | |
Promise<C[]>
|
The list of items matching the given filters. |
getItemsGroupedByDividers | |
---|---|
Gets a list of sub-lists representing the list items grouped by dividers. If the list has no dividers it is represented as a list with a single sub-list. |
|
Parameters | |
filters? F
|
Optional filters used to narrow which list item harnesses are included |
Returns | |
Promise<C[][]>
|
The list of items matching the given filters, grouped into sub-lists by divider. |
getItemsGroupedBySubheader | |
---|---|
Gets a list of |
|
Parameters | |
filters? F
|
Optional filters used to narrow which list item harnesses are included |
Returns | |
Promise<ListSection<C>[]>
|
The list of items matching the given filters, grouped into sections by subheader. |
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item: false; subheader: false; divider: false; }
|
|
Returns | |
Promise<[
]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item?: false | F; subheader: false; divider: false; }
|
|
Returns | |
Promise<C[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item: false; subheader?: false | SubheaderHarnessFilters; divider: false; }
|
|
Returns | |
Promise<MatSubheaderHarness[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item: false; subheader: false; divider?: false | DividerHarnessFilters; }
|
|
Returns | |
Promise<MatDividerHarness[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item?: false | F; subheader?: false | SubheaderHarnessFilters; divider: false; }
|
|
Returns | |
Promise<(C | MatSubheaderHarness)[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item?: false | F; subheader: false; divider?: false | DividerHarnessFilters; }
|
|
Returns | |
Promise<(C | MatDividerHarness)[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item: false; subheader?: false | SubheaderHarnessFilters; divider?: false | DividerHarnessFilters; }
|
|
Returns | |
Promise<(MatSubheaderHarness | MatDividerHarness)[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters? { item?: false | F; subheader?: false | SubheaderHarnessFilters; divider?: false | DividerHarnessFilters; }
|
|
Returns | |
Promise<(C | MatSubheaderHarness | MatDividerHarness)[]>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options ListHarnessFilters = {}
|
Options for filtering which list instances are considered a match. |
Returns | |
HarnessPredicate<T>
|
a |
MatListItemHarness
Harness for interacting with a list item.
Properties
Name | Description |
---|---|
|
The selector for the host element of a |
Methods
async
getAllChildLoaders
|
|
---|---|
Parameters | |
selector S
|
|
Returns | |
Promise<HarnessLoader[]>
|
|
async
getAllHarnesses
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T[]>
|
|
async
getChildLoader
|
|
---|---|
Parameters | |
selector S
|
|
Returns | |
Promise<HarnessLoader>
|
|
getFullText | |
---|---|
Gets the full text content of the list item, excluding text from icons and avatars. |
|
Returns | |
Promise<string>
|
|
async
getHarness
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T>
|
|
async
getHarnessOrNull
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T | null>
|
|
getSecondaryText | |
---|---|
Gets the secondary line text of the list item. Null if the list item does not have a secondary line. |
|
Returns | |
Promise<string | null>
|
|
getTertiaryText | |
---|---|
Gets the tertiary line text of the list item. Null if the list item does not have a tertiary line. |
|
Returns | |
Promise<string | null>
|
|
getTitle | |
---|---|
Gets the title of the list item. |
|
Returns | |
Promise<string>
|
|
getType | |
---|---|
Gets the type of the list item, currently describing how many lines there are. |
|
Returns | |
Promise<MatListItemType>
|
|
hasAvatar | |
---|---|
Whether this list item has an avatar. |
|
Returns | |
Promise<boolean>
|
|
async
hasHarness
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<boolean>
|
|
hasIcon | |
---|---|
Whether this list item has an icon. |
|
Returns | |
Promise<boolean>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
isDisabled | |
---|---|
Whether the list item is disabled. |
|
Returns | |
Promise<boolean>
|
|
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options ListItemHarnessFilters = {}
|
Options for filtering which list item instances are considered a match. |
Returns | |
HarnessPredicate<T>
|
a |
Deprecated
getText
|
|
---|---|
Gets the full text content of the list item, excluding text from icons and avatars. |
|
Returns | |
Promise<string>
|
|
MatNavListHarness
Harness for interacting with a mat-nav-list in tests.
Properties
Name | Description |
---|---|
|
The selector for the host element of a |
Methods
getItems | |
---|---|
Gets a list of harnesses representing the items in this list. |
|
Parameters | |
filters? F
|
Optional filters used to narrow which harnesses are included |
Returns | |
Promise<C[]>
|
The list of items matching the given filters. |
getItemsGroupedByDividers | |
---|---|
Gets a list of sub-lists representing the list items grouped by dividers. If the list has no dividers it is represented as a list with a single sub-list. |
|
Parameters | |
filters? F
|
Optional filters used to narrow which list item harnesses are included |
Returns | |
Promise<C[][]>
|
The list of items matching the given filters, grouped into sub-lists by divider. |
getItemsGroupedBySubheader | |
---|---|
Gets a list of |
|
Parameters | |
filters? F
|
Optional filters used to narrow which list item harnesses are included |
Returns | |
Promise<ListSection<C>[]>
|
The list of items matching the given filters, grouped into sections by subheader. |
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item: false; subheader: false; divider: false; }
|
|
Returns | |
Promise<[
]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item?: false | F; subheader: false; divider: false; }
|
|
Returns | |
Promise<C[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item: false; subheader?: false | SubheaderHarnessFilters; divider: false; }
|
|
Returns | |
Promise<MatSubheaderHarness[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item: false; subheader: false; divider?: false | DividerHarnessFilters; }
|
|
Returns | |
Promise<MatDividerHarness[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item?: false | F; subheader?: false | SubheaderHarnessFilters; divider: false; }
|
|
Returns | |
Promise<(C | MatSubheaderHarness)[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item?: false | F; subheader: false; divider?: false | DividerHarnessFilters; }
|
|
Returns | |
Promise<(C | MatDividerHarness)[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item: false; subheader?: false | SubheaderHarnessFilters; divider?: false | DividerHarnessFilters; }
|
|
Returns | |
Promise<(MatSubheaderHarness | MatDividerHarness)[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters? { item?: false | F; subheader?: false | SubheaderHarnessFilters; divider?: false | DividerHarnessFilters; }
|
|
Returns | |
Promise<(C | MatSubheaderHarness | MatDividerHarness)[]>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options NavListHarnessFilters = {}
|
Options for filtering which nav list instances are considered a match. |
Returns | |
HarnessPredicate<T>
|
a |
MatNavListItemHarness
Harness for interacting with a nav-list item.
Properties
Name | Description |
---|---|
|
The selector for the host element of a |
Methods
async
blur
|
|
---|---|
Blurs the nav list item. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
click
|
|
---|---|
Clicks on the nav list item. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
focus
|
|
---|---|
Focuses the nav list item. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
getAllChildLoaders
|
|
---|---|
Parameters | |
selector S
|
|
Returns | |
Promise<HarnessLoader[]>
|
|
async
getAllHarnesses
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T[]>
|
|
async
getChildLoader
|
|
---|---|
Parameters | |
selector S
|
|
Returns | |
Promise<HarnessLoader>
|
|
getFullText | |
---|---|
Gets the full text content of the list item, excluding text from icons and avatars. |
|
Returns | |
Promise<string>
|
|
async
getHarness
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T>
|
|
async
getHarnessOrNull
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T | null>
|
|
async
getHref
|
|
---|---|
Gets the href for this nav list item. |
|
Returns | |
Promise<string | null>
|
|
getSecondaryText | |
---|---|
Gets the secondary line text of the list item. Null if the list item does not have a secondary line. |
|
Returns | |
Promise<string | null>
|
|
getTertiaryText | |
---|---|
Gets the tertiary line text of the list item. Null if the list item does not have a tertiary line. |
|
Returns | |
Promise<string | null>
|
|
getTitle | |
---|---|
Gets the title of the list item. |
|
Returns | |
Promise<string>
|
|
getType | |
---|---|
Gets the type of the list item, currently describing how many lines there are. |
|
Returns | |
Promise<MatListItemType>
|
|
hasAvatar | |
---|---|
Whether this list item has an avatar. |
|
Returns | |
Promise<boolean>
|
|
async
hasHarness
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<boolean>
|
|
hasIcon | |
---|---|
Whether this list item has an icon. |
|
Returns | |
Promise<boolean>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
isActivated
|
|
---|---|
Whether the list item is activated. Should only be used for nav list items. |
|
Returns | |
Promise<boolean>
|
|
isDisabled | |
---|---|
Whether the list item is disabled. |
|
Returns | |
Promise<boolean>
|
|
async
isFocused
|
|
---|---|
Whether the nav list item is focused. |
|
Returns | |
Promise<boolean>
|
|
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options NavListItemHarnessFilters = {}
|
Options for filtering which nav list item instances are considered a match. |
Returns | |
HarnessPredicate<T>
|
a |
Deprecated
getText
|
|
---|---|
Gets the full text content of the list item, excluding text from icons and avatars. |
|
Returns | |
Promise<string>
|
|
MatSelectionListHarness
Harness for interacting with a selection-list in tests.
Properties
Name | Description |
---|---|
|
The selector for the host element of a |
Methods
async
deselectItems
|
|
---|---|
Deselects all items matching any of the given filters. |
|
Parameters | |
filters
|
Filters that specify which items should be deselected. |
...filters ListItemHarnessFilters[]
|
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
getItems | |
---|---|
Gets a list of harnesses representing the items in this list. |
|
Parameters | |
filters? F
|
Optional filters used to narrow which harnesses are included |
Returns | |
Promise<C[]>
|
The list of items matching the given filters. |
getItemsGroupedByDividers | |
---|---|
Gets a list of sub-lists representing the list items grouped by dividers. If the list has no dividers it is represented as a list with a single sub-list. |
|
Parameters | |
filters? F
|
Optional filters used to narrow which list item harnesses are included |
Returns | |
Promise<C[][]>
|
The list of items matching the given filters, grouped into sub-lists by divider. |
getItemsGroupedBySubheader | |
---|---|
Gets a list of |
|
Parameters | |
filters? F
|
Optional filters used to narrow which list item harnesses are included |
Returns | |
Promise<ListSection<C>[]>
|
The list of items matching the given filters, grouped into sections by subheader. |
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item: false; subheader: false; divider: false; }
|
|
Returns | |
Promise<[
]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item?: false | F; subheader: false; divider: false; }
|
|
Returns | |
Promise<C[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item: false; subheader?: false | SubheaderHarnessFilters; divider: false; }
|
|
Returns | |
Promise<MatSubheaderHarness[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item: false; subheader: false; divider?: false | DividerHarnessFilters; }
|
|
Returns | |
Promise<MatDividerHarness[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item?: false | F; subheader?: false | SubheaderHarnessFilters; divider: false; }
|
|
Returns | |
Promise<(C | MatSubheaderHarness)[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item?: false | F; subheader: false; divider?: false | DividerHarnessFilters; }
|
|
Returns | |
Promise<(C | MatDividerHarness)[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters { item: false; subheader?: false | SubheaderHarnessFilters; divider?: false | DividerHarnessFilters; }
|
|
Returns | |
Promise<(MatSubheaderHarness | MatDividerHarness)[]>
|
|
getItemsWithSubheadersAndDividers | |
---|---|
Parameters | |
filters? { item?: false | F; subheader?: false | SubheaderHarnessFilters; divider?: false | DividerHarnessFilters; }
|
|
Returns | |
Promise<(C | MatSubheaderHarness | MatDividerHarness)[]>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
isDisabled
|
|
---|---|
Whether the selection list is disabled. |
|
Returns | |
Promise<boolean>
|
|
async
selectItems
|
|
---|---|
Selects all items matching any of the given filters. |
|
Parameters | |
filters
|
Filters that specify which items should be selected. |
...filters ListOptionHarnessFilters[]
|
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options SelectionListHarnessFilters = {}
|
Options for filtering which selection list instances are considered a match. |
Returns | |
HarnessPredicate<T>
|
a |
MatListOptionHarness
Harness for interacting with a list option.
Properties
Name | Description |
---|---|
|
The selector for the host element of a |
Methods
async
blur
|
|
---|---|
Blurs the list option. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
deselect
|
|
---|---|
Puts the list option in an unchecked state by toggling it if it is currently checked, or doing nothing if it is already unchecked. |
async
focus
|
|
---|---|
Focuses the list option. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
getAllChildLoaders
|
|
---|---|
Parameters | |
selector S
|
|
Returns | |
Promise<HarnessLoader[]>
|
|
async
getAllHarnesses
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T[]>
|
|
async
getCheckboxPosition
|
|
---|---|
Gets the position of the checkbox relative to the list option content. |
|
Returns | |
Promise<MatListOptionTogglePosition>
|
|
async
getChildLoader
|
|
---|---|
Parameters | |
selector S
|
|
Returns | |
Promise<HarnessLoader>
|
|
getFullText | |
---|---|
Gets the full text content of the list item, excluding text from icons and avatars. |
|
Returns | |
Promise<string>
|
|
async
getHarness
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T>
|
|
async
getHarnessOrNull
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T | null>
|
|
async
getRadioPosition
|
|
---|---|
Gets the position of the radio relative to the list option content. |
|
Returns | |
Promise<MatListOptionTogglePosition>
|
|
getSecondaryText | |
---|---|
Gets the secondary line text of the list item. Null if the list item does not have a secondary line. |
|
Returns | |
Promise<string | null>
|
|
getTertiaryText | |
---|---|
Gets the tertiary line text of the list item. Null if the list item does not have a tertiary line. |
|
Returns | |
Promise<string | null>
|
|
getTitle | |
---|---|
Gets the title of the list item. |
|
Returns | |
Promise<string>
|
|
getType | |
---|---|
Gets the type of the list item, currently describing how many lines there are. |
|
Returns | |
Promise<MatListItemType>
|
|
hasAvatar | |
---|---|
Whether this list item has an avatar. |
|
Returns | |
Promise<boolean>
|
|
async
hasHarness
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<boolean>
|
|
hasIcon | |
---|---|
Whether this list item has an icon. |
|
Returns | |
Promise<boolean>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
isDisabled | |
---|---|
Whether the list item is disabled. |
|
Returns | |
Promise<boolean>
|
|
async
isFocused
|
|
---|---|
Whether the list option is focused. |
|
Returns | |
Promise<boolean>
|
|
async
isSelected
|
|
---|---|
Whether the list option is selected. |
|
Returns | |
Promise<boolean>
|
|
async
select
|
|
---|---|
Puts the list option in a checked state by toggling it if it is currently unchecked, or doing nothing if it is already checked. |
async
toggle
|
|
---|---|
Toggles the checked state of the checkbox. |
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options ListOptionHarnessFilters = {}
|
Options for filtering which list option instances are considered a match. |
Returns | |
HarnessPredicate<T>
|
a |
Deprecated
getText
|
|
---|---|
Gets the full text content of the list item, excluding text from icons and avatars. |
|
Returns | |
Promise<string>
|
|
Interfaces
ListHarnessFilters
ActionListHarnessFilters
NavListHarnessFilters
SelectionListHarnessFilters
BaseListItemHarnessFilters
Properties
Name | Description |
---|---|
|
|
|
|
|
|
|
|
Deprecated
|
ListItemHarnessFilters
ActionListItemHarnessFilters
NavListItemHarnessFilters
Properties
Name | Description |
---|---|
|
|
|
ListOptionHarnessFilters
Properties
Name | Description |
---|---|
|
SubheaderHarnessFilters
Properties
Name | Description |
---|---|
|