Mr.Combet Webshell
Your IP :
216.73.216.136
Server IP :
103.233.58.157
Server :
Windows NT WIN-4PGF72KEHKB 10.0 build 17763 (Windows Server 2016) AMD64
Server Software :
Microsoft-IIS/10.0
PHP Version :
7.3.25
Add File :
Submit
Add Directory :
Submit
Dir :
C:
/
inetpub
/
wwwroot
/
ActionAidWeb
/
Edit File Name :
10-es5.62d96c69f140ebd4b256.js
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[10],{ /***/ "./node_modules/@angular/cdk/esm5/tree.es5.js": /*!****************************************************!*\ !*** ./node_modules/@angular/cdk/esm5/tree.es5.js ***! \****************************************************/ /*! exports provided: BaseTreeControl, FlatTreeControl, NestedTreeControl, CdkNestedTreeNode, CdkTreeNodeOutletContext, CdkTreeNodeDef, CdkTreeNodePadding, CDK_TREE_NODE_OUTLET_NODE, CdkTreeNodeOutlet, CdkTree, CdkTreeNode, getTreeNoValidDataSourceError, getTreeMultipleDefaultNodeDefsError, getTreeMissingMatchingNodeDefError, getTreeControlMissingError, getTreeControlFunctionsMissingError, CdkTreeModule, CdkTreeNodeToggle */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseTreeControl", function() { return BaseTreeControl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FlatTreeControl", function() { return FlatTreeControl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NestedTreeControl", function() { return NestedTreeControl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkNestedTreeNode", function() { return CdkNestedTreeNode; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTreeNodeOutletContext", function() { return CdkTreeNodeOutletContext; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTreeNodeDef", function() { return CdkTreeNodeDef; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTreeNodePadding", function() { return CdkTreeNodePadding; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CDK_TREE_NODE_OUTLET_NODE", function() { return CDK_TREE_NODE_OUTLET_NODE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTreeNodeOutlet", function() { return CdkTreeNodeOutlet; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTree", function() { return CdkTree; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTreeNode", function() { return CdkTreeNode; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTreeNoValidDataSourceError", function() { return getTreeNoValidDataSourceError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTreeMultipleDefaultNodeDefsError", function() { return getTreeMultipleDefaultNodeDefsError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTreeMissingMatchingNodeDefError", function() { return getTreeMissingMatchingNodeDefError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTreeControlMissingError", function() { return getTreeControlMissingError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTreeControlFunctionsMissingError", function() { return getTreeControlFunctionsMissingError; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTreeModule", function() { return CdkTreeModule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CdkTreeNodeToggle", function() { return CdkTreeNodeToggle; }); /* harmony import */ var _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/cdk/collections */ "./node_modules/@angular/cdk/esm5/collections.es5.js"); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ "./node_modules/@angular/cdk/node_modules/tslib/tslib.es6.js"); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js"); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js"); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js"); /* harmony import */ var _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/cdk/bidi */ "./node_modules/@angular/cdk/esm5/bidi.es5.js"); /* harmony import */ var _angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/cdk/coercion */ "./node_modules/@angular/cdk/esm5/coercion.es5.js"); /* harmony import */ var _angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/cdk/a11y */ "./node_modules/@angular/cdk/esm5/a11y.es5.js"); /* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js"); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Base tree control. It has basic toggle/expand/collapse operations on a single data node. * @abstract * @template T */ var /** * Base tree control. It has basic toggle/expand/collapse operations on a single data node. * @abstract * @template T */ BaseTreeControl = /** @class */ (function () { function BaseTreeControl() { /** * A selection model with multi-selection to track expansion status. */ this.expansionModel = new _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_0__["SelectionModel"](true); } /** Toggles one single data node's expanded/collapsed state. */ /** * Toggles one single data node's expanded/collapsed state. * @param {?} dataNode * @return {?} */ BaseTreeControl.prototype.toggle = /** * Toggles one single data node's expanded/collapsed state. * @param {?} dataNode * @return {?} */ function (dataNode) { this.expansionModel.toggle(dataNode); }; /** Expands one single data node. */ /** * Expands one single data node. * @param {?} dataNode * @return {?} */ BaseTreeControl.prototype.expand = /** * Expands one single data node. * @param {?} dataNode * @return {?} */ function (dataNode) { this.expansionModel.select(dataNode); }; /** Collapses one single data node. */ /** * Collapses one single data node. * @param {?} dataNode * @return {?} */ BaseTreeControl.prototype.collapse = /** * Collapses one single data node. * @param {?} dataNode * @return {?} */ function (dataNode) { this.expansionModel.deselect(dataNode); }; /** Whether a given data node is expanded or not. Returns true if the data node is expanded. */ /** * Whether a given data node is expanded or not. Returns true if the data node is expanded. * @param {?} dataNode * @return {?} */ BaseTreeControl.prototype.isExpanded = /** * Whether a given data node is expanded or not. Returns true if the data node is expanded. * @param {?} dataNode * @return {?} */ function (dataNode) { return this.expansionModel.isSelected(dataNode); }; /** Toggles a subtree rooted at `node` recursively. */ /** * Toggles a subtree rooted at `node` recursively. * @param {?} dataNode * @return {?} */ BaseTreeControl.prototype.toggleDescendants = /** * Toggles a subtree rooted at `node` recursively. * @param {?} dataNode * @return {?} */ function (dataNode) { this.expansionModel.isSelected(dataNode) ? this.collapseDescendants(dataNode) : this.expandDescendants(dataNode); }; /** Collapse all dataNodes in the tree. */ /** * Collapse all dataNodes in the tree. * @return {?} */ BaseTreeControl.prototype.collapseAll = /** * Collapse all dataNodes in the tree. * @return {?} */ function () { this.expansionModel.clear(); }; /** Expands a subtree rooted at given data node recursively. */ /** * Expands a subtree rooted at given data node recursively. * @param {?} dataNode * @return {?} */ BaseTreeControl.prototype.expandDescendants = /** * Expands a subtree rooted at given data node recursively. * @param {?} dataNode * @return {?} */ function (dataNode) { var _a; /** @type {?} */ var toBeProcessed = [dataNode]; toBeProcessed.push.apply(toBeProcessed, this.getDescendants(dataNode)); (_a = this.expansionModel).select.apply(_a, toBeProcessed); }; /** Collapses a subtree rooted at given data node recursively. */ /** * Collapses a subtree rooted at given data node recursively. * @param {?} dataNode * @return {?} */ BaseTreeControl.prototype.collapseDescendants = /** * Collapses a subtree rooted at given data node recursively. * @param {?} dataNode * @return {?} */ function (dataNode) { var _a; /** @type {?} */ var toBeProcessed = [dataNode]; toBeProcessed.push.apply(toBeProcessed, this.getDescendants(dataNode)); (_a = this.expansionModel).deselect.apply(_a, toBeProcessed); }; return BaseTreeControl; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Flat tree control. Able to expand/collapse a subtree recursively for flattened tree. * @template T */ var /** * Flat tree control. Able to expand/collapse a subtree recursively for flattened tree. * @template T */ FlatTreeControl = /** @class */ (function (_super) { Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(FlatTreeControl, _super); /** Construct with flat tree data node functions getLevel and isExpandable. */ function FlatTreeControl(getLevel, isExpandable) { var _this = _super.call(this) || this; _this.getLevel = getLevel; _this.isExpandable = isExpandable; return _this; } /** * Gets a list of the data node's subtree of descendent data nodes. * * To make this working, the `dataNodes` of the TreeControl must be flattened tree nodes * with correct levels. */ /** * Gets a list of the data node's subtree of descendent data nodes. * * To make this working, the `dataNodes` of the TreeControl must be flattened tree nodes * with correct levels. * @param {?} dataNode * @return {?} */ FlatTreeControl.prototype.getDescendants = /** * Gets a list of the data node's subtree of descendent data nodes. * * To make this working, the `dataNodes` of the TreeControl must be flattened tree nodes * with correct levels. * @param {?} dataNode * @return {?} */ function (dataNode) { /** @type {?} */ var startIndex = this.dataNodes.indexOf(dataNode); /** @type {?} */ var results = []; // Goes through flattened tree nodes in the `dataNodes` array, and get all descendants. // The level of descendants of a tree node must be greater than the level of the given // tree node. // If we reach a node whose level is equal to the level of the tree node, we hit a sibling. // If we reach a node whose level is greater than the level of the tree node, we hit a // sibling of an ancestor. for (var i = startIndex + 1; i < this.dataNodes.length && this.getLevel(dataNode) < this.getLevel(this.dataNodes[i]); i++) { results.push(this.dataNodes[i]); } return results; }; /** * Expands all data nodes in the tree. * * To make this working, the `dataNodes` variable of the TreeControl must be set to all flattened * data nodes of the tree. */ /** * Expands all data nodes in the tree. * * To make this working, the `dataNodes` variable of the TreeControl must be set to all flattened * data nodes of the tree. * @return {?} */ FlatTreeControl.prototype.expandAll = /** * Expands all data nodes in the tree. * * To make this working, the `dataNodes` variable of the TreeControl must be set to all flattened * data nodes of the tree. * @return {?} */ function () { var _a; (_a = this.expansionModel).select.apply(_a, this.dataNodes); }; return FlatTreeControl; }(BaseTreeControl)); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Nested tree control. Able to expand/collapse a subtree recursively for NestedNode type. * @template T */ var /** * Nested tree control. Able to expand/collapse a subtree recursively for NestedNode type. * @template T */ NestedTreeControl = /** @class */ (function (_super) { Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(NestedTreeControl, _super); /** Construct with nested tree function getChildren. */ function NestedTreeControl(getChildren) { var _this = _super.call(this) || this; _this.getChildren = getChildren; return _this; } /** * Expands all dataNodes in the tree. * * To make this working, the `dataNodes` variable of the TreeControl must be set to all root level * data nodes of the tree. */ /** * Expands all dataNodes in the tree. * * To make this working, the `dataNodes` variable of the TreeControl must be set to all root level * data nodes of the tree. * @return {?} */ NestedTreeControl.prototype.expandAll = /** * Expands all dataNodes in the tree. * * To make this working, the `dataNodes` variable of the TreeControl must be set to all root level * data nodes of the tree. * @return {?} */ function () { var _this = this; var _a; this.expansionModel.clear(); /** @type {?} */ var allNodes = this.dataNodes.reduce((/** * @param {?} accumulator * @param {?} dataNode * @return {?} */ function (accumulator, dataNode) { return accumulator.concat(_this.getDescendants(dataNode), [dataNode]); }), []); (_a = this.expansionModel).select.apply(_a, allNodes); }; /** Gets a list of descendant dataNodes of a subtree rooted at given data node recursively. */ /** * Gets a list of descendant dataNodes of a subtree rooted at given data node recursively. * @param {?} dataNode * @return {?} */ NestedTreeControl.prototype.getDescendants = /** * Gets a list of descendant dataNodes of a subtree rooted at given data node recursively. * @param {?} dataNode * @return {?} */ function (dataNode) { /** @type {?} */ var descendants = []; this._getDescendants(descendants, dataNode); // Remove the node itself return descendants.splice(1); }; /** A helper function to get descendants recursively. */ /** * A helper function to get descendants recursively. * @protected * @param {?} descendants * @param {?} dataNode * @return {?} */ NestedTreeControl.prototype._getDescendants = /** * A helper function to get descendants recursively. * @protected * @param {?} descendants * @param {?} dataNode * @return {?} */ function (descendants, dataNode) { var _this = this; descendants.push(dataNode); /** @type {?} */ var childrenNodes = this.getChildren(dataNode); if (Array.isArray(childrenNodes)) { childrenNodes.forEach((/** * @param {?} child * @return {?} */ function (child) { return _this._getDescendants(descendants, child); })); } else if (childrenNodes instanceof rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"]) { // TypeScript as of version 3.5 doesn't seem to treat `Boolean` like a function that // returns a `boolean` specifically in the context of `filter`, so we manually clarify that. childrenNodes.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["take"])(1), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["filter"])((/** @type {?} */ (Boolean)))) .subscribe((/** * @param {?} children * @return {?} */ function (children) { for (var _i = 0, children_1 = children; _i < children_1.length; _i++) { var child = children_1[_i]; _this._getDescendants(descendants, child); } })); } }; return NestedTreeControl; }(BaseTreeControl)); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Injection token used to provide a `CdkTreeNode` to its outlet. * Used primarily to avoid circular imports. * \@docs-private * @type {?} */ var CDK_TREE_NODE_OUTLET_NODE = new _angular_core__WEBPACK_IMPORTED_MODULE_4__["InjectionToken"]('CDK_TREE_NODE_OUTLET_NODE'); /** * Outlet for nested CdkNode. Put `[cdkTreeNodeOutlet]` on a tag to place children dataNodes * inside the outlet. */ var CdkTreeNodeOutlet = /** @class */ (function () { function CdkTreeNodeOutlet(viewContainer, _node) { this.viewContainer = viewContainer; this._node = _node; } CdkTreeNodeOutlet.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Directive"], args: [{ selector: '[cdkTreeNodeOutlet]' },] }, ]; /** @nocollapse */ CdkTreeNodeOutlet.ctorParameters = function () { return [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ViewContainerRef"] }, { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Inject"], args: [CDK_TREE_NODE_OUTLET_NODE,] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Optional"] }] } ]; }; return CdkTreeNodeOutlet; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Context provided to the tree node component. * @template T */ var /** * Context provided to the tree node component. * @template T */ CdkTreeNodeOutletContext = /** @class */ (function () { function CdkTreeNodeOutletContext(data) { this.$implicit = data; } return CdkTreeNodeOutletContext; }()); /** * Data node definition for the CdkTree. * Captures the node's template and a when predicate that describes when this node should be used. * @template T */ var CdkTreeNodeDef = /** @class */ (function () { /** @docs-private */ function CdkTreeNodeDef(template) { this.template = template; } CdkTreeNodeDef.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Directive"], args: [{ selector: '[cdkTreeNodeDef]', inputs: [ 'when: cdkTreeNodeDefWhen' ], },] }, ]; /** @nocollapse */ CdkTreeNodeDef.ctorParameters = function () { return [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["TemplateRef"] } ]; }; return CdkTreeNodeDef; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Returns an error to be thrown when there is no usable data. * \@docs-private * @return {?} */ function getTreeNoValidDataSourceError() { return Error("A valid data source must be provided."); } /** * Returns an error to be thrown when there are multiple nodes that are missing a when function. * \@docs-private * @return {?} */ function getTreeMultipleDefaultNodeDefsError() { return Error("There can only be one default row without a when predicate function."); } /** * Returns an error to be thrown when there are no matching node defs for a particular set of data. * \@docs-private * @return {?} */ function getTreeMissingMatchingNodeDefError() { return Error("Could not find a matching node definition for the provided node data."); } /** * Returns an error to be thrown when there are tree control. * \@docs-private * @return {?} */ function getTreeControlMissingError() { return Error("Could not find a tree control for the tree."); } /** * Returns an error to be thrown when tree control did not implement functions for flat/nested node. * \@docs-private * @return {?} */ function getTreeControlFunctionsMissingError() { return Error("Could not find functions for nested/flat tree in tree control."); } /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * CDK tree component that connects with a data source to retrieve data of type `T` and renders * dataNodes with hierarchy. Updates the dataNodes when new data is provided by the data source. * @template T */ var CdkTree = /** @class */ (function () { function CdkTree(_differs, _changeDetectorRef) { this._differs = _differs; this._changeDetectorRef = _changeDetectorRef; /** * Subject that emits when the component has been destroyed. */ this._onDestroy = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"](); /** * Level of nodes */ this._levels = new Map(); // TODO(tinayuangao): Setup a listener for scrolling, emit the calculated view to viewChange. // Remove the MAX_VALUE in viewChange /** * Stream containing the latest information on what rows are being displayed on screen. * Can be used by the data source to as a heuristic of what data should be provided. */ this.viewChange = new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"]({ start: 0, end: Number.MAX_VALUE }); } Object.defineProperty(CdkTree.prototype, "dataSource", { /** * Provides a stream containing the latest data array to render. Influenced by the tree's * stream of view window (what dataNodes are currently on screen). * Data source can be an observable of data array, or a data array to render. */ get: /** * Provides a stream containing the latest data array to render. Influenced by the tree's * stream of view window (what dataNodes are currently on screen). * Data source can be an observable of data array, or a data array to render. * @return {?} */ function () { return this._dataSource; }, set: /** * @param {?} dataSource * @return {?} */ function (dataSource) { if (this._dataSource !== dataSource) { this._switchDataSource(dataSource); } }, enumerable: true, configurable: true }); /** * @return {?} */ CdkTree.prototype.ngOnInit = /** * @return {?} */ function () { this._dataDiffer = this._differs.find([]).create(this.trackBy); if (!this.treeControl) { throw getTreeControlMissingError(); } }; /** * @return {?} */ CdkTree.prototype.ngOnDestroy = /** * @return {?} */ function () { this._nodeOutlet.viewContainer.clear(); this._onDestroy.next(); this._onDestroy.complete(); if (this._dataSource && typeof ((/** @type {?} */ (this._dataSource))).disconnect === 'function') { ((/** @type {?} */ (this.dataSource))).disconnect(this); } if (this._dataSubscription) { this._dataSubscription.unsubscribe(); this._dataSubscription = null; } }; /** * @return {?} */ CdkTree.prototype.ngAfterContentChecked = /** * @return {?} */ function () { /** @type {?} */ var defaultNodeDefs = this._nodeDefs.filter((/** * @param {?} def * @return {?} */ function (def) { return !def.when; })); if (defaultNodeDefs.length > 1) { throw getTreeMultipleDefaultNodeDefsError(); } this._defaultNodeDef = defaultNodeDefs[0]; if (this.dataSource && this._nodeDefs && !this._dataSubscription) { this._observeRenderChanges(); } }; // TODO(tinayuangao): Work on keyboard traversal and actions, make sure it's working for RTL // and nested trees. /** * Switch to the provided data source by resetting the data and unsubscribing from the current * render change subscription if one exists. If the data source is null, interpret this by * clearing the node outlet. Otherwise start listening for new data. */ // TODO(tinayuangao): Work on keyboard traversal and actions, make sure it's working for RTL // and nested trees. /** * Switch to the provided data source by resetting the data and unsubscribing from the current * render change subscription if one exists. If the data source is null, interpret this by * clearing the node outlet. Otherwise start listening for new data. * @private * @param {?} dataSource * @return {?} */ CdkTree.prototype._switchDataSource = // TODO(tinayuangao): Work on keyboard traversal and actions, make sure it's working for RTL // and nested trees. /** * Switch to the provided data source by resetting the data and unsubscribing from the current * render change subscription if one exists. If the data source is null, interpret this by * clearing the node outlet. Otherwise start listening for new data. * @private * @param {?} dataSource * @return {?} */ function (dataSource) { if (this._dataSource && typeof ((/** @type {?} */ (this._dataSource))).disconnect === 'function') { ((/** @type {?} */ (this.dataSource))).disconnect(this); } if (this._dataSubscription) { this._dataSubscription.unsubscribe(); this._dataSubscription = null; } // Remove the all dataNodes if there is now no data source if (!dataSource) { this._nodeOutlet.viewContainer.clear(); } this._dataSource = dataSource; if (this._nodeDefs) { this._observeRenderChanges(); } }; /** Set up a subscription for the data provided by the data source. */ /** * Set up a subscription for the data provided by the data source. * @private * @return {?} */ CdkTree.prototype._observeRenderChanges = /** * Set up a subscription for the data provided by the data source. * @private * @return {?} */ function () { var _this = this; /** @type {?} */ var dataStream; if (Object(_angular_cdk_collections__WEBPACK_IMPORTED_MODULE_0__["isDataSource"])(this._dataSource)) { dataStream = this._dataSource.connect(this); } else if (this._dataSource instanceof rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"]) { dataStream = this._dataSource; } else if (Array.isArray(this._dataSource)) { dataStream = Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(this._dataSource); } if (dataStream) { this._dataSubscription = dataStream.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["takeUntil"])(this._onDestroy)) .subscribe((/** * @param {?} data * @return {?} */ function (data) { return _this.renderNodeChanges(data); })); } else { throw getTreeNoValidDataSourceError(); } }; /** Check for changes made in the data and render each change (node added/removed/moved). */ /** * Check for changes made in the data and render each change (node added/removed/moved). * @param {?} data * @param {?=} dataDiffer * @param {?=} viewContainer * @param {?=} parentData * @return {?} */ CdkTree.prototype.renderNodeChanges = /** * Check for changes made in the data and render each change (node added/removed/moved). * @param {?} data * @param {?=} dataDiffer * @param {?=} viewContainer * @param {?=} parentData * @return {?} */ function (data, dataDiffer, viewContainer, parentData) { var _this = this; if (dataDiffer === void 0) { dataDiffer = this._dataDiffer; } if (viewContainer === void 0) { viewContainer = this._nodeOutlet.viewContainer; } /** @type {?} */ var changes = dataDiffer.diff(data); if (!changes) { return; } changes.forEachOperation((/** * @param {?} item * @param {?} adjustedPreviousIndex * @param {?} currentIndex * @return {?} */ function (item, adjustedPreviousIndex, currentIndex) { if (item.previousIndex == null) { _this.insertNode(data[(/** @type {?} */ (currentIndex))], (/** @type {?} */ (currentIndex)), viewContainer, parentData); } else if (currentIndex == null) { viewContainer.remove((/** @type {?} */ (adjustedPreviousIndex))); _this._levels.delete(item.item); } else { /** @type {?} */ var view = viewContainer.get((/** @type {?} */ (adjustedPreviousIndex))); viewContainer.move((/** @type {?} */ (view)), currentIndex); } })); this._changeDetectorRef.detectChanges(); }; /** * Finds the matching node definition that should be used for this node data. If there is only * one node definition, it is returned. Otherwise, find the node definition that has a when * predicate that returns true with the data. If none return true, return the default node * definition. */ /** * Finds the matching node definition that should be used for this node data. If there is only * one node definition, it is returned. Otherwise, find the node definition that has a when * predicate that returns true with the data. If none return true, return the default node * definition. * @param {?} data * @param {?} i * @return {?} */ CdkTree.prototype._getNodeDef = /** * Finds the matching node definition that should be used for this node data. If there is only * one node definition, it is returned. Otherwise, find the node definition that has a when * predicate that returns true with the data. If none return true, return the default node * definition. * @param {?} data * @param {?} i * @return {?} */ function (data, i) { if (this._nodeDefs.length === 1) { return this._nodeDefs.first; } /** @type {?} */ var nodeDef = this._nodeDefs.find((/** * @param {?} def * @return {?} */ function (def) { return def.when && def.when(i, data); })) || this._defaultNodeDef; if (!nodeDef) { throw getTreeMissingMatchingNodeDefError(); } return nodeDef; }; /** * Create the embedded view for the data node template and place it in the correct index location * within the data node view container. */ /** * Create the embedded view for the data node template and place it in the correct index location * within the data node view container. * @param {?} nodeData * @param {?} index * @param {?=} viewContainer * @param {?=} parentData * @return {?} */ CdkTree.prototype.insertNode = /** * Create the embedded view for the data node template and place it in the correct index location * within the data node view container. * @param {?} nodeData * @param {?} index * @param {?=} viewContainer * @param {?=} parentData * @return {?} */ function (nodeData, index, viewContainer, parentData) { /** @type {?} */ var node = this._getNodeDef(nodeData, index); // Node context that will be provided to created embedded view /** @type {?} */ var context = new CdkTreeNodeOutletContext(nodeData); // If the tree is flat tree, then use the `getLevel` function in flat tree control // Otherwise, use the level of parent node. if (this.treeControl.getLevel) { context.level = this.treeControl.getLevel(nodeData); } else if (typeof parentData !== 'undefined' && this._levels.has(parentData)) { context.level = (/** @type {?} */ (this._levels.get(parentData))) + 1; } else { context.level = 0; } this._levels.set(nodeData, context.level); // Use default tree nodeOutlet, or nested node's nodeOutlet /** @type {?} */ var container = viewContainer ? viewContainer : this._nodeOutlet.viewContainer; container.createEmbeddedView(node.template, context, index); // Set the data to just created `CdkTreeNode`. // The `CdkTreeNode` created from `createEmbeddedView` will be saved in static variable // `mostRecentTreeNode`. We get it from static variable and pass the node data to it. if (CdkTreeNode.mostRecentTreeNode) { CdkTreeNode.mostRecentTreeNode.data = nodeData; } }; CdkTree.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Component"], args: [{selector: 'cdk-tree', exportAs: 'cdkTree', template: "<ng-container cdkTreeNodeOutlet></ng-container>", host: { 'class': 'cdk-tree', 'role': 'tree', }, encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ViewEncapsulation"].None, // The "OnPush" status for the `CdkTree` component is effectively a noop, so we are removing it. // The view for `CdkTree` consists entirely of templates declared in other views. As they are // declared elsewhere, they are checked when their declaration points are checked. // tslint:disable-next-line:validate-decorators changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ChangeDetectionStrategy"].Default },] }, ]; /** @nocollapse */ CdkTree.ctorParameters = function () { return [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["IterableDiffers"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ChangeDetectorRef"] } ]; }; CdkTree.propDecorators = { dataSource: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] }], treeControl: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] }], trackBy: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] }], _nodeOutlet: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ViewChild"], args: [CdkTreeNodeOutlet, { static: true },] }], _nodeDefs: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ContentChildren"], args: [CdkTreeNodeDef,] }] }; return CdkTree; }()); /** * Tree node for CdkTree. It contains the data in the tree node. * @template T */ var CdkTreeNode = /** @class */ (function () { function CdkTreeNode(_elementRef, _tree) { this._elementRef = _elementRef; this._tree = _tree; /** * Subject that emits when the component has been destroyed. */ this._destroyed = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"](); /** * Emits when the node's data has changed. */ this._dataChanges = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"](); /** * The role of the node should be 'group' if it's an internal node, * and 'treeitem' if it's a leaf node. */ this.role = 'treeitem'; CdkTreeNode.mostRecentTreeNode = (/** @type {?} */ (this)); } Object.defineProperty(CdkTreeNode.prototype, "data", { /** The tree node's data. */ get: /** * The tree node's data. * @return {?} */ function () { return this._data; }, set: /** * @param {?} value * @return {?} */ function (value) { if (value !== this._data) { this._data = value; this._setRoleFromData(); this._dataChanges.next(); } }, enumerable: true, configurable: true }); Object.defineProperty(CdkTreeNode.prototype, "isExpanded", { get: /** * @return {?} */ function () { return this._tree.treeControl.isExpanded(this._data); }, enumerable: true, configurable: true }); Object.defineProperty(CdkTreeNode.prototype, "level", { get: /** * @return {?} */ function () { return this._tree.treeControl.getLevel ? this._tree.treeControl.getLevel(this._data) : 0; }, enumerable: true, configurable: true }); /** * @return {?} */ CdkTreeNode.prototype.ngOnDestroy = /** * @return {?} */ function () { // If this is the last tree node being destroyed, // clear out the reference to avoid leaking memory. if (CdkTreeNode.mostRecentTreeNode === this) { CdkTreeNode.mostRecentTreeNode = null; } this._dataChanges.complete(); this._destroyed.next(); this._destroyed.complete(); }; /** Focuses the menu item. Implements for FocusableOption. */ /** * Focuses the menu item. Implements for FocusableOption. * @return {?} */ CdkTreeNode.prototype.focus = /** * Focuses the menu item. Implements for FocusableOption. * @return {?} */ function () { this._elementRef.nativeElement.focus(); }; /** * @protected * @return {?} */ CdkTreeNode.prototype._setRoleFromData = /** * @protected * @return {?} */ function () { var _this = this; if (this._tree.treeControl.isExpandable) { this.role = this._tree.treeControl.isExpandable(this._data) ? 'group' : 'treeitem'; } else { if (!this._tree.treeControl.getChildren) { throw getTreeControlFunctionsMissingError(); } /** @type {?} */ var childrenNodes = this._tree.treeControl.getChildren(this._data); if (Array.isArray(childrenNodes)) { this._setRoleFromChildren((/** @type {?} */ (childrenNodes))); } else if (childrenNodes instanceof rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"]) { childrenNodes.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["takeUntil"])(this._destroyed)) .subscribe((/** * @param {?} children * @return {?} */ function (children) { return _this._setRoleFromChildren(children); })); } } }; /** * @protected * @param {?} children * @return {?} */ CdkTreeNode.prototype._setRoleFromChildren = /** * @protected * @param {?} children * @return {?} */ function (children) { this.role = children && children.length ? 'group' : 'treeitem'; }; /** * The most recently created `CdkTreeNode`. We save it in static variable so we can retrieve it * in `CdkTree` and set the data to it. */ CdkTreeNode.mostRecentTreeNode = null; CdkTreeNode.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Directive"], args: [{ selector: 'cdk-tree-node', exportAs: 'cdkTreeNode', host: { '[attr.aria-expanded]': 'isExpanded', '[attr.aria-level]': 'role === "treeitem" ? level : null', '[attr.role]': 'role', 'class': 'cdk-tree-node', }, },] }, ]; /** @nocollapse */ CdkTreeNode.ctorParameters = function () { return [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ElementRef"] }, { type: CdkTree } ]; }; CdkTreeNode.propDecorators = { role: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"] }] }; return CdkTreeNode; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Nested node is a child of `<cdk-tree>`. It works with nested tree. * By using `cdk-nested-tree-node` component in tree node template, children of the parent node will * be added in the `cdkTreeNodeOutlet` in tree node template. * For example: * ```html * <cdk-nested-tree-node> * {{node.name}} * <ng-template cdkTreeNodeOutlet></ng-template> * </cdk-nested-tree-node> * ``` * The children of node will be automatically added to `cdkTreeNodeOutlet`, the result dom will be * like this: * ```html * <cdk-nested-tree-node> * {{node.name}} * <cdk-nested-tree-node>{{child1.name}}</cdk-nested-tree-node> * <cdk-nested-tree-node>{{child2.name}}</cdk-nested-tree-node> * </cdk-nested-tree-node> * ``` * @template T */ var CdkNestedTreeNode = /** @class */ (function (_super) { Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__extends"])(CdkNestedTreeNode, _super); function CdkNestedTreeNode(_elementRef, _tree, _differs) { var _this = _super.call(this, _elementRef, _tree) || this; _this._elementRef = _elementRef; _this._tree = _tree; _this._differs = _differs; return _this; } /** * @return {?} */ CdkNestedTreeNode.prototype.ngAfterContentInit = /** * @return {?} */ function () { var _this = this; this._dataDiffer = this._differs.find([]).create(this._tree.trackBy); if (!this._tree.treeControl.getChildren) { throw getTreeControlFunctionsMissingError(); } /** @type {?} */ var childrenNodes = this._tree.treeControl.getChildren(this.data); if (Array.isArray(childrenNodes)) { this.updateChildrenNodes((/** @type {?} */ (childrenNodes))); } else if (childrenNodes instanceof rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"]) { childrenNodes.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["takeUntil"])(this._destroyed)) .subscribe((/** * @param {?} result * @return {?} */ function (result) { return _this.updateChildrenNodes(result); })); } this.nodeOutlet.changes.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["takeUntil"])(this._destroyed)) .subscribe((/** * @return {?} */ function () { return _this.updateChildrenNodes(); })); }; /** * @return {?} */ CdkNestedTreeNode.prototype.ngOnDestroy = /** * @return {?} */ function () { this._clear(); _super.prototype.ngOnDestroy.call(this); }; /** Add children dataNodes to the NodeOutlet */ /** * Add children dataNodes to the NodeOutlet * @protected * @param {?=} children * @return {?} */ CdkNestedTreeNode.prototype.updateChildrenNodes = /** * Add children dataNodes to the NodeOutlet * @protected * @param {?=} children * @return {?} */ function (children) { /** @type {?} */ var outlet = this._getNodeOutlet(); if (children) { this._children = children; } if (outlet && this._children) { /** @type {?} */ var viewContainer = outlet.viewContainer; this._tree.renderNodeChanges(this._children, this._dataDiffer, viewContainer, this._data); } else { // Reset the data differ if there's no children nodes displayed this._dataDiffer.diff([]); } }; /** Clear the children dataNodes. */ /** * Clear the children dataNodes. * @protected * @return {?} */ CdkNestedTreeNode.prototype._clear = /** * Clear the children dataNodes. * @protected * @return {?} */ function () { /** @type {?} */ var outlet = this._getNodeOutlet(); if (outlet) { outlet.viewContainer.clear(); this._dataDiffer.diff([]); } }; /** Gets the outlet for the current node. */ /** * Gets the outlet for the current node. * @private * @return {?} */ CdkNestedTreeNode.prototype._getNodeOutlet = /** * Gets the outlet for the current node. * @private * @return {?} */ function () { var _this = this; /** @type {?} */ var outlets = this.nodeOutlet; if (outlets) { // Note that since we use `descendants: true` on the query, we have to ensure // that we don't pick up the outlet of a child node by accident. return outlets.find((/** * @param {?} outlet * @return {?} */ function (outlet) { return !outlet._node || outlet._node === _this; })); } }; CdkNestedTreeNode.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Directive"], args: [{ selector: 'cdk-nested-tree-node', exportAs: 'cdkNestedTreeNode', host: { '[attr.aria-expanded]': 'isExpanded', '[attr.role]': 'role', 'class': 'cdk-tree-node cdk-nested-tree-node', }, providers: [ { provide: CdkTreeNode, useExisting: CdkNestedTreeNode }, { provide: CDK_TREE_NODE_OUTLET_NODE, useExisting: CdkNestedTreeNode } ] },] }, ]; /** @nocollapse */ CdkNestedTreeNode.ctorParameters = function () { return [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ElementRef"] }, { type: CdkTree }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["IterableDiffers"] } ]; }; CdkNestedTreeNode.propDecorators = { nodeOutlet: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ContentChildren"], args: [CdkTreeNodeOutlet, { // We need to use `descendants: true`, because Ivy will no longer match // indirect descendants if it's left as false. descendants: true },] }] }; return CdkNestedTreeNode; }(CdkTreeNode)); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Regex used to split a string on its CSS units. * @type {?} */ var cssUnitPattern = /([A-Za-z%]+)$/; /** * Indent for the children tree dataNodes. * This directive will add left-padding to the node to show hierarchy. * @template T */ var CdkTreeNodePadding = /** @class */ (function () { function CdkTreeNodePadding(_treeNode, _tree, _renderer, _element, _dir) { var _this = this; this._treeNode = _treeNode; this._tree = _tree; this._renderer = _renderer; this._element = _element; this._dir = _dir; /** * Subject that emits when the component has been destroyed. */ this._destroyed = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"](); /** * CSS units used for the indentation value. */ this.indentUnits = 'px'; this._indent = 40; this._setPadding(); if (_dir) { _dir.change.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["takeUntil"])(this._destroyed)).subscribe((/** * @return {?} */ function () { return _this._setPadding(true); })); } // In Ivy the indentation binding might be set before the tree node's data has been added, // which means that we'll miss the first render. We have to subscribe to changes in the // data to ensure that everything is up to date. _treeNode._dataChanges.subscribe((/** * @return {?} */ function () { return _this._setPadding(); })); } Object.defineProperty(CdkTreeNodePadding.prototype, "level", { /** The level of depth of the tree node. The padding will be `level * indent` pixels. */ get: /** * The level of depth of the tree node. The padding will be `level * indent` pixels. * @return {?} */ function () { return this._level; }, set: /** * @param {?} value * @return {?} */ function (value) { this._level = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_6__["coerceNumberProperty"])(value); this._setPadding(); }, enumerable: true, configurable: true }); Object.defineProperty(CdkTreeNodePadding.prototype, "indent", { /** * The indent for each level. Can be a number or a CSS string. * Default number 40px from material design menu sub-menu spec. */ get: /** * The indent for each level. Can be a number or a CSS string. * Default number 40px from material design menu sub-menu spec. * @return {?} */ function () { return this._indent; }, set: /** * @param {?} indent * @return {?} */ function (indent) { /** @type {?} */ var value = indent; /** @type {?} */ var units = 'px'; if (typeof indent === 'string') { /** @type {?} */ var parts = indent.split(cssUnitPattern); value = parts[0]; units = parts[1] || units; } this.indentUnits = units; this._indent = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_6__["coerceNumberProperty"])(value); this._setPadding(); }, enumerable: true, configurable: true }); /** * @return {?} */ CdkTreeNodePadding.prototype.ngOnDestroy = /** * @return {?} */ function () { this._destroyed.next(); this._destroyed.complete(); }; /** The padding indent value for the tree node. Returns a string with px numbers if not null. */ /** * The padding indent value for the tree node. Returns a string with px numbers if not null. * @return {?} */ CdkTreeNodePadding.prototype._paddingIndent = /** * The padding indent value for the tree node. Returns a string with px numbers if not null. * @return {?} */ function () { /** @type {?} */ var nodeLevel = (this._treeNode.data && this._tree.treeControl.getLevel) ? this._tree.treeControl.getLevel(this._treeNode.data) : null; /** @type {?} */ var level = this._level || nodeLevel; return level ? "" + level * this._indent + this.indentUnits : null; }; /** * @param {?=} forceChange * @return {?} */ CdkTreeNodePadding.prototype._setPadding = /** * @param {?=} forceChange * @return {?} */ function (forceChange) { if (forceChange === void 0) { forceChange = false; } /** @type {?} */ var padding = this._paddingIndent(); if (padding !== this._currentPadding || forceChange) { /** @type {?} */ var element = this._element.nativeElement; /** @type {?} */ var paddingProp = this._dir && this._dir.value === 'rtl' ? 'paddingRight' : 'paddingLeft'; /** @type {?} */ var resetProp = paddingProp === 'paddingLeft' ? 'paddingRight' : 'paddingLeft'; this._renderer.setStyle(element, paddingProp, padding); this._renderer.setStyle(element, resetProp, null); this._currentPadding = padding; } }; CdkTreeNodePadding.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Directive"], args: [{ selector: '[cdkTreeNodePadding]', },] }, ]; /** @nocollapse */ CdkTreeNodePadding.ctorParameters = function () { return [ { type: CdkTreeNode }, { type: CdkTree }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Renderer2"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ElementRef"] }, { type: _angular_cdk_bidi__WEBPACK_IMPORTED_MODULE_5__["Directionality"], decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Optional"] }] } ]; }; CdkTreeNodePadding.propDecorators = { level: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"], args: ['cdkTreeNodePadding',] }], indent: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"], args: ['cdkTreeNodePaddingIndent',] }] }; return CdkTreeNodePadding; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Node toggle to expand/collapse the node. * @template T */ var CdkTreeNodeToggle = /** @class */ (function () { function CdkTreeNodeToggle(_tree, _treeNode) { this._tree = _tree; this._treeNode = _treeNode; this._recursive = false; } Object.defineProperty(CdkTreeNodeToggle.prototype, "recursive", { /** Whether expand/collapse the node recursively. */ get: /** * Whether expand/collapse the node recursively. * @return {?} */ function () { return this._recursive; }, set: /** * @param {?} value * @return {?} */ function (value) { this._recursive = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_6__["coerceBooleanProperty"])(value); }, enumerable: true, configurable: true }); // We have to use a `HostListener` here in order to support both Ivy and ViewEngine. // In Ivy the `host` bindings will be merged when this class is extended, whereas in // ViewEngine they're overwritten. // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default. // tslint:disable-next-line:no-host-decorator-in-concrete // We have to use a `HostListener` here in order to support both Ivy and ViewEngine. // In Ivy the `host` bindings will be merged when this class is extended, whereas in // ViewEngine they're overwritten. // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default. // tslint:disable-next-line:no-host-decorator-in-concrete /** * @param {?} event * @return {?} */ CdkTreeNodeToggle.prototype._toggle = // We have to use a `HostListener` here in order to support both Ivy and ViewEngine. // In Ivy the `host` bindings will be merged when this class is extended, whereas in // ViewEngine they're overwritten. // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default. // tslint:disable-next-line:no-host-decorator-in-concrete /** * @param {?} event * @return {?} */ function (event) { this.recursive ? this._tree.treeControl.toggleDescendants(this._treeNode.data) : this._tree.treeControl.toggle(this._treeNode.data); event.stopPropagation(); }; CdkTreeNodeToggle.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Directive"], args: [{ selector: '[cdkTreeNodeToggle]' },] }, ]; /** @nocollapse */ CdkTreeNodeToggle.ctorParameters = function () { return [ { type: CdkTree }, { type: CdkTreeNode } ]; }; CdkTreeNodeToggle.propDecorators = { recursive: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["Input"], args: ['cdkTreeNodeToggleRecursive',] }], _toggle: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["HostListener"], args: ['click', ['$event'],] }] }; return CdkTreeNodeToggle; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** @type {?} */ var EXPORTED_DECLARATIONS = [ CdkNestedTreeNode, CdkTreeNodeDef, CdkTreeNodePadding, CdkTreeNodeToggle, CdkTree, CdkTreeNode, CdkTreeNodeOutlet, ]; var CdkTreeModule = /** @class */ (function () { function CdkTreeModule() { } CdkTreeModule.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_4__["NgModule"], args: [{ imports: [_angular_common__WEBPACK_IMPORTED_MODULE_8__["CommonModule"]], exports: EXPORTED_DECLARATIONS, declarations: EXPORTED_DECLARATIONS, providers: [_angular_cdk_a11y__WEBPACK_IMPORTED_MODULE_7__["FocusMonitor"], CdkTreeNodeDef] },] }, ]; return CdkTreeModule; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ //# sourceMappingURL=tree.es5.js.map /***/ }), /***/ "./node_modules/@angular/material/esm5/tree.es5.js": /*!*********************************************************!*\ !*** ./node_modules/@angular/material/esm5/tree.es5.js ***! \*********************************************************/ /*! exports provided: MatTreeNode, MatTreeNodeDef, MatNestedTreeNode, MatTreeNodePadding, MatTree, MatTreeModule, MatTreeNodeToggle, MatTreeNodeOutlet, MatTreeFlattener, MatTreeFlatDataSource, MatTreeNestedDataSource */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTreeNode", function() { return MatTreeNode; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTreeNodeDef", function() { return MatTreeNodeDef; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatNestedTreeNode", function() { return MatNestedTreeNode; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTreeNodePadding", function() { return MatTreeNodePadding; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTree", function() { return MatTree; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTreeModule", function() { return MatTreeModule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTreeNodeToggle", function() { return MatTreeNodeToggle; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTreeNodeOutlet", function() { return MatTreeNodeOutlet; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTreeFlattener", function() { return MatTreeFlattener; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTreeFlatDataSource", function() { return MatTreeFlatDataSource; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatTreeNestedDataSource", function() { return MatTreeNestedDataSource; }); /* harmony import */ var _angular_cdk_tree__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/cdk/tree */ "./node_modules/@angular/cdk/esm5/tree.es5.js"); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js"); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tslib */ "./node_modules/@angular/material/node_modules/tslib/tslib.es6.js"); /* harmony import */ var _angular_material_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/material/core */ "./node_modules/@angular/material/esm5/core.es5.js"); /* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js"); /* harmony import */ var _angular_cdk_collections__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/cdk/collections */ "./node_modules/@angular/cdk/esm5/collections.es5.js"); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js"); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js"); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Outlet for nested CdkNode. Put `[matTreeNodeOutlet]` on a tag to place children dataNodes * inside the outlet. */ var MatTreeNodeOutlet = /** @class */ (function () { function MatTreeNodeOutlet(viewContainer, _node) { this.viewContainer = viewContainer; this._node = _node; } MatTreeNodeOutlet.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[matTreeNodeOutlet]' },] }, ]; /** @nocollapse */ MatTreeNodeOutlet.ctorParameters = function () { return [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewContainerRef"] }, { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_cdk_tree__WEBPACK_IMPORTED_MODULE_0__["CDK_TREE_NODE_OUTLET_NODE"],] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }] } ]; }; return MatTreeNodeOutlet; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** @type {?} */ var _MatTreeNodeMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinTabIndex"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinDisabled"])(_angular_cdk_tree__WEBPACK_IMPORTED_MODULE_0__["CdkTreeNode"])); /** @type {?} */ var _MatNestedTreeNodeMixinBase = Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinTabIndex"])(Object(_angular_material_core__WEBPACK_IMPORTED_MODULE_3__["mixinDisabled"])(_angular_cdk_tree__WEBPACK_IMPORTED_MODULE_0__["CdkNestedTreeNode"])); /** * Wrapper for the CdkTree node with Material design styles. * @template T */ var MatTreeNode = /** @class */ (function (_super) { Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(MatTreeNode, _super); function MatTreeNode(_elementRef, _tree, tabIndex) { var _this = _super.call(this, _elementRef, _tree) || this; _this._elementRef = _elementRef; _this._tree = _tree; _this.role = 'treeitem'; _this.tabIndex = Number(tabIndex) || 0; return _this; } MatTreeNode.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: 'mat-tree-node', exportAs: 'matTreeNode', inputs: ['disabled', 'tabIndex'], host: { '[attr.aria-expanded]': 'isExpanded', '[attr.aria-level]': 'role === "treeitem" ? level : null', '[attr.role]': 'role', 'class': 'mat-tree-node' }, providers: [{ provide: _angular_cdk_tree__WEBPACK_IMPORTED_MODULE_0__["CdkTreeNode"], useExisting: MatTreeNode }] },] }, ]; /** @nocollapse */ MatTreeNode.ctorParameters = function () { return [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] }, { type: _angular_cdk_tree__WEBPACK_IMPORTED_MODULE_0__["CdkTree"] }, { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Attribute"], args: ['tabindex',] }] } ]; }; MatTreeNode.propDecorators = { role: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }] }; return MatTreeNode; }(_MatTreeNodeMixinBase)); /** * Wrapper for the CdkTree node definition with Material design styles. * @template T */ var MatTreeNodeDef = /** @class */ (function (_super) { Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(MatTreeNodeDef, _super); function MatTreeNodeDef() { return _super !== null && _super.apply(this, arguments) || this; } MatTreeNodeDef.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[matTreeNodeDef]', inputs: [ 'when: matTreeNodeDefWhen' ], providers: [{ provide: _angular_cdk_tree__WEBPACK_IMPORTED_MODULE_0__["CdkTreeNodeDef"], useExisting: MatTreeNodeDef }] },] }, ]; MatTreeNodeDef.propDecorators = { data: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['matTreeNode',] }] }; return MatTreeNodeDef; }(_angular_cdk_tree__WEBPACK_IMPORTED_MODULE_0__["CdkTreeNodeDef"])); /** * Wrapper for the CdkTree nested node with Material design styles. * @template T */ var MatNestedTreeNode = /** @class */ (function (_super) { Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(MatNestedTreeNode, _super); function MatNestedTreeNode(_elementRef, _tree, _differs, tabIndex) { var _this = _super.call(this, _elementRef, _tree, _differs) || this; _this._elementRef = _elementRef; _this._tree = _tree; _this._differs = _differs; _this.tabIndex = Number(tabIndex) || 0; return _this; } // This is a workaround for https://github.com/angular/angular/issues/23091 // In aot mode, the lifecycle hooks from parent class are not called. // TODO(tinayuangao): Remove when the angular issue #23091 is fixed // This is a workaround for https://github.com/angular/angular/issues/23091 // In aot mode, the lifecycle hooks from parent class are not called. // TODO(tinayuangao): Remove when the angular issue #23091 is fixed /** * @return {?} */ MatNestedTreeNode.prototype.ngAfterContentInit = // This is a workaround for https://github.com/angular/angular/issues/23091 // In aot mode, the lifecycle hooks from parent class are not called. // TODO(tinayuangao): Remove when the angular issue #23091 is fixed /** * @return {?} */ function () { _super.prototype.ngAfterContentInit.call(this); }; /** * @return {?} */ MatNestedTreeNode.prototype.ngOnDestroy = /** * @return {?} */ function () { _super.prototype.ngOnDestroy.call(this); }; MatNestedTreeNode.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: 'mat-nested-tree-node', exportAs: 'matNestedTreeNode', host: { '[attr.aria-expanded]': 'isExpanded', '[attr.role]': 'role', 'class': 'mat-nested-tree-node', }, inputs: ['disabled', 'tabIndex'], providers: [ { provide: _angular_cdk_tree__WEBPACK_IMPORTED_MODULE_0__["CdkNestedTreeNode"], useExisting: MatNestedTreeNode }, { provide: _angular_cdk_tree__WEBPACK_IMPORTED_MODULE_0__["CdkTreeNode"], useExisting: MatNestedTreeNode }, { provide: _angular_cdk_tree__WEBPACK_IMPORTED_MODULE_0__["CDK_TREE_NODE_OUTLET_NODE"], useExisting: MatNestedTreeNode } ] },] }, ]; /** @nocollapse */ MatNestedTreeNode.ctorParameters = function () { return [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] }, { type: _angular_cdk_tree__WEBPACK_IMPORTED_MODULE_0__["CdkTree"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["IterableDiffers"] }, { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Attribute"], args: ['tabindex',] }] } ]; }; MatNestedTreeNode.propDecorators = { node: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['matNestedTreeNode',] }], nodeOutlet: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChildren"], args: [MatTreeNodeOutlet, { // We need to use `descendants: true`, because Ivy will no longer match // indirect descendants if it's left as false. descendants: true },] }] }; return MatNestedTreeNode; }(_MatNestedTreeNodeMixinBase)); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Wrapper for the CdkTree padding with Material design styles. * @template T */ var MatTreeNodePadding = /** @class */ (function (_super) { Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(MatTreeNodePadding, _super); function MatTreeNodePadding() { return _super !== null && _super.apply(this, arguments) || this; } MatTreeNodePadding.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[matTreeNodePadding]', providers: [{ provide: _angular_cdk_tree__WEBPACK_IMPORTED_MODULE_0__["CdkTreeNodePadding"], useExisting: MatTreeNodePadding }] },] }, ]; MatTreeNodePadding.propDecorators = { level: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['matTreeNodePadding',] }], indent: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['matTreeNodePaddingIndent',] }] }; return MatTreeNodePadding; }(_angular_cdk_tree__WEBPACK_IMPORTED_MODULE_0__["CdkTreeNodePadding"])); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Wrapper for the CdkTable with Material design styles. * @template T */ var MatTree = /** @class */ (function (_super) { Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(MatTree, _super); function MatTree() { return _super !== null && _super.apply(this, arguments) || this; } MatTree.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"], args: [{selector: 'mat-tree', exportAs: 'matTree', template: "<ng-container matTreeNodeOutlet></ng-container>", host: { 'class': 'mat-tree', 'role': 'tree', }, styles: [".mat-tree{display:block}.mat-tree-node{display:flex;align-items:center;min-height:48px;flex:1;overflow:hidden;word-wrap:break-word}.mat-nested-tree-ndoe{border-bottom-width:0}"], encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None, // See note on CdkTree for explanation on why this uses the default change detection strategy. // tslint:disable-next-line:validate-decorators changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectionStrategy"].Default, providers: [{ provide: _angular_cdk_tree__WEBPACK_IMPORTED_MODULE_0__["CdkTree"], useExisting: MatTree }] },] }, ]; MatTree.propDecorators = { _nodeOutlet: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"], args: [MatTreeNodeOutlet, { static: true },] }] }; return MatTree; }(_angular_cdk_tree__WEBPACK_IMPORTED_MODULE_0__["CdkTree"])); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Wrapper for the CdkTree's toggle with Material design styles. * @template T */ var MatTreeNodeToggle = /** @class */ (function (_super) { Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(MatTreeNodeToggle, _super); function MatTreeNodeToggle() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.recursive = false; return _this; } MatTreeNodeToggle.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"], args: [{ selector: '[matTreeNodeToggle]', providers: [{ provide: _angular_cdk_tree__WEBPACK_IMPORTED_MODULE_0__["CdkTreeNodeToggle"], useExisting: MatTreeNodeToggle }] },] }, ]; MatTreeNodeToggle.propDecorators = { recursive: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"], args: ['matTreeNodeToggleRecursive',] }] }; return MatTreeNodeToggle; }(_angular_cdk_tree__WEBPACK_IMPORTED_MODULE_0__["CdkTreeNodeToggle"])); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** @type {?} */ var MAT_TREE_DIRECTIVES = [ MatNestedTreeNode, MatTreeNodeDef, MatTreeNodePadding, MatTreeNodeToggle, MatTree, MatTreeNode, MatTreeNodeOutlet ]; var MatTreeModule = /** @class */ (function () { function MatTreeModule() { } MatTreeModule.decorators = [ { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"], args: [{ imports: [_angular_cdk_tree__WEBPACK_IMPORTED_MODULE_0__["CdkTreeModule"], _angular_common__WEBPACK_IMPORTED_MODULE_4__["CommonModule"], _angular_material_core__WEBPACK_IMPORTED_MODULE_3__["MatCommonModule"]], exports: MAT_TREE_DIRECTIVES, declarations: MAT_TREE_DIRECTIVES, },] }, ]; return MatTreeModule; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Tree flattener to convert a normal type of node to node with children & level information. * Transform nested nodes of type `T` to flattened nodes of type `F`. * * For example, the input data of type `T` is nested, and contains its children data: * SomeNode: { * key: 'Fruits', * children: [ * NodeOne: { * key: 'Apple', * }, * NodeTwo: { * key: 'Pear', * } * ] * } * After flattener flatten the tree, the structure will become * SomeNode: { * key: 'Fruits', * expandable: true, * level: 1 * }, * NodeOne: { * key: 'Apple', * expandable: false, * level: 2 * }, * NodeTwo: { * key: 'Pear', * expandable: false, * level: 2 * } * and the output flattened type is `F` with additional information. * @template T, F */ var /** * Tree flattener to convert a normal type of node to node with children & level information. * Transform nested nodes of type `T` to flattened nodes of type `F`. * * For example, the input data of type `T` is nested, and contains its children data: * SomeNode: { * key: 'Fruits', * children: [ * NodeOne: { * key: 'Apple', * }, * NodeTwo: { * key: 'Pear', * } * ] * } * After flattener flatten the tree, the structure will become * SomeNode: { * key: 'Fruits', * expandable: true, * level: 1 * }, * NodeOne: { * key: 'Apple', * expandable: false, * level: 2 * }, * NodeTwo: { * key: 'Pear', * expandable: false, * level: 2 * } * and the output flattened type is `F` with additional information. * @template T, F */ MatTreeFlattener = /** @class */ (function () { function MatTreeFlattener(transformFunction, getLevel, isExpandable, getChildren) { this.transformFunction = transformFunction; this.getLevel = getLevel; this.isExpandable = isExpandable; this.getChildren = getChildren; } /** * @param {?} node * @param {?} level * @param {?} resultNodes * @param {?} parentMap * @return {?} */ MatTreeFlattener.prototype._flattenNode = /** * @param {?} node * @param {?} level * @param {?} resultNodes * @param {?} parentMap * @return {?} */ function (node, level, resultNodes, parentMap) { var _this = this; /** @type {?} */ var flatNode = this.transformFunction(node, level); resultNodes.push(flatNode); if (this.isExpandable(flatNode)) { /** @type {?} */ var childrenNodes = this.getChildren(node); if (childrenNodes) { if (Array.isArray(childrenNodes)) { this._flattenChildren(childrenNodes, level, resultNodes, parentMap); } else { childrenNodes.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["take"])(1)).subscribe((/** * @param {?} children * @return {?} */ function (children) { _this._flattenChildren(children, level, resultNodes, parentMap); })); } } } return resultNodes; }; /** * @param {?} children * @param {?} level * @param {?} resultNodes * @param {?} parentMap * @return {?} */ MatTreeFlattener.prototype._flattenChildren = /** * @param {?} children * @param {?} level * @param {?} resultNodes * @param {?} parentMap * @return {?} */ function (children, level, resultNodes, parentMap) { var _this = this; children.forEach((/** * @param {?} child * @param {?} index * @return {?} */ function (child, index) { /** @type {?} */ var childParentMap = parentMap.slice(); childParentMap.push(index != children.length - 1); _this._flattenNode(child, level + 1, resultNodes, childParentMap); })); }; /** * Flatten a list of node type T to flattened version of node F. * Please note that type T may be nested, and the length of `structuredData` may be different * from that of returned list `F[]`. */ /** * Flatten a list of node type T to flattened version of node F. * Please note that type T may be nested, and the length of `structuredData` may be different * from that of returned list `F[]`. * @param {?} structuredData * @return {?} */ MatTreeFlattener.prototype.flattenNodes = /** * Flatten a list of node type T to flattened version of node F. * Please note that type T may be nested, and the length of `structuredData` may be different * from that of returned list `F[]`. * @param {?} structuredData * @return {?} */ function (structuredData) { var _this = this; /** @type {?} */ var resultNodes = []; structuredData.forEach((/** * @param {?} node * @return {?} */ function (node) { return _this._flattenNode(node, 0, resultNodes, []); })); return resultNodes; }; /** * Expand flattened node with current expansion status. * The returned list may have different length. */ /** * Expand flattened node with current expansion status. * The returned list may have different length. * @param {?} nodes * @param {?} treeControl * @return {?} */ MatTreeFlattener.prototype.expandFlattenedNodes = /** * Expand flattened node with current expansion status. * The returned list may have different length. * @param {?} nodes * @param {?} treeControl * @return {?} */ function (nodes, treeControl) { var _this = this; /** @type {?} */ var results = []; /** @type {?} */ var currentExpand = []; currentExpand[0] = true; nodes.forEach((/** * @param {?} node * @return {?} */ function (node) { /** @type {?} */ var expand = true; for (var i = 0; i <= _this.getLevel(node); i++) { expand = expand && currentExpand[i]; } if (expand) { results.push(node); } if (_this.isExpandable(node)) { currentExpand[_this.getLevel(node) + 1] = treeControl.isExpanded(node); } })); return results; }; return MatTreeFlattener; }()); /** * Data source for flat tree. * The data source need to handle expansion/collapsion of the tree node and change the data feed * to `MatTree`. * The nested tree nodes of type `T` are flattened through `MatTreeFlattener`, and converted * to type `F` for `MatTree` to consume. * @template T, F */ var /** * Data source for flat tree. * The data source need to handle expansion/collapsion of the tree node and change the data feed * to `MatTree`. * The nested tree nodes of type `T` are flattened through `MatTreeFlattener`, and converted * to type `F` for `MatTree` to consume. * @template T, F */ MatTreeFlatDataSource = /** @class */ (function (_super) { Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(MatTreeFlatDataSource, _super); function MatTreeFlatDataSource(_treeControl, _treeFlattener, initialData) { if (initialData === void 0) { initialData = []; } var _this = _super.call(this) || this; _this._treeControl = _treeControl; _this._treeFlattener = _treeFlattener; _this._flattenedData = new rxjs__WEBPACK_IMPORTED_MODULE_6__["BehaviorSubject"]([]); _this._expandedData = new rxjs__WEBPACK_IMPORTED_MODULE_6__["BehaviorSubject"]([]); _this._data = new rxjs__WEBPACK_IMPORTED_MODULE_6__["BehaviorSubject"](initialData); return _this; } Object.defineProperty(MatTreeFlatDataSource.prototype, "data", { get: /** * @return {?} */ function () { return this._data.value; }, set: /** * @param {?} value * @return {?} */ function (value) { this._data.next(value); this._flattenedData.next(this._treeFlattener.flattenNodes(this.data)); this._treeControl.dataNodes = this._flattenedData.value; }, enumerable: true, configurable: true }); /** * @param {?} collectionViewer * @return {?} */ MatTreeFlatDataSource.prototype.connect = /** * @param {?} collectionViewer * @return {?} */ function (collectionViewer) { var _this = this; /** @type {?} */ var changes = [ collectionViewer.viewChange, this._treeControl.expansionModel.onChange, this._flattenedData ]; return rxjs__WEBPACK_IMPORTED_MODULE_6__["merge"].apply(void 0, changes).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["map"])((/** * @return {?} */ function () { _this._expandedData.next(_this._treeFlattener.expandFlattenedNodes(_this._flattenedData.value, _this._treeControl)); return _this._expandedData.value; }))); }; /** * @return {?} */ MatTreeFlatDataSource.prototype.disconnect = /** * @return {?} */ function () { // no op }; return MatTreeFlatDataSource; }(_angular_cdk_collections__WEBPACK_IMPORTED_MODULE_5__["DataSource"])); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * Data source for nested tree. * * The data source for nested tree doesn't have to consider node flattener, or the way to expand * or collapse. The expansion/collapsion will be handled by TreeControl and each non-leaf node. * @template T */ var /** * Data source for nested tree. * * The data source for nested tree doesn't have to consider node flattener, or the way to expand * or collapse. The expansion/collapsion will be handled by TreeControl and each non-leaf node. * @template T */ MatTreeNestedDataSource = /** @class */ (function (_super) { Object(tslib__WEBPACK_IMPORTED_MODULE_2__["__extends"])(MatTreeNestedDataSource, _super); function MatTreeNestedDataSource() { var _this = _super !== null && _super.apply(this, arguments) || this; _this._data = new rxjs__WEBPACK_IMPORTED_MODULE_6__["BehaviorSubject"]([]); return _this; } Object.defineProperty(MatTreeNestedDataSource.prototype, "data", { /** * Data for the nested tree */ get: /** * Data for the nested tree * @return {?} */ function () { return this._data.value; }, set: /** * @param {?} value * @return {?} */ function (value) { this._data.next(value); }, enumerable: true, configurable: true }); /** * @param {?} collectionViewer * @return {?} */ MatTreeNestedDataSource.prototype.connect = /** * @param {?} collectionViewer * @return {?} */ function (collectionViewer) { var _this = this; return rxjs__WEBPACK_IMPORTED_MODULE_6__["merge"].apply(void 0, [collectionViewer.viewChange, this._data]).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["map"])((/** * @return {?} */ function () { return _this.data; }))); }; /** * @return {?} */ MatTreeNestedDataSource.prototype.disconnect = /** * @return {?} */ function () { // no op }; return MatTreeNestedDataSource; }(_angular_cdk_collections__WEBPACK_IMPORTED_MODULE_5__["DataSource"])); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ //# sourceMappingURL=tree.es5.js.map /***/ }) }]);
Save