@progress/kendo-angular-treeview
Version:
Kendo UI TreeView for Angular
99 lines (96 loc) • 4.18 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 { Component, HostBinding, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
import { NgIf, NgTemplateOutlet } from '@angular/common';
import * as i0 from "@angular/core";
/**
* @hidden
*/
export class DropHintComponent {
changeDetectorRef;
hostClass = true;
/**
* Defines the drag hint content template.
*/
template;
position = 'fixed';
pointerEvents = 'none';
/**
* The attempted operation according to the current drop target.
*/
action;
/**
* The look-up info for the currently dragged item.
*/
sourceItem;
/**
* The look-up info for the destination item.
*/
destinationItem;
constructor(changeDetectorRef) {
this.changeDetectorRef = changeDetectorRef;
}
// exposed as a public method that can be called from outside as the component uses `OnPush` strategy
detectChanges() {
this.changeDetectorRef.detectChanges();
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropHintComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DropHintComponent, isStandalone: true, selector: "kendo-treeview-drop-hint", host: { properties: { "class.k-drop-hint-container": "this.hostClass", "style.position": "this.position", "style.pointer-events": "this.pointerEvents" } }, ngImport: i0, template: `
<div
*ngIf="!template"
class="k-drop-hint k-drop-hint-h"
>
<div class='k-drop-hint-start'></div>
<div class='k-drop-hint-line'></div>
</div>
<ng-template
*ngIf="template"
[ngTemplateOutlet]="template"
[ngTemplateOutletContext]="{
action: action,
sourceItem: sourceItem,
destinationItem: destinationItem
}"
>
<ng-template>
`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropHintComponent, decorators: [{
type: Component,
args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'kendo-treeview-drop-hint',
template: `
<div
*ngIf="!template"
class="k-drop-hint k-drop-hint-h"
>
<div class='k-drop-hint-start'></div>
<div class='k-drop-hint-line'></div>
</div>
<ng-template
*ngIf="template"
[ngTemplateOutlet]="template"
[ngTemplateOutletContext]="{
action: action,
sourceItem: sourceItem,
destinationItem: destinationItem
}"
>
<ng-template>
`,
standalone: true,
imports: [NgIf, NgTemplateOutlet]
}]
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { hostClass: [{
type: HostBinding,
args: ['class.k-drop-hint-container']
}], position: [{
type: HostBinding,
args: ['style.position']
}], pointerEvents: [{
type: HostBinding,
args: ['style.pointer-events']
}] } });