# API of `@koobiq/components/form-field`

Documented on [Form field](https://koobiq.io/en/components/form-field.md). NgModule: `KbqFormFieldModule`.

## Components

### KbqCleaner (component)

Element to be placed in end of the form field.
Resets form control by click.

```ts
@Component({ selector: 'kbq-cleaner', exportAs: 'kbqCleaner' })
class KbqCleaner extends KbqIconButton {
    readonly ariaLabel = input<string | undefined>(undefined, {
        alias: 'aria-label'
    });
    readonly size = input<KbqIconButtonSize>('normal');
    tabindex = input<number | null | undefined>();
    disabled = input<boolean | undefined>();
    readonly ariaHidden = input<boolean | undefined>(undefined, {
        alias: 'aria-hidden'
    });
    readonly iconSize = input<number | undefined>();
    autoColor = input<boolean | undefined>();
    readonly color = input<T | null | undefined>();
    hasError: boolean;
    iconName: string | undefined;
    get colorClassName(): string;
    getHostElement(): HTMLElement;
    setDefaultColor(color: T): void;
}
```

- `[aria-label]`: `string | undefined` — Accessible name of the cleaner. Defaults to the localized "Clear".
- `[localeOverrides]`: `KbqPartialLocaleData | undefined` — Localized strings for this element and its subtree, keyed by locale section. Every key is optional at
  every depth.
- `[size]`: `KbqIconButtonSize` — Size of the icon button.
- `[tabindex]`: `number | null | undefined` — Position of the button in the tab order. A disabled button is taken out of it entirely.
- `[disabled]`: `boolean | undefined` — Whether the button is disabled.
- `[aria-hidden]`: `boolean | undefined` — Whether the icon is hidden from assistive technology. Left unbound, it falls back to
  `defaultAriaHidden`, which is `true` for a decorative icon and `false` for an interactive one.
- `[iconSize]`: `number | undefined` — Rendered size of the icon in pixels. Left unset, the size is read from the `_<px>` suffix of the
  icon name (`kbq-plus_16` → 16), which is the `@koobiq/icons` convention; a name without one is
  rendered at whatever size the surrounding styles give it.
- `[autoColor]`: `boolean | undefined` — Whether the icon follows the error state of the host it sits in (a form field, for one), painting
  itself red while that host reports an error.
- `[color]`: `T | null | undefined` — Color of the component. A value set in code holds until the input changes, and the default color is used
  while both are unset or falsy.
- `hasError`: `boolean` — Whether the icon takes the error color whatever its `color` is. Set by a host that tints the icons
  it holds, such as `KbqEmptyState`.
- `iconName`: `string | undefined` — Name of an icon within a `@koobiq/icons`. Accepts "namespace:name" syntax.
- `colorClassName`: `string` — current class name of color
- `setDefaultColor()`: `void` — this color will be used as a default value. For example [color]="'' | false | undefined | null".

### KbqError (component)

Error text to be shown below the form field control. It keeps the error color under a disabled control too.

```ts
@Component({ selector: 'kbq-error', exportAs: 'kbqError' })
class KbqError extends KbqHint {
    readonly id = input<string>(`kbq-hint-${nextUniqueId++}`);
    readonly fillTextOff = input<boolean>(false);
    readonly compact = input<boolean>(false);
    readonly color = input<T | null | undefined>();
    get colorClassName(): string;
    setDefaultColor(color: T): void;
}
```

- `[id]`: `string` — Unique ID for the hint. Referenced by the `aria-describedby` of the form field control.
- `[fillTextOff]`: `boolean` — Disables `color` for the hint text.
- `[compact]`: `boolean` — Makes the hint size smaller.
- `[color]`: `T | null | undefined` — Color of the component. A value set in code holds until the input changes, and the default color is used
  while both are unset or falsy.
- `colorClassName`: `string` — current class name of color
- `setDefaultColor()`: `void` — this color will be used as a default value. For example [color]="'' | false | undefined | null".

### KbqFieldset (component)

A group of form-fields and related controls.
Container component emulating the native `fieldset` element.

```ts
@Component({ selector: 'kbq-fieldset', exportAs: 'kbqFieldset' })
class KbqFieldset {}
```

### KbqFormField (component)

Container for form controls that applies styling and behavior.

```ts
@Component({ selector: 'kbq-form-field', exportAs: 'kbqFormField' })
class KbqFormField extends KbqColorDirective {
    readonly noBorders = input<boolean | undefined>(
        this.defaultOptions?.noBorders
    );
    readonly inOverlay = model<boolean | undefined>(
        this.defaultOptions?.inOverlay
    );
    readonly horizontal = input<boolean | undefined>(
        this.defaultOptions?.horizontal
    );
    readonly labelClass = input<string | string[] | Set<string> | undefined>(
        this.defaultOptions?.labelClass
    );
    readonly contentClass = input<string | string[] | Set<string> | undefined>(
        this.defaultOptions?.contentClass
    );
    readonly showRequiredMarker = input<boolean>(
        !!this.defaultOptions?.showRequiredMarker
    );
    readonly color = input<T | null | undefined>();
    get invalid(): boolean;
    readonly labelId: Signal<string | null>;
    readonly isNativeLabelSupported: Signal<boolean>;
    get disabled(): boolean;
    readonly readonly: Signal<boolean>;
    get autofilled(): boolean;
    get colorClassName(): string;
    focus(options?: FocusOptions): void;
    getConnectedOverlayOrigin(): ElementRef;
    setDefaultColor(color: T): void;
}
```

- `[noBorders]`: `boolean | undefined` — Disables form field borders and shadows.
- `[(inOverlay)]`: `boolean | undefined` — Use when KbqFormField is in an overlay container.
- `[horizontal]`: `boolean | undefined` — Whether the form field is displayed horizontally.
- `[labelClass]`: `string | string[] | Set<string> | undefined` — Additional CSS classes applied to the label element.
- `[contentClass]`: `string | string[] | Set<string> | undefined` — Additional CSS classes applied to the content wrapper element.
- `[showRequiredMarker]`: `boolean` — Whether the label of a required control ends with the `*` marker. A control is required by its `required`
  state or by `Validators.required` on its form control.
- `[color]`: `T | null | undefined` — Color of the component. A value set in code holds until the input changes, and the default color is used
  while both are unset or falsy.
- `invalid`: `boolean` — Whether the form field is invalid.
- `labelId`: `Signal<string | null>` — Id of the rendered label, or `null` when the form field has no label.

  `for` only associates a label with a native form control, so a control that is a custom element
  (`kbq-select`, for one) has to point back at the label through `aria-labelledby` instead.
- `isNativeLabelSupported`: `Signal<boolean>` — Whether the control is a native labelable element, so that a `<label>` can associate with it.

  A custom control (`kbq-select`, for one) reports `isNativeLabelSupported: false`; the caption is then rendered
  as a `<span>` instead of a `<label>`, because a label that neither has a `for` matching a labelable
  element nor wraps one is invalid, and the control is named through `aria-labelledby` instead.
- `disabled`: `boolean` — Whether the form field is disabled.
- `readonly`: `Signal<boolean>` — Whether the form field control is read-only.
- `autofilled`: `boolean` — Whether the form field control's value was filled in by the browser. Controls that cannot be
  autofilled do not implement `autofilled`, and report `false` here.

  Reflected as `kbq-form-field_autofilled` for application code to key on. The autofill styling
  does not use it: CSS matches `:autofill` directly, in the same style pass the browser fills
  the field, where this arrives a frame or two later. Keeping the paint on one source also means
  a class left behind by a detached or re-attached control cannot tint a field the browser no
  longer considers autofilled.
- `colorClassName`: `string` — current class name of color
- `focus()`: `void` — Focuses the control.
- `getConnectedOverlayOrigin()`: `ElementRef` — Gets an ElementRef for the element that a overlay attached to the form-field should be positioned relative to.
- `setDefaultColor()`: `void` — this color will be used as a default value. For example [color]="'' | false | undefined | null".

### KbqHint (component)

Hint text to be shown below the form field control.

```ts
@Component({ selector: 'kbq-hint', exportAs: 'kbqHint' })
class KbqHint extends KbqColorDirective {
    readonly id = input<string>(`kbq-hint-${nextUniqueId++}`);
    readonly fillTextOff = input<boolean>(false);
    readonly compact = input<boolean>(false);
    readonly color = input<T | null | undefined>();
    get colorClassName(): string;
    setDefaultColor(color: T): void;
}
```

- `[id]`: `string` — Unique ID for the hint. Referenced by the `aria-describedby` of the form field control.
- `[fillTextOff]`: `boolean` — Disables `color` for the hint text.
- `[compact]`: `boolean` — Makes the hint size smaller.
- `[color]`: `T | null | undefined` — Color of the component. A value set in code holds until the input changes, and the default color is used
  while both are unset or falsy.
- `colorClassName`: `string` — current class name of color
- `setDefaultColor()`: `void` — this color will be used as a default value. For example [color]="'' | false | undefined | null".

### KbqPasswordToggle (component)

Component which changes password visibility.

```ts
@Component({ selector: 'kbq-password-toggle', exportAs: 'kbqPasswordToggle' })
class KbqPasswordToggle extends KbqTooltipTrigger {
    readonly tabindex = input<number>(0);
    readonly kbqTooltipHidden = input<string | TemplateRef<any>>();
    readonly forDisabledComponent = input<Record<'disabledSignal', WritableSignal<boolean>>>();
    readonly ignoreTooltipPointerEvents = input<boolean>(false);
    readonly singleInstance = input<boolean>(
        inject(KBQ_TOOLTIP_SINGLE_INSTANCE_DEFAULT),
        { alias: 'kbqTooltipSingleInstance' }
    );
    hideWithTimeout = input<boolean | undefined>();
    content: string | TemplateRef<any>;
    tooltipVisible: boolean;
    tooltipPlacement: KbqPopUpPlacementValues;
    relativeToPointer: boolean;
    relativeToCaret: boolean;
    relativeToCaretVertical: KbqCaretVerticalAnchor;
    tooltipPlacementPriority: string | string[] | null;
    disabled: boolean;
    enterDelay: number;
    leaveDelay: number;
    trigger: string;
    customClass: string;
    context: unknown;
    color: KbqComponentColors | string;
    arrow: boolean;
    arrowCentered: boolean;
    offset: number | null;
    readonly placementChange: EventEmitter<KbqPopUpPlacementValues>;
    readonly visibleChange: EventEmitter<boolean>;
    modifier: KbqEnumValues<TooltipModifier>;
    header: string | TemplateRef<unknown>;
    isOpen: boolean;
    get isAttached(): boolean;
    get openedChange(): Observable<boolean>;
    show(delay?: number): void;
    hide(delay?: number): void;
    showForMouseEvent(event: MouseEvent): void;
    showForElement(element: HTMLElement): void;
    updateOrigin(origin: KbqOverlayOrigin | null): void;
}
```

- `[kbqTooltipHidden]`: `string | TemplateRef<any>` — Tooltip shown while the password is hidden.
- `[localeOverrides]`: `KbqPartialLocaleData | undefined` — Localized strings for this element and its subtree, keyed by locale section. Every key is optional at
  every depth.
- `[forDisabledComponent]`: `Record<'disabledSignal', WritableSignal<boolean>>` — Input for controlling the disabled state of a component.

  The input expects a component containing `disabledSignal` property, which is
  a writable signal emitting boolean values.
- `[ignoreTooltipPointerEvents]`: `boolean` — Determines whether pointer events should be ignored on tooltips.

  When set to `true`, the tooltip pane does not receive pointer events, so clicks and hovers pass through
  to whatever is underneath it. Defaults to `false`, which keeps the tooltip hoverable: a user who needs
  more time to read it — or who reads at high magnification, where the pointer often ends up over the
  tooltip itself — can move the pointer onto it without it disappearing (WCAG 1.4.13 "Content on Hover").

  Set it to `true` for tooltips that float over other click targets, such as the overflow hints of a
  scrolling option list.
- `[kbqTooltipSingleInstance]`: `boolean` — Whether the tooltip takes part in the "only one tooltip is visible at a time" group: showing it
  hides the previously visible tooltip, and it is hidden when another tooltip is shown.

  Defaults to `true`; the default can be changed application-wide with the
  `KBQ_TOOLTIP_SINGLE_INSTANCE_DEFAULT` token.

  Tooltips without an interactive `kbqTrigger` (`manual`, `none`, …) never take part in the group,
  regardless of this input — they are shown imperatively and are expected to stay pinned.
- `[hideWithTimeout]`: `boolean | undefined` — Changes hiding behavior. By default, tooltip is hidden on mouseleave from trigger.
  Setting hideWithTimeout to true will delay tooltip hiding and will not hide when the mouse moves from trigger
  to tooltip.
- `content`: `string | TemplateRef<any>` — Tooltip shown while the password is visible. Reading it resolves to the tooltip matching the current
  visibility, so that the base trigger renders the right one.
- `tooltipVisible`: `boolean` — Input (`kbqVisible`) that programmatically shows or hides the tooltip; reflects the current `visible` state.
- `tooltipPlacement`: `KbqPopUpPlacementValues` — Input (`kbqPlacement`) that sets the tooltip placement relative to its trigger; reflects the current `placement`.
- `relativeToPointer`: `boolean` — Positions the tooltip relative to the mouse cursor. Only available for top and bottom kbqPlacement.
  Does not work with kbqPlacementPriority.
- `relativeToCaret`: `boolean` — Positions the tooltip relative to the text caret of the field it is attached to, following it while the
  user types, moves the caret and scrolls the field. Anchors to the selection whenever there is one.

  Every placement is available, unlike with `kbqRelativeToPointer`: the caret is anchored as a rectangle,
  so the usual fallback placements keep the tooltip on screen. Wins when both inputs are enabled.

  The field is the host element itself when it is editable, otherwise the first editable it wraps.
- `relativeToCaretVertical`: `KbqCaretVerticalAnchor` — What the tooltip is vertically anchored to while `kbqRelativeToCaret` is enabled.
- `tooltipPlacementPriority`: `string | string[] | null` — Input (`kbqPlacementPriority`) that sets the ordered fallback placements; reflects the current `placementPriority`.
- `disabled`: `boolean` — Input (`kbqTooltipDisabled`) controlling whether the tooltip is disabled; setting it to `true` hides it.
  `undefined` leaves the decision to the trigger, like an unset input.

  Reads back the *effective* state, which for triggers that derive one of their own (see
  `derivedDisabledWins`) is not necessarily the value that was written.
- `enterDelay`: `number` — Input (`kbqEnterDelay`) — delay in milliseconds before the tooltip is shown. Defaults to `400`.
- `leaveDelay`: `number` — Input (`kbqLeaveDelay`) — delay in milliseconds before the tooltip is hidden. Defaults to `0`.
- `trigger`: `string` — Input (`kbqTrigger`) with the comma-separated trigger events. An empty value resets to hover + focus and rebinds listeners.
- `customClass`: `string` — Input (`kbqTooltipClass`) with an extra CSS class applied to the tooltip; updating it refreshes the class map.
- `context`: `unknown` — Input (`kbqTooltipContext`) with the context object passed to a template tooltip; updating it refreshes the open tooltip.
- `color`: `KbqComponentColors | string` — Input (`kbqTooltipColor`) with the tooltip color theme. Defaults to `KbqComponentColors.Contrast`.
- `arrow`: `boolean` — Input (`kbqTooltipArrow`) — whether to render the tooltip's arrow/pointer. Defaults to `false`.
- `arrowCentered`: `boolean` — Input (`kbqTooltipArrowCentered`) — centers the arrow on the trigger while preserving the panel placement.
  Requires a visible arrow. Defaults to `false`.
- `offset`: `number | null` — Input (`kbqTooltipOffset`) — distance in pixels between the tooltip and its trigger. `null` keeps
  the gap of the stylesheet. Defaults to the `offset` of `KBQ_TOOLTIP_DEFAULT_OPTIONS`, when a
  provider in scope set one. Inside a provider scope such as the navbar's, `null`/`undefined` restores
  that inherited default.
- `placementChange`: `EventEmitter<KbqPopUpPlacementValues>` — Output (`kbqPlacementChange`) that emits the new placement whenever the tooltip repositions.
- `visibleChange`: `EventEmitter<boolean>` — Output (`kbqVisibleChange`) that emits when the tooltip's visibility changes.
- `modifier`: `KbqEnumValues<TooltipModifier>` — Visual variant of the tooltip. Accepts `'default'` | `'warning'` | `'extended'`.
  Replaces the removed `KbqWarningTooltipTrigger` and `KbqExtendedTooltipTrigger`
  subclasses — to render a warning tooltip use `kbqTooltipModifier="warning"`,
  and `kbqTooltipModifier="extended"` for the extended variant (combine with `kbqTooltipHeader`).
- `header`: `string | TemplateRef<unknown>` — Header text or template, rendered above the tooltip content. Only meaningful with
  `kbqTooltipModifier="extended"`. Replaces the removed `KbqExtendedTooltipTrigger.header`.
- `isOpen`: `boolean` — Whether the pop-up overlay is currently open.
- `isAttached`: `boolean` — Whether the pop-up overlay is currently attached.

  Unlike `isOpen`, which follows the visibility of the pop-up component and therefore lags a task behind
  `show()`/`hide()`, this flips synchronously — it is the window during which the overlay (and its
  backdrop) is present in the DOM. Part of the `KbqSiblingPopup` contract.
- `openedChange`: `Observable<boolean>` — Emits `true` when the pop-up opens and `false` when it closes. Part of the `KbqSiblingPopup` contract.
- `show()`: `void` — Shows the tooltip after `delay` ms. Suppresses showing while a pop-up on the same element holds the
  anchor or on a focus trigger that did not originate from the keyboard, and applies cursor-relative
  positioning when `relativeToPointer` is enabled.
- `hide()`: `void` — Hides the tooltip after `delay` ms and, when the user has genuinely left the host, un-mutes a tooltip
  that a pop-up on the same element had muted.

  `mouseleave` and `blur` are the release signals because the base class binds `hide` to both regardless
  of whether the tooltip is currently visible. A pop-up that is still attached does not count: its
  backdrop steals the hover from the trigger while the pointer stands still, and that `mouseleave` must
  not be mistaken for the user leaving.
- `showForMouseEvent()`: `void` — Shows the tooltip next to the cursor position of the given mouse event, anchoring it to the event's
  `currentTarget` instead of the directive's own host element.

  Use it when the trigger cannot be declared in the template — for instance for a tooltip shared by the
  cells of a virtualized table. The directive still has to be created in an injection context.
- `showForElement()`: `void` — Shows the tooltip anchored to the given element instead of the directive's own host element.

  Use it when the trigger cannot be declared in the template. The directive still has to be created in an
  injection context:

  ```ts
  const tooltip = runInInjectionContext(injector, () => new KbqTooltipTrigger());
  tooltip.showForElement(element);
  ```

  Does nothing while the tooltip is disabled or has no content — there is no overlay to anchor then.
- `updateOrigin()`: `void` — Positions the pop-up against `origin` — an element, or a rectangle in viewport coordinates such as the one
  `kbqCreateCaretOrigin` keeps on the caret — instead of the host element; `null` restores the host
  element. An open pop-up moves to the new origin at once.

  This moves the position origin only. `setExternalNativeElement` moves the host itself, and with it
  the trigger's event listeners, its focus target and the scroll containers the pop-up follows.

### KbqReactivePasswordHint (component)

Password hint to be shown below the password form field control.

```ts
@Component({
    selector: 'kbq-reactive-password-hint',
    exportAs: 'kbqReactivePasswordHint'
})
class KbqReactivePasswordHint extends KbqHint {
    readonly hasError = input<boolean>(false);
    readonly fillTextOff = input<boolean>(true);
    readonly id = input<string>(`kbq-hint-${nextUniqueId++}`);
    readonly compact = input<boolean>(false);
    readonly color = input<T | null | undefined>();
    get colorClassName(): string;
    setDefaultColor(color: T): void;
}
```

- `[hasError]`: `boolean` — Whether the form field control has an error.
- `[fillTextOff]`: `boolean` — Disables `color` for the hint text.
- `[id]`: `string` — Unique ID for the hint. Referenced by the `aria-describedby` of the form field control.
- `[compact]`: `boolean` — Makes the hint size smaller.
- `[color]`: `T | null | undefined` — Color of the component. A value set in code holds until the input changes, and the default color is used
  while both are unset or falsy.
- `colorClassName`: `string` — current class name of color
- `setDefaultColor()`: `void` — this color will be used as a default value. For example [color]="'' | false | undefined | null".

### KbqStepper (component)

Component which allow to increment or decrement number value.

```ts
@Component({ selector: 'kbq-stepper', exportAs: 'kbqStepper' })
class KbqStepper {
    readonly stepUp = output<void>();
    readonly stepDown = output<void>();
}
```

- `(stepUp)`: `void` — Emitted when the stepper is incremented.
- `(stepDown)`: `void` — Emitted when the stepper is decremented.

## Directives

### KbqFieldsetItem (directive)

Directive for marking elements as items inside `KbqFieldset`

```ts
@Directive({ selector: '[kbqFieldsetItem]', exportAs: 'kbqFieldsetItem' })
class KbqFieldsetItem {}
```

### KbqLabel (directive)

Label for the form field.

```ts
@Directive({ selector: 'kbq-label', exportAs: 'kbqLabel' })
class KbqLabel {}
```

### KbqLegend (directive)

Directive for marking an element as legend of `KbqFieldset`

```ts
@Directive({ selector: '[kbqLegend]', exportAs: 'kbqLegend' })
class KbqLegend {
    readonly id = input<string>(`kbq-legend-${nextLegendUniqueId++}`);
}
```

- `[id]`: `string` — Unique ID for the legend, referenced by the `aria-labelledby` of the fieldset.

### KbqPrefix (directive)

Element to be placed in front of the form field.

```ts
@Directive({ selector: '[kbqPrefix]', exportAs: 'kbqPrefix' })
class KbqPrefix {}
```

### KbqSuffix (directive)

Element to be placed at the end of the form field.

```ts
@Directive({ selector: '[kbqSuffix]', exportAs: 'kbqSuffix' })
class KbqSuffix {}
```

## Classes

### KbqFormFieldControl (abstract class)

An interface which allows a control to work inside of a `KbqFormField`.

Every state member is a signal: the form field derives its own state from them and runs `OnPush`, so a
change of the control reaches it without any notification of the control's own.

```ts
abstract class KbqFormFieldControl<T> {
    readonly value: Signal<T | null>;
    readonly id: Signal<string>;
    readonly placeholder: Signal<string | null | undefined>;
    readonly ngControl: NgControl | null;
    readonly focused: Signal<boolean>;
    readonly empty: Signal<boolean>;
    readonly required: Signal<boolean>;
    readonly disabled: Signal<boolean>;
    readonly errorState: Signal<boolean>;
    readonly readonly?: Signal<boolean>;
    readonly autofilled?: Signal<boolean>;
    readonly controlType?: string;
    readonly isNativeLabelSupported?: boolean;
    setDescribedByIds?: (ids: string[]) => void;
    open?: () => void;
    abstract onContainerClick(event: MouseEvent): void;
    abstract focus(options?: FocusOptions): void;
}
```

- `value`: `Signal<T | null>` — The value of the control.
- `id`: `Signal<string>` — The element ID for this control.
- `placeholder`: `Signal<string | null | undefined>` — The placeholder for this control.
- `ngControl`: `NgControl | null` — Gets the NgControl for this control.
- `focused`: `Signal<boolean>` — Whether the control is focused.
- `empty`: `Signal<boolean>` — Whether the control is empty.
- `required`: `Signal<boolean>` — Whether the control is required.
- `disabled`: `Signal<boolean>` — Whether the control is disabled.
- `errorState`: `Signal<boolean>` — Whether the control is in an error state.
- `readonly?`: `Signal<boolean>` — Whether the control is read-only: it can be focused and its value selected and copied, but not changed.

  Implement it only on a control that has a read-only state. `KbqFormField` then hides the cleaner and adds
  the `kbq-form-field_readonly` class.
- `autofilled?`: `Signal<boolean>` — Whether the control's value was filled in by the browser.

  Implement it only where autofill is reachable: on a control that is itself a text input or a
  textarea, or — like `KbqTagList` — on a wrapper that forwards the state of the input it hosts.
  Leave it out on controls the browser never fills.
- `controlType?`: `string` — An optional name for the control type that can be used to distinguish `kbq-form-field` elements
  based on their control type. The form field will add a class,
  `kbq-form-field-type-{{controlType}}` to its root element.
- `isNativeLabelSupported?`: `boolean` — Whether the control is a native labelable element, so that the `<label for>` a wrapping
  `kbq-form-field` renders associates with it.

  Defaults to `true`. A control rendered as a custom element (`kbq-select`, for one) sets it to
  `false`: a `<label>` with neither a `for` matching a labelable element nor a nested one is
  invalid, so the form field renders the caption as a `<span>` instead and the control is named
  through `aria-labelledby`.
- `setDescribedByIds?`: `(ids: string[]) => void` — Sets the ids of the elements (hints, errors) that describe the control.

  Implement it only when `aria-describedby` has to be placed on an element other than the one
  the control is declared on: `KbqFormField` writes the attribute on the control's host element
  by default.
- `open?`: `() => void` — Opens control's overlay.
- `onContainerClick()`: `void` — Handles a click on the control's container.
- `focus()`: `void` — Focuses the control.

## Types

### KbqFormFieldDefaultOptions (type)

Default options for the kbq-form-field that can be configured using the `KBQ_FORM_FIELD_DEFAULT_OPTIONS`
injection token.

```ts
type KbqFormFieldDefaultOptions = Partial<{
    noBorders: boolean;
    inOverlay: boolean;
    horizontal: boolean;
    labelClass: string | string[] | Set<string>;
    contentClass: string | string[] | Set<string>;
    showRequiredMarker: boolean;
}>;
```

- `noBorders?`: `boolean` — Disables form field borders and shadows.
- `inOverlay?`: `boolean` — Use when KbqFormField is in an overlay container.
- `horizontal?`: `boolean` — Whether the form field is displayed horizontally.
- `labelClass?`: `string | string[] | Set<string>` — Additional CSS classes applied to the label element.
- `contentClass?`: `string | string[] | Set<string>` — Additional CSS classes applied to the content wrapper element.
- `showRequiredMarker?`: `boolean` — Whether the label of a required control ends with the `*` marker.

## Constants

### kbqFormFieldDefaultOptionsProvider (const)

Utility provider for `KBQ_FORM_FIELD_DEFAULT_OPTIONS`.

```ts
const kbqFormFieldDefaultOptionsProvider: (
    options: KbqFormFieldDefaultOptions
) => Provider;
```
