import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef } from '@angular/core'; import { AbstractControl, ControlValueAccessor, NgControl, Validator } from '@angular/forms'; import { Observable, Subject } from 'rxjs'; import { TranslocoScope, TranslocoService } from '@jsverse/transloco'; import type { InputmaskOptions } from '@sebgroup/green-angular/src/v-angular/input-mask'; import { DateCharacters } from '../models/dates'; import * as i0 from "@angular/core"; export declare abstract class DateControlValueAccessorComponent implements AfterViewInit, OnInit, OnChanges, OnDestroy, ControlValueAccessor, Validator { ngControl: NgControl; protected translocoScope: TranslocoScope; protected elementRef: ElementRef; protected cdr: ChangeDetectorRef; private _transloco; /** Custom template for displaying the content of the label. * Specified by nesting an `Custom Label`. */ labelContentTpl?: TemplateRef; /** Custom template for displaying value when the input is locked. * Specified by nesting an `Custom locked content date: {{ selectedDate }}`. */ lockedTpl?: TemplateRef; /** Reference to the native child input element. */ inputRef?: ElementRef; /** Id of the host element and is accessible by the children, automatically generated if not provided. */ id: any; /** Name of the child input element. */ name?: string; /** Label of the child input element using the default template. * Can be overwritten by specifying an `Custom Label`. */ label?: string; /** Text shown before input has a written value. Default current date format by locale of transloco */ set placeholder(value: string | undefined); get placeholder(): string | undefined; private _placeholder; defaultPlaceholder?: string; /** What characters to use in date placeholder, e.g. {year: 'Y', month: 'M', day: 'D'} */ dateCharacters?: DateCharacters; /** Role of the child input element. https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles */ role?: string; /** Value of the child input element. Mostly used in conjunction with radio and checkboxes. */ value: any; /** An error string to be shown under invalid inputs. Overwrites any form errors. */ error?: string; /** A list of errors string to be shown under invalid inputs. Overwrites any form errors. */ errorList?: string[]; /** Adds an icon before each error message. */ withErrorIcon?: boolean; /** Description of the child input element. Both visibly and as `aria-label`. */ description?: string; /** If set to true, the browser will try to automatically set focus to the child input element. */ autofocus: boolean; /** Default value of the child input element. */ defaultValue?: any; /** If passed, the component will listen for updates and will reset its value. */ reset?: Observable; /** Adds (Optional) to input label. */ optional?: boolean | null | undefined; /** * Settings for input mask for dates based on locale * @see {@link getLocaleDateMask} use this tool to generate settings for `dateInputMask` */ set dateInputMask(dateMask: InputmaskOptions); get dateInputMask(): InputmaskOptions; private _dateInputMask; private _locked; /** Hides the input borders and displays current value as a text. */ set locked(value: boolean | null | undefined); get locked(): boolean | null | undefined; /** If set to true, using a controls disabled state will display input as locked. */ displayDisabledAsLocked?: boolean | null | undefined; private _required; /** Override the required flag of the component. */ set required(value: boolean | null | undefined); /** Child input element is considered required and changes default label template accordingly. */ get required(): boolean | null | undefined; private _invalid; /** Override the invalid state of the component. */ set invalid(value: boolean); /** The component has the invalid state, usually decorating the elements red and shows the first error. */ get invalid(): boolean; private _valid; /** Override the valid state of the component. */ set valid(value: boolean); /** The component has the valid state, usually decorating the elements green. */ get valid(): boolean; /** The component has the focused state, updated by the child input element's focus state. */ focused: boolean; /** The component has the disabled state, usually muting the colors and removes interaction. */ disabled: boolean; /** Locale for using correct language in the datepicker. */ locale: string | undefined; /** Date format used for placeholder and input mask. Should be in lower case {year: 'y', month: 'm', day: 'd'} */ dateFormat: string | undefined; /** Date locale used for placeholder and input mask. */ dateLocale: string | undefined; /** Toggler for showing or hiding the input field */ protected showInputDateSrc: Subject; /** Emits focus events triggered by the child elements. */ readonly ngvFocus: EventEmitter; /** Emits focus events triggered by the child elements. */ readonly ngvBlur: EventEmitter; /** @internal */ protected onChange: (_: any) => void; /** @internal */ protected onTouched: () => void; /** @internal */ protected onValidatorChange: () => void; private _state; scope: string | undefined; /** @internal */ private _onDestroy$; /** * Creates a new BaseControlValueAccessorComponent. * @param ngControl optional FormControl provided when component is used in a form, through dependency injection. */ constructor(ngControl: NgControl, translocoScope: TranslocoScope, elementRef: ElementRef, cdr: ChangeDetectorRef, _transloco: TranslocoService); static parseDateLike(value: any): null | undefined | string; ngOnInit(): void; ngAfterViewInit(): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; /** @internal */ onFocus(event: Event): void; /** @internal */ onBlur(event: Event): void; detectChanges(): void; /** Sets the focus on the actual input element. */ setFocus(): void; /** * @internal * Update placeholder and input mask to match locale. * Order if choice for locale: * 1. dateLocale - Used for specifying which locale to be used for formatting date * 2. locale - Unless dateLocale is not provided, use locale form current translation * 3. transloco.getActiveLang - as last resort, get active language form trnasloco * If locale is undefined, transloco.activeLang will be used instead. */ updatePlaceholderAndMask(): void; updateFormat(): void; /** Internal state/value that the native input element has. */ get state(): any; /** * Internal state/value that the native input element has. */ set state(value: any); /** Writes a new value to the child input element. */ writeValue(value: any): void; /** Registers a callback function that is called when the child input element's value changes. */ registerOnChange(fn: (value: any) => void): void; /** Registers a callback function that is called when the child input element triggers on blur. */ registerOnTouched(fn: () => void): void; /** Function that is called by the forms API when the control status changes to or from 'DISABLED'. */ setDisabledState(isDisabled: boolean): void; /** Method that performs synchronous validation against the provided control. Used for internal validation. */ validate(_control: AbstractControl): { [name: string]: any; } | null; /** Registers a callback function to call when the validator inputs change. */ registerOnValidatorChange(fn: () => void): void; /** Returns the first entry in an error object. */ get firstError(): { code: string; params: Record; } | null; private updateValue; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; }