_id
stringlengths
21
254
text
stringlengths
1
93.7k
metadata
dict
components/src/material/form-field/_mdc-text-field-structure-overrides.scss_812_9265
@mixin private-text-field-structure-overrides() { // Unset the border set by MDC. We move the border (which serves as the Material Design // text-field bottom line) into its own element. This is necessary because we want the // bottom-line to span across the whole form-field (including prefixes and suffixes). Als...
{ "end_byte": 9265, "start_byte": 812, "url": "https://github.com/angular/components/blob/main/src/material/form-field/_mdc-text-field-structure-overrides.scss" }
components/src/material/form-field/_form-field-focus-overlay.scss_0_1461
@use '../core/tokens/m2/mat/form-field' as tokens-mat-form-field; @use '../core/tokens/token-utils'; @use '../core/style/layout-common'; // MDC text-field used to use their ripple in order to show a focus and hover effect for // text-fields. This is unnecessary because the ripples bring in a lot of unnecessary // styl...
{ "end_byte": 1461, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/_form-field-focus-overlay.scss" }
components/src/material/form-field/public-api.ts_0_557
/** * @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 './directives/label'; export * from './directives/error'; export * from './directives/hint'; export * ...
{ "end_byte": 557, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/public-api.ts" }
components/src/material/form-field/form-field.md_0_7585
`<mat-form-field>` is a component used to wrap several Angular Material components and apply common [Text field](https://material.io/guidelines/components/text-fields.html) styles such as the underline, floating label, and hint messages. In this document, "form field" refers to the wrapper component `<mat-form-field>`...
{ "end_byte": 7585, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/form-field.md" }
components/src/material/form-field/_mdc-text-field-structure.scss_0_7267
@use '@angular/cdk'; @use '../core/style/vendor-prefixes'; @use '../core/tokens/token-utils'; @use '../core/tokens/m2/mdc/filled-text-field' as tokens-mdc-filled-text-field; @use '../core/tokens/m2/mdc/outlined-text-field' as tokens-mdc-outlined-text-field; // Includes the structural styles for the form field inherite...
{ "end_byte": 7267, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/_mdc-text-field-structure.scss" }
components/src/material/form-field/_mdc-text-field-structure.scss_7267_15558
.use-tokens($outlined-slots...) { // Moved out into variables because the selectors we inherited were too long. $enabled-selector: '.mdc-text-field--outlined:not(.mdc-text-field--disabled)'; $hover-selector: ':not(.mdc-text-field--focused):hover'; #{$enabled-selector} & { @include token...
{ "end_byte": 15558, "start_byte": 7267, "url": "https://github.com/angular/components/blob/main/src/material/form-field/_mdc-text-field-structure.scss" }
components/src/material/form-field/_mdc-text-field-structure.scss_15559_17139
@mixin _input-tokens($selector) { #{$selector}:not(.mdc-text-field--disabled) & { @include token-utils.create-token-slot(color, input-text-color); @include token-utils.create-token-slot(caret-color, caret-color); @include vendor-prefixes.input-placeholder { @include token-utils.create-token-slot(co...
{ "end_byte": 17139, "start_byte": 15559, "url": "https://github.com/angular/components/blob/main/src/material/form-field/_mdc-text-field-structure.scss" }
components/src/material/form-field/form-field.html_0_4506
<ng-template #labelTemplate> <!-- MDC recommends that the text-field is a `<label>` element. This rather complicates the setup because it would require every form-field control to explicitly set `aria-labelledby`. This is because the `<label>` itself contains more than the actual label (e.g. prefix, suffi...
{ "end_byte": 4506, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/form-field.html" }
components/src/material/form-field/_form-field-theme.scss_0_7957
@use '../core/tokens/m2/mdc/filled-text-field' as tokens-mdc-filled-text-field; @use '../core/tokens/m2/mdc/outlined-text-field' as tokens-mdc-outlined-text-field; @use '../core/tokens/m2/mat/form-field' as tokens-mat-form-field; @use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/theming/v...
{ "end_byte": 7957, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/_form-field-theme.scss" }
components/src/material/form-field/README.md_0_101
Please see the official documentation at https://material.angular.io/components/component/form-field
{ "end_byte": 101, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/README.md" }
components/src/material/form-field/form-field-animations.ts_0_935
/** * @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, } from '@angular/animation...
{ "end_byte": 935, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/form-field-animations.ts" }
components/src/material/form-field/_form-field-high-contrast.scss_0_1303
@use '@angular/cdk'; @mixin private-form-field-high-contrast() { $focus-indicator-width: 3px; $focus-indicator-style: dashed; .mat-form-field-appearance-fill { // The outline of the `fill` appearance is achieved through a background color // which won't be visible in high contrast mode. Add an outline t...
{ "end_byte": 1303, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/_form-field-high-contrast.scss" }
components/src/material/form-field/_mdc-text-field-density-overrides.scss_0_3223
@use '../core/tokens/m2/mat/form-field' as tokens-mat-form-field; @use '../core/tokens/token-utils'; // Mixin that includes the density styles for form fields. MDC provides their own density // styles for MDC text-field which we cannot use. MDC relies on input elements to stretch // vertically when the height is reduc...
{ "end_byte": 3223, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/_mdc-text-field-density-overrides.scss" }
components/src/material/form-field/_form-field-native-select.scss_0_3661
@use 'sass:math'; @use '../core/tokens/m2/mat/form-field' as tokens-mat-form-field; @use '../core/tokens/token-utils'; // Width of the Material Design form-field select arrow. $mat-form-field-select-arrow-width: 10px; // Height of the Material Design form-field select arrow. $mat-form-field-select-arrow-height: 5px; /...
{ "end_byte": 3661, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/_form-field-native-select.scss" }
components/src/material/form-field/BUILD.bazel_0_1797
load( "//tools:defaults.bzl", "extract_tokens", "markdown_to_html", "ng_module", "sass_binary", "sass_library", ) package(default_visibility = ["//visibility:public"]) ng_module( name = "form-field", srcs = glob( ["**/*.ts"], exclude = ["**/*.spec.ts"], ), asset...
{ "end_byte": 1797, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/BUILD.bazel" }
components/src/material/form-field/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/form-field/index.ts" }
components/src/material/form-field/_form-field-subscript.scss_0_2349
@use '../core/tokens/m2/mat/form-field' as tokens-mat-form-field; @use '../core/style/vendor-prefixes'; @use '../core/tokens/token-utils'; @mixin private-form-field-subscript() { // Wrapper for the hints and error messages. .mat-mdc-form-field-subscript-wrapper { box-sizing: border-box; width: 100%; po...
{ "end_byte": 2349, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/_form-field-subscript.scss" }
components/src/material/form-field/form-field-control.ts_0_2634
/** * @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 {Observable} from 'rxjs'; import {AbstractControlDirective, NgControl} from '@angular/forms'; import {Directi...
{ "end_byte": 2634, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/form-field-control.ts" }
components/src/material/form-field/directives/notched-outline.html_0_242
<div class="mat-mdc-notch-piece mdc-notched-outline__leading"></div> <div class="mat-mdc-notch-piece mdc-notched-outline__notch" #notch> <ng-content></ng-content> </div> <div class="mat-mdc-notch-piece mdc-notched-outline__trailing"></div>
{ "end_byte": 242, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/directives/notched-outline.html" }
components/src/material/form-field/directives/suffix.ts_0_906
/** * @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, InjectionToken, Input} from '@angular/core'; /** * Injection token that can be used to referenc...
{ "end_byte": 906, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/directives/suffix.ts" }
components/src/material/form-field/directives/hint.ts_0_942
/** * @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'; let nextUniqueId = 0; /** Hint text to be shown underneath the for...
{ "end_byte": 942, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/directives/hint.ts" }
components/src/material/form-field/directives/notched-outline.ts_0_2495
/** * @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 { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, Input, NgZone, ViewChild, Vi...
{ "end_byte": 2495, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/directives/notched-outline.ts" }
components/src/material/form-field/directives/label.ts_0_362
/** * @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'; /** The floating label for a `mat-form-field`. */ @Directive({ selector:...
{ "end_byte": 362, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/directives/label.ts" }
components/src/material/form-field/directives/floating-label.ts_0_5123
/** * @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, Input, NgZone, OnDestroy, InjectionToken, } from '@angular/cor...
{ "end_byte": 5123, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/directives/floating-label.ts" }
components/src/material/form-field/directives/error.ts_0_1519
/** * @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, InjectionToken, Input, HostAttributeToken, inject, } from '@angular/core...
{ "end_byte": 1519, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/directives/error.ts" }
components/src/material/form-field/directives/line-ripple.ts_0_2106
/** * @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, NgZone, OnDestroy, inject} from '@angular/core'; /** Class added when the line rippl...
{ "end_byte": 2106, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/directives/line-ripple.ts" }
components/src/material/form-field/directives/prefix.ts_0_904
/** * @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, InjectionToken, Input} from '@angular/core'; /** * Injection token that can be used to referenc...
{ "end_byte": 904, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/directives/prefix.ts" }
components/src/material/form-field/testing/error-harness.ts_0_1719
/** * @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, ComponentHarness, ComponentHarnessConstructor, HarnessPredicate, } from '@angul...
{ "end_byte": 1719, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/testing/error-harness.ts" }
components/src/material/form-field/testing/public-api.ts_0_676
/** * @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 */ // Re-export the base control harness from the "form-field/testing/control" entry-point. To // avoid circular depend...
{ "end_byte": 676, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/testing/public-api.ts" }
components/src/material/form-field/testing/form-field-harness.ts_0_8724
/** * @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, HarnessQuery, parallel, } from '...
{ "end_byte": 8724, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/testing/form-field-harness.ts" }
components/src/material/form-field/testing/form-field-harness-filters.ts_0_717
/** * @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": 717, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/testing/form-field-harness-filters.ts" }
components/src/material/form-field/testing/form-field-harness.spec.ts_0_1437
import {Component, signal} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import {ComponentHarness, HarnessLoader, HarnessPredicate, parallel} from '@angular/cdk/testing'; import {createFakeEvent, dispatchFakeEvent} from '@angular/cdk/testing/private'; import {TestbedHarnessEnvir...
{ "end_byte": 1437, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/testing/form-field-harness.spec.ts" }
components/src/material/form-field/testing/form-field-harness.spec.ts_1439_9588
describe('MatFormFieldHarness', () => { let fixture: ComponentFixture<FormFieldHarnessTest>; let loader: HarnessLoader; beforeEach(() => { TestBed.configureTestingModule({ imports: [ NoopAnimationsModule, MatNativeDateModule, FormFieldHarnessTest, MatDatepickerModule, ...
{ "end_byte": 9588, "start_byte": 1439, "url": "https://github.com/angular/components/blob/main/src/material/form-field/testing/form-field-harness.spec.ts" }
components/src/material/form-field/testing/form-field-harness.spec.ts_9592_17079
it('should be able to get error harnesses from the form-field harness', async () => { const formFields = await loader.getAllHarnesses(MatFormFieldHarness); expect(await formFields[1].getErrors()).toEqual([]); fixture.componentInstance.requiredControl.setValue(''); dispatchFakeEvent(fixture.nativeElemen...
{ "end_byte": 17079, "start_byte": 9592, "url": "https://github.com/angular/components/blob/main/src/material/form-field/testing/form-field-harness.spec.ts" }
components/src/material/form-field/testing/BUILD.bazel_0_1286
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", "//src/material/...
{ "end_byte": 1286, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/testing/BUILD.bazel" }
components/src/material/form-field/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/form-field/testing/index.ts" }
components/src/material/form-field/testing/control/form-field-control-harness.ts_0_484
/** * @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} from '@angular/cdk/testing'; /** * Base class for custom form-field control harnesses. H...
{ "end_byte": 484, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/testing/control/form-field-control-harness.ts" }
components/src/material/form-field/testing/control/BUILD.bazel_0_270
load("//tools:defaults.bzl", "ts_library") package(default_visibility = ["//visibility:public"]) ts_library( name = "control", srcs = glob(["**/*.ts"]), deps = ["//src/cdk/testing"], ) filegroup( name = "source-files", srcs = glob(["**/*.ts"]), )
{ "end_byte": 270, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/testing/control/BUILD.bazel" }
components/src/material/form-field/testing/control/index.ts_0_250
/** * @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 './form-field-control-harness';
{ "end_byte": 250, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/form-field/testing/control/index.ts" }
components/src/material/testing/month-constants.ts_0_546
/** * @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 */ /** * When constructing a Date, the month is zero-based. This can be confusing, since people are * used to seeing ...
{ "end_byte": 546, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/testing/month-constants.ts" }
components/src/material/testing/README.md_0_127
Note that this is not an entry-point. This directory is just used to share testing logic that is specific to Angular Material.
{ "end_byte": 127, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/testing/README.md" }
components/src/material/testing/BUILD.bazel_0_266
load("//tools:defaults.bzl", "ng_module") package(default_visibility = ["//visibility:public"]) ng_module( name = "testing", testonly = True, srcs = glob(["**/*.ts"]), deps = [ "//src/material/core", "@npm//@angular/core", ], )
{ "end_byte": 266, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/testing/BUILD.bazel" }
components/src/material/testing/index.ts_0_239
/** * @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 './month-constants';
{ "end_byte": 239, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/testing/index.ts" }
components/src/material/expansion/expansion-panel-header.ts_0_7489
/** * @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 {FocusableOption, FocusMonitor, FocusOrigin} from '@angular/cdk/a11y'; import {ENTER, hasModifierKey, SPACE} ...
{ "end_byte": 7489, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/expansion-panel-header.ts" }
components/src/material/expansion/expansion.md_0_2833
`<mat-expansion-panel>` provides an expandable details-summary view. <!-- example(expansion-overview) --> ### Expansion-panel content #### Header The `<mat-expansion-panel-header>` shows a summary of the panel content and acts as the control for expanding and collapsing. This header may optionally contain an `<mat-...
{ "end_byte": 2833, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/expansion.md" }
components/src/material/expansion/_expansion-variables.scss_0_1133
// Default minimum and maximum height for collapsed panel headers. $header-collapsed-height: 48px !default; $header-collapsed-minimum-height: 36px !default; $header-collapsed-maximum-height: $header-collapsed-height !default; // Default minimum and maximum height for expanded panel headers. $header-expanded-height...
{ "end_byte": 1133, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/_expansion-variables.scss" }
components/src/material/expansion/public-api.ts_0_523
/** * @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 './expansion-module'; export * from './accordion'; export * from './accordion-base'; export * from './...
{ "end_byte": 523, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/public-api.ts" }
components/src/material/expansion/accordion-base.ts_0_1389
/** * @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'; import {CdkAccordion} from '@angular/cdk/accordion'; /** MatAccordion...
{ "end_byte": 1389, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/accordion-base.ts" }
components/src/material/expansion/expansion-panel-base.ts_0_807
/** * @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'; import {CdkAccordionItem} from '@angular/cdk/accordion'; /** * Base ...
{ "end_byte": 807, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/expansion-panel-base.ts" }
components/src/material/expansion/accordion.ts_0_3138
/** * @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, ContentChildren, QueryList, AfterContentInit, OnDestroy, booleanAttribute, ...
{ "end_byte": 3138, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/accordion.ts" }
components/src/material/expansion/accordion.spec.ts_0_614
import {FocusMonitor} from '@angular/cdk/a11y'; import {DOWN_ARROW, END, HOME, UP_ARROW} from '@angular/cdk/keycodes'; import { createKeyboardEvent, dispatchEvent, dispatchKeyboardEvent, } from '@angular/cdk/testing/private'; import {Component, QueryList, ViewChild, ViewChildren} from '@angular/core'; import {Tes...
{ "end_byte": 614, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/accordion.spec.ts" }
components/src/material/expansion/accordion.spec.ts_616_10543
describe('MatAccordion', () => { let focusMonitor: FocusMonitor; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ BrowserAnimationsModule, MatExpansionModule, AccordionWithHideToggle, AccordionWithTogglePosition, NestedPanel, SetO...
{ "end_byte": 10543, "start_byte": 616, "url": "https://github.com/angular/components/blob/main/src/material/expansion/accordion.spec.ts" }
components/src/material/expansion/accordion.spec.ts_10547_14681
it('should focus the last header when pressing the end key', () => { const fixture = TestBed.createComponent(SetOfItems); fixture.detectChanges(); const headerElements = fixture.debugElement.queryAll(By.css('mat-expansion-panel-header')); const headers = fixture.componentInstance.headers.toArray(); ...
{ "end_byte": 14681, "start_byte": 10547, "url": "https://github.com/angular/components/blob/main/src/material/expansion/accordion.spec.ts" }
components/src/material/expansion/expansion-panel-header.scss_0_5217
@use '@angular/cdk'; @use '../core/tokens/m2/mat/expansion' as tokens-mat-expansion; @use '../core/tokens/token-utils'; @use './expansion-variables'; .mat-expansion-panel-header { display: flex; flex-direction: row; align-items: center; padding: 0 24px; border-radius: inherit; transition: height expansion-...
{ "end_byte": 5217, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/expansion-panel-header.scss" }
components/src/material/expansion/expansion.spec.ts_0_591
import {ENTER, SPACE} from '@angular/cdk/keycodes'; import { createKeyboardEvent, dispatchEvent, dispatchKeyboardEvent, } from '@angular/cdk/testing/private'; import {Component, ViewChild} from '@angular/core'; import { ComponentFixture, TestBed, fakeAsync, flush, tick, waitForAsync, } from '@angular/...
{ "end_byte": 591, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/expansion.spec.ts" }
components/src/material/expansion/expansion.spec.ts_593_10531
describe('MatExpansionPanel', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ MatExpansionModule, NoopAnimationsModule, PanelWithContent, PanelWithContentInNgIf, PanelWithCustomMargin, LazyPanelWithContent, LazyPanel...
{ "end_byte": 10531, "start_byte": 593, "url": "https://github.com/angular/components/blob/main/src/material/expansion/expansion.spec.ts" }
components/src/material/expansion/expansion.spec.ts_10535_20734
it('should not override the panel margin if it is not inside an accordion', fakeAsync(() => { const fixture = TestBed.createComponent(PanelWithCustomMargin); fixture.detectChanges(); const panel = fixture.debugElement.query(By.css('mat-expansion-panel'))!; let styles = getComputedStyle(panel.nativeElem...
{ "end_byte": 20734, "start_byte": 10535, "url": "https://github.com/angular/components/blob/main/src/material/expansion/expansion.spec.ts" }
components/src/material/expansion/expansion.spec.ts_20736_24078
@Component({ template: ` <mat-expansion-panel [expanded]="expanded" [hideToggle]="hideToggle" [disabled]="disabled" (opened)="openCallback()" (closed)="closeCallback()"> <mat-expansion-panel-header>Panel Title</mat-expansion...
{ "end_byte": 24078, "start_byte": 20736, "url": "https://github.com/angular/components/blob/main/src/material/expansion/expansion.spec.ts" }
components/src/material/expansion/expansion-module.ts_0_1267
/** * @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 {CdkAccordionModule} from '@angular/cdk/accordion'; import {PortalModule} from '@angular/cdk/portal'; import ...
{ "end_byte": 1267, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/expansion-module.ts" }
components/src/material/expansion/_expansion-theme.scss_0_3257
@use 'sass:map'; @use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/theming/validation'; @use '../core/typography/typography'; @use '../core/style/sass-utils'; @use '../core/tokens/token-utils'; @use '../core/tokens/m2/mat/expansion' as tokens-mat-expansion; @mixin base($theme) { @if in...
{ "end_byte": 3257, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/_expansion-theme.scss" }
components/src/material/expansion/expansion-panel-header.html_0_555
<span class="mat-content" [class.mat-content-hide-toggle]="!_showToggle()"> <ng-content select="mat-panel-title"></ng-content> <ng-content select="mat-panel-description"></ng-content> <ng-content></ng-content> </span> @if (_showToggle()) { <span [@indicatorRotate]="_getExpandedState()" class="mat-expansion-ind...
{ "end_byte": 555, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/expansion-panel-header.html" }
components/src/material/expansion/BUILD.bazel_0_1898
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 = "expansion", srcs = glob( ["**/*.ts"], ...
{ "end_byte": 1898, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/BUILD.bazel" }
components/src/material/expansion/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/expansion/index.ts" }
components/src/material/expansion/expansion-panel.html_0_540
<ng-content select="mat-expansion-panel-header"></ng-content> <div class="mat-expansion-panel-content" role="region" [@bodyExpansion]="_getExpandedState()" (@bodyExpansion.start)="_animationStarted($event)" (@bodyExpansion.done)="_animationDone($event)" [attr.aria-labelledby]="_headerId" [...
{ "end_byte": 540, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/expansion-panel.html" }
components/src/material/expansion/expansion-panel-content.ts_0_772
/** * @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, TemplateRef, inject} from '@angular/core'; import {MAT_EXPANSION_PANEL, MatExpansionPanelBase} fr...
{ "end_byte": 772, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/expansion-panel-content.ts" }
components/src/material/expansion/expansion-panel.scss_1_3835
@use '@angular/cdk'; @use '../core/tokens/m2/mat/expansion' as tokens-mat-expansion; @use '../core/tokens/token-utils'; @use '../core/style/variables'; @use '../core/style/elevation'; .mat-expansion-panel { box-sizing: content-box; display: block; margin: 0; overflow: hidden; transition: margin 225ms variabl...
{ "end_byte": 3835, "start_byte": 1, "url": "https://github.com/angular/components/blob/main/src/material/expansion/expansion-panel.scss" }
components/src/material/expansion/expansion-animations.ts_0_2894
/** * @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, AnimationTriggerMetadata, state, style, transition, trigger, } from '@angular/animation...
{ "end_byte": 2894, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/expansion-animations.ts" }
components/src/material/expansion/expansion-panel.ts_0_8645
/** * @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 {AnimationEvent} from '@angular/animations'; import {CdkAccordionItem} from '@angular/cdk/accordion'; import ...
{ "end_byte": 8645, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/expansion-panel.ts" }
components/src/material/expansion/testing/expansion-harness.spec.ts_0_543
import {ComponentHarness, HarnessLoader, parallel} from '@angular/cdk/testing'; import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed'; import {Component} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import {MatAccordionTogglePosition, MatExpansionModule} from '...
{ "end_byte": 543, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/testing/expansion-harness.spec.ts" }
components/src/material/expansion/testing/expansion-harness.spec.ts_545_9236
describe('MatExpansionHarness', () => { let fixture: ComponentFixture<ExpansionHarnessTestComponent>; let loader: HarnessLoader; beforeEach(() => { TestBed.configureTestingModule({ imports: [MatExpansionModule, NoopAnimationsModule, ExpansionHarnessTestComponent], }); fixture = TestBed.createC...
{ "end_byte": 9236, "start_byte": 545, "url": "https://github.com/angular/components/blob/main/src/material/expansion/testing/expansion-harness.spec.ts" }
components/src/material/expansion/testing/expansion-harness.spec.ts_9240_14646
it('should be able to check if expansion panel has toggle indicator', async () => { const accordion = await loader.getHarness(MatAccordionHarness); const standalonePanel = await loader.getHarness( MatExpansionPanelHarness.with({selector: '#standalonePanel'}), ); const expansionPanels = [standalone...
{ "end_byte": 14646, "start_byte": 9240, "url": "https://github.com/angular/components/blob/main/src/material/expansion/testing/expansion-harness.spec.ts" }
components/src/material/expansion/testing/public-api.ts_0_323
/** * @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 './accordion-harness'; export * from './expansion-harness'; export * from './expansion-harness-filters...
{ "end_byte": 323, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/testing/public-api.ts" }
components/src/material/expansion/testing/accordion-harness.ts_0_1466
/** * @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 {MatExpansionPanelHarness} from './e...
{ "end_byte": 1466, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/testing/accordion-harness.ts" }
components/src/material/expansion/testing/expansion-harness.ts_0_5648
/** * @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, HarnessLoader, HarnessPredicate, } from '@angular/cdk/testing'; imp...
{ "end_byte": 5648, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/testing/expansion-harness.ts" }
components/src/material/expansion/testing/expansion-harness-filters.ts_0_558
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {BaseHarnessFilters} from '@angular/cdk/testing'; export interface AccordionHarnessFilters extends BaseHarne...
{ "end_byte": 558, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/testing/expansion-harness-filters.ts" }
components/src/material/expansion/testing/BUILD.bazel_0_724
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": 724, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/expansion/testing/BUILD.bazel" }
components/src/material/expansion/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/expansion/testing/index.ts" }
components/src/material/button-toggle/button-toggle.html_0_1830
<button #button class="mat-button-toggle-button mat-focus-indicator" type="button" [id]="buttonId" [attr.role]="isSingleSelector() ? 'radio' : 'button'" [attr.tabindex]="disabled && !disabledInteractive ? -1 : tabIndex" [attr.aria-pressed]="!isSingleSelector() ? checked : null" ...
{ "end_byte": 1830, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/button-toggle.html" }
components/src/material/button-toggle/public-api.ts_0_277
/** * @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'; export * from './button-toggle-module';
{ "end_byte": 277, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/public-api.ts" }
components/src/material/button-toggle/button-toggle.scss_0_8571
@use '@angular/cdk'; @use '../core/style/vendor-prefixes'; @use '../core/style/layout-common'; @use '../core/style/elevation'; @use '../core/tokens/token-utils'; @use '../core/tokens/m2/mat/legacy-button-toggle' as tokens-mat-legacy-button-toggle; @use '../core/tokens/m2/mat/standard-button-toggle' as tokens-mat-stand...
{ "end_byte": 8571, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/button-toggle.scss" }
components/src/material/button-toggle/button-toggle.scss_8571_11423
.high-contrast { // Changing the background color for the selected item won't be visible in high contrast mode. // We fall back to using the overlay to draw a brighter, semi-transparent tint on top instead. // It uses a border, because the browser will render it using a brighter color. .mat-button-toggle-checke...
{ "end_byte": 11423, "start_byte": 8571, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/button-toggle.scss" }
components/src/material/button-toggle/README.md_0_103
Please see the official documentation at https://material.angular.io/components/component/button-toggle
{ "end_byte": 103, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/README.md" }
components/src/material/button-toggle/button-toggle.md_0_2573
`<mat-button-toggle>` are on/off toggles with the appearance of a button. These toggles can be configured to behave as either radio-buttons or checkboxes. While they can be standalone, they are typically part of a `mat-button-toggle-group`. <!-- example(button-toggle-overview) --> ### Exclusive selection vs. multipl...
{ "end_byte": 2573, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/button-toggle.md" }
components/src/material/button-toggle/button-toggle.spec.ts_0_9846
import {dispatchMouseEvent} from '@angular/cdk/testing/private'; import {Component, DebugElement, QueryList, ViewChild, ViewChildren} from '@angular/core'; import {ComponentFixture, TestBed, fakeAsync, flush, tick} from '@angular/core/testing'; import {FormControl, FormsModule, NgModel, ReactiveFormsModule} from '@angu...
{ "end_byte": 9846, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/button-toggle.spec.ts" }
components/src/material/button-toggle/button-toggle.spec.ts_9850_12214
it('should preserve the selection if the pre-selected option is removed and re-added', () => { const fixture = TestBed.createComponent(ButtonToggleGroupWithFormControlAndDynamicButtons); const instance = fixture.componentInstance; instance.control.setValue('a'); fixture.detectChanges(); const button...
{ "end_byte": 12214, "start_byte": 9850, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/button-toggle.spec.ts" }
components/src/material/button-toggle/button-toggle.spec.ts_12218_22077
describe('inside of an exclusive selection group', () => { let fixture: ComponentFixture<ButtonTogglesInsideButtonToggleGroup>; let groupDebugElement: DebugElement; let groupNativeElement: HTMLElement; let buttonToggleDebugElements: DebugElement[]; let buttonToggleNativeElements: HTMLElement[]; ...
{ "end_byte": 22077, "start_byte": 12218, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/button-toggle.spec.ts" }
components/src/material/button-toggle/button-toggle.spec.ts_22081_31264
describe('with initial value and change event', () => { it('should not fire an initial change event', () => { const fixture = TestBed.createComponent(ButtonToggleGroupWithInitialValue); const testComponent = fixture.debugElement.componentInstance; const groupDebugElement = fixture.debugElement.que...
{ "end_byte": 31264, "start_byte": 22081, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/button-toggle.spec.ts" }
components/src/material/button-toggle/button-toggle.spec.ts_31268_41013
describe('aria-label handling ', () => { it('should not set the aria-label attribute if none is provided', () => { const fixture = TestBed.createComponent(StandaloneButtonToggle); const checkboxDebugElement = fixture.debugElement.query(By.directive(MatButtonToggle))!; const checkboxNativeElement =...
{ "end_byte": 41013, "start_byte": 31268, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/button-toggle.spec.ts" }
components/src/material/button-toggle/button-toggle.spec.ts_41015_47225
@Component({ template: ` <mat-button-toggle-group [name]="groupName" [(ngModel)]="modelValue" (change)="lastEvent = $event"> @for (option of options; track option) { <mat-button-toggle [value]="option.value" [disableRipple]="disableRipple" [name]="option.name">{{option....
{ "end_byte": 47225, "start_byte": 41015, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/button-toggle.spec.ts" }
components/src/material/button-toggle/BUILD.bazel_0_1629
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-toggle", srcs = glob( ["**/*.ts"], ...
{ "end_byte": 1629, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/BUILD.bazel" }
components/src/material/button-toggle/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/index.ts" }
components/src/material/button-toggle/_button-toggle-theme.scss_0_5789
@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/theming/validation'; @use '../core/typography/typography'; @use '../core/tokens/m2/mat/legacy-button-toggle' as tokens-mat-legacy-button-toggle; @use '../core/tokens/m2/mat/standard-button-toggle' as tokens-mat-standard-button-toggle; @use...
{ "end_byte": 5789, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/_button-toggle-theme.scss" }
components/src/material/button-toggle/button-toggle.ts_0_3786
/** * @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} from '@angular/cdk/a11y'; import {SelectionModel} from '@angular/cdk/collections'; import {DOW...
{ "end_byte": 3786, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/button-toggle.ts" }
components/src/material/button-toggle/button-toggle.ts_3787_12255
@Directive({ selector: 'mat-button-toggle-group', providers: [ MAT_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR, {provide: MAT_BUTTON_TOGGLE_GROUP, useExisting: MatButtonToggleGroup}, ], host: { 'class': 'mat-button-toggle-group', '(keydown)': '_keydown($event)', '[attr.role]': "multiple ? 'group' : '...
{ "end_byte": 12255, "start_byte": 3787, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/button-toggle.ts" }
components/src/material/button-toggle/button-toggle.ts_12258_17058
_syncButtonToggle( toggle: MatButtonToggle, select: boolean, isUserInput = false, deferEvents = false, ) { // Deselect the currently-selected toggle, if we're in single-selection // mode and the button being toggled isn't selected at the moment. if (!this.multiple && this.selected && !togg...
{ "end_byte": 17058, "start_byte": 12258, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/button-toggle.ts" }
components/src/material/button-toggle/button-toggle.ts_17059_25216
@Component({ selector: 'mat-button-toggle', templateUrl: 'button-toggle.html', styleUrl: 'button-toggle.css', encapsulation: ViewEncapsulation.None, exportAs: 'matButtonToggle', changeDetection: ChangeDetectionStrategy.OnPush, host: { '[class.mat-button-toggle-standalone]': '!buttonToggleGroup', '...
{ "end_byte": 25216, "start_byte": 17059, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/button-toggle.ts" }
components/src/material/button-toggle/button-toggle-module.ts_0_597
/** * @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": 597, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/button-toggle-module.ts" }
components/src/material/button-toggle/testing/button-toggle-group-harness-filters.ts_0_525
/** * @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": 525, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/testing/button-toggle-group-harness-filters.ts" }
components/src/material/button-toggle/testing/button-toggle-group-harness.ts_0_2484
/** * @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 {MatButtonToggleAppearance} from '@a...
{ "end_byte": 2484, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/testing/button-toggle-group-harness.ts" }
components/src/material/button-toggle/testing/button-toggle-harness.ts_0_4489
/** * @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, parallel} from '@angular/cdk/testing'; import {coerceBooleanProperty} fr...
{ "end_byte": 4489, "start_byte": 0, "url": "https://github.com/angular/components/blob/main/src/material/button-toggle/testing/button-toggle-harness.ts" }