UNPKG

@aurelia-mdc-web/tree-view

Version:

Wrapper for Material Components Web Tree View

53 lines 1.93 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TreeNode = void 0; var tslib_1 = require("tslib"); var aurelia_framework_1 = require("aurelia-framework"); var TreeNode = /** @class */ (function () { function TreeNode(element, container) { this.element = element; this.container = container; this.viewSlot = new aurelia_framework_1.ViewSlot(this.element, true); } TreeNode.prototype.bind = function (bindingContext) { this.build(); this.viewSlot.bind(bindingContext, this.rootBindingContext); }; TreeNode.prototype.attached = function () { this.viewSlot.attached(); }; TreeNode.prototype.detached = function () { this.viewSlot.detached(); }; TreeNode.prototype.unbind = function () { this.viewSlot.unbind(); }; TreeNode.prototype.build = function () { if (this.built) { return; } this.built = true; if (!this.factory) { return; } this.view = this.factory.create(this.container); this.viewSlot.add(this.view); }; tslib_1.__decorate([ aurelia_framework_1.bindable, tslib_1.__metadata("design:type", aurelia_framework_1.ViewFactory) ], TreeNode.prototype, "factory", void 0); tslib_1.__decorate([ aurelia_framework_1.bindable, tslib_1.__metadata("design:type", Object) ], TreeNode.prototype, "rootBindingContext", void 0); TreeNode = tslib_1.__decorate([ (0, aurelia_framework_1.inject)(Element, aurelia_framework_1.Container), (0, aurelia_framework_1.customElement)('mdc-tree-node'), (0, aurelia_framework_1.noView)(), tslib_1.__metadata("design:paramtypes", [Element, aurelia_framework_1.Container]) ], TreeNode); return TreeNode; }()); exports.TreeNode = TreeNode; //# sourceMappingURL=mdc-tree-node.js.map