@progress/kendo-angular-treeview
Version:
Kendo UI TreeView for Angular
103 lines (100 loc) • 4.14 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 { 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: "18.2.14", ngImport: i0, type: DropHintComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", 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: `
@if (!template) {
<div
class="k-drop-hint k-drop-hint-h"
>
<div class='k-drop-hint-start'></div>
<div class='k-drop-hint-line'></div>
</div>
}
@if (template) {
<ng-template
[ngTemplateOutlet]="template"
[ngTemplateOutletContext]="{
action: action,
sourceItem: sourceItem,
destinationItem: destinationItem
}"
>
</ng-template>
}
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropHintComponent, decorators: [{
type: Component,
args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'kendo-treeview-drop-hint',
template: `
@if (!template) {
<div
class="k-drop-hint k-drop-hint-h"
>
<div class='k-drop-hint-start'></div>
<div class='k-drop-hint-line'></div>
</div>
}
@if (template) {
<ng-template
[ngTemplateOutlet]="template"
[ngTemplateOutletContext]="{
action: action,
sourceItem: sourceItem,
destinationItem: destinationItem
}"
>
</ng-template>
}
`,
standalone: true,
imports: [NgTemplateOutlet]
}]
}], ctorParameters: () => [{ 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']
}] } });