UNPKG

@progress/kendo-angular-inputs

Version:

Kendo UI for Angular Inputs Package - Everything you need to build professional form functionality (Checkbox, ColorGradient, ColorPalette, ColorPicker, FlatColorPicker, FormField, MaskedTextBox, NumericTextBox, RadioButton, RangeSlider, Slider, Switch, Te

118 lines (117 loc) 4.91 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { AfterViewInit, ElementRef, Renderer2, QueryList, AfterViewChecked, SimpleChanges, OnChanges, OnDestroy } from '@angular/core'; import { NgControl } from '@angular/forms'; import { LocalizationService } from '@progress/kendo-angular-l10n'; import { ShowOptions } from './models/show-options'; import { ErrorComponent } from './error.component'; import { HintComponent } from './hint.component'; import { Orientation } from './models/orientation'; import { FormService } from '../common/formservice.service'; import { ResponsiveFormBreakPoint } from '../common/models/responsive-breakpoints'; import * as i0 from "@angular/core"; /** * Represents the Kendo UI FormField component for Angular. * Use this component to group form-bound controls (Kendo Angular components or native HTML controls). * Applies styling and behavior rules. * * @example * ```html * <kendo-formfield> * <kendo-label [for]="firstName"text="First Name"></kendo-label> * <kendo-textbox formControlName="firstName" #firstName></kendo-textbox> * <kendo-formhint>Enter your name.</kendo-formhint> * <kendo-formerror>First name is required.</kendo-formerror> * </kendo-formfield> * ``` * * @remarks * Supported children components are: {@link ErrorComponent}, {@link HintComponent}, {@link TextBoxComponent}, {@link NumericTextBoxComponent}, {@link MaskedTextBoxComponent}, {@link TextAreaComponent}, {@link DatePickerComponent}, {@link DateTimePickerComponent}, {@link DateInputComponent}, {@link OTPInputComponent}. */ export declare class FormFieldComponent implements AfterViewInit, AfterViewChecked, OnChanges, OnDestroy { private renderer; private localizationService; private hostElement; private formService; hostClass: boolean; /** * @hidden */ direction: string; get errorClass(): boolean; get disabledClass(): boolean; set formControls(formControls: QueryList<NgControl>); controlElementRefs: QueryList<ElementRef>; kendoInput: any; errorChildren: QueryList<ErrorComponent>; hintChildren: QueryList<HintComponent>; /** * Specifies when to show the hint messages: * * `initial`&mdash;Shows hints when the form control is `valid` or `untouched` and `pristine`. * * `always`&mdash;Always shows hints. * * @default 'initial' */ showHints: ShowOptions; /** * Specifies the layout orientation of the form field. * * @hidden * * @default 'vertical' */ orientation: Orientation; /** * Specifies when to show the error messages: * * `initial`&mdash;Shows errors when the form control is `invalid` and `touched` or `dirty`. * * `always`&mdash;Always shows errors. * * @default 'initial' */ showErrors: ShowOptions; /** * Defines the colspan for the form field. * Can be a number or an array of responsive breakpoints. */ colSpan: number | ResponsiveFormBreakPoint[]; /** * @hidden */ get horizontal(): boolean; /** * @hidden */ get hasHints(): boolean; /** * @hidden */ get hasErrors(): boolean; private control; private subscriptions; private rtl; private _formWidth; private _colSpanClass; private _previousColSpan; constructor(renderer: Renderer2, localizationService: LocalizationService, hostElement: ElementRef<HTMLElement>, formService: FormService); ngAfterViewInit(): void; ngAfterViewChecked(): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; private disabledKendoInput; private disabledControl; private disabledElement; private validateFormControl; private isControlGroup; private isRadioControl; private updateDescription; private findControlElements; private generateDescriptionIds; private showHintsInitial; private showErrorsInitial; private setDescription; private updateColSpanClass; static ɵfac: i0.ɵɵFactoryDeclaration<FormFieldComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<FormFieldComponent, "kendo-formfield", never, { "showHints": { "alias": "showHints"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; "showErrors": { "alias": "showErrors"; "required": false; }; "colSpan": { "alias": "colSpan"; "required": false; }; }, {}, ["kendoInput", "formControls", "controlElementRefs", "errorChildren", "hintChildren"], ["label, kendo-label", "*", "kendo-formhint", "kendo-formerror"], true, never>; }