UNPKG

@progress/kendo-angular-layout

Version:

Kendo UI for Angular Layout Package - a collection of components to create professional application layoyts

45 lines (44 loc) 2.64 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { Directive, Optional, TemplateRef } from '@angular/core'; import * as i0 from "@angular/core"; /** * Defines a template that specifies the item content of the Drawer. * To define the template, nest an `<ng-template>` tag with the `kendoDrawerItemTemplate` directive inside the `<kendo-drawer>` tag. * * The `let-item` context variable provides access to the item data. * * For the Hierarchical Drawer, the `kendoDrawerItemTemplate` directive provides additional context fields: * * * `level`&mdash;A number that indicates the nesting level of the current item. Use the `let-level="level"` syntax to access the nesting level. * * `hasChildren`&mdash;A boolean that indicates whether the current item has nested items. Use the `let-hasChildren="hasChildren"` syntax to access the value. * * `isItemExpanded`&mdash;A boolean that holds information about the expanded state of the current item, which indicates whether its children are visible or not. Use the `let-isItemExpanded="isItemExpanded"` syntax to access the value of the expanded state. * * @example * ```html * <kendo-drawer> * <ng-template kendoDrawerItemTemplate let-item> * <span class="custom-item">{{ item.text }}</span> * </ng-template> * </kendo-drawer> * ``` */ export class DrawerItemTemplateDirective { templateRef; constructor(templateRef) { this.templateRef = templateRef; } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DrawerItemTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: DrawerItemTemplateDirective, isStandalone: true, selector: "[kendoDrawerItemTemplate]", ngImport: i0 }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DrawerItemTemplateDirective, decorators: [{ type: Directive, args: [{ selector: '[kendoDrawerItemTemplate]', standalone: true }] }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{ type: Optional }] }]; } });