@angular/cdk 7.0.3 → 7.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.
- package/a11y/typings/focus-monitor/focus-monitor.d.ts +20 -4
- package/a11y/typings/index.metadata.json +1 -1
- package/a11y/typings/key-manager/list-key-manager.d.ts +8 -0
- package/a11y/typings/live-announcer/live-announcer.d.ts +37 -4
- package/bidi/typings/dir.d.ts +4 -1
- package/bidi/typings/index.metadata.json +1 -1
- package/bundles/cdk-a11y.umd.js +503 -210
- 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-accordion.umd.js +16 -9
- package/bundles/cdk-accordion.umd.js.map +1 -1
- package/bundles/cdk-accordion.umd.min.js.map +1 -1
- package/bundles/cdk-bidi.umd.js +16 -7
- package/bundles/cdk-bidi.umd.js.map +1 -1
- package/bundles/cdk-bidi.umd.min.js +1 -1
- package/bundles/cdk-bidi.umd.min.js.map +1 -1
- package/bundles/cdk-coercion.umd.js +5 -5
- package/bundles/cdk-coercion.umd.js.map +1 -1
- package/bundles/cdk-collections.umd.js +28 -5
- package/bundles/cdk-collections.umd.js.map +1 -1
- package/bundles/cdk-collections.umd.min.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.js +2251 -853
- package/bundles/cdk-drag-drop.umd.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.min.js +2 -1
- package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
- package/bundles/cdk-keycodes.umd.js +33 -1
- package/bundles/cdk-keycodes.umd.js.map +1 -1
- package/bundles/cdk-keycodes.umd.min.js +1 -1
- package/bundles/cdk-keycodes.umd.min.js.map +1 -1
- package/bundles/cdk-layout.umd.js +29 -22
- package/bundles/cdk-layout.umd.js.map +1 -1
- package/bundles/cdk-layout.umd.min.js +1 -1
- package/bundles/cdk-layout.umd.min.js.map +1 -1
- package/bundles/cdk-observers.umd.js +25 -6
- package/bundles/cdk-observers.umd.js.map +1 -1
- package/bundles/cdk-observers.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +600 -243
- 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-platform.umd.js +50 -28
- package/bundles/cdk-platform.umd.js.map +1 -1
- package/bundles/cdk-platform.umd.min.js.map +1 -1
- package/bundles/cdk-portal.umd.js +14 -7
- package/bundles/cdk-portal.umd.js.map +1 -1
- package/bundles/cdk-portal.umd.min.js.map +1 -1
- package/bundles/cdk-scrolling.umd.js +143 -48
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.min.js +1 -1
- package/bundles/cdk-scrolling.umd.min.js.map +1 -1
- package/bundles/cdk-stepper.umd.js +103 -19
- package/bundles/cdk-stepper.umd.js.map +1 -1
- package/bundles/cdk-stepper.umd.min.js +1 -1
- package/bundles/cdk-stepper.umd.min.js.map +1 -1
- package/bundles/cdk-table.umd.js +182 -48
- package/bundles/cdk-table.umd.js.map +1 -1
- package/bundles/cdk-table.umd.min.js.map +1 -1
- package/bundles/cdk-text-field.umd.js +70 -32
- package/bundles/cdk-text-field.umd.js.map +1 -1
- package/bundles/cdk-text-field.umd.min.js +1 -1
- package/bundles/cdk-text-field.umd.min.js.map +1 -1
- package/bundles/cdk-tree.umd.js +71 -34
- package/bundles/cdk-tree.umd.js.map +1 -1
- package/bundles/cdk-tree.umd.min.js +1 -1
- package/bundles/cdk-tree.umd.min.js.map +1 -1
- package/bundles/cdk.umd.js +5 -4
- 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/typings/{drag-handle.d.ts → directives/drag-handle.d.ts} +3 -0
- package/drag-drop/typings/{drag-placeholder.d.ts → directives/drag-placeholder.d.ts} +0 -0
- package/drag-drop/typings/{drag-preview.d.ts → directives/drag-preview.d.ts} +0 -0
- package/drag-drop/typings/directives/drag.d.ts +108 -0
- package/drag-drop/typings/directives/drop-list-group.d.ts +22 -0
- package/drag-drop/typings/directives/drop-list.d.ts +135 -0
- package/drag-drop/typings/drag-drop-registry.d.ts +8 -5
- package/drag-drop/typings/drag-events.d.ts +24 -6
- package/{typings/esm5/drag-drop/drag.d.ts → drag-drop/typings/drag-ref.d.ts} +153 -77
- package/drag-drop/typings/drop-list-container.d.ts +21 -3
- package/drag-drop/typings/{drop-list.d.ts → drop-list-ref.d.ts} +133 -77
- package/drag-drop/typings/index.d.ts +1 -0
- package/drag-drop/typings/index.metadata.json +1 -1
- package/drag-drop/typings/public-api.d.ts +13 -5
- package/esm2015/a11y.js +353 -189
- package/esm2015/a11y.js.map +1 -1
- package/esm2015/accordion.js +16 -11
- package/esm2015/accordion.js.map +1 -1
- package/esm2015/bidi.js +18 -9
- package/esm2015/bidi.js.map +1 -1
- package/esm2015/cdk.js +7 -6
- package/esm2015/cdk.js.map +1 -1
- package/esm2015/coercion.js +7 -7
- package/esm2015/coercion.js.map +1 -1
- package/esm2015/collections.js +22 -7
- package/esm2015/collections.js.map +1 -1
- package/esm2015/drag-drop.js +1768 -751
- package/esm2015/drag-drop.js.map +1 -1
- package/esm2015/keycodes.js +31 -4
- package/esm2015/keycodes.js.map +1 -1
- package/esm2015/layout.js +29 -19
- package/esm2015/layout.js.map +1 -1
- package/esm2015/observers.js +13 -8
- package/esm2015/observers.js.map +1 -1
- package/esm2015/overlay.js +384 -219
- package/esm2015/overlay.js.map +1 -1
- package/esm2015/platform.js +53 -31
- package/esm2015/platform.js.map +1 -1
- package/esm2015/portal.js +13 -9
- package/esm2015/portal.js.map +1 -1
- package/esm2015/scrolling.js +106 -49
- package/esm2015/scrolling.js.map +1 -1
- package/esm2015/stepper.js +93 -24
- package/esm2015/stepper.js.map +1 -1
- package/esm2015/table.js +89 -45
- package/esm2015/table.js.map +1 -1
- package/esm2015/text-field.js +51 -34
- package/esm2015/text-field.js.map +1 -1
- package/esm2015/tree.js +55 -36
- package/esm2015/tree.js.map +1 -1
- package/esm5/a11y.es5.js +507 -214
- package/esm5/a11y.es5.js.map +1 -1
- package/esm5/accordion.es5.js +18 -11
- package/esm5/accordion.es5.js.map +1 -1
- package/esm5/bidi.es5.js +18 -9
- package/esm5/bidi.es5.js.map +1 -1
- package/esm5/cdk.es5.js +7 -6
- package/esm5/cdk.es5.js.map +1 -1
- package/esm5/coercion.es5.js +7 -7
- package/esm5/coercion.es5.js.map +1 -1
- package/esm5/collections.es5.js +35 -7
- package/esm5/collections.es5.js.map +1 -1
- package/esm5/drag-drop.es5.js +2125 -729
- package/esm5/drag-drop.es5.js.map +1 -1
- package/esm5/keycodes.es5.js +35 -4
- package/esm5/keycodes.es5.js.map +1 -1
- package/esm5/layout.es5.js +31 -24
- package/esm5/layout.es5.js.map +1 -1
- package/esm5/observers.es5.js +27 -8
- package/esm5/observers.es5.js.map +1 -1
- package/esm5/overlay.es5.js +602 -245
- package/esm5/overlay.es5.js.map +1 -1
- package/esm5/platform.es5.js +52 -30
- package/esm5/platform.es5.js.map +1 -1
- package/esm5/portal.es5.js +16 -9
- package/esm5/portal.es5.js.map +1 -1
- package/esm5/scrolling.es5.js +145 -50
- package/esm5/scrolling.es5.js.map +1 -1
- package/esm5/stepper.es5.js +106 -24
- package/esm5/stepper.es5.js.map +1 -1
- package/esm5/table.es5.js +184 -50
- package/esm5/table.es5.js.map +1 -1
- package/esm5/text-field.es5.js +72 -34
- package/esm5/text-field.es5.js.map +1 -1
- package/esm5/tree.es5.js +74 -37
- package/esm5/tree.es5.js.map +1 -1
- package/keycodes/typings/index.metadata.json +1 -1
- package/keycodes/typings/modifiers.d.ts +14 -0
- package/keycodes/typings/public-api.d.ts +1 -0
- package/overlay/typings/index.metadata.json +1 -1
- package/package.json +4 -4
- package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts +2 -2
- package/schematics/ng-update/upgrade-data.js +2 -1
- package/schematics/ng-update/upgrade-data.js.map +1 -1
- package/schematics/ng-update/upgrade-rules/index.js +3 -2
- package/schematics/ng-update/upgrade-rules/index.js.map +1 -1
- package/schematics/utils/ast/ng-module-imports.d.ts +1 -1
- package/schematics/utils/ast/ng-module-imports.js +25 -13
- package/schematics/utils/ast/ng-module-imports.js.map +1 -1
- package/schematics/utils/get-project.js +2 -1
- package/schematics/utils/get-project.js.map +1 -1
- package/schematics/utils/parse5-element.js +3 -2
- package/schematics/utils/parse5-element.js.map +1 -1
- package/schematics/utils/project-targets.js +2 -1
- package/schematics/utils/project-targets.js.map +1 -1
- package/schematics/utils/version-agnostic-typescript.js +3 -2
- package/schematics/utils/version-agnostic-typescript.js.map +1 -1
- package/scrolling/typings/index.metadata.json +1 -1
- package/stepper/typings/index.metadata.json +1 -1
- package/stepper/typings/public-api.d.ts +1 -0
- package/stepper/typings/step-header.d.ts +15 -0
- package/stepper/typings/stepper.d.ts +11 -1
- package/text-field/typings/autosize.d.ts +6 -0
- package/text-field/typings/index.metadata.json +1 -1
- package/tree/typings/nested-node.d.ts +5 -5
- package/typings/a11y/focus-monitor/focus-monitor.d.ts +20 -4
- package/typings/a11y/index.metadata.json +1 -1
- package/typings/a11y/key-manager/list-key-manager.d.ts +8 -0
- package/typings/a11y/live-announcer/live-announcer.d.ts +37 -4
- package/typings/bidi/dir.d.ts +4 -1
- package/typings/bidi/index.metadata.json +1 -1
- package/typings/{esm5/drag-drop → drag-drop/directives}/drag-handle.d.ts +3 -0
- package/typings/drag-drop/{drag-placeholder.d.ts → directives/drag-placeholder.d.ts} +0 -0
- package/typings/drag-drop/{drag-preview.d.ts → directives/drag-preview.d.ts} +0 -0
- package/typings/drag-drop/directives/drag.d.ts +108 -0
- package/typings/drag-drop/directives/drop-list-group.d.ts +22 -0
- package/typings/drag-drop/directives/drop-list.d.ts +135 -0
- package/typings/drag-drop/drag-drop-registry.d.ts +8 -5
- package/typings/drag-drop/drag-events.d.ts +24 -6
- package/typings/drag-drop/{drag.d.ts → drag-ref.d.ts} +153 -77
- package/typings/drag-drop/drop-list-container.d.ts +21 -3
- package/typings/{esm5/drag-drop/drop-list.d.ts → drag-drop/drop-list-ref.d.ts} +133 -77
- package/typings/drag-drop/index.d.ts +1 -0
- package/typings/drag-drop/index.metadata.json +1 -1
- package/typings/drag-drop/public-api.d.ts +13 -5
- package/typings/esm5/a11y/focus-monitor/focus-monitor.d.ts +20 -4
- package/typings/esm5/a11y/index.metadata.json +1 -1
- package/typings/esm5/a11y/key-manager/list-key-manager.d.ts +8 -0
- package/typings/esm5/a11y/live-announcer/live-announcer.d.ts +37 -4
- package/typings/esm5/bidi/dir.d.ts +4 -1
- package/typings/esm5/bidi/index.metadata.json +1 -1
- package/typings/{drag-drop → esm5/drag-drop/directives}/drag-handle.d.ts +3 -0
- package/typings/esm5/drag-drop/{drag-placeholder.d.ts → directives/drag-placeholder.d.ts} +0 -0
- package/typings/esm5/drag-drop/{drag-preview.d.ts → directives/drag-preview.d.ts} +0 -0
- package/typings/esm5/drag-drop/directives/drag.d.ts +108 -0
- package/typings/esm5/drag-drop/directives/drop-list-group.d.ts +22 -0
- package/typings/esm5/drag-drop/directives/drop-list.d.ts +135 -0
- package/typings/esm5/drag-drop/drag-drop-registry.d.ts +8 -5
- package/typings/esm5/drag-drop/drag-events.d.ts +24 -6
- package/{drag-drop/typings/drag.d.ts → typings/esm5/drag-drop/drag-ref.d.ts} +153 -77
- package/typings/esm5/drag-drop/drop-list-container.d.ts +21 -3
- package/typings/{drag-drop/drop-list.d.ts → esm5/drag-drop/drop-list-ref.d.ts} +133 -77
- package/typings/esm5/drag-drop/index.d.ts +1 -0
- package/typings/esm5/drag-drop/index.metadata.json +1 -1
- package/typings/esm5/drag-drop/public-api.d.ts +13 -5
- package/typings/esm5/index.metadata.json +1 -1
- package/typings/esm5/keycodes/index.metadata.json +1 -1
- package/typings/esm5/keycodes/modifiers.d.ts +14 -0
- package/typings/esm5/keycodes/public-api.d.ts +1 -0
- package/typings/esm5/overlay/index.metadata.json +1 -1
- package/typings/esm5/scrolling/index.metadata.json +1 -1
- package/typings/esm5/stepper/index.metadata.json +1 -1
- package/typings/esm5/stepper/public-api.d.ts +1 -0
- package/typings/esm5/stepper/step-header.d.ts +15 -0
- package/typings/esm5/stepper/stepper.d.ts +11 -1
- package/typings/esm5/text-field/autosize.d.ts +6 -0
- package/typings/esm5/text-field/index.metadata.json +1 -1
- package/typings/esm5/tree/nested-node.d.ts +5 -5
- package/typings/index.metadata.json +1 -1
- package/typings/keycodes/index.metadata.json +1 -1
- package/typings/keycodes/modifiers.d.ts +14 -0
- package/typings/keycodes/public-api.d.ts +1 -0
- package/typings/overlay/index.metadata.json +1 -1
- package/typings/schematics/utils/ast/ng-module-imports.d.ts +1 -1
- package/typings/scrolling/index.metadata.json +1 -1
- package/typings/stepper/index.metadata.json +1 -1
- package/typings/stepper/public-api.d.ts +1 -0
- package/typings/stepper/step-header.d.ts +15 -0
- package/typings/stepper/stepper.d.ts +11 -1
- package/typings/text-field/autosize.d.ts +6 -0
- package/typings/text-field/index.metadata.json +1 -1
- package/typings/tree/nested-node.d.ts +5 -5
|
@@ -42,16 +42,17 @@ function __extends(d, b) {
|
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* @fileoverview added by tsickle
|
|
45
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
45
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
46
46
|
*/
|
|
47
|
-
/**
|
|
47
|
+
/**
|
|
48
48
|
* The injection token used to specify the virtual scrolling strategy.
|
|
49
|
-
|
|
49
|
+
* @type {?}
|
|
50
|
+
*/
|
|
50
51
|
var VIRTUAL_SCROLL_STRATEGY = new core.InjectionToken('VIRTUAL_SCROLL_STRATEGY');
|
|
51
52
|
|
|
52
53
|
/**
|
|
53
54
|
* @fileoverview added by tsickle
|
|
54
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
55
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
55
56
|
*/
|
|
56
57
|
/**
|
|
57
58
|
* Virtual scrolling strategy for lists with items of known fixed size.
|
|
@@ -175,9 +176,7 @@ FixedSizeVirtualScrollStrategy = /** @class */ (function () {
|
|
|
175
176
|
* \@docs-private Implemented as part of VirtualScrollStrategy.
|
|
176
177
|
* @return {?}
|
|
177
178
|
*/
|
|
178
|
-
function () {
|
|
179
|
-
/* no-op */
|
|
180
|
-
};
|
|
179
|
+
function () { };
|
|
181
180
|
/** @docs-private Implemented as part of VirtualScrollStrategy. */
|
|
182
181
|
/**
|
|
183
182
|
* \@docs-private Implemented as part of VirtualScrollStrategy.
|
|
@@ -187,9 +186,7 @@ FixedSizeVirtualScrollStrategy = /** @class */ (function () {
|
|
|
187
186
|
* \@docs-private Implemented as part of VirtualScrollStrategy.
|
|
188
187
|
* @return {?}
|
|
189
188
|
*/
|
|
190
|
-
function () {
|
|
191
|
-
/* no-op */
|
|
192
|
-
};
|
|
189
|
+
function () { };
|
|
193
190
|
/**
|
|
194
191
|
* Scroll to the offset for the given index.
|
|
195
192
|
* @param index The index of the element to scroll to.
|
|
@@ -212,12 +209,15 @@ FixedSizeVirtualScrollStrategy = /** @class */ (function () {
|
|
|
212
209
|
this._viewport.scrollToOffset(index * this._itemSize, behavior);
|
|
213
210
|
}
|
|
214
211
|
};
|
|
212
|
+
/** Update the viewport's total content size. */
|
|
215
213
|
/**
|
|
216
214
|
* Update the viewport's total content size.
|
|
215
|
+
* @private
|
|
217
216
|
* @return {?}
|
|
218
217
|
*/
|
|
219
218
|
FixedSizeVirtualScrollStrategy.prototype._updateTotalContentSize = /**
|
|
220
219
|
* Update the viewport's total content size.
|
|
220
|
+
* @private
|
|
221
221
|
* @return {?}
|
|
222
222
|
*/
|
|
223
223
|
function () {
|
|
@@ -226,12 +226,15 @@ FixedSizeVirtualScrollStrategy = /** @class */ (function () {
|
|
|
226
226
|
}
|
|
227
227
|
this._viewport.setTotalContentSize(this._viewport.getDataLength() * this._itemSize);
|
|
228
228
|
};
|
|
229
|
+
/** Update the viewport's rendered range. */
|
|
229
230
|
/**
|
|
230
231
|
* Update the viewport's rendered range.
|
|
232
|
+
* @private
|
|
231
233
|
* @return {?}
|
|
232
234
|
*/
|
|
233
235
|
FixedSizeVirtualScrollStrategy.prototype._updateRenderedRange = /**
|
|
234
236
|
* Update the viewport's rendered range.
|
|
237
|
+
* @private
|
|
235
238
|
* @return {?}
|
|
236
239
|
*/
|
|
237
240
|
function () {
|
|
@@ -379,11 +382,12 @@ var CdkFixedSizeVirtualScroll = /** @class */ (function () {
|
|
|
379
382
|
|
|
380
383
|
/**
|
|
381
384
|
* @fileoverview added by tsickle
|
|
382
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
385
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
383
386
|
*/
|
|
384
|
-
/**
|
|
387
|
+
/**
|
|
385
388
|
* Time in ms to throttle the scrolling events by default.
|
|
386
|
-
|
|
389
|
+
* @type {?}
|
|
390
|
+
*/
|
|
387
391
|
var DEFAULT_SCROLL_TIME = 20;
|
|
388
392
|
/**
|
|
389
393
|
* Service contained all registered Scrollable references and emits an event when any one of the
|
|
@@ -430,10 +434,10 @@ var ScrollDispatcher = /** @class */ (function () {
|
|
|
430
434
|
*/
|
|
431
435
|
function (scrollable) {
|
|
432
436
|
var _this = this;
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
+
if (!this.scrollContainers.has(scrollable)) {
|
|
438
|
+
this.scrollContainers.set(scrollable, scrollable.elementScrolled()
|
|
439
|
+
.subscribe(function () { return _this._scrolled.next(scrollable); }));
|
|
440
|
+
}
|
|
437
441
|
};
|
|
438
442
|
/**
|
|
439
443
|
* Deregisters a Scrollable reference and unsubscribes from its scroll event observable.
|
|
@@ -501,6 +505,8 @@ var ScrollDispatcher = /** @class */ (function () {
|
|
|
501
505
|
if (!_this._globalSubscription) {
|
|
502
506
|
_this._addGlobalListener();
|
|
503
507
|
}
|
|
508
|
+
// In the case of a 0ms delay, use an observable without auditTime
|
|
509
|
+
// since it does add a perceptible delay in processing overhead.
|
|
504
510
|
/** @type {?} */
|
|
505
511
|
var subscription = auditTimeInMs > 0 ?
|
|
506
512
|
_this._scrolled.pipe(operators.auditTime(auditTimeInMs)).subscribe(observer) :
|
|
@@ -576,14 +582,17 @@ var ScrollDispatcher = /** @class */ (function () {
|
|
|
576
582
|
});
|
|
577
583
|
return scrollingContainers;
|
|
578
584
|
};
|
|
585
|
+
/** Returns true if the element is contained within the provided Scrollable. */
|
|
579
586
|
/**
|
|
580
587
|
* Returns true if the element is contained within the provided Scrollable.
|
|
588
|
+
* @private
|
|
581
589
|
* @param {?} scrollable
|
|
582
590
|
* @param {?} elementRef
|
|
583
591
|
* @return {?}
|
|
584
592
|
*/
|
|
585
593
|
ScrollDispatcher.prototype._scrollableContainsElement = /**
|
|
586
594
|
* Returns true if the element is contained within the provided Scrollable.
|
|
595
|
+
* @private
|
|
587
596
|
* @param {?} scrollable
|
|
588
597
|
* @param {?} elementRef
|
|
589
598
|
* @return {?}
|
|
@@ -599,15 +608,18 @@ var ScrollDispatcher = /** @class */ (function () {
|
|
|
599
608
|
if (element == scrollableElement) {
|
|
600
609
|
return true;
|
|
601
610
|
}
|
|
602
|
-
} while (element = /** @type {?} */ (
|
|
611
|
+
} while (element = (/** @type {?} */ (element)).parentElement);
|
|
603
612
|
return false;
|
|
604
613
|
};
|
|
614
|
+
/** Sets up the global scroll listeners. */
|
|
605
615
|
/**
|
|
606
616
|
* Sets up the global scroll listeners.
|
|
617
|
+
* @private
|
|
607
618
|
* @return {?}
|
|
608
619
|
*/
|
|
609
620
|
ScrollDispatcher.prototype._addGlobalListener = /**
|
|
610
621
|
* Sets up the global scroll listeners.
|
|
622
|
+
* @private
|
|
611
623
|
* @return {?}
|
|
612
624
|
*/
|
|
613
625
|
function () {
|
|
@@ -616,12 +628,15 @@ var ScrollDispatcher = /** @class */ (function () {
|
|
|
616
628
|
return rxjs.fromEvent(window.document, 'scroll').subscribe(function () { return _this._scrolled.next(); });
|
|
617
629
|
});
|
|
618
630
|
};
|
|
631
|
+
/** Cleans up the global scroll listener. */
|
|
619
632
|
/**
|
|
620
633
|
* Cleans up the global scroll listener.
|
|
634
|
+
* @private
|
|
621
635
|
* @return {?}
|
|
622
636
|
*/
|
|
623
637
|
ScrollDispatcher.prototype._removeGlobalListener = /**
|
|
624
638
|
* Cleans up the global scroll listener.
|
|
639
|
+
* @private
|
|
625
640
|
* @return {?}
|
|
626
641
|
*/
|
|
627
642
|
function () {
|
|
@@ -651,9 +666,10 @@ var ScrollDispatcher = /** @class */ (function () {
|
|
|
651
666
|
function SCROLL_DISPATCHER_PROVIDER_FACTORY(parentDispatcher, ngZone, platform$$1) {
|
|
652
667
|
return parentDispatcher || new ScrollDispatcher(ngZone, platform$$1);
|
|
653
668
|
}
|
|
654
|
-
/**
|
|
669
|
+
/**
|
|
655
670
|
* \@docs-private \@deprecated \@breaking-change 8.0.0
|
|
656
|
-
|
|
671
|
+
* @type {?}
|
|
672
|
+
*/
|
|
657
673
|
var SCROLL_DISPATCHER_PROVIDER = {
|
|
658
674
|
// If there is already a ScrollDispatcher available, use that. Otherwise, provide a new one.
|
|
659
675
|
provide: ScrollDispatcher,
|
|
@@ -663,7 +679,7 @@ var SCROLL_DISPATCHER_PROVIDER = {
|
|
|
663
679
|
|
|
664
680
|
/**
|
|
665
681
|
* @fileoverview added by tsickle
|
|
666
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
682
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
667
683
|
*/
|
|
668
684
|
/**
|
|
669
685
|
* Sends an event when the directive's element is scrolled. Registers itself with the
|
|
@@ -787,10 +803,12 @@ var CdkScrollable = /** @class */ (function () {
|
|
|
787
803
|
this._applyScrollToOptions(options);
|
|
788
804
|
};
|
|
789
805
|
/**
|
|
806
|
+
* @private
|
|
790
807
|
* @param {?} options
|
|
791
808
|
* @return {?}
|
|
792
809
|
*/
|
|
793
810
|
CdkScrollable.prototype._applyScrollToOptions = /**
|
|
811
|
+
* @private
|
|
794
812
|
* @param {?} options
|
|
795
813
|
* @return {?}
|
|
796
814
|
*/
|
|
@@ -851,6 +869,7 @@ var CdkScrollable = /** @class */ (function () {
|
|
|
851
869
|
if (from == 'bottom') {
|
|
852
870
|
return el.scrollHeight - el.clientHeight - el.scrollTop;
|
|
853
871
|
}
|
|
872
|
+
// Rewrite start & end as left or right offsets.
|
|
854
873
|
/** @type {?} */
|
|
855
874
|
var isRtl = this.dir && this.dir.value == 'rtl';
|
|
856
875
|
if (from == 'start') {
|
|
@@ -907,7 +926,7 @@ var CdkScrollable = /** @class */ (function () {
|
|
|
907
926
|
|
|
908
927
|
/**
|
|
909
928
|
* @fileoverview added by tsickle
|
|
910
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
929
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
911
930
|
*/
|
|
912
931
|
/**
|
|
913
932
|
* Checks if the given ranges are equal.
|
|
@@ -940,6 +959,10 @@ var CdkVirtualScrollViewport = /** @class */ (function (_super) {
|
|
|
940
959
|
* The direction the viewport scrolls.
|
|
941
960
|
*/
|
|
942
961
|
_this.orientation = 'vertical';
|
|
962
|
+
// Note: we don't use the typical EventEmitter here because we need to subscribe to the scroll
|
|
963
|
+
// strategy lazily (i.e. only if the user is actually listening to the events). We do this because
|
|
964
|
+
// depending on how the strategy calculates the scrolled index, it may come at a cost to
|
|
965
|
+
// performance.
|
|
943
966
|
/**
|
|
944
967
|
* Emits when the index of the first element visible in the viewport changes.
|
|
945
968
|
*/
|
|
@@ -1014,7 +1037,7 @@ var CdkVirtualScrollViewport = /** @class */ (function (_super) {
|
|
|
1014
1037
|
_this.elementScrolled()
|
|
1015
1038
|
.pipe(
|
|
1016
1039
|
// Start off with a fake scroll event so we properly detect our initial position.
|
|
1017
|
-
operators.startWith(/** @type {?} */ (
|
|
1040
|
+
operators.startWith((/** @type {?} */ (null))),
|
|
1018
1041
|
// Collect multiple events into one until the next animation frame. This way if
|
|
1019
1042
|
// there are multiple scroll events in the same frame we only need to recheck
|
|
1020
1043
|
// our layout once.
|
|
@@ -1111,11 +1134,20 @@ var CdkVirtualScrollViewport = /** @class */ (function (_super) {
|
|
|
1111
1134
|
// setting it to something else, but its error prone and should probably be split into
|
|
1112
1135
|
// `pendingRange` and `renderedRange`, the latter reflecting whats actually in the DOM.
|
|
1113
1136
|
/** Get the current rendered range of items. */
|
|
1137
|
+
// TODO(mmalerba): This is technically out of sync with what's really rendered until a render
|
|
1138
|
+
// cycle happens. I'm being careful to only call it after the render cycle is complete and before
|
|
1139
|
+
// setting it to something else, but its error prone and should probably be split into
|
|
1140
|
+
// `pendingRange` and `renderedRange`, the latter reflecting whats actually in the DOM.
|
|
1114
1141
|
/**
|
|
1115
1142
|
* Get the current rendered range of items.
|
|
1116
1143
|
* @return {?}
|
|
1117
1144
|
*/
|
|
1118
|
-
CdkVirtualScrollViewport.prototype.getRenderedRange =
|
|
1145
|
+
CdkVirtualScrollViewport.prototype.getRenderedRange =
|
|
1146
|
+
// TODO(mmalerba): This is technically out of sync with what's really rendered until a render
|
|
1147
|
+
// cycle happens. I'm being careful to only call it after the render cycle is complete and before
|
|
1148
|
+
// setting it to something else, but its error prone and should probably be split into
|
|
1149
|
+
// `pendingRange` and `renderedRange`, the latter reflecting whats actually in the DOM.
|
|
1150
|
+
/**
|
|
1119
1151
|
* Get the current rendered range of items.
|
|
1120
1152
|
* @return {?}
|
|
1121
1153
|
*/
|
|
@@ -1200,6 +1232,8 @@ var CdkVirtualScrollViewport = /** @class */ (function (_super) {
|
|
|
1200
1232
|
function (offset, to) {
|
|
1201
1233
|
var _this = this;
|
|
1202
1234
|
if (to === void 0) { to = 'to-start'; }
|
|
1235
|
+
// For a horizontal viewport in a right-to-left language we need to translate along the x-axis
|
|
1236
|
+
// in the negative direction.
|
|
1203
1237
|
/** @type {?} */
|
|
1204
1238
|
var isRtl = this.dir && this.dir.value == 'rtl';
|
|
1205
1239
|
/** @type {?} */
|
|
@@ -1360,12 +1394,15 @@ var CdkVirtualScrollViewport = /** @class */ (function (_super) {
|
|
|
1360
1394
|
this._measureViewportSize();
|
|
1361
1395
|
this._scrollStrategy.onDataLengthChanged();
|
|
1362
1396
|
};
|
|
1397
|
+
/** Measure the viewport size. */
|
|
1363
1398
|
/**
|
|
1364
1399
|
* Measure the viewport size.
|
|
1400
|
+
* @private
|
|
1365
1401
|
* @return {?}
|
|
1366
1402
|
*/
|
|
1367
1403
|
CdkVirtualScrollViewport.prototype._measureViewportSize = /**
|
|
1368
1404
|
* Measure the viewport size.
|
|
1405
|
+
* @private
|
|
1369
1406
|
* @return {?}
|
|
1370
1407
|
*/
|
|
1371
1408
|
function () {
|
|
@@ -1374,13 +1411,16 @@ var CdkVirtualScrollViewport = /** @class */ (function (_super) {
|
|
|
1374
1411
|
this._viewportSize = this.orientation === 'horizontal' ?
|
|
1375
1412
|
viewportEl.clientWidth : viewportEl.clientHeight;
|
|
1376
1413
|
};
|
|
1414
|
+
/** Queue up change detection to run. */
|
|
1377
1415
|
/**
|
|
1378
1416
|
* Queue up change detection to run.
|
|
1417
|
+
* @private
|
|
1379
1418
|
* @param {?=} runAfter
|
|
1380
1419
|
* @return {?}
|
|
1381
1420
|
*/
|
|
1382
1421
|
CdkVirtualScrollViewport.prototype._markChangeDetectionNeeded = /**
|
|
1383
1422
|
* Queue up change detection to run.
|
|
1423
|
+
* @private
|
|
1384
1424
|
* @param {?=} runAfter
|
|
1385
1425
|
* @return {?}
|
|
1386
1426
|
*/
|
|
@@ -1398,12 +1438,15 @@ var CdkVirtualScrollViewport = /** @class */ (function (_super) {
|
|
|
1398
1438
|
}); });
|
|
1399
1439
|
}
|
|
1400
1440
|
};
|
|
1441
|
+
/** Run change detection. */
|
|
1401
1442
|
/**
|
|
1402
1443
|
* Run change detection.
|
|
1444
|
+
* @private
|
|
1403
1445
|
* @return {?}
|
|
1404
1446
|
*/
|
|
1405
1447
|
CdkVirtualScrollViewport.prototype._doChangeDetection = /**
|
|
1406
1448
|
* Run change detection.
|
|
1449
|
+
* @private
|
|
1407
1450
|
* @return {?}
|
|
1408
1451
|
*/
|
|
1409
1452
|
function () {
|
|
@@ -1433,10 +1476,14 @@ var CdkVirtualScrollViewport = /** @class */ (function (_super) {
|
|
|
1433
1476
|
host: {
|
|
1434
1477
|
'class': 'cdk-virtual-scroll-viewport',
|
|
1435
1478
|
'[class.cdk-virtual-scroll-orientation-horizontal]': 'orientation === "horizontal"',
|
|
1436
|
-
'[class.cdk-virtual-scroll-orientation-vertical]': 'orientation
|
|
1479
|
+
'[class.cdk-virtual-scroll-orientation-vertical]': 'orientation !== "horizontal"',
|
|
1437
1480
|
},
|
|
1438
1481
|
encapsulation: core.ViewEncapsulation.None,
|
|
1439
1482
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
1483
|
+
providers: [{
|
|
1484
|
+
provide: CdkScrollable,
|
|
1485
|
+
useExisting: CdkVirtualScrollViewport,
|
|
1486
|
+
}]
|
|
1440
1487
|
},] },
|
|
1441
1488
|
];
|
|
1442
1489
|
/** @nocollapse */
|
|
@@ -1458,7 +1505,7 @@ var CdkVirtualScrollViewport = /** @class */ (function (_super) {
|
|
|
1458
1505
|
|
|
1459
1506
|
/**
|
|
1460
1507
|
* @fileoverview added by tsickle
|
|
1461
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
1508
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1462
1509
|
*/
|
|
1463
1510
|
/**
|
|
1464
1511
|
* Helper to extract size from a DOM Node.
|
|
@@ -1468,7 +1515,7 @@ var CdkVirtualScrollViewport = /** @class */ (function (_super) {
|
|
|
1468
1515
|
*/
|
|
1469
1516
|
function getSize(orientation, node) {
|
|
1470
1517
|
/** @type {?} */
|
|
1471
|
-
var el = /** @type {?} */ (node);
|
|
1518
|
+
var el = (/** @type {?} */ (node));
|
|
1472
1519
|
if (!el.getBoundingClientRect) {
|
|
1473
1520
|
return 0;
|
|
1474
1521
|
}
|
|
@@ -1482,8 +1529,7 @@ function getSize(orientation, node) {
|
|
|
1482
1529
|
* @template T
|
|
1483
1530
|
*/
|
|
1484
1531
|
var CdkVirtualForOf = /** @class */ (function () {
|
|
1485
|
-
function CdkVirtualForOf(_viewContainerRef, _template, _differs,
|
|
1486
|
-
_viewport, ngZone) {
|
|
1532
|
+
function CdkVirtualForOf(_viewContainerRef, _template, _differs, _viewport, ngZone) {
|
|
1487
1533
|
var _this = this;
|
|
1488
1534
|
this._viewContainerRef = _viewContainerRef;
|
|
1489
1535
|
this._template = _template;
|
|
@@ -1508,7 +1554,7 @@ var CdkVirtualForOf = /** @class */ (function () {
|
|
|
1508
1554
|
this.dataStream = this._dataSourceChanges
|
|
1509
1555
|
.pipe(
|
|
1510
1556
|
// Start off with null `DataSource`.
|
|
1511
|
-
operators.startWith(/** @type {?} */ (
|
|
1557
|
+
operators.startWith((/** @type {?} */ (null))),
|
|
1512
1558
|
// Bundle up the previous and current data sources so we can work with both.
|
|
1513
1559
|
operators.pairwise(),
|
|
1514
1560
|
// Use `_changeDataSource` to disconnect from the previous data source and connect to the
|
|
@@ -1641,21 +1687,24 @@ var CdkVirtualForOf = /** @class */ (function () {
|
|
|
1641
1687
|
if (range.start < this._renderedRange.start || range.end > this._renderedRange.end) {
|
|
1642
1688
|
throw Error("Error: attempted to measure an item that isn't rendered.");
|
|
1643
1689
|
}
|
|
1690
|
+
// The index into the list of rendered views for the first item in the range.
|
|
1644
1691
|
/** @type {?} */
|
|
1645
1692
|
var renderedStartIndex = range.start - this._renderedRange.start;
|
|
1693
|
+
// The length of the range we're measuring.
|
|
1646
1694
|
/** @type {?} */
|
|
1647
1695
|
var rangeLen = range.end - range.start;
|
|
1696
|
+
// Loop over all root nodes for all items in the range and sum up their size.
|
|
1648
1697
|
/** @type {?} */
|
|
1649
1698
|
var totalSize = 0;
|
|
1650
1699
|
/** @type {?} */
|
|
1651
1700
|
var i = rangeLen;
|
|
1652
1701
|
while (i--) {
|
|
1653
1702
|
/** @type {?} */
|
|
1654
|
-
var view = /** @type {?} */ (this._viewContainerRef.get(i + renderedStartIndex));
|
|
1703
|
+
var view = (/** @type {?} */ (this._viewContainerRef.get(i + renderedStartIndex)));
|
|
1655
1704
|
/** @type {?} */
|
|
1656
1705
|
var j = view ? view.rootNodes.length : 0;
|
|
1657
1706
|
while (j--) {
|
|
1658
|
-
totalSize += getSize(orientation, /** @type {?} */ (
|
|
1707
|
+
totalSize += getSize(orientation, (/** @type {?} */ (view)).rootNodes[j]);
|
|
1659
1708
|
}
|
|
1660
1709
|
}
|
|
1661
1710
|
return totalSize;
|
|
@@ -1668,6 +1717,9 @@ var CdkVirtualForOf = /** @class */ (function () {
|
|
|
1668
1717
|
*/
|
|
1669
1718
|
function () {
|
|
1670
1719
|
if (this._differ && this._needsUpdate) {
|
|
1720
|
+
// TODO(mmalerba): We should differentiate needs update due to scrolling and a new portion of
|
|
1721
|
+
// this list being rendered (can use simpler algorithm) vs needs update due to data actually
|
|
1722
|
+
// changing (need to do this diff).
|
|
1671
1723
|
/** @type {?} */
|
|
1672
1724
|
var changes = this._differ.diff(this._renderedItems);
|
|
1673
1725
|
if (!changes) {
|
|
@@ -1696,12 +1748,15 @@ var CdkVirtualForOf = /** @class */ (function () {
|
|
|
1696
1748
|
view.destroy();
|
|
1697
1749
|
}
|
|
1698
1750
|
};
|
|
1751
|
+
/** React to scroll state changes in the viewport. */
|
|
1699
1752
|
/**
|
|
1700
1753
|
* React to scroll state changes in the viewport.
|
|
1754
|
+
* @private
|
|
1701
1755
|
* @return {?}
|
|
1702
1756
|
*/
|
|
1703
1757
|
CdkVirtualForOf.prototype._onRenderedDataChange = /**
|
|
1704
1758
|
* React to scroll state changes in the viewport.
|
|
1759
|
+
* @private
|
|
1705
1760
|
* @return {?}
|
|
1706
1761
|
*/
|
|
1707
1762
|
function () {
|
|
@@ -1714,14 +1769,17 @@ var CdkVirtualForOf = /** @class */ (function () {
|
|
|
1714
1769
|
}
|
|
1715
1770
|
this._needsUpdate = true;
|
|
1716
1771
|
};
|
|
1772
|
+
/** Swap out one `DataSource` for another. */
|
|
1717
1773
|
/**
|
|
1718
1774
|
* Swap out one `DataSource` for another.
|
|
1775
|
+
* @private
|
|
1719
1776
|
* @param {?} oldDs
|
|
1720
1777
|
* @param {?} newDs
|
|
1721
1778
|
* @return {?}
|
|
1722
1779
|
*/
|
|
1723
1780
|
CdkVirtualForOf.prototype._changeDataSource = /**
|
|
1724
1781
|
* Swap out one `DataSource` for another.
|
|
1782
|
+
* @private
|
|
1725
1783
|
* @param {?} oldDs
|
|
1726
1784
|
* @param {?} newDs
|
|
1727
1785
|
* @return {?}
|
|
@@ -1733,12 +1791,15 @@ var CdkVirtualForOf = /** @class */ (function () {
|
|
|
1733
1791
|
this._needsUpdate = true;
|
|
1734
1792
|
return newDs.connect(this);
|
|
1735
1793
|
};
|
|
1794
|
+
/** Update the `CdkVirtualForOfContext` for all views. */
|
|
1736
1795
|
/**
|
|
1737
1796
|
* Update the `CdkVirtualForOfContext` for all views.
|
|
1797
|
+
* @private
|
|
1738
1798
|
* @return {?}
|
|
1739
1799
|
*/
|
|
1740
1800
|
CdkVirtualForOf.prototype._updateContext = /**
|
|
1741
1801
|
* Update the `CdkVirtualForOfContext` for all views.
|
|
1802
|
+
* @private
|
|
1742
1803
|
* @return {?}
|
|
1743
1804
|
*/
|
|
1744
1805
|
function () {
|
|
@@ -1748,20 +1809,23 @@ var CdkVirtualForOf = /** @class */ (function () {
|
|
|
1748
1809
|
var i = this._viewContainerRef.length;
|
|
1749
1810
|
while (i--) {
|
|
1750
1811
|
/** @type {?} */
|
|
1751
|
-
var view = /** @type {?} */ (this._viewContainerRef.get(i));
|
|
1812
|
+
var view = (/** @type {?} */ (this._viewContainerRef.get(i)));
|
|
1752
1813
|
view.context.index = this._renderedRange.start + i;
|
|
1753
1814
|
view.context.count = count;
|
|
1754
1815
|
this._updateComputedContextProperties(view.context);
|
|
1755
1816
|
view.detectChanges();
|
|
1756
1817
|
}
|
|
1757
1818
|
};
|
|
1819
|
+
/** Apply changes to the DOM. */
|
|
1758
1820
|
/**
|
|
1759
1821
|
* Apply changes to the DOM.
|
|
1822
|
+
* @private
|
|
1760
1823
|
* @param {?} changes
|
|
1761
1824
|
* @return {?}
|
|
1762
1825
|
*/
|
|
1763
1826
|
CdkVirtualForOf.prototype._applyChanges = /**
|
|
1764
1827
|
* Apply changes to the DOM.
|
|
1828
|
+
* @private
|
|
1765
1829
|
* @param {?} changes
|
|
1766
1830
|
* @return {?}
|
|
1767
1831
|
*/
|
|
@@ -1770,18 +1834,19 @@ var CdkVirtualForOf = /** @class */ (function () {
|
|
|
1770
1834
|
// Rearrange the views to put them in the right location.
|
|
1771
1835
|
changes.forEachOperation(function (record, adjustedPreviousIndex, currentIndex) {
|
|
1772
1836
|
if (record.previousIndex == null) { // Item added.
|
|
1837
|
+
// Item added.
|
|
1773
1838
|
/** @type {?} */
|
|
1774
1839
|
var view = _this._getViewForNewItem();
|
|
1775
|
-
_this._viewContainerRef.insert(view, /** @type {?} */ (
|
|
1840
|
+
_this._viewContainerRef.insert(view, (/** @type {?} */ (currentIndex)));
|
|
1776
1841
|
view.context.$implicit = record.item;
|
|
1777
1842
|
}
|
|
1778
1843
|
else if (currentIndex == null) { // Item removed.
|
|
1779
|
-
|
|
1780
|
-
_this._cacheView(/** @type {?} */ (_this._viewContainerRef.detach(/** @type {?} */ ((adjustedPreviousIndex)))));
|
|
1844
|
+
_this._cacheView((/** @type {?} */ (_this._viewContainerRef.detach((/** @type {?} */ (adjustedPreviousIndex))))));
|
|
1781
1845
|
}
|
|
1782
1846
|
else { // Item moved.
|
|
1847
|
+
// Item moved.
|
|
1783
1848
|
/** @type {?} */
|
|
1784
|
-
var view = /** @type {?} */ (_this._viewContainerRef.get(/** @type {?} */ (
|
|
1849
|
+
var view = (/** @type {?} */ (_this._viewContainerRef.get((/** @type {?} */ (adjustedPreviousIndex)))));
|
|
1785
1850
|
_this._viewContainerRef.move(view, currentIndex);
|
|
1786
1851
|
view.context.$implicit = record.item;
|
|
1787
1852
|
}
|
|
@@ -1789,28 +1854,32 @@ var CdkVirtualForOf = /** @class */ (function () {
|
|
|
1789
1854
|
// Update $implicit for any items that had an identity change.
|
|
1790
1855
|
changes.forEachIdentityChange(function (record) {
|
|
1791
1856
|
/** @type {?} */
|
|
1792
|
-
var view = /** @type {?} */ (_this._viewContainerRef.get(/** @type {?} */ (
|
|
1857
|
+
var view = (/** @type {?} */ (_this._viewContainerRef.get((/** @type {?} */ (record.currentIndex)))));
|
|
1793
1858
|
view.context.$implicit = record.item;
|
|
1794
1859
|
});
|
|
1860
|
+
// Update the context variables on all items.
|
|
1795
1861
|
/** @type {?} */
|
|
1796
1862
|
var count = this._data.length;
|
|
1797
1863
|
/** @type {?} */
|
|
1798
1864
|
var i = this._viewContainerRef.length;
|
|
1799
1865
|
while (i--) {
|
|
1800
1866
|
/** @type {?} */
|
|
1801
|
-
var view = /** @type {?} */ (this._viewContainerRef.get(i));
|
|
1867
|
+
var view = (/** @type {?} */ (this._viewContainerRef.get(i)));
|
|
1802
1868
|
view.context.index = this._renderedRange.start + i;
|
|
1803
1869
|
view.context.count = count;
|
|
1804
1870
|
this._updateComputedContextProperties(view.context);
|
|
1805
1871
|
}
|
|
1806
1872
|
};
|
|
1873
|
+
/** Cache the given detached view. */
|
|
1807
1874
|
/**
|
|
1808
1875
|
* Cache the given detached view.
|
|
1876
|
+
* @private
|
|
1809
1877
|
* @param {?} view
|
|
1810
1878
|
* @return {?}
|
|
1811
1879
|
*/
|
|
1812
1880
|
CdkVirtualForOf.prototype._cacheView = /**
|
|
1813
1881
|
* Cache the given detached view.
|
|
1882
|
+
* @private
|
|
1814
1883
|
* @param {?} view
|
|
1815
1884
|
* @return {?}
|
|
1816
1885
|
*/
|
|
@@ -1832,17 +1901,20 @@ var CdkVirtualForOf = /** @class */ (function () {
|
|
|
1832
1901
|
}
|
|
1833
1902
|
}
|
|
1834
1903
|
};
|
|
1904
|
+
/** Get a view for a new item, either from the cache or by creating a new one. */
|
|
1835
1905
|
/**
|
|
1836
1906
|
* Get a view for a new item, either from the cache or by creating a new one.
|
|
1907
|
+
* @private
|
|
1837
1908
|
* @return {?}
|
|
1838
1909
|
*/
|
|
1839
1910
|
CdkVirtualForOf.prototype._getViewForNewItem = /**
|
|
1840
1911
|
* Get a view for a new item, either from the cache or by creating a new one.
|
|
1912
|
+
* @private
|
|
1841
1913
|
* @return {?}
|
|
1842
1914
|
*/
|
|
1843
1915
|
function () {
|
|
1844
1916
|
return this._templateCache.pop() || this._viewContainerRef.createEmbeddedView(this._template, {
|
|
1845
|
-
$implicit: /** @type {?} */ (
|
|
1917
|
+
$implicit: (/** @type {?} */ (null)),
|
|
1846
1918
|
cdkVirtualForOf: this._cdkVirtualForOf,
|
|
1847
1919
|
index: -1,
|
|
1848
1920
|
count: -1,
|
|
@@ -1852,13 +1924,16 @@ var CdkVirtualForOf = /** @class */ (function () {
|
|
|
1852
1924
|
even: false
|
|
1853
1925
|
});
|
|
1854
1926
|
};
|
|
1927
|
+
/** Update the computed properties on the `CdkVirtualForOfContext`. */
|
|
1855
1928
|
/**
|
|
1856
1929
|
* Update the computed properties on the `CdkVirtualForOfContext`.
|
|
1930
|
+
* @private
|
|
1857
1931
|
* @param {?} context
|
|
1858
1932
|
* @return {?}
|
|
1859
1933
|
*/
|
|
1860
1934
|
CdkVirtualForOf.prototype._updateComputedContextProperties = /**
|
|
1861
1935
|
* Update the computed properties on the `CdkVirtualForOfContext`.
|
|
1936
|
+
* @private
|
|
1862
1937
|
* @param {?} context
|
|
1863
1938
|
* @return {?}
|
|
1864
1939
|
*/
|
|
@@ -1892,7 +1967,7 @@ var CdkVirtualForOf = /** @class */ (function () {
|
|
|
1892
1967
|
|
|
1893
1968
|
/**
|
|
1894
1969
|
* @fileoverview added by tsickle
|
|
1895
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
1970
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1896
1971
|
*/
|
|
1897
1972
|
var ScrollingModule = /** @class */ (function () {
|
|
1898
1973
|
function ScrollingModule() {
|
|
@@ -1935,11 +2010,12 @@ var ScrollDispatchModule = /** @class */ (function () {
|
|
|
1935
2010
|
|
|
1936
2011
|
/**
|
|
1937
2012
|
* @fileoverview added by tsickle
|
|
1938
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
2013
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1939
2014
|
*/
|
|
1940
|
-
/**
|
|
2015
|
+
/**
|
|
1941
2016
|
* Time in ms to throttle the resize events by default.
|
|
1942
|
-
|
|
2017
|
+
* @type {?}
|
|
2018
|
+
*/
|
|
1943
2019
|
var DEFAULT_RESIZE_TIME = 20;
|
|
1944
2020
|
/**
|
|
1945
2021
|
* Simple utility for getting the bounds of the browser viewport.
|
|
@@ -1984,7 +2060,7 @@ var ViewportRuler = /** @class */ (function () {
|
|
|
1984
2060
|
var output = { width: this._viewportSize.width, height: this._viewportSize.height };
|
|
1985
2061
|
// If we're not on a browser, don't cache the size since it'll be mocked out anyway.
|
|
1986
2062
|
if (!this._platform.isBrowser) {
|
|
1987
|
-
this._viewportSize = /** @type {?} */ (
|
|
2063
|
+
this._viewportSize = (/** @type {?} */ (null));
|
|
1988
2064
|
}
|
|
1989
2065
|
return output;
|
|
1990
2066
|
};
|
|
@@ -1998,6 +2074,15 @@ var ViewportRuler = /** @class */ (function () {
|
|
|
1998
2074
|
* @return {?}
|
|
1999
2075
|
*/
|
|
2000
2076
|
function () {
|
|
2077
|
+
// Use the document element's bounding rect rather than the window scroll properties
|
|
2078
|
+
// (e.g. pageYOffset, scrollY) due to in issue in Chrome and IE where window scroll
|
|
2079
|
+
// properties and client coordinates (boundingClientRect, clientX/Y, etc.) are in different
|
|
2080
|
+
// conceptual viewports. Under most circumstances these viewports are equivalent, but they
|
|
2081
|
+
// can disagree when the page is pinch-zoomed (on devices that support touch).
|
|
2082
|
+
// See https://bugs.chromium.org/p/chromium/issues/detail?id=489206#c4
|
|
2083
|
+
// We use the documentElement instead of the body because, by default (without a css reset)
|
|
2084
|
+
// browsers typically give the document body an 8px margin, which is not included in
|
|
2085
|
+
// getBoundingClientRect().
|
|
2001
2086
|
/** @type {?} */
|
|
2002
2087
|
var scrollPosition = this.getViewportScrollPosition();
|
|
2003
2088
|
var _a = this.getViewportSize(), width = _a.width, height = _a.height;
|
|
@@ -2025,8 +2110,14 @@ var ViewportRuler = /** @class */ (function () {
|
|
|
2025
2110
|
if (!this._platform.isBrowser) {
|
|
2026
2111
|
return { top: 0, left: 0 };
|
|
2027
2112
|
}
|
|
2113
|
+
// The top-left-corner of the viewport is determined by the scroll position of the document
|
|
2114
|
+
// body, normally just (scrollLeft, scrollTop). However, Chrome and Firefox disagree about
|
|
2115
|
+
// whether `document.body` or `document.documentElement` is the scrolled element, so reading
|
|
2116
|
+
// `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of
|
|
2117
|
+
// `document.documentElement` works consistently, where the `top` and `left` values will
|
|
2118
|
+
// equal negative the scroll position.
|
|
2028
2119
|
/** @type {?} */
|
|
2029
|
-
var documentElement = /** @type {?} */ (
|
|
2120
|
+
var documentElement = (/** @type {?} */ (document.documentElement));
|
|
2030
2121
|
/** @type {?} */
|
|
2031
2122
|
var documentRect = documentElement.getBoundingClientRect();
|
|
2032
2123
|
/** @type {?} */
|
|
@@ -2055,12 +2146,15 @@ var ViewportRuler = /** @class */ (function () {
|
|
|
2055
2146
|
if (throttleTime === void 0) { throttleTime = DEFAULT_RESIZE_TIME; }
|
|
2056
2147
|
return throttleTime > 0 ? this._change.pipe(operators.auditTime(throttleTime)) : this._change;
|
|
2057
2148
|
};
|
|
2149
|
+
/** Updates the cached viewport size. */
|
|
2058
2150
|
/**
|
|
2059
2151
|
* Updates the cached viewport size.
|
|
2152
|
+
* @private
|
|
2060
2153
|
* @return {?}
|
|
2061
2154
|
*/
|
|
2062
2155
|
ViewportRuler.prototype._updateViewportSize = /**
|
|
2063
2156
|
* Updates the cached viewport size.
|
|
2157
|
+
* @private
|
|
2064
2158
|
* @return {?}
|
|
2065
2159
|
*/
|
|
2066
2160
|
function () {
|
|
@@ -2089,9 +2183,10 @@ var ViewportRuler = /** @class */ (function () {
|
|
|
2089
2183
|
function VIEWPORT_RULER_PROVIDER_FACTORY(parentRuler, platform$$1, ngZone) {
|
|
2090
2184
|
return parentRuler || new ViewportRuler(platform$$1, ngZone);
|
|
2091
2185
|
}
|
|
2092
|
-
/**
|
|
2186
|
+
/**
|
|
2093
2187
|
* \@docs-private \@deprecated \@breaking-change 8.0.0
|
|
2094
|
-
|
|
2188
|
+
* @type {?}
|
|
2189
|
+
*/
|
|
2095
2190
|
var VIEWPORT_RULER_PROVIDER = {
|
|
2096
2191
|
// If there is already a ViewportRuler available, use that. Otherwise, provide a new one.
|
|
2097
2192
|
provide: ViewportRuler,
|