id
stringlengths
6
6
text
stringlengths
20
17.2k
title
stringclasses
1 value
112789
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>YarnPnpCompat</title> <base href="/"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="preconnect" href="https://fonts.gstatic.com"> <link href="htt...
112791
@use '@angular/material' as mat; $primary: mat.m2-define-palette(mat.$m2-blue-palette); $accent: mat.m2-define-palette(mat.$m2-grey-palette); $theme: mat.m2-define-light-theme(( color: (primary: $primary, accent: $accent), typography: mat.m2-define-typography-config(), density: 0 )); @include mat.all-component-...
112793
/** * This file includes polyfills needed by Angular and is loaded before the app. * You can add your own extra polyfills to this file. * * This file is divided into 2 sections: * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. * 2. Application imports. Files imported...
112796
import {NgModule} from '@angular/core'; import {BrowserModule} from '@angular/platform-browser'; import {MatButtonModule} from '@angular/material/button'; import {AppComponent} from './app.component'; import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; @NgModule({ declarations: [AppCompone...
112803
# Customizing Angular Material component styles Angular Material supports customizing component styles via Sass API as described in the [theming guide][]. This document provides guidance on defining custom CSS rules that directly style Angular Material components. [theming guide]: https://material.angular.io/guide/th...
112804
# Installation and Code Generation Angular Material comes packaged with Angular CLI schematics to make creating Material applications easier. ## Install Schematics Schematics are included with both `@angular/cdk` and `@angular/material`. Once you install the npm packages, they will be available through the Angular C...
112806
# Theme your own components with Angular Material's theming system You can use Angular Material's Sass-based theming system for your own custom components. **Note: The information on this page is specific to Material 3, for Material 2 information on how to theme your components see the [Material 2 guide][material-2]....
112807
## Step-by-step example To illustrate participation in Angular Material's theming system, we can look at an example of a custom carousel component. The carousel starts with a single file, `carousel.scss`, that contains structural, color, and typography styles. This file is included in the `styleUrls` of the component....
112808
# Getting Started with Angular Material This guide explains how to set up your Angular project to begin using Angular Material. It includes information on prerequisites, installing Angular Material, and optionally displaying a sample Material component in your application to verify your setup. This guide assumes that...
112809
# Theming Angular Material ## What is theming? Angular Material's theming system lets you customize base, color, typography, and density styles for components in your application. The theming system is based on Google's [Material Design 3][material-design-theming] specification which is the latest iteration of Google...
112810
#### Applying a theme to components The `core-theme` Sass mixin emits prerequisite styles for common features used by multiple components, such as ripples. This mixin must be included once per theme. Each Angular Material component has a mixin for each [theming dimension](#theming-dimensions): base, color, typography...
112811
### Granular customizations with CSS custom properties The CSS custom properties emitted by the theme mixins are derived from [M3's design tokens](https://m3.material.io/foundations/design-tokens/overview). To further customize your UI beyond the `define-theme` API, you can manually set these custom properties in your...
112814
# Theming Angular Material 2 ## What is theming? Angular Material's theming system lets you customize base, color, typography, and density styles for components in your application. The theming system is based on Google's [Material Design 2][material-design-theming] specification. **This guide refers to Material 2, ...
112815
## Themes A **theme** is a collection of color, typography, and density options. Each theme includes three palettes that determine component colors: * A **primary** palette for the color that appears most frequently throughout your application * An **accent**, or _secondary_, palette used to selectively highlight key...
112818
## Theming your components ### Reading values from a theme As described in this guide, a theme is a Sass map that contains style values to customize components. Angular Material provides APIs for reading values from this data structure. #### Reading color values To read color values from a theme, you can use the `g...
112821
## How to migrate an app from Material 2 to Material 3 Angular Material does not offer an automated migration from M2 to M3 because the design of your app is subjective. Material Design offers general principles and constraints to guide you, but ultimately it is up to you to decide how to apply those in your app. That...
112826
### Implementing the methods and properties of MatFormFieldControl #### `value` This property allows someone to set or get the value of our control. Its type should be the same type we used for the type parameter when we implemented `MatFormFieldControl`. Since our component already has a value property, we don't nee...
112987
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {inject, Injectable, PLATFORM_ID} from '@angular/core'; import {isPlatformBrowser} from '@angular/common'; /...
113233
The `@angular/cdk/menu` module provides directives to help create custom menu interactions based on the [WAI ARIA specification][aria]. By using `@angular/cdk/menu` you get all of the expected behaviors for an accessible experience, including bidi layout support, keyboard interaction, and focus management. All directi...
113234
### Menu Items The `cdkMenuItem` directive allows users to navigate menu items via keyboard. You can add a custom action to a menu item with the `cdkMenuItemTriggered` output. <!-- example({"example":"cdk-menu-standalone-stateful-menu", "file":"cdk-menu-standalone-stateful-menu-example.html", ...
113497
import {Component, ElementRef, ViewChild} from '@angular/core'; import { ComponentFixture, TestBed, fakeAsync, inject, tick, waitForAsync, } from '@angular/core/testing'; import {ContentObserver, MutationObserverFactory, ObserversModule} from './observe-content'; describe('Observe content directive', () =>...
113862
getPlaybackRate(): number { if (this._player) { return this._player.getPlaybackRate(); } if (this._pendingPlayerState && this._pendingPlayerState.playbackRate != null) { return this._pendingPlayerState.playbackRate; } return 0; } /** See https://developers.google.com/youtube/ifram...
113979
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Angular Material</title> <base href="/"> <link rel="preconnect" href="https://fonts.gstatic.com"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" r...
113986
@use '@angular/material' as mat; $theme: mat.define-theme(( color: ( theme-type: light, primary: mat.$azure-palette, tertiary: mat.$blue-palette, ), density: ( scale: 0, ) )); html { @include mat.all-component-themes($theme); } @include mat.typography-hierarchy($theme);
114314
import {Component} from '@angular/core'; import {DataSource} from '@angular/cdk/collections'; import {NgForm, FormsModule} from '@angular/forms'; import {MatIconModule} from '@angular/material/icon'; import {MatButtonModule} from '@angular/material/button'; import {MatInputModule} from '@angular/material/input'; import...
114536
<mat-autocomplete #autocomplete="matAutocomplete"> @for (state of states; track state) { <mat-option [value]="state.code">{{ state.name }}</mat-option> } </mat-autocomplete> <input id="plain" [matAutocomplete]="autocomplete"> <input id="disabled" disabled [matAutocomplete]="autocomplete">
114539
Control value: {{myControl.value || 'empty'}} <form class="example-form"> <mat-form-field class="example-full-width"> <mat-label>Number</mat-label> <input #input type="text" placeholder="Pick one" matInput [formControl]="myControl" [matAutocomplete]="aut...
114622
import {Component} from '@angular/core'; import {MatInputModule} from '@angular/material/input'; import {MatFormFieldModule} from '@angular/material/form-field'; import {FormsModule} from '@angular/forms'; /** * @title Inputs in a form */ @Component({ selector: 'input-form-example', templateUrl: 'input-form-exam...
114690
import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/core'; import {FormControl, FormsModule, ReactiveFormsModule} from '@angular/forms'; import {provideMomentDateAdapter} from '@angular/material-moment-adapter'; import {MatDatepicker, MatDatepickerModule} from '@angular/material/datepicker'; ...
114704
import {ChangeDetectionStrategy, Component} from '@angular/core'; import {FormControl, FormsModule, ReactiveFormsModule} from '@angular/forms'; import {provideMomentDateAdapter} from '@angular/material-moment-adapter'; import {MatDatepickerModule} from '@angular/material/datepicker'; import {MatFormFieldModule} from '@...
114951
import {Component} from '@angular/core'; import {MatTableModule} from '@angular/material/table'; export interface PeriodicElement { name: string; position: number; weight: number; symbol: string; } const ELEMENT_DATA: PeriodicElement[] = [ {position: 1, name: 'Hydrogen', weight: 1.0079, symbol: 'H'}, {pos...
114954
import {HttpClient} from '@angular/common/http'; import {Component, ViewChild, AfterViewInit, inject} from '@angular/core'; import {MatPaginator, MatPaginatorModule} from '@angular/material/paginator'; import {MatSort, MatSortModule, SortDirection} from '@angular/material/sort'; import {merge, Observable, of as observa...
114979
import {AfterViewInit, Component, ViewChild} from '@angular/core'; import {MatPaginator, MatPaginatorModule} from '@angular/material/paginator'; import {MatSort, MatSortModule} from '@angular/material/sort'; import {MatTableDataSource, MatTableModule} from '@angular/material/table'; import {MatInputModule} from '@angul...
114999
<form [formGroup]="form"> <mat-selection-list #shoesList [formControl]="shoesControl" name="shoes" [multiple]="false"> @for (shoe of shoes; track shoe) { <mat-list-option [value]="shoe.value">{{shoe.name}}</mat-list-option> } </mat-selection-list> <p> Option selected: {{shoesControl.value ? sho...
115007
<mat-selection-list #shoes> @for (shoe of typesOfShoes; track shoe) { <mat-list-option>{{shoe}}</mat-list-option> } </mat-selection-list> <p> Options selected: {{shoes.selectedOptions.selected.length}} </p>
115015
<form [formGroup]="form"> <mat-selection-list #shoesList [formControl]="shoesControl" name="shoes" [multiple]="false"> @for (shoe of shoes; track shoe) { <mat-list-option [value]="shoe.value">{{shoe.name}}</mat-list-option> } </mat-selection-list> <p> Option selected: {{shoesControl.value ? sho...
115140
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Angular Material</title> <base href="/"> <link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="preconnect" href="https://fonts.gstatic.com"> <link href=...
115145
@use '@angular/material' as mat; @use '@angular/material-experimental' as experimental; // Plus imports for other components in your app. // Disable legacy API compatibility, since dev-app is fully migrated to theme inspection API. mat.$theme-legacy-inspection-api-compatibility: false; // Define the default (light) ...
115146
@use '@angular/material' as mat; // Plus imports for other components in your app. // Disable legacy API compatibility, since dev-app is fully migrated to theme inspection API. mat.$theme-legacy-inspection-api-compatibility: false; $primary: mat.$azure-palette; $tertiary: mat.$blue-palette; // Create a theme with t...
115194
Space above cards: <input type="number" [formControl]="topHeightCtrl"> <div [style.height.px]="topHeightCtrl.value"></div> <div class="demo-autocomplete"> <mat-card> Reactive length: {{ reactiveStates.length }} <div class="demo-truncate-text">Reactive value: {{ stateCtrl.value | json }}</div> <div>Reactiv...
115292
<div #demoYouTubePlayer class="demo-youtube-player"> <h2>Basic Example</h2> <section> <div class="demo-video-selection"> <label>Pick the video:</label> <mat-radio-group aria-label="Select a video" [(ngModel)]="selectedVideo"> @for (video of videos; track video) { <mat-radio-button ...
115315
@use '@angular/material' as mat; :host { display: block; max-width: 1000px; } h1 { font: var(--mat-sys-title-large); font-size: 28px; padding-top: 32px; } h2 { font: var(--mat-sys-title-large); } a { color: var(--mat-sys-primary); } .demo-warn { background: var(--mat-sys-error-container); color: ...
115316
<p class="demo-warn"> This page uses an experimental prototype version of a <span class="demo-surface-variable">material.theme</span> API. To enable it, click the <mat-icon>public</mat-icon> icon in the header. </p> <p> Angular Material components depend on CSS variables defined by the <span class="demo-surf...
115384
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import { afterNextRender, AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, inject, ...
115390
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {Directionality} from '@angular/cdk/bidi'; import { ChangeDetectionStrategy, Component, TemplateRef, ...
115418
import {bootstrapApplication, provideClientHydration} from '@angular/platform-browser'; import {provideAnimations} from '@angular/platform-browser/animations'; import {AUTOMATED_KITCHEN_SINK, KitchenSink} from './kitchen-sink/kitchen-sink'; bootstrapApplication(KitchenSink, { providers: [ provideAnimations(), ...
115426
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Angular Material Universal Kitchen Sink Test</title> <link href="styles.css" rel="stylesheet"> <link rel="preconnect" href="https://fonts.gstatic.com"> <link href="https...
115769
@Component({ selector: 'mat-option', exportAs: 'matOption', host: { 'role': 'option', '[class.mdc-list-item--selected]': 'selected', '[class.mat-mdc-option-multiple]': 'multiple', '[class.mat-mdc-option-active]': 'active', '[class.mdc-list-item--disabled]': 'disabled', '[id]': 'id', //...
115793
( 0: #000000, 10: #1a1c18, 20: #2f312c, 25: #3a3c37, 30: #464742, 35: #52534e, 40: #5e5f5a, 50: #767872, 60: #90918b, 70: #abaca5, 80: #c7c7c0, 90: #e3e3dc, 95: #f1f1ea, 98: #fafaf2, 99: #fdfdf5, 100: #ffffff, 4: #0c0f0b, 6: #121410, 12: #1e201...
115794
#5f00c0, 35: #6e00dc, 40: #7d00fa, 50: #944aff, 60: #a974ff, 70: #bf98ff, 80: #d5baff, 90: #ecdcff, 95: #f7edff, 98: #fef7ff, 99: #fffbff, 100: #ffffff, secondary: ( 0: #000000, 10: #1f182a, 20: #352d40, 25: #40384c, 30: #4b4357, 35: #574f63, 40: #645b70, 50: #7d7...
115795
// This file contains functions used to define Angular Material theme objects. @use 'sass:map'; @use '../style/sass-utils'; @use './palettes'; @use '../tokens/m3-tokens'; @use './config-validation'; // Prefix used for component token fallback variables, e.g. // `color: var(--mdc-text-button-label-text-color, var(--ma...
115797
@use 'sass:list'; @use 'sass:map'; @use '../style/validation'; @use './m2-inspection'; $_internals: _mat-theming-internals-do-not-access; $_m3-typescales: ( display-large, display-medium, display-small, headline-large, headline-medium, headline-small, title-large, title-medium, title-small, label-...
115798
@if $version == 0 { @return m2-inspection.get-theme-color($theme, $args...); } @else if $version == 1 { @if $args-count == 1 { @return _get-theme-role-color($theme, $args...); } @else if $args-count == 2 { @return _get-theme-palette-color($theme, $args...); } } @else { @error...
115808
describe('theming definition api', () => { describe('define-theme', () => { it('should fill in defaults', () => { const css = transpile(` $theme: mat.define-theme(); $data: map.get($theme, $internals); :root { --keys: #{map.keys($data)}; --version: #{map.get($data...
115815
import {compileString} from 'sass'; import {runfiles} from '@bazel/runfiles'; import * as path from 'path'; import {createLocalAngularPackageImporter} from '../../../../../tools/sass/local-sass-importer'; // Note: For Windows compatibility, we need to resolve the directory paths through runfiles // which are guarante...
115816
describe('for m3 theme', () => { it('should get theme version', () => { expect( transpile(` $theme: mat.define-theme(); div { --theme-version: #{mat.get-theme-version($theme)}; } `), ).toMatch('--theme-version: 1;'); }); it('should get t...
115842
@use 'sass:list'; @use 'sass:map'; @use 'sass:meta'; @use '../theming/theming'; @use './palette'; /// Extracts a color from a palette or throws an error if it doesn't exist. /// @param {Map} $palette The palette from which to extract a color. /// @param {String | Number} $hue The hue for which to get the color. @funct...
115845
@use 'sass:list'; @use 'sass:map'; @use 'sass:string'; @use 'typography-utils'; @use '../theming/inspection'; // Definition and versioning functions live in their own files to avoid circular dependencies, but // we re-export them here so that historical imports from this file continue to work without needing // to be ...
115861
@function _get-sys-typeface($ref, $prefix) { @if (sass-utils.$use-system-typography-variables) { $keys: ( 'body-large', 'body-large-font', 'body-large-line-height', 'body-large-size', 'body-large-tracking', 'body-large-weight', 'b...
115865
@mixin system-level-typography($theme, $overrides: (), $prefix: null) { $font-definition: map.get($theme, _mat-theming-internals-do-not-access, font-definition); $brand: map.get($font-definition, brand); $plain: map.get($font-definition, plain); $bold: map.get($font-definition, bold); $medium: map.get($font-d...
116031
#{'/'} if( $exclude-hardcoded-values, null, 1.5rem ) map.get($deps, 'md-ref-typeface', 'plain') ), 'body-large-font': map.get($deps, 'md-ref-typeface', 'plain'), 'body-large-line-height': if($exclude-hardcoded-values, null, 1.5rem), 'body-large-size': if($...
116032
, 'headline-small-font': map.get($deps, 'md-ref-typeface', 'brand'), 'headline-small-line-height': if($exclude-hardcoded-values, null, 2rem), 'headline-small-size': if($exclude-hardcoded-values, null, 1.5rem), 'headline-small-tracking': if($exclude-hardcoded-values, null, 0), 'headline-small-weight'...
116136
class MatAutocomplete implements AfterContentInit, OnDestroy { private _changeDetectorRef = inject(ChangeDetectorRef); private _elementRef = inject<ElementRef<HTMLElement>>(ElementRef); protected _defaults = inject<MatAutocompleteDefaultOptions>(MAT_AUTOCOMPLETE_DEFAULT_OPTIONS); private _activeOptionChanges =...
116139
import {OverlayModule} from '@angular/cdk/overlay'; import {dispatchFakeEvent} from '@angular/cdk/testing/private'; import { Component, NgZone, OnDestroy, Provider, QueryList, Type, ViewChild, ViewChildren, provideZoneChangeDetection, } from '@angular/core'; import {ComponentFixture, TestBed, waitForA...
116141
The autocomplete is a normal text input enhanced by a panel of suggested options. ### Simple autocomplete Start by creating the autocomplete panel and the options displayed inside it. Each option should be defined by a `mat-option` tag. Set each option's value property to whatever you'd like the value of the text inp...
116146
it('should update the panel direction if it changes for the trigger', () => { const dirProvider = {value: 'rtl', change: EMPTY}; const rtlFixture = createComponent(SimpleAutocomplete, [ {provide: Directionality, useFactory: () => dirProvider}, ]); rtlFixture.detectChanges(); rtlFixture.compon...
116157
it('should preserve the value if a selection is required, and there are no options', waitForAsync(async () => { const input = fixture.nativeElement.querySelector('input'); const {stateCtrl, trigger, states} = fixture.componentInstance; fixture.componentInstance.requireSelection = true; fixture.c...
116158
describe('misc', () => { it('should allow basic use without any forms directives', () => { expect(() => { const fixture = createComponent(AutocompleteWithoutForms); fixture.detectChanges(); const input = fixture.debugElement.query(By.css('input'))!.nativeElement; typeInElement...
116162
@Component({ template: ` @if (isVisible) { <mat-form-field> <input matInput placeholder="Choose" [matAutocomplete]="auto" [formControl]="optionCtrl"> </mat-form-field> } <mat-autocomplete #auto="matAutocomplete"> @for (option of filteredOptions | async; track option) { <mat-option [value]="...
116246
Chips allow users to view information, make selections, filter content, and enter data. ### Static Chips Chips are always used inside a container. To create chips, start with a `<mat-chip-set>` element. Then, nest `<mat-chip>` elements inside the `<mat-chip-set>`. <!-- example(chips-overview) --> By default, `<mat-...
116292
{ protected _elementRef = inject<ElementRef<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>>(ElementRef); protected _platform = inject(Platform); ngControl = inject(NgControl, {optional: true, self: true})!; private _autofillMonitor = inject(AutofillMonitor); private _ngZone = inject(NgZone); ...
116306
Please see the official documentation at https://material.angular.io/components/component/input
116343
class MatSlideToggle implements OnDestroy, AfterContentInit, OnChanges, ControlValueAccessor, Validator { private _elementRef = inject(ElementRef); protected _focusMonitor = inject(FocusMonitor); protected _changeDetectorRef = inject(ChangeDetectorRef); defaults = inject<MatSlideToggleDefaultOptions>(MAT_SLID...
116659
The `MatDialog` service can be used to open modal dialogs with Material Design styling and animations. <!-- example(dialog-overview) --> A dialog is opened by calling the `open` method with a component to be loaded and an optional config object. The `open` method will return an instance of `MatDialogRef`: ```ts let ...
116661
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {ViewContainerRef, Injector} from '@angular/core'; import {Direction} from '@angular/cdk/bidi'; import {Scrol...
116682
import {Component, inject} from '@angular/core'; import {TestBed, fakeAsync, flush} from '@angular/core/testing'; import {MAT_DIALOG_DATA, MatDialogRef, MatDialogState} from '@angular/material/dialog'; import {MatTestDialogOpener, MatTestDialogOpenerModule} from '@angular/material/dialog/testing'; import {NoopAnimation...
116687
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {ComponentType} from '@angular/cdk/overlay'; import { ChangeDetectionStrategy, Component, NgModule, N...
116703
`<mat-form-field>` is a component used to wrap several Angular Material components and apply common [Text field](https://material.io/guidelines/components/text-fields.html) styles such as the underline, floating label, and hint messages. In this document, "form field" refers to the wrapper component `<mat-form-field>`...
116841
@Component({ template: ` <table mat-table [dataSource]="dataSource" matSort> <ng-container matColumnDef="column_a"> <th mat-header-cell *matHeaderCellDef mat-sort-header="a"> Column A</th> <td mat-cell *matCellDef="let row"> {{row.a}}</td> <td mat-footer-cell *matFooterCellDef> Foote...
116846
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {NgModule} from '@angular/core'; import {MatCommonModule} from '@angular/material/core'; import {MatRecycleRo...
116851
### Features The `MatTable` is focused on a single responsibility: efficiently render rows of data in a performant and accessible way. You'll notice that the table itself doesn't come out of the box with a lot of features, but expects that the table will be included in a composition of components that fills out its f...
116855
export class MatTableDataSource<T, P extends MatPaginator = MatPaginator> extends DataSource<T> { /** Stream that emits when a new data array is set on the data source. */ private readonly _data: BehaviorSubject<T[]>; /** Stream emitting render data to the table (depends on ordered data changes). */ private re...
116872
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion'; import {SelectionModel} from '@angular/cd...
116873
class MatListOption extends MatListItemBase implements ListOption, OnInit, OnDestroy { private _selectionList = inject<SelectionList>(SELECTION_LIST); private _changeDetectorRef = inject(ChangeDetectorRef); @ContentChildren(MatListItemLine, {descendants: true}) _lines: QueryList<MatListItemLine>; @ContentChild...
116879
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {FocusKeyManager} from '@angular/cdk/a11y'; import {BooleanInput, coerceBooleanProperty} from '@angular/cdk/c...
116882
`<mat-list>` is a container component that wraps and formats a series of `<mat-list-item>`. As the base list component, it provides Material Design styling, but no behavior of its own. <!-- example(list-overview) --> List items can be constructed in two ways depending the content they need to show: ### Simple lists ...
116890
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {NgModule} from '@angular/core'; import {MatPseudoCheckboxModule, MatRippleModule, MatCommonModule} from '@an...
116900
it('should be able to deselect all options, even if they are disabled', () => { const list: MatSelectionList = selectionList.componentInstance; list.options.forEach(option => option.toggle()); expect(list.options.toArray().every(option => option.selected)).toBe(true); list.options.forEach(opti...
116905
describe('and formControl', () => { let fixture: ComponentFixture<SelectionListWithFormControl>; let listOptions: MatListOption[]; let selectionList: MatSelectionList; beforeEach(() => { fixture = TestBed.createComponent(SelectionListWithFormControl); fixture.detectChanges(); selecti...
116906
@Component({ template: ` <mat-selection-list id="selection-list-2"> <mat-list-option togglePosition="after"> Inbox (disabled selection-option) </mat-list-option> <mat-list-option id="testSelect" togglePosition="after"> Starred </mat-list-option> <mat-list-option togglePosition="after...
116946
`<mat-menu>` is a floating panel containing list of options. <!-- example(menu-overview) --> By itself, the `<mat-menu>` element does not render anything. The menu is attached to and opened via application of the `matMenuTriggerFor` directive: <!-- example({"example": "menu-overview", "file": "menu-over...
116972
@Component({ selector: 'custom-menu', template: ` <ng-template> Custom Menu header <ng-content></ng-content> </ng-template> `, exportAs: 'matCustomMenu', standalone: false, }) class CustomMenuPanel implements MatMenuPanel { direction: Direction; xPosition: MenuPositionX = 'after'; yP...
117071
{ protected _viewportRuler = inject(ViewportRuler); protected _changeDetectorRef = inject(ChangeDetectorRef); readonly _elementRef = inject(ElementRef); private _dir = inject(Directionality, {optional: true}); protected _parentFormField = inject<MatFormField>(MAT_FORM_FIELD, {optional: true}); ngControl = i...
117079
`<mat-select>` is a form control for selecting a value from a set of options, similar to the native `<select>` element. You can read more about selects in the [Material Design spec](https://material.io/design/components/menus.html). It is designed to work inside of a [`<mat-form-field>`](https://material.angular.io/com...
117081
Please see the official documentation at https://material.angular.io/components/component/select
117084
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import { animate, animateChild, AnimationTriggerMetadata, query, state, style, transition, trigger, ...
117102
it('should not throw when toggling an icon that has a binding in IE11', () => { iconRegistry.addSvgIcon('fluffy', trustUrl('cat.svg')); const fixture = TestBed.createComponent(IconWithBindingAndNgIf); fixture.detectChanges(); http.expectOne('cat.svg').flush(FAKE_SVGS.cat); expect(() => ...
117142
it('should allow manually dismissing with an action', fakeAsync(() => { const dismissCompleteSpy = jasmine.createSpy('dismiss complete spy'); const actionCompleteSpy = jasmine.createSpy('action complete spy'); const snackBarRef = snackBar.open('Some content'); viewContainerFixture.detectChanges(); ...
117153
class MatSnackBarContainer extends BasePortalOutlet implements OnDestroy { private _ngZone = inject(NgZone); private _elementRef = inject<ElementRef<HTMLElement>>(ElementRef); private _changeDetectorRef = inject(ChangeDetectorRef); private _platform = inject(Platform); snackBarConfig = inject(MatSnackBarConfi...
117227
import {SchematicTestRunner, UnitTestTree} from '@angular-devkit/schematics/testing'; import {createTestApp, getFileContent} from '@angular/cdk/schematics/testing'; import {COLLECTION_PATH} from '../../paths'; import {Schema} from './schema'; describe('material-navigation-schematic', () => { let runner: SchematicTe...