@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
package/bundles/cdk-tree.umd.js
CHANGED
|
@@ -42,7 +42,7 @@ 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
|
* Base tree control. It has basic toggle/expand/collapse operations on a single data node.
|
|
@@ -186,7 +186,7 @@ BaseTreeControl = /** @class */ (function () {
|
|
|
186
186
|
|
|
187
187
|
/**
|
|
188
188
|
* @fileoverview added by tsickle
|
|
189
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
189
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
190
190
|
*/
|
|
191
191
|
/**
|
|
192
192
|
* Flat tree control. Able to expand/collapse a subtree recursively for flattened tree.
|
|
@@ -272,7 +272,7 @@ FlatTreeControl = /** @class */ (function (_super) {
|
|
|
272
272
|
|
|
273
273
|
/**
|
|
274
274
|
* @fileoverview added by tsickle
|
|
275
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
275
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
276
276
|
*/
|
|
277
277
|
/**
|
|
278
278
|
* Nested tree control. Able to expand/collapse a subtree recursively for NestedNode type.
|
|
@@ -341,12 +341,14 @@ NestedTreeControl = /** @class */ (function (_super) {
|
|
|
341
341
|
/** A helper function to get descendants recursively. */
|
|
342
342
|
/**
|
|
343
343
|
* A helper function to get descendants recursively.
|
|
344
|
+
* @protected
|
|
344
345
|
* @param {?} descendants
|
|
345
346
|
* @param {?} dataNode
|
|
346
347
|
* @return {?}
|
|
347
348
|
*/
|
|
348
349
|
NestedTreeControl.prototype._getDescendants = /**
|
|
349
350
|
* A helper function to get descendants recursively.
|
|
351
|
+
* @protected
|
|
350
352
|
* @param {?} descendants
|
|
351
353
|
* @param {?} dataNode
|
|
352
354
|
* @return {?}
|
|
@@ -360,7 +362,7 @@ NestedTreeControl = /** @class */ (function (_super) {
|
|
|
360
362
|
childrenNodes.forEach(function (child) { return _this._getDescendants(descendants, child); });
|
|
361
363
|
}
|
|
362
364
|
else if (childrenNodes instanceof rxjs.Observable) {
|
|
363
|
-
childrenNodes.pipe(operators.take(1)).subscribe(function (children) {
|
|
365
|
+
childrenNodes.pipe(operators.take(1), operators.filter(Boolean)).subscribe(function (children) {
|
|
364
366
|
children.forEach(function (child) { return _this._getDescendants(descendants, child); });
|
|
365
367
|
});
|
|
366
368
|
}
|
|
@@ -370,7 +372,12 @@ NestedTreeControl = /** @class */ (function (_super) {
|
|
|
370
372
|
|
|
371
373
|
/**
|
|
372
374
|
* @fileoverview added by tsickle
|
|
373
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
375
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
376
|
+
*/
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* @fileoverview added by tsickle
|
|
380
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
374
381
|
*/
|
|
375
382
|
/**
|
|
376
383
|
* Context provided to the tree node component.
|
|
@@ -413,7 +420,7 @@ var CdkTreeNodeDef = /** @class */ (function () {
|
|
|
413
420
|
|
|
414
421
|
/**
|
|
415
422
|
* @fileoverview added by tsickle
|
|
416
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
423
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
417
424
|
*/
|
|
418
425
|
/**
|
|
419
426
|
* Outlet for nested CdkNode. Put `[cdkTreeNodeOutlet]` on a tag to place children dataNodes
|
|
@@ -437,7 +444,7 @@ var CdkTreeNodeOutlet = /** @class */ (function () {
|
|
|
437
444
|
|
|
438
445
|
/**
|
|
439
446
|
* @fileoverview added by tsickle
|
|
440
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
447
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
441
448
|
*/
|
|
442
449
|
|
|
443
450
|
/**
|
|
@@ -483,7 +490,7 @@ function getTreeControlFunctionsMissingError() {
|
|
|
483
490
|
|
|
484
491
|
/**
|
|
485
492
|
* @fileoverview added by tsickle
|
|
486
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
493
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
487
494
|
*/
|
|
488
495
|
/**
|
|
489
496
|
* CDK tree component that connects with a data source to retrieve data of type `T` and renders
|
|
@@ -502,6 +509,8 @@ var CdkTree = /** @class */ (function () {
|
|
|
502
509
|
* Level of nodes
|
|
503
510
|
*/
|
|
504
511
|
this._levels = new Map();
|
|
512
|
+
// TODO(tinayuangao): Setup a listener for scrolling, emit the calculated view to viewChange.
|
|
513
|
+
// Remove the MAX_VALUE in viewChange
|
|
505
514
|
/**
|
|
506
515
|
* Stream containing the latest information on what rows are being displayed on screen.
|
|
507
516
|
* Can be used by the data source to as a heuristic of what data should be provided.
|
|
@@ -555,8 +564,8 @@ var CdkTree = /** @class */ (function () {
|
|
|
555
564
|
this._nodeOutlet.viewContainer.clear();
|
|
556
565
|
this._onDestroy.next();
|
|
557
566
|
this._onDestroy.complete();
|
|
558
|
-
if (this._dataSource && typeof (/** @type {?} */ (this._dataSource)).disconnect === 'function') {
|
|
559
|
-
(/** @type {?} */ (this.dataSource)).disconnect(this);
|
|
567
|
+
if (this._dataSource && typeof ((/** @type {?} */ (this._dataSource))).disconnect === 'function') {
|
|
568
|
+
((/** @type {?} */ (this.dataSource))).disconnect(this);
|
|
560
569
|
}
|
|
561
570
|
if (this._dataSubscription) {
|
|
562
571
|
this._dataSubscription.unsubscribe();
|
|
@@ -580,23 +589,37 @@ var CdkTree = /** @class */ (function () {
|
|
|
580
589
|
this._observeRenderChanges();
|
|
581
590
|
}
|
|
582
591
|
};
|
|
592
|
+
// TODO(tinayuangao): Work on keyboard traversal and actions, make sure it's working for RTL
|
|
593
|
+
// and nested trees.
|
|
583
594
|
/**
|
|
584
595
|
* Switch to the provided data source by resetting the data and unsubscribing from the current
|
|
585
596
|
* render change subscription if one exists. If the data source is null, interpret this by
|
|
586
597
|
* clearing the node outlet. Otherwise start listening for new data.
|
|
598
|
+
*/
|
|
599
|
+
// TODO(tinayuangao): Work on keyboard traversal and actions, make sure it's working for RTL
|
|
600
|
+
// and nested trees.
|
|
601
|
+
/**
|
|
602
|
+
* Switch to the provided data source by resetting the data and unsubscribing from the current
|
|
603
|
+
* render change subscription if one exists. If the data source is null, interpret this by
|
|
604
|
+
* clearing the node outlet. Otherwise start listening for new data.
|
|
605
|
+
* @private
|
|
587
606
|
* @param {?} dataSource
|
|
588
607
|
* @return {?}
|
|
589
608
|
*/
|
|
590
|
-
CdkTree.prototype._switchDataSource =
|
|
609
|
+
CdkTree.prototype._switchDataSource =
|
|
610
|
+
// TODO(tinayuangao): Work on keyboard traversal and actions, make sure it's working for RTL
|
|
611
|
+
// and nested trees.
|
|
612
|
+
/**
|
|
591
613
|
* Switch to the provided data source by resetting the data and unsubscribing from the current
|
|
592
614
|
* render change subscription if one exists. If the data source is null, interpret this by
|
|
593
615
|
* clearing the node outlet. Otherwise start listening for new data.
|
|
616
|
+
* @private
|
|
594
617
|
* @param {?} dataSource
|
|
595
618
|
* @return {?}
|
|
596
619
|
*/
|
|
597
620
|
function (dataSource) {
|
|
598
|
-
if (this._dataSource && typeof (/** @type {?} */ (this._dataSource)).disconnect === 'function') {
|
|
599
|
-
(/** @type {?} */ (this.dataSource)).disconnect(this);
|
|
621
|
+
if (this._dataSource && typeof ((/** @type {?} */ (this._dataSource))).disconnect === 'function') {
|
|
622
|
+
((/** @type {?} */ (this.dataSource))).disconnect(this);
|
|
600
623
|
}
|
|
601
624
|
if (this._dataSubscription) {
|
|
602
625
|
this._dataSubscription.unsubscribe();
|
|
@@ -611,12 +634,15 @@ var CdkTree = /** @class */ (function () {
|
|
|
611
634
|
this._observeRenderChanges();
|
|
612
635
|
}
|
|
613
636
|
};
|
|
637
|
+
/** Set up a subscription for the data provided by the data source. */
|
|
614
638
|
/**
|
|
615
639
|
* Set up a subscription for the data provided by the data source.
|
|
640
|
+
* @private
|
|
616
641
|
* @return {?}
|
|
617
642
|
*/
|
|
618
643
|
CdkTree.prototype._observeRenderChanges = /**
|
|
619
644
|
* Set up a subscription for the data provided by the data source.
|
|
645
|
+
* @private
|
|
620
646
|
* @return {?}
|
|
621
647
|
*/
|
|
622
648
|
function () {
|
|
@@ -625,8 +651,8 @@ var CdkTree = /** @class */ (function () {
|
|
|
625
651
|
var dataStream;
|
|
626
652
|
// Cannot use `instanceof DataSource` since the data source could be a literal with
|
|
627
653
|
// `connect` function and may not extends DataSource.
|
|
628
|
-
if (typeof (/** @type {?} */ (this._dataSource)).connect === 'function') {
|
|
629
|
-
dataStream = (/** @type {?} */ (this._dataSource)).connect(this);
|
|
654
|
+
if (typeof ((/** @type {?} */ (this._dataSource))).connect === 'function') {
|
|
655
|
+
dataStream = ((/** @type {?} */ (this._dataSource))).connect(this);
|
|
630
656
|
}
|
|
631
657
|
else if (this._dataSource instanceof rxjs.Observable) {
|
|
632
658
|
dataStream = this._dataSource;
|
|
@@ -670,16 +696,16 @@ var CdkTree = /** @class */ (function () {
|
|
|
670
696
|
}
|
|
671
697
|
changes.forEachOperation(function (item, adjustedPreviousIndex, currentIndex) {
|
|
672
698
|
if (item.previousIndex == null) {
|
|
673
|
-
_this.insertNode(data[/** @type {?} */ (
|
|
699
|
+
_this.insertNode(data[(/** @type {?} */ (currentIndex))], (/** @type {?} */ (currentIndex)), viewContainer, parentData);
|
|
674
700
|
}
|
|
675
701
|
else if (currentIndex == null) {
|
|
676
|
-
viewContainer.remove(/** @type {?} */ (
|
|
702
|
+
viewContainer.remove((/** @type {?} */ (adjustedPreviousIndex)));
|
|
677
703
|
_this._levels.delete(item.item);
|
|
678
704
|
}
|
|
679
705
|
else {
|
|
680
706
|
/** @type {?} */
|
|
681
|
-
var view = viewContainer.get(/** @type {?} */ (
|
|
682
|
-
viewContainer.move(/** @type {?} */ (
|
|
707
|
+
var view = viewContainer.get((/** @type {?} */ (adjustedPreviousIndex)));
|
|
708
|
+
viewContainer.move((/** @type {?} */ (view)), currentIndex);
|
|
683
709
|
}
|
|
684
710
|
});
|
|
685
711
|
this._changeDetectorRef.detectChanges();
|
|
@@ -744,6 +770,7 @@ var CdkTree = /** @class */ (function () {
|
|
|
744
770
|
function (nodeData, index, viewContainer, parentData) {
|
|
745
771
|
/** @type {?} */
|
|
746
772
|
var node = this._getNodeDef(nodeData, index);
|
|
773
|
+
// Node context that will be provided to created embedded view
|
|
747
774
|
/** @type {?} */
|
|
748
775
|
var context = new CdkTreeNodeOutletContext(nodeData);
|
|
749
776
|
// If the tree is flat tree, then use the `getLevel` function in flat tree control
|
|
@@ -752,12 +779,13 @@ var CdkTree = /** @class */ (function () {
|
|
|
752
779
|
context.level = this.treeControl.getLevel(nodeData);
|
|
753
780
|
}
|
|
754
781
|
else if (typeof parentData !== 'undefined' && this._levels.has(parentData)) {
|
|
755
|
-
context.level = /** @type {?} */ (
|
|
782
|
+
context.level = (/** @type {?} */ (this._levels.get(parentData))) + 1;
|
|
756
783
|
}
|
|
757
784
|
else {
|
|
758
785
|
context.level = 0;
|
|
759
786
|
}
|
|
760
787
|
this._levels.set(nodeData, context.level);
|
|
788
|
+
// Use default tree nodeOutlet, or nested node's nodeOutlet
|
|
761
789
|
/** @type {?} */
|
|
762
790
|
var container = viewContainer ? viewContainer : this._nodeOutlet.viewContainer;
|
|
763
791
|
container.createEmbeddedView(node.template, context, index);
|
|
@@ -811,7 +839,7 @@ var CdkTreeNode = /** @class */ (function () {
|
|
|
811
839
|
* and 'treeitem' if it's a leaf node.
|
|
812
840
|
*/
|
|
813
841
|
this.role = 'treeitem';
|
|
814
|
-
CdkTreeNode.mostRecentTreeNode = /** @type {?} */ (this);
|
|
842
|
+
CdkTreeNode.mostRecentTreeNode = (/** @type {?} */ (this));
|
|
815
843
|
}
|
|
816
844
|
Object.defineProperty(CdkTreeNode.prototype, "data", {
|
|
817
845
|
/** The tree node's data. */
|
|
@@ -879,9 +907,11 @@ var CdkTreeNode = /** @class */ (function () {
|
|
|
879
907
|
this._elementRef.nativeElement.focus();
|
|
880
908
|
};
|
|
881
909
|
/**
|
|
910
|
+
* @protected
|
|
882
911
|
* @return {?}
|
|
883
912
|
*/
|
|
884
913
|
CdkTreeNode.prototype._setRoleFromData = /**
|
|
914
|
+
* @protected
|
|
885
915
|
* @return {?}
|
|
886
916
|
*/
|
|
887
917
|
function () {
|
|
@@ -896,7 +926,7 @@ var CdkTreeNode = /** @class */ (function () {
|
|
|
896
926
|
/** @type {?} */
|
|
897
927
|
var childrenNodes = this._tree.treeControl.getChildren(this._data);
|
|
898
928
|
if (Array.isArray(childrenNodes)) {
|
|
899
|
-
this._setRoleFromChildren(/** @type {?} */ (childrenNodes));
|
|
929
|
+
this._setRoleFromChildren((/** @type {?} */ (childrenNodes)));
|
|
900
930
|
}
|
|
901
931
|
else if (childrenNodes instanceof rxjs.Observable) {
|
|
902
932
|
childrenNodes.pipe(operators.takeUntil(this._destroyed))
|
|
@@ -905,10 +935,12 @@ var CdkTreeNode = /** @class */ (function () {
|
|
|
905
935
|
}
|
|
906
936
|
};
|
|
907
937
|
/**
|
|
938
|
+
* @protected
|
|
908
939
|
* @param {?} children
|
|
909
940
|
* @return {?}
|
|
910
941
|
*/
|
|
911
942
|
CdkTreeNode.prototype._setRoleFromChildren = /**
|
|
943
|
+
* @protected
|
|
912
944
|
* @param {?} children
|
|
913
945
|
* @return {?}
|
|
914
946
|
*/
|
|
@@ -945,7 +977,7 @@ var CdkTreeNode = /** @class */ (function () {
|
|
|
945
977
|
|
|
946
978
|
/**
|
|
947
979
|
* @fileoverview added by tsickle
|
|
948
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
980
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
949
981
|
*/
|
|
950
982
|
/**
|
|
951
983
|
* Nested node is a child of `<cdk-tree>`. It works with nested tree.
|
|
@@ -953,19 +985,19 @@ var CdkTreeNode = /** @class */ (function () {
|
|
|
953
985
|
* be added in the `cdkTreeNodeOutlet` in tree node template.
|
|
954
986
|
* For example:
|
|
955
987
|
* ```html
|
|
956
|
-
* <cdk-
|
|
988
|
+
* <cdk-nested-tree-node>
|
|
957
989
|
* {{node.name}}
|
|
958
990
|
* <ng-template cdkTreeNodeOutlet></ng-template>
|
|
959
|
-
* </cdk-tree-node>
|
|
991
|
+
* </cdk-nested-tree-node>
|
|
960
992
|
* ```
|
|
961
993
|
* The children of node will be automatically added to `cdkTreeNodeOutlet`, the result dom will be
|
|
962
994
|
* like this:
|
|
963
995
|
* ```html
|
|
964
996
|
* <cdk-nested-tree-node>
|
|
965
997
|
* {{node.name}}
|
|
966
|
-
* <cdk-nested-tree-node>{{child1.name}}</cdk-tree-node>
|
|
967
|
-
* <cdk-nested-tree-node>{{child2.name}}</cdk-tree-node>
|
|
968
|
-
* </cdk-tree-node>
|
|
998
|
+
* <cdk-nested-tree-node>{{child1.name}}</cdk-nested-tree-node>
|
|
999
|
+
* <cdk-nested-tree-node>{{child2.name}}</cdk-nested-tree-node>
|
|
1000
|
+
* </cdk-nested-tree-node>
|
|
969
1001
|
* ```
|
|
970
1002
|
* @template T
|
|
971
1003
|
*/
|
|
@@ -993,7 +1025,7 @@ var CdkNestedTreeNode = /** @class */ (function (_super) {
|
|
|
993
1025
|
/** @type {?} */
|
|
994
1026
|
var childrenNodes = this._tree.treeControl.getChildren(this.data);
|
|
995
1027
|
if (Array.isArray(childrenNodes)) {
|
|
996
|
-
this.updateChildrenNodes(/** @type {?} */ (childrenNodes));
|
|
1028
|
+
this.updateChildrenNodes((/** @type {?} */ (childrenNodes)));
|
|
997
1029
|
}
|
|
998
1030
|
else if (childrenNodes instanceof rxjs.Observable) {
|
|
999
1031
|
childrenNodes.pipe(operators.takeUntil(this._destroyed))
|
|
@@ -1015,11 +1047,13 @@ var CdkNestedTreeNode = /** @class */ (function (_super) {
|
|
|
1015
1047
|
/** Add children dataNodes to the NodeOutlet */
|
|
1016
1048
|
/**
|
|
1017
1049
|
* Add children dataNodes to the NodeOutlet
|
|
1050
|
+
* @protected
|
|
1018
1051
|
* @param {?=} children
|
|
1019
1052
|
* @return {?}
|
|
1020
1053
|
*/
|
|
1021
1054
|
CdkNestedTreeNode.prototype.updateChildrenNodes = /**
|
|
1022
1055
|
* Add children dataNodes to the NodeOutlet
|
|
1056
|
+
* @protected
|
|
1023
1057
|
* @param {?=} children
|
|
1024
1058
|
* @return {?}
|
|
1025
1059
|
*/
|
|
@@ -1040,10 +1074,12 @@ var CdkNestedTreeNode = /** @class */ (function (_super) {
|
|
|
1040
1074
|
/** Clear the children dataNodes. */
|
|
1041
1075
|
/**
|
|
1042
1076
|
* Clear the children dataNodes.
|
|
1077
|
+
* @protected
|
|
1043
1078
|
* @return {?}
|
|
1044
1079
|
*/
|
|
1045
1080
|
CdkNestedTreeNode.prototype._clear = /**
|
|
1046
1081
|
* Clear the children dataNodes.
|
|
1082
|
+
* @protected
|
|
1047
1083
|
* @return {?}
|
|
1048
1084
|
*/
|
|
1049
1085
|
function () {
|
|
@@ -1078,11 +1114,12 @@ var CdkNestedTreeNode = /** @class */ (function (_super) {
|
|
|
1078
1114
|
|
|
1079
1115
|
/**
|
|
1080
1116
|
* @fileoverview added by tsickle
|
|
1081
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
1117
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1082
1118
|
*/
|
|
1083
|
-
/**
|
|
1119
|
+
/**
|
|
1084
1120
|
* Regex used to split a string on its CSS units.
|
|
1085
|
-
|
|
1121
|
+
* @type {?}
|
|
1122
|
+
*/
|
|
1086
1123
|
var cssUnitPattern = /([A-Za-z%]+)$/;
|
|
1087
1124
|
/**
|
|
1088
1125
|
* Indent for the children tree dataNodes.
|
|
@@ -1225,7 +1262,7 @@ var CdkTreeNodePadding = /** @class */ (function () {
|
|
|
1225
1262
|
|
|
1226
1263
|
/**
|
|
1227
1264
|
* @fileoverview added by tsickle
|
|
1228
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
1265
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1229
1266
|
*/
|
|
1230
1267
|
/**
|
|
1231
1268
|
* Node toggle to expand/collapse the node.
|
|
@@ -1287,7 +1324,7 @@ var CdkTreeNodeToggle = /** @class */ (function () {
|
|
|
1287
1324
|
|
|
1288
1325
|
/**
|
|
1289
1326
|
* @fileoverview added by tsickle
|
|
1290
|
-
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
|
|
1327
|
+
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1291
1328
|
*/
|
|
1292
1329
|
/** @type {?} */
|
|
1293
1330
|
var EXPORTED_DECLARATIONS = [
|