"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/cdk/tree/tree.ts" between
material2-7.3.4.tar.gz and material2-7.3.5.tar.gz

About: material2 offers Material Design components for Angular.

tree.ts  (material2-7.3.4):tree.ts  (material2-7.3.5)
skipping to change at line 57 skipping to change at line 57
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'cdk-tree', selector: 'cdk-tree',
exportAs: 'cdkTree', exportAs: 'cdkTree',
template: `<ng-container cdkTreeNodeOutlet></ng-container>`, template: `<ng-container cdkTreeNodeOutlet></ng-container>`,
host: { host: {
'class': 'cdk-tree', 'class': 'cdk-tree',
'role': 'tree', 'role': 'tree',
}, },
encapsulation: ViewEncapsulation.None, encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush
// The "OnPush" status for the `CdkTree` component is effectively a noop, so w
e are removing it.
// The view for `CdkTree` consists entirely of templates declared in other vie
ws. As they are
// declared elsewhere, they are checked when their declaration points are chec
ked.
// tslint:disable-next-line:validate-decorators
changeDetection: ChangeDetectionStrategy.Default
}) })
export class CdkTree<T> export class CdkTree<T> implements AfterContentChecked, CollectionViewer, OnDest
implements AfterContentChecked, CollectionViewer, OnDestroy, OnInit { roy, OnInit {
/** Subject that emits when the component has been destroyed. */ /** Subject that emits when the component has been destroyed. */
private _onDestroy = new Subject<void>(); private _onDestroy = new Subject<void>();
/** Differ used to find the changes in the data provided by the data source. * / /** Differ used to find the changes in the data provided by the data source. * /
private _dataDiffer: IterableDiffer<T>; private _dataDiffer: IterableDiffer<T>;
/** Stores the node definition that does not have a when predicate. */ /** Stores the node definition that does not have a when predicate. */
private _defaultNodeDef: CdkTreeNodeDef<T> | null; private _defaultNodeDef: CdkTreeNodeDef<T> | null;
/** Data subscription */ /** Data subscription */
skipping to change at line 300 skipping to change at line 304
export class CdkTreeNode<T> implements FocusableOption, OnDestroy { export class CdkTreeNode<T> implements FocusableOption, OnDestroy {
/** /**
* The most recently created `CdkTreeNode`. We save it in static variable so w e can retrieve it * The most recently created `CdkTreeNode`. We save it in static variable so w e can retrieve it
* in `CdkTree` and set the data to it. * in `CdkTree` and set the data to it.
*/ */
static mostRecentTreeNode: CdkTreeNode<any> | null = null; static mostRecentTreeNode: CdkTreeNode<any> | null = null;
/** Subject that emits when the component has been destroyed. */ /** Subject that emits when the component has been destroyed. */
protected _destroyed = new Subject<void>(); protected _destroyed = new Subject<void>();
/** Emits when the node's data has changed. */
_dataChanges = new Subject<void>();
/** The tree node's data. */ /** The tree node's data. */
get data(): T { return this._data; } get data(): T { return this._data; }
set data(value: T) { set data(value: T) {
this._data = value; if (value !== this._data) {
this._setRoleFromData(); this._data = value;
this._setRoleFromData();
this._dataChanges.next();
}
} }
protected _data: T; protected _data: T;
get isExpanded(): boolean { get isExpanded(): boolean {
return this._tree.treeControl.isExpanded(this._data); return this._tree.treeControl.isExpanded(this._data);
} }
get level(): number { get level(): number {
return this._tree.treeControl.getLevel ? this._tree.treeControl.getLevel(thi s._data) : 0; return this._tree.treeControl.getLevel ? this._tree.treeControl.getLevel(thi s._data) : 0;
} }
skipping to change at line 334 skipping to change at line 344
CdkTreeNode.mostRecentTreeNode = this as CdkTreeNode<T>; CdkTreeNode.mostRecentTreeNode = this as CdkTreeNode<T>;
} }
ngOnDestroy() { ngOnDestroy() {
// If this is the last tree node being destroyed, // If this is the last tree node being destroyed,
// clear out the reference to avoid leaking memory. // clear out the reference to avoid leaking memory.
if (CdkTreeNode.mostRecentTreeNode === this) { if (CdkTreeNode.mostRecentTreeNode === this) {
CdkTreeNode.mostRecentTreeNode = null; CdkTreeNode.mostRecentTreeNode = null;
} }
this._dataChanges.complete();
this._destroyed.next(); this._destroyed.next();
this._destroyed.complete(); this._destroyed.complete();
} }
/** Focuses the menu item. Implements for FocusableOption. */ /** Focuses the menu item. Implements for FocusableOption. */
focus(): void { focus(): void {
this._elementRef.nativeElement.focus(); this._elementRef.nativeElement.focus();
} }
protected _setRoleFromData(): void { protected _setRoleFromData(): void {
 End of changes. 5 change blocks. 
5 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)