UNPKG

@progress/kendo-angular-treeview

Version:
42 lines (41 loc) 2.1 kB
/**----------------------------------------------------------------------------------------- * 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 { dataItemsEqual, isPresent } from '../../utils'; import { DropHintComponent } from './drop-hint.component'; import { DragAndDropAssetService } from '../editing-services/drag-and-drop-asset.service'; import * as i0 from "@angular/core"; /** * @hidden */ export class DropHintService extends DragAndDropAssetService { constructor() { super(); } initialize(container, template) { if (isPresent(this._componentRef)) { this.ngOnDestroy(); } this.componentRef = container.createComponent(DropHintComponent); this.hide(); this.componentRef.instance.template = template; this.componentRef.changeDetectorRef.detectChanges(); } updateDropHintData(action, sourceItem, destinationItem) { const dropHint = this.componentRef.instance; if (action === dropHint.action && dataItemsEqual(sourceItem, dropHint.sourceItem) && dataItemsEqual(destinationItem, dropHint.destinationItem)) { return; } dropHint.action = action; dropHint.sourceItem = sourceItem; dropHint.destinationItem = destinationItem; dropHint.detectChanges(); } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropHintService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropHintService }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropHintService, decorators: [{ type: Injectable }], ctorParameters: function () { return []; } });