angular-wrapper-kendo-ui-app
Version:
A sample application to use and test the TreeList component defined in the *angular-wrapper-kendo-ui* library.
127 lines (121 loc) • 3.93 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';
let TreeListComponent = class TreeListComponent {
constructor(zone, elementRef) {
this.zone = zone;
this.elementRef = elementRef;
}
ngOnInit() { }
ngAfterViewInit() {
const treeList = kendo.jQuery(this.treelistEl.nativeElement);
this.zone.runOutsideAngular(() => {
this._treelist = treeList
.kendoTreeList(this.options)
.data('kendoTreeList');
});
}
ngOnDestroy() {
kendo.destroy(this.elementRef.nativeElement);
}
get dataSource() {
return this._treelist && this._treelist.dataSource;
}
get content() {
return this._treelist && this._treelist.content;
}
get thead() {
return this._treelist && this._treelist.thead;
}
get tbody() {
return this._treelist && this._treelist.tbody;
}
addRow(parentRow = '') {
return this._treelist && this._treelist.addRow(parentRow);
}
editRow(row) {
if (!row) {
return;
}
const internalRow = row instanceof jQuery ? row : kendo.jQuery(row);
return this._treelist && this._treelist.editRow(internalRow);
}
removeRow(row) {
if (!row) {
return;
}
const internalRow = row instanceof jQuery ? row : kendo.jQuery(row);
return this._treelist && this._treelist.removeRow(internalRow);
}
expand(row) {
if (!row) {
return;
}
const internalRow = row instanceof jQuery ? row : kendo.jQuery(row);
return this._treelist && this._treelist.expand(internalRow);
}
select(row) {
if (!row) {
return;
}
const internalRow = row instanceof jQuery ? row : kendo.jQuery(row);
return this._treelist && this._treelist.select(internalRow);
}
itemFor(model) {
if (!model) {
return;
}
return this._treelist && this._treelist.itemFor(model);
}
dataItem(row) {
if (!row) {
return;
}
const internalRow = row instanceof jQuery ? row : kendo.jQuery(row);
return this._treelist && this._treelist.dataItem(internalRow);
}
clearSelection() {
return this._treelist && this._treelist.clearSelection();
}
};
TreeListComponent.ctorParameters = () => [
{ 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);
let AngularWrapperKendoUiModule = class AngularWrapperKendoUiModule {
};
AngularWrapperKendoUiModule = __decorate([
NgModule({
imports: [],
declarations: [TreeListComponent],
exports: [TreeListComponent]
})
], 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