@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.
78 lines (77 loc) • 4.06 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, forwardRef, ContentChild, SkipSelf, Host, Optional } from '@angular/core';
import { ColumnBase } from './column-base';
import { CellTemplateDirective } from '../rendering/cell-template.directive';
import { OptionChangesService } from '../common/option-changes.service';
import * as i0 from "@angular/core";
import * as i1 from "./column-base";
import * as i2 from "../common/option-changes.service";
/**
* Represents the command column of the TreeList. Define the content of the column inside an `<ng-template>` tag.
* For more information and examples on using the passed fields and command directives, see
* [editing the TreeList in Angular Reactive Forms]({% slug editing_reactive_forms_treelist %}).
*
* Usually, the template contains CRUD command directives such as:
* - [`EditCommandDirective`]({% slug api_treelist_editcommanddirective %})
* - [`RemoveCommandDirective`]({% slug api_treelist_removecommanddirective %})
* - [`CancelCommandDirective`]({% slug api_treelist_cancelcommanddirective %})
* - [`SaveCommandDirective`]({% slug api_treelist_savecommanddirective %})
*
* @example
* ```html
* <kendo-treelist ...>
* <kendo-treelist-column field="ProductID"></kendo-treelist-column>
* <kendo-treelist-command-column title="command">
* <ng-template kendoTreeListCellTemplate>
* <button kendoTreeListEditCommand class="k-primary">Edit</button>
* <button kendoTreeListRemoveCommand>Remove</button>
* </ng-template>
* </kendo-treelist-command-column>
* </kendo-treelist>
* ```
*/
export class CommandColumnComponent extends ColumnBase {
parent;
template;
isCommand = true;
constructor(parent, optionChanges) {
super(parent, optionChanges);
this.parent = parent;
}
get templateRef() {
return this.template ? this.template.templateRef : undefined;
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CommandColumnComponent, deps: [{ token: i1.ColumnBase, host: true, optional: true, skipSelf: true }, { token: i2.OptionChangesService }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CommandColumnComponent, isStandalone: true, selector: "kendo-treelist-command-column", providers: [
{
provide: ColumnBase,
useExisting: forwardRef(() => CommandColumnComponent)
}
], queries: [{ propertyName: "template", first: true, predicate: CellTemplateDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CommandColumnComponent, decorators: [{
type: Component,
args: [{
providers: [
{
provide: ColumnBase,
useExisting: forwardRef(() => CommandColumnComponent)
}
],
selector: 'kendo-treelist-command-column',
template: ``,
standalone: true
}]
}], ctorParameters: function () { return [{ type: i1.ColumnBase, decorators: [{
type: SkipSelf
}, {
type: Host
}, {
type: Optional
}] }, { type: i2.OptionChangesService }]; }, propDecorators: { template: [{
type: ContentChild,
args: [CellTemplateDirective, { static: false }]
}] } });