UNPKG

@aurelia-mdc-web/tree-view

Version:

Wrapper for Material Components Web Tree View

49 lines 1.38 kB
import { __decorate, __metadata } from "tslib"; import { inject, bindable, noView, ViewSlot, customElement, ViewFactory, Container } from 'aurelia-framework'; let TreeNode = class TreeNode { constructor(element, container) { this.element = element; this.container = container; this.viewSlot = new ViewSlot(this.element, true); } bind(bindingContext) { this.build(); this.viewSlot.bind(bindingContext, this.rootBindingContext); } attached() { this.viewSlot.attached(); } detached() { this.viewSlot.detached(); } unbind() { this.viewSlot.unbind(); } build() { if (this.built) { return; } this.built = true; if (!this.factory) { return; } this.view = this.factory.create(this.container); this.viewSlot.add(this.view); } }; __decorate([ bindable, __metadata("design:type", ViewFactory) ], TreeNode.prototype, "factory", void 0); __decorate([ bindable, __metadata("design:type", Object) ], TreeNode.prototype, "rootBindingContext", void 0); TreeNode = __decorate([ inject(Element, Container), customElement('mdc-tree-node'), noView(), __metadata("design:paramtypes", [Element, Container]) ], TreeNode); export { TreeNode }; //# sourceMappingURL=mdc-tree-node.js.map