@progress/kendo-angular-treelist
Version:
Kendo UI TreeList for Angular - Display hierarchical data in an Angular tree grid view that supports sorting, filtering, paging, and much more.
59 lines (58 loc) • 2.91 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 { Directive, TemplateRef, Optional, Input } from '@angular/core';
import { OptionChangesService } from '../../common/option-changes.service';
import * as i0 from "@angular/core";
import * as i1 from "../../common/option-changes.service";
/**
* Represents the toolbar template of the TreeList ([see example](slug:toolbartemplate_treelist)).
*
* The template context has the following field:
* - `position`—The position at which the toolbar template is rendered. The possible values are `top`, `bottom`, and `both`.
*
* @example
* ```html
* <kendo-treelist ...>
* <ng-template kendoTreeListToolbarTemplate>
* <button kendoTreeListExcelCommand>Export to Excel</button>
* </ng-template>
* </kendo-treelist>
* ```
*/
export class ToolbarTemplateDirective {
templateRef;
optionChanges;
_position = "top";
/**
* Sets the position of the toolbar. The value can be `top`, `bottom`, or `both`.
* Controls whether the toolbar appears above, below, or on both sides of the TreeList. [See example.](slug:toolbartemplate_treelist#toc-setting-the-toolbar-position)
* @default 'top'
*/
set position(position) {
this._position = position;
this.optionChanges.optionChanged();
}
get position() {
return this._position;
}
constructor(templateRef, optionChanges) {
this.templateRef = templateRef;
this.optionChanges = optionChanges;
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ToolbarTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }, { token: i1.OptionChangesService }], target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: ToolbarTemplateDirective, isStandalone: true, selector: "[kendoTreeListToolbarTemplate]", inputs: { position: "position" }, ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ToolbarTemplateDirective, decorators: [{
type: Directive,
args: [{
selector: '[kendoTreeListToolbarTemplate]',
standalone: true
}]
}], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
type: Optional
}] }, { type: i1.OptionChangesService }]; }, propDecorators: { position: [{
type: Input,
args: ["position"]
}] } });