_id
stringlengths
21
254
text
stringlengths
1
93.7k
metadata
dict
components/src/material/button-toggle/testing/public-api.ts_0_396
/** * @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 './button-toggle-harness'; export * from './button-toggle-harness-filters'; export * from './button-to...
{ "end_byte": 396, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/testing/public-api.ts" }
components/src/material/button-toggle/testing/button-toggle-harness-filters.ts_0_765
/** * @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'; /** Criteria that can be used to filter a list of `MatButt...
{ "end_byte": 765, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/testing/button-toggle-harness-filters.ts" }
components/src/material/button-toggle/testing/button-toggle-group.spec.ts_0_3559
import {HarnessLoader} from '@angular/cdk/testing'; import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed'; import {Component} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import {MatButtonToggleAppearance, MatButtonToggleModule} from '@angular/material/button-t...
{ "end_byte": 3559, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/testing/button-toggle-group.spec.ts" }
components/src/material/button-toggle/testing/button-toggle-harness.spec.ts_0_6457
import {HarnessLoader} from '@angular/cdk/testing'; import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed'; import {Component} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import {MatButtonToggleModule} from '@angular/material/button-toggle'; import {MatButtonTo...
{ "end_byte": 6457, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/testing/button-toggle-harness.spec.ts" }
components/src/material/button-toggle/testing/BUILD.bazel_0_755
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": 755, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/testing/BUILD.bazel" }
components/src/material/button-toggle/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/button-toggle/testing/index.ts" }
components/src/material/button/icon-button.scss_0_3286
@use '../core/tokens/m2/mdc/icon-button' as tokens-mdc-icon-button; @use '../core/tokens/m2/mat/icon-button' as tokens-mat-icon-button; @use './button-base'; @use '../core/style/private'; @use '../core/style/vendor-prefixes'; @use '../core/tokens/token-utils'; .mat-mdc-icon-button { @include vendor-prefixes.user-s...
{ "end_byte": 3286, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/icon-button.scss" }
components/src/material/button/_icon-button-theme.scss_0_6265
@use 'sass:map'; @use 'sass:math'; @use '../core/tokens/m2/mdc/icon-button' as tokens-mdc-icon-button; @use '../core/tokens/m2/mat/icon-button' as tokens-mat-icon-button; @use '../core/style/sass-utils'; @use '../core/tokens/token-utils'; @use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/...
{ "end_byte": 6265, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/_icon-button-theme.scss" }
components/src/material/button/icon-button.html_0_399
<span class="mat-mdc-button-persistent-ripple mdc-icon-button__ripple"></span> <ng-content></ng-content> <!-- The indicator can't be directly on the button, because MDC uses ::before for high contrast indication and it can't be on the ripple, because it has a border radius and overflow: hidden. --> <span class="m...
{ "end_byte": 399, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/icon-button.html" }
components/src/material/button/module.ts_0_953
/** * @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": 953, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/module.ts" }
components/src/material/button/button.md_0_4378
Angular Material buttons are native `<button>` or `<a>` elements enhanced with Material Design styling and ink ripples. <!-- example(button-overview) --> Native `<button>` and `<a>` elements are always used in order to provide the most straightforward and accessible experience for users. A `<button>` element should b...
{ "end_byte": 4378, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/button.md" }
components/src/material/button/fab.ts_0_5312
/** * @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, InjectionToken, Input, ViewEncapsulation, booleanAttribute,...
{ "end_byte": 5312, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/fab.ts" }
components/src/material/button/button-high-contrast.scss_0_515
@use '@angular/cdk'; // Add an outline to make buttons more visible in high contrast mode. Stroked buttons and FABs // don't need a special look in high-contrast mode, because those already have an outline. .mat-mdc-button:not(.mdc-button--outlined), .mat-mdc-unelevated-button:not(.mdc-button--outlined), .mat-mdc-rais...
{ "end_byte": 515, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/button-high-contrast.scss" }
components/src/material/button/button.spec.ts_0_6588
import {createMouseEvent, dispatchEvent} from '@angular/cdk/testing/private'; import {ApplicationRef, Component} from '@angular/core'; import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; import {ThemePalette} from '@angular/material/core'; import {By} from '@angular/platform-browser'; import ...
{ "end_byte": 6588, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/button.spec.ts" }
components/src/material/button/button.spec.ts_6591_15648
describe('a[mat-button]', () => { it('should not redirect if disabled', () => { let fixture = TestBed.createComponent(TestApp); let testComponent = fixture.debugElement.componentInstance; let buttonDebugElement = fixture.debugElement.query(By.css('a'))!; testComponent.isDisabled = true; ...
{ "end_byte": 15648, "start_byte": 6591, "url": "https://github.com/angular/components/blob/main/src/material/button/button.spec.ts" }
components/src/material/button/button.scss_0_7935
@use './button-base'; @use '../core/style/private' as style-private; @use '../core/style/vendor-prefixes'; @use '../core/tokens/token-utils'; @use '../core/focus-indicators/private' as focus-indicators-private; @use '../core/tokens/m2/mdc/filled-button' as tokens-mdc-filled-button; @use '../core/tokens/m2/mat/filled-bu...
{ "end_byte": 7935, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/button.scss" }
components/src/material/button/button.scss_7937_12525
.mat-mdc-outlined-button { $mat-outlined-button-slots: tokens-mat-outlined-button.get-token-slots(); border-style: solid; transition: border 280ms cubic-bezier(0.4, 0, 0.2, 1); @include token-utils.use-tokens( tokens-mdc-outlined-button.$prefix, tokens-mdc-outlined-button.get-token-slots() ) { @i...
{ "end_byte": 12525, "start_byte": 7937, "url": "https://github.com/angular/components/blob/main/src/material/button/button.scss" }
components/src/material/button/public-api.ts_0_376
/** * @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 './button'; export * from './fab'; export * from './icon-button'; export * from './module'; export {MA...
{ "end_byte": 376, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/public-api.ts" }
components/src/material/button/button.html_0_776
<span class="mat-mdc-button-persistent-ripple" [class.mdc-button__ripple]="!_isFab" [class.mdc-fab__ripple]="_isFab"></span> <ng-content select=".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])"> </ng-content> <span class="mdc-button__label"><...
{ "end_byte": 776, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/button.html" }
components/src/material/button/button.ts_0_2191
/** * @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, ViewEncapsulation} from '@angular/core'; import {MAT_ANCHOR_HOST, MAT_BU...
{ "end_byte": 2191, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/button.ts" }
components/src/material/button/button-base.ts_0_7238
/** * @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} from '@angular/cdk/a11y'; import {Platform} from '@angular/cdk/platform'; import ...
{ "end_byte": 7238, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/button-base.ts" }
components/src/material/button/button-base.ts_7239_9247
export const MAT_ANCHOR_HOST = { '[attr.disabled]': '_getDisabledAttribute()', '[class.mat-mdc-button-disabled]': 'disabled', '[class.mat-mdc-button-disabled-interactive]': 'disabledInteractive', '[class._mat-animation-noopable]': '_animationMode === "NoopAnimations"', // Note that we ignore the user-specifi...
{ "end_byte": 9247, "start_byte": 7239, "url": "https://github.com/angular/components/blob/main/src/material/button/button-base.ts" }
components/src/material/button/fab.scss_0_6533
@use './button-base'; @use '../core/tokens/token-utils'; @use '../core/style/private' as style-private; @use '../core/style/vendor-prefixes'; @use '../core/focus-indicators/private' as focus-indicators-private; @use '../core/tokens/m2/mdc/extended-fab' as tokens-mdc-extended-fab; @use '../core/tokens/m2/mdc/fab' as tok...
{ "end_byte": 6533, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/fab.scss" }
components/src/material/button/_button-theme.scss_0_7394
@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/theming/validation'; @use '../core/tokens/token-utils'; @use '../core/typography/typography'; @use '../core/tokens/m2/mdc/filled-button' as tokens-mdc-filled-button; @use '../core/tokens/m2/mat/filled-button' as tokens-mat-filled-button; @...
{ "end_byte": 7394, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/_button-theme.scss" }
components/src/material/button/_button-theme.scss_7395_15367
@mixin color($theme, $options...) { @if inspection.get-theme-version($theme) == 1 { @include _theme-from-tokens(inspection.get-theme-tokens($theme, color), $options...); } @else { @include sass-utils.current-selector-or-root() { @include _text-button-variant($theme, null); @include _filled-butto...
{ "end_byte": 15367, "start_byte": 7395, "url": "https://github.com/angular/components/blob/main/src/material/button/_button-theme.scss" }
components/src/material/button/icon-button.ts_0_1713
/** * @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, ViewEncapsulation} from '@angular/core'; import {MAT_ANCHOR_HOST, MAT_BU...
{ "end_byte": 1713, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/icon-button.ts" }
components/src/material/button/BUILD.bazel_0_2189
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 = "button", srcs = glob( ["**/*.ts"], ...
{ "end_byte": 2189, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/BUILD.bazel" }
components/src/material/button/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/button/index.ts" }
components/src/material/button/_fab-theme.scss_0_7302
@use '../core/style/sass-utils'; @use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/theming/validation'; @use '../core/tokens/m2/mdc/fab' as tokens-mdc-fab; @use '../core/tokens/m2/mdc/fab-small' as tokens-mdc-fab-small; @use '../core/tokens/m2/mdc/extended-fab' as tokens-mdc-extended-fab;...
{ "end_byte": 7302, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/_fab-theme.scss" }
components/src/material/button/_fab-theme.scss_7304_8526
@mixin _theme-from-tokens($tokens, $options...) { @include validation.selector-defined( 'Calls to Angular Material theme mixins with an M3 theme must be wrapped in a selector' ); $mdc-extended-fab-tokens: token-utils.get-tokens-for( $tokens, tokens-mdc-extended-fab.$prefix, $options... ); $mdc...
{ "end_byte": 8526, "start_byte": 7304, "url": "https://github.com/angular/components/blob/main/src/material/button/_fab-theme.scss" }
components/src/material/button/_button-base.scss_0_6153
@use '../core/tokens/token-utils'; @use '../core/style/layout-common'; // Adds styles necessary to provide stateful interactions with the button. This includes providing // content for the state container's ::before and ::after so that they can be given a background // color and opacity for states like hover, active, ...
{ "end_byte": 6153, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/_button-base.scss" }
components/src/material/button/testing/public-api.ts_0_280
/** * @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 './button-harness'; export * from './button-harness-filters';
{ "end_byte": 280, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/testing/public-api.ts" }
components/src/material/button/testing/button-harness-filters.ts_0_809
/** * @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'; /** Possible button appearances. */ export type ButtonVari...
{ "end_byte": 809, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/testing/button-harness-filters.ts" }
components/src/material/button/testing/BUILD.bazel_0_899
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", "@npm//@angular/...
{ "end_byte": 899, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/testing/BUILD.bazel" }
components/src/material/button/testing/button-harness.ts_0_4039
/** * @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 {booleanAttribute} from '@angular/core'; import { ComponentHarnessConstructor, ContentContainerComponentH...
{ "end_byte": 4039, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/testing/button-harness.ts" }
components/src/material/button/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/button/testing/index.ts" }
components/src/material/button/testing/button-harness.spec.ts_0_7059
import {Component} from '@angular/core'; import {ComponentFixture, inject, TestBed} from '@angular/core/testing'; import {Platform, PlatformModule} from '@angular/cdk/platform'; import {HarnessLoader, parallel} from '@angular/cdk/testing'; import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed'; import {...
{ "end_byte": 7059, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button/testing/button-harness.spec.ts" }
components/src/material/table/table.spec.ts_0_8537
import {AfterViewInit, Component, OnInit, ViewChild} from '@angular/core'; import { waitForAsync, ComponentFixture, fakeAsync, flushMicrotasks, TestBed, tick, } from '@angular/core/testing'; import {MatTable, MatTableDataSource, MatTableModule} from './index'; import {DataSource} from '@angular/cdk/table'; ...
{ "end_byte": 8537, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/table/table.spec.ts" }
components/src/material/table/table.spec.ts_8541_16062
describe('with MatTableDataSource and sort/pagination/filter', () => { let tableElement: HTMLElement; let fixture: ComponentFixture<ArrayDataSourceMatTableApp>; let dataSource: MatTableDataSource<TestData>; let component: ArrayDataSourceMatTableApp; beforeEach(() => { fixture = TestBed.create...
{ "end_byte": 16062, "start_byte": 8541, "url": "https://github.com/angular/components/blob/main/src/material/table/table.spec.ts" }
components/src/material/table/table.spec.ts_16068_22546
it('should by default correctly sort an empty string', () => { // Activate column A sort dataSource.data[0].a = ' '; component.sort.sort(component.sortHeader); fixture.detectChanges(); // Expect that empty string row comes before the other values expectTableToMatchContent(tableEleme...
{ "end_byte": 22546, "start_byte": 16068, "url": "https://github.com/angular/components/blob/main/src/material/table/table.spec.ts" }
components/src/material/table/table.spec.ts_22548_29910
class FakeDataSource extends DataSource<TestData> { _dataChange = new BehaviorSubject<TestData[]>([]); get data() { return this._dataChange.getValue(); } set data(data: TestData[]) { this._dataChange.next(data); } constructor() { super(); for (let i = 0; i < 4; i++) { this.addData(); ...
{ "end_byte": 29910, "start_byte": 22548, "url": "https://github.com/angular/components/blob/main/src/material/table/table.spec.ts" }
components/src/material/table/table.spec.ts_29912_37864
@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...
{ "end_byte": 37864, "start_byte": 29912, "url": "https://github.com/angular/components/blob/main/src/material/table/table.spec.ts" }
components/src/material/table/table.spec.ts_37866_40102
function getRows(tableElement: Element): Element[] { return getElements(tableElement, '.mat-mdc-row'); } function getCells(row: Element): Element[] { if (!row) { return []; } return getElements(row, 'td'); } function getHeaderCells(headerRow: Element): Element[] { return getElements(headerRow, 'th'); }...
{ "end_byte": 40102, "start_byte": 37866, "url": "https://github.com/angular/components/blob/main/src/material/table/table.spec.ts" }
components/src/material/table/_table-flex-styles.scss_0_1507
// Flex-based table structure $header-row-height: 56px; $row-height: 48px; $row-horizontal-padding: 24px; // Only use tag name selectors here since the styles are shared between MDC and non-MDC @mixin private-table-flex-styles { mat-table { display: block; } mat-header-row { min-height: $header-row-heig...
{ "end_byte": 1507, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/table/_table-flex-styles.scss" }
components/src/material/table/row.ts_0_4431
/** * @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 { CdkFooterRow, CdkFooterRowDef, CdkHeaderRow, CdkHeaderRowDef, CdkRow, CdkRowDef, CdkNoDataRow...
{ "end_byte": 4431, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/table/row.ts" }
components/src/material/table/table.ts_0_3566
/** * @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, Directive, ViewEncapsulation} from '@angular/core'; import { CdkTable,...
{ "end_byte": 3566, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/table/table.ts" }
components/src/material/table/module.ts_0_1275
/** * @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...
{ "end_byte": 1275, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/table/module.ts" }
components/src/material/table/public-api.ts_0_370
/** * @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 './table'; export * from './module'; export * from './cell'; export * from './row'; export * from './t...
{ "end_byte": 370, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/table/public-api.ts" }
components/src/material/table/text-column.ts_0_1979
/** * @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 {CdkTextColumn} from '@angular/cdk/table'; import {ChangeDetectionStrategy, Component, ViewEncapsulation} fro...
{ "end_byte": 1979, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/table/text-column.ts" }
components/src/material/table/table.scss_0_5916
@use '../core/tokens/token-utils'; @use '../core/tokens/m2/mat/table' as tokens-mat-table; @use '../core/style/vendor-prefixes'; @use './table-flex-styles'; .mat-mdc-table-sticky { // Note that the table can either set this class or an inline style to make something sticky. // We set the style as `!important` so t...
{ "end_byte": 5916, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/table/table.scss" }
components/src/material/table/table.md_0_6289
The `mat-table` provides a Material Design styled data-table that can be used to display rows of data. This table builds on the foundation of the CDK data-table and uses a similar interface for its data input and template, except that its element and attribute selectors will be prefixed with `mat-` instead of `cdk-`. ...
{ "end_byte": 6289, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/table/table.md" }
components/src/material/table/table.md_6289_14799
### 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...
{ "end_byte": 14799, "start_byte": 6289, "url": "https://github.com/angular/components/blob/main/src/material/table/table.md" }
components/src/material/table/table.md_14799_19419
#### Sticky Rows and Columns By using `position: sticky` styling, the table's rows and columns can be fixed so that they do not leave the viewport even when scrolled. The table provides inputs that will automatically apply the correct CSS styling so that the rows and columns become sticky. In order to fix the header ...
{ "end_byte": 19419, "start_byte": 14799, "url": "https://github.com/angular/components/blob/main/src/material/table/table.md" }
components/src/material/table/README.md_0_96
Please see the official documentation at https://material.angular.io/components/component/table
{ "end_byte": 96, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/table/README.md" }
components/src/material/table/table-data-source.ts_0_1561
/** * @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 {MatPaginator, PageEvent} from '@angular/material/paginator'; import { BehaviorSubject, combineLatest, ...
{ "end_byte": 1561, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/table/table-data-source.ts" }
components/src/material/table/table-data-source.ts_1562_10056
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...
{ "end_byte": 10056, "start_byte": 1562, "url": "https://github.com/angular/components/blob/main/src/material/table/table-data-source.ts" }
components/src/material/table/table-data-source.ts_10060_15606
nstructor(initialData: T[] = []) { super(); this._data = new BehaviorSubject<T[]>(initialData); this._updateChangeSubscription(); } /** * Subscribe to changes that should trigger an update to the table's rendered rows. When the * changes occur, process the current state of the filter, sort, and p...
{ "end_byte": 15606, "start_byte": 10060, "url": "https://github.com/angular/components/blob/main/src/material/table/table-data-source.ts" }
components/src/material/table/cell.ts_0_3092
/** * @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 {Directive, Input} from '@angular/core'; import { CdkCell, CdkCellDef, CdkColumnDef, CdkFooterCell, ...
{ "end_byte": 3092, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/table/cell.ts" }
components/src/material/table/BUILD.bazel_0_1686
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 = "table", srcs = glob( ["**/*.ts"], e...
{ "end_byte": 1686, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/table/BUILD.bazel" }
components/src/material/table/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/table/index.ts" }
components/src/material/table/_table-theme.scss_0_3046
@use 'sass:map'; @use '../core/tokens/m2/mat/table' as tokens-mat-table; @use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/theming/validation'; @use '../core/typography/typography'; @use '../core/tokens/token-utils'; @use '../core/style/sass-utils'; @mixin base($theme) { @if inspection...
{ "end_byte": 3046, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/table/_table-theme.scss" }
components/src/material/table/testing/table-harness.ts_0_3934
/** * @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, HarnessPredicate, parallel, } from '...
{ "end_byte": 3934, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/table/testing/table-harness.ts" }
components/src/material/table/testing/public-api.ts_0_341
/** * @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 './table-harness'; export * from './row-harness'; export * from './cell-harness'; export * from './tab...
{ "end_byte": 341, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/table/testing/public-api.ts" }
components/src/material/table/testing/table-harness.spec.ts_0_6485
import {Component} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import {HarnessLoader, parallel} from '@angular/cdk/testing'; import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed'; import {MatTableModule} from '../module'; import {MatTableHarness} from './table...
{ "end_byte": 6485, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/table/testing/table-harness.spec.ts" }
components/src/material/table/testing/table-harness.spec.ts_6487_8681
@Component({ template: ` <table mat-table [dataSource]="dataSource"> <ng-container matColumnDef="position"> <th mat-header-cell *matHeaderCellDef>No.</th> <td mat-cell *matCellDef="let element">{{element.position}}</td> <td mat-footer-cell *matFooterCellDef>Number of the element</td>...
{ "end_byte": 8681, "start_byte": 6487, "url": "https://github.com/angular/components/blob/main/src/material/table/testing/table-harness.spec.ts" }
components/src/material/table/testing/table-harness-filters.ts_0_916
/** * @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": 916, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/table/testing/table-harness-filters.ts" }
components/src/material/table/testing/row-harness.ts_0_4287
/** * @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": 4287, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/table/testing/row-harness.ts" }
components/src/material/table/testing/BUILD.bazel_0_677
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": 677, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/table/testing/BUILD.bazel" }
components/src/material/table/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/table/testing/index.ts" }
components/src/material/table/testing/cell-harness.ts_0_3607
/** * @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, HarnessPredicate, } from '@angular/cdk...
{ "end_byte": 3607, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/table/testing/cell-harness.ts" }
components/src/material/list/nav-list.ts_0_1582
/** * @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, InjectionToken, ViewEncapsulation} from '@angular/core'; import {MatList...
{ "end_byte": 1582, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/nav-list.ts" }
components/src/material/list/_list-item-hcm-indicator.scss_0_764
@use '@angular/cdk'; // Renders a circle indicator when Windows Hich Constrast mode (HCM) is enabled. In some // situations, such as a selected option, the list item communicates the selected state by changing // its background color. Since that doesn't work in HCM, this mixin provides an alternative by // rendering a...
{ "end_byte": 764, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/_list-item-hcm-indicator.scss" }
components/src/material/list/list-option.ts_0_4144
/** * @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...
{ "end_byte": 4144, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/list-option.ts" }
components/src/material/list/list-option.ts_4145_11872
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...
{ "end_byte": 11872, "start_byte": 4145, "url": "https://github.com/angular/components/blob/main/src/material/list/list-option.ts" }
components/src/material/list/list-option-types.ts_0_1037
/** * @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'; /** * Type describing possible positions of a checkbox or radio in a...
{ "end_byte": 1037, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/list-option-types.ts" }
components/src/material/list/public-api.ts_0_758
/** * @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'; export * from './list'; export * from './list-module'; export * from './nav-list'; ex...
{ "end_byte": 758, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/public-api.ts" }
components/src/material/list/list-item.html_0_695
<ng-content select="[matListItemAvatar],[matListItemIcon]"></ng-content> <span class="mdc-list-item__content"> <ng-content select="[matListItemTitle]"></ng-content> <ng-content select="[matListItemLine]"></ng-content> <span #unscopedContent class="mat-mdc-list-item-unscoped-content" (cdkObserveContent)="...
{ "end_byte": 695, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/list-item.html" }
components/src/material/list/_list-theme.scss_0_7819
@use 'sass:map'; @use '../core/style/sass-utils'; @use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/theming/validation'; @use '../core/tokens/m2/mat/list' as tokens-mat-list; @use '../core/tokens/m2/mdc/checkbox' as tokens-mdc-checkbox; @use '../core/tokens/m2/mdc/radio' as tokens-mdc-ra...
{ "end_byte": 7819, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/_list-theme.scss" }
components/src/material/list/list.scss_0_7205
@use '../core/style/layout-common'; @use '../core/tokens/m2/mat/list' as tokens-mat-list; @use '../core/tokens/m2/mdc/list' as tokens-mdc-list; @use '../core/tokens/token-utils'; @use './list-item-hcm-indicator'; @use './list-inherited-structure'; @include list-inherited-structure.private-list-inherited-structural-sty...
{ "end_byte": 7205, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/list.scss" }
components/src/material/list/selection-list.ts_0_2396
/** * @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...
{ "end_byte": 2396, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/selection-list.ts" }
components/src/material/list/selection-list.ts_2397_11128
{ _element = inject<ElementRef<HTMLElement>>(ElementRef); private _ngZone = inject(NgZone); private _initialized = false; private _keyManager: FocusKeyManager<MatListOption>; /** Emits when the list has been destroyed. */ private _destroyed = new Subject<void>(); /** Whether the list has been destroyed...
{ "end_byte": 11128, "start_byte": 2397, "url": "https://github.com/angular/components/blob/main/src/material/list/selection-list.ts" }
components/src/material/list/selection-list.ts_11132_16067
/** * Sets the selected state on all of the options * and emits an event if anything changed. */ private _setAllOptionsSelected(isSelected: boolean, skipDisabled?: boolean): MatListOption[] { // Keep track of whether anything changed, because we only want to // emit the changed event when something a...
{ "end_byte": 16067, "start_byte": 11132, "url": "https://github.com/angular/components/blob/main/src/material/list/selection-list.ts" }
components/src/material/list/list.md_0_8345
`<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 ...
{ "end_byte": 8345, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/list.md" }
components/src/material/list/README.md_0_95
Please see the official documentation at https://material.angular.io/components/component/list
{ "end_byte": 95, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/README.md" }
components/src/material/list/list-item-sections.ts_0_3673
/** * @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 {Directive, ElementRef, inject} from '@angular/core'; import {LIST_OPTION, ListOption} from './list-option-ty...
{ "end_byte": 3673, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/list-item-sections.ts" }
components/src/material/list/tokens.ts_0_662
/** * @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'; /** Object that can be used to configure the default options for the ...
{ "end_byte": 662, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/tokens.ts" }
components/src/material/list/_list-inherited-structure.scss_0_7711
@use '../core/style/vendor-prefixes'; @use '../core/tokens/m2/mdc/list' as tokens-mdc-list; @use '../core/tokens/token-utils'; // Includes the structural styles for the list that were inherited from MDC. @mixin private-list-inherited-structural-styles { $tokens: (tokens-mdc-list.$prefix, tokens-mdc-list.get-token-sl...
{ "end_byte": 7711, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/_list-inherited-structure.scss" }
components/src/material/list/_list-inherited-structure.scss_7715_13634
.mdc-list-item__secondary-text { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; display: block; margin-top: 0; @include token-utils.use-tokens($tokens...) { @include token-utils.create-token-slot(color, list-item-supporting-text-color); @include token-utils.create-t...
{ "end_byte": 13634, "start_byte": 7715, "url": "https://github.com/angular/components/blob/main/src/material/list/_list-inherited-structure.scss" }
components/src/material/list/subheader.ts_0_686
/** * @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 {Directive} from '@angular/core'; /** * Directive whose purpose is to add the mat- CSS styling to this sele...
{ "end_byte": 686, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/subheader.ts" }
components/src/material/list/action-list.ts_0_1269
/** * @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, ViewEncapsulation} from '@angular/core'; import {MatListBase} from './li...
{ "end_byte": 1269, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/action-list.ts" }
components/src/material/list/list-module.ts_0_1571
/** * @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...
{ "end_byte": 1571, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/list-module.ts" }
components/src/material/list/BUILD.bazel_0_2462
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 = "list", srcs = glob( ["**/*.ts"], ex...
{ "end_byte": 2462, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/BUILD.bazel" }
components/src/material/list/list-base.ts_0_2037
/** * @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, coerceNumberProperty} from '@angular/cdk/coercion'; import {Platform} f...
{ "end_byte": 2037, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/list-base.ts" }
components/src/material/list/list-base.ts_2038_10422
abstract class MatListItemBase implements AfterViewInit, OnDestroy, RippleTarget { _elementRef = inject<ElementRef<HTMLElement>>(ElementRef); protected _ngZone = inject(NgZone); private _listBase = inject(MatListBase, {optional: true}); private _platform = inject(Platform); /** Query list matching list-item ...
{ "end_byte": 10422, "start_byte": 2038, "url": "https://github.com/angular/components/blob/main/src/material/list/list-base.ts" }
components/src/material/list/list-base.ts_10425_12023
private _inferLinesFromContent() { let numOfLines = this._titles!.length + this._lines!.length; if (this._hasUnscopedTextContent) { numOfLines += 1; } return numOfLines; } /** Checks whether the list item has unscoped text content. */ private _checkDomForUnscopedTextContent() { this._ha...
{ "end_byte": 12023, "start_byte": 10425, "url": "https://github.com/angular/components/blob/main/src/material/list/list-base.ts" }
components/src/material/list/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/index.ts" }
components/src/material/list/list-option.scss_0_2905
@use '../checkbox/checkbox-common'; @use '../radio/radio-common'; @use './list-item-hcm-indicator'; // For compatibility with the non-MDC selection list, we support avatars that are // shown at the end of the list option. This is not supported by the MDC list as the // spec only defines avatars at the beginning of a l...
{ "end_byte": 2905, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/list-option.scss" }
components/src/material/list/selection-list.spec.ts_0_965
import {A, D, DOWN_ARROW, END, ENTER, HOME, SPACE, UP_ARROW} from '@angular/cdk/keycodes'; import { createKeyboardEvent, dispatchEvent, dispatchFakeEvent, dispatchKeyboardEvent, dispatchMouseEvent, } from '@angular/cdk/testing/private'; import { ChangeDetectionStrategy, Component, DebugElement, QueryL...
{ "end_byte": 965, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/list/selection-list.spec.ts" }
components/src/material/list/selection-list.spec.ts_966_10712
{ let fixture: ComponentFixture<SelectionListWithListOptions>; let listOptions: DebugElement[]; let selectionList: DebugElement; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ MatListModule, SelectionListWithListOptions, Selection...
{ "end_byte": 10712, "start_byte": 966, "url": "https://github.com/angular/components/blob/main/src/material/list/selection-list.spec.ts" }
components/src/material/list/selection-list.spec.ts_10718_20238
it('should focus the first option when the list takes focus for the first time', () => { expect(listOptions[0].nativeElement.tabIndex).toBe(0); expect(listOptions.slice(1).every(o => o.nativeElement.tabIndex === -1)).toBe(true); }); it('should focus the first selected option when list receives focu...
{ "end_byte": 20238, "start_byte": 10718, "url": "https://github.com/angular/components/blob/main/src/material/list/selection-list.spec.ts" }