angular-wrapper-kendo-ui
Version:
A simple library to wrapper Telerik Kendo UI jQuery controls in Angular 6 components.
222 lines (216 loc) • 5.98 kB
JavaScript
import { Component, ViewEncapsulation, ChangeDetectionStrategy, NgZone, ElementRef, Input, ViewChild, NgModule } from '@angular/core';
import '@progress/kendo-ui';
import 'jquery';
/**
* @fileoverview added by tsickle
* Generated from: lib/tree-list.component.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class TreeListComponent {
/**
* @param {?} zone
* @param {?} elementRef
*/
constructor(zone, elementRef) {
this.zone = zone;
this.elementRef = elementRef;
}
/**
* @return {?}
*/
ngOnInit() { }
/**
* @return {?}
*/
ngAfterViewInit() {
/** @type {?} */
const treeList = kendo.jQuery(this.treelistEl.nativeElement);
this.zone.runOutsideAngular((/**
* @return {?}
*/
() => {
this._treelist = treeList
.kendoTreeList(this.options)
.data('kendoTreeList');
}));
}
/**
* @return {?}
*/
ngOnDestroy() {
kendo.destroy(this.elementRef.nativeElement);
}
/**
* @return {?}
*/
get dataSource() {
return this._treelist && this._treelist.dataSource;
}
/**
* @return {?}
*/
get content() {
return this._treelist && this._treelist.content;
}
/**
* @return {?}
*/
get thead() {
return this._treelist && this._treelist.thead;
}
/**
* @return {?}
*/
get tbody() {
return this._treelist && this._treelist.tbody;
}
/**
* @param {?=} parentRow
* @return {?}
*/
addRow(parentRow = '') {
return this._treelist && this._treelist.addRow(parentRow);
}
/**
* @param {?} row
* @return {?}
*/
editRow(row) {
if (!row) {
return;
}
/** @type {?} */
const internalRow = row instanceof jQuery ? row : kendo.jQuery(row);
return this._treelist && this._treelist.editRow(internalRow);
}
/**
* @param {?} row
* @return {?}
*/
removeRow(row) {
if (!row) {
return;
}
/** @type {?} */
const internalRow = row instanceof jQuery ? row : kendo.jQuery(row);
return this._treelist && this._treelist.removeRow(internalRow);
}
/**
* @param {?} row
* @return {?}
*/
expand(row) {
if (!row) {
return;
}
/** @type {?} */
const internalRow = row instanceof jQuery ? row : kendo.jQuery(row);
return this._treelist && this._treelist.expand(internalRow);
}
/**
* @param {?} row
* @return {?}
*/
select(row) {
if (!row) {
return;
}
/** @type {?} */
const internalRow = row instanceof jQuery ? row : kendo.jQuery(row);
return this._treelist && this._treelist.select(internalRow);
}
/**
* @param {?} model
* @return {?}
*/
itemFor(model) {
if (!model) {
return;
}
return this._treelist && this._treelist.itemFor(model);
}
/**
* @param {?} row
* @return {?}
*/
dataItem(row) {
if (!row) {
return;
}
/** @type {?} */
const internalRow = row instanceof jQuery ? row : kendo.jQuery(row);
return this._treelist && this._treelist.dataItem(internalRow);
}
/**
* @return {?}
*/
clearSelection() {
return this._treelist && this._treelist.clearSelection();
}
}
TreeListComponent.decorators = [
{ type: Component, args: [{
// tslint:disable-next-line:component-selector
selector: 'ng-treelist',
template: "<div id=\"treelist\" #treelist></div>",
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
styles: [""]
}] }
];
/** @nocollapse */
TreeListComponent.ctorParameters = () => [
{ type: NgZone },
{ type: ElementRef }
];
TreeListComponent.propDecorators = {
options: [{ type: Input }],
treelistEl: [{ type: ViewChild, args: ['treelist', { static: false },] }]
};
if (false) {
/** @type {?} */
TreeListComponent.prototype.options;
/** @type {?} */
TreeListComponent.prototype.treelistEl;
/**
* @type {?}
* @private
*/
TreeListComponent.prototype._treelist;
/**
* @type {?}
* @private
*/
TreeListComponent.prototype.zone;
/**
* @type {?}
* @private
*/
TreeListComponent.prototype.elementRef;
}
/**
* @fileoverview added by tsickle
* Generated from: lib/angular-wrapper-kendo-ui.module.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class AngularWrapperKendoUiModule {
}
AngularWrapperKendoUiModule.decorators = [
{ type: NgModule, args: [{
imports: [],
declarations: [TreeListComponent],
exports: [TreeListComponent]
},] }
];
/**
* @fileoverview added by tsickle
* Generated from: public_api.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* Generated from: angular-wrapper-kendo-ui.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
export { AngularWrapperKendoUiModule, TreeListComponent };
//# sourceMappingURL=angular-wrapper-kendo-ui.js.map