# API of `@koobiq/components/timepicker`

Documented on [Timepicker](https://koobiq.io/en/components/timepicker.md). NgModule: `KbqTimepickerModule`.

## Directives

### KbqTimepicker (directive)

```ts
@Directive({ selector: 'input[kbqTimepicker]', exportAs: 'kbqTimepicker' })
class KbqTimepicker<D> implements KbqFormFieldControl<D>, ControlValueAccessor, Validator {
    readonly errorStateMatcher = input<ErrorStateMatcher>();
    readonly disabled = input<boolean>(false);
    readonly format = input<TimeFormats>(DEFAULT_TIME_FORMAT);
    readonly min = input<D | null>(null);
    readonly max = input<D | null>(null);
    readonly id = input<string | undefined>();
    readonly value = input<D | null | undefined>();
    readonly kbqValidationTooltip = input<KbqTooltipTrigger | undefined>();
    readonly incorrectInput = output<void>();
    get hasSelection(): boolean;
    get isFullFormat(): boolean;
    get isShortFormat(): boolean;
    get viewValue(): string;
    get ngControl(): any;
    selectionStart: number | null;
    selectionEnd: number | null;
    get timeFormatPlaceholder(): string;
    onInput: () => void;
    getSize(): number;
    focus(): void;
    focusChanged(isFocused: boolean): void;
    onBlur(): void;
    onPaste(event: ClipboardEvent): void;
    onKeyDown(event: KeyboardEvent): void;
    validate(control: AbstractControl): ValidationErrors | null;
    registerOnValidatorChange(fn: () => void): void;
}
```

- `[errorStateMatcher]`: `ErrorStateMatcher` — Object used to control when error messages are shown.
- `[disabled]`: `boolean` — Whether the timepicker is disabled. Also set by the bound form control.
- `[format]`: `TimeFormats` — Time format the input parses and renders. An unsupported value falls back to the default.
- `[min]`: `D | null` — Earliest time the control accepts. Anything the date adapter cannot read is treated as unset.
- `[max]`: `D | null` — Latest time the control accepts. Anything the date adapter cannot read is treated as unset.
- `[id]`: `string | undefined` — Unique id of the element, generated when not provided.
- `[value]`: `D | null | undefined` — The time the control holds: set with `[value]`, by the form control and by typing. The model value is
  adapted to the active zone, while the rendered text is owned by `writeValue` and by typing — a write made
  with `emitModelToViewChange: false` updates this signal without rewriting the text, and `(valueChange)`
  is not emitted for it.
- `[kbqValidationTooltip]`: `KbqTooltipTrigger | undefined` — Tooltip shown for a moment whenever a keystroke is rejected.
- `[localeOverrides]`: `KbqPartialLocaleData | undefined` — Localized strings for this element and its subtree, keyed by locale section. Every key is optional at
  every depth.
- `timeFormatPlaceholder`: `string` — Localized placeholder

## Enums

### TimeFormats (enum)

```ts
enum TimeFormats {
    HHmmss = 'HH:mm:ss',
    HHmm = 'HH:mm'
}
```

### TimeParts (enum)

```ts
enum TimeParts {
    hours,
    minutes,
    seconds
}
```

## Constants

### AM_PM_FORMAT_REGEXP (const)

```ts
const AM_PM_FORMAT_REGEXP: RegExp;
```

### DEFAULT_TIME_FORMAT (const)

```ts
const DEFAULT_TIME_FORMAT: TimeFormats;
```

### HOURS_MINUTES_REGEXP (const)

```ts
const HOURS_MINUTES_REGEXP: RegExp;
```

### HOURS_MINUTES_SECONDS_REGEXP (const)

```ts
const HOURS_MINUTES_SECONDS_REGEXP: RegExp;
```

### HOURS_ONLY_REGEXP (const)

```ts
const HOURS_ONLY_REGEXP: RegExp;
```

### HOURS_PER_DAY (const)

```ts
const HOURS_PER_DAY: number;
```

### kbqTimepickerLocaleConfigurationProvider (const)

Utility provider for `KBQ_TIMEPICKER_LOCALE_CONFIGURATION`. Only the strings you pass are overridden; the rest
keep following the active locale.

```ts
const kbqTimepickerLocaleConfigurationProvider: (
    configuration: KbqDeepPartial<KbqTimepickerLocaleConfiguration>
) => Provider;
```

### MINUTES_PER_HOUR (const)

```ts
const MINUTES_PER_HOUR: number;
```

### SECONDS_PER_MINUTE (const)

```ts
const SECONDS_PER_MINUTE: number;
```

### TIMEFORMAT_PLACEHOLDERS (const)

```ts
const TIMEFORMAT_PLACEHOLDERS: { [timeFormat: string]: string };
```

### TimeFormatToLocaleKeys (const)

Object that maps each time format to a related locale key

```ts
const TimeFormatToLocaleKeys: Record<TimeFormats, 'full' | 'short'>;
```
