@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
|
@@ -71,7 +71,7 @@ function P(e){return 0===e.buttons}
|
|
|
71
71
|
*
|
|
72
72
|
* Use of this source code is governed by an MIT-style license that can be
|
|
73
73
|
* found in the LICENSE file at https://angular.io/license
|
|
74
|
-
*/var K=650,U=new n.InjectionToken("cdk-focus-monitor-default-options"),Z=c.normalizePassiveListenerOptions({passive:!0,capture:!0}),W=function(){function e(e,t,n,r){var o=this;this._ngZone=e,this._platform=t,this._origin=null,this._windowFocused=!1,this._elementInfo=new Map,this._monitoredElementCount=0,this._rootNodeFocusListenerCount=new Map,this._documentKeydownListener=function(){o._lastTouchTarget=null,o._setOriginForCurrentEventQueue("keyboard")},this._documentMousedownListener=function(e){if(!o._lastTouchTarget){var t=P(e)?"keyboard":"mouse";o._setOriginForCurrentEventQueue(t)}},this._documentTouchstartListener=function(e){null!=o._touchTimeoutId&&clearTimeout(o._touchTimeoutId),o._lastTouchTarget=V(e),o._touchTimeoutId=setTimeout((function(){return o._lastTouchTarget=null}),K)},this._windowFocusListener=function(){o._windowFocused=!0,o._windowFocusTimeoutId=setTimeout((function(){return o._windowFocused=!1}))},this._rootNodeFocusAndBlurListener=function(e){for(var t=V(e),n="focus"===e.type?o._onFocus:o._onBlur,r=t;r;r=r.parentElement)n.call(o,e,r)},this._document=n,this._detectionMode=(null==r?void 0:r.detectionMode)||0}return e.prototype.monitor=function(e,t){if(void 0===t&&(t=!1),!this._platform.isBrowser)return r.of(null);var n=s.coerceElement(e),o=c._getShadowRoot(n)||this._getDocument()
|
|
74
|
+
*/var K=650,U=new n.InjectionToken("cdk-focus-monitor-default-options"),Z=c.normalizePassiveListenerOptions({passive:!0,capture:!0}),W=function(){function e(e,t,n,r){var o=this;this._ngZone=e,this._platform=t,this._origin=null,this._windowFocused=!1,this._elementInfo=new Map,this._monitoredElementCount=0,this._rootNodeFocusListenerCount=new Map,this._documentKeydownListener=function(){o._lastTouchTarget=null,o._setOriginForCurrentEventQueue("keyboard")},this._documentMousedownListener=function(e){if(!o._lastTouchTarget){var t=P(e)?"keyboard":"mouse";o._setOriginForCurrentEventQueue(t)}},this._documentTouchstartListener=function(e){null!=o._touchTimeoutId&&clearTimeout(o._touchTimeoutId),o._lastTouchTarget=V(e),o._touchTimeoutId=setTimeout((function(){return o._lastTouchTarget=null}),K)},this._windowFocusListener=function(){o._windowFocused=!0,o._windowFocusTimeoutId=setTimeout((function(){return o._windowFocused=!1}))},this._rootNodeFocusAndBlurListener=function(e){for(var t=V(e),n="focus"===e.type?o._onFocus:o._onBlur,r=t;r;r=r.parentElement)n.call(o,e,r)},this._document=n,this._detectionMode=(null==r?void 0:r.detectionMode)||0}return e.prototype.monitor=function(e,t){if(void 0===t&&(t=!1),!this._platform.isBrowser)return r.of(null);var n=s.coerceElement(e),o=c._getShadowRoot(n)||this._getDocument(),i=this._elementInfo.get(n);if(i)return t&&(i.checkChildren=!0),i.subject.asObservable();var a={checkChildren:t,subject:new r.Subject,rootNode:o};return this._elementInfo.set(n,a),this._registerGlobalListeners(a),a.subject.asObservable()},e.prototype.stopMonitoring=function(e){var t=s.coerceElement(e),n=this._elementInfo.get(t);n&&(n.subject.complete(),this._setClasses(t),this._elementInfo.delete(t),this._removeGlobalListeners(n))},e.prototype.focusVia=function(e,t,n){var r=s.coerceElement(e);this._setOriginForCurrentEventQueue(t),"function"==typeof r.focus&&r.focus(n)},e.prototype.ngOnDestroy=function(){var e=this;this._elementInfo.forEach((function(t,n){return e.stopMonitoring(n)}))},e.prototype._getDocument=function(){return this._document||document},e.prototype._getWindow=function(){return this._getDocument().defaultView||window},e.prototype._toggleClass=function(e,t,n){n?e.classList.add(t):e.classList.remove(t)},e.prototype._getFocusOrigin=function(e){return this._origin?this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:this._wasCausedByTouch(e)?"touch":"program"},e.prototype._setClasses=function(e,t){this._toggleClass(e,"cdk-focused",!!t),this._toggleClass(e,"cdk-touch-focused","touch"===t),this._toggleClass(e,"cdk-keyboard-focused","keyboard"===t),this._toggleClass(e,"cdk-mouse-focused","mouse"===t),this._toggleClass(e,"cdk-program-focused","program"===t)},e.prototype._setOriginForCurrentEventQueue=function(e){var t=this;this._ngZone.runOutsideAngular((function(){t._origin=e,0===t._detectionMode&&(t._originTimeoutId=setTimeout((function(){return t._origin=null}),1))}))},e.prototype._wasCausedByTouch=function(e){var t=V(e);return this._lastTouchTarget instanceof Node&&t instanceof Node&&(t===this._lastTouchTarget||t.contains(this._lastTouchTarget))},e.prototype._onFocus=function(e,t){var n=this._elementInfo.get(t);if(n&&(n.checkChildren||t===V(e))){var r=this._getFocusOrigin(e);this._setClasses(t,r),this._emitOrigin(n.subject,r),this._lastFocusOrigin=r}},e.prototype._onBlur=function(e,t){var n=this._elementInfo.get(t);!n||n.checkChildren&&e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)||(this._setClasses(t),this._emitOrigin(n.subject,null))},e.prototype._emitOrigin=function(e,t){this._ngZone.run((function(){return e.next(t)}))},e.prototype._registerGlobalListeners=function(e){var t=this;if(this._platform.isBrowser){var n=e.rootNode,r=this._rootNodeFocusListenerCount.get(n)||0;r||this._ngZone.runOutsideAngular((function(){n.addEventListener("focus",t._rootNodeFocusAndBlurListener,Z),n.addEventListener("blur",t._rootNodeFocusAndBlurListener,Z)})),this._rootNodeFocusListenerCount.set(n,r+1),1==++this._monitoredElementCount&&this._ngZone.runOutsideAngular((function(){var e=t._getDocument(),n=t._getWindow();e.addEventListener("keydown",t._documentKeydownListener,Z),e.addEventListener("mousedown",t._documentMousedownListener,Z),e.addEventListener("touchstart",t._documentTouchstartListener,Z),n.addEventListener("focus",t._windowFocusListener)}))}},e.prototype._removeGlobalListeners=function(e){var t=e.rootNode;if(this._rootNodeFocusListenerCount.has(t)){var n=this._rootNodeFocusListenerCount.get(t);n>1?this._rootNodeFocusListenerCount.set(t,n-1):(t.removeEventListener("focus",this._rootNodeFocusAndBlurListener,Z),t.removeEventListener("blur",this._rootNodeFocusAndBlurListener,Z),this._rootNodeFocusListenerCount.delete(t))}if(!--this._monitoredElementCount){var r=this._getDocument(),o=this._getWindow();r.removeEventListener("keydown",this._documentKeydownListener,Z),r.removeEventListener("mousedown",this._documentMousedownListener,Z),r.removeEventListener("touchstart",this._documentTouchstartListener,Z),o.removeEventListener("focus",this._windowFocusListener),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._touchTimeoutId),clearTimeout(this._originTimeoutId)}},e.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:n.NgZone},{type:c.Platform},{type:void 0,decorators:[{type:n.Optional},{type:n.Inject,args:[t.DOCUMENT]}]},{type:void 0,decorators:[{type:n.Optional},{type:n.Inject,args:[U]}]}]},e.ɵprov=n.ɵɵdefineInjectable({factory:function r(){return new e(n.ɵɵinject(n.NgZone),n.ɵɵinject(c.Platform),n.ɵɵinject(t.DOCUMENT,8),n.ɵɵinject(U,8))},token:e,providedIn:"root"}),e}();function V(e){return e.composedPath?e.composedPath()[0]:e.target}var q=function(){function e(e,t){var r=this;this._elementRef=e,this._focusMonitor=t,this.cdkFocusChange=new n.EventEmitter,this._monitorSubscription=this._focusMonitor.monitor(this._elementRef,this._elementRef.nativeElement.hasAttribute("cdkMonitorSubtreeFocus")).subscribe((function(e){return r.cdkFocusChange.emit(e)}))}return e.prototype.ngOnDestroy=function(){this._focusMonitor.stopMonitoring(this._elementRef),this._monitorSubscription.unsubscribe()},e.decorators=[{type:n.Directive,args:[{selector:"[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]"}]}],e.ctorParameters=function(){return[{type:n.ElementRef},{type:W}]},e.propDecorators={cdkFocusChange:[{type:n.Output}]},e}(),H=function(){function e(e,t){this._platform=e,this._document=t}return e.prototype.getHighContrastMode=function(){if(!this._platform.isBrowser)return 0;var e=this._document.createElement("div");e.style.backgroundColor="rgb(1,2,3)",e.style.position="absolute",this._document.body.appendChild(e);var t=this._document.defaultView||window,n=t&&t.getComputedStyle?t.getComputedStyle(e):null,r=(n&&n.backgroundColor||"").replace(/ /g,"");switch(this._document.body.removeChild(e),r){case"rgb(0,0,0)":return 2;case"rgb(255,255,255)":return 1}return 0},e.prototype._applyBodyHighContrastModeCssClasses=function(){if(this._platform.isBrowser&&this._document.body){var e=this._document.body.classList;e.remove("cdk-high-contrast-active"),e.remove("cdk-high-contrast-black-on-white"),e.remove("cdk-high-contrast-white-on-black");var t=this.getHighContrastMode();1===t?(e.add("cdk-high-contrast-active"),e.add("cdk-high-contrast-black-on-white")):2===t&&(e.add("cdk-high-contrast-active"),e.add("cdk-high-contrast-white-on-black"))}},e.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:c.Platform},{type:void 0,decorators:[{type:n.Inject,args:[t.DOCUMENT]}]}]},e.ɵprov=n.ɵɵdefineInjectable({factory:function r(){return new e(n.ɵɵinject(c.Platform),n.ɵɵinject(t.DOCUMENT))},token:e,providedIn:"root"}),e}(),G=function(){function e(e){e._applyBodyHighContrastModeCssClasses()}return e.decorators=[{type:n.NgModule,args:[{imports:[c.PlatformModule,a.ObserversModule],declarations:[B,k,q],exports:[B,k,q]}]}],e.ctorParameters=function(){return[{type:H}]},e}();
|
|
75
75
|
/**
|
|
76
76
|
* @license
|
|
77
77
|
* Copyright Google LLC All Rights Reserved.
|