@aurelia-mdc-web/tree-view
Version:
Wrapper for Material Components Web Tree View
53 lines • 2.16 kB
JavaScript
define(["require", "exports", "tslib", "aurelia-framework"], function (require, exports, tslib_1, aurelia_framework_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TreeNode = void 0;
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