@progress/kendo-angular-label
Version:
Kendo UI Label for Angular
117 lines (116 loc) • 3.92 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 { AfterContentInit, ElementRef, Renderer2 } from '@angular/core';
import { LocalizationService } from '@progress/kendo-angular-l10n';
import { LabelDirective } from './../label.directive';
import * as i0 from "@angular/core";
/**
* Represents the [Kendo UI Label component for Angular]({% slug overview_label %}).
*
* Use the `LabelComponent` to associate a label with input elements or components.
*
* @example
* ```html
* <kendo-label [for]="input" text="First name">
* <kendo-textbox #input></kendo-textbox>
* </kendo-label>
* ```
* @remarks
* Supported children components are: {@link CustomMessagesComponent}.
*/
export declare class LabelComponent implements AfterContentInit {
private elementRef;
private renderer;
private localization;
/**
* Specifies the `dir` attribute value for the component.
* @hidden
*/
direction: string;
/**
* Sets the text content of the Label. Use this property to describe the input.
*
* @example
* ```html
* <kendo-label text="Email"></kendo-label>
* ```
*/
text: string;
/**
* Associates the label with a component by a template reference or with an HTML element by `id`.
*
* @example
* ```html
* <input #myInput />
* <kendo-label [for]="myInput" text="Username"></kendo-label>
* ```
*/
set for(forValue: any);
get for(): any;
/**
* Marks a form field as optional. When enabled, the label displays the `Optional` text by default.
* You can customize the text by providing a custom message. ([See example]({% slug label_globalization %}#toc-custom-messages)).
*
* @default false
* @example
* ```html
* <kendo-label text="Phone" [optional]="true"></kendo-label>
* ```
*/
optional: boolean;
/**
* Sets the CSS styles for the label element.
* Accepts values supported by the [`ngStyle`](link:site.data.urls.angular['ngstyleapi']) directive.
*
* @example
* ```html
* <kendo-label text="Name" [labelCssStyle]="{ color: 'red' }"></kendo-label>
* ```
*/
labelCssStyle: any;
/**
* Sets the CSS classes for the label element.
* Accepts values supported by the [`ngClass`](link:site.data.urls.angular['ngclassapi']) directive.
*
* @example
* ```html
* <kendo-label text="Address" [labelCssClass]="'custom-label'"></kendo-label>
* ```
*/
labelCssClass: any;
labelDirective: LabelDirective;
kendoInput: any;
/**
* @hidden
*/
control: string | {
focus: Function;
};
private subscriptions;
private _for;
constructor(elementRef: ElementRef, renderer: Renderer2, localization: LocalizationService);
/**
* @hidden
*/
ngAfterContentInit(): void;
/**
* @hidden
*/
ngOnInit(): void;
/**
* @hidden
*/
ngAfterViewInit(): void;
/**
* @hidden
*/
ngOnDestroy(): void;
/**
* @hidden
*/
textFor(key: string): string;
static ɵfac: i0.ɵɵFactoryDeclaration<LabelComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<LabelComponent, "kendo-label", ["kendoLabel"], { "text": { "alias": "text"; "required": false; }; "for": { "alias": "for"; "required": false; }; "optional": { "alias": "optional"; "required": false; }; "labelCssStyle": { "alias": "labelCssStyle"; "required": false; }; "labelCssClass": { "alias": "labelCssClass"; "required": false; }; }, {}, ["kendoInput"], ["*"], true, never>;
}