_id
stringlengths
21
254
text
stringlengths
1
93.7k
metadata
dict
components/src/material/list/selection-list.spec.ts_20244_29390
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...
{ "end_byte": 29390, "start_byte": 20244, "url": "https://github.com/angular/components/blob/main/src/material/list/selection-list.spec.ts" }
components/src/material/list/selection-list.spec.ts_29394_35663
describe('with option disabled', () => { let fixture: ComponentFixture<SelectionListWithDisabledOption>; let listOptionEl: HTMLElement; let listOption: MatListOption; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [MatListModule, SelectionListWithDisabledOption]...
{ "end_byte": 35663, "start_byte": 29394, "url": "https://github.com/angular/components/blob/main/src/material/list/selection-list.spec.ts" }
components/src/material/list/selection-list.spec.ts_35667_40959
describe('with list item elements', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [MatListModule, SelectionListWithAvatar, SelectionListWithIcon], }); })); function expectCheckboxAtPosition( listItemElement: HTMLElement, position: MatListO...
{ "end_byte": 40959, "start_byte": 35667, "url": "https://github.com/angular/components/blob/main/src/material/list/selection-list.spec.ts" }
components/src/material/list/selection-list.spec.ts_40963_46898
describe('with single selection', () => { let fixture: ComponentFixture<SelectionListWithListOptions>; let listOptions: DebugElement[]; let selectionList: DebugElement; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [MatListModule, SelectionListWithListOptions],...
{ "end_byte": 46898, "start_byte": 40963, "url": "https://github.com/angular/components/blob/main/src/material/list/selection-list.spec.ts" }
components/src/material/list/selection-list.spec.ts_46900_55667
describe('MatSelectionList with forms', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ MatListModule, FormsModule, ReactiveFormsModule, SelectionListWithModel, SelectionListWithFormControl, SelectionListWithPreselectedOptio...
{ "end_byte": 55667, "start_byte": 46900, "url": "https://github.com/angular/components/blob/main/src/material/list/selection-list.spec.ts" }
components/src/material/list/selection-list.spec.ts_55671_65517
describe('and formControl', () => { let fixture: ComponentFixture<SelectionListWithFormControl>; let listOptions: MatListOption[]; let selectionList: MatSelectionList; beforeEach(() => { fixture = TestBed.createComponent(SelectionListWithFormControl); fixture.detectChanges(); selecti...
{ "end_byte": 65517, "start_byte": 55671, "url": "https://github.com/angular/components/blob/main/src/material/list/selection-list.spec.ts" }
components/src/material/list/selection-list.spec.ts_65519_73046
@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...
{ "end_byte": 73046, "start_byte": 65519, "url": "https://github.com/angular/components/blob/main/src/material/list/selection-list.spec.ts" }
components/src/material/list/list.ts_0_3521
/** * @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 { ChangeDetectionStrategy, Component, Input, ContentChildren, ElementRef, QueryList, ViewChild,...
{ "end_byte": 3521, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/list.ts" }
components/src/material/list/list.spec.ts_0_357
import {dispatchFakeEvent, dispatchMouseEvent} from '@angular/cdk/testing/private'; import {Component, QueryList, ViewChild, ViewChildren} from '@angular/core'; import {TestBed, fakeAsync, waitForAsync} from '@angular/core/testing'; import {By} from '@angular/platform-browser'; import {MatListItem, MatListModule} from ...
{ "end_byte": 357, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/list.spec.ts" }
components/src/material/list/list.spec.ts_358_10119
{ beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ MatListModule, ListWithOneAnchorItem, ListWithOneItem, ListWithTwoLineItem, ListWithThreeLineItem, ListWithAvatar, ListWithItemWithCssClass, ListWithDynamicNumberOfLi...
{ "end_byte": 10119, "start_byte": 358, "url": "https://github.com/angular/components/blob/main/src/material/list/list.spec.ts" }
components/src/material/list/list.spec.ts_10123_18840
it('should allow disabling ripples for the entire action list', () => { const fixture = TestBed.createComponent(ActionListWithoutType); fixture.detectChanges(); const items = fixture.componentInstance.listItems.toArray(); expect(items.length).toBeGreaterThan(0); expect(items.every(item => !item.ri...
{ "end_byte": 18840, "start_byte": 10123, "url": "https://github.com/angular/components/blob/main/src/material/list/list.spec.ts" }
components/src/material/list/list.spec.ts_18842_22030
@Component({ template: ` <mat-action-list> <button mat-list-item [disabled]="disableItem"> Paprika </button> </mat-action-list>`, standalone: true, imports: [MatListModule], }) class ActionListWithDisabledItem extends BaseTestList { @ViewChild(MatListItem) buttonItem: MatListItem; disableIte...
{ "end_byte": 22030, "start_byte": 18842, "url": "https://github.com/angular/components/blob/main/src/material/list/list.spec.ts" }
components/src/material/list/list-option.html_0_3105
<!-- Save icons and the pseudo checkbox/radio so that they can be re-used in the template without duplication. Also content can only be injected once so we need to extract icons/avatars into a template since we use it in multiple places. --> <ng-template #icons> <ng-content select="[matListItemAvatar],[matListI...
{ "end_byte": 3105, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/list-option.html" }
components/src/material/list/testing/public-api.ts_0_492
/** * @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 */ export * from './action-list-harness'; export * from './list-harness'; export * from './list-harness-filters'; expor...
{ "end_byte": 492, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/testing/public-api.ts" }
components/src/material/list/testing/action-list-harness.ts_0_2700
/** * @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 {ComponentHarnessConstructor, HarnessPredicate} from '@angular/cdk/testing'; import {MatListHarnessBase} from...
{ "end_byte": 2700, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/testing/action-list-harness.ts" }
components/src/material/list/testing/list-harness-base.ts_0_6808
/** * @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 { ComponentHarness, ComponentHarnessConstructor, HarnessPredicate, parallel, } from '@angular/cdk/tes...
{ "end_byte": 6808, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/testing/list-harness-base.ts" }
components/src/material/list/testing/list-harness.spec.ts_0_1596
import { BaseHarnessFilters, ComponentHarness, ComponentHarnessConstructor, HarnessPredicate, parallel, } from '@angular/cdk/testing'; import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed'; import {Component, Type, WritableSignal, signal} from '@angular/core'; import {ComponentFixture, TestBe...
{ "end_byte": 1596, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/testing/list-harness.spec.ts" }
components/src/material/list/testing/list-harness.spec.ts_1597_10023
{ describe('base list functionality', () => { let simpleListHarness: L; let emptyListHarness: L; let fixture: ComponentFixture<F>; beforeEach(async () => { const testComponent = testComponentFn(); TestBed.configureTestingModule({ imports: [MatListModule, testComponent], }); ...
{ "end_byte": 10023, "start_byte": 1597, "url": "https://github.com/angular/components/blob/main/src/material/list/testing/list-harness.spec.ts" }
components/src/material/list/testing/list-harness.spec.ts_10029_16697
it('should get list item text, title, secondary and tertiary text', async () => { const items = await simpleListHarness.getItems(); expect(items.length).toBe(5); expect(await items[0].getFullText()).toBe('Item 1'); expect(await items[0].getTitle()).toBe('Item'); expect(await items[0].getSe...
{ "end_byte": 16697, "start_byte": 10029, "url": "https://github.com/angular/components/blob/main/src/material/list/testing/list-harness.spec.ts" }
components/src/material/list/testing/list-harness.spec.ts_16699_24638
describe('MatSelectionListHarness', () => { runBaseListFunctionalityTests( () => SelectionListHarnessTest, MatSelectionListHarness, MatListOptionHarness, ); describe('additional functionality', () => { let harness: MatSelectionListHarness; let emptyHarness: MatSelectionListHarness; let fi...
{ "end_byte": 24638, "start_byte": 16699, "url": "https://github.com/angular/components/blob/main/src/material/list/testing/list-harness.spec.ts" }
components/src/material/list/testing/list-harness.spec.ts_24640_26030
@Component({ template: ` <mat-selection-list class="test-base-list-functionality"> <mat-list-option togglePosition="before"> <div matListItemTitle>Item </div> <div matListItemLine>1</div> <div matListItemIcon>icon</div> <div matListItemAvatar>Avatar</div> </mat-list-opt...
{ "end_byte": 26030, "start_byte": 24640, "url": "https://github.com/angular/components/blob/main/src/material/list/testing/list-harness.spec.ts" }
components/src/material/list/testing/BUILD.bazel_0_836
load("//tools:defaults.bzl", "ng_test_library", "ng_web_test_suite", "ts_library") package(default_visibility = ["//visibility:public"]) ts_library( name = "testing", srcs = glob( ["**/*.ts"], exclude = ["**/*.spec.ts"], ), deps = [ "//src/cdk/coercion", "//src/cdk/test...
{ "end_byte": 836, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/testing/BUILD.bazel" }
components/src/material/list/testing/list-harness.ts_0_2074
/** * @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 {ComponentHarnessConstructor, HarnessPredicate} from '@angular/cdk/testing'; import {MatListHarnessBase} from...
{ "end_byte": 2074, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/testing/list-harness.ts" }
components/src/material/list/testing/index.ts_0_234
/** * @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 */ export * from './public-api';
{ "end_byte": 234, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/testing/index.ts" }
components/src/material/list/testing/list-harness-filters.ts_0_1388
/** * @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 {BaseHarnessFilters} from '@angular/cdk/testing'; export interface ListHarnessFilters extends BaseHarnessFil...
{ "end_byte": 1388, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/testing/list-harness-filters.ts" }
components/src/material/list/testing/list-item-harness-base.ts_0_6804
/** * @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 { ComponentHarness, ComponentHarnessConstructor, ContentContainerComponentHarness, HarnessPredicate, ...
{ "end_byte": 6804, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/testing/list-item-harness-base.ts" }
components/src/material/list/testing/nav-list-harness.ts_0_3278
/** * @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 {ComponentHarnessConstructor, HarnessPredicate} from '@angular/cdk/testing'; import {MatListHarnessBase} from...
{ "end_byte": 3278, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/testing/nav-list-harness.ts" }
components/src/material/list/testing/selection-list-harness.ts_0_5465
/** * @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 {ComponentHarnessConstructor, HarnessPredicate, parallel} from '@angular/cdk/testing'; import {MatListOptionT...
{ "end_byte": 5465, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/testing/selection-list-harness.ts" }
components/src/material/divider/_divider-offset.scss_0_420
// This mixin provides the correct offset for an inset divider based on the // size of the parent class (e.g. avatar vs icon) @mixin inset-divider-offset($offset, $padding) { $mat-inset-divider-offset: #{(2 * $padding) + $offset}; margin-left: $mat-inset-divider-offset; width: calc(100% - #{$mat-inset-divider-off...
{ "end_byte": 420, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/divider/_divider-offset.scss" }
components/src/material/divider/public-api.ts_0_265
/** * @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 */ export * from './divider'; export * from './divider-module';
{ "end_byte": 265, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/divider/public-api.ts" }
components/src/material/divider/README.md_0_97
Please see the official documentation at https://material.angular.io/components/component/divider
{ "end_byte": 97, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/divider/README.md" }
components/src/material/divider/divider.scss_0_825
@use '../core/tokens/token-utils'; @use '../core/tokens/m2/mat/divider' as tokens-mat-divider; $inset-margin: 80px; .mat-divider { display: block; margin: 0; border-top-style: solid; @include token-utils.use-tokens( tokens-mat-divider.$prefix, tokens-mat-divider.get-token-slots()) { @include token-uti...
{ "end_byte": 825, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/divider/divider.scss" }
components/src/material/divider/divider.ts_0_1348
/** * @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 {ChangeDetectionStrategy, Component, Input, ViewEncapsulation} from '@angular/core'; import {BooleanInput, co...
{ "end_byte": 1348, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/divider/divider.ts" }
components/src/material/divider/_divider-theme.scss_0_2623
@use 'sass:map'; @use '../core/style/sass-utils'; @use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/theming/validation'; @use '../core/tokens/token-utils'; @use '../core/tokens/m2/mat/divider' as tokens-mat-divider; @mixin base($theme) { @if inspection.get-theme-version($theme) == 1 { ...
{ "end_byte": 2623, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/divider/_divider-theme.scss" }
components/src/material/divider/BUILD.bazel_0_1341
load( "//tools:defaults.bzl", "extract_tokens", "markdown_to_html", "ng_module", "ng_test_library", "ng_web_test_suite", "sass_binary", "sass_library", ) package(default_visibility = ["//visibility:public"]) ng_module( name = "divider", srcs = glob( ["**/*.ts"], ...
{ "end_byte": 1341, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/divider/BUILD.bazel" }
components/src/material/divider/index.ts_0_234
/** * @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 */ export * from './public-api';
{ "end_byte": 234, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/divider/index.ts" }
components/src/material/divider/divider-module.ts_0_471
/** * @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 {MatDivider} ...
{ "end_byte": 471, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/divider/divider-module.ts" }
components/src/material/divider/divider.spec.ts_0_2639
import {ComponentFixture, TestBed} from '@angular/core/testing'; import {Component} from '@angular/core'; import {By} from '@angular/platform-browser'; import {MatDividerModule} from './divider-module'; describe('MatDivider', () => { let fixture: ComponentFixture<MatDividerTestComponent>; beforeEach(() => { T...
{ "end_byte": 2639, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/divider/divider.spec.ts" }
components/src/material/divider/divider.md_0_1959
`<mat-divider>` is a component that allows for Material styling of a line separator with various orientation options. <!-- example(divider-overview) --> ### Simple divider A `<mat-divider>` element can be used on its own to create a horizontal or vertical line styled with a Material theme ```html <mat-divider></ma...
{ "end_byte": 1959, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/divider/divider.md" }
components/src/material/divider/testing/divider-harness-filters.ts_0_331
/** * @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 {BaseHarnessFilters} from '@angular/cdk/testing'; export interface DividerHarnessFilters extends BaseHarness...
{ "end_byte": 331, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/divider/testing/divider-harness-filters.ts" }
components/src/material/divider/testing/public-api.ts_0_282
/** * @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 */ export * from './divider-harness'; export * from './divider-harness-filters';
{ "end_byte": 282, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/divider/testing/public-api.ts" }
components/src/material/divider/testing/divider-harness.ts_0_903
/** * @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 {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing'; import {DividerHarnessFilters} from './divi...
{ "end_byte": 903, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/divider/testing/divider-harness.ts" }
components/src/material/divider/testing/BUILD.bazel_0_722
load("//tools:defaults.bzl", "ng_test_library", "ng_web_test_suite", "ts_library") package(default_visibility = ["//visibility:public"]) ts_library( name = "testing", srcs = glob( ["**/*.ts"], exclude = ["**/*.spec.ts"], ), deps = [ "//src/cdk/testing", ], ) filegroup( ...
{ "end_byte": 722, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/divider/testing/BUILD.bazel" }
components/src/material/divider/testing/divider-harness.spec.ts_0_1609
import {Component} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import {HarnessLoader} from '@angular/cdk/testing'; import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed'; import {MatDividerModule} from '@angular/material/divider'; import {MatDividerHarness} fro...
{ "end_byte": 1609, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/divider/testing/divider-harness.spec.ts" }
components/src/material/divider/testing/index.ts_0_234
/** * @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 */ export * from './public-api';
{ "end_byte": 234, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/divider/testing/index.ts" }
components/src/material/menu/menu-errors.ts_0_1279
/** * @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 */ /** * Throws an exception for the case when menu's x-position value isn't valid. * In other words, it doesn't matc...
{ "end_byte": 1279, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu-errors.ts" }
components/src/material/menu/menu.md_0_4612
`<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...
{ "end_byte": 4612, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu.md" }
components/src/material/menu/module.ts_0_1026
/** * @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, MatRippleModule} from '@angular/material/core'; imp...
{ "end_byte": 1026, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/module.ts" }
components/src/material/menu/menu.scss_0_7907
@use '@angular/cdk'; @use '../core/tokens/m2/mat/menu' as tokens-mat-menu; @use '../core/tokens/token-utils'; @use '../core/style/menu-common'; @use '../core/style/button-common'; @use '../core/style/vendor-prefixes'; // Prevent rendering mat-menu as it can affect the flex layout. mat-menu { display: none; } .mat-m...
{ "end_byte": 7907, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu.scss" }
components/src/material/menu/public-api.ts_0_639
/** * @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 */ export {MatMenu, MAT_MENU_DEFAULT_OPTIONS, MatMenuDefaultOptions, MenuCloseReason} from './menu'; export * from './m...
{ "end_byte": 639, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/public-api.ts" }
components/src/material/menu/menu.html_0_638
<ng-template> <div class="mat-mdc-menu-panel mat-mdc-elevation-specific" [id]="panelId" [class]="_classList" (keydown)="_handleKeydown($event)" (click)="closed.emit('click')" [@transformMenu]="_panelAnimationState" (@transformMenu.start)="_onAnimationStart($event)" (@transformMenu.done...
{ "end_byte": 638, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu.html" }
components/src/material/menu/menu.ts_0_3163
/** * @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 { AfterContentInit, ChangeDetectionStrategy, Component, ContentChild, ContentChildren, ElementRef...
{ "end_byte": 3163, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu.ts" }
components/src/material/menu/menu.ts_3164_11406
{ private _elementRef = inject<ElementRef<HTMLElement>>(ElementRef); private _changeDetectorRef = inject(ChangeDetectorRef); private _keyManager: FocusKeyManager<MatMenuItem>; private _xPosition: MenuPositionX; private _yPosition: MenuPositionY; private _firstItemFocusRef?: AfterRenderRef; private _previ...
{ "end_byte": 11406, "start_byte": 3164, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu.ts" }
components/src/material/menu/menu.ts_11409_18316
_handleKeydown(event: KeyboardEvent) { const keyCode = event.keyCode; const manager = this._keyManager; switch (keyCode) { case ESCAPE: if (!hasModifierKey(event)) { event.preventDefault(); this.closed.emit('keydown'); } break; case LEFT_ARROW: ...
{ "end_byte": 18316, "start_byte": 11409, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu.ts" }
components/src/material/menu/README.md_0_95
Please see the official documentation at https://material.angular.io/components/component/menu
{ "end_byte": 95, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/README.md" }
components/src/material/menu/menu-panel.ts_0_1618
/** * @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 {EventEmitter, TemplateRef, InjectionToken} from '@angular/core'; import {MenuPositionX, MenuPositionY} from ...
{ "end_byte": 1618, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu-panel.ts" }
components/src/material/menu/menu-animations.ts_0_2123
/** * @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 { trigger, state, style, animate, transition, AnimationTriggerMetadata, } from '@angular/animatio...
{ "end_byte": 2123, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu-animations.ts" }
components/src/material/menu/menu-item.ts_0_5362
/** * @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 { ChangeDetectionStrategy, Component, ElementRef, OnDestroy, ViewEncapsulation, Input, AfterVie...
{ "end_byte": 5362, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu-item.ts" }
components/src/material/menu/menu-content.ts_0_3292
/** * @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 {DomPortalOutlet, TemplatePortal} from '@angular/cdk/portal'; import {DOCUMENT} from '@angular/common'; impor...
{ "end_byte": 3292, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu-content.ts" }
components/src/material/menu/menu.spec.ts_0_1304
import {FocusMonitor} from '@angular/cdk/a11y'; import {Direction, Directionality} from '@angular/cdk/bidi'; import { DOWN_ARROW, END, ENTER, ESCAPE, HOME, LEFT_ARROW, RIGHT_ARROW, TAB, } from '@angular/cdk/keycodes'; import {Overlay, OverlayContainer} from '@angular/cdk/overlay'; import {ScrollDispatch...
{ "end_byte": 1304, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu.spec.ts" }
components/src/material/menu/menu.spec.ts_1306_11005
describe('MatMenu', () => { let overlayContainerElement: HTMLElement; let focusMonitor: FocusMonitor; let viewportRuler: ViewportRuler; function createComponent<T>( component: Type<T>, providers: Provider[] = [], declarations: any[] = [], ): ComponentFixture<T> { TestBed.configureTestingModul...
{ "end_byte": 11005, "start_byte": 1306, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu.spec.ts" }
components/src/material/menu/menu.spec.ts_11009_20146
it('should restore focus to the root trigger when the menu was opened by mouse', fakeAsync(() => { const fixture = createComponent(SimpleMenu, [], [FakeIcon]); fixture.detectChanges(); const triggerEl = fixture.componentInstance.triggerEl.nativeElement; dispatchFakeEvent(triggerEl, 'mousedown'); tr...
{ "end_byte": 20146, "start_byte": 11009, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu.spec.ts" }
components/src/material/menu/menu.spec.ts_20150_29918
it('should not remove mat-elevation class from overlay when panelClass is changed', fakeAsync(() => { const fixture = createComponent(SimpleMenu, [], [FakeIcon]); fixture.componentInstance.panelClass = 'custom-one'; fixture.detectChanges(); fixture.componentInstance.trigger.openMenu(); fixture.dete...
{ "end_byte": 29918, "start_byte": 20150, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu.spec.ts" }
components/src/material/menu/menu.spec.ts_29922_39136
it('should set the keyboard focus origin when opened using the keyboard', fakeAsync(() => { const fixture = createComponent(SimpleMenu, [], [FakeIcon]); fixture.detectChanges(); const trigger = fixture.componentInstance.triggerEl.nativeElement; // Note that we dispatch both a `click` and a `keydown` to...
{ "end_byte": 39136, "start_byte": 29922, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu.spec.ts" }
components/src/material/menu/menu.spec.ts_39140_47391
it('should open submenus when the menu is inside an OnPush component', fakeAsync(() => { const fixture = createComponent(LazyMenuWithOnPush); fixture.detectChanges(); // Open the top-level menu fixture.componentInstance.rootTrigger.nativeElement.click(); fixture.detectChanges(); flush(); /...
{ "end_byte": 47391, "start_byte": 39140, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu.spec.ts" }
components/src/material/menu/menu.spec.ts_47395_51620
describe('positions', () => { let fixture: ComponentFixture<PositionedMenu>; let trigger: HTMLElement; beforeEach(fakeAsync(() => { fixture = createComponent(PositionedMenu); fixture.detectChanges(); trigger = fixture.componentInstance.triggerEl.nativeElement; // Push trigger to t...
{ "end_byte": 51620, "start_byte": 47395, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu.spec.ts" }
components/src/material/menu/menu.spec.ts_51624_57614
describe('fallback positions', () => { it('should fall back to "before" mode if "after" mode would not fit on screen', fakeAsync(() => { const fixture = createComponent(SimpleMenu, [], [FakeIcon]); fixture.detectChanges(); const trigger = fixture.componentInstance.triggerEl.nativeElement; /...
{ "end_byte": 57614, "start_byte": 51624, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu.spec.ts" }
components/src/material/menu/menu.spec.ts_57618_65412
describe('overlapping trigger', () => { /** * This test class is used to create components containing a menu. * It provides helpers to reposition the trigger, open the menu, * and access the trigger and overlay positions. * Additionally it can take any inputs for the menu wrapper component. ...
{ "end_byte": 65412, "start_byte": 57618, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu.spec.ts" }
components/src/material/menu/menu.spec.ts_65416_75192
describe('nested menu', () => { let fixture: ComponentFixture<NestedMenu>; let instance: NestedMenu; let overlay: HTMLElement; let compileTestComponent = (direction: Direction = 'ltr') => { fixture = createComponent(NestedMenu, [ { provide: Directionality, useFactory: (...
{ "end_byte": 75192, "start_byte": 65416, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu.spec.ts" }
components/src/material/menu/menu.spec.ts_75198_84633
it('should not do anything with the arrow keys for a top-level menu', fakeAsync(() => { compileTestComponent(); instance.rootTriggerEl.nativeElement.click(); fixture.detectChanges(); tick(500); const menu = overlay.querySelector('.mat-mdc-menu-panel')!; dispatchKeyboardEvent(menu, ...
{ "end_byte": 84633, "start_byte": 75198, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu.spec.ts" }
components/src/material/menu/menu.spec.ts_84639_93496
it('should close all of the menus when the user tabs away', fakeAsync(() => { compileTestComponent(); instance.rootTriggerEl.nativeElement.click(); fixture.detectChanges(); instance.levelOneTrigger.openMenu(); fixture.detectChanges(); instance.levelTwoTrigger.openMenu(); fixt...
{ "end_byte": 93496, "start_byte": 84639, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu.spec.ts" }
components/src/material/menu/menu.spec.ts_93502_102488
it('should be able to trigger the same nested menu from different triggers', fakeAsync(() => { const repeaterFixture = createComponent(NestedMenuRepeater); overlay = overlayContainerElement; repeaterFixture.detectChanges(); repeaterFixture.componentInstance.rootTriggerEl.nativeElement.click(); ...
{ "end_byte": 102488, "start_byte": 93502, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu.spec.ts" }
components/src/material/menu/menu.spec.ts_102490_109758
@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...
{ "end_byte": 109758, "start_byte": 102490, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu.spec.ts" }
components/src/material/menu/menu.spec.ts_109760_112772
@Component({ template: ` <button [matMenuTriggerFor]="menu">Toggle menu</button> <mat-menu #menu="matMenu"> @for (item of items; track $index) { <button [disabled]="item.disabled"mat-menu-item>{{item.label}}</button> } </mat-menu> `, standalone: false, }) class SimpleMenuWithRepeat...
{ "end_byte": 112772, "start_byte": 109760, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu.spec.ts" }
components/src/material/menu/_menu-theme.scss_0_2831
@use 'sass:map'; @use '../core/tokens/m2/mat/menu' as tokens-mat-menu; @use '../core/style/sass-utils'; @use '../core/tokens/token-utils'; @use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/theming/validation'; @use '../core/typography/typography'; @mixin base($theme) { @if inspection.g...
{ "end_byte": 2831, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/_menu-theme.scss" }
components/src/material/menu/BUILD.bazel_0_1658
load( "//tools:defaults.bzl", "extract_tokens", "markdown_to_html", "ng_module", "ng_test_library", "ng_web_test_suite", "sass_binary", "sass_library", ) package(default_visibility = ["//visibility:public"]) ng_module( name = "menu", srcs = glob( ["**/*.ts"], ex...
{ "end_byte": 1658, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/BUILD.bazel" }
components/src/material/menu/menu-item.html_0_476
<ng-content select="mat-icon, [matMenuItemIcon]"></ng-content> <span class="mat-mdc-menu-item-text"><ng-content></ng-content></span> <div class="mat-mdc-menu-ripple" matRipple [matRippleDisabled]="disableRipple || disabled" [matRippleTrigger]="_getHostElement()"> </div> @if (_triggersSubmenu) { <svg ...
{ "end_byte": 476, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu-item.html" }
components/src/material/menu/index.ts_0_234
/** * @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 */ export * from './public-api';
{ "end_byte": 234, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/index.ts" }
components/src/material/menu/menu-positions.ts_0_300
/** * @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 */ export type MenuPositionX = 'before' | 'after'; export type MenuPositionY = 'above' | 'below';
{ "end_byte": 300, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu-positions.ts" }
components/src/material/menu/menu-trigger.ts_0_2522
/** * @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 { FocusMonitor, FocusOrigin, isFakeMousedownFromScreenReader, isFakeTouchstartFromScreenReader, } fro...
{ "end_byte": 2522, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu-trigger.ts" }
components/src/material/menu/menu-trigger.ts_2523_10496
@Directive({ selector: `[mat-menu-trigger-for], [matMenuTriggerFor]`, host: { 'class': 'mat-mdc-menu-trigger', '[attr.aria-haspopup]': 'menu ? "menu" : null', '[attr.aria-expanded]': 'menuOpen', '[attr.aria-controls]': 'menuOpen ? menu.panelId : null', '(click)': '_handleClick($event)', '(mo...
{ "end_byte": 10496, "start_byte": 2523, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu-trigger.ts" }
components/src/material/menu/menu-trigger.ts_10499_18988
private _destroyMenu(reason: MenuCloseReason) { if (!this._overlayRef || !this.menuOpen) { return; } const menu = this.menu; this._closingActionsSubscription.unsubscribe(); this._overlayRef.detach(); // Always restore focus if the user is navigating using the keyboard or the menu was ope...
{ "end_byte": 18988, "start_byte": 10499, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu-trigger.ts" }
components/src/material/menu/menu-trigger.ts_18991_21772
_handleKeydown(event: KeyboardEvent): void { const keyCode = event.keyCode; // Pressing enter on the trigger will trigger the click handler later. if (keyCode === ENTER || keyCode === SPACE) { this._openedBy = 'keyboard'; } if ( this.triggersSubmenu() && ((keyCode === RIGHT_ARROW...
{ "end_byte": 21772, "start_byte": 18991, "url": "https://github.com/angular/components/blob/main/src/material/menu/menu-trigger.ts" }
components/src/material/menu/testing/menu-harness.ts_0_7181
/** * @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 { ComponentHarnessConstructor, ContentContainerComponentHarness, HarnessLoader, HarnessPredicate, T...
{ "end_byte": 7181, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/testing/menu-harness.ts" }
components/src/material/menu/testing/menu-harness-filters.ts_0_857
/** * @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 {BaseHarnessFilters} from '@angular/cdk/testing'; /** A set of criteria that can be used to filter a list of...
{ "end_byte": 857, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/testing/menu-harness-filters.ts" }
components/src/material/menu/testing/menu-harness.spec.ts_0_7409
import {Component} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import {HarnessLoader} from '@angular/cdk/testing'; import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed'; import {MatMenuModule} from '@angular/material/menu'; import {NoopAnimationsModule} from '...
{ "end_byte": 7409, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/testing/menu-harness.spec.ts" }
components/src/material/menu/testing/public-api.ts_0_276
/** * @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 */ export * from './menu-harness'; export * from './menu-harness-filters';
{ "end_byte": 276, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/testing/public-api.ts" }
components/src/material/menu/testing/BUILD.bazel_0_830
load("//tools:defaults.bzl", "ng_test_library", "ng_web_test_suite", "ts_library") package(default_visibility = ["//visibility:public"]) ts_library( name = "testing", srcs = glob( ["**/*.ts"], exclude = ["**/*.spec.ts"], ), deps = [ "//src/cdk/coercion", "//src/cdk/test...
{ "end_byte": 830, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/testing/BUILD.bazel" }
components/src/material/menu/testing/index.ts_0_234
/** * @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 */ export * from './public-api';
{ "end_byte": 234, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/menu/testing/index.ts" }
components/src/material/grid-list/grid-tile.html_0_71
<div class="mat-grid-tile-content"> <ng-content></ng-content> </div>
{ "end_byte": 71, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/grid-list/grid-tile.html" }
components/src/material/grid-list/grid-list.ts_0_5720
/** * @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 { Component, ViewEncapsulation, AfterContentChecked, OnInit, Input, ContentChildren, QueryList,...
{ "end_byte": 5720, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/grid-list/grid-list.ts" }
components/src/material/grid-list/grid-tile.ts_0_3339
/** * @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 { Component, ViewEncapsulation, ElementRef, Input, ContentChildren, QueryList, AfterContentInit...
{ "end_byte": 3339, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/grid-list/grid-tile.ts" }
components/src/material/grid-list/grid-list.scss_0_2246
@use '../core/style/list-common'; @use '../core/style/layout-common'; @use '../core/tokens/m2/mat/grid-list' as tokens-mat-grid-list; @use '../core/tokens/token-utils'; // height of tile header or footer if it has one line $one-line-height: 48px; // height of tile header or footer if it has two lines $two-line-height...
{ "end_byte": 2246, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/grid-list/grid-list.scss" }
components/src/material/grid-list/grid-list-base.ts_0_617
/** * @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 {InjectionToken} from '@angular/core'; /** * Injection token used to provide a grid list to a tile and to a...
{ "end_byte": 617, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/grid-list/grid-list-base.ts" }
components/src/material/grid-list/public-api.ts_0_450
/** * @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 {TileCoordinator} from './tile-coordinator'; export * from './grid-list-module'; export * from './grid-list';...
{ "end_byte": 450, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/grid-list/public-api.ts" }
components/src/material/grid-list/grid-list.md_0_2528
`mat-grid-list` is a two-dimensional list view that arranges cells into grid-based layout. See Material Design spec [here](https://material.io/design/components/image-lists.html). <!-- example(grid-list-overview) --> ### Setting the number of columns An `mat-grid-list` must specify a `cols` attribute which sets the ...
{ "end_byte": 2528, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/grid-list/grid-list.md" }
components/src/material/grid-list/_grid-list-theme.scss_0_2552
@use 'sass:map'; @use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/theming/validation'; @use '../core/typography/typography'; @use '../core/tokens/m2/mat/grid-list' as tokens-mat-grid-list; @use '../core/style/sass-utils'; @use '../core/tokens/token-utils'; @mixin base($theme) { @if in...
{ "end_byte": 2552, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/grid-list/_grid-list-theme.scss" }
components/src/material/grid-list/grid-list.html_0_40
<div> <ng-content></ng-content> </div>
{ "end_byte": 40, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/grid-list/grid-list.html" }
components/src/material/grid-list/grid-list.spec.ts_0_346
import {Directionality} from '@angular/cdk/bidi'; import {Component, DebugElement, Type, ViewChild} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import {By} from '@angular/platform-browser'; import {MatGridTile, MatGridTileText} from './grid-tile'; import {MatGridList, MatGridL...
{ "end_byte": 346, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/grid-list/grid-list.spec.ts" }
components/src/material/grid-list/grid-list.spec.ts_348_8728
describe('MatGridList', () => { function createComponent<T>(componentType: Type<T>): ComponentFixture<T> { TestBed.configureTestingModule({ imports: [MatGridListModule], declarations: [componentType], }); return TestBed.createComponent<T>(componentType); } it('should throw error if cols ...
{ "end_byte": 8728, "start_byte": 348, "url": "https://github.com/angular/components/blob/main/src/material/grid-list/grid-list.spec.ts" }