_id
stringlengths
21
254
text
stringlengths
1
93.7k
metadata
dict
components/src/material/stepper/stepper.md_0_8435
Angular Material's stepper provides a wizard-like workflow by dividing content into logical steps. Material stepper builds on the foundation of the CDK stepper that is responsible for the logic that drives a stepped workflow. Material stepper extends the CDK stepper and has Material Design styling. ### Stepper varian...
{ "end_byte": 8435, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/stepper/stepper.md" }
components/src/material/stepper/stepper.md_8435_10101
### Accessibility The stepper is treated as a tabbed view for accessibility purposes, so it is given `role="tablist"` by default. The header of step that can be clicked to select the step is given `role="tab"`, and the content that can be expanded upon selection is given `role="tabpanel"`. `aria-selected` attribute of ...
{ "end_byte": 10101, "start_byte": 8435, "url": "https://github.com/angular/components/blob/main/src/material/stepper/stepper.md" }
components/src/material/stepper/BUILD.bazel_0_2162
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 = "stepper", srcs = glob( ["**/*.ts"], ...
{ "end_byte": 2162, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/stepper/BUILD.bazel" }
components/src/material/stepper/stepper-module.ts_0_1419
/** * @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 {PortalModule} from '@angular/cdk/portal'; import {CdkStepperModule} from '@angular/cdk/stepper'; import {NgM...
{ "end_byte": 1419, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/stepper/stepper-module.ts" }
components/src/material/stepper/step.html_0_115
<ng-template> <ng-content></ng-content> <ng-template [cdkPortalOutlet]="_portal"></ng-template> </ng-template>
{ "end_byte": 115, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/stepper/step.html" }
components/src/material/stepper/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/stepper/index.ts" }
components/src/material/stepper/_stepper-variables.scss_0_959
$header-height: 72px !default; // Minimum height for highest density stepper's is determined based on how much // stepper headers can shrink until the step icon or step label exceed. We can't use // a value below `42px` because the optional label for steps would otherwise exceed. $header-minimum-height: 42px !default; ...
{ "end_byte": 959, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/stepper/_stepper-variables.scss" }
components/src/material/stepper/stepper.spec.ts_0_1628
import {Direction, Directionality} from '@angular/cdk/bidi'; import { DOWN_ARROW, END, ENTER, HOME, LEFT_ARROW, RIGHT_ARROW, SPACE, UP_ARROW, } from '@angular/cdk/keycodes'; import {_supportsShadowDom} from '@angular/cdk/platform'; import { CdkStep, STEPPER_GLOBAL_OPTIONS, STEP_STATE, StepperOri...
{ "end_byte": 1628, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/stepper/stepper.spec.ts" }
components/src/material/stepper/stepper.spec.ts_1630_10903
describe('MatStepper', () => { beforeEach(() => { dir = { value: 'ltr', change: new EventEmitter(), }; }); describe('basic stepper', () => { let fixture: ComponentFixture<SimpleMatVerticalStepperApp>; beforeEach(() => { fixture = createComponent(SimpleMatVerticalStepperApp); ...
{ "end_byte": 10903, "start_byte": 1630, "url": "https://github.com/angular/components/blob/main/src/material/stepper/stepper.spec.ts" }
components/src/material/stepper/stepper.spec.ts_10909_20156
it('should only be able to return to a previous step if it is editable', () => { const stepperComponent = fixture.debugElement.query( By.directive(MatStepper), )!.componentInstance; stepperComponent.selectedIndex = 1; stepperComponent.steps.toArray()[0].editable = false; const pre...
{ "end_byte": 20156, "start_byte": 10909, "url": "https://github.com/angular/components/blob/main/src/material/stepper/stepper.spec.ts" }
components/src/material/stepper/stepper.spec.ts_20160_22989
describe('icon overrides', () => { let fixture: ComponentFixture<IconOverridesStepper>; beforeEach(() => { fixture = createComponent(IconOverridesStepper); fixture.detectChanges(); }); it('should allow for the `edit` icon to be overridden', () => { const stepperDebugElement = fixture...
{ "end_byte": 22989, "start_byte": 20160, "url": "https://github.com/angular/components/blob/main/src/material/stepper/stepper.spec.ts" }
components/src/material/stepper/stepper.spec.ts_22993_32227
describe('linear stepper', () => { let fixture: ComponentFixture<LinearMatVerticalStepperApp>; let testComponent: LinearMatVerticalStepperApp; let stepperComponent: MatStepper; beforeEach(() => { fixture = createComponent(LinearMatVerticalStepperApp, [], [], undefined, []); fixture.detectCh...
{ "end_byte": 32227, "start_byte": 22993, "url": "https://github.com/angular/components/blob/main/src/material/stepper/stepper.spec.ts" }
components/src/material/stepper/stepper.spec.ts_32231_39274
describe('linear stepper with a pre-defined selectedIndex', () => { let preselectedFixture: ComponentFixture<SimplePreselectedMatHorizontalStepperApp>; let stepper: MatStepper; beforeEach(() => { preselectedFixture = createComponent(SimplePreselectedMatHorizontalStepperApp); preselectedFixture....
{ "end_byte": 39274, "start_byte": 32231, "url": "https://github.com/angular/components/blob/main/src/material/stepper/stepper.spec.ts" }
components/src/material/stepper/stepper.spec.ts_39278_48625
describe('horizontal stepper', () => { it('should set the aria-orientation to "horizontal"', () => { const fixture = createComponent(SimpleMatHorizontalStepperApp); fixture.detectChanges(); const stepperEl = fixture.debugElement.query(By.css('mat-stepper'))!.nativeElement; expect(stepperEl....
{ "end_byte": 48625, "start_byte": 39278, "url": "https://github.com/angular/components/blob/main/src/material/stepper/stepper.spec.ts" }
components/src/material/stepper/stepper.spec.ts_48629_57644
describe('stepper with error state', () => { let fixture: ComponentFixture<MatHorizontalStepperWithErrorsApp>; let stepper: MatStepper; function createFixture(showErrorByDefault: boolean | undefined) { fixture = createComponent( MatHorizontalStepperWithErrorsApp, [ { ...
{ "end_byte": 57644, "start_byte": 48629, "url": "https://github.com/angular/components/blob/main/src/material/stepper/stepper.spec.ts" }
components/src/material/stepper/stepper.spec.ts_57648_65624
describe('stepper with two-way binding on selectedIndex', () => { it('should update selectedIndex in component on navigation', () => { const fixture = createComponent(StepperWithTwoWayBindingOnSelectedIndex); fixture.detectChanges(); expect(fixture.componentInstance.index).toBe(0); const s...
{ "end_byte": 65624, "start_byte": 57648, "url": "https://github.com/angular/components/blob/main/src/material/stepper/stepper.spec.ts" }
components/src/material/stepper/stepper.spec.ts_65626_73021
@Component({ template: ` <form [formGroup]="formGroup"> <mat-stepper> <mat-step errorMessage="This field is required" [stepControl]="formGroup.get('firstNameCtrl')"> <ng-template matStepLabel>Step 1</ng-template> <mat-form-field> <mat-label>First name</mat-label> ...
{ "end_byte": 73021, "start_byte": 65626, "url": "https://github.com/angular/components/blob/main/src/material/stepper/stepper.spec.ts" }
components/src/material/stepper/stepper.spec.ts_73023_77376
@Component({ template: ` <mat-stepper> @if (true) { <ng-template matStepperIcon="edit">Custom edit</ng-template> <ng-template matStepperIcon="done">Custom done</ng-template> <ng-template matStepperIcon="number" let-index="index"> {{getRomanNumeral(index + 1)}} </ng-...
{ "end_byte": 77376, "start_byte": 73023, "url": "https://github.com/angular/components/blob/main/src/material/stepper/stepper.spec.ts" }
components/src/material/stepper/stepper.ts_0_4057
/** * @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 {CdkStep, CdkStepper, StepContentPositionState} from '@angular/cdk/stepper'; import {AnimationEvent} from '@a...
{ "end_byte": 4057, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/stepper/stepper.ts" }
components/src/material/stepper/stepper.ts_4059_8963
@Component({ selector: 'mat-stepper, mat-vertical-stepper, mat-horizontal-stepper, [matStepper]', exportAs: 'matStepper, matVerticalStepper, matHorizontalStepper', templateUrl: 'stepper.html', styleUrl: 'stepper.css', host: { '[class.mat-stepper-horizontal]': 'orientation === "horizontal"', '[class.ma...
{ "end_byte": 8963, "start_byte": 4059, "url": "https://github.com/angular/components/blob/main/src/material/stepper/stepper.ts" }
components/src/material/stepper/stepper-animations.ts_0_2451
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import { animate, state, style, transition, trigger, AnimationTriggerMetadata, group, query, animat...
{ "end_byte": 2451, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/stepper/stepper-animations.ts" }
components/src/material/stepper/step-label.ts_0_393
/** * @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'; import {CdkStepLabel} from '@angular/cdk/stepper'; @Directive({ selector...
{ "end_byte": 393, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/stepper/step-label.ts" }
components/src/material/stepper/testing/stepper-button-harnesses.ts_0_2436
/** * @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 {StepperButtonHarnessFilters} from '...
{ "end_byte": 2436, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/stepper/testing/stepper-button-harnesses.ts" }
components/src/material/stepper/testing/stepper-harness.ts_0_2299
/** * @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 {MatStepHarness} from './step-harnes...
{ "end_byte": 2299, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/stepper/testing/stepper-harness.ts" }
components/src/material/stepper/testing/public-api.ts_0_355
/** * @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 './stepper-harness'; export * from './step-harness'; export * from './step-harness-filters'; export * ...
{ "end_byte": 355, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/stepper/testing/public-api.ts" }
components/src/material/stepper/testing/stepper-harness.spec.ts_0_728
import {Component} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ReactiveFormsModule, FormGroup, FormControl, Validators} from '@angular/forms'; import {HarnessLoader, parallel} from '@angular/cdk/testing'; import {TestbedHarnessEnvironment} from '@angular/cdk/testing/te...
{ "end_byte": 728, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/stepper/testing/stepper-harness.spec.ts" }
components/src/material/stepper/testing/stepper-harness.spec.ts_730_8969
describe('MatStepperHarness', () => { let fixture: ComponentFixture<StepperHarnessTest>; let loader: HarnessLoader; beforeEach(() => { TestBed.configureTestingModule({ imports: [MatStepperModule, NoopAnimationsModule, ReactiveFormsModule, StepperHarnessTest], providers: [ { prov...
{ "end_byte": 8969, "start_byte": 730, "url": "https://github.com/angular/components/blob/main/src/material/stepper/testing/stepper-harness.spec.ts" }
components/src/material/stepper/testing/stepper-harness.spec.ts_8971_10677
@Component({ template: ` <mat-stepper orientation="vertical" id="one-stepper"> <mat-step label="One"> <button matStepperNext>Next</button> </mat-step> <mat-step label="Two"> <button matStepperPrevious>Previous</button> <button matStepperNext>Next</button> </mat-step...
{ "end_byte": 10677, "start_byte": 8971, "url": "https://github.com/angular/components/blob/main/src/material/stepper/testing/stepper-harness.spec.ts" }
components/src/material/stepper/testing/BUILD.bazel_0_820
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": 820, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/stepper/testing/BUILD.bazel" }
components/src/material/stepper/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/stepper/testing/index.ts" }
components/src/material/stepper/testing/step-harness.ts_0_4554
/** * @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 { ContentContainerComponentHarness, HarnessPredicate, HarnessLoader, } from '@angular/cdk/testing'; imp...
{ "end_byte": 4554, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/stepper/testing/step-harness.ts" }
components/src/material/stepper/testing/step-harness-filters.ts_0_1394
/** * @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 orientations for a stepper. */ export enum Ste...
{ "end_byte": 1394, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/stepper/testing/step-harness-filters.ts" }
components/src/material/progress-spinner/module.ts_0_531
/** * @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 {MatProgressS...
{ "end_byte": 531, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/progress-spinner/module.ts" }
components/src/material/progress-spinner/progress-spinner.spec.ts_0_341
import {waitForAsync, TestBed} from '@angular/core/testing'; import {By} from '@angular/platform-browser'; import {Component, ElementRef, ViewChild, ViewEncapsulation, signal} from '@angular/core'; import {MatProgressSpinnerModule} from './module'; import {MatProgressSpinner, MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS} from ...
{ "end_byte": 341, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/progress-spinner/progress-spinner.spec.ts" }
components/src/material/progress-spinner/progress-spinner.spec.ts_343_10353
describe('MatProgressSpinner', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ MatProgressSpinnerModule, BasicProgressSpinner, IndeterminateProgressSpinner, ProgressSpinnerWithValueAndBoundMode, ProgressSpinnerWithColor, Pro...
{ "end_byte": 10353, "start_byte": 343, "url": "https://github.com/angular/components/blob/main/src/material/progress-spinner/progress-spinner.spec.ts" }
components/src/material/progress-spinner/progress-spinner.spec.ts_10357_18262
it('should remove the underlying SVG element from the tab order explicitly', () => { const fixture = TestBed.createComponent(BasicProgressSpinner); fixture.detectChanges(); expect(fixture.nativeElement.querySelector('svg').getAttribute('focusable')).toBe('false'); }); it('should handle the number inp...
{ "end_byte": 18262, "start_byte": 10357, "url": "https://github.com/angular/components/blob/main/src/material/progress-spinner/progress-spinner.spec.ts" }
components/src/material/progress-spinner/public-api.ts_0_266
/** * @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 './progress-spinner'; export * from './module';
{ "end_byte": 266, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/progress-spinner/public-api.ts" }
components/src/material/progress-spinner/README.md_0_107
Please see the official documentation at https://material.angular.io/components/component/progress-spinner
{ "end_byte": 107, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/progress-spinner/README.md" }
components/src/material/progress-spinner/_progress-spinner-theme.scss_0_4340
@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/mdc/circular-progress' as tokens-mdc-circular-progress; /// Outputs base theme styles (styles not dependent on the color, typ...
{ "end_byte": 4340, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/progress-spinner/_progress-spinner-theme.scss" }
components/src/material/progress-spinner/progress-spinner.ts_0_7044
/** * @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, InjectionToken, Input, ViewChild, ViewEncapsu...
{ "end_byte": 7044, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/progress-spinner/progress-spinner.ts" }
components/src/material/progress-spinner/BUILD.bazel_0_1547
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 = "progress-spinner", srcs = glob( ["**/*.ts"]...
{ "end_byte": 1547, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/progress-spinner/BUILD.bazel" }
components/src/material/progress-spinner/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/progress-spinner/index.ts" }
components/src/material/progress-spinner/progress-spinner.scss_0_5447
@use '@angular/cdk'; @use '../core/tokens/token-utils'; @use '../core/tokens/m2/mdc/circular-progress' as tokens-mdc-circular-progress; .mat-mdc-progress-spinner { // Explicitly set to `block` since the browser defaults custom elements to `inline`. display: block; // Prevents the spinning of the inner element f...
{ "end_byte": 5447, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/progress-spinner/progress-spinner.scss" }
components/src/material/progress-spinner/progress-spinner.html_0_1889
<ng-template #circle> <svg [attr.viewBox]="_viewBox()" class="mdc-circular-progress__indeterminate-circle-graphic" xmlns="http://www.w3.org/2000/svg" focusable="false"> <circle [attr.r]="_circleRadius()" [style.stroke-dasharray.px]="_strokeCircumference()" [style.stroke-dashoffset.p...
{ "end_byte": 1889, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/progress-spinner/progress-spinner.html" }
components/src/material/progress-spinner/progress-spinner.md_0_1298
`<mat-progress-spinner>` and `<mat-spinner>` are a circular indicators of progress and activity. <!-- example(progress-spinner-overview) --> ### Progress mode The progress-spinner supports two modes, "determinate" and "indeterminate". The `<mat-spinner>` component is an alias for `<mat-progress-spinner mode="indeterm...
{ "end_byte": 1298, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/progress-spinner/progress-spinner.md" }
components/src/material/progress-spinner/testing/progress-spinner-harness.ts_0_1795
/** * @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 {coerceNumberProperty} from '@angular/cdk/coercion'; import { ComponentHarness, ComponentHarnessConstruct...
{ "end_byte": 1795, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/progress-spinner/testing/progress-spinner-harness.ts" }
components/src/material/progress-spinner/testing/public-api.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 * from './progress-spinner-harness'; export * from './progress-spinner-harness-filters';
{ "end_byte": 300, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/progress-spinner/testing/public-api.ts" }
components/src/material/progress-spinner/testing/BUILD.bazel_0_817
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite") package(default_visibility = ["//visibility:public"]) ng_module( name = "testing", srcs = glob( ["**/*.ts"], exclude = ["**/*.spec.ts"], ), deps = [ "//src/cdk/coercion", "//src/cdk/testin...
{ "end_byte": 817, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/progress-spinner/testing/BUILD.bazel" }
components/src/material/progress-spinner/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/progress-spinner/testing/index.ts" }
components/src/material/progress-spinner/testing/progress-spinner-harness-filters.ts_0_440
/** * @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": 440, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/progress-spinner/testing/progress-spinner-harness-filters.ts" }
components/src/material/progress-spinner/testing/progress-spinner-harness.spec.ts_0_2131
import {Component, signal} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import {HarnessLoader} from '@angular/cdk/testing'; import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed'; import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; impor...
{ "end_byte": 2131, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/progress-spinner/testing/progress-spinner-harness.spec.ts" }
components/src/material/dialog/dialog.zone.spec.ts_0_3163
import {Directionality} from '@angular/cdk/bidi'; import {ScrollDispatcher} from '@angular/cdk/scrolling'; import {SpyLocation} from '@angular/common/testing'; import { Component, Directive, Injector, NgZone, ViewChild, ViewContainerRef, provideZoneChangeDetection, inject, } from '@angular/core'; import...
{ "end_byte": 3163, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog.zone.spec.ts" }
components/src/material/dialog/dialog-content-directives.ts_0_6284
/** * @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, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, inject, } from '...
{ "end_byte": 6284, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog-content-directives.ts" }
components/src/material/dialog/dialog-animations.ts_0_1774
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import { animate, state, style, transition, trigger, AnimationTriggerMetadata, query, animateChild, ...
{ "end_byte": 1774, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog-animations.ts" }
components/src/material/dialog/module.ts_0_996
/** * @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 {DialogModule} from '@angular/cdk/dialog'; import {OverlayModule} from '@angular/cdk/overlay'; import {Portal...
{ "end_byte": 996, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/module.ts" }
components/src/material/dialog/dialog.scss_0_1928
@use '@angular/cdk'; @use '../core/tokens/m2/mdc/dialog' as tokens-mdc-dialog; @use '../core/tokens/m2/mat/dialog' as tokens-mat-dialog; @use '../core/tokens/token-utils'; @use '../core/style/variables'; // Dialog content max height. This has been copied from the standard dialog // and is needed to make the dialog con...
{ "end_byte": 1928, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog.scss" }
components/src/material/dialog/dialog.scss_1929_9337
.cdk-overlay-pane.mat-mdc-dialog-panel { @include _use-mat-tokens { @include token-utils.create-token-slot(max-width, container-max-width, $_emit-fallbacks); @include token-utils.create-token-slot(min-width, container-min-width, $_emit-fallbacks); @media (variables.$xsmall) { @include t...
{ "end_byte": 9337, "start_byte": 1929, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog.scss" }
components/src/material/dialog/public-api.ts_0_570
/** * @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 './dialog'; export * from './dialog-config'; export * from './dialog-ref'; export { MatDialogActions...
{ "end_byte": 570, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/public-api.ts" }
components/src/material/dialog/README.md_0_97
Please see the official documentation at https://material.angular.io/components/component/dialog
{ "end_byte": 97, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/README.md" }
components/src/material/dialog/dialog.md_0_7108
The `MatDialog` service can be used to open modal dialogs with Material Design styling and animations. <!-- example(dialog-overview) --> A dialog is opened by calling the `open` method with a component to be loaded and an optional config object. The `open` method will return an instance of `MatDialogRef`: ```ts let ...
{ "end_byte": 7108, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog.md" }
components/src/material/dialog/_dialog-theme.scss_0_3675
@use 'sass:map'; @use '../core/style/sass-utils'; @use '../core/tokens/m2/mdc/dialog' as tokens-mdc-dialog; @use '../core/tokens/m2/mat/dialog' as tokens-mat-dialog; @use '../core/tokens/token-utils'; @use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/theming/validation'; @use '../core/typ...
{ "end_byte": 3675, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/_dialog-theme.scss" }
components/src/material/dialog/dialog-config.ts_0_4980
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {ViewContainerRef, Injector} from '@angular/core'; import {Direction} from '@angular/cdk/bidi'; import {Scrol...
{ "end_byte": 4980, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog-config.ts" }
components/src/material/dialog/BUILD.bazel_0_1672
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 = "dialog", srcs = glob( ["**/*.ts"], ...
{ "end_byte": 1672, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/BUILD.bazel" }
components/src/material/dialog/dialog-container.ts_0_2174
/** * @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, ComponentRef, EventEmitter, OnDestroy, ViewEncapsulation, ...
{ "end_byte": 2174, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog-container.ts" }
components/src/material/dialog/dialog-container.ts_2175_11093
class MatDialogContainer extends CdkDialogContainer<MatDialogConfig> implements OnDestroy { private _animationMode = inject(ANIMATION_MODULE_TYPE, {optional: true}); /** Emits when an animation state changes. */ _animationStateChanged = new EventEmitter<LegacyDialogAnimationEvent>(); /** Whether animations ar...
{ "end_byte": 11093, "start_byte": 2175, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog-container.ts" }
components/src/material/dialog/dialog-container.ts_11094_11561
function parseCssTime(time: string | number | undefined): number | null { if (time == null) { return null; } if (typeof time === 'number') { return time; } if (time.endsWith('ms')) { return coerceNumberProperty(time.substring(0, time.length - 2)); } if (time.endsWith('s')) { return coerceN...
{ "end_byte": 11561, "start_byte": 11094, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog-container.ts" }
components/src/material/dialog/dialog.ts_0_8557
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {ComponentType, Overlay, ScrollStrategy} from '@angular/cdk/overlay'; import { ComponentRef, Injectable, ...
{ "end_byte": 8557, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog.ts" }
components/src/material/dialog/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/dialog/index.ts" }
components/src/material/dialog/dialog.spec.ts_0_1454
import {FocusMonitor, FocusOrigin} from '@angular/cdk/a11y'; import {Directionality} from '@angular/cdk/bidi'; import {A, ESCAPE} from '@angular/cdk/keycodes'; import {Overlay, OverlayContainer, ScrollStrategy} from '@angular/cdk/overlay'; import {_supportsShadowDom} from '@angular/cdk/platform'; import {ScrollDispatch...
{ "end_byte": 1454, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog.spec.ts" }
components/src/material/dialog/dialog.spec.ts_1456_11331
describe('MatDialog', () => { let dialog: MatDialog; let overlayContainerElement: HTMLElement; let scrolledSubject = new Subject(); let focusMonitor: FocusMonitor; let testViewContainerRef: ViewContainerRef; let viewContainerFixture: ComponentFixture<ComponentWithChildViewContainer>; let mockLocation: Sp...
{ "end_byte": 11331, "start_byte": 1456, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog.spec.ts" }
components/src/material/dialog/dialog.spec.ts_11335_20221
it('should close when clicking on the overlay backdrop', fakeAsync(() => { dialog.open(PizzaMsg, {viewContainerRef: testViewContainerRef}); viewContainerFixture.detectChanges(); let backdrop = overlayContainerElement.querySelector('.cdk-overlay-backdrop') as HTMLElement; backdrop.click(); viewCon...
{ "end_byte": 20221, "start_byte": 11335, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog.spec.ts" }
components/src/material/dialog/dialog.spec.ts_20225_29381
it('should use the passed in ViewContainerRef from the config', fakeAsync(() => { const dialogRef = dialog.open(PizzaMsg, {viewContainerRef: testViewContainerRef}); viewContainerFixture.detectChanges(); flush(); // One view ref is for the container and one more for the component with the content. e...
{ "end_byte": 29381, "start_byte": 20225, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog.spec.ts" }
components/src/material/dialog/dialog.spec.ts_29385_38048
describe('disableClose option', () => { it('should prevent closing via clicks on the backdrop', fakeAsync(() => { dialog.open(PizzaMsg, {disableClose: true, viewContainerRef: testViewContainerRef}); viewContainerFixture.detectChanges(); let backdrop = overlayContainerElement.querySelector('.cdk-...
{ "end_byte": 38048, "start_byte": 29385, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog.spec.ts" }
components/src/material/dialog/dialog.spec.ts_38052_46631
describe('focus management', () => { // When testing focus, all of the elements must be in the DOM. beforeEach(() => document.body.appendChild(overlayContainerElement)); afterEach(() => overlayContainerElement.remove()); it('should focus the first tabbable element of the dialog on open (the default)', ...
{ "end_byte": 46631, "start_byte": 38052, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog.spec.ts" }
components/src/material/dialog/dialog.spec.ts_46637_51823
it('should re-focus via mouse if the close button has been clicked', fakeAsync(() => { const button = document.createElement('button'); let lastFocusOrigin: FocusOrigin = null; focusMonitor.monitor(button, false).subscribe(focusOrigin => (lastFocusOrigin = focusOrigin)); document.body.appendCh...
{ "end_byte": 51823, "start_byte": 46637, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog.spec.ts" }
components/src/material/dialog/dialog.spec.ts_51827_62006
describe('dialog content elements', () => { let dialogRef: MatDialogRef<any>; let hostInstance: ContentElementDialog | ComponentWithContentElementTemplateRef; describe('inside component dialog', () => { beforeEach(fakeAsync(() => { dialogRef = dialog.open(ContentElementDialog, {viewContainerR...
{ "end_byte": 62006, "start_byte": 51827, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog.spec.ts" }
components/src/material/dialog/dialog.spec.ts_62010_72014
describe('aria-label', () => { it('should be able to set a custom aria-label', () => { dialog.open(PizzaMsg, {ariaLabel: 'Hello there', viewContainerRef: testViewContainerRef}); viewContainerFixture.detectChanges(); const container = overlayContainerElement.querySelector('mat-dialog-container')!;...
{ "end_byte": 72014, "start_byte": 62010, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog.spec.ts" }
components/src/material/dialog/dialog.spec.ts_72016_77842
@Directive({ selector: 'dir-with-view-container', standalone: true, }) class DirectiveWithViewContainer { viewContainerRef = inject(ViewContainerRef); } @Component({ changeDetection: ChangeDetectionStrategy.OnPush, template: 'hello', standalone: false, }) class ComponentWithOnPushViewContainer { viewCont...
{ "end_byte": 77842, "start_byte": 72016, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog.spec.ts" }
components/src/material/dialog/dialog-container.html_0_178
<div class="mat-mdc-dialog-inner-container mdc-dialog__container"> <div class="mat-mdc-dialog-surface mdc-dialog__surface"> <ng-template cdkPortalOutlet /> </div> </div>
{ "end_byte": 178, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog-container.html" }
components/src/material/dialog/_dialog-legacy-padding.scss_0_1174
// Legacy padding for the dialog. Copied from the non-MDC dialog styles. $legacy-padding: 24px !default; /// Mixin that applies creates styles for MDC-based dialog's to have legacy outer /// padding. By default, the dialog does not have any padding. The individual directives /// such as `matDialogContent`, `matDialogA...
{ "end_byte": 1174, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/_dialog-legacy-padding.scss" }
components/src/material/dialog/dialog-ref.ts_0_8332
/** * @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 */ /** Possible states of the lifecycle of a dialog. */ import {FocusOrigin} from '@angular/cdk/a11y'; import {merge, O...
{ "end_byte": 8332, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/dialog-ref.ts" }
components/src/material/dialog/testing/public-api.ts_0_369
/** * @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 {DialogHarnessFilters} from './dialog-harness-filters'; export {MatDialogHarness, MatDialogSection} from './d...
{ "end_byte": 369, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/testing/public-api.ts" }
components/src/material/dialog/testing/dialog-opener.spec.ts_0_2521
import {Component, inject} from '@angular/core'; import {TestBed, fakeAsync, flush} from '@angular/core/testing'; import {MAT_DIALOG_DATA, MatDialogRef, MatDialogState} from '@angular/material/dialog'; import {MatTestDialogOpener, MatTestDialogOpenerModule} from '@angular/material/dialog/testing'; import {NoopAnimation...
{ "end_byte": 2521, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/testing/dialog-opener.spec.ts" }
components/src/material/dialog/testing/dialog-harness.ts_0_3698
/** * @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, TestKey, } from '@...
{ "end_byte": 3698, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/testing/dialog-harness.ts" }
components/src/material/dialog/testing/dialog-harness-filters.ts_0_422
/** * @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": 422, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/testing/dialog-harness-filters.ts" }
components/src/material/dialog/testing/dialog-harness.spec.ts_0_5147
import {Component, TemplateRef, ViewChild, inject} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import {HarnessLoader} from '@angular/cdk/testing'; import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed'; import { MatDialog, MatDialogActions, MatDialogConfi...
{ "end_byte": 5147, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/testing/dialog-harness.spec.ts" }
components/src/material/dialog/testing/BUILD.bazel_0_923
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/overlay", "//src/cdk/testi...
{ "end_byte": 923, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/testing/BUILD.bazel" }
components/src/material/dialog/testing/dialog-opener.ts_0_2689
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {ComponentType} from '@angular/cdk/overlay'; import { ChangeDetectionStrategy, Component, NgModule, N...
{ "end_byte": 2689, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/testing/dialog-opener.ts" }
components/src/material/dialog/testing/index.ts_0_285
/** * @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'; export {MatDialogHarness} from './dialog-harness';
{ "end_byte": 285, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/dialog/testing/index.ts" }
components/src/material/form-field/form-field-errors.ts_0_700
/** * @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 */ /** @docs-private */ export function getMatFormFieldPlaceholderConflictError(): Error { return Error('Placeholder ...
{ "end_byte": 700, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/form-field-errors.ts" }
components/src/material/form-field/form-field.ts_0_7255
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {Directionality} from '@angular/cdk/bidi'; import {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coe...
{ "end_byte": 7255, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/form-field.ts" }
components/src/material/form-field/form-field.ts_7256_15331
class MatFormField implements FloatingLabelParent, AfterContentInit, AfterContentChecked, AfterViewInit, OnDestroy { _elementRef = inject(ElementRef); private _changeDetectorRef = inject(ChangeDetectorRef); private _dir = inject(Directionality); private _platform = inject(Platform); private _defaults = inje...
{ "end_byte": 15331, "start_byte": 7256, "url": "https://github.com/angular/components/blob/main/src/material/form-field/form-field.ts" }
components/src/material/form-field/form-field.ts_15334_23828
_animateAndLockLabel(): void { // This is for backwards compatibility only. Consumers of the form field might use // this method. e.g. the autocomplete trigger. This method has been added to the non-MDC // form field because setting "floatLabel" to "always" caused the label to float without // animation...
{ "end_byte": 23828, "start_byte": 15334, "url": "https://github.com/angular/components/blob/main/src/material/form-field/form-field.ts" }
components/src/material/form-field/form-field.ts_23831_29619
private _validateHints() { if (this._hintChildren && (typeof ngDevMode === 'undefined' || ngDevMode)) { let startHint: MatHint; let endHint: MatHint; this._hintChildren.forEach((hint: MatHint) => { if (hint.align === 'start') { if (startHint || this.hintLabel) { throw...
{ "end_byte": 29619, "start_byte": 23831, "url": "https://github.com/angular/components/blob/main/src/material/form-field/form-field.ts" }
components/src/material/form-field/_mdc-text-field-textarea-overrides.scss_0_2028
// MDCs default textarea styles cannot be used because they only apply if a special // class is applied to the "mdc-text-field" wrapper. Since we cannot know whether the // registered form-field control is a textarea and MDC by default does not have styles // for textareas in the fill appearance, we add our own minimal...
{ "end_byte": 2028, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/_mdc-text-field-textarea-overrides.scss" }
components/src/material/form-field/module.ts_0_921
/** * @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 {ObserversModule} from '@angular/cdk/observers'; import {NgModule} from '@angular/core'; import {MatCommonMod...
{ "end_byte": 921, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/module.ts" }
components/src/material/form-field/_user-agent-overrides.scss_0_845
// Mixin that resets user agent styles to make the form field behave consistently. @mixin private-form-field-user-agent-overrides() { .mat-mdc-form-field-input-control { // Due to the native input masking these inputs can be slightly taller than // the plain text inputs. We normalize it by resetting the line ...
{ "end_byte": 845, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/_user-agent-overrides.scss" }
components/src/material/form-field/form-field.scss_0_1290
@use '../core/tokens/token-utils'; @use '../core/style/vendor-prefixes'; @use '../core/tokens/m2/mat/form-field' as tokens-mat-form-field; @use './form-field-subscript'; @use './form-field-focus-overlay'; @use './form-field-high-contrast'; @use './form-field-native-select'; @use './user-agent-overrides'; @use './mdc-te...
{ "end_byte": 1290, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/form-field.scss" }
components/src/material/form-field/form-field.scss_1290_8724
.private-form-field-user-agent-overrides(); // The amount of padding between the icon prefix/suffix and the infix. // This assumes that the icon will be a 24px square with 12px padding. $_icon-prefix-infix-padding: 4px; // Host element of the form-field. It contains the mdc-text-field wrapper // and the subscript wra...
{ "end_byte": 8724, "start_byte": 1290, "url": "https://github.com/angular/components/blob/main/src/material/form-field/form-field.scss" }
components/src/material/form-field/_mdc-text-field-structure-overrides.scss_0_811
@use '../core/tokens/m2/mat/form-field' as tokens-mat-form-field; @use '../core/tokens/token-utils'; @use '../core/style/vendor-prefixes'; // TODO(b/263527625): should be removed when this is addressed on the MDC side. // MDC sets a will-change on this element, because of the animation. This can cause // scrolling per...
{ "end_byte": 811, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/_mdc-text-field-structure-overrides.scss" }