@angular/cdk 9.2.3 → 9.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_text-field.scss +19 -4
- package/a11y/index.metadata.json +1 -1
- package/bundles/cdk-a11y.umd.js +8 -3
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +1 -1
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +2 -12
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js +2 -2
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-text-field.umd.js +7 -4
- package/bundles/cdk-text-field.umd.js.map +1 -1
- package/bundles/cdk-text-field.umd.min.js +2 -2
- package/bundles/cdk-text-field.umd.min.js.map +1 -1
- package/bundles/cdk.umd.js +1 -1
- package/bundles/cdk.umd.js.map +1 -1
- package/bundles/cdk.umd.min.js +1 -1
- package/bundles/cdk.umd.min.js.map +1 -1
- package/esm2015/a11y/focus-monitor/focus-monitor.js +10 -5
- package/esm2015/a11y/focus-trap/configurable-focus-trap-factory.js +3 -3
- package/esm2015/a11y/focus-trap/focus-trap.js +1 -1
- package/esm2015/a11y/live-announcer/live-announcer.js +1 -1
- package/esm2015/overlay/keyboard/overlay-keyboard-dispatcher.js +2 -2
- package/esm2015/overlay/overlay-ref.js +3 -33
- package/esm2015/text-field/autosize.js +14 -5
- package/esm2015/version.js +1 -1
- package/esm5/a11y/focus-monitor/focus-monitor.js +9 -4
- package/esm5/overlay/keyboard/overlay-keyboard-dispatcher.js +2 -2
- package/esm5/overlay/overlay-ref.js +3 -13
- package/esm5/text-field/autosize.js +8 -5
- package/esm5/version.js +1 -1
- package/fesm2015/a11y.js +9 -4
- package/fesm2015/a11y.js.map +1 -1
- package/fesm2015/cdk.js +1 -1
- package/fesm2015/cdk.js.map +1 -1
- package/fesm2015/overlay.js +3 -33
- package/fesm2015/overlay.js.map +1 -1
- package/fesm2015/text-field.js +13 -4
- package/fesm2015/text-field.js.map +1 -1
- package/fesm5/a11y.js +8 -3
- package/fesm5/a11y.js.map +1 -1
- package/fesm5/cdk.js +1 -1
- package/fesm5/cdk.js.map +1 -1
- package/fesm5/overlay.js +3 -13
- package/fesm5/overlay.js.map +1 -1
- package/fesm5/text-field.js +7 -4
- package/fesm5/text-field.js.map +1 -1
- package/overlay/index.metadata.json +1 -1
- package/overlay/overlay-ref.d.ts +0 -3
- package/package.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/text-field/_text-field.scss +19 -4
- package/text-field/autosize.d.ts +2 -0
- package/text-field/index.metadata.json +1 -1
- package/text-field-prebuilt.css +1 -1
|
@@ -63,14 +63,14 @@ function v(t,e){return e.some((function(e){return t.bottom<e.top||t.top>e.bottom
|
|
|
63
63
|
*
|
|
64
64
|
* Use of this source code is governed by an MIT-style license that can be
|
|
65
65
|
* found in the LICENSE file at https://angular.io/license
|
|
66
|
-
*/var E=function(){function t(t){var e=this;this._attachedOverlays=[],this._keydownListener=function(t){for(var i=e._attachedOverlays,o=i.length-1;o>-1;o--)if(i[o].
|
|
66
|
+
*/var E=function(){function t(t){var e=this;this._attachedOverlays=[],this._keydownListener=function(t){for(var i=e._attachedOverlays,o=i.length-1;o>-1;o--)if(i[o]._keydownEvents.observers.length>0){i[o]._keydownEvents.next(t);break}},this._document=t}return t.prototype.ngOnDestroy=function(){this._detach()},t.prototype.add=function(t){this.remove(t),this._isAttached||(this._document.body.addEventListener("keydown",this._keydownListener),this._isAttached=!0),this._attachedOverlays.push(t)},t.prototype.remove=function(t){var e=this._attachedOverlays.indexOf(t);e>-1&&this._attachedOverlays.splice(e,1),0===this._attachedOverlays.length&&this._detach()},t.prototype._detach=function(){this._isAttached&&(this._document.body.removeEventListener("keydown",this._keydownListener),this._isAttached=!1)},t.decorators=[{type:o.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:void 0,decorators:[{type:o.Inject,args:[i.DOCUMENT]}]}]},t.ɵprov=o.ɵɵdefineInjectable({factory:function e(){return new t(o.ɵɵinject(i.DOCUMENT))},token:t,providedIn:"root"}),t}();function R(t,e){return t||new E(e)}var j={provide:E,deps:[[new o.Optional,new o.SkipSelf,E],i.DOCUMENT],useFactory:R},B=!("undefined"==typeof window||!window||!window.__karma__&&!window.jasmine),D=function(){function t(t,e){this._platform=e,this._document=t}return t.prototype.ngOnDestroy=function(){var t=this._containerElement;t&&t.parentNode&&t.parentNode.removeChild(t)},t.prototype.getContainerElement=function(){return this._containerElement||this._createContainer(),this._containerElement},t.prototype._createContainer=function(){var t=this._platform?this._platform.isBrowser:"undefined"!=typeof window;if(t||B)for(var e=this._document.querySelectorAll('.cdk-overlay-container[platform="server"], .cdk-overlay-container[platform="test"]'),i=0;i<e.length;i++)e[i].parentNode.removeChild(e[i]);var o=this._document.createElement("div");o.classList.add("cdk-overlay-container"),B?o.setAttribute("platform","test"):t||o.setAttribute("platform","server"),this._document.body.appendChild(o),this._containerElement=o},t.decorators=[{type:o.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:void 0,decorators:[{type:o.Inject,args:[i.DOCUMENT]}]},{type:a.Platform}]},t.ɵprov=o.ɵɵdefineInjectable({factory:function e(){return new t(o.ɵɵinject(i.DOCUMENT),o.ɵɵinject(a.Platform))},token:t,providedIn:"root"}),t}();
|
|
67
67
|
/**
|
|
68
68
|
* @license
|
|
69
69
|
* Copyright Google LLC All Rights Reserved.
|
|
70
70
|
*
|
|
71
71
|
* Use of this source code is governed by an MIT-style license that can be
|
|
72
72
|
* found in the LICENSE file at https://angular.io/license
|
|
73
|
-
*/function I(t,e){return t||new D(e)}var M={provide:D,deps:[[new o.Optional,new o.SkipSelf,D],i.DOCUMENT],useFactory:I},V=function(){function t(t,e,i,o,n,r,s,a){var h=this;this._portalOutlet=t,this._host=e,this._pane=i,this._config=o,this._ngZone=n,this._keyboardDispatcher=r,this._document=s,this._location=a,this._backdropElement=null,this._backdropClick=new l.Subject,this._attachments=new l.Subject,this._detachments=new l.Subject,this._locationChanges=l.Subscription.EMPTY,this._backdropClickHandler=function(t){return h._backdropClick.next(t)},this._keydownEventsObservable=new l.Observable((function(t){var e=h._keydownEvents.subscribe(t);return h._keydownEventSubscriptions++,function(){e.unsubscribe(),h._keydownEventSubscriptions--}})),this._keydownEvents=new l.Subject,this._keydownEventSubscriptions=0,o.scrollStrategy&&(this._scrollStrategy=o.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=o.positionStrategy}return Object.defineProperty(t.prototype,"overlayElement",{get:function(){return this._pane},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"backdropElement",{get:function(){return this._backdropElement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hostElement",{get:function(){return this._host},enumerable:!0,configurable:!0}),t.prototype.attach=function(t){var e=this,i=this._portalOutlet.attach(t);return!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host),this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._ngZone.onStable.asObservable().pipe(h.take(1)).subscribe((function(){e.hasAttached()&&e.updatePosition()})),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&this._location&&(this._locationChanges=this._location.subscribe((function(){return e.dispose()}))),i},t.prototype.detach=function(){if(this.hasAttached()){this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();var t=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),t}},t.prototype.dispose=function(){var t=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this.detachBackdrop(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._host&&this._host.parentNode&&(this._host.parentNode.removeChild(this._host),this._host=null),this._previousHostParent=this._pane=null,t&&this._detachments.next(),this._detachments.complete()},t.prototype.hasAttached=function(){return this._portalOutlet.hasAttached()},t.prototype.backdropClick=function(){return this._backdropClick.asObservable()},t.prototype.attachments=function(){return this._attachments.asObservable()},t.prototype.detachments=function(){return this._detachments.asObservable()},t.prototype.keydownEvents=function(){return this._keydownEventsObservable},t.prototype.getConfig=function(){return this._config},t.prototype.updatePosition=function(){this._positionStrategy&&this._positionStrategy.apply()},t.prototype.updatePositionStrategy=function(t){t!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=t,this.hasAttached()&&(t.attach(this),this.updatePosition()))},t.prototype.updateSize=function(t){this._config=u(u({},this._config),t),this._updateElementSize()},t.prototype.setDirection=function(t){this._config=u(u({},this._config),{direction:t}),this._updateElementDirection()},t.prototype.addPanelClass=function(t){this._pane&&this._toggleClasses(this._pane,t,!0)},t.prototype.removePanelClass=function(t){this._pane&&this._toggleClasses(this._pane,t,!1)},t.prototype.getDirection=function(){var t=this._config.direction;return t?"string"==typeof t?t:t.value:"ltr"},t.prototype.updateScrollStrategy=function(t){t!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=t,this.hasAttached()&&(t.attach(this),t.enable()))},t.prototype._updateElementDirection=function(){this._host.setAttribute("dir",this.getDirection())},t.prototype._updateElementSize=function(){if(this._pane){var t=this._pane.style;t.width=n.coerceCssPixelValue(this._config.width),t.height=n.coerceCssPixelValue(this._config.height),t.minWidth=n.coerceCssPixelValue(this._config.minWidth),t.minHeight=n.coerceCssPixelValue(this._config.minHeight),t.maxWidth=n.coerceCssPixelValue(this._config.maxWidth),t.maxHeight=n.coerceCssPixelValue(this._config.maxHeight)}},t.prototype._togglePointerEvents=function(t){this._pane.style.pointerEvents=t?"auto":"none"},t.prototype._attachBackdrop=function(){var t=this;this._backdropElement=this._document.createElement("div"),this._backdropElement.classList.add("cdk-overlay-backdrop"),this._config.backdropClass&&this._toggleClasses(this._backdropElement,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropElement,this._host),this._backdropElement.addEventListener("click",this._backdropClickHandler),"undefined"!=typeof requestAnimationFrame?this._ngZone.runOutsideAngular((function(){requestAnimationFrame((function(){t._backdropElement&&t._backdropElement.classList.add("cdk-overlay-backdrop-showing")}))})):this._backdropElement.classList.add("cdk-overlay-backdrop-showing")},t.prototype._updateStackingOrder=function(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)},t.prototype.detachBackdrop=function(){var t=this,e=this._backdropElement;if(e){var i,o=function(){e&&(e.removeEventListener("click",t._backdropClickHandler),e.removeEventListener("transitionend",o),e.parentNode&&e.parentNode.removeChild(e)),t._backdropElement==e&&(t._backdropElement=null),t._config.backdropClass&&t._toggleClasses(e,t._config.backdropClass,!1),clearTimeout(i)};e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular((function(){e.addEventListener("transitionend",o)})),e.style.pointerEvents="none",i=this._ngZone.runOutsideAngular((function(){return setTimeout(o,500)}))}},t.prototype._toggleClasses=function(t,e,i){var o=t.classList;n.coerceArray(e).forEach((function(t){t&&(i?o.add(t):o.remove(t))}))},t.prototype._detachContentWhenStable=function(){var t=this;this._ngZone.runOutsideAngular((function(){var e=t._ngZone.onStable.asObservable().pipe(h.takeUntil(l.merge(t._attachments,t._detachments))).subscribe((function(){t._pane&&t._host&&0!==t._pane.children.length||(t._pane&&t._config.panelClass&&t._toggleClasses(t._pane,t._config.panelClass,!1),t._host&&t._host.parentElement&&(t._previousHostParent=t._host.parentElement,t._previousHostParent.removeChild(t._host)),e.unsubscribe())}))}))},t.prototype._disposeScrollStrategy=function(){var t=this._scrollStrategy;t&&(t.disable(),t.detach&&t.detach())},t}(),A=/([A-Za-z%]+)$/,L=function(){function t(t,e,i,o,n){this._viewportRuler=e,this._document=i,this._platform=o,this._overlayContainer=n,this._lastBoundingBoxSize={width:0,height:0},this._isPushed=!1,this._canPush=!0,this._growAfterOpen=!1,this._hasFlexibleDimensions=!0,this._positionLocked=!1,this._viewportMargin=0,this._scrollables=[],this._preferredPositions=[],this._positionChanges=new l.Subject,this._resizeSubscription=l.Subscription.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges.asObservable(),this.setOrigin(t)}return Object.defineProperty(t.prototype,"positions",{get:function(){return this._preferredPositions},enumerable:!0,configurable:!0}),t.prototype.attach=function(t){var e=this;if(this._overlayRef&&t!==this._overlayRef)throw Error("This position strategy is already attached to an overlay");this._validatePositions(),t.hostElement.classList.add("cdk-overlay-connected-position-bounding-box"),this._overlayRef=t,this._boundingBox=t.hostElement,this._pane=t.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe((function(){e._isInitialRender=!0,e.apply()}))},t.prototype.apply=function(){var t,e,i,o;if(!this._isDisposed&&this._platform.isBrowser)if(!this._isInitialRender&&this._positionLocked&&this._lastPosition)this.reapplyLastPosition();else{this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect();var n,r=this._originRect,s=this._overlayRect,a=this._viewportRect,l=[];try{for(var h=d(this._preferredPositions),c=h.next();!c.done;c=h.next()){var p=c.value,u=this._getOriginPoint(r,p),_=this._getOverlayPoint(u,s,p),f=this._getOverlayFit(_,s,a,p);if(f.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(p,u);this._canFitWithFlexibleDimensions(f,_,a)?l.push({position:p,origin:u,overlayRect:s,boundingBoxRect:this._calculateBoundingBoxRect(u,p)}):(!n||n.overlayFit.visibleArea<f.visibleArea)&&(n={overlayFit:f,overlayPoint:_,originPoint:u,position:p,overlayRect:s})}}catch(e){t={error:e}}finally{try{c&&!c.done&&(e=h.return)&&e.call(h)}finally{if(t)throw t.error}}if(l.length){var y=null,g=-1;try{for(var v=d(l),m=v.next();!m.done;m=v.next()){var b=m.value,w=b.boundingBoxRect.width*b.boundingBoxRect.height*(b.position.weight||1);w>g&&(g=w,y=b)}}catch(t){i={error:t}}finally{try{m&&!m.done&&(o=v.return)&&o.call(v)}finally{if(i)throw i.error}}return this._isPushed=!1,void this._applyPosition(y.position,y.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(n.position,n.originPoint);this._applyPosition(n.position,n.originPoint)}},t.prototype.detach=function(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()},t.prototype.dispose=function(){this._isDisposed||(this._boundingBox&&X(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove("cdk-overlay-connected-position-bounding-box"),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)},t.prototype.reapplyLastPosition=function(){if(!this._isDisposed&&(!this._platform||this._platform.isBrowser)){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect();var t=this._lastPosition||this._preferredPositions[0],e=this._getOriginPoint(this._originRect,t);this._applyPosition(t,e)}},t.prototype.withScrollableContainers=function(t){return this._scrollables=t,this},t.prototype.withPositions=function(t){return this._preferredPositions=t,-1===t.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this},t.prototype.withViewportMargin=function(t){return this._viewportMargin=t,this},t.prototype.withFlexibleDimensions=function(t){return void 0===t&&(t=!0),this._hasFlexibleDimensions=t,this},t.prototype.withGrowAfterOpen=function(t){return void 0===t&&(t=!0),this._growAfterOpen=t,this},t.prototype.withPush=function(t){return void 0===t&&(t=!0),this._canPush=t,this},t.prototype.withLockedPosition=function(t){return void 0===t&&(t=!0),this._positionLocked=t,this},t.prototype.setOrigin=function(t){return this._origin=t,this},t.prototype.withDefaultOffsetX=function(t){return this._offsetX=t,this},t.prototype.withDefaultOffsetY=function(t){return this._offsetY=t,this},t.prototype.withTransformOriginOn=function(t){return this._transformOriginSelector=t,this},t.prototype._getOriginPoint=function(t,e){var i;if("center"==e.originX)i=t.left+t.width/2;else{var o=this._isRtl()?t.right:t.left,n=this._isRtl()?t.left:t.right;i="start"==e.originX?o:n}return{x:i,y:"center"==e.originY?t.top+t.height/2:"top"==e.originY?t.top:t.bottom}},t.prototype._getOverlayPoint=function(t,e,i){var o;return o="center"==i.overlayX?-e.width/2:"start"===i.overlayX?this._isRtl()?-e.width:0:this._isRtl()?0:-e.width,{x:t.x+o,y:t.y+("center"==i.overlayY?-e.height/2:"top"==i.overlayY?0:-e.height)}},t.prototype._getOverlayFit=function(t,e,i,o){var n=t.x,r=t.y,s=this._getOffset(o,"x"),a=this._getOffset(o,"y");s&&(n+=s),a&&(r+=a);var l=0-r,h=r+e.height-i.height,c=this._subtractOverflows(e.width,0-n,n+e.width-i.width),p=this._subtractOverflows(e.height,l,h),u=c*p;return{visibleArea:u,isCompletelyWithinViewport:e.width*e.height===u,fitsInViewportVertically:p===e.height,fitsInViewportHorizontally:c==e.width}},t.prototype._canFitWithFlexibleDimensions=function(t,e,i){if(this._hasFlexibleDimensions){var o=i.bottom-e.y,n=i.right-e.x,r=Y(this._overlayRef.getConfig().minHeight),s=Y(this._overlayRef.getConfig().minWidth);return(t.fitsInViewportVertically||null!=r&&r<=o)&&(t.fitsInViewportHorizontally||null!=s&&s<=n)}return!1},t.prototype._pushOverlayOnScreen=function(t,e,i){if(this._previousPushAmount&&this._positionLocked)return{x:t.x+this._previousPushAmount.x,y:t.y+this._previousPushAmount.y};var o,n,r=this._viewportRect,s=Math.max(t.x+e.width-r.right,0),a=Math.max(t.y+e.height-r.bottom,0),l=Math.max(r.top-i.top-t.y,0),h=Math.max(r.left-i.left-t.x,0);return this._previousPushAmount={x:o=e.width<=r.width?h||-s:t.x<this._viewportMargin?r.left-i.left-t.x:0,y:n=e.height<=r.height?l||-a:t.y<this._viewportMargin?r.top-i.top-t.y:0},{x:t.x+o,y:t.y+n}},t.prototype._applyPosition=function(t,e){if(this._setTransformOrigin(t),this._setOverlayElementStyles(e,t),this._setBoundingBoxStyles(e,t),t.panelClass&&this._addPanelClasses(t.panelClass),this._lastPosition=t,this._positionChanges.observers.length){var i=this._getScrollVisibility(),o=new k(t,i);this._positionChanges.next(o)}this._isInitialRender=!1},t.prototype._setTransformOrigin=function(t){if(this._transformOriginSelector){var e,i=this._boundingBox.querySelectorAll(this._transformOriginSelector),o=t.overlayY;e="center"===t.overlayX?"center":this._isRtl()?"start"===t.overlayX?"right":"left":"start"===t.overlayX?"left":"right";for(var n=0;n<i.length;n++)i[n].style.transformOrigin=e+" "+o}},t.prototype._calculateBoundingBoxRect=function(t,e){var i,o,n,r,s,a,l=this._viewportRect,h=this._isRtl();if("top"===e.overlayY)i=l.height-(o=t.y)+this._viewportMargin;else if("bottom"===e.overlayY)i=l.height-(n=l.height-t.y+2*this._viewportMargin)+this._viewportMargin;else{var c=Math.min(l.bottom-t.y+l.top,t.y),p=this._lastBoundingBoxSize.height;o=t.y-c,(i=2*c)>p&&!this._isInitialRender&&!this._growAfterOpen&&(o=t.y-p/2)}if("end"===e.overlayX&&!h||"start"===e.overlayX&&h)a=l.width-t.x+this._viewportMargin,r=t.x-this._viewportMargin;else if("start"===e.overlayX&&!h||"end"===e.overlayX&&h)s=t.x,r=l.right-t.x;else{c=Math.min(l.right-t.x+l.left,t.x);var u=this._lastBoundingBoxSize.width;s=t.x-c,(r=2*c)>u&&!this._isInitialRender&&!this._growAfterOpen&&(s=t.x-u/2)}return{top:o,left:s,bottom:n,right:a,width:r,height:i}},t.prototype._setBoundingBoxStyles=function(t,e){var i=this._calculateBoundingBoxRect(t,e);this._isInitialRender||this._growAfterOpen||(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));var o={};if(this._hasExactPosition())o.top=o.left="0",o.bottom=o.right=o.maxHeight=o.maxWidth="",o.width=o.height="100%";else{var r=this._overlayRef.getConfig().maxHeight,s=this._overlayRef.getConfig().maxWidth;o.height=n.coerceCssPixelValue(i.height),o.top=n.coerceCssPixelValue(i.top),o.bottom=n.coerceCssPixelValue(i.bottom),o.width=n.coerceCssPixelValue(i.width),o.left=n.coerceCssPixelValue(i.left),o.right=n.coerceCssPixelValue(i.right),o.alignItems="center"===e.overlayX?"center":"end"===e.overlayX?"flex-end":"flex-start",o.justifyContent="center"===e.overlayY?"center":"bottom"===e.overlayY?"flex-end":"flex-start",r&&(o.maxHeight=n.coerceCssPixelValue(r)),s&&(o.maxWidth=n.coerceCssPixelValue(s))}this._lastBoundingBoxSize=i,X(this._boundingBox.style,o)},t.prototype._resetBoundingBoxStyles=function(){X(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})},t.prototype._resetOverlayElementStyles=function(){X(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})},t.prototype._setOverlayElementStyles=function(t,e){var i={},o=this._hasExactPosition(),r=this._hasFlexibleDimensions,s=this._overlayRef.getConfig();if(o){var a=this._viewportRuler.getViewportScrollPosition();X(i,this._getExactOverlayY(e,t,a)),X(i,this._getExactOverlayX(e,t,a))}else i.position="static";var l="",h=this._getOffset(e,"x"),c=this._getOffset(e,"y");h&&(l+="translateX("+h+"px) "),c&&(l+="translateY("+c+"px)"),i.transform=l.trim(),s.maxHeight&&(o?i.maxHeight=n.coerceCssPixelValue(s.maxHeight):r&&(i.maxHeight="")),s.maxWidth&&(o?i.maxWidth=n.coerceCssPixelValue(s.maxWidth):r&&(i.maxWidth="")),X(this._pane.style,i)},t.prototype._getExactOverlayY=function(t,e,i){var o={top:"",bottom:""},r=this._getOverlayPoint(e,this._overlayRect,t);this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,i));var s=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return r.y-=s,"bottom"===t.overlayY?o.bottom=this._document.documentElement.clientHeight-(r.y+this._overlayRect.height)+"px":o.top=n.coerceCssPixelValue(r.y),o},t.prototype._getExactOverlayX=function(t,e,i){var o={left:"",right:""},r=this._getOverlayPoint(e,this._overlayRect,t);return this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,i)),"right"==(this._isRtl()?"end"===t.overlayX?"left":"right":"end"===t.overlayX?"right":"left")?o.right=this._document.documentElement.clientWidth-(r.x+this._overlayRect.width)+"px":o.left=n.coerceCssPixelValue(r.x),o},t.prototype._getScrollVisibility=function(){var t=this._getOriginRect(),e=this._pane.getBoundingClientRect(),i=this._scrollables.map((function(t){return t.getElementRef().nativeElement.getBoundingClientRect()}));return{isOriginClipped:m(t,i),isOriginOutsideView:v(t,i),isOverlayClipped:m(e,i),isOverlayOutsideView:v(e,i)}},t.prototype._subtractOverflows=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return e.reduce((function(t,e){return t-Math.max(e,0)}),t)},t.prototype._getNarrowedViewportRect=function(){var t=this._document.documentElement.clientWidth,e=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+t-this._viewportMargin,bottom:i.top+e-this._viewportMargin,width:t-2*this._viewportMargin,height:e-2*this._viewportMargin}},t.prototype._isRtl=function(){return"rtl"===this._overlayRef.getDirection()},t.prototype._hasExactPosition=function(){return!this._hasFlexibleDimensions||this._isPushed},t.prototype._getOffset=function(t,e){return"x"===e?null==t.offsetX?this._offsetX:t.offsetX:null==t.offsetY?this._offsetY:t.offsetY},t.prototype._validatePositions=function(){if(!this._preferredPositions.length)throw Error("FlexibleConnectedPositionStrategy: At least one position is required.");this._preferredPositions.forEach((function(t){x("originX",t.originX),S("originY",t.originY),x("overlayX",t.overlayX),S("overlayY",t.overlayY)}))},t.prototype._addPanelClasses=function(t){var e=this;this._pane&&n.coerceArray(t).forEach((function(t){""!==t&&-1===e._appliedPanelClasses.indexOf(t)&&(e._appliedPanelClasses.push(t),e._pane.classList.add(t))}))},t.prototype._clearPanelClasses=function(){var t=this;this._pane&&(this._appliedPanelClasses.forEach((function(e){t._pane.classList.remove(e)})),this._appliedPanelClasses=[])},t.prototype._getOriginRect=function(){var t=this._origin;if(t instanceof o.ElementRef)return t.nativeElement.getBoundingClientRect();if(t instanceof Element)return t.getBoundingClientRect();var e=t.width||0,i=t.height||0;return{top:t.y,bottom:t.y+i,left:t.x,right:t.x+e,height:i,width:e}},t}();
|
|
73
|
+
*/function I(t,e){return t||new D(e)}var M={provide:D,deps:[[new o.Optional,new o.SkipSelf,D],i.DOCUMENT],useFactory:I},V=function(){function t(t,e,i,o,n,r,s,a){var h=this;this._portalOutlet=t,this._host=e,this._pane=i,this._config=o,this._ngZone=n,this._keyboardDispatcher=r,this._document=s,this._location=a,this._backdropElement=null,this._backdropClick=new l.Subject,this._attachments=new l.Subject,this._detachments=new l.Subject,this._locationChanges=l.Subscription.EMPTY,this._backdropClickHandler=function(t){return h._backdropClick.next(t)},this._keydownEvents=new l.Subject,o.scrollStrategy&&(this._scrollStrategy=o.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=o.positionStrategy}return Object.defineProperty(t.prototype,"overlayElement",{get:function(){return this._pane},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"backdropElement",{get:function(){return this._backdropElement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hostElement",{get:function(){return this._host},enumerable:!0,configurable:!0}),t.prototype.attach=function(t){var e=this,i=this._portalOutlet.attach(t);return!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host),this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._ngZone.onStable.asObservable().pipe(h.take(1)).subscribe((function(){e.hasAttached()&&e.updatePosition()})),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&this._location&&(this._locationChanges=this._location.subscribe((function(){return e.dispose()}))),i},t.prototype.detach=function(){if(this.hasAttached()){this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();var t=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),t}},t.prototype.dispose=function(){var t=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this.detachBackdrop(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._host&&this._host.parentNode&&(this._host.parentNode.removeChild(this._host),this._host=null),this._previousHostParent=this._pane=null,t&&this._detachments.next(),this._detachments.complete()},t.prototype.hasAttached=function(){return this._portalOutlet.hasAttached()},t.prototype.backdropClick=function(){return this._backdropClick.asObservable()},t.prototype.attachments=function(){return this._attachments.asObservable()},t.prototype.detachments=function(){return this._detachments.asObservable()},t.prototype.keydownEvents=function(){return this._keydownEvents.asObservable()},t.prototype.getConfig=function(){return this._config},t.prototype.updatePosition=function(){this._positionStrategy&&this._positionStrategy.apply()},t.prototype.updatePositionStrategy=function(t){t!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=t,this.hasAttached()&&(t.attach(this),this.updatePosition()))},t.prototype.updateSize=function(t){this._config=u(u({},this._config),t),this._updateElementSize()},t.prototype.setDirection=function(t){this._config=u(u({},this._config),{direction:t}),this._updateElementDirection()},t.prototype.addPanelClass=function(t){this._pane&&this._toggleClasses(this._pane,t,!0)},t.prototype.removePanelClass=function(t){this._pane&&this._toggleClasses(this._pane,t,!1)},t.prototype.getDirection=function(){var t=this._config.direction;return t?"string"==typeof t?t:t.value:"ltr"},t.prototype.updateScrollStrategy=function(t){t!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=t,this.hasAttached()&&(t.attach(this),t.enable()))},t.prototype._updateElementDirection=function(){this._host.setAttribute("dir",this.getDirection())},t.prototype._updateElementSize=function(){if(this._pane){var t=this._pane.style;t.width=n.coerceCssPixelValue(this._config.width),t.height=n.coerceCssPixelValue(this._config.height),t.minWidth=n.coerceCssPixelValue(this._config.minWidth),t.minHeight=n.coerceCssPixelValue(this._config.minHeight),t.maxWidth=n.coerceCssPixelValue(this._config.maxWidth),t.maxHeight=n.coerceCssPixelValue(this._config.maxHeight)}},t.prototype._togglePointerEvents=function(t){this._pane.style.pointerEvents=t?"auto":"none"},t.prototype._attachBackdrop=function(){var t=this;this._backdropElement=this._document.createElement("div"),this._backdropElement.classList.add("cdk-overlay-backdrop"),this._config.backdropClass&&this._toggleClasses(this._backdropElement,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropElement,this._host),this._backdropElement.addEventListener("click",this._backdropClickHandler),"undefined"!=typeof requestAnimationFrame?this._ngZone.runOutsideAngular((function(){requestAnimationFrame((function(){t._backdropElement&&t._backdropElement.classList.add("cdk-overlay-backdrop-showing")}))})):this._backdropElement.classList.add("cdk-overlay-backdrop-showing")},t.prototype._updateStackingOrder=function(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)},t.prototype.detachBackdrop=function(){var t=this,e=this._backdropElement;if(e){var i,o=function(){e&&(e.removeEventListener("click",t._backdropClickHandler),e.removeEventListener("transitionend",o),e.parentNode&&e.parentNode.removeChild(e)),t._backdropElement==e&&(t._backdropElement=null),t._config.backdropClass&&t._toggleClasses(e,t._config.backdropClass,!1),clearTimeout(i)};e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular((function(){e.addEventListener("transitionend",o)})),e.style.pointerEvents="none",i=this._ngZone.runOutsideAngular((function(){return setTimeout(o,500)}))}},t.prototype._toggleClasses=function(t,e,i){var o=t.classList;n.coerceArray(e).forEach((function(t){t&&(i?o.add(t):o.remove(t))}))},t.prototype._detachContentWhenStable=function(){var t=this;this._ngZone.runOutsideAngular((function(){var e=t._ngZone.onStable.asObservable().pipe(h.takeUntil(l.merge(t._attachments,t._detachments))).subscribe((function(){t._pane&&t._host&&0!==t._pane.children.length||(t._pane&&t._config.panelClass&&t._toggleClasses(t._pane,t._config.panelClass,!1),t._host&&t._host.parentElement&&(t._previousHostParent=t._host.parentElement,t._previousHostParent.removeChild(t._host)),e.unsubscribe())}))}))},t.prototype._disposeScrollStrategy=function(){var t=this._scrollStrategy;t&&(t.disable(),t.detach&&t.detach())},t}(),A=/([A-Za-z%]+)$/,L=function(){function t(t,e,i,o,n){this._viewportRuler=e,this._document=i,this._platform=o,this._overlayContainer=n,this._lastBoundingBoxSize={width:0,height:0},this._isPushed=!1,this._canPush=!0,this._growAfterOpen=!1,this._hasFlexibleDimensions=!0,this._positionLocked=!1,this._viewportMargin=0,this._scrollables=[],this._preferredPositions=[],this._positionChanges=new l.Subject,this._resizeSubscription=l.Subscription.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges.asObservable(),this.setOrigin(t)}return Object.defineProperty(t.prototype,"positions",{get:function(){return this._preferredPositions},enumerable:!0,configurable:!0}),t.prototype.attach=function(t){var e=this;if(this._overlayRef&&t!==this._overlayRef)throw Error("This position strategy is already attached to an overlay");this._validatePositions(),t.hostElement.classList.add("cdk-overlay-connected-position-bounding-box"),this._overlayRef=t,this._boundingBox=t.hostElement,this._pane=t.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe((function(){e._isInitialRender=!0,e.apply()}))},t.prototype.apply=function(){var t,e,i,o;if(!this._isDisposed&&this._platform.isBrowser)if(!this._isInitialRender&&this._positionLocked&&this._lastPosition)this.reapplyLastPosition();else{this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect();var n,r=this._originRect,s=this._overlayRect,a=this._viewportRect,l=[];try{for(var h=d(this._preferredPositions),c=h.next();!c.done;c=h.next()){var p=c.value,u=this._getOriginPoint(r,p),_=this._getOverlayPoint(u,s,p),f=this._getOverlayFit(_,s,a,p);if(f.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(p,u);this._canFitWithFlexibleDimensions(f,_,a)?l.push({position:p,origin:u,overlayRect:s,boundingBoxRect:this._calculateBoundingBoxRect(u,p)}):(!n||n.overlayFit.visibleArea<f.visibleArea)&&(n={overlayFit:f,overlayPoint:_,originPoint:u,position:p,overlayRect:s})}}catch(e){t={error:e}}finally{try{c&&!c.done&&(e=h.return)&&e.call(h)}finally{if(t)throw t.error}}if(l.length){var y=null,g=-1;try{for(var v=d(l),m=v.next();!m.done;m=v.next()){var b=m.value,w=b.boundingBoxRect.width*b.boundingBoxRect.height*(b.position.weight||1);w>g&&(g=w,y=b)}}catch(t){i={error:t}}finally{try{m&&!m.done&&(o=v.return)&&o.call(v)}finally{if(i)throw i.error}}return this._isPushed=!1,void this._applyPosition(y.position,y.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(n.position,n.originPoint);this._applyPosition(n.position,n.originPoint)}},t.prototype.detach=function(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()},t.prototype.dispose=function(){this._isDisposed||(this._boundingBox&&X(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove("cdk-overlay-connected-position-bounding-box"),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)},t.prototype.reapplyLastPosition=function(){if(!this._isDisposed&&(!this._platform||this._platform.isBrowser)){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect();var t=this._lastPosition||this._preferredPositions[0],e=this._getOriginPoint(this._originRect,t);this._applyPosition(t,e)}},t.prototype.withScrollableContainers=function(t){return this._scrollables=t,this},t.prototype.withPositions=function(t){return this._preferredPositions=t,-1===t.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this},t.prototype.withViewportMargin=function(t){return this._viewportMargin=t,this},t.prototype.withFlexibleDimensions=function(t){return void 0===t&&(t=!0),this._hasFlexibleDimensions=t,this},t.prototype.withGrowAfterOpen=function(t){return void 0===t&&(t=!0),this._growAfterOpen=t,this},t.prototype.withPush=function(t){return void 0===t&&(t=!0),this._canPush=t,this},t.prototype.withLockedPosition=function(t){return void 0===t&&(t=!0),this._positionLocked=t,this},t.prototype.setOrigin=function(t){return this._origin=t,this},t.prototype.withDefaultOffsetX=function(t){return this._offsetX=t,this},t.prototype.withDefaultOffsetY=function(t){return this._offsetY=t,this},t.prototype.withTransformOriginOn=function(t){return this._transformOriginSelector=t,this},t.prototype._getOriginPoint=function(t,e){var i;if("center"==e.originX)i=t.left+t.width/2;else{var o=this._isRtl()?t.right:t.left,n=this._isRtl()?t.left:t.right;i="start"==e.originX?o:n}return{x:i,y:"center"==e.originY?t.top+t.height/2:"top"==e.originY?t.top:t.bottom}},t.prototype._getOverlayPoint=function(t,e,i){var o;return o="center"==i.overlayX?-e.width/2:"start"===i.overlayX?this._isRtl()?-e.width:0:this._isRtl()?0:-e.width,{x:t.x+o,y:t.y+("center"==i.overlayY?-e.height/2:"top"==i.overlayY?0:-e.height)}},t.prototype._getOverlayFit=function(t,e,i,o){var n=t.x,r=t.y,s=this._getOffset(o,"x"),a=this._getOffset(o,"y");s&&(n+=s),a&&(r+=a);var l=0-r,h=r+e.height-i.height,c=this._subtractOverflows(e.width,0-n,n+e.width-i.width),p=this._subtractOverflows(e.height,l,h),u=c*p;return{visibleArea:u,isCompletelyWithinViewport:e.width*e.height===u,fitsInViewportVertically:p===e.height,fitsInViewportHorizontally:c==e.width}},t.prototype._canFitWithFlexibleDimensions=function(t,e,i){if(this._hasFlexibleDimensions){var o=i.bottom-e.y,n=i.right-e.x,r=Y(this._overlayRef.getConfig().minHeight),s=Y(this._overlayRef.getConfig().minWidth);return(t.fitsInViewportVertically||null!=r&&r<=o)&&(t.fitsInViewportHorizontally||null!=s&&s<=n)}return!1},t.prototype._pushOverlayOnScreen=function(t,e,i){if(this._previousPushAmount&&this._positionLocked)return{x:t.x+this._previousPushAmount.x,y:t.y+this._previousPushAmount.y};var o,n,r=this._viewportRect,s=Math.max(t.x+e.width-r.right,0),a=Math.max(t.y+e.height-r.bottom,0),l=Math.max(r.top-i.top-t.y,0),h=Math.max(r.left-i.left-t.x,0);return this._previousPushAmount={x:o=e.width<=r.width?h||-s:t.x<this._viewportMargin?r.left-i.left-t.x:0,y:n=e.height<=r.height?l||-a:t.y<this._viewportMargin?r.top-i.top-t.y:0},{x:t.x+o,y:t.y+n}},t.prototype._applyPosition=function(t,e){if(this._setTransformOrigin(t),this._setOverlayElementStyles(e,t),this._setBoundingBoxStyles(e,t),t.panelClass&&this._addPanelClasses(t.panelClass),this._lastPosition=t,this._positionChanges.observers.length){var i=this._getScrollVisibility(),o=new k(t,i);this._positionChanges.next(o)}this._isInitialRender=!1},t.prototype._setTransformOrigin=function(t){if(this._transformOriginSelector){var e,i=this._boundingBox.querySelectorAll(this._transformOriginSelector),o=t.overlayY;e="center"===t.overlayX?"center":this._isRtl()?"start"===t.overlayX?"right":"left":"start"===t.overlayX?"left":"right";for(var n=0;n<i.length;n++)i[n].style.transformOrigin=e+" "+o}},t.prototype._calculateBoundingBoxRect=function(t,e){var i,o,n,r,s,a,l=this._viewportRect,h=this._isRtl();if("top"===e.overlayY)i=l.height-(o=t.y)+this._viewportMargin;else if("bottom"===e.overlayY)i=l.height-(n=l.height-t.y+2*this._viewportMargin)+this._viewportMargin;else{var c=Math.min(l.bottom-t.y+l.top,t.y),p=this._lastBoundingBoxSize.height;o=t.y-c,(i=2*c)>p&&!this._isInitialRender&&!this._growAfterOpen&&(o=t.y-p/2)}if("end"===e.overlayX&&!h||"start"===e.overlayX&&h)a=l.width-t.x+this._viewportMargin,r=t.x-this._viewportMargin;else if("start"===e.overlayX&&!h||"end"===e.overlayX&&h)s=t.x,r=l.right-t.x;else{c=Math.min(l.right-t.x+l.left,t.x);var u=this._lastBoundingBoxSize.width;s=t.x-c,(r=2*c)>u&&!this._isInitialRender&&!this._growAfterOpen&&(s=t.x-u/2)}return{top:o,left:s,bottom:n,right:a,width:r,height:i}},t.prototype._setBoundingBoxStyles=function(t,e){var i=this._calculateBoundingBoxRect(t,e);this._isInitialRender||this._growAfterOpen||(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));var o={};if(this._hasExactPosition())o.top=o.left="0",o.bottom=o.right=o.maxHeight=o.maxWidth="",o.width=o.height="100%";else{var r=this._overlayRef.getConfig().maxHeight,s=this._overlayRef.getConfig().maxWidth;o.height=n.coerceCssPixelValue(i.height),o.top=n.coerceCssPixelValue(i.top),o.bottom=n.coerceCssPixelValue(i.bottom),o.width=n.coerceCssPixelValue(i.width),o.left=n.coerceCssPixelValue(i.left),o.right=n.coerceCssPixelValue(i.right),o.alignItems="center"===e.overlayX?"center":"end"===e.overlayX?"flex-end":"flex-start",o.justifyContent="center"===e.overlayY?"center":"bottom"===e.overlayY?"flex-end":"flex-start",r&&(o.maxHeight=n.coerceCssPixelValue(r)),s&&(o.maxWidth=n.coerceCssPixelValue(s))}this._lastBoundingBoxSize=i,X(this._boundingBox.style,o)},t.prototype._resetBoundingBoxStyles=function(){X(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})},t.prototype._resetOverlayElementStyles=function(){X(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})},t.prototype._setOverlayElementStyles=function(t,e){var i={},o=this._hasExactPosition(),r=this._hasFlexibleDimensions,s=this._overlayRef.getConfig();if(o){var a=this._viewportRuler.getViewportScrollPosition();X(i,this._getExactOverlayY(e,t,a)),X(i,this._getExactOverlayX(e,t,a))}else i.position="static";var l="",h=this._getOffset(e,"x"),c=this._getOffset(e,"y");h&&(l+="translateX("+h+"px) "),c&&(l+="translateY("+c+"px)"),i.transform=l.trim(),s.maxHeight&&(o?i.maxHeight=n.coerceCssPixelValue(s.maxHeight):r&&(i.maxHeight="")),s.maxWidth&&(o?i.maxWidth=n.coerceCssPixelValue(s.maxWidth):r&&(i.maxWidth="")),X(this._pane.style,i)},t.prototype._getExactOverlayY=function(t,e,i){var o={top:"",bottom:""},r=this._getOverlayPoint(e,this._overlayRect,t);this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,i));var s=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return r.y-=s,"bottom"===t.overlayY?o.bottom=this._document.documentElement.clientHeight-(r.y+this._overlayRect.height)+"px":o.top=n.coerceCssPixelValue(r.y),o},t.prototype._getExactOverlayX=function(t,e,i){var o={left:"",right:""},r=this._getOverlayPoint(e,this._overlayRect,t);return this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,i)),"right"==(this._isRtl()?"end"===t.overlayX?"left":"right":"end"===t.overlayX?"right":"left")?o.right=this._document.documentElement.clientWidth-(r.x+this._overlayRect.width)+"px":o.left=n.coerceCssPixelValue(r.x),o},t.prototype._getScrollVisibility=function(){var t=this._getOriginRect(),e=this._pane.getBoundingClientRect(),i=this._scrollables.map((function(t){return t.getElementRef().nativeElement.getBoundingClientRect()}));return{isOriginClipped:m(t,i),isOriginOutsideView:v(t,i),isOverlayClipped:m(e,i),isOverlayOutsideView:v(e,i)}},t.prototype._subtractOverflows=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return e.reduce((function(t,e){return t-Math.max(e,0)}),t)},t.prototype._getNarrowedViewportRect=function(){var t=this._document.documentElement.clientWidth,e=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+t-this._viewportMargin,bottom:i.top+e-this._viewportMargin,width:t-2*this._viewportMargin,height:e-2*this._viewportMargin}},t.prototype._isRtl=function(){return"rtl"===this._overlayRef.getDirection()},t.prototype._hasExactPosition=function(){return!this._hasFlexibleDimensions||this._isPushed},t.prototype._getOffset=function(t,e){return"x"===e?null==t.offsetX?this._offsetX:t.offsetX:null==t.offsetY?this._offsetY:t.offsetY},t.prototype._validatePositions=function(){if(!this._preferredPositions.length)throw Error("FlexibleConnectedPositionStrategy: At least one position is required.");this._preferredPositions.forEach((function(t){x("originX",t.originX),S("originY",t.originY),x("overlayX",t.overlayX),S("overlayY",t.overlayY)}))},t.prototype._addPanelClasses=function(t){var e=this;this._pane&&n.coerceArray(t).forEach((function(t){""!==t&&-1===e._appliedPanelClasses.indexOf(t)&&(e._appliedPanelClasses.push(t),e._pane.classList.add(t))}))},t.prototype._clearPanelClasses=function(){var t=this;this._pane&&(this._appliedPanelClasses.forEach((function(e){t._pane.classList.remove(e)})),this._appliedPanelClasses=[])},t.prototype._getOriginRect=function(){var t=this._origin;if(t instanceof o.ElementRef)return t.nativeElement.getBoundingClientRect();if(t instanceof Element)return t.getBoundingClientRect();var e=t.width||0,i=t.height||0;return{top:t.y,bottom:t.y+i,left:t.x,right:t.x+e,height:i,width:e}},t}();
|
|
74
74
|
/**
|
|
75
75
|
* @license
|
|
76
76
|
* Copyright Google LLC All Rights Reserved.
|