@angular/cdk 9.2.0 → 9.2.1
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/focus-monitor/focus-monitor.d.ts +6 -0
- package/a11y/index.metadata.json +1 -1
- package/bundles/cdk-a11y.umd.js +71 -64
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +8 -8
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.js +108 -79
- package/bundles/cdk-drag-drop.umd.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.min.js +15 -8
- package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
- package/bundles/cdk-tree.umd.js +8 -4
- 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 +1 -1
- package/bundles/cdk.umd.js.map +1 -1
- package/bundles/cdk.umd.min.js +1 -1
- package/bundles/cdk.umd.min.js.map +1 -1
- package/drag-drop/client-rect.d.ts +31 -0
- package/drag-drop/directives/config.d.ts +1 -0
- package/drag-drop/directives/drop-list.d.ts +4 -3
- package/drag-drop/drag-ref.d.ts +4 -0
- package/drag-drop/index.metadata.json +1 -1
- package/esm2015/a11y/focus-monitor/focus-monitor.js +71 -65
- package/esm2015/a11y/high-contrast-mode/high-contrast-mode-detector.js +8 -4
- package/esm2015/drag-drop/client-rect.js +75 -0
- package/esm2015/drag-drop/directives/config.js +3 -1
- package/esm2015/drag-drop/directives/drag.js +3 -2
- package/esm2015/drag-drop/directives/drop-list.js +24 -18
- package/esm2015/drag-drop/drag-ref.js +55 -21
- package/esm2015/drag-drop/drop-list-ref.js +5 -64
- package/esm2015/tree/padding.js +9 -10
- package/esm2015/version.js +1 -1
- package/esm5/a11y/focus-monitor/focus-monitor.js +49 -44
- package/esm5/a11y/high-contrast-mode/high-contrast-mode-detector.js +7 -4
- package/esm5/drag-drop/client-rect.js +60 -0
- package/esm5/drag-drop/directives/config.js +1 -1
- package/esm5/drag-drop/directives/drag.js +3 -2
- package/esm5/drag-drop/directives/drop-list.js +13 -10
- package/esm5/drag-drop/drag-ref.js +33 -17
- package/esm5/drag-drop/drop-list-ref.js +5 -54
- package/esm5/tree/padding.js +9 -5
- package/esm5/version.js +1 -1
- package/fesm2015/a11y.js +101 -92
- package/fesm2015/a11y.js.map +1 -1
- package/fesm2015/cdk.js +1 -1
- package/fesm2015/cdk.js.map +1 -1
- package/fesm2015/drag-drop.js +158 -101
- package/fesm2015/drag-drop.js.map +1 -1
- package/fesm2015/tree.js +8 -9
- package/fesm2015/tree.js.map +1 -1
- package/fesm5/a11y.js +71 -64
- package/fesm5/a11y.js.map +1 -1
- package/fesm5/cdk.js +1 -1
- package/fesm5/cdk.js.map +1 -1
- package/fesm5/drag-drop.js +108 -79
- package/fesm5/drag-drop.js.map +1 -1
- package/fesm5/tree.js +8 -4
- package/fesm5/tree.js.map +1 -1
- package/package.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/tree/index.metadata.json +1 -1
- package/tree/padding.d.ts +6 -2
package/fesm2015/tree.js
CHANGED
|
@@ -1287,10 +1287,14 @@ class CdkTreeNodePadding {
|
|
|
1287
1287
|
* @param {?} _element
|
|
1288
1288
|
* @param {?} _dir
|
|
1289
1289
|
*/
|
|
1290
|
-
constructor(_treeNode, _tree,
|
|
1290
|
+
constructor(_treeNode, _tree,
|
|
1291
|
+
/**
|
|
1292
|
+
* @deprecated _renderer parameter no longer being used. To be removed.
|
|
1293
|
+
* @breaking-change 11.0.0
|
|
1294
|
+
*/
|
|
1295
|
+
_renderer, _element, _dir) {
|
|
1291
1296
|
this._treeNode = _treeNode;
|
|
1292
1297
|
this._tree = _tree;
|
|
1293
|
-
this._renderer = _renderer;
|
|
1294
1298
|
this._element = _element;
|
|
1295
1299
|
this._dir = _dir;
|
|
1296
1300
|
/**
|
|
@@ -1392,8 +1396,8 @@ class CdkTreeNodePadding {
|
|
|
1392
1396
|
const paddingProp = this._dir && this._dir.value === 'rtl' ? 'paddingRight' : 'paddingLeft';
|
|
1393
1397
|
/** @type {?} */
|
|
1394
1398
|
const resetProp = paddingProp === 'paddingLeft' ? 'paddingRight' : 'paddingLeft';
|
|
1395
|
-
|
|
1396
|
-
|
|
1399
|
+
element.style[paddingProp] = padding || '';
|
|
1400
|
+
element.style[resetProp] = '';
|
|
1397
1401
|
this._currentPadding = padding;
|
|
1398
1402
|
}
|
|
1399
1403
|
}
|
|
@@ -1449,11 +1453,6 @@ if (false) {
|
|
|
1449
1453
|
* @private
|
|
1450
1454
|
*/
|
|
1451
1455
|
CdkTreeNodePadding.prototype._tree;
|
|
1452
|
-
/**
|
|
1453
|
-
* @type {?}
|
|
1454
|
-
* @private
|
|
1455
|
-
*/
|
|
1456
|
-
CdkTreeNodePadding.prototype._renderer;
|
|
1457
1456
|
/**
|
|
1458
1457
|
* @type {?}
|
|
1459
1458
|
* @private
|
package/fesm2015/tree.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.js","sources":["../../../../../../src/cdk/tree/control/base-tree-control.ts","../../../../../../src/cdk/tree/control/flat-tree-control.ts","../../../../../../src/cdk/tree/control/nested-tree-control.ts","../../../../../../src/cdk/tree/control/tree-control.ts","../../../../../../src/cdk/tree/outlet.ts","../../../../../../src/cdk/tree/node.ts","../../../../../../src/cdk/tree/tree-errors.ts","../../../../../../src/cdk/tree/tree.ts","../../../../../../src/cdk/tree/nested-node.ts","../../../../../../src/cdk/tree/padding.ts","../../../../../../src/cdk/tree/toggle.ts","../../../../../../src/cdk/tree/tree-module.ts","../../../../../../src/cdk/tree/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {SelectionModel} from '@angular/cdk/collections';\nimport {Observable} from 'rxjs';\nimport {TreeControl} from './tree-control';\n\n/** Base tree control. It has basic toggle/expand/collapse operations on a single data node. */\nexport abstract class BaseTreeControl<T> implements TreeControl<T> {\n\n /** Gets a list of descendent data nodes of a subtree rooted at given data node recursively. */\n abstract getDescendants(dataNode: T): T[];\n\n /** Expands all data nodes in the tree. */\n abstract expandAll(): void;\n\n /** Saved data node for `expandAll` action. */\n dataNodes: T[];\n\n /** A selection model with multi-selection to track expansion status. */\n expansionModel: SelectionModel<T> = new SelectionModel<T>(true);\n\n /** Get depth of a given data node, return the level number. This is for flat tree node. */\n getLevel: (dataNode: T) => number;\n\n /**\n * Whether the data node is expandable. Returns true if expandable.\n * This is for flat tree node.\n */\n isExpandable: (dataNode: T) => boolean;\n\n /** Gets a stream that emits whenever the given data node's children change. */\n getChildren: (dataNode: T) => (Observable<T[]> | T[] | undefined | null);\n\n /** Toggles one single data node's expanded/collapsed state. */\n toggle(dataNode: T): void {\n this.expansionModel.toggle(dataNode);\n }\n\n /** Expands one single data node. */\n expand(dataNode: T): void {\n this.expansionModel.select(dataNode);\n }\n\n /** Collapses one single data node. */\n collapse(dataNode: T): void {\n this.expansionModel.deselect(dataNode);\n }\n\n /** Whether a given data node is expanded or not. Returns true if the data node is expanded. */\n isExpanded(dataNode: T): boolean {\n return this.expansionModel.isSelected(dataNode);\n }\n\n /** Toggles a subtree rooted at `node` recursively. */\n toggleDescendants(dataNode: T): void {\n this.expansionModel.isSelected(dataNode)\n ? this.collapseDescendants(dataNode)\n : this.expandDescendants(dataNode);\n }\n\n /** Collapse all dataNodes in the tree. */\n collapseAll(): void {\n this.expansionModel.clear();\n }\n\n /** Expands a subtree rooted at given data node recursively. */\n expandDescendants(dataNode: T): void {\n let toBeProcessed = [dataNode];\n toBeProcessed.push(...this.getDescendants(dataNode));\n this.expansionModel.select(...toBeProcessed);\n }\n\n /** Collapses a subtree rooted at given data node recursively. */\n collapseDescendants(dataNode: T): void {\n let toBeProcessed = [dataNode];\n toBeProcessed.push(...this.getDescendants(dataNode));\n this.expansionModel.deselect(...toBeProcessed);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BaseTreeControl} from './base-tree-control';\n\n/** Flat tree control. Able to expand/collapse a subtree recursively for flattened tree. */\nexport class FlatTreeControl<T> extends BaseTreeControl<T> {\n\n /** Construct with flat tree data node functions getLevel and isExpandable. */\n constructor(public getLevel: (dataNode: T) => number,\n public isExpandable: (dataNode: T) => boolean) {\n super();\n }\n\n /**\n * Gets a list of the data node's subtree of descendent data nodes.\n *\n * To make this working, the `dataNodes` of the TreeControl must be flattened tree nodes\n * with correct levels.\n */\n getDescendants(dataNode: T): T[] {\n const startIndex = this.dataNodes.indexOf(dataNode);\n const results: T[] = [];\n\n // Goes through flattened tree nodes in the `dataNodes` array, and get all descendants.\n // The level of descendants of a tree node must be greater than the level of the given\n // tree node.\n // If we reach a node whose level is equal to the level of the tree node, we hit a sibling.\n // If we reach a node whose level is greater than the level of the tree node, we hit a\n // sibling of an ancestor.\n for (let i = startIndex + 1;\n i < this.dataNodes.length && this.getLevel(dataNode) < this.getLevel(this.dataNodes[i]);\n i++) {\n results.push(this.dataNodes[i]);\n }\n return results;\n }\n\n /**\n * Expands all data nodes in the tree.\n *\n * To make this working, the `dataNodes` variable of the TreeControl must be set to all flattened\n * data nodes of the tree.\n */\n expandAll(): void {\n this.expansionModel.select(...this.dataNodes);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {Observable, isObservable} from 'rxjs';\nimport {take, filter} from 'rxjs/operators';\nimport {BaseTreeControl} from './base-tree-control';\n\n/** Nested tree control. Able to expand/collapse a subtree recursively for NestedNode type. */\nexport class NestedTreeControl<T> extends BaseTreeControl<T> {\n\n /** Construct with nested tree function getChildren. */\n constructor(public getChildren: (dataNode: T) => (Observable<T[]> | T[] | undefined | null)) {\n super();\n }\n\n /**\n * Expands all dataNodes in the tree.\n *\n * To make this working, the `dataNodes` variable of the TreeControl must be set to all root level\n * data nodes of the tree.\n */\n expandAll(): void {\n this.expansionModel.clear();\n const allNodes = this.dataNodes.reduce((accumulator: T[], dataNode) =>\n [...accumulator, ...this.getDescendants(dataNode), dataNode], []);\n this.expansionModel.select(...allNodes);\n }\n\n /** Gets a list of descendant dataNodes of a subtree rooted at given data node recursively. */\n getDescendants(dataNode: T): T[] {\n const descendants: T[] = [];\n\n this._getDescendants(descendants, dataNode);\n // Remove the node itself\n return descendants.splice(1);\n }\n\n /** A helper function to get descendants recursively. */\n protected _getDescendants(descendants: T[], dataNode: T): void {\n descendants.push(dataNode);\n const childrenNodes = this.getChildren(dataNode);\n if (Array.isArray(childrenNodes)) {\n childrenNodes.forEach((child: T) => this._getDescendants(descendants, child));\n } else if (isObservable(childrenNodes)) {\n // TypeScript as of version 3.5 doesn't seem to treat `Boolean` like a function that\n // returns a `boolean` specifically in the context of `filter`, so we manually clarify that.\n childrenNodes.pipe(take(1), filter(Boolean as () => boolean))\n .subscribe(children => {\n for (const child of children) {\n this._getDescendants(descendants, child);\n }\n });\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {SelectionModel} from '@angular/cdk/collections';\nimport {Observable} from 'rxjs';\n\n/**\n * Tree control interface. User can implement TreeControl to expand/collapse dataNodes in the tree.\n * The CDKTree will use this TreeControl to expand/collapse a node.\n * User can also use it outside the `<cdk-tree>` to control the expansion status of the tree.\n */\nexport interface TreeControl<T> {\n /** The saved tree nodes data for `expandAll` action. */\n dataNodes: T[];\n\n /** The expansion model */\n expansionModel: SelectionModel<T>;\n\n /** Whether the data node is expanded or collapsed. Return true if it's expanded. */\n isExpanded(dataNode: T): boolean;\n\n /** Get all descendants of a data node */\n getDescendants(dataNode: T): any[];\n\n /** Expand or collapse data node */\n toggle(dataNode: T): void;\n\n /** Expand one data node */\n expand(dataNode: T): void;\n\n /** Collapse one data node */\n collapse(dataNode: T): void;\n\n /** Expand all the dataNodes in the tree */\n expandAll(): void;\n\n /** Collapse all the dataNodes in the tree */\n collapseAll(): void;\n\n /** Toggle a data node by expand/collapse it and all its descendants */\n toggleDescendants(dataNode: T): void;\n\n /** Expand a data node and all its descendants */\n expandDescendants(dataNode: T): void;\n\n /** Collapse a data node and all its descendants */\n collapseDescendants(dataNode: T): void;\n\n /** Get depth of a given data node, return the level number. This is for flat tree node. */\n readonly getLevel: (dataNode: T) => number;\n\n /**\n * Whether the data node is expandable. Returns true if expandable.\n * This is for flat tree node.\n */\n readonly isExpandable: (dataNode: T) => boolean;\n\n /** Gets a stream that emits whenever the given data node's children change. */\n readonly getChildren: (dataNode: T) => Observable<T[]> | T[] | undefined | null;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {\n Directive,\n Inject,\n InjectionToken,\n Optional,\n ViewContainerRef,\n} from '@angular/core';\n\n/**\n * Injection token used to provide a `CdkTreeNode` to its outlet.\n * Used primarily to avoid circular imports.\n * @docs-private\n */\nexport const CDK_TREE_NODE_OUTLET_NODE = new InjectionToken<{}>('CDK_TREE_NODE_OUTLET_NODE');\n\n/**\n * Outlet for nested CdkNode. Put `[cdkTreeNodeOutlet]` on a tag to place children dataNodes\n * inside the outlet.\n */\n@Directive({\n selector: '[cdkTreeNodeOutlet]'\n})\nexport class CdkTreeNodeOutlet {\n constructor(\n public viewContainer: ViewContainerRef,\n @Inject(CDK_TREE_NODE_OUTLET_NODE) @Optional() public _node?: any) {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, TemplateRef} from '@angular/core';\n\n\n/** Context provided to the tree node component. */\nexport class CdkTreeNodeOutletContext<T> {\n /** Data for the node. */\n $implicit: T;\n\n /** Depth of the node. */\n level: number;\n\n /** Index location of the node. */\n index?: number;\n\n /** Length of the number of total dataNodes. */\n count?: number;\n\n constructor(data: T) {\n this.$implicit = data;\n }\n}\n\n/**\n * Data node definition for the CdkTree.\n * Captures the node's template and a when predicate that describes when this node should be used.\n */\n@Directive({\n selector: '[cdkTreeNodeDef]',\n inputs: [\n 'when: cdkTreeNodeDefWhen'\n ],\n})\nexport class CdkTreeNodeDef<T> {\n /**\n * Function that should return true if this node template should be used for the provided node\n * data and index. If left undefined, this node will be considered the default node template to\n * use when no other when functions return true for the data.\n * For every node, there must be at least one when function that passes or an undefined to\n * default.\n */\n when: (index: number, nodeData: T) => boolean;\n\n /** @docs-private */\n constructor(public template: TemplateRef<any>) {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Returns an error to be thrown when there is no usable data.\n * @docs-private\n */\nexport function getTreeNoValidDataSourceError() {\n return Error(`A valid data source must be provided.`);\n}\n\n/**\n * Returns an error to be thrown when there are multiple nodes that are missing a when function.\n * @docs-private\n */\nexport function getTreeMultipleDefaultNodeDefsError() {\n return Error(`There can only be one default row without a when predicate function.`);\n}\n\n/**\n * Returns an error to be thrown when there are no matching node defs for a particular set of data.\n * @docs-private\n */\nexport function getTreeMissingMatchingNodeDefError() {\n return Error(`Could not find a matching node definition for the provided node data.`);\n}\n\n/**\n * Returns an error to be thrown when there are tree control.\n * @docs-private\n */\nexport function getTreeControlMissingError() {\n return Error(`Could not find a tree control for the tree.`);\n}\n\n/**\n * Returns an error to be thrown when tree control did not implement functions for flat/nested node.\n * @docs-private\n */\nexport function getTreeControlFunctionsMissingError() {\n return Error(`Could not find functions for nested/flat tree in tree control.`);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {FocusableOption} from '@angular/cdk/a11y';\nimport {CollectionViewer, DataSource, isDataSource} from '@angular/cdk/collections';\nimport {\n AfterContentChecked,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Directive,\n ElementRef,\n Input,\n IterableChangeRecord,\n IterableDiffer,\n IterableDiffers,\n OnDestroy,\n OnInit,\n QueryList,\n ViewChild,\n ViewContainerRef,\n ViewEncapsulation,\n TrackByFunction\n} from '@angular/core';\nimport {\n BehaviorSubject,\n Observable,\n of as observableOf,\n Subject,\n Subscription,\n isObservable,\n} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\nimport {TreeControl} from './control/tree-control';\nimport {CdkTreeNodeDef, CdkTreeNodeOutletContext} from './node';\nimport {CdkTreeNodeOutlet} from './outlet';\nimport {\n getTreeControlFunctionsMissingError,\n getTreeControlMissingError,\n getTreeMissingMatchingNodeDefError,\n getTreeMultipleDefaultNodeDefsError,\n getTreeNoValidDataSourceError\n} from './tree-errors';\n\n/**\n * CDK tree component that connects with a data source to retrieve data of type `T` and renders\n * dataNodes with hierarchy. Updates the dataNodes when new data is provided by the data source.\n */\n@Component({\n selector: 'cdk-tree',\n exportAs: 'cdkTree',\n template: `<ng-container cdkTreeNodeOutlet></ng-container>`,\n host: {\n 'class': 'cdk-tree',\n 'role': 'tree',\n },\n encapsulation: ViewEncapsulation.None,\n\n // The \"OnPush\" status for the `CdkTree` component is effectively a noop, so we are removing it.\n // The view for `CdkTree` consists entirely of templates declared in other views. As they are\n // declared elsewhere, they are checked when their declaration points are checked.\n // tslint:disable-next-line:validate-decorators\n changeDetection: ChangeDetectionStrategy.Default\n})\nexport class CdkTree<T> implements AfterContentChecked, CollectionViewer, OnDestroy, OnInit {\n /** Subject that emits when the component has been destroyed. */\n private _onDestroy = new Subject<void>();\n\n /** Differ used to find the changes in the data provided by the data source. */\n private _dataDiffer: IterableDiffer<T>;\n\n /** Stores the node definition that does not have a when predicate. */\n private _defaultNodeDef: CdkTreeNodeDef<T> | null;\n\n /** Data subscription */\n private _dataSubscription: Subscription | null;\n\n /** Level of nodes */\n private _levels: Map<T, number> = new Map<T, number>();\n\n /**\n * Provides a stream containing the latest data array to render. Influenced by the tree's\n * stream of view window (what dataNodes are currently on screen).\n * Data source can be an observable of data array, or a data array to render.\n */\n @Input()\n get dataSource(): DataSource<T> | Observable<T[]> | T[] { return this._dataSource; }\n set dataSource(dataSource: DataSource<T> | Observable<T[]> | T[]) {\n if (this._dataSource !== dataSource) {\n this._switchDataSource(dataSource);\n }\n }\n private _dataSource: DataSource<T> | Observable<T[]> | T[];\n\n /** The tree controller */\n @Input() treeControl: TreeControl<T>;\n\n /**\n * Tracking function that will be used to check the differences in data changes. Used similarly\n * to `ngFor` `trackBy` function. Optimize node operations by identifying a node based on its data\n * relative to the function to know if a node should be added/removed/moved.\n * Accepts a function that takes two parameters, `index` and `item`.\n */\n @Input() trackBy: TrackByFunction<T>;\n\n // Outlets within the tree's template where the dataNodes will be inserted.\n @ViewChild(CdkTreeNodeOutlet, {static: true}) _nodeOutlet: CdkTreeNodeOutlet;\n\n /** The tree node template for the tree */\n @ContentChildren(CdkTreeNodeDef, {\n // We need to use `descendants: true`, because Ivy will no longer match\n // indirect descendants if it's left as false.\n descendants: true\n }) _nodeDefs: QueryList<CdkTreeNodeDef<T>>;\n\n // TODO(tinayuangao): Setup a listener for scrolling, emit the calculated view to viewChange.\n // Remove the MAX_VALUE in viewChange\n /**\n * Stream containing the latest information on what rows are being displayed on screen.\n * Can be used by the data source to as a heuristic of what data should be provided.\n */\n viewChange =\n new BehaviorSubject<{start: number, end: number}>({start: 0, end: Number.MAX_VALUE});\n\n constructor(private _differs: IterableDiffers,\n private _changeDetectorRef: ChangeDetectorRef) {}\n\n ngOnInit() {\n this._dataDiffer = this._differs.find([]).create(this.trackBy);\n if (!this.treeControl) {\n throw getTreeControlMissingError();\n }\n }\n\n ngOnDestroy() {\n this._nodeOutlet.viewContainer.clear();\n\n this._onDestroy.next();\n this._onDestroy.complete();\n\n if (this._dataSource && typeof (this._dataSource as DataSource<T>).disconnect === 'function') {\n (this.dataSource as DataSource<T>).disconnect(this);\n }\n\n if (this._dataSubscription) {\n this._dataSubscription.unsubscribe();\n this._dataSubscription = null;\n }\n }\n\n ngAfterContentChecked() {\n const defaultNodeDefs = this._nodeDefs.filter(def => !def.when);\n if (defaultNodeDefs.length > 1) {\n throw getTreeMultipleDefaultNodeDefsError();\n }\n this._defaultNodeDef = defaultNodeDefs[0];\n\n if (this.dataSource && this._nodeDefs && !this._dataSubscription) {\n this._observeRenderChanges();\n }\n }\n\n\n // TODO(tinayuangao): Work on keyboard traversal and actions, make sure it's working for RTL\n // and nested trees.\n\n /**\n * Switch to the provided data source by resetting the data and unsubscribing from the current\n * render change subscription if one exists. If the data source is null, interpret this by\n * clearing the node outlet. Otherwise start listening for new data.\n */\n private _switchDataSource(dataSource: DataSource<T> | Observable<T[]> | T[]) {\n if (this._dataSource && typeof (this._dataSource as DataSource<T>).disconnect === 'function') {\n (this.dataSource as DataSource<T>).disconnect(this);\n }\n\n if (this._dataSubscription) {\n this._dataSubscription.unsubscribe();\n this._dataSubscription = null;\n }\n\n // Remove the all dataNodes if there is now no data source\n if (!dataSource) {\n this._nodeOutlet.viewContainer.clear();\n }\n\n this._dataSource = dataSource;\n if (this._nodeDefs) {\n this._observeRenderChanges();\n }\n }\n\n /** Set up a subscription for the data provided by the data source. */\n private _observeRenderChanges() {\n let dataStream: Observable<T[] | ReadonlyArray<T>> | undefined;\n\n if (isDataSource(this._dataSource)) {\n dataStream = this._dataSource.connect(this);\n } else if (isObservable(this._dataSource)) {\n dataStream = this._dataSource;\n } else if (Array.isArray(this._dataSource)) {\n dataStream = observableOf(this._dataSource);\n }\n\n if (dataStream) {\n this._dataSubscription = dataStream.pipe(takeUntil(this._onDestroy))\n .subscribe(data => this.renderNodeChanges(data));\n } else {\n throw getTreeNoValidDataSourceError();\n }\n }\n\n /** Check for changes made in the data and render each change (node added/removed/moved). */\n renderNodeChanges(data: T[] | ReadonlyArray<T>, dataDiffer: IterableDiffer<T> = this._dataDiffer,\n viewContainer: ViewContainerRef = this._nodeOutlet.viewContainer,\n parentData?: T) {\n const changes = dataDiffer.diff(data);\n if (!changes) { return; }\n\n changes.forEachOperation((item: IterableChangeRecord<T>,\n adjustedPreviousIndex: number | null,\n currentIndex: number | null) => {\n if (item.previousIndex == null) {\n this.insertNode(data[currentIndex!], currentIndex!, viewContainer, parentData);\n } else if (currentIndex == null) {\n viewContainer.remove(adjustedPreviousIndex!);\n this._levels.delete(item.item);\n } else {\n const view = viewContainer.get(adjustedPreviousIndex!);\n viewContainer.move(view!, currentIndex);\n }\n });\n\n this._changeDetectorRef.detectChanges();\n }\n\n /**\n * Finds the matching node definition that should be used for this node data. If there is only\n * one node definition, it is returned. Otherwise, find the node definition that has a when\n * predicate that returns true with the data. If none return true, return the default node\n * definition.\n */\n _getNodeDef(data: T, i: number): CdkTreeNodeDef<T> {\n if (this._nodeDefs.length === 1) { return this._nodeDefs.first; }\n\n const nodeDef =\n this._nodeDefs.find(def => def.when && def.when(i, data)) || this._defaultNodeDef;\n if (!nodeDef) { throw getTreeMissingMatchingNodeDefError(); }\n\n return nodeDef;\n }\n\n /**\n * Create the embedded view for the data node template and place it in the correct index location\n * within the data node view container.\n */\n insertNode(nodeData: T, index: number, viewContainer?: ViewContainerRef, parentData?: T) {\n const node = this._getNodeDef(nodeData, index);\n\n // Node context that will be provided to created embedded view\n const context = new CdkTreeNodeOutletContext<T>(nodeData);\n\n // If the tree is flat tree, then use the `getLevel` function in flat tree control\n // Otherwise, use the level of parent node.\n if (this.treeControl.getLevel) {\n context.level = this.treeControl.getLevel(nodeData);\n } else if (typeof parentData !== 'undefined' && this._levels.has(parentData)) {\n context.level = this._levels.get(parentData)! + 1;\n } else {\n context.level = 0;\n }\n this._levels.set(nodeData, context.level);\n\n // Use default tree nodeOutlet, or nested node's nodeOutlet\n const container = viewContainer ? viewContainer : this._nodeOutlet.viewContainer;\n container.createEmbeddedView(node.template, context, index);\n\n // Set the data to just created `CdkTreeNode`.\n // The `CdkTreeNode` created from `createEmbeddedView` will be saved in static variable\n // `mostRecentTreeNode`. We get it from static variable and pass the node data to it.\n if (CdkTreeNode.mostRecentTreeNode) {\n CdkTreeNode.mostRecentTreeNode.data = nodeData;\n }\n }\n}\n\n\n/**\n * Tree node for CdkTree. It contains the data in the tree node.\n */\n@Directive({\n selector: 'cdk-tree-node',\n exportAs: 'cdkTreeNode',\n host: {\n '[attr.aria-expanded]': 'isExpanded',\n '[attr.aria-level]': 'role === \"treeitem\" ? level : null',\n '[attr.role]': 'role',\n 'class': 'cdk-tree-node',\n },\n})\nexport class CdkTreeNode<T> implements FocusableOption, OnDestroy {\n /**\n * The most recently created `CdkTreeNode`. We save it in static variable so we can retrieve it\n * in `CdkTree` and set the data to it.\n */\n static mostRecentTreeNode: CdkTreeNode<any> | null = null;\n\n /** Subject that emits when the component has been destroyed. */\n protected _destroyed = new Subject<void>();\n\n /** Emits when the node's data has changed. */\n _dataChanges = new Subject<void>();\n\n /** The tree node's data. */\n get data(): T { return this._data; }\n set data(value: T) {\n if (value !== this._data) {\n this._data = value;\n this._setRoleFromData();\n this._dataChanges.next();\n }\n }\n protected _data: T;\n\n get isExpanded(): boolean {\n return this._tree.treeControl.isExpanded(this._data);\n }\n\n get level(): number {\n return this._tree.treeControl.getLevel ? this._tree.treeControl.getLevel(this._data) : 0;\n }\n\n /**\n * The role of the node should be 'group' if it's an internal node,\n * and 'treeitem' if it's a leaf node.\n */\n @Input() role: 'treeitem' | 'group' = 'treeitem';\n\n constructor(protected _elementRef: ElementRef<HTMLElement>,\n protected _tree: CdkTree<T>) {\n CdkTreeNode.mostRecentTreeNode = this as CdkTreeNode<T>;\n }\n\n ngOnDestroy() {\n // If this is the last tree node being destroyed,\n // clear out the reference to avoid leaking memory.\n if (CdkTreeNode.mostRecentTreeNode === this) {\n CdkTreeNode.mostRecentTreeNode = null;\n }\n\n this._dataChanges.complete();\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** Focuses the menu item. Implements for FocusableOption. */\n focus(): void {\n this._elementRef.nativeElement.focus();\n }\n\n protected _setRoleFromData(): void {\n if (this._tree.treeControl.isExpandable) {\n this.role = this._tree.treeControl.isExpandable(this._data) ? 'group' : 'treeitem';\n } else {\n if (!this._tree.treeControl.getChildren) {\n throw getTreeControlFunctionsMissingError();\n }\n const childrenNodes = this._tree.treeControl.getChildren(this._data);\n if (Array.isArray(childrenNodes)) {\n this._setRoleFromChildren(childrenNodes as T[]);\n } else if (isObservable(childrenNodes)) {\n childrenNodes.pipe(takeUntil(this._destroyed))\n .subscribe(children => this._setRoleFromChildren(children));\n }\n }\n }\n\n protected _setRoleFromChildren(children: T[]) {\n this.role = children && children.length ? 'group' : 'treeitem';\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {\n AfterContentInit,\n ContentChildren,\n Directive,\n ElementRef,\n IterableDiffer,\n IterableDiffers,\n OnDestroy,\n QueryList,\n} from '@angular/core';\nimport {isObservable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\nimport {CDK_TREE_NODE_OUTLET_NODE, CdkTreeNodeOutlet} from './outlet';\nimport {CdkTree, CdkTreeNode} from './tree';\nimport {getTreeControlFunctionsMissingError} from './tree-errors';\n\n/**\n * Nested node is a child of `<cdk-tree>`. It works with nested tree.\n * By using `cdk-nested-tree-node` component in tree node template, children of the parent node will\n * be added in the `cdkTreeNodeOutlet` in tree node template.\n * The children of node will be automatically added to `cdkTreeNodeOutlet`.\n */\n@Directive({\n selector: 'cdk-nested-tree-node',\n exportAs: 'cdkNestedTreeNode',\n host: {\n '[attr.aria-expanded]': 'isExpanded',\n '[attr.role]': 'role',\n 'class': 'cdk-tree-node cdk-nested-tree-node',\n },\n providers: [\n {provide: CdkTreeNode, useExisting: CdkNestedTreeNode},\n {provide: CDK_TREE_NODE_OUTLET_NODE, useExisting: CdkNestedTreeNode}\n ]\n})\nexport class CdkNestedTreeNode<T> extends CdkTreeNode<T> implements AfterContentInit, OnDestroy {\n /** Differ used to find the changes in the data provided by the data source. */\n private _dataDiffer: IterableDiffer<T>;\n\n /** The children data dataNodes of current node. They will be placed in `CdkTreeNodeOutlet`. */\n protected _children: T[];\n\n /** The children node placeholder. */\n @ContentChildren(CdkTreeNodeOutlet, {\n // We need to use `descendants: true`, because Ivy will no longer match\n // indirect descendants if it's left as false.\n descendants: true\n })\n nodeOutlet: QueryList<CdkTreeNodeOutlet>;\n\n constructor(protected _elementRef: ElementRef<HTMLElement>,\n protected _tree: CdkTree<T>,\n protected _differs: IterableDiffers) {\n super(_elementRef, _tree);\n }\n\n ngAfterContentInit() {\n this._dataDiffer = this._differs.find([]).create(this._tree.trackBy);\n if (!this._tree.treeControl.getChildren) {\n throw getTreeControlFunctionsMissingError();\n }\n const childrenNodes = this._tree.treeControl.getChildren(this.data);\n if (Array.isArray(childrenNodes)) {\n this.updateChildrenNodes(childrenNodes as T[]);\n } else if (isObservable(childrenNodes)) {\n childrenNodes.pipe(takeUntil(this._destroyed))\n .subscribe(result => this.updateChildrenNodes(result));\n }\n this.nodeOutlet.changes.pipe(takeUntil(this._destroyed))\n .subscribe(() => this.updateChildrenNodes());\n }\n\n ngOnDestroy() {\n this._clear();\n super.ngOnDestroy();\n }\n\n /** Add children dataNodes to the NodeOutlet */\n protected updateChildrenNodes(children?: T[]): void {\n const outlet = this._getNodeOutlet();\n if (children) {\n this._children = children;\n }\n if (outlet && this._children) {\n const viewContainer = outlet.viewContainer;\n this._tree.renderNodeChanges(this._children, this._dataDiffer, viewContainer, this._data);\n } else {\n // Reset the data differ if there's no children nodes displayed\n this._dataDiffer.diff([]);\n }\n }\n\n /** Clear the children dataNodes. */\n protected _clear(): void {\n const outlet = this._getNodeOutlet();\n if (outlet) {\n outlet.viewContainer.clear();\n this._dataDiffer.diff([]);\n }\n }\n\n /** Gets the outlet for the current node. */\n private _getNodeOutlet() {\n const outlets = this.nodeOutlet;\n\n // Note that since we use `descendants: true` on the query, we have to ensure\n // that we don't pick up the outlet of a child node by accident.\n return outlets && outlets.find(outlet => !outlet._node || outlet._node === this);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directionality} from '@angular/cdk/bidi';\nimport {coerceNumberProperty, NumberInput} from '@angular/cdk/coercion';\nimport {Directive, ElementRef, Input, OnDestroy, Optional, Renderer2} from '@angular/core';\nimport {takeUntil} from 'rxjs/operators';\nimport {Subject} from 'rxjs';\nimport {CdkTree, CdkTreeNode} from './tree';\n\n/** Regex used to split a string on its CSS units. */\nconst cssUnitPattern = /([A-Za-z%]+)$/;\n\n/**\n * Indent for the children tree dataNodes.\n * This directive will add left-padding to the node to show hierarchy.\n */\n@Directive({\n selector: '[cdkTreeNodePadding]',\n})\nexport class CdkTreeNodePadding<T> implements OnDestroy {\n /** Current padding value applied to the element. Used to avoid unnecessarily hitting the DOM. */\n private _currentPadding: string|null;\n\n /** Subject that emits when the component has been destroyed. */\n private _destroyed = new Subject<void>();\n\n /** CSS units used for the indentation value. */\n indentUnits = 'px';\n\n /** The level of depth of the tree node. The padding will be `level * indent` pixels. */\n @Input('cdkTreeNodePadding')\n get level(): number { return this._level; }\n set level(value: number) {\n // Set to null as the fallback value so that _setPadding can fall back to the node level if the\n // consumer set the directive as `cdkTreeNodePadding=\"\"`. We still want to take this value if\n // they set 0 explicitly.\n this._level = coerceNumberProperty(value, null)!;\n this._setPadding();\n }\n _level: number;\n\n /**\n * The indent for each level. Can be a number or a CSS string.\n * Default number 40px from material design menu sub-menu spec.\n */\n @Input('cdkTreeNodePaddingIndent')\n get indent(): number | string { return this._indent; }\n set indent(indent: number | string) {\n let value = indent;\n let units = 'px';\n\n if (typeof indent === 'string') {\n const parts = indent.split(cssUnitPattern);\n value = parts[0];\n units = parts[1] || units;\n }\n\n this.indentUnits = units;\n this._indent = coerceNumberProperty(value);\n this._setPadding();\n }\n _indent: number = 40;\n\n constructor(private _treeNode: CdkTreeNode<T>,\n private _tree: CdkTree<T>,\n private _renderer: Renderer2,\n private _element: ElementRef<HTMLElement>,\n @Optional() private _dir: Directionality) {\n this._setPadding();\n if (_dir) {\n _dir.change.pipe(takeUntil(this._destroyed)).subscribe(() => this._setPadding(true));\n }\n\n // In Ivy the indentation binding might be set before the tree node's data has been added,\n // which means that we'll miss the first render. We have to subscribe to changes in the\n // data to ensure that everything is up to date.\n _treeNode._dataChanges.subscribe(() => this._setPadding());\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** The padding indent value for the tree node. Returns a string with px numbers if not null. */\n _paddingIndent(): string|null {\n const nodeLevel = (this._treeNode.data && this._tree.treeControl.getLevel)\n ? this._tree.treeControl.getLevel(this._treeNode.data)\n : null;\n const level = this._level == null ? nodeLevel : this._level;\n return typeof level === 'number' ? `${level * this._indent}${this.indentUnits}` : null;\n }\n\n _setPadding(forceChange = false) {\n const padding = this._paddingIndent();\n\n if (padding !== this._currentPadding || forceChange) {\n const element = this._element.nativeElement;\n const paddingProp = this._dir && this._dir.value === 'rtl' ? 'paddingRight' : 'paddingLeft';\n const resetProp = paddingProp === 'paddingLeft' ? 'paddingRight' : 'paddingLeft';\n this._renderer.setStyle(element, paddingProp, padding);\n this._renderer.setStyle(element, resetProp, null);\n this._currentPadding = padding;\n }\n }\n\n static ngAcceptInputType_level: NumberInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {Directive, HostListener, Input} from '@angular/core';\n\nimport {CdkTree, CdkTreeNode} from './tree';\n\n/**\n * Node toggle to expand/collapse the node.\n */\n@Directive({selector: '[cdkTreeNodeToggle]'})\nexport class CdkTreeNodeToggle<T> {\n /** Whether expand/collapse the node recursively. */\n @Input('cdkTreeNodeToggleRecursive')\n get recursive(): boolean { return this._recursive; }\n set recursive(value: boolean) { this._recursive = coerceBooleanProperty(value); }\n protected _recursive = false;\n\n constructor(protected _tree: CdkTree<T>,\n protected _treeNode: CdkTreeNode<T>) {}\n\n // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.\n // In Ivy the `host` bindings will be merged when this class is extended, whereas in\n // ViewEngine they're overwritten.\n // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.\n // tslint:disable-next-line:no-host-decorator-in-concrete\n @HostListener('click', ['$event'])\n _toggle(event: Event): void {\n this.recursive\n ? this._tree.treeControl.toggleDescendants(this._treeNode.data)\n : this._tree.treeControl.toggle(this._treeNode.data);\n\n event.stopPropagation();\n }\n\n static ngAcceptInputType_recursive: BooleanInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {FocusMonitor} from '@angular/cdk/a11y';\nimport {NgModule} from '@angular/core';\nimport {CdkTreeNodeOutlet} from './outlet';\nimport {CdkTreeNodePadding} from './padding';\nimport {CdkTreeNodeToggle} from './toggle';\nimport {CdkTree, CdkTreeNode} from './tree';\nimport {CdkTreeNodeDef} from './node';\nimport {CdkNestedTreeNode} from './nested-node';\n\nconst EXPORTED_DECLARATIONS = [\n CdkNestedTreeNode,\n CdkTreeNodeDef,\n CdkTreeNodePadding,\n CdkTreeNodeToggle,\n CdkTree,\n CdkTreeNode,\n CdkTreeNodeOutlet,\n];\n\n@NgModule({\n exports: EXPORTED_DECLARATIONS,\n declarations: EXPORTED_DECLARATIONS,\n providers: [FocusMonitor, CdkTreeNodeDef]\n})\nexport class CdkTreeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"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G,qBAAqB,CAAC,KAAK,CAAC,CAAC,EAAE;;;;;;;;;;IAYjF,OAAO,CAAC,KAAY;QAClB,IAAI,CAAC,SAAS;cACV,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;cAC7D,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAEvD,KAAK,CAAC,eAAe,EAAE,CAAC;KACzB;;;YAvBF,SAAS,SAAC,EAAC,QAAQ,EAAE,qBAAqB,EAAC;;;;YALpC,OAAO;YAAE,WAAW;;;wBAQzB,KAAK,SAAC,4BAA4B;sBAalC,YAAY,SAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;;;IASjC,8CAAiD;;;;;IAnBjD,uCAA6B;;;;;IAEjB,kCAA2B;;;;;IAC3B,sCAAmC;;;;;;;;;MCR3C,qBAAqB,GAAG;IAC5B,iBAAiB;IACjB,cAAc;IACd,kBAAkB;IAClB,iBAAiB;IACjB,OAAO;IACP,WAAW;IACX,iBAAiB;CAClB;AAOD,MAAa,aAAa;;;YALzB,QAAQ,SAAC;gBACR,OAAO,EAAE,qBAAqB;gBAC9B,YAAY,EAAE,qBAAqB;gBACnC,SAAS,EAAE,CAAC,YAAY,EAAE,cAAc,CAAC;aAC1C;;;;;;;;;AC/BD;;GAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"tree.js","sources":["../../../../../../src/cdk/tree/control/base-tree-control.ts","../../../../../../src/cdk/tree/control/flat-tree-control.ts","../../../../../../src/cdk/tree/control/nested-tree-control.ts","../../../../../../src/cdk/tree/control/tree-control.ts","../../../../../../src/cdk/tree/outlet.ts","../../../../../../src/cdk/tree/node.ts","../../../../../../src/cdk/tree/tree-errors.ts","../../../../../../src/cdk/tree/tree.ts","../../../../../../src/cdk/tree/nested-node.ts","../../../../../../src/cdk/tree/padding.ts","../../../../../../src/cdk/tree/toggle.ts","../../../../../../src/cdk/tree/tree-module.ts","../../../../../../src/cdk/tree/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {SelectionModel} from '@angular/cdk/collections';\nimport {Observable} from 'rxjs';\nimport {TreeControl} from './tree-control';\n\n/** Base tree control. It has basic toggle/expand/collapse operations on a single data node. */\nexport abstract class BaseTreeControl<T> implements TreeControl<T> {\n\n /** Gets a list of descendent data nodes of a subtree rooted at given data node recursively. */\n abstract getDescendants(dataNode: T): T[];\n\n /** Expands all data nodes in the tree. */\n abstract expandAll(): void;\n\n /** Saved data node for `expandAll` action. */\n dataNodes: T[];\n\n /** A selection model with multi-selection to track expansion status. */\n expansionModel: SelectionModel<T> = new SelectionModel<T>(true);\n\n /** Get depth of a given data node, return the level number. This is for flat tree node. */\n getLevel: (dataNode: T) => number;\n\n /**\n * Whether the data node is expandable. Returns true if expandable.\n * This is for flat tree node.\n */\n isExpandable: (dataNode: T) => boolean;\n\n /** Gets a stream that emits whenever the given data node's children change. */\n getChildren: (dataNode: T) => (Observable<T[]> | T[] | undefined | null);\n\n /** Toggles one single data node's expanded/collapsed state. */\n toggle(dataNode: T): void {\n this.expansionModel.toggle(dataNode);\n }\n\n /** Expands one single data node. */\n expand(dataNode: T): void {\n this.expansionModel.select(dataNode);\n }\n\n /** Collapses one single data node. */\n collapse(dataNode: T): void {\n this.expansionModel.deselect(dataNode);\n }\n\n /** Whether a given data node is expanded or not. Returns true if the data node is expanded. */\n isExpanded(dataNode: T): boolean {\n return this.expansionModel.isSelected(dataNode);\n }\n\n /** Toggles a subtree rooted at `node` recursively. */\n toggleDescendants(dataNode: T): void {\n this.expansionModel.isSelected(dataNode)\n ? this.collapseDescendants(dataNode)\n : this.expandDescendants(dataNode);\n }\n\n /** Collapse all dataNodes in the tree. */\n collapseAll(): void {\n this.expansionModel.clear();\n }\n\n /** Expands a subtree rooted at given data node recursively. */\n expandDescendants(dataNode: T): void {\n let toBeProcessed = [dataNode];\n toBeProcessed.push(...this.getDescendants(dataNode));\n this.expansionModel.select(...toBeProcessed);\n }\n\n /** Collapses a subtree rooted at given data node recursively. */\n collapseDescendants(dataNode: T): void {\n let toBeProcessed = [dataNode];\n toBeProcessed.push(...this.getDescendants(dataNode));\n this.expansionModel.deselect(...toBeProcessed);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BaseTreeControl} from './base-tree-control';\n\n/** Flat tree control. Able to expand/collapse a subtree recursively for flattened tree. */\nexport class FlatTreeControl<T> extends BaseTreeControl<T> {\n\n /** Construct with flat tree data node functions getLevel and isExpandable. */\n constructor(public getLevel: (dataNode: T) => number,\n public isExpandable: (dataNode: T) => boolean) {\n super();\n }\n\n /**\n * Gets a list of the data node's subtree of descendent data nodes.\n *\n * To make this working, the `dataNodes` of the TreeControl must be flattened tree nodes\n * with correct levels.\n */\n getDescendants(dataNode: T): T[] {\n const startIndex = this.dataNodes.indexOf(dataNode);\n const results: T[] = [];\n\n // Goes through flattened tree nodes in the `dataNodes` array, and get all descendants.\n // The level of descendants of a tree node must be greater than the level of the given\n // tree node.\n // If we reach a node whose level is equal to the level of the tree node, we hit a sibling.\n // If we reach a node whose level is greater than the level of the tree node, we hit a\n // sibling of an ancestor.\n for (let i = startIndex + 1;\n i < this.dataNodes.length && this.getLevel(dataNode) < this.getLevel(this.dataNodes[i]);\n i++) {\n results.push(this.dataNodes[i]);\n }\n return results;\n }\n\n /**\n * Expands all data nodes in the tree.\n *\n * To make this working, the `dataNodes` variable of the TreeControl must be set to all flattened\n * data nodes of the tree.\n */\n expandAll(): void {\n this.expansionModel.select(...this.dataNodes);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {Observable, isObservable} from 'rxjs';\nimport {take, filter} from 'rxjs/operators';\nimport {BaseTreeControl} from './base-tree-control';\n\n/** Nested tree control. Able to expand/collapse a subtree recursively for NestedNode type. */\nexport class NestedTreeControl<T> extends BaseTreeControl<T> {\n\n /** Construct with nested tree function getChildren. */\n constructor(public getChildren: (dataNode: T) => (Observable<T[]> | T[] | undefined | null)) {\n super();\n }\n\n /**\n * Expands all dataNodes in the tree.\n *\n * To make this working, the `dataNodes` variable of the TreeControl must be set to all root level\n * data nodes of the tree.\n */\n expandAll(): void {\n this.expansionModel.clear();\n const allNodes = this.dataNodes.reduce((accumulator: T[], dataNode) =>\n [...accumulator, ...this.getDescendants(dataNode), dataNode], []);\n this.expansionModel.select(...allNodes);\n }\n\n /** Gets a list of descendant dataNodes of a subtree rooted at given data node recursively. */\n getDescendants(dataNode: T): T[] {\n const descendants: T[] = [];\n\n this._getDescendants(descendants, dataNode);\n // Remove the node itself\n return descendants.splice(1);\n }\n\n /** A helper function to get descendants recursively. */\n protected _getDescendants(descendants: T[], dataNode: T): void {\n descendants.push(dataNode);\n const childrenNodes = this.getChildren(dataNode);\n if (Array.isArray(childrenNodes)) {\n childrenNodes.forEach((child: T) => this._getDescendants(descendants, child));\n } else if (isObservable(childrenNodes)) {\n // TypeScript as of version 3.5 doesn't seem to treat `Boolean` like a function that\n // returns a `boolean` specifically in the context of `filter`, so we manually clarify that.\n childrenNodes.pipe(take(1), filter(Boolean as () => boolean))\n .subscribe(children => {\n for (const child of children) {\n this._getDescendants(descendants, child);\n }\n });\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {SelectionModel} from '@angular/cdk/collections';\nimport {Observable} from 'rxjs';\n\n/**\n * Tree control interface. User can implement TreeControl to expand/collapse dataNodes in the tree.\n * The CDKTree will use this TreeControl to expand/collapse a node.\n * User can also use it outside the `<cdk-tree>` to control the expansion status of the tree.\n */\nexport interface TreeControl<T> {\n /** The saved tree nodes data for `expandAll` action. */\n dataNodes: T[];\n\n /** The expansion model */\n expansionModel: SelectionModel<T>;\n\n /** Whether the data node is expanded or collapsed. Return true if it's expanded. */\n isExpanded(dataNode: T): boolean;\n\n /** Get all descendants of a data node */\n getDescendants(dataNode: T): any[];\n\n /** Expand or collapse data node */\n toggle(dataNode: T): void;\n\n /** Expand one data node */\n expand(dataNode: T): void;\n\n /** Collapse one data node */\n collapse(dataNode: T): void;\n\n /** Expand all the dataNodes in the tree */\n expandAll(): void;\n\n /** Collapse all the dataNodes in the tree */\n collapseAll(): void;\n\n /** Toggle a data node by expand/collapse it and all its descendants */\n toggleDescendants(dataNode: T): void;\n\n /** Expand a data node and all its descendants */\n expandDescendants(dataNode: T): void;\n\n /** Collapse a data node and all its descendants */\n collapseDescendants(dataNode: T): void;\n\n /** Get depth of a given data node, return the level number. This is for flat tree node. */\n readonly getLevel: (dataNode: T) => number;\n\n /**\n * Whether the data node is expandable. Returns true if expandable.\n * This is for flat tree node.\n */\n readonly isExpandable: (dataNode: T) => boolean;\n\n /** Gets a stream that emits whenever the given data node's children change. */\n readonly getChildren: (dataNode: T) => Observable<T[]> | T[] | undefined | null;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {\n Directive,\n Inject,\n InjectionToken,\n Optional,\n ViewContainerRef,\n} from '@angular/core';\n\n/**\n * Injection token used to provide a `CdkTreeNode` to its outlet.\n * Used primarily to avoid circular imports.\n * @docs-private\n */\nexport const CDK_TREE_NODE_OUTLET_NODE = new InjectionToken<{}>('CDK_TREE_NODE_OUTLET_NODE');\n\n/**\n * Outlet for nested CdkNode. Put `[cdkTreeNodeOutlet]` on a tag to place children dataNodes\n * inside the outlet.\n */\n@Directive({\n selector: '[cdkTreeNodeOutlet]'\n})\nexport class CdkTreeNodeOutlet {\n constructor(\n public viewContainer: ViewContainerRef,\n @Inject(CDK_TREE_NODE_OUTLET_NODE) @Optional() public _node?: any) {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, TemplateRef} from '@angular/core';\n\n\n/** Context provided to the tree node component. */\nexport class CdkTreeNodeOutletContext<T> {\n /** Data for the node. */\n $implicit: T;\n\n /** Depth of the node. */\n level: number;\n\n /** Index location of the node. */\n index?: number;\n\n /** Length of the number of total dataNodes. */\n count?: number;\n\n constructor(data: T) {\n this.$implicit = data;\n }\n}\n\n/**\n * Data node definition for the CdkTree.\n * Captures the node's template and a when predicate that describes when this node should be used.\n */\n@Directive({\n selector: '[cdkTreeNodeDef]',\n inputs: [\n 'when: cdkTreeNodeDefWhen'\n ],\n})\nexport class CdkTreeNodeDef<T> {\n /**\n * Function that should return true if this node template should be used for the provided node\n * data and index. If left undefined, this node will be considered the default node template to\n * use when no other when functions return true for the data.\n * For every node, there must be at least one when function that passes or an undefined to\n * default.\n */\n when: (index: number, nodeData: T) => boolean;\n\n /** @docs-private */\n constructor(public template: TemplateRef<any>) {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Returns an error to be thrown when there is no usable data.\n * @docs-private\n */\nexport function getTreeNoValidDataSourceError() {\n return Error(`A valid data source must be provided.`);\n}\n\n/**\n * Returns an error to be thrown when there are multiple nodes that are missing a when function.\n * @docs-private\n */\nexport function getTreeMultipleDefaultNodeDefsError() {\n return Error(`There can only be one default row without a when predicate function.`);\n}\n\n/**\n * Returns an error to be thrown when there are no matching node defs for a particular set of data.\n * @docs-private\n */\nexport function getTreeMissingMatchingNodeDefError() {\n return Error(`Could not find a matching node definition for the provided node data.`);\n}\n\n/**\n * Returns an error to be thrown when there are tree control.\n * @docs-private\n */\nexport function getTreeControlMissingError() {\n return Error(`Could not find a tree control for the tree.`);\n}\n\n/**\n * Returns an error to be thrown when tree control did not implement functions for flat/nested node.\n * @docs-private\n */\nexport function getTreeControlFunctionsMissingError() {\n return Error(`Could not find functions for nested/flat tree in tree control.`);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {FocusableOption} from '@angular/cdk/a11y';\nimport {CollectionViewer, DataSource, isDataSource} from '@angular/cdk/collections';\nimport {\n AfterContentChecked,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Directive,\n ElementRef,\n Input,\n IterableChangeRecord,\n IterableDiffer,\n IterableDiffers,\n OnDestroy,\n OnInit,\n QueryList,\n ViewChild,\n ViewContainerRef,\n ViewEncapsulation,\n TrackByFunction\n} from '@angular/core';\nimport {\n BehaviorSubject,\n Observable,\n of as observableOf,\n Subject,\n Subscription,\n isObservable,\n} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\nimport {TreeControl} from './control/tree-control';\nimport {CdkTreeNodeDef, CdkTreeNodeOutletContext} from './node';\nimport {CdkTreeNodeOutlet} from './outlet';\nimport {\n getTreeControlFunctionsMissingError,\n getTreeControlMissingError,\n getTreeMissingMatchingNodeDefError,\n getTreeMultipleDefaultNodeDefsError,\n getTreeNoValidDataSourceError\n} from './tree-errors';\n\n/**\n * CDK tree component that connects with a data source to retrieve data of type `T` and renders\n * dataNodes with hierarchy. Updates the dataNodes when new data is provided by the data source.\n */\n@Component({\n selector: 'cdk-tree',\n exportAs: 'cdkTree',\n template: `<ng-container cdkTreeNodeOutlet></ng-container>`,\n host: {\n 'class': 'cdk-tree',\n 'role': 'tree',\n },\n encapsulation: ViewEncapsulation.None,\n\n // The \"OnPush\" status for the `CdkTree` component is effectively a noop, so we are removing it.\n // The view for `CdkTree` consists entirely of templates declared in other views. As they are\n // declared elsewhere, they are checked when their declaration points are checked.\n // tslint:disable-next-line:validate-decorators\n changeDetection: ChangeDetectionStrategy.Default\n})\nexport class CdkTree<T> implements AfterContentChecked, CollectionViewer, OnDestroy, OnInit {\n /** Subject that emits when the component has been destroyed. */\n private _onDestroy = new Subject<void>();\n\n /** Differ used to find the changes in the data provided by the data source. */\n private _dataDiffer: IterableDiffer<T>;\n\n /** Stores the node definition that does not have a when predicate. */\n private _defaultNodeDef: CdkTreeNodeDef<T> | null;\n\n /** Data subscription */\n private _dataSubscription: Subscription | null;\n\n /** Level of nodes */\n private _levels: Map<T, number> = new Map<T, number>();\n\n /**\n * Provides a stream containing the latest data array to render. Influenced by the tree's\n * stream of view window (what dataNodes are currently on screen).\n * Data source can be an observable of data array, or a data array to render.\n */\n @Input()\n get dataSource(): DataSource<T> | Observable<T[]> | T[] { return this._dataSource; }\n set dataSource(dataSource: DataSource<T> | Observable<T[]> | T[]) {\n if (this._dataSource !== dataSource) {\n this._switchDataSource(dataSource);\n }\n }\n private _dataSource: DataSource<T> | Observable<T[]> | T[];\n\n /** The tree controller */\n @Input() treeControl: TreeControl<T>;\n\n /**\n * Tracking function that will be used to check the differences in data changes. Used similarly\n * to `ngFor` `trackBy` function. Optimize node operations by identifying a node based on its data\n * relative to the function to know if a node should be added/removed/moved.\n * Accepts a function that takes two parameters, `index` and `item`.\n */\n @Input() trackBy: TrackByFunction<T>;\n\n // Outlets within the tree's template where the dataNodes will be inserted.\n @ViewChild(CdkTreeNodeOutlet, {static: true}) _nodeOutlet: CdkTreeNodeOutlet;\n\n /** The tree node template for the tree */\n @ContentChildren(CdkTreeNodeDef, {\n // We need to use `descendants: true`, because Ivy will no longer match\n // indirect descendants if it's left as false.\n descendants: true\n }) _nodeDefs: QueryList<CdkTreeNodeDef<T>>;\n\n // TODO(tinayuangao): Setup a listener for scrolling, emit the calculated view to viewChange.\n // Remove the MAX_VALUE in viewChange\n /**\n * Stream containing the latest information on what rows are being displayed on screen.\n * Can be used by the data source to as a heuristic of what data should be provided.\n */\n viewChange =\n new BehaviorSubject<{start: number, end: number}>({start: 0, end: Number.MAX_VALUE});\n\n constructor(private _differs: IterableDiffers,\n private _changeDetectorRef: ChangeDetectorRef) {}\n\n ngOnInit() {\n this._dataDiffer = this._differs.find([]).create(this.trackBy);\n if (!this.treeControl) {\n throw getTreeControlMissingError();\n }\n }\n\n ngOnDestroy() {\n this._nodeOutlet.viewContainer.clear();\n\n this._onDestroy.next();\n this._onDestroy.complete();\n\n if (this._dataSource && typeof (this._dataSource as DataSource<T>).disconnect === 'function') {\n (this.dataSource as DataSource<T>).disconnect(this);\n }\n\n if (this._dataSubscription) {\n this._dataSubscription.unsubscribe();\n this._dataSubscription = null;\n }\n }\n\n ngAfterContentChecked() {\n const defaultNodeDefs = this._nodeDefs.filter(def => !def.when);\n if (defaultNodeDefs.length > 1) {\n throw getTreeMultipleDefaultNodeDefsError();\n }\n this._defaultNodeDef = defaultNodeDefs[0];\n\n if (this.dataSource && this._nodeDefs && !this._dataSubscription) {\n this._observeRenderChanges();\n }\n }\n\n\n // TODO(tinayuangao): Work on keyboard traversal and actions, make sure it's working for RTL\n // and nested trees.\n\n /**\n * Switch to the provided data source by resetting the data and unsubscribing from the current\n * render change subscription if one exists. If the data source is null, interpret this by\n * clearing the node outlet. Otherwise start listening for new data.\n */\n private _switchDataSource(dataSource: DataSource<T> | Observable<T[]> | T[]) {\n if (this._dataSource && typeof (this._dataSource as DataSource<T>).disconnect === 'function') {\n (this.dataSource as DataSource<T>).disconnect(this);\n }\n\n if (this._dataSubscription) {\n this._dataSubscription.unsubscribe();\n this._dataSubscription = null;\n }\n\n // Remove the all dataNodes if there is now no data source\n if (!dataSource) {\n this._nodeOutlet.viewContainer.clear();\n }\n\n this._dataSource = dataSource;\n if (this._nodeDefs) {\n this._observeRenderChanges();\n }\n }\n\n /** Set up a subscription for the data provided by the data source. */\n private _observeRenderChanges() {\n let dataStream: Observable<T[] | ReadonlyArray<T>> | undefined;\n\n if (isDataSource(this._dataSource)) {\n dataStream = this._dataSource.connect(this);\n } else if (isObservable(this._dataSource)) {\n dataStream = this._dataSource;\n } else if (Array.isArray(this._dataSource)) {\n dataStream = observableOf(this._dataSource);\n }\n\n if (dataStream) {\n this._dataSubscription = dataStream.pipe(takeUntil(this._onDestroy))\n .subscribe(data => this.renderNodeChanges(data));\n } else {\n throw getTreeNoValidDataSourceError();\n }\n }\n\n /** Check for changes made in the data and render each change (node added/removed/moved). */\n renderNodeChanges(data: T[] | ReadonlyArray<T>, dataDiffer: IterableDiffer<T> = this._dataDiffer,\n viewContainer: ViewContainerRef = this._nodeOutlet.viewContainer,\n parentData?: T) {\n const changes = dataDiffer.diff(data);\n if (!changes) { return; }\n\n changes.forEachOperation((item: IterableChangeRecord<T>,\n adjustedPreviousIndex: number | null,\n currentIndex: number | null) => {\n if (item.previousIndex == null) {\n this.insertNode(data[currentIndex!], currentIndex!, viewContainer, parentData);\n } else if (currentIndex == null) {\n viewContainer.remove(adjustedPreviousIndex!);\n this._levels.delete(item.item);\n } else {\n const view = viewContainer.get(adjustedPreviousIndex!);\n viewContainer.move(view!, currentIndex);\n }\n });\n\n this._changeDetectorRef.detectChanges();\n }\n\n /**\n * Finds the matching node definition that should be used for this node data. If there is only\n * one node definition, it is returned. Otherwise, find the node definition that has a when\n * predicate that returns true with the data. If none return true, return the default node\n * definition.\n */\n _getNodeDef(data: T, i: number): CdkTreeNodeDef<T> {\n if (this._nodeDefs.length === 1) { return this._nodeDefs.first; }\n\n const nodeDef =\n this._nodeDefs.find(def => def.when && def.when(i, data)) || this._defaultNodeDef;\n if (!nodeDef) { throw getTreeMissingMatchingNodeDefError(); }\n\n return nodeDef;\n }\n\n /**\n * Create the embedded view for the data node template and place it in the correct index location\n * within the data node view container.\n */\n insertNode(nodeData: T, index: number, viewContainer?: ViewContainerRef, parentData?: T) {\n const node = this._getNodeDef(nodeData, index);\n\n // Node context that will be provided to created embedded view\n const context = new CdkTreeNodeOutletContext<T>(nodeData);\n\n // If the tree is flat tree, then use the `getLevel` function in flat tree control\n // Otherwise, use the level of parent node.\n if (this.treeControl.getLevel) {\n context.level = this.treeControl.getLevel(nodeData);\n } else if (typeof parentData !== 'undefined' && this._levels.has(parentData)) {\n context.level = this._levels.get(parentData)! + 1;\n } else {\n context.level = 0;\n }\n this._levels.set(nodeData, context.level);\n\n // Use default tree nodeOutlet, or nested node's nodeOutlet\n const container = viewContainer ? viewContainer : this._nodeOutlet.viewContainer;\n container.createEmbeddedView(node.template, context, index);\n\n // Set the data to just created `CdkTreeNode`.\n // The `CdkTreeNode` created from `createEmbeddedView` will be saved in static variable\n // `mostRecentTreeNode`. We get it from static variable and pass the node data to it.\n if (CdkTreeNode.mostRecentTreeNode) {\n CdkTreeNode.mostRecentTreeNode.data = nodeData;\n }\n }\n}\n\n\n/**\n * Tree node for CdkTree. It contains the data in the tree node.\n */\n@Directive({\n selector: 'cdk-tree-node',\n exportAs: 'cdkTreeNode',\n host: {\n '[attr.aria-expanded]': 'isExpanded',\n '[attr.aria-level]': 'role === \"treeitem\" ? level : null',\n '[attr.role]': 'role',\n 'class': 'cdk-tree-node',\n },\n})\nexport class CdkTreeNode<T> implements FocusableOption, OnDestroy {\n /**\n * The most recently created `CdkTreeNode`. We save it in static variable so we can retrieve it\n * in `CdkTree` and set the data to it.\n */\n static mostRecentTreeNode: CdkTreeNode<any> | null = null;\n\n /** Subject that emits when the component has been destroyed. */\n protected _destroyed = new Subject<void>();\n\n /** Emits when the node's data has changed. */\n _dataChanges = new Subject<void>();\n\n /** The tree node's data. */\n get data(): T { return this._data; }\n set data(value: T) {\n if (value !== this._data) {\n this._data = value;\n this._setRoleFromData();\n this._dataChanges.next();\n }\n }\n protected _data: T;\n\n get isExpanded(): boolean {\n return this._tree.treeControl.isExpanded(this._data);\n }\n\n get level(): number {\n return this._tree.treeControl.getLevel ? this._tree.treeControl.getLevel(this._data) : 0;\n }\n\n /**\n * The role of the node should be 'group' if it's an internal node,\n * and 'treeitem' if it's a leaf node.\n */\n @Input() role: 'treeitem' | 'group' = 'treeitem';\n\n constructor(protected _elementRef: ElementRef<HTMLElement>,\n protected _tree: CdkTree<T>) {\n CdkTreeNode.mostRecentTreeNode = this as CdkTreeNode<T>;\n }\n\n ngOnDestroy() {\n // If this is the last tree node being destroyed,\n // clear out the reference to avoid leaking memory.\n if (CdkTreeNode.mostRecentTreeNode === this) {\n CdkTreeNode.mostRecentTreeNode = null;\n }\n\n this._dataChanges.complete();\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** Focuses the menu item. Implements for FocusableOption. */\n focus(): void {\n this._elementRef.nativeElement.focus();\n }\n\n protected _setRoleFromData(): void {\n if (this._tree.treeControl.isExpandable) {\n this.role = this._tree.treeControl.isExpandable(this._data) ? 'group' : 'treeitem';\n } else {\n if (!this._tree.treeControl.getChildren) {\n throw getTreeControlFunctionsMissingError();\n }\n const childrenNodes = this._tree.treeControl.getChildren(this._data);\n if (Array.isArray(childrenNodes)) {\n this._setRoleFromChildren(childrenNodes as T[]);\n } else if (isObservable(childrenNodes)) {\n childrenNodes.pipe(takeUntil(this._destroyed))\n .subscribe(children => this._setRoleFromChildren(children));\n }\n }\n }\n\n protected _setRoleFromChildren(children: T[]) {\n this.role = children && children.length ? 'group' : 'treeitem';\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {\n AfterContentInit,\n ContentChildren,\n Directive,\n ElementRef,\n IterableDiffer,\n IterableDiffers,\n OnDestroy,\n QueryList,\n} from '@angular/core';\nimport {isObservable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\nimport {CDK_TREE_NODE_OUTLET_NODE, CdkTreeNodeOutlet} from './outlet';\nimport {CdkTree, CdkTreeNode} from './tree';\nimport {getTreeControlFunctionsMissingError} from './tree-errors';\n\n/**\n * Nested node is a child of `<cdk-tree>`. It works with nested tree.\n * By using `cdk-nested-tree-node` component in tree node template, children of the parent node will\n * be added in the `cdkTreeNodeOutlet` in tree node template.\n * The children of node will be automatically added to `cdkTreeNodeOutlet`.\n */\n@Directive({\n selector: 'cdk-nested-tree-node',\n exportAs: 'cdkNestedTreeNode',\n host: {\n '[attr.aria-expanded]': 'isExpanded',\n '[attr.role]': 'role',\n 'class': 'cdk-tree-node cdk-nested-tree-node',\n },\n providers: [\n {provide: CdkTreeNode, useExisting: CdkNestedTreeNode},\n {provide: CDK_TREE_NODE_OUTLET_NODE, useExisting: CdkNestedTreeNode}\n ]\n})\nexport class CdkNestedTreeNode<T> extends CdkTreeNode<T> implements AfterContentInit, OnDestroy {\n /** Differ used to find the changes in the data provided by the data source. */\n private _dataDiffer: IterableDiffer<T>;\n\n /** The children data dataNodes of current node. They will be placed in `CdkTreeNodeOutlet`. */\n protected _children: T[];\n\n /** The children node placeholder. */\n @ContentChildren(CdkTreeNodeOutlet, {\n // We need to use `descendants: true`, because Ivy will no longer match\n // indirect descendants if it's left as false.\n descendants: true\n })\n nodeOutlet: QueryList<CdkTreeNodeOutlet>;\n\n constructor(protected _elementRef: ElementRef<HTMLElement>,\n protected _tree: CdkTree<T>,\n protected _differs: IterableDiffers) {\n super(_elementRef, _tree);\n }\n\n ngAfterContentInit() {\n this._dataDiffer = this._differs.find([]).create(this._tree.trackBy);\n if (!this._tree.treeControl.getChildren) {\n throw getTreeControlFunctionsMissingError();\n }\n const childrenNodes = this._tree.treeControl.getChildren(this.data);\n if (Array.isArray(childrenNodes)) {\n this.updateChildrenNodes(childrenNodes as T[]);\n } else if (isObservable(childrenNodes)) {\n childrenNodes.pipe(takeUntil(this._destroyed))\n .subscribe(result => this.updateChildrenNodes(result));\n }\n this.nodeOutlet.changes.pipe(takeUntil(this._destroyed))\n .subscribe(() => this.updateChildrenNodes());\n }\n\n ngOnDestroy() {\n this._clear();\n super.ngOnDestroy();\n }\n\n /** Add children dataNodes to the NodeOutlet */\n protected updateChildrenNodes(children?: T[]): void {\n const outlet = this._getNodeOutlet();\n if (children) {\n this._children = children;\n }\n if (outlet && this._children) {\n const viewContainer = outlet.viewContainer;\n this._tree.renderNodeChanges(this._children, this._dataDiffer, viewContainer, this._data);\n } else {\n // Reset the data differ if there's no children nodes displayed\n this._dataDiffer.diff([]);\n }\n }\n\n /** Clear the children dataNodes. */\n protected _clear(): void {\n const outlet = this._getNodeOutlet();\n if (outlet) {\n outlet.viewContainer.clear();\n this._dataDiffer.diff([]);\n }\n }\n\n /** Gets the outlet for the current node. */\n private _getNodeOutlet() {\n const outlets = this.nodeOutlet;\n\n // Note that since we use `descendants: true` on the query, we have to ensure\n // that we don't pick up the outlet of a child node by accident.\n return outlets && outlets.find(outlet => !outlet._node || outlet._node === this);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directionality} from '@angular/cdk/bidi';\nimport {coerceNumberProperty, NumberInput} from '@angular/cdk/coercion';\nimport {Directive, ElementRef, Input, OnDestroy, Optional, Renderer2} from '@angular/core';\nimport {takeUntil} from 'rxjs/operators';\nimport {Subject} from 'rxjs';\nimport {CdkTree, CdkTreeNode} from './tree';\n\n/** Regex used to split a string on its CSS units. */\nconst cssUnitPattern = /([A-Za-z%]+)$/;\n\n/**\n * Indent for the children tree dataNodes.\n * This directive will add left-padding to the node to show hierarchy.\n */\n@Directive({\n selector: '[cdkTreeNodePadding]',\n})\nexport class CdkTreeNodePadding<T> implements OnDestroy {\n /** Current padding value applied to the element. Used to avoid unnecessarily hitting the DOM. */\n private _currentPadding: string|null;\n\n /** Subject that emits when the component has been destroyed. */\n private _destroyed = new Subject<void>();\n\n /** CSS units used for the indentation value. */\n indentUnits = 'px';\n\n /** The level of depth of the tree node. The padding will be `level * indent` pixels. */\n @Input('cdkTreeNodePadding')\n get level(): number { return this._level; }\n set level(value: number) {\n // Set to null as the fallback value so that _setPadding can fall back to the node level if the\n // consumer set the directive as `cdkTreeNodePadding=\"\"`. We still want to take this value if\n // they set 0 explicitly.\n this._level = coerceNumberProperty(value, null)!;\n this._setPadding();\n }\n _level: number;\n\n /**\n * The indent for each level. Can be a number or a CSS string.\n * Default number 40px from material design menu sub-menu spec.\n */\n @Input('cdkTreeNodePaddingIndent')\n get indent(): number | string { return this._indent; }\n set indent(indent: number | string) {\n let value = indent;\n let units = 'px';\n\n if (typeof indent === 'string') {\n const parts = indent.split(cssUnitPattern);\n value = parts[0];\n units = parts[1] || units;\n }\n\n this.indentUnits = units;\n this._indent = coerceNumberProperty(value);\n this._setPadding();\n }\n _indent: number = 40;\n\n constructor(private _treeNode: CdkTreeNode<T>,\n private _tree: CdkTree<T>,\n /**\n * @deprecated _renderer parameter no longer being used. To be removed.\n * @breaking-change 11.0.0\n */\n _renderer: Renderer2,\n private _element: ElementRef<HTMLElement>,\n @Optional() private _dir: Directionality) {\n this._setPadding();\n if (_dir) {\n _dir.change.pipe(takeUntil(this._destroyed)).subscribe(() => this._setPadding(true));\n }\n\n // In Ivy the indentation binding might be set before the tree node's data has been added,\n // which means that we'll miss the first render. We have to subscribe to changes in the\n // data to ensure that everything is up to date.\n _treeNode._dataChanges.subscribe(() => this._setPadding());\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** The padding indent value for the tree node. Returns a string with px numbers if not null. */\n _paddingIndent(): string|null {\n const nodeLevel = (this._treeNode.data && this._tree.treeControl.getLevel)\n ? this._tree.treeControl.getLevel(this._treeNode.data)\n : null;\n const level = this._level == null ? nodeLevel : this._level;\n return typeof level === 'number' ? `${level * this._indent}${this.indentUnits}` : null;\n }\n\n _setPadding(forceChange = false) {\n const padding = this._paddingIndent();\n\n if (padding !== this._currentPadding || forceChange) {\n const element = this._element.nativeElement;\n const paddingProp = this._dir && this._dir.value === 'rtl' ? 'paddingRight' : 'paddingLeft';\n const resetProp = paddingProp === 'paddingLeft' ? 'paddingRight' : 'paddingLeft';\n element.style[paddingProp] = padding || '';\n element.style[resetProp] = '';\n this._currentPadding = padding;\n }\n }\n\n static ngAcceptInputType_level: NumberInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {Directive, HostListener, Input} from '@angular/core';\n\nimport {CdkTree, CdkTreeNode} from './tree';\n\n/**\n * Node toggle to expand/collapse the node.\n */\n@Directive({selector: '[cdkTreeNodeToggle]'})\nexport class CdkTreeNodeToggle<T> {\n /** Whether expand/collapse the node recursively. */\n @Input('cdkTreeNodeToggleRecursive')\n get recursive(): boolean { return this._recursive; }\n set recursive(value: boolean) { this._recursive = coerceBooleanProperty(value); }\n protected _recursive = false;\n\n constructor(protected _tree: CdkTree<T>,\n protected _treeNode: CdkTreeNode<T>) {}\n\n // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.\n // In Ivy the `host` bindings will be merged when this class is extended, whereas in\n // ViewEngine they're overwritten.\n // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.\n // tslint:disable-next-line:no-host-decorator-in-concrete\n @HostListener('click', ['$event'])\n _toggle(event: Event): void {\n this.recursive\n ? this._tree.treeControl.toggleDescendants(this._treeNode.data)\n : this._tree.treeControl.toggle(this._treeNode.data);\n\n event.stopPropagation();\n }\n\n static ngAcceptInputType_recursive: BooleanInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {FocusMonitor} from '@angular/cdk/a11y';\nimport {NgModule} from '@angular/core';\nimport {CdkTreeNodeOutlet} from './outlet';\nimport {CdkTreeNodePadding} from './padding';\nimport {CdkTreeNodeToggle} from './toggle';\nimport {CdkTree, CdkTreeNode} from './tree';\nimport {CdkTreeNodeDef} from './node';\nimport {CdkNestedTreeNode} from './nested-node';\n\nconst EXPORTED_DECLARATIONS = [\n CdkNestedTreeNode,\n CdkTreeNodeDef,\n CdkTreeNodePadding,\n CdkTreeNodeToggle,\n CdkTree,\n CdkTreeNode,\n CdkTreeNodeOutlet,\n];\n\n@NgModule({\n exports: EXPORTED_DECLARATIONS,\n declarations: EXPORTED_DECLARATIONS,\n providers: [FocusMonitor, CdkTreeNodeDef]\n})\nexport class CdkTreeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["observableOf"],"mappings":";;;;;;;;;;;;;;;;;;AAYA,MAAsB,eAAe;IAArC;;;;QAYE,mBAAc,GAAsB,IAAI,cAAc,CAAI,IAAI,CAAC,CAAC;KA2DjE;;;;;;IA5CC,MAAM,CAAC,QAAW;QAChB,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;KACtC;;;;;;IAGD,MAAM,CAAC,QAAW;QAChB,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;KACtC;;;;;;IAGD,QAAQ,CAAC,QAAW;QAClB,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;KACxC;;;;;;IAGD,UAAU,CAAC,QAAW;QACpB,OAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;KACjD;;;;;;IAGD,iBAAiB,CAAC,QAAW;QAC3B,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC;cAClC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC;cAClC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;KACxC;;;;;IAGD,WAAW;QACT,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;KAC7B;;;;;;IAGD,iBAAiB,CAAC,QAAW;;YACvB,aAAa,GAAG,CAAC,QAAQ,CAAC;QAC9B,aAAa,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;QACrD,IAAI,CAAC,cA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692
|
+
* @license
|
|
1693
|
+
* Copyright Google LLC All Rights Reserved.
|
|
1694
|
+
*
|
|
1695
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
1696
|
+
* found in the LICENSE file at https://angular.io/license
|
|
1697
|
+
*/
|
|
1698
|
+
/**
|
|
1699
|
+
* Screenreaders will often fire fake mousedown events when a focusable element
|
|
1700
|
+
* is activated using the keyboard. We can typically distinguish between these faked
|
|
1701
|
+
* mousedown events and real mousedown events using the "buttons" property. While
|
|
1702
|
+
* real mousedowns will indicate the mouse button that was pressed (e.g. "1" for
|
|
1703
|
+
* the left mouse button), faked mousedowns will usually set the property value to 0.
|
|
1704
|
+
*/
|
|
1705
|
+
function isFakeMousedownFromScreenReader(event) {
|
|
1706
|
+
return event.buttons === 0;
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1691
1709
|
/**
|
|
1692
1710
|
* @license
|
|
1693
1711
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -1737,11 +1755,14 @@ var FocusMonitor = /** @class */ (function () {
|
|
|
1737
1755
|
* Event listener for `mousedown` events on the document.
|
|
1738
1756
|
* Needs to be an arrow function in order to preserve the context when it gets bound.
|
|
1739
1757
|
*/
|
|
1740
|
-
this._documentMousedownListener = function () {
|
|
1758
|
+
this._documentMousedownListener = function (event) {
|
|
1741
1759
|
// On mousedown record the origin only if there is not touch
|
|
1742
1760
|
// target, since a mousedown can happen as a result of a touch event.
|
|
1743
1761
|
if (!_this._lastTouchTarget) {
|
|
1744
|
-
|
|
1762
|
+
// In some cases screen readers fire fake `mousedown` events instead of `keydown`.
|
|
1763
|
+
// Resolve the focus source to `keyboard` if we detect one of them.
|
|
1764
|
+
var source = isFakeMousedownFromScreenReader(event) ? 'keyboard' : 'mouse';
|
|
1765
|
+
_this._setOriginForCurrentEventQueue(source);
|
|
1745
1766
|
}
|
|
1746
1767
|
};
|
|
1747
1768
|
/**
|
|
@@ -1771,11 +1792,22 @@ var FocusMonitor = /** @class */ (function () {
|
|
|
1771
1792
|
_this._windowFocused = true;
|
|
1772
1793
|
_this._windowFocusTimeoutId = setTimeout(function () { return _this._windowFocused = false; });
|
|
1773
1794
|
};
|
|
1795
|
+
/**
|
|
1796
|
+
* Event listener for `focus` and 'blur' events on the document.
|
|
1797
|
+
* Needs to be an arrow function in order to preserve the context when it gets bound.
|
|
1798
|
+
*/
|
|
1799
|
+
this._documentFocusAndBlurListener = function (event) {
|
|
1800
|
+
var target = event.target;
|
|
1801
|
+
var handler = event.type === 'focus' ? _this._onFocus : _this._onBlur;
|
|
1802
|
+
// We need to walk up the ancestor chain in order to support `checkChildren`.
|
|
1803
|
+
for (var el = target; el; el = el.parentElement) {
|
|
1804
|
+
handler.call(_this, event, el);
|
|
1805
|
+
}
|
|
1806
|
+
};
|
|
1774
1807
|
this._document = document;
|
|
1775
1808
|
this._detectionMode = (options === null || options === void 0 ? void 0 : options.detectionMode) || 0 /* IMMEDIATE */;
|
|
1776
1809
|
}
|
|
1777
1810
|
FocusMonitor.prototype.monitor = function (element, checkChildren) {
|
|
1778
|
-
var _this = this;
|
|
1779
1811
|
if (checkChildren === void 0) { checkChildren = false; }
|
|
1780
1812
|
// Do nothing if we're not on the browser platform.
|
|
1781
1813
|
if (!this._platform.isBrowser) {
|
|
@@ -1790,31 +1822,17 @@ var FocusMonitor = /** @class */ (function () {
|
|
|
1790
1822
|
}
|
|
1791
1823
|
// Create monitored element info.
|
|
1792
1824
|
var info = {
|
|
1793
|
-
unlisten: function () { },
|
|
1794
1825
|
checkChildren: checkChildren,
|
|
1795
1826
|
subject: new Subject()
|
|
1796
1827
|
};
|
|
1797
1828
|
this._elementInfo.set(nativeElement, info);
|
|
1798
1829
|
this._incrementMonitoredElementCount();
|
|
1799
|
-
// Start listening. We need to listen in capture phase since focus events don't bubble.
|
|
1800
|
-
var focusListener = function (event) { return _this._onFocus(event, nativeElement); };
|
|
1801
|
-
var blurListener = function (event) { return _this._onBlur(event, nativeElement); };
|
|
1802
|
-
this._ngZone.runOutsideAngular(function () {
|
|
1803
|
-
nativeElement.addEventListener('focus', focusListener, true);
|
|
1804
|
-
nativeElement.addEventListener('blur', blurListener, true);
|
|
1805
|
-
});
|
|
1806
|
-
// Create an unlisten function for later.
|
|
1807
|
-
info.unlisten = function () {
|
|
1808
|
-
nativeElement.removeEventListener('focus', focusListener, true);
|
|
1809
|
-
nativeElement.removeEventListener('blur', blurListener, true);
|
|
1810
|
-
};
|
|
1811
1830
|
return info.subject.asObservable();
|
|
1812
1831
|
};
|
|
1813
1832
|
FocusMonitor.prototype.stopMonitoring = function (element) {
|
|
1814
1833
|
var nativeElement = coerceElement(element);
|
|
1815
1834
|
var elementInfo = this._elementInfo.get(nativeElement);
|
|
1816
1835
|
if (elementInfo) {
|
|
1817
|
-
elementInfo.unlisten();
|
|
1818
1836
|
elementInfo.subject.complete();
|
|
1819
1837
|
this._setClasses(nativeElement);
|
|
1820
1838
|
this._elementInfo.delete(nativeElement);
|
|
@@ -1851,20 +1869,37 @@ var FocusMonitor = /** @class */ (function () {
|
|
|
1851
1869
|
element.classList.remove(className);
|
|
1852
1870
|
}
|
|
1853
1871
|
};
|
|
1872
|
+
FocusMonitor.prototype._getFocusOrigin = function (event) {
|
|
1873
|
+
// If we couldn't detect a cause for the focus event, it's due to one of three reasons:
|
|
1874
|
+
// 1) The window has just regained focus, in which case we want to restore the focused state of
|
|
1875
|
+
// the element from before the window blurred.
|
|
1876
|
+
// 2) It was caused by a touch event, in which case we mark the origin as 'touch'.
|
|
1877
|
+
// 3) The element was programmatically focused, in which case we should mark the origin as
|
|
1878
|
+
// 'program'.
|
|
1879
|
+
if (this._origin) {
|
|
1880
|
+
return this._origin;
|
|
1881
|
+
}
|
|
1882
|
+
if (this._windowFocused && this._lastFocusOrigin) {
|
|
1883
|
+
return this._lastFocusOrigin;
|
|
1884
|
+
}
|
|
1885
|
+
else if (this._wasCausedByTouch(event)) {
|
|
1886
|
+
return 'touch';
|
|
1887
|
+
}
|
|
1888
|
+
else {
|
|
1889
|
+
return 'program';
|
|
1890
|
+
}
|
|
1891
|
+
};
|
|
1854
1892
|
/**
|
|
1855
1893
|
* Sets the focus classes on the element based on the given focus origin.
|
|
1856
1894
|
* @param element The element to update the classes on.
|
|
1857
1895
|
* @param origin The focus origin.
|
|
1858
1896
|
*/
|
|
1859
1897
|
FocusMonitor.prototype._setClasses = function (element, origin) {
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
this._toggleClass(element, 'cdk-mouse-focused', origin === 'mouse');
|
|
1866
|
-
this._toggleClass(element, 'cdk-program-focused', origin === 'program');
|
|
1867
|
-
}
|
|
1898
|
+
this._toggleClass(element, 'cdk-focused', !!origin);
|
|
1899
|
+
this._toggleClass(element, 'cdk-touch-focused', origin === 'touch');
|
|
1900
|
+
this._toggleClass(element, 'cdk-keyboard-focused', origin === 'keyboard');
|
|
1901
|
+
this._toggleClass(element, 'cdk-mouse-focused', origin === 'mouse');
|
|
1902
|
+
this._toggleClass(element, 'cdk-program-focused', origin === 'program');
|
|
1868
1903
|
};
|
|
1869
1904
|
/**
|
|
1870
1905
|
* Sets the origin and schedules an async function to clear it at the end of the event queue.
|
|
@@ -1926,24 +1961,7 @@ var FocusMonitor = /** @class */ (function () {
|
|
|
1926
1961
|
if (!elementInfo || (!elementInfo.checkChildren && element !== event.target)) {
|
|
1927
1962
|
return;
|
|
1928
1963
|
}
|
|
1929
|
-
|
|
1930
|
-
// 1) The window has just regained focus, in which case we want to restore the focused state of
|
|
1931
|
-
// the element from before the window blurred.
|
|
1932
|
-
// 2) It was caused by a touch event, in which case we mark the origin as 'touch'.
|
|
1933
|
-
// 3) The element was programmatically focused, in which case we should mark the origin as
|
|
1934
|
-
// 'program'.
|
|
1935
|
-
var origin = this._origin;
|
|
1936
|
-
if (!origin) {
|
|
1937
|
-
if (this._windowFocused && this._lastFocusOrigin) {
|
|
1938
|
-
origin = this._lastFocusOrigin;
|
|
1939
|
-
}
|
|
1940
|
-
else if (this._wasCausedByTouch(event)) {
|
|
1941
|
-
origin = 'touch';
|
|
1942
|
-
}
|
|
1943
|
-
else {
|
|
1944
|
-
origin = 'program';
|
|
1945
|
-
}
|
|
1946
|
-
}
|
|
1964
|
+
var origin = this._getFocusOrigin(event);
|
|
1947
1965
|
this._setClasses(element, origin);
|
|
1948
1966
|
this._emitOrigin(elementInfo.subject, origin);
|
|
1949
1967
|
this._lastFocusOrigin = origin;
|
|
@@ -1976,6 +1994,8 @@ var FocusMonitor = /** @class */ (function () {
|
|
|
1976
1994
|
this._ngZone.runOutsideAngular(function () {
|
|
1977
1995
|
var document = _this._getDocument();
|
|
1978
1996
|
var window = _this._getWindow();
|
|
1997
|
+
document.addEventListener('focus', _this._documentFocusAndBlurListener, captureEventListenerOptions);
|
|
1998
|
+
document.addEventListener('blur', _this._documentFocusAndBlurListener, captureEventListenerOptions);
|
|
1979
1999
|
document.addEventListener('keydown', _this._documentKeydownListener, captureEventListenerOptions);
|
|
1980
2000
|
document.addEventListener('mousedown', _this._documentMousedownListener, captureEventListenerOptions);
|
|
1981
2001
|
document.addEventListener('touchstart', _this._documentTouchstartListener, captureEventListenerOptions);
|
|
@@ -1988,6 +2008,8 @@ var FocusMonitor = /** @class */ (function () {
|
|
|
1988
2008
|
if (!--this._monitoredElementCount) {
|
|
1989
2009
|
var document_1 = this._getDocument();
|
|
1990
2010
|
var window_1 = this._getWindow();
|
|
2011
|
+
document_1.removeEventListener('focus', this._documentFocusAndBlurListener, captureEventListenerOptions);
|
|
2012
|
+
document_1.removeEventListener('blur', this._documentFocusAndBlurListener, captureEventListenerOptions);
|
|
1991
2013
|
document_1.removeEventListener('keydown', this._documentKeydownListener, captureEventListenerOptions);
|
|
1992
2014
|
document_1.removeEventListener('mousedown', this._documentMousedownListener, captureEventListenerOptions);
|
|
1993
2015
|
document_1.removeEventListener('touchstart', this._documentTouchstartListener, captureEventListenerOptions);
|
|
@@ -2049,24 +2071,6 @@ var CdkMonitorFocus = /** @class */ (function () {
|
|
|
2049
2071
|
return CdkMonitorFocus;
|
|
2050
2072
|
}());
|
|
2051
2073
|
|
|
2052
|
-
/**
|
|
2053
|
-
* @license
|
|
2054
|
-
* Copyright Google LLC All Rights Reserved.
|
|
2055
|
-
*
|
|
2056
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
2057
|
-
* found in the LICENSE file at https://angular.io/license
|
|
2058
|
-
*/
|
|
2059
|
-
/**
|
|
2060
|
-
* Screenreaders will often fire fake mousedown events when a focusable element
|
|
2061
|
-
* is activated using the keyboard. We can typically distinguish between these faked
|
|
2062
|
-
* mousedown events and real mousedown events using the "buttons" property. While
|
|
2063
|
-
* real mousedowns will indicate the mouse button that was pressed (e.g. "1" for
|
|
2064
|
-
* the left mouse button), faked mousedowns will usually set the property value to 0.
|
|
2065
|
-
*/
|
|
2066
|
-
function isFakeMousedownFromScreenReader(event) {
|
|
2067
|
-
return event.buttons === 0;
|
|
2068
|
-
}
|
|
2069
|
-
|
|
2070
2074
|
/**
|
|
2071
2075
|
* @license
|
|
2072
2076
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -2110,9 +2114,12 @@ var HighContrastModeDetector = /** @class */ (function () {
|
|
|
2110
2114
|
this._document.body.appendChild(testElement);
|
|
2111
2115
|
// Get the computed style for the background color, collapsing spaces to normalize between
|
|
2112
2116
|
// browsers. Once we get this color, we no longer need the test element. Access the `window`
|
|
2113
|
-
// via the document so we can fake it in tests.
|
|
2114
|
-
|
|
2115
|
-
var
|
|
2117
|
+
// via the document so we can fake it in tests. Note that we have extra null checks, because
|
|
2118
|
+
// this logic will likely run during app bootstrap and throwing can break the entire app.
|
|
2119
|
+
var documentWindow = this._document.defaultView || window;
|
|
2120
|
+
var computedStyle = (documentWindow && documentWindow.getComputedStyle) ?
|
|
2121
|
+
documentWindow.getComputedStyle(testElement) : null;
|
|
2122
|
+
var computedColor = (computedStyle && computedStyle.backgroundColor || '').replace(/ /g, '');
|
|
2116
2123
|
this._document.body.removeChild(testElement);
|
|
2117
2124
|
switch (computedColor) {
|
|
2118
2125
|
case 'rgb(0,0,0)': return 2 /* WHITE_ON_BLACK */;
|