| !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/cdk/overlay"),require("@angular/cdk/portal"),require("@angular/core"),require("@angular/material/core"),require("@angular/cdk/layout"),require("@angular/animations"),require("@angular/common"),require("@angular/cdk/a11y"),require("@angular/cdk/bidi"),require("rxjs"),require("@angular/cdk/keycodes"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@angular/material/bottom-sheet",["exports","@angular/cdk/overlay","@angular/cdk/portal","@angular/core","@angular/material/core","@angular/cdk/layout","@angular/animations","@angular/common","@angular/cdk/a11y","@angular/cdk/bidi","rxjs","@angular/cdk/keycodes","rxjs/operators"],e):e(((t=t||self).ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.bottomSheet={}),t.ng.cdk.overlay,t.ng.cdk.portal,t.ng.core,t.ng.material.core,t.ng.cdk.layout,t.ng.animations,t.ng.common,t.ng.cdk.a11y,t.ng.cdk.bidi,t.rxjs,t.ng.cdk.keycodes,t.rxjs.operators)}(this,(function(t,e,o,n,a,i,r,s,c,l,u,p,h){"use strict"; |
| /*! ***************************************************************************** |
| Copyright (c) Microsoft Corporation. |
| |
| Permission to use, copy, modify, and/or distribute this software for any |
| purpose with or without fee is hereby granted. |
| |
| THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH |
| REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY |
| AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, |
| INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM |
| LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR |
| OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| PERFORMANCE OF THIS SOFTWARE. |
| ***************************************************************************** */var d,m=function(t,e){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},f=new n.InjectionToken("MatBottomSheetData"),_=function _(){this.data=null,this.hasBackdrop=!0,this.disableClose=!1,this.ariaLabel=null,this.closeOnNavigation=!0,this.autoFocus=!1,this.restoreFocus=!0},y={bottomSheetState:r.trigger("state",[r.state("void, hidden",r.style({transform:"translateY(100%)"})),r.state("visible",r.style({transform:"translateY(0%)"})),r.transition("visible => void, visible => hidden",r.animate(a.AnimationDurations.COMPLEX+" "+a.AnimationCurves.ACCELERATION_CURVE)),r.transition("void => visible",r.animate(a.AnimationDurations.EXITING+" "+a.AnimationCurves.DECELERATION_CURVE))])},v=function(t){function e(e,o,a,r,s,c){var l=t.call(this)||this;return l._elementRef=e,l._changeDetectorRef=o,l._focusTrapFactory=a,l.bottomSheetConfig=c,l._animationState="void",l._animationStateChanged=new n.EventEmitter,l._elementFocusedBeforeOpened=null,l.attachDomPortal=function(t){return l._validatePortalAttached(),l._setPanelClass(),l._savePreviouslyFocusedElement(),l._portalOutlet.attachDomPortal(t)},l._document=s,l._breakpointSubscription=r.observe([i.Breakpoints.Medium,i.Breakpoints.Large,i.Breakpoints.XLarge]).subscribe((function(){l._toggleClass("mat-bottom-sheet-container-medium",r.isMatched(i.Breakpoints.Medium)),l._toggleClass("mat-bottom-sheet-container-large",r.isMatched(i.Breakpoints.Large)),l._toggleClass("mat-bottom-sheet-container-xlarge",r.isMatched(i.Breakpoints.XLarge))})),l}return function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}m(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}(e,t),e.prototype.attachComponentPortal=function(t){return this._validatePortalAttached(),this._setPanelClass(),this._savePreviouslyFocusedElement(),this._portalOutlet.attachComponentPortal(t)},e.prototype.attachTemplatePortal=function(t){return this._validatePortalAttached(),this._setPanelClass(),this._savePreviouslyFocusedElement(),this._portalOutlet.attachTemplatePortal(t)},e.prototype.enter=function(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.detectChanges())},e.prototype.exit=function(){this._destroyed||(this._animationState="hidden",this._changeDetectorRef.markForCheck())},e.prototype.ngOnDestroy=function(){this._breakpointSubscription.unsubscribe(),this._destroyed=!0},e.prototype._onAnimationDone=function(t){"hidden"===t.toState?this._restoreFocus():"visible"===t.toState&&this._trapFocus(),this._animationStateChanged.emit(t)},e.prototype._onAnimationStart=function(t){this._animationStateChanged.emit(t)},e.prototype._toggleClass=function(t,e){var o=this._elementRef.nativeElement.classList;e?o.add(t):o.remove(t)},e.prototype._validatePortalAttached=function(){this._portalOutlet.hasAttached()},e.prototype._setPanelClass=function(){var t=this._elementRef.nativeElement,e=this.bottomSheetConfig.panelClass;Array.isArray(e)?e.forEach((function(e){return t.classList.add(e)})):e&&t.classList.add(e)},e.prototype._trapFocus=function(){var t=this._elementRef.nativeElement;if(this._focusTrap||(this._focusTrap=this._focusTrapFactory.create(t)),this.bottomSheetConfig.autoFocus)this._focusTrap.focusInitialElementWhenReady();else{var e=this._getActiveElement();e===t||t.contains(e)||t.focus()}},e.prototype._restoreFocus=function(){var t=this._elementFocusedBeforeOpened;if(this.bottomSheetConfig.restoreFocus&&t&&"function"==typeof t.focus){var e=this._getActiveElement(),o=this._elementRef.nativeElement;e&&e!==this._document.body&&e!==o&&!o.contains(e)||t.focus()}this._focusTrap&&this._focusTrap.destroy()},e.prototype._savePreviouslyFocusedElement=function(){var t=this;this._elementFocusedBeforeOpened=this._getActiveElement(),this._elementRef.nativeElement.focus&&Promise.resolve().then((function(){return t._elementRef.nativeElement.focus()}))},e.prototype._getActiveElement=function(){var t,e=this._document.activeElement;return(null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.activeElement)||e},e}(o.BasePortalOutlet);v.decorators=[{type:n.Component,args:[{selector:"mat-bottom-sheet-container",template:"<ng-template cdkPortalOutlet></ng-template>\r\n",changeDetection:n.ChangeDetectionStrategy.Default,encapsulation:n.ViewEncapsulation.None,animations:[y.bottomSheetState],host:{class:"mat-bottom-sheet-container",tabindex:"-1",role:"dialog","aria-modal":"true","[attr.aria-label]":"bottomSheetConfig?.ariaLabel","[@state]":"_animationState","(@state.start)":"_onAnimationStart($event)","(@state.done)":"_onAnimationDone($event)"},styles:[".mat-bottom-sheet-container{padding:8px 16px;min-width:100vw;box-sizing:border-box;display:block;outline:0;max-height:80vh;overflow:auto}.cdk-high-contrast-active .mat-bottom-sheet-container{outline:1px solid}.mat-bottom-sheet-container-xlarge,.mat-bottom-sheet-container-large,.mat-bottom-sheet-container-medium{border-top-left-radius:4px;border-top-right-radius:4px}.mat-bottom-sheet-container-medium{min-width:384px;max-width:calc(100vw - 128px)}.mat-bottom-sheet-container-large{min-width:512px;max-width:calc(100vw - 256px)}.mat-bottom-sheet-container-xlarge{min-width:576px;max-width:calc(100vw - 384px)}\n"]}]}],v.ctorParameters=function(){return[{type:n.ElementRef},{type:n.ChangeDetectorRef},{type:c.FocusTrapFactory},{type:i.BreakpointObserver},{type:void 0,decorators:[{type:n.Optional},{type:n.Inject,args:[s.DOCUMENT]}]},{type:_}]},v.propDecorators={_portalOutlet:[{type:n.ViewChild,args:[o.CdkPortalOutlet,{static:!0}]}]},(d=function d(){}).decorators=[{type:n.NgModule,args:[{imports:[e.OverlayModule,a.MatCommonModule,o.PortalModule],exports:[v,a.MatCommonModule],declarations:[v],entryComponents:[v]}]}]; |
| /** |
| * @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.io/license |
| */ |
| var g=function(){function t(t,e){var o=this;this._overlayRef=e,this._afterDismissed=new u.Subject,this._afterOpened=new u.Subject,this.containerInstance=t,this.disableClose=t.bottomSheetConfig.disableClose,t._animationStateChanged.pipe(h.filter((function(t){return"done"===t.phaseName&&"visible"===t.toState})),h.take(1)).subscribe((function(){o._afterOpened.next(),o._afterOpened.complete()})),t._animationStateChanged.pipe(h.filter((function(t){return"done"===t.phaseName&&"hidden"===t.toState})),h.take(1)).subscribe((function(){clearTimeout(o._closeFallbackTimeout),e.dispose()})),e.detachments().pipe(h.take(1)).subscribe((function(){o._afterDismissed.next(o._result),o._afterDismissed.complete()})),u.merge(e.backdropClick(),e.keydownEvents().pipe(h.filter((function(t){return t.keyCode===p.ESCAPE})))).subscribe((function(t){o.disableClose||"keydown"===t.type&&p.hasModifierKey(t)||(t.preventDefault(),o.dismiss())}))}return t.prototype.dismiss=function(t){var e=this;this._afterDismissed.closed||(this.containerInstance._animationStateChanged.pipe(h.filter((function(t){return"start"===t.phaseName})),h.take(1)).subscribe((function(t){e._closeFallbackTimeout=setTimeout((function(){e._overlayRef.dispose()}),t.totalTime+100),e._overlayRef.detachBackdrop()})),this._result=t,this.containerInstance.exit())},t.prototype.afterDismissed=function(){return this._afterDismissed},t.prototype.afterOpened=function(){return this._afterOpened},t.prototype.backdropClick=function(){return this._overlayRef.backdropClick()},t.prototype.keydownEvents=function(){return this._overlayRef.keydownEvents()},t}(),b=new n.InjectionToken("mat-bottom-sheet-default-options"),S=function(){function t(t,e,o,n){this._overlay=t,this._injector=e,this._parentBottomSheet=o,this._defaultOptions=n,this._bottomSheetRefAtThisLevel=null}return Object.defineProperty(t.prototype,"_openedBottomSheetRef",{get:function(){var t=this._parentBottomSheet;return t?t._openedBottomSheetRef:this._bottomSheetRefAtThisLevel},set:function(t){this._parentBottomSheet?this._parentBottomSheet._openedBottomSheetRef=t:this._bottomSheetRefAtThisLevel=t},enumerable:!1,configurable:!0}),t.prototype.open=function(t,e){var a=this,i=function r(t,e){return Object.assign(Object.assign({},t),e)} |
| /** |
| * @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.io/license |
| */(this._defaultOptions||new _,e),s=this._createOverlay(i),c=this._attachContainer(s,i),l=new g(c,s);if(t instanceof n.TemplateRef)c.attachTemplatePortal(new o.TemplatePortal(t,null,{$implicit:i.data,bottomSheetRef:l}));else{var u=new o.ComponentPortal(t,void 0,this._createInjector(i,l)),p=c.attachComponentPortal(u);l.instance=p.instance}return l.afterDismissed().subscribe((function(){a._openedBottomSheetRef==l&&(a._openedBottomSheetRef=null)})),this._openedBottomSheetRef?(this._openedBottomSheetRef.afterDismissed().subscribe((function(){return l.containerInstance.enter()})),this._openedBottomSheetRef.dismiss()):l.containerInstance.enter(),this._openedBottomSheetRef=l,l},t.prototype.dismiss=function(t){this._openedBottomSheetRef&&this._openedBottomSheetRef.dismiss(t)},t.prototype.ngOnDestroy=function(){this._bottomSheetRefAtThisLevel&&this._bottomSheetRefAtThisLevel.dismiss()},t.prototype._attachContainer=function(t,e){var a=n.Injector.create({parent:e&&e.viewContainerRef&&e.viewContainerRef.injector||this._injector,providers:[{provide:_,useValue:e}]}),i=new o.ComponentPortal(v,e.viewContainerRef,a);return t.attach(i).instance},t.prototype._createOverlay=function(t){var o=new e.OverlayConfig({direction:t.direction,hasBackdrop:t.hasBackdrop,disposeOnNavigation:t.closeOnNavigation,maxWidth:"100%",scrollStrategy:t.scrollStrategy||this._overlay.scrollStrategies.block(),positionStrategy:this._overlay.position().global().centerHorizontally().bottom("0")});return t.backdropClass&&(o.backdropClass=t.backdropClass),this._overlay.create(o)},t.prototype._createInjector=function(t,e){var o=t&&t.viewContainerRef&&t.viewContainerRef.injector,a=[{provide:g,useValue:e},{provide:f,useValue:t.data}];return!t.direction||o&&o.get(l.Directionality,null)||a.push({provide:l.Directionality,useValue:{value:t.direction,change:u.of()}}),n.Injector.create({parent:o||this._injector,providers:a})},t}(); |
| /** |
| * @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.io/license |
| */S.ɵprov=n.ɵɵdefineInjectable({factory:function t(){return new S(n.ɵɵinject(e.Overlay),n.ɵɵinject(n.INJECTOR),n.ɵɵinject(S,12),n.ɵɵinject(b,8))},token:S,providedIn:d}),S.decorators=[{type:n.Injectable,args:[{providedIn:d}]}],S.ctorParameters=function(){return[{type:e.Overlay},{type:n.Injector},{type:S,decorators:[{type:n.Optional},{type:n.SkipSelf}]},{type:_,decorators:[{type:n.Optional},{type:n.Inject,args:[b]}]}]},t.MAT_BOTTOM_SHEET_DATA=f,t.MAT_BOTTOM_SHEET_DEFAULT_OPTIONS=b,t.MatBottomSheet=S,t.MatBottomSheetConfig=_,t.MatBottomSheetContainer=v,t.MatBottomSheetModule=d,t.MatBottomSheetRef=g,t.matBottomSheetAnimations=y,Object.defineProperty(t,"__esModule",{value:!0})})); |