import { AfterContentInit, AfterViewChecked, ChangeDetectorRef, QueryList } from '@angular/core'; import { FieldNoteDirective } from './field-note.directive'; import { FieldErrorDirective } from './field-error.directive'; import { LabelComponent } from '../../label/src/label.component'; import { BooleanInput } from '@angular/cdk/coercion'; import { FieldControl } from './field-control'; import { FieldLabelDirective } from './field-label.directive'; import { DomPortal } from '@angular/cdk/portal'; import { IconSizeProvider } from '../../icon/src/icon-size-provider'; import { RadioGroupComponent } from '../../radio/src/radio-group.component'; import { CheckboxGroupComponent } from '../../checkbox/src/checkbox-group.component'; import { IconRegistry } from '../../icon/public_api'; import * as i0 from "@angular/core"; import * as i1 from "../../common/sapphire-view-encapsulation"; /** * A field is a common container for labelable controls such as select, radio group, text field, * etc. * * In addition to the field control (sp-select, sp-radio-group, sp-text-field), the following * components can be used inside a field: * - sp-field-label: is used to provide the label text for the field. * - sp-help-button: is placed in the label area, next to the label text * - sp-field-error: is used to provide an error message, which is placed below the field's * control. * - sp-field-note: is used to provide a note, which is placed below the field's control. Only * shown * when there is no error * - sp-field-note-suffix: is used to provide a suffix, which is placed on the right side of the * note area. * * Additionally, field supports: * - Label placement either above (default) or on the side of the control. * - Associating label with the control, so that clicking the label focuses the control, showing * focus ring. * - Optionally showing necessity indicator in the label. Fields necessity (required or optional) * is determined based on the presence of @angular/form's {@link RequiredValidator}. */ export declare class FieldComponent implements AfterContentInit, AfterViewChecked, IconSizeProvider { private changeDetectorRef; private fieldset?; /** * Whether the necessity indicator should be visible. */ necessityIndicator?: BooleanInput; /** * Label placement with respect to the form control. * @default "above" */ labelPlacement?: 'side' | 'above'; /** * Avoid the default width */ noDefaultWidth?: BooleanInput; /** * Allow both note and error at the same time * @default false */ allowNoteAndError?: BooleanInput; /** * @default "lg" */ size?: 'lg' | 'md' | 'sm'; note?: FieldNoteDirective; error?: FieldErrorDirective; label?: LabelComponent; _fieldLabel?: FieldLabelDirective; /** * Focusable, labelable control. Components like Select, RadioGroup or TextField, * that are meant to rendered inside sp-field, provide FieldControl. */ controls?: QueryList; radioGroup?: RadioGroupComponent; checkboxGroup?: CheckboxGroupComponent; private ngControl?; private requiredValidator?; private suffixPortalOutlet; /** * Is set via field-note-affix directive. ContentChild query can't be used since we need * to query from content -> view in some cases. * @internal */ _noteSuffixPortal: DomPortal | null; private changed; constructor(changeDetectorRef: ChangeDetectorRef, iconRegistry: IconRegistry, fieldset?: FieldsetComponent | undefined); ngAfterContentInit(): void; ngAfterViewInit(): void; ngAfterViewChecked(): void; /** * Whether the field contains an error message (sp-field-error). * Also checks if a parent fieldset has an error. */ hasError(targetField?: FieldControl): boolean; private _hasOwnError; private _isFieldControl; /** * If there are multiple controls, the field is only disabled when all of them are disabled */ isDisabled(): boolean; /** * If any of the controls should be constrained by the field's default widht */ controlHasDefaultWidth(): boolean; /** * Only support features like `for` or `labelClick` if the field has one control. */ get control(): FieldControl | undefined; get isGroup(): boolean; /** * Whether the field control is radio group (sp-radio-group). */ hasRadioGroupChild(): boolean; /** * Whether the field control is a checkbox group (sp-checkbox-group). */ hasCheckboxGroupChild(): boolean; get labelNecessityIndicator(): LabelComponent['necessityIndicator']; _setSuffixPortal(portal: DomPortal | null): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * `sp-fieldset` groups related inputs that together form a single field. Each input must be wrapped in a `sp-field` component. */ export declare class FieldsetComponent extends FieldComponent { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }