@angular/cdk 11.0.3 → 11.0.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/LICENSE +1 -1
- package/a11y/focus-monitor/focus-monitor.d.ts +6 -0
- package/a11y/index.metadata.json +1 -1
- package/bundles/cdk-a11y.umd.js +21 -9
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +1 -8
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.js +78 -40
- package/bundles/cdk-drag-drop.umd.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.min.js +8 -8
- package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +15 -7
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js +17 -24
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-platform.umd.js +1 -0
- package/bundles/cdk-platform.umd.js.map +1 -1
- package/bundles/cdk-platform.umd.min.js +1 -1
- package/bundles/cdk-platform.umd.min.js.map +1 -1
- package/bundles/cdk-scrolling.umd.js +9 -3
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.min.js +2 -2
- package/bundles/cdk-scrolling.umd.min.js.map +1 -1
- package/bundles/cdk-tree.umd.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/drag-drop/directives/drag.d.ts +1 -1
- package/drag-drop/drag-drop-registry.d.ts +8 -1
- package/drag-drop/drag-ref.d.ts +2 -0
- package/drag-drop/drop-list-ref.d.ts +5 -1
- package/drag-drop/index.metadata.json +1 -1
- package/esm2015/a11y/focus-monitor/focus-monitor.js +18 -3
- package/esm2015/drag-drop/directives/drag.js +6 -4
- package/esm2015/drag-drop/drag-drop-registry.js +25 -12
- package/esm2015/drag-drop/drag-ref.js +10 -8
- package/esm2015/drag-drop/drop-list-ref.js +39 -19
- package/esm2015/overlay/scroll/block-scroll-strategy.js +13 -4
- package/esm2015/platform/features/scrolling.js +2 -1
- package/esm2015/scrolling/fixed-size-virtual-scroll.js +3 -2
- package/esm2015/scrolling/virtual-for-of.js +8 -4
- package/esm2015/tree/nested-node.js +1 -1
- package/esm2015/tree/padding.js +1 -1
- package/esm2015/tree/toggle.js +1 -1
- package/esm2015/tree/tree.js +1 -1
- package/esm2015/version.js +1 -1
- package/fesm2015/a11y.js +17 -2
- package/fesm2015/a11y.js.map +1 -1
- package/fesm2015/cdk.js +1 -1
- package/fesm2015/cdk.js.map +1 -1
- package/fesm2015/drag-drop.js +76 -39
- package/fesm2015/drag-drop.js.map +1 -1
- package/fesm2015/overlay.js +12 -4
- package/fesm2015/overlay.js.map +1 -1
- package/fesm2015/platform.js +1 -0
- package/fesm2015/platform.js.map +1 -1
- package/fesm2015/scrolling.js +9 -4
- package/fesm2015/scrolling.js.map +1 -1
- package/fesm2015/tree.js.map +1 -1
- package/overlay/index.metadata.json +1 -1
- package/package.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/scrolling/index.metadata.json +1 -1
- package/tree/index.metadata.json +1 -1
- package/tree/nested-node.d.ts +3 -3
- package/tree/padding.d.ts +2 -2
- package/tree/toggle.d.ts +4 -4
- package/tree/tree.d.ts +5 -5
|
@@ -87,14 +87,7 @@ var S=new n.InjectionToken("liveAnnouncerElement",{providedIn:"root",factory:R})
|
|
|
87
87
|
* Use of this source code is governed by an MIT-style license that can be
|
|
88
88
|
* found in the LICENSE file at https://angular.io/license
|
|
89
89
|
*/
|
|
90
|
-
function Z(e){return 0===e.buttons}
|
|
91
|
-
/**
|
|
92
|
-
* @license
|
|
93
|
-
* Copyright Google LLC All Rights Reserved.
|
|
94
|
-
*
|
|
95
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
96
|
-
* found in the LICENSE file at https://angular.io/license
|
|
97
|
-
*/U.decorators=[{type:n.Directive,args:[{selector:"[cdkAriaLive]",exportAs:"cdkAriaLive"}]}],U.ctorParameters=function(){return[{type:n.ElementRef},{type:B},{type:a.ContentObserver},{type:n.NgZone}]},U.propDecorators={politeness:[{type:n.Input,args:["cdkAriaLive"]}]};var K=new n.InjectionToken("cdk-focus-monitor-default-options"),W=r.normalizePassiveListenerOptions({passive:!0,capture:!0}),V=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=Z(e)?"keyboard":"mouse";o._setOriginForCurrentEventQueue(t)}},this._documentTouchstartListener=function(e){null!=o._touchTimeoutId&&clearTimeout(o._touchTimeoutId),o._lastTouchTarget=H(e),o._touchTimeoutId=setTimeout((function(){return o._lastTouchTarget=null}),650)},this._windowFocusListener=function(){o._windowFocused=!0,o._windowFocusTimeoutId=setTimeout((function(){return o._windowFocused=!1}))},this._rootNodeFocusAndBlurListener=function(e){for(var t=H(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){void 0===t&&(t=!1);var n=c.coerceElement(e);if(!this._platform.isBrowser||1!==n.nodeType)return o.of(null);var i=r._getShadowRoot(n)||this._getDocument(),s=this._elementInfo.get(n);if(s)return t&&(s.checkChildren=!0),s.subject;var a={checkChildren:t,subject:new o.Subject,rootNode:i};return this._elementInfo.set(n,a),this._registerGlobalListeners(a),a.subject},e.prototype.stopMonitoring=function(e){var t=c.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=c.coerceElement(e);r===this._getDocument().activeElement&&this._elementInfo.has(r)?this._originChanged(r,t,this._elementInfo.get(r)):(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=H(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);n&&(n.checkChildren||t===H(e))&&this._originChanged(t,this._getFocusOrigin(e),n)},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,W),n.addEventListener("blur",t._rootNodeFocusAndBlurListener,W)})),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,W),e.addEventListener("mousedown",t._documentMousedownListener,W),e.addEventListener("touchstart",t._documentTouchstartListener,W),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,W),t.removeEventListener("blur",this._rootNodeFocusAndBlurListener,W),this._rootNodeFocusListenerCount.delete(t))}if(!--this._monitoredElementCount){var r=this._getDocument(),o=this._getWindow();r.removeEventListener("keydown",this._documentKeydownListener,W),r.removeEventListener("mousedown",this._documentMousedownListener,W),r.removeEventListener("touchstart",this._documentTouchstartListener,W),o.removeEventListener("focus",this._windowFocusListener),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._touchTimeoutId),clearTimeout(this._originTimeoutId)}},e.prototype._originChanged=function(e,t,n){this._setClasses(e,t),this._emitOrigin(n.subject,t),this._lastFocusOrigin=t},e}();function H(e){return e.composedPath?e.composedPath()[0]:e.target}V.ɵprov=n.ɵɵdefineInjectable({factory:function e(){return new V(n.ɵɵinject(n.NgZone),n.ɵɵinject(r.Platform),n.ɵɵinject(t.DOCUMENT,8),n.ɵɵinject(K,8))},token:V,providedIn:"root"}),V.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],V.ctorParameters=function(){return[{type:n.NgZone},{type:r.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:[K]}]}]};var q=function(){function e(e,t){this._elementRef=e,this._focusMonitor=t,this.cdkFocusChange=new n.EventEmitter}return e.prototype.ngAfterViewInit=function(){var e=this,t=this._elementRef.nativeElement;this._monitorSubscription=this._focusMonitor.monitor(t,1===t.nodeType&&t.hasAttribute("cdkMonitorSubtreeFocus")).subscribe((function(t){return e.cdkFocusChange.emit(t)}))},e.prototype.ngOnDestroy=function(){this._focusMonitor.stopMonitoring(this._elementRef),this._monitorSubscription&&this._monitorSubscription.unsubscribe()},e}();q.decorators=[{type:n.Directive,args:[{selector:"[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]"}]}],q.ctorParameters=function(){return[{type:n.ElementRef},{type:V}]},q.propDecorators={cdkFocusChange:[{type:n.Output}]};
|
|
90
|
+
function Z(e){return 0===e.buttons}U.decorators=[{type:n.Directive,args:[{selector:"[cdkAriaLive]",exportAs:"cdkAriaLive"}]}],U.ctorParameters=function(){return[{type:n.ElementRef},{type:B},{type:a.ContentObserver},{type:n.NgZone}]},U.propDecorators={politeness:[{type:n.Input,args:["cdkAriaLive"]}]};var K=new n.InjectionToken("cdk-focus-monitor-default-options"),W=r.normalizePassiveListenerOptions({passive:!0,capture:!0}),V=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=Z(e)?"keyboard":"mouse";o._setOriginForCurrentEventQueue(t)}},this._documentTouchstartListener=function(e){null!=o._touchTimeoutId&&clearTimeout(o._touchTimeoutId),o._lastTouchTarget=H(e),o._touchTimeoutId=setTimeout((function(){return o._lastTouchTarget=null}),650)},this._windowFocusListener=function(){o._windowFocused=!0,o._windowFocusTimeoutId=setTimeout((function(){return o._windowFocused=!1}))},this._rootNodeFocusAndBlurListener=function(e){for(var t=H(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){void 0===t&&(t=!1);var n=c.coerceElement(e);if(!this._platform.isBrowser||1!==n.nodeType)return o.of(null);var i=r._getShadowRoot(n)||this._getDocument(),s=this._elementInfo.get(n);if(s)return t&&(s.checkChildren=!0),s.subject;var a={checkChildren:t,subject:new o.Subject,rootNode:i};return this._elementInfo.set(n,a),this._registerGlobalListeners(a),a.subject},e.prototype.stopMonitoring=function(e){var t=c.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=this,o=c.coerceElement(e);o===this._getDocument().activeElement?this._getClosestElementsInfo(o).forEach((function(e){var n=m(e,2);return r._originChanged(n[0],t,n[1])})):(this._setOriginForCurrentEventQueue(t),"function"==typeof o.focus&&o.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=H(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);n&&(n.checkChildren||t===H(e))&&this._originChanged(t,this._getFocusOrigin(e),n)},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,W),n.addEventListener("blur",t._rootNodeFocusAndBlurListener,W)})),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,W),e.addEventListener("mousedown",t._documentMousedownListener,W),e.addEventListener("touchstart",t._documentTouchstartListener,W),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,W),t.removeEventListener("blur",this._rootNodeFocusAndBlurListener,W),this._rootNodeFocusListenerCount.delete(t))}if(!--this._monitoredElementCount){var r=this._getDocument(),o=this._getWindow();r.removeEventListener("keydown",this._documentKeydownListener,W),r.removeEventListener("mousedown",this._documentMousedownListener,W),r.removeEventListener("touchstart",this._documentTouchstartListener,W),o.removeEventListener("focus",this._windowFocusListener),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._touchTimeoutId),clearTimeout(this._originTimeoutId)}},e.prototype._originChanged=function(e,t,n){this._setClasses(e,t),this._emitOrigin(n.subject,t),this._lastFocusOrigin=t},e.prototype._getClosestElementsInfo=function(e){var t=[];return this._elementInfo.forEach((function(n,r){(r===e||n.checkChildren&&r.contains(e))&&t.push([r,n])})),t},e}();function H(e){return e.composedPath?e.composedPath()[0]:e.target}V.ɵprov=n.ɵɵdefineInjectable({factory:function e(){return new V(n.ɵɵinject(n.NgZone),n.ɵɵinject(r.Platform),n.ɵɵinject(t.DOCUMENT,8),n.ɵɵinject(K,8))},token:V,providedIn:"root"}),V.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],V.ctorParameters=function(){return[{type:n.NgZone},{type:r.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:[K]}]}]};var q=function(){function e(e,t){this._elementRef=e,this._focusMonitor=t,this.cdkFocusChange=new n.EventEmitter}return e.prototype.ngAfterViewInit=function(){var e=this,t=this._elementRef.nativeElement;this._monitorSubscription=this._focusMonitor.monitor(t,1===t.nodeType&&t.hasAttribute("cdkMonitorSubtreeFocus")).subscribe((function(t){return e.cdkFocusChange.emit(t)}))},e.prototype.ngOnDestroy=function(){this._focusMonitor.stopMonitoring(this._elementRef),this._monitorSubscription&&this._monitorSubscription.unsubscribe()},e}();q.decorators=[{type:n.Directive,args:[{selector:"[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]"}]}],q.ctorParameters=function(){return[{type:n.ElementRef},{type:V}]},q.propDecorators={cdkFocusChange:[{type:n.Output}]};
|
|
98
91
|
/**
|
|
99
92
|
* @license
|
|
100
93
|
* Copyright Google LLC All Rights Reserved.
|