1 | import { FocusMonitor, FocusTrapFactory } from '@angular/cdk/a11y';
|
---|
2 | import { Directionality } from '@angular/cdk/bidi';
|
---|
3 | import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
---|
4 | import { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
|
---|
5 | import { Platform } from '@angular/cdk/platform';
|
---|
6 | import { CdkScrollable, ScrollDispatcher, ViewportRuler } from '@angular/cdk/scrolling';
|
---|
7 | import { DOCUMENT } from '@angular/common';
|
---|
8 | import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, ContentChildren, ElementRef, EventEmitter, forwardRef, Inject, InjectionToken, Input, NgZone, Optional, Output, QueryList, ViewChild, ViewEncapsulation, HostListener, HostBinding, } from '@angular/core';
|
---|
9 | import { fromEvent, merge, Observable, Subject } from 'rxjs';
|
---|
10 | import { debounceTime, filter, map, startWith, take, takeUntil, distinctUntilChanged, mapTo, } from 'rxjs/operators';
|
---|
11 | import { matDrawerAnimations } from './drawer-animations';
|
---|
12 | import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';
|
---|
13 | /**
|
---|
14 | * Throws an exception when two MatDrawer are matching the same position.
|
---|
15 | * @docs-private
|
---|
16 | */
|
---|
17 | export function throwMatDuplicatedDrawerError(position) {
|
---|
18 | throw Error(`A drawer was already declared for 'position="${position}"'`);
|
---|
19 | }
|
---|
20 | /** Configures whether drawers should use auto sizing by default. */
|
---|
21 | export const MAT_DRAWER_DEFAULT_AUTOSIZE = new InjectionToken('MAT_DRAWER_DEFAULT_AUTOSIZE', {
|
---|
22 | providedIn: 'root',
|
---|
23 | factory: MAT_DRAWER_DEFAULT_AUTOSIZE_FACTORY,
|
---|
24 | });
|
---|
25 | /**
|
---|
26 | * Used to provide a drawer container to a drawer while avoiding circular references.
|
---|
27 | * @docs-private
|
---|
28 | */
|
---|
29 | export const MAT_DRAWER_CONTAINER = new InjectionToken('MAT_DRAWER_CONTAINER');
|
---|
30 | /** @docs-private */
|
---|
31 | export function MAT_DRAWER_DEFAULT_AUTOSIZE_FACTORY() {
|
---|
32 | return false;
|
---|
33 | }
|
---|
34 | export class MatDrawerContent extends CdkScrollable {
|
---|
35 | constructor(_changeDetectorRef, _container, elementRef, scrollDispatcher, ngZone) {
|
---|
36 | super(elementRef, scrollDispatcher, ngZone);
|
---|
37 | this._changeDetectorRef = _changeDetectorRef;
|
---|
38 | this._container = _container;
|
---|
39 | }
|
---|
40 | ngAfterContentInit() {
|
---|
41 | this._container._contentMarginChanges.subscribe(() => {
|
---|
42 | this._changeDetectorRef.markForCheck();
|
---|
43 | });
|
---|
44 | }
|
---|
45 | }
|
---|
46 | MatDrawerContent.decorators = [
|
---|
47 | { type: Component, args: [{
|
---|
48 | selector: 'mat-drawer-content',
|
---|
49 | template: '<ng-content></ng-content>',
|
---|
50 | host: {
|
---|
51 | 'class': 'mat-drawer-content',
|
---|
52 | '[style.margin-left.px]': '_container._contentMargins.left',
|
---|
53 | '[style.margin-right.px]': '_container._contentMargins.right',
|
---|
54 | },
|
---|
55 | changeDetection: ChangeDetectionStrategy.OnPush,
|
---|
56 | encapsulation: ViewEncapsulation.None
|
---|
57 | },] }
|
---|
58 | ];
|
---|
59 | MatDrawerContent.ctorParameters = () => [
|
---|
60 | { type: ChangeDetectorRef },
|
---|
61 | { type: MatDrawerContainer, decorators: [{ type: Inject, args: [forwardRef(() => MatDrawerContainer),] }] },
|
---|
62 | { type: ElementRef },
|
---|
63 | { type: ScrollDispatcher },
|
---|
64 | { type: NgZone }
|
---|
65 | ];
|
---|
66 | /**
|
---|
67 | * This component corresponds to a drawer that can be opened on the drawer container.
|
---|
68 | */
|
---|
69 | export class MatDrawer {
|
---|
70 | constructor(_elementRef, _focusTrapFactory, _focusMonitor, _platform, _ngZone, _doc, _container) {
|
---|
71 | this._elementRef = _elementRef;
|
---|
72 | this._focusTrapFactory = _focusTrapFactory;
|
---|
73 | this._focusMonitor = _focusMonitor;
|
---|
74 | this._platform = _platform;
|
---|
75 | this._ngZone = _ngZone;
|
---|
76 | this._doc = _doc;
|
---|
77 | this._container = _container;
|
---|
78 | this._elementFocusedBeforeDrawerWasOpened = null;
|
---|
79 | /** Whether the drawer is initialized. Used for disabling the initial animation. */
|
---|
80 | this._enableAnimations = false;
|
---|
81 | this._position = 'start';
|
---|
82 | this._mode = 'over';
|
---|
83 | this._disableClose = false;
|
---|
84 | this._opened = false;
|
---|
85 | /** Emits whenever the drawer has started animating. */
|
---|
86 | this._animationStarted = new Subject();
|
---|
87 | /** Emits whenever the drawer is done animating. */
|
---|
88 | this._animationEnd = new Subject();
|
---|
89 | /** Current state of the sidenav animation. */
|
---|
90 | // @HostBinding is used in the class as it is expected to be extended. Since @Component decorator
|
---|
91 | // metadata is not inherited by child classes, instead the host binding data is defined in a way
|
---|
92 | // that can be inherited.
|
---|
93 | // tslint:disable-next-line:no-host-decorator-in-concrete
|
---|
94 | this._animationState = 'void';
|
---|
95 | /** Event emitted when the drawer open state is changed. */
|
---|
96 | this.openedChange =
|
---|
97 | // Note this has to be async in order to avoid some issues with two-bindings (see #8872).
|
---|
98 | new EventEmitter(/* isAsync */ true);
|
---|
99 | /** Event emitted when the drawer has been opened. */
|
---|
100 | this._openedStream = this.openedChange.pipe(filter(o => o), map(() => { }));
|
---|
101 | /** Event emitted when the drawer has started opening. */
|
---|
102 | this.openedStart = this._animationStarted.pipe(filter(e => e.fromState !== e.toState && e.toState.indexOf('open') === 0), mapTo(undefined));
|
---|
103 | /** Event emitted when the drawer has been closed. */
|
---|
104 | this._closedStream = this.openedChange.pipe(filter(o => !o), map(() => { }));
|
---|
105 | /** Event emitted when the drawer has started closing. */
|
---|
106 | this.closedStart = this._animationStarted.pipe(filter(e => e.fromState !== e.toState && e.toState === 'void'), mapTo(undefined));
|
---|
107 | /** Emits when the component is destroyed. */
|
---|
108 | this._destroyed = new Subject();
|
---|
109 | /** Event emitted when the drawer's position changes. */
|
---|
110 | // tslint:disable-next-line:no-output-on-prefix
|
---|
111 | this.onPositionChanged = new EventEmitter();
|
---|
112 | /**
|
---|
113 | * An observable that emits when the drawer mode changes. This is used by the drawer container to
|
---|
114 | * to know when to when the mode changes so it can adapt the margins on the content.
|
---|
115 | */
|
---|
116 | this._modeChanged = new Subject();
|
---|
117 | this.openedChange.subscribe((opened) => {
|
---|
118 | if (opened) {
|
---|
119 | if (this._doc) {
|
---|
120 | this._elementFocusedBeforeDrawerWasOpened = this._doc.activeElement;
|
---|
121 | }
|
---|
122 | this._takeFocus();
|
---|
123 | }
|
---|
124 | else if (this._isFocusWithinDrawer()) {
|
---|
125 | this._restoreFocus();
|
---|
126 | }
|
---|
127 | });
|
---|
128 | /**
|
---|
129 | * Listen to `keydown` events outside the zone so that change detection is not run every
|
---|
130 | * time a key is pressed. Instead we re-enter the zone only if the `ESC` key is pressed
|
---|
131 | * and we don't have close disabled.
|
---|
132 | */
|
---|
133 | this._ngZone.runOutsideAngular(() => {
|
---|
134 | fromEvent(this._elementRef.nativeElement, 'keydown').pipe(filter(event => {
|
---|
135 | return event.keyCode === ESCAPE && !this.disableClose && !hasModifierKey(event);
|
---|
136 | }), takeUntil(this._destroyed)).subscribe(event => this._ngZone.run(() => {
|
---|
137 | this.close();
|
---|
138 | event.stopPropagation();
|
---|
139 | event.preventDefault();
|
---|
140 | }));
|
---|
141 | });
|
---|
142 | // We need a Subject with distinctUntilChanged, because the `done` event
|
---|
143 | // fires twice on some browsers. See https://github.com/angular/angular/issues/24084
|
---|
144 | this._animationEnd.pipe(distinctUntilChanged((x, y) => {
|
---|
145 | return x.fromState === y.fromState && x.toState === y.toState;
|
---|
146 | })).subscribe((event) => {
|
---|
147 | const { fromState, toState } = event;
|
---|
148 | if ((toState.indexOf('open') === 0 && fromState === 'void') ||
|
---|
149 | (toState === 'void' && fromState.indexOf('open') === 0)) {
|
---|
150 | this.openedChange.emit(this._opened);
|
---|
151 | }
|
---|
152 | });
|
---|
153 | }
|
---|
154 | /** The side that the drawer is attached to. */
|
---|
155 | get position() { return this._position; }
|
---|
156 | set position(value) {
|
---|
157 | // Make sure we have a valid value.
|
---|
158 | value = value === 'end' ? 'end' : 'start';
|
---|
159 | if (value != this._position) {
|
---|
160 | this._position = value;
|
---|
161 | this.onPositionChanged.emit();
|
---|
162 | }
|
---|
163 | }
|
---|
164 | /** Mode of the drawer; one of 'over', 'push' or 'side'. */
|
---|
165 | get mode() { return this._mode; }
|
---|
166 | set mode(value) {
|
---|
167 | this._mode = value;
|
---|
168 | this._updateFocusTrapState();
|
---|
169 | this._modeChanged.next();
|
---|
170 | }
|
---|
171 | /** Whether the drawer can be closed with the escape key or by clicking on the backdrop. */
|
---|
172 | get disableClose() { return this._disableClose; }
|
---|
173 | set disableClose(value) { this._disableClose = coerceBooleanProperty(value); }
|
---|
174 | /**
|
---|
175 | * Whether the drawer should focus the first focusable element automatically when opened.
|
---|
176 | * Defaults to false in when `mode` is set to `side`, otherwise defaults to `true`. If explicitly
|
---|
177 | * enabled, focus will be moved into the sidenav in `side` mode as well.
|
---|
178 | */
|
---|
179 | get autoFocus() {
|
---|
180 | const value = this._autoFocus;
|
---|
181 | // Note that usually we disable auto focusing in `side` mode, because we don't know how the
|
---|
182 | // sidenav is being used, but in some cases it still makes sense to do it. If the consumer
|
---|
183 | // explicitly enabled `autoFocus`, we take it as them always wanting to enable it.
|
---|
184 | return value == null ? this.mode !== 'side' : value;
|
---|
185 | }
|
---|
186 | set autoFocus(value) { this._autoFocus = coerceBooleanProperty(value); }
|
---|
187 | /**
|
---|
188 | * Whether the drawer is opened. We overload this because we trigger an event when it
|
---|
189 | * starts or end.
|
---|
190 | */
|
---|
191 | get opened() { return this._opened; }
|
---|
192 | set opened(value) { this.toggle(coerceBooleanProperty(value)); }
|
---|
193 | /**
|
---|
194 | * Moves focus into the drawer. Note that this works even if
|
---|
195 | * the focus trap is disabled in `side` mode.
|
---|
196 | */
|
---|
197 | _takeFocus() {
|
---|
198 | if (!this.autoFocus || !this._focusTrap) {
|
---|
199 | return;
|
---|
200 | }
|
---|
201 | this._focusTrap.focusInitialElementWhenReady().then(hasMovedFocus => {
|
---|
202 | // If there were no focusable elements, focus the sidenav itself so the keyboard navigation
|
---|
203 | // still works. We need to check that `focus` is a function due to Universal.
|
---|
204 | if (!hasMovedFocus && typeof this._elementRef.nativeElement.focus === 'function') {
|
---|
205 | this._elementRef.nativeElement.focus();
|
---|
206 | }
|
---|
207 | });
|
---|
208 | }
|
---|
209 | /**
|
---|
210 | * Restores focus to the element that was originally focused when the drawer opened.
|
---|
211 | * If no element was focused at that time, the focus will be restored to the drawer.
|
---|
212 | */
|
---|
213 | _restoreFocus() {
|
---|
214 | if (!this.autoFocus) {
|
---|
215 | return;
|
---|
216 | }
|
---|
217 | // Note that we don't check via `instanceof HTMLElement` so that we can cover SVGs as well.
|
---|
218 | if (this._elementFocusedBeforeDrawerWasOpened) {
|
---|
219 | this._focusMonitor.focusVia(this._elementFocusedBeforeDrawerWasOpened, this._openedVia);
|
---|
220 | }
|
---|
221 | else {
|
---|
222 | this._elementRef.nativeElement.blur();
|
---|
223 | }
|
---|
224 | this._elementFocusedBeforeDrawerWasOpened = null;
|
---|
225 | this._openedVia = null;
|
---|
226 | }
|
---|
227 | /** Whether focus is currently within the drawer. */
|
---|
228 | _isFocusWithinDrawer() {
|
---|
229 | var _a;
|
---|
230 | const activeEl = (_a = this._doc) === null || _a === void 0 ? void 0 : _a.activeElement;
|
---|
231 | return !!activeEl && this._elementRef.nativeElement.contains(activeEl);
|
---|
232 | }
|
---|
233 | ngAfterContentInit() {
|
---|
234 | this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);
|
---|
235 | this._updateFocusTrapState();
|
---|
236 | }
|
---|
237 | ngAfterContentChecked() {
|
---|
238 | // Enable the animations after the lifecycle hooks have run, in order to avoid animating
|
---|
239 | // drawers that are open by default. When we're on the server, we shouldn't enable the
|
---|
240 | // animations, because we don't want the drawer to animate the first time the user sees
|
---|
241 | // the page.
|
---|
242 | if (this._platform.isBrowser) {
|
---|
243 | this._enableAnimations = true;
|
---|
244 | }
|
---|
245 | }
|
---|
246 | ngOnDestroy() {
|
---|
247 | if (this._focusTrap) {
|
---|
248 | this._focusTrap.destroy();
|
---|
249 | }
|
---|
250 | this._animationStarted.complete();
|
---|
251 | this._animationEnd.complete();
|
---|
252 | this._modeChanged.complete();
|
---|
253 | this._destroyed.next();
|
---|
254 | this._destroyed.complete();
|
---|
255 | }
|
---|
256 | /**
|
---|
257 | * Open the drawer.
|
---|
258 | * @param openedVia Whether the drawer was opened by a key press, mouse click or programmatically.
|
---|
259 | * Used for focus management after the sidenav is closed.
|
---|
260 | */
|
---|
261 | open(openedVia) {
|
---|
262 | return this.toggle(true, openedVia);
|
---|
263 | }
|
---|
264 | /** Close the drawer. */
|
---|
265 | close() {
|
---|
266 | return this.toggle(false);
|
---|
267 | }
|
---|
268 | /** Closes the drawer with context that the backdrop was clicked. */
|
---|
269 | _closeViaBackdropClick() {
|
---|
270 | // If the drawer is closed upon a backdrop click, we always want to restore focus. We
|
---|
271 | // don't need to check whether focus is currently in the drawer, as clicking on the
|
---|
272 | // backdrop causes blurring of the active element.
|
---|
273 | return this._setOpen(/* isOpen */ false, /* restoreFocus */ true);
|
---|
274 | }
|
---|
275 | /**
|
---|
276 | * Toggle this drawer.
|
---|
277 | * @param isOpen Whether the drawer should be open.
|
---|
278 | * @param openedVia Whether the drawer was opened by a key press, mouse click or programmatically.
|
---|
279 | * Used for focus management after the sidenav is closed.
|
---|
280 | */
|
---|
281 | toggle(isOpen = !this.opened, openedVia) {
|
---|
282 | // If the focus is currently inside the drawer content and we are closing the drawer,
|
---|
283 | // restore the focus to the initially focused element (when the drawer opened).
|
---|
284 | return this._setOpen(isOpen, /* restoreFocus */ !isOpen && this._isFocusWithinDrawer(), openedVia);
|
---|
285 | }
|
---|
286 | /**
|
---|
287 | * Toggles the opened state of the drawer.
|
---|
288 | * @param isOpen Whether the drawer should open or close.
|
---|
289 | * @param restoreFocus Whether focus should be restored on close.
|
---|
290 | * @param openedVia Focus origin that can be optionally set when opening a drawer. The
|
---|
291 | * origin will be used later when focus is restored on drawer close.
|
---|
292 | */
|
---|
293 | _setOpen(isOpen, restoreFocus, openedVia = 'program') {
|
---|
294 | this._opened = isOpen;
|
---|
295 | if (isOpen) {
|
---|
296 | this._animationState = this._enableAnimations ? 'open' : 'open-instant';
|
---|
297 | this._openedVia = openedVia;
|
---|
298 | }
|
---|
299 | else {
|
---|
300 | this._animationState = 'void';
|
---|
301 | if (restoreFocus) {
|
---|
302 | this._restoreFocus();
|
---|
303 | }
|
---|
304 | }
|
---|
305 | this._updateFocusTrapState();
|
---|
306 | return new Promise(resolve => {
|
---|
307 | this.openedChange.pipe(take(1)).subscribe(open => resolve(open ? 'open' : 'close'));
|
---|
308 | });
|
---|
309 | }
|
---|
310 | _getWidth() {
|
---|
311 | return this._elementRef.nativeElement ? (this._elementRef.nativeElement.offsetWidth || 0) : 0;
|
---|
312 | }
|
---|
313 | /** Updates the enabled state of the focus trap. */
|
---|
314 | _updateFocusTrapState() {
|
---|
315 | if (this._focusTrap) {
|
---|
316 | // The focus trap is only enabled when the drawer is open in any mode other than side.
|
---|
317 | this._focusTrap.enabled = this.opened && this.mode !== 'side';
|
---|
318 | }
|
---|
319 | }
|
---|
320 | // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
|
---|
321 | // In Ivy the `host` bindings will be merged when this class is extended, whereas in
|
---|
322 | // ViewEngine they're overwritten.
|
---|
323 | // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.
|
---|
324 | // tslint:disable-next-line:no-host-decorator-in-concrete
|
---|
325 | _animationStartListener(event) {
|
---|
326 | this._animationStarted.next(event);
|
---|
327 | }
|
---|
328 | // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
|
---|
329 | // In Ivy the `host` bindings will be merged when this class is extended, whereas in
|
---|
330 | // ViewEngine they're overwritten.
|
---|
331 | // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.
|
---|
332 | // tslint:disable-next-line:no-host-decorator-in-concrete
|
---|
333 | _animationDoneListener(event) {
|
---|
334 | this._animationEnd.next(event);
|
---|
335 | }
|
---|
336 | }
|
---|
337 | MatDrawer.decorators = [
|
---|
338 | { type: Component, args: [{
|
---|
339 | selector: 'mat-drawer',
|
---|
340 | exportAs: 'matDrawer',
|
---|
341 | template: "<div class=\"mat-drawer-inner-container\" cdkScrollable>\r\n <ng-content></ng-content>\r\n</div>\r\n",
|
---|
342 | animations: [matDrawerAnimations.transformDrawer],
|
---|
343 | host: {
|
---|
344 | 'class': 'mat-drawer',
|
---|
345 | // must prevent the browser from aligning text based on value
|
---|
346 | '[attr.align]': 'null',
|
---|
347 | '[class.mat-drawer-end]': 'position === "end"',
|
---|
348 | '[class.mat-drawer-over]': 'mode === "over"',
|
---|
349 | '[class.mat-drawer-push]': 'mode === "push"',
|
---|
350 | '[class.mat-drawer-side]': 'mode === "side"',
|
---|
351 | '[class.mat-drawer-opened]': 'opened',
|
---|
352 | 'tabIndex': '-1',
|
---|
353 | },
|
---|
354 | changeDetection: ChangeDetectionStrategy.OnPush,
|
---|
355 | encapsulation: ViewEncapsulation.None
|
---|
356 | },] }
|
---|
357 | ];
|
---|
358 | MatDrawer.ctorParameters = () => [
|
---|
359 | { type: ElementRef },
|
---|
360 | { type: FocusTrapFactory },
|
---|
361 | { type: FocusMonitor },
|
---|
362 | { type: Platform },
|
---|
363 | { type: NgZone },
|
---|
364 | { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [DOCUMENT,] }] },
|
---|
365 | { type: MatDrawerContainer, decorators: [{ type: Optional }, { type: Inject, args: [MAT_DRAWER_CONTAINER,] }] }
|
---|
366 | ];
|
---|
367 | MatDrawer.propDecorators = {
|
---|
368 | position: [{ type: Input }],
|
---|
369 | mode: [{ type: Input }],
|
---|
370 | disableClose: [{ type: Input }],
|
---|
371 | autoFocus: [{ type: Input }],
|
---|
372 | opened: [{ type: Input }],
|
---|
373 | _animationState: [{ type: HostBinding, args: ['@transform',] }],
|
---|
374 | openedChange: [{ type: Output }],
|
---|
375 | _openedStream: [{ type: Output, args: ['opened',] }],
|
---|
376 | openedStart: [{ type: Output }],
|
---|
377 | _closedStream: [{ type: Output, args: ['closed',] }],
|
---|
378 | closedStart: [{ type: Output }],
|
---|
379 | onPositionChanged: [{ type: Output, args: ['positionChanged',] }],
|
---|
380 | _animationStartListener: [{ type: HostListener, args: ['@transform.start', ['$event'],] }],
|
---|
381 | _animationDoneListener: [{ type: HostListener, args: ['@transform.done', ['$event'],] }]
|
---|
382 | };
|
---|
383 | /**
|
---|
384 | * `<mat-drawer-container>` component.
|
---|
385 | *
|
---|
386 | * This is the parent component to one or two `<mat-drawer>`s that validates the state internally
|
---|
387 | * and coordinates the backdrop and content styling.
|
---|
388 | */
|
---|
389 | export class MatDrawerContainer {
|
---|
390 | constructor(_dir, _element, _ngZone, _changeDetectorRef, viewportRuler, defaultAutosize = false, _animationMode) {
|
---|
391 | this._dir = _dir;
|
---|
392 | this._element = _element;
|
---|
393 | this._ngZone = _ngZone;
|
---|
394 | this._changeDetectorRef = _changeDetectorRef;
|
---|
395 | this._animationMode = _animationMode;
|
---|
396 | /** Drawers that belong to this container. */
|
---|
397 | this._drawers = new QueryList();
|
---|
398 | /** Event emitted when the drawer backdrop is clicked. */
|
---|
399 | this.backdropClick = new EventEmitter();
|
---|
400 | /** Emits when the component is destroyed. */
|
---|
401 | this._destroyed = new Subject();
|
---|
402 | /** Emits on every ngDoCheck. Used for debouncing reflows. */
|
---|
403 | this._doCheckSubject = new Subject();
|
---|
404 | /**
|
---|
405 | * Margins to be applied to the content. These are used to push / shrink the drawer content when a
|
---|
406 | * drawer is open. We use margin rather than transform even for push mode because transform breaks
|
---|
407 | * fixed position elements inside of the transformed element.
|
---|
408 | */
|
---|
409 | this._contentMargins = { left: null, right: null };
|
---|
410 | this._contentMarginChanges = new Subject();
|
---|
411 | // If a `Dir` directive exists up the tree, listen direction changes
|
---|
412 | // and update the left/right properties to point to the proper start/end.
|
---|
413 | if (_dir) {
|
---|
414 | _dir.change.pipe(takeUntil(this._destroyed)).subscribe(() => {
|
---|
415 | this._validateDrawers();
|
---|
416 | this.updateContentMargins();
|
---|
417 | });
|
---|
418 | }
|
---|
419 | // Since the minimum width of the sidenav depends on the viewport width,
|
---|
420 | // we need to recompute the margins if the viewport changes.
|
---|
421 | viewportRuler.change()
|
---|
422 | .pipe(takeUntil(this._destroyed))
|
---|
423 | .subscribe(() => this.updateContentMargins());
|
---|
424 | this._autosize = defaultAutosize;
|
---|
425 | }
|
---|
426 | /** The drawer child with the `start` position. */
|
---|
427 | get start() { return this._start; }
|
---|
428 | /** The drawer child with the `end` position. */
|
---|
429 | get end() { return this._end; }
|
---|
430 | /**
|
---|
431 | * Whether to automatically resize the container whenever
|
---|
432 | * the size of any of its drawers changes.
|
---|
433 | *
|
---|
434 | * **Use at your own risk!** Enabling this option can cause layout thrashing by measuring
|
---|
435 | * the drawers on every change detection cycle. Can be configured globally via the
|
---|
436 | * `MAT_DRAWER_DEFAULT_AUTOSIZE` token.
|
---|
437 | */
|
---|
438 | get autosize() { return this._autosize; }
|
---|
439 | set autosize(value) { this._autosize = coerceBooleanProperty(value); }
|
---|
440 | /**
|
---|
441 | * Whether the drawer container should have a backdrop while one of the sidenavs is open.
|
---|
442 | * If explicitly set to `true`, the backdrop will be enabled for drawers in the `side`
|
---|
443 | * mode as well.
|
---|
444 | */
|
---|
445 | get hasBackdrop() {
|
---|
446 | if (this._backdropOverride == null) {
|
---|
447 | return !this._start || this._start.mode !== 'side' || !this._end || this._end.mode !== 'side';
|
---|
448 | }
|
---|
449 | return this._backdropOverride;
|
---|
450 | }
|
---|
451 | set hasBackdrop(value) {
|
---|
452 | this._backdropOverride = value == null ? null : coerceBooleanProperty(value);
|
---|
453 | }
|
---|
454 | /** Reference to the CdkScrollable instance that wraps the scrollable content. */
|
---|
455 | get scrollable() {
|
---|
456 | return this._userContent || this._content;
|
---|
457 | }
|
---|
458 | ngAfterContentInit() {
|
---|
459 | this._allDrawers.changes
|
---|
460 | .pipe(startWith(this._allDrawers), takeUntil(this._destroyed))
|
---|
461 | .subscribe((drawer) => {
|
---|
462 | this._drawers.reset(drawer.filter(item => !item._container || item._container === this));
|
---|
463 | this._drawers.notifyOnChanges();
|
---|
464 | });
|
---|
465 | this._drawers.changes.pipe(startWith(null)).subscribe(() => {
|
---|
466 | this._validateDrawers();
|
---|
467 | this._drawers.forEach((drawer) => {
|
---|
468 | this._watchDrawerToggle(drawer);
|
---|
469 | this._watchDrawerPosition(drawer);
|
---|
470 | this._watchDrawerMode(drawer);
|
---|
471 | });
|
---|
472 | if (!this._drawers.length ||
|
---|
473 | this._isDrawerOpen(this._start) ||
|
---|
474 | this._isDrawerOpen(this._end)) {
|
---|
475 | this.updateContentMargins();
|
---|
476 | }
|
---|
477 | this._changeDetectorRef.markForCheck();
|
---|
478 | });
|
---|
479 | // Avoid hitting the NgZone through the debounce timeout.
|
---|
480 | this._ngZone.runOutsideAngular(() => {
|
---|
481 | this._doCheckSubject.pipe(debounceTime(10), // Arbitrary debounce time, less than a frame at 60fps
|
---|
482 | takeUntil(this._destroyed)).subscribe(() => this.updateContentMargins());
|
---|
483 | });
|
---|
484 | }
|
---|
485 | ngOnDestroy() {
|
---|
486 | this._contentMarginChanges.complete();
|
---|
487 | this._doCheckSubject.complete();
|
---|
488 | this._drawers.destroy();
|
---|
489 | this._destroyed.next();
|
---|
490 | this._destroyed.complete();
|
---|
491 | }
|
---|
492 | /** Calls `open` of both start and end drawers */
|
---|
493 | open() {
|
---|
494 | this._drawers.forEach(drawer => drawer.open());
|
---|
495 | }
|
---|
496 | /** Calls `close` of both start and end drawers */
|
---|
497 | close() {
|
---|
498 | this._drawers.forEach(drawer => drawer.close());
|
---|
499 | }
|
---|
500 | /**
|
---|
501 | * Recalculates and updates the inline styles for the content. Note that this should be used
|
---|
502 | * sparingly, because it causes a reflow.
|
---|
503 | */
|
---|
504 | updateContentMargins() {
|
---|
505 | // 1. For drawers in `over` mode, they don't affect the content.
|
---|
506 | // 2. For drawers in `side` mode they should shrink the content. We do this by adding to the
|
---|
507 | // left margin (for left drawer) or right margin (for right the drawer).
|
---|
508 | // 3. For drawers in `push` mode the should shift the content without resizing it. We do this by
|
---|
509 | // adding to the left or right margin and simultaneously subtracting the same amount of
|
---|
510 | // margin from the other side.
|
---|
511 | let left = 0;
|
---|
512 | let right = 0;
|
---|
513 | if (this._left && this._left.opened) {
|
---|
514 | if (this._left.mode == 'side') {
|
---|
515 | left += this._left._getWidth();
|
---|
516 | }
|
---|
517 | else if (this._left.mode == 'push') {
|
---|
518 | const width = this._left._getWidth();
|
---|
519 | left += width;
|
---|
520 | right -= width;
|
---|
521 | }
|
---|
522 | }
|
---|
523 | if (this._right && this._right.opened) {
|
---|
524 | if (this._right.mode == 'side') {
|
---|
525 | right += this._right._getWidth();
|
---|
526 | }
|
---|
527 | else if (this._right.mode == 'push') {
|
---|
528 | const width = this._right._getWidth();
|
---|
529 | right += width;
|
---|
530 | left -= width;
|
---|
531 | }
|
---|
532 | }
|
---|
533 | // If either `right` or `left` is zero, don't set a style to the element. This
|
---|
534 | // allows users to specify a custom size via CSS class in SSR scenarios where the
|
---|
535 | // measured widths will always be zero. Note that we reset to `null` here, rather
|
---|
536 | // than below, in order to ensure that the types in the `if` below are consistent.
|
---|
537 | left = left || null;
|
---|
538 | right = right || null;
|
---|
539 | if (left !== this._contentMargins.left || right !== this._contentMargins.right) {
|
---|
540 | this._contentMargins = { left, right };
|
---|
541 | // Pull back into the NgZone since in some cases we could be outside. We need to be careful
|
---|
542 | // to do it only when something changed, otherwise we can end up hitting the zone too often.
|
---|
543 | this._ngZone.run(() => this._contentMarginChanges.next(this._contentMargins));
|
---|
544 | }
|
---|
545 | }
|
---|
546 | ngDoCheck() {
|
---|
547 | // If users opted into autosizing, do a check every change detection cycle.
|
---|
548 | if (this._autosize && this._isPushed()) {
|
---|
549 | // Run outside the NgZone, otherwise the debouncer will throw us into an infinite loop.
|
---|
550 | this._ngZone.runOutsideAngular(() => this._doCheckSubject.next());
|
---|
551 | }
|
---|
552 | }
|
---|
553 | /**
|
---|
554 | * Subscribes to drawer events in order to set a class on the main container element when the
|
---|
555 | * drawer is open and the backdrop is visible. This ensures any overflow on the container element
|
---|
556 | * is properly hidden.
|
---|
557 | */
|
---|
558 | _watchDrawerToggle(drawer) {
|
---|
559 | drawer._animationStarted.pipe(filter((event) => event.fromState !== event.toState), takeUntil(this._drawers.changes))
|
---|
560 | .subscribe((event) => {
|
---|
561 | // Set the transition class on the container so that the animations occur. This should not
|
---|
562 | // be set initially because animations should only be triggered via a change in state.
|
---|
563 | if (event.toState !== 'open-instant' && this._animationMode !== 'NoopAnimations') {
|
---|
564 | this._element.nativeElement.classList.add('mat-drawer-transition');
|
---|
565 | }
|
---|
566 | this.updateContentMargins();
|
---|
567 | this._changeDetectorRef.markForCheck();
|
---|
568 | });
|
---|
569 | if (drawer.mode !== 'side') {
|
---|
570 | drawer.openedChange.pipe(takeUntil(this._drawers.changes)).subscribe(() => this._setContainerClass(drawer.opened));
|
---|
571 | }
|
---|
572 | }
|
---|
573 | /**
|
---|
574 | * Subscribes to drawer onPositionChanged event in order to
|
---|
575 | * re-validate drawers when the position changes.
|
---|
576 | */
|
---|
577 | _watchDrawerPosition(drawer) {
|
---|
578 | if (!drawer) {
|
---|
579 | return;
|
---|
580 | }
|
---|
581 | // NOTE: We need to wait for the microtask queue to be empty before validating,
|
---|
582 | // since both drawers may be swapping positions at the same time.
|
---|
583 | drawer.onPositionChanged.pipe(takeUntil(this._drawers.changes)).subscribe(() => {
|
---|
584 | this._ngZone.onMicrotaskEmpty.pipe(take(1)).subscribe(() => {
|
---|
585 | this._validateDrawers();
|
---|
586 | });
|
---|
587 | });
|
---|
588 | }
|
---|
589 | /** Subscribes to changes in drawer mode so we can run change detection. */
|
---|
590 | _watchDrawerMode(drawer) {
|
---|
591 | if (drawer) {
|
---|
592 | drawer._modeChanged.pipe(takeUntil(merge(this._drawers.changes, this._destroyed)))
|
---|
593 | .subscribe(() => {
|
---|
594 | this.updateContentMargins();
|
---|
595 | this._changeDetectorRef.markForCheck();
|
---|
596 | });
|
---|
597 | }
|
---|
598 | }
|
---|
599 | /** Toggles the 'mat-drawer-opened' class on the main 'mat-drawer-container' element. */
|
---|
600 | _setContainerClass(isAdd) {
|
---|
601 | const classList = this._element.nativeElement.classList;
|
---|
602 | const className = 'mat-drawer-container-has-open';
|
---|
603 | if (isAdd) {
|
---|
604 | classList.add(className);
|
---|
605 | }
|
---|
606 | else {
|
---|
607 | classList.remove(className);
|
---|
608 | }
|
---|
609 | }
|
---|
610 | /** Validate the state of the drawer children components. */
|
---|
611 | _validateDrawers() {
|
---|
612 | this._start = this._end = null;
|
---|
613 | // Ensure that we have at most one start and one end drawer.
|
---|
614 | this._drawers.forEach(drawer => {
|
---|
615 | if (drawer.position == 'end') {
|
---|
616 | if (this._end != null && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
---|
617 | throwMatDuplicatedDrawerError('end');
|
---|
618 | }
|
---|
619 | this._end = drawer;
|
---|
620 | }
|
---|
621 | else {
|
---|
622 | if (this._start != null && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
---|
623 | throwMatDuplicatedDrawerError('start');
|
---|
624 | }
|
---|
625 | this._start = drawer;
|
---|
626 | }
|
---|
627 | });
|
---|
628 | this._right = this._left = null;
|
---|
629 | // Detect if we're LTR or RTL.
|
---|
630 | if (this._dir && this._dir.value === 'rtl') {
|
---|
631 | this._left = this._end;
|
---|
632 | this._right = this._start;
|
---|
633 | }
|
---|
634 | else {
|
---|
635 | this._left = this._start;
|
---|
636 | this._right = this._end;
|
---|
637 | }
|
---|
638 | }
|
---|
639 | /** Whether the container is being pushed to the side by one of the drawers. */
|
---|
640 | _isPushed() {
|
---|
641 | return (this._isDrawerOpen(this._start) && this._start.mode != 'over') ||
|
---|
642 | (this._isDrawerOpen(this._end) && this._end.mode != 'over');
|
---|
643 | }
|
---|
644 | _onBackdropClicked() {
|
---|
645 | this.backdropClick.emit();
|
---|
646 | this._closeModalDrawersViaBackdrop();
|
---|
647 | }
|
---|
648 | _closeModalDrawersViaBackdrop() {
|
---|
649 | // Close all open drawers where closing is not disabled and the mode is not `side`.
|
---|
650 | [this._start, this._end]
|
---|
651 | .filter(drawer => drawer && !drawer.disableClose && this._canHaveBackdrop(drawer))
|
---|
652 | .forEach(drawer => drawer._closeViaBackdropClick());
|
---|
653 | }
|
---|
654 | _isShowingBackdrop() {
|
---|
655 | return (this._isDrawerOpen(this._start) && this._canHaveBackdrop(this._start)) ||
|
---|
656 | (this._isDrawerOpen(this._end) && this._canHaveBackdrop(this._end));
|
---|
657 | }
|
---|
658 | _canHaveBackdrop(drawer) {
|
---|
659 | return drawer.mode !== 'side' || !!this._backdropOverride;
|
---|
660 | }
|
---|
661 | _isDrawerOpen(drawer) {
|
---|
662 | return drawer != null && drawer.opened;
|
---|
663 | }
|
---|
664 | }
|
---|
665 | MatDrawerContainer.decorators = [
|
---|
666 | { type: Component, args: [{
|
---|
667 | selector: 'mat-drawer-container',
|
---|
668 | exportAs: 'matDrawerContainer',
|
---|
669 | template: "<div class=\"mat-drawer-backdrop\" (click)=\"_onBackdropClicked()\" *ngIf=\"hasBackdrop\"\n [class.mat-drawer-shown]=\"_isShowingBackdrop()\"></div>\n\n<ng-content select=\"mat-drawer\"></ng-content>\n\n<ng-content select=\"mat-drawer-content\">\n</ng-content>\n<mat-drawer-content *ngIf=\"!_content\">\n <ng-content></ng-content>\n</mat-drawer-content>\n",
|
---|
670 | host: {
|
---|
671 | 'class': 'mat-drawer-container',
|
---|
672 | '[class.mat-drawer-container-explicit-backdrop]': '_backdropOverride',
|
---|
673 | },
|
---|
674 | changeDetection: ChangeDetectionStrategy.OnPush,
|
---|
675 | encapsulation: ViewEncapsulation.None,
|
---|
676 | providers: [{
|
---|
677 | provide: MAT_DRAWER_CONTAINER,
|
---|
678 | useExisting: MatDrawerContainer
|
---|
679 | }],
|
---|
680 | styles: [".mat-drawer-container{position:relative;z-index:1;box-sizing:border-box;-webkit-overflow-scrolling:touch;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}.cdk-high-contrast-active .mat-drawer-backdrop{opacity:.5}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}.cdk-high-contrast-active .mat-drawer,.cdk-high-contrast-active [dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}.cdk-high-contrast-active [dir=rtl] .mat-drawer,.cdk-high-contrast-active .mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer{transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch}.mat-sidenav-fixed{position:fixed}\n"]
|
---|
681 | },] }
|
---|
682 | ];
|
---|
683 | MatDrawerContainer.ctorParameters = () => [
|
---|
684 | { type: Directionality, decorators: [{ type: Optional }] },
|
---|
685 | { type: ElementRef },
|
---|
686 | { type: NgZone },
|
---|
687 | { type: ChangeDetectorRef },
|
---|
688 | { type: ViewportRuler },
|
---|
689 | { type: undefined, decorators: [{ type: Inject, args: [MAT_DRAWER_DEFAULT_AUTOSIZE,] }] },
|
---|
690 | { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
|
---|
691 | ];
|
---|
692 | MatDrawerContainer.propDecorators = {
|
---|
693 | _allDrawers: [{ type: ContentChildren, args: [MatDrawer, {
|
---|
694 | // We need to use `descendants: true`, because Ivy will no longer match
|
---|
695 | // indirect descendants if it's left as false.
|
---|
696 | descendants: true
|
---|
697 | },] }],
|
---|
698 | _content: [{ type: ContentChild, args: [MatDrawerContent,] }],
|
---|
699 | _userContent: [{ type: ViewChild, args: [MatDrawerContent,] }],
|
---|
700 | autosize: [{ type: Input }],
|
---|
701 | hasBackdrop: [{ type: Input }],
|
---|
702 | backdropClick: [{ type: Output }]
|
---|
703 | };
|
---|
704 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJhd2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21hdGVyaWFsL3NpZGVuYXYvZHJhd2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVFBLE9BQU8sRUFBQyxZQUFZLEVBQTBCLGdCQUFnQixFQUFDLE1BQU0sbUJBQW1CLENBQUM7QUFDekYsT0FBTyxFQUFDLGNBQWMsRUFBQyxNQUFNLG1CQUFtQixDQUFDO0FBQ2pELE9BQU8sRUFBZSxxQkFBcUIsRUFBQyxNQUFNLHVCQUF1QixDQUFDO0FBQzFFLE9BQU8sRU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