angular-wrapper-kendo-ui-app
Version:
A sample application to use and test the TreeList component defined in the *angular-wrapper-kendo-ui* library.
149 lines (143 loc) • 5.33 kB
JavaScript
import { __decorate, __metadata } from 'tslib';
import { NgZone, ElementRef, Input, ViewChild, Component, ViewEncapsulation, ChangeDetectionStrategy, NgModule } from '@angular/core';
import '@progress/kendo-ui';
import 'jquery';
var TreeListComponent = /** @class */ (function () {
function TreeListComponent(zone, elementRef) {
this.zone = zone;
this.elementRef = elementRef;
}
TreeListComponent.prototype.ngOnInit = function () { };
TreeListComponent.prototype.ngAfterViewInit = function () {
var _this = this;
var treeList = kendo.jQuery(this.treelistEl.nativeElement);
this.zone.runOutsideAngular(function () {
_this._treelist = treeList
.kendoTreeList(_this.options)
.data('kendoTreeList');
});
};
TreeListComponent.prototype.ngOnDestroy = function () {
kendo.destroy(this.elementRef.nativeElement);
};
Object.defineProperty(TreeListComponent.prototype, "dataSource", {
get: function () {
return this._treelist && this._treelist.dataSource;
},
enumerable: true,
configurable: true
});
Object.defineProperty(TreeListComponent.prototype, "content", {
get: function () {
return this._treelist && this._treelist.content;
},
enumerable: true,
configurable: true
});
Object.defineProperty(TreeListComponent.prototype, "thead", {
get: function () {
return this._treelist && this._treelist.thead;
},
enumerable: true,
configurable: true
});
Object.defineProperty(TreeListComponent.prototype, "tbody", {
get: function () {
return this._treelist && this._treelist.tbody;
},
enumerable: true,
configurable: true
});
TreeListComponent.prototype.addRow = function (parentRow) {
if (parentRow === void 0) { parentRow = ''; }
return this._treelist && this._treelist.addRow(parentRow);
};
TreeListComponent.prototype.editRow = function (row) {
if (!row) {
return;
}
var internalRow = row instanceof jQuery ? row : kendo.jQuery(row);
return this._treelist && this._treelist.editRow(internalRow);
};
TreeListComponent.prototype.removeRow = function (row) {
if (!row) {
return;
}
var internalRow = row instanceof jQuery ? row : kendo.jQuery(row);
return this._treelist && this._treelist.removeRow(internalRow);
};
TreeListComponent.prototype.expand = function (row) {
if (!row) {
return;
}
var internalRow = row instanceof jQuery ? row : kendo.jQuery(row);
return this._treelist && this._treelist.expand(internalRow);
};
TreeListComponent.prototype.select = function (row) {
if (!row) {
return;
}
var internalRow = row instanceof jQuery ? row : kendo.jQuery(row);
return this._treelist && this._treelist.select(internalRow);
};
TreeListComponent.prototype.itemFor = function (model) {
if (!model) {
return;
}
return this._treelist && this._treelist.itemFor(model);
};
TreeListComponent.prototype.dataItem = function (row) {
if (!row) {
return;
}
var internalRow = row instanceof jQuery ? row : kendo.jQuery(row);
return this._treelist && this._treelist.dataItem(internalRow);
};
TreeListComponent.prototype.clearSelection = function () {
return this._treelist && this._treelist.clearSelection();
};
TreeListComponent.ctorParameters = function () { return [
{ type: NgZone },
{ type: ElementRef }
]; };
__decorate([
Input(),
__metadata("design:type", Object)
], TreeListComponent.prototype, "options", void 0);
__decorate([
ViewChild('treelist', { static: false }),
__metadata("design:type", ElementRef)
], TreeListComponent.prototype, "treelistEl", void 0);
TreeListComponent = __decorate([
Component({
// tslint:disable-next-line:component-selector
selector: 'ng-treelist',
template: "<div id=\"treelist\" #treelist></div>",
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
styles: [""]
}),
__metadata("design:paramtypes", [NgZone, ElementRef])
], TreeListComponent);
return TreeListComponent;
}());
var AngularWrapperKendoUiModule = /** @class */ (function () {
function AngularWrapperKendoUiModule() {
}
AngularWrapperKendoUiModule = __decorate([
NgModule({
imports: [],
declarations: [TreeListComponent],
exports: [TreeListComponent]
})
], AngularWrapperKendoUiModule);
return AngularWrapperKendoUiModule;
}());
/*
* Public API Surface of angular-wrapper-kendo-ui
*/
/**
* Generated bundle index. Do not edit.
*/
export { AngularWrapperKendoUiModule, TreeListComponent };
//# sourceMappingURL=angular-wrapper-kendo-ui.js.map