@progress/kendo-angular-treeview
Version:
Kendo UI TreeView for Angular
49 lines (48 loc) • 1.97 kB
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { Injectable } from '@angular/core';
import { isPresent } from '../../utils';
import * as i0 from "@angular/core";
/**
* @hidden
*/
export class DragAndDropAssetService {
get componentRef() {
if (!isPresent(this._componentRef)) {
throw new Error('The `initalize` method must be called before calling other service methods.');
}
return this._componentRef;
}
set componentRef(componentRef) {
this._componentRef = componentRef;
}
get element() {
return this.componentRef.location.nativeElement;
}
_componentRef;
ngOnDestroy() {
if (!isPresent(this._componentRef)) {
return;
}
this.element.parentElement.removeChild(this.element);
this.componentRef.destroy();
this.componentRef = null;
}
show() {
this.element.style.display = '';
}
hide() {
this.element.style.display = 'none';
}
move(left, top, offset = 0) {
this.element.style.left = `${left + offset}px`;
this.element.style.top = `${top + offset}px`;
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DragAndDropAssetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DragAndDropAssetService });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DragAndDropAssetService, decorators: [{
type: Injectable
}] });