1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { InjectionToken } from '@angular/core';
|
---|
9 | /** Injection token that can be used to access the data that was passed in to a bottom sheet. */
|
---|
10 | export const MAT_BOTTOM_SHEET_DATA = new InjectionToken('MatBottomSheetData');
|
---|
11 | /**
|
---|
12 | * Configuration used when opening a bottom sheet.
|
---|
13 | */
|
---|
14 | export class MatBottomSheetConfig {
|
---|
15 | constructor() {
|
---|
16 | /** Data being injected into the child component. */
|
---|
17 | this.data = null;
|
---|
18 | /** Whether the bottom sheet has a backdrop. */
|
---|
19 | this.hasBackdrop = true;
|
---|
20 | /** Whether the user can use escape or clicking outside to close the bottom sheet. */
|
---|
21 | this.disableClose = false;
|
---|
22 | /** Aria label to assign to the bottom sheet element. */
|
---|
23 | this.ariaLabel = null;
|
---|
24 | /**
|
---|
25 | * Whether the bottom sheet should close when the user goes backwards/forwards in history.
|
---|
26 | * Note that this usually doesn't include clicking on links (unless the user is using
|
---|
27 | * the `HashLocationStrategy`).
|
---|
28 | */
|
---|
29 | this.closeOnNavigation = true;
|
---|
30 | // Note that this is disabled by default, because while the a11y recommendations are to focus
|
---|
31 | // the first focusable element, doing so prevents screen readers from reading out the
|
---|
32 | // rest of the bottom sheet content.
|
---|
33 | /** Whether the bottom sheet should focus the first focusable element on open. */
|
---|
34 | this.autoFocus = false;
|
---|
35 | /**
|
---|
36 | * Whether the bottom sheet should restore focus to the
|
---|
37 | * previously-focused element, after it's closed.
|
---|
38 | */
|
---|
39 | this.restoreFocus = true;
|
---|
40 | }
|
---|
41 | }
|
---|
42 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYm90dG9tLXNoZWV0LWNvbmZpZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpb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