@progress/kendo-angular-label
Version:
Kendo UI Label for Angular
72 lines (71 loc) • 2.67 kB
TypeScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { ElementRef, Renderer2, NgZone } from '@angular/core';
import * as i0 from "@angular/core";
/**
* Represents the [Kendo UI Label directive for Angular]({% slug label_directive %}).
* Use the `LabelDirective` to link a focusable Angular component or HTML element to a `<label>` tag with the `[for]` property binding.
*
* To link a component with the `label` element:
* - Set the `[for]` property binding to a [template reference variable](link:site.data.urls.angular['templatesyntax']#template-reference-variables--var-), or
* - Set the `[for]` property binding to an `id` HTML string value.
*
* @example
* ```ts
* @Component({
* selector: 'my-app',
* template: `
* <div class="row example-wrapper" style="min-height: 450px;">
* <div class="col-xs-12 col-md-6 example-col">
* <label [for]="datepicker">DatePicker: </label>
* <kendo-datepicker #datepicker></kendo-datepicker>
* </div>
*
* <div class="col-xs-12 col-md-6 example-col">
* <label for="input">Input: </label>
* <input id="input" />
* </div>
* </div>
* `
* })
* class AppComponent { }
* ```
*/
export declare class LabelDirective {
private label;
private renderer;
private zone;
/**
* Sets the focusable target for the label.
* Accepts a [template reference variable](link:site.data.urls.angular['templatesyntax']#template-reference-variables--var-) or an `id` HTML string value.
*/
for: string | {
focus: Function;
};
get labelFor(): string;
/**
* @hidden
* Allows the user to specify if the label CSS class should be rendered or not.
*/
labelClass: boolean;
private clickListener;
constructor(label: ElementRef<HTMLLabelElement>, renderer: Renderer2, zone: NgZone);
/**
* @hidden
*/
ngAfterViewInit(): void;
/**
* @hidden
*/
ngOnDestroy(): void;
/**
* @hidden
*/
setAriaLabelledby(): void;
private getFocusableComponent;
private handleClick;
static ɵfac: i0.ɵɵFactoryDeclaration<LabelDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<LabelDirective, "label[for]", never, { "for": { "alias": "for"; "required": false; }; "labelClass": { "alias": "labelClass"; "required": false; }; }, {}, never, never, true, never>;
}