@angular/cdk 9.1.1 → 9.2.0

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.
Files changed (190) hide show
  1. package/a11y/focus-monitor/focus-monitor.d.ts +36 -2
  2. package/a11y/index.metadata.json +1 -1
  3. package/bundles/cdk-a11y.umd.js +241 -19
  4. package/bundles/cdk-a11y.umd.js.map +1 -1
  5. package/bundles/cdk-a11y.umd.min.js +25 -10
  6. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  7. package/bundles/cdk-clipboard.umd.js +1 -1
  8. package/bundles/cdk-clipboard.umd.js.map +1 -1
  9. package/bundles/cdk-clipboard.umd.min.js +1 -1
  10. package/bundles/cdk-clipboard.umd.min.js.map +1 -1
  11. package/bundles/cdk-coercion.umd.js +0 -1
  12. package/bundles/cdk-coercion.umd.js.map +1 -1
  13. package/bundles/cdk-coercion.umd.min.js.map +1 -1
  14. package/bundles/cdk-collections.umd.js +203 -6
  15. package/bundles/cdk-collections.umd.js.map +1 -1
  16. package/bundles/cdk-collections.umd.min.js +17 -10
  17. package/bundles/cdk-collections.umd.min.js.map +1 -1
  18. package/bundles/cdk-drag-drop.umd.js +217 -23
  19. package/bundles/cdk-drag-drop.umd.js.map +1 -1
  20. package/bundles/cdk-drag-drop.umd.min.js +25 -10
  21. package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
  22. package/bundles/cdk-overlay.umd.js +210 -12
  23. package/bundles/cdk-overlay.umd.js.map +1 -1
  24. package/bundles/cdk-overlay.umd.min.js +27 -12
  25. package/bundles/cdk-overlay.umd.min.js.map +1 -1
  26. package/bundles/cdk-platform.umd.js +11 -0
  27. package/bundles/cdk-platform.umd.js.map +1 -1
  28. package/bundles/cdk-platform.umd.min.js +6 -6
  29. package/bundles/cdk-platform.umd.min.js.map +1 -1
  30. package/bundles/cdk-portal.umd.js +211 -14
  31. package/bundles/cdk-portal.umd.js.map +1 -1
  32. package/bundles/cdk-portal.umd.min.js +19 -4
  33. package/bundles/cdk-portal.umd.min.js.map +1 -1
  34. package/bundles/cdk-scrolling.umd.js +242 -14
  35. package/bundles/cdk-scrolling.umd.js.map +1 -1
  36. package/bundles/cdk-scrolling.umd.min.js +14 -6
  37. package/bundles/cdk-scrolling.umd.min.js.map +1 -1
  38. package/bundles/cdk-table.umd.js +278 -50
  39. package/bundles/cdk-table.umd.js.map +1 -1
  40. package/bundles/cdk-table.umd.min.js +29 -7
  41. package/bundles/cdk-table.umd.min.js.map +1 -1
  42. package/bundles/cdk-testing-protractor.umd.js +254 -49
  43. package/bundles/cdk-testing-protractor.umd.js.map +1 -1
  44. package/bundles/cdk-testing-protractor.umd.min.js +16 -9
  45. package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
  46. package/bundles/cdk-testing-testbed.umd.js +257 -54
  47. package/bundles/cdk-testing-testbed.umd.js.map +1 -1
  48. package/bundles/cdk-testing-testbed.umd.min.js +23 -8
  49. package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
  50. package/bundles/cdk-testing.umd.js +243 -46
  51. package/bundles/cdk-testing.umd.js.map +1 -1
  52. package/bundles/cdk-testing.umd.min.js +20 -5
  53. package/bundles/cdk-testing.umd.min.js.map +1 -1
  54. package/bundles/cdk-text-field.umd.js +21 -6
  55. package/bundles/cdk-text-field.umd.js.map +1 -1
  56. package/bundles/cdk-text-field.umd.min.js +3 -3
  57. package/bundles/cdk-text-field.umd.min.js.map +1 -1
  58. package/bundles/cdk-tree.umd.js +212 -15
  59. package/bundles/cdk-tree.umd.js.map +1 -1
  60. package/bundles/cdk-tree.umd.min.js +17 -3
  61. package/bundles/cdk-tree.umd.min.js.map +1 -1
  62. package/bundles/cdk.umd.js +1 -1
  63. package/bundles/cdk.umd.js.map +1 -1
  64. package/bundles/cdk.umd.min.js +1 -1
  65. package/bundles/cdk.umd.min.js.map +1 -1
  66. package/coercion/array.d.ts +1 -0
  67. package/esm2015/a11y/focus-monitor/focus-monitor.js +93 -12
  68. package/esm2015/a11y/focus-trap/configurable-focus-trap-factory.js +3 -3
  69. package/esm2015/a11y/focus-trap/focus-trap.js +1 -1
  70. package/esm2015/a11y/live-announcer/live-announcer.js +1 -1
  71. package/esm2015/a11y/public-api.js +2 -2
  72. package/esm2015/bidi/directionality.js +1 -1
  73. package/esm2015/clipboard/pending-copy.js +3 -3
  74. package/esm2015/coercion/array.js +1 -2
  75. package/esm2015/drag-drop/drag-drop.js +1 -1
  76. package/esm2015/drag-drop/drag-ref.js +7 -5
  77. package/esm2015/drag-drop/drop-list-ref.js +11 -19
  78. package/esm2015/layout/breakpoints-observer.js +1 -1
  79. package/esm2015/overlay/position/flexible-connected-position-strategy.js +3 -2
  80. package/esm2015/overlay/position/overlay-position-builder.js +1 -1
  81. package/esm2015/platform/features/shadow-dom.js +16 -1
  82. package/esm2015/platform/public-api.js +2 -2
  83. package/esm2015/scrolling/scroll-dispatcher.js +38 -5
  84. package/esm2015/scrolling/viewport-ruler.js +44 -5
  85. package/esm2015/table/cell.js +18 -8
  86. package/esm2015/table/public-api.js +3 -2
  87. package/esm2015/table/row.js +24 -8
  88. package/esm2015/table/table.js +26 -12
  89. package/esm2015/table/text-column.js +3 -26
  90. package/esm2015/table/tokens.js +44 -0
  91. package/esm2015/testing/protractor/protractor-element.js +4 -2
  92. package/esm2015/testing/protractor/protractor-harness-environment.js +13 -8
  93. package/esm2015/testing/testbed/testbed-harness-environment.js +16 -10
  94. package/esm2015/text-field/autosize.js +38 -4
  95. package/esm2015/version.js +1 -1
  96. package/esm5/a11y/focus-monitor/focus-monitor.js +39 -13
  97. package/esm5/a11y/focus-trap/configurable-focus-trap-factory.js +3 -3
  98. package/esm5/a11y/focus-trap/focus-trap.js +1 -1
  99. package/esm5/a11y/live-announcer/live-announcer.js +1 -1
  100. package/esm5/bidi/directionality.js +1 -1
  101. package/esm5/clipboard/pending-copy.js +2 -2
  102. package/esm5/coercion/array.js +1 -2
  103. package/esm5/drag-drop/drag-drop.js +1 -1
  104. package/esm5/drag-drop/drag-ref.js +7 -5
  105. package/esm5/drag-drop/drop-list-ref.js +9 -14
  106. package/esm5/layout/breakpoints-observer.js +1 -1
  107. package/esm5/overlay/position/flexible-connected-position-strategy.js +3 -2
  108. package/esm5/overlay/position/overlay-position-builder.js +1 -1
  109. package/esm5/platform/features/shadow-dom.js +11 -1
  110. package/esm5/scrolling/scroll-dispatcher.js +21 -5
  111. package/esm5/scrolling/viewport-ruler.js +24 -5
  112. package/esm5/table/cell.js +13 -8
  113. package/esm5/table/public-api.js +2 -1
  114. package/esm5/table/row.js +21 -11
  115. package/esm5/table/table.js +16 -11
  116. package/esm5/table/text-column.js +3 -4
  117. package/esm5/table/tokens.js +16 -0
  118. package/esm5/testing/protractor/protractor-element.js +4 -2
  119. package/esm5/testing/protractor/protractor-harness-environment.js +17 -11
  120. package/esm5/testing/testbed/testbed-harness-environment.js +17 -11
  121. package/esm5/text-field/autosize.js +20 -4
  122. package/esm5/version.js +1 -1
  123. package/fesm2015/a11y.js +89 -11
  124. package/fesm2015/a11y.js.map +1 -1
  125. package/fesm2015/cdk.js +1 -1
  126. package/fesm2015/cdk.js.map +1 -1
  127. package/fesm2015/clipboard.js +2 -2
  128. package/fesm2015/clipboard.js.map +1 -1
  129. package/fesm2015/coercion.js +0 -1
  130. package/fesm2015/coercion.js.map +1 -1
  131. package/fesm2015/drag-drop.js +16 -22
  132. package/fesm2015/drag-drop.js.map +1 -1
  133. package/fesm2015/overlay.js +2 -1
  134. package/fesm2015/overlay.js.map +1 -1
  135. package/fesm2015/platform.js +16 -1
  136. package/fesm2015/platform.js.map +1 -1
  137. package/fesm2015/scrolling.js +76 -7
  138. package/fesm2015/scrolling.js.map +1 -1
  139. package/fesm2015/table.js +98 -49
  140. package/fesm2015/table.js.map +1 -1
  141. package/fesm2015/testing/protractor.js +16 -9
  142. package/fesm2015/testing/protractor.js.map +1 -1
  143. package/fesm2015/testing/testbed.js +15 -9
  144. package/fesm2015/testing/testbed.js.map +1 -1
  145. package/fesm2015/text-field.js +37 -3
  146. package/fesm2015/text-field.js.map +1 -1
  147. package/fesm5/a11y.js +36 -12
  148. package/fesm5/a11y.js.map +1 -1
  149. package/fesm5/cdk.js +1 -1
  150. package/fesm5/cdk.js.map +1 -1
  151. package/fesm5/clipboard.js +1 -1
  152. package/fesm5/clipboard.js.map +1 -1
  153. package/fesm5/coercion.js +0 -1
  154. package/fesm5/coercion.js.map +1 -1
  155. package/fesm5/drag-drop.js +14 -17
  156. package/fesm5/drag-drop.js.map +1 -1
  157. package/fesm5/overlay.js +2 -1
  158. package/fesm5/overlay.js.map +1 -1
  159. package/fesm5/platform.js +11 -1
  160. package/fesm5/platform.js.map +1 -1
  161. package/fesm5/scrolling.js +39 -7
  162. package/fesm5/scrolling.js.map +1 -1
  163. package/fesm5/table.js +59 -29
  164. package/fesm5/table.js.map +1 -1
  165. package/fesm5/testing/protractor.js +20 -12
  166. package/fesm5/testing/protractor.js.map +1 -1
  167. package/fesm5/testing/testbed.js +16 -10
  168. package/fesm5/testing/testbed.js.map +1 -1
  169. package/fesm5/text-field.js +19 -3
  170. package/fesm5/text-field.js.map +1 -1
  171. package/package.json +1 -1
  172. package/platform/features/shadow-dom.d.ts +2 -0
  173. package/platform/index.metadata.json +1 -1
  174. package/schematics/ng-add/index.js +1 -1
  175. package/schematics/ng-update/upgrade-rules/class-names-rule.js +3 -1
  176. package/schematics/utils/ast/ng-module-imports.js +3 -2
  177. package/scrolling/index.metadata.json +1 -1
  178. package/scrolling/scroll-dispatcher.d.ts +9 -1
  179. package/scrolling/viewport-ruler.d.ts +9 -1
  180. package/table/cell.d.ts +2 -0
  181. package/table/index.metadata.json +1 -1
  182. package/table/public-api.d.ts +1 -0
  183. package/table/row.d.ts +6 -3
  184. package/table/table.d.ts +2 -0
  185. package/table/text-column.d.ts +2 -13
  186. package/table/tokens.d.ts +25 -0
  187. package/testing/protractor/protractor-harness-environment.d.ts +10 -3
  188. package/testing/testbed/testbed-harness-environment.d.ts +12 -4
  189. package/text-field/autosize.d.ts +9 -1
  190. package/text-field/index.metadata.json +1 -1
package/fesm2015/a11y.js CHANGED
@@ -2675,6 +2675,34 @@ if (false) {
2675
2675
  */
2676
2676
  FocusOptions.prototype.preventScroll;
2677
2677
  }
2678
+ /** @enum {number} */
2679
+ const FocusMonitorDetectionMode = {
2680
+ /**
2681
+ * Any mousedown, keydown, or touchstart event that happened in the previous
2682
+ * tick or the current tick will be used to assign a focus event's origin (to
2683
+ * either mouse, keyboard, or touch). This is the default option.
2684
+ */
2685
+ IMMEDIATE: 0,
2686
+ /**
2687
+ * A focus event's origin is always attributed to the last corresponding
2688
+ * mousedown, keydown, or touchstart event, no matter how long ago it occured.
2689
+ */
2690
+ EVENTUAL: 1,
2691
+ };
2692
+ /**
2693
+ * Injectable service-level options for FocusMonitor.
2694
+ * @record
2695
+ */
2696
+ function FocusMonitorOptions() { }
2697
+ if (false) {
2698
+ /** @type {?|undefined} */
2699
+ FocusMonitorOptions.prototype.detectionMode;
2700
+ }
2701
+ /**
2702
+ * InjectionToken for FocusMonitorOptions.
2703
+ * @type {?}
2704
+ */
2705
+ const FOCUS_MONITOR_DEFAULT_OPTIONS = new InjectionToken('cdk-focus-monitor-default-options');
2678
2706
  /**
2679
2707
  * Event listener options that enable capturing and also
2680
2708
  * mark the listener as passive if the browser supports it.
@@ -2691,8 +2719,12 @@ class FocusMonitor {
2691
2719
  /**
2692
2720
  * @param {?} _ngZone
2693
2721
  * @param {?} _platform
2722
+ * @param {?} document
2723
+ * @param {?} options
2694
2724
  */
2695
- constructor(_ngZone, _platform) {
2725
+ constructor(_ngZone, _platform,
2726
+ /** @breaking-change 11.0.0 make document required */
2727
+ document, options) {
2696
2728
  this._ngZone = _ngZone;
2697
2729
  this._platform = _platform;
2698
2730
  /**
@@ -2777,6 +2809,8 @@ class FocusMonitor {
2777
2809
  */
2778
2810
  () => this._windowFocused = false));
2779
2811
  });
2812
+ this._document = document;
2813
+ this._detectionMode = (options === null || options === void 0 ? void 0 : options.detectionMode) || 0 /* IMMEDIATE */;
2780
2814
  }
2781
2815
  /**
2782
2816
  * @param {?} element
@@ -2883,6 +2917,24 @@ class FocusMonitor {
2883
2917
  */
2884
2918
  (_info, element) => this.stopMonitoring(element)));
2885
2919
  }
2920
+ /**
2921
+ * Access injected document if available or fallback to global document reference
2922
+ * @private
2923
+ * @return {?}
2924
+ */
2925
+ _getDocument() {
2926
+ return this._document || document;
2927
+ }
2928
+ /**
2929
+ * Use defaultView of injected document if available or fallback to global window reference
2930
+ * @private
2931
+ * @return {?}
2932
+ */
2933
+ _getWindow() {
2934
+ /** @type {?} */
2935
+ const doc = this._getDocument();
2936
+ return doc.defaultView || window;
2937
+ }
2886
2938
  /**
2887
2939
  * @private
2888
2940
  * @param {?} element
@@ -2918,6 +2970,7 @@ class FocusMonitor {
2918
2970
  }
2919
2971
  /**
2920
2972
  * Sets the origin and schedules an async function to clear it at the end of the event queue.
2973
+ * If the detection mode is 'eventual', the origin is never cleared.
2921
2974
  * @private
2922
2975
  * @param {?} origin The origin to set.
2923
2976
  * @return {?}
@@ -2928,13 +2981,15 @@ class FocusMonitor {
2928
2981
  */
2929
2982
  () => {
2930
2983
  this._origin = origin;
2931
- // Sometimes the focus origin won't be valid in Firefox because Firefox seems to focus *one*
2932
- // tick after the interaction event fired. To ensure the focus origin is always correct,
2933
- // the focus origin will be determined at the beginning of the next tick.
2934
- this._originTimeoutId = setTimeout((/**
2935
- * @return {?}
2936
- */
2937
- () => this._origin = null), 1);
2984
+ if (this._detectionMode === 0 /* IMMEDIATE */) {
2985
+ // Sometimes the focus origin won't be valid in Firefox because Firefox seems to focus *one*
2986
+ // tick after the interaction event fired. To ensure the focus origin is always correct,
2987
+ // the focus origin will be determined at the beginning of the next tick.
2988
+ this._originTimeoutId = setTimeout((/**
2989
+ * @return {?}
2990
+ */
2991
+ () => this._origin = null), 1);
2992
+ }
2938
2993
  }));
2939
2994
  }
2940
2995
  /**
@@ -3055,6 +3110,10 @@ class FocusMonitor {
3055
3110
  * @return {?}
3056
3111
  */
3057
3112
  () => {
3113
+ /** @type {?} */
3114
+ const document = this._getDocument();
3115
+ /** @type {?} */
3116
+ const window = this._getWindow();
3058
3117
  document.addEventListener('keydown', this._documentKeydownListener, captureEventListenerOptions);
3059
3118
  document.addEventListener('mousedown', this._documentMousedownListener, captureEventListenerOptions);
3060
3119
  document.addEventListener('touchstart', this._documentTouchstartListener, captureEventListenerOptions);
@@ -3069,6 +3128,10 @@ class FocusMonitor {
3069
3128
  _decrementMonitoredElementCount() {
3070
3129
  // Unregister global listeners when last element is unmonitored.
3071
3130
  if (!--this._monitoredElementCount) {
3131
+ /** @type {?} */
3132
+ const document = this._getDocument();
3133
+ /** @type {?} */
3134
+ const window = this._getWindow();
3072
3135
  document.removeEventListener('keydown', this._documentKeydownListener, captureEventListenerOptions);
3073
3136
  document.removeEventListener('mousedown', this._documentMousedownListener, captureEventListenerOptions);
3074
3137
  document.removeEventListener('touchstart', this._documentTouchstartListener, captureEventListenerOptions);
@@ -3086,9 +3149,11 @@ FocusMonitor.decorators = [
3086
3149
  /** @nocollapse */
3087
3150
  FocusMonitor.ctorParameters = () => [
3088
3151
  { type: NgZone },
3089
- { type: Platform }
3152
+ { type: Platform },
3153
+ { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [DOCUMENT,] }] },
3154
+ { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [FOCUS_MONITOR_DEFAULT_OPTIONS,] }] }
3090
3155
  ];
3091
- /** @nocollapse */ FocusMonitor.ɵprov = ɵɵdefineInjectable({ factory: function FocusMonitor_Factory() { return new FocusMonitor(ɵɵinject(NgZone), ɵɵinject(Platform)); }, token: FocusMonitor, providedIn: "root" });
3156
+ /** @nocollapse */ FocusMonitor.ɵprov = ɵɵdefineInjectable({ factory: function FocusMonitor_Factory() { return new FocusMonitor(ɵɵinject(NgZone), ɵɵinject(Platform), ɵɵinject(DOCUMENT, 8), ɵɵinject(FOCUS_MONITOR_DEFAULT_OPTIONS, 8)); }, token: FocusMonitor, providedIn: "root" });
3092
3157
  if (false) {
3093
3158
  /**
3094
3159
  * The focus origin that the next focus event is a result of.
@@ -3144,6 +3209,13 @@ if (false) {
3144
3209
  * @private
3145
3210
  */
3146
3211
  FocusMonitor.prototype._monitoredElementCount;
3212
+ /**
3213
+ * The specified detection mode, used for attributing the origin of a focus
3214
+ * event.
3215
+ * @type {?}
3216
+ * @private
3217
+ */
3218
+ FocusMonitor.prototype._detectionMode;
3147
3219
  /**
3148
3220
  * Event listener for `keydown` events on the document.
3149
3221
  * Needs to be an arrow function in order to preserve the context when it gets bound.
@@ -3172,6 +3244,12 @@ if (false) {
3172
3244
  * @private
3173
3245
  */
3174
3246
  FocusMonitor.prototype._windowFocusListener;
3247
+ /**
3248
+ * Used to reference correct document/window
3249
+ * @type {?}
3250
+ * @protected
3251
+ */
3252
+ FocusMonitor.prototype._document;
3175
3253
  /**
3176
3254
  * @type {?}
3177
3255
  * @private
@@ -3432,5 +3510,5 @@ A11yModule.ctorParameters = () => [
3432
3510
  * Generated bundle index. Do not edit.
3433
3511
  */
3434
3512
 
3435
- export { A11yModule, ActiveDescendantKeyManager, AriaDescriber, CDK_DESCRIBEDBY_HOST_ATTRIBUTE, CDK_DESCRIBEDBY_ID_PREFIX, CdkAriaLive, CdkMonitorFocus, CdkTrapFocus, ConfigurableFocusTrap, ConfigurableFocusTrapFactory, EventListenerFocusTrapInertStrategy, FOCUS_TRAP_INERT_STRATEGY, FocusKeyManager, FocusMonitor, FocusTrap, FocusTrapFactory, HighContrastModeDetector, InteractivityChecker, LIVE_ANNOUNCER_DEFAULT_OPTIONS, LIVE_ANNOUNCER_ELEMENT_TOKEN, LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY, ListKeyManager, LiveAnnouncer, MESSAGES_CONTAINER_ID, TOUCH_BUFFER_MS, isFakeMousedownFromScreenReader, FocusTrapManager as ɵangular_material_src_cdk_a11y_a11y_a, ConfigurableFocusTrapConfig as ɵangular_material_src_cdk_a11y_a11y_b };
3513
+ export { A11yModule, ActiveDescendantKeyManager, AriaDescriber, CDK_DESCRIBEDBY_HOST_ATTRIBUTE, CDK_DESCRIBEDBY_ID_PREFIX, CdkAriaLive, CdkMonitorFocus, CdkTrapFocus, ConfigurableFocusTrap, ConfigurableFocusTrapFactory, EventListenerFocusTrapInertStrategy, FOCUS_MONITOR_DEFAULT_OPTIONS, FOCUS_TRAP_INERT_STRATEGY, FocusKeyManager, FocusMonitor, FocusTrap, FocusTrapFactory, HighContrastModeDetector, InteractivityChecker, LIVE_ANNOUNCER_DEFAULT_OPTIONS, LIVE_ANNOUNCER_ELEMENT_TOKEN, LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY, ListKeyManager, LiveAnnouncer, MESSAGES_CONTAINER_ID, TOUCH_BUFFER_MS, isFakeMousedownFromScreenReader, FocusTrapManager as ɵangular_material_src_cdk_a11y_a11y_a, ConfigurableFocusTrapConfig as ɵangular_material_src_cdk_a11y_a11y_b };
3436
3514
  //# sourceMappingURL=a11y.js.map