import * as i0 from '@angular/core';
import { OnInit } from '@angular/core';
import { ControlValueAccessor, AbstractControl } from '@angular/forms';
import { FormFieldControlBaseComponent, FormFieldControl } from '@talenra/ngx-base/form-field';
/**
* Values accepted by the `InputComponent`'s `type` property.
*
* ```html
*
* ```
*
* ### Import
*
* ```typescript
* import { InputType } from '@talenra/ngx-base/input';
* ```
*
* @see {@link InputComponent}
* @see {@link TInputType}
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#input_types|MDN: Input type}
*/
declare const InputType: {
readonly Email: "email";
readonly Number: "number";
readonly Password: "password";
readonly Search: "search";
readonly Tel: "tel";
readonly Text: "text";
readonly Url: "url";
};
/**
* Type of values accepted by the `InputComponent`'s `type` property.
*
* ### Import
*
* ```typescript
* import { TInputType } from '@talenra/ngx-base/input';
* ```
*
* @see {@link InputComponent}
* @see {@link InputType}
*/
type TInputType = (typeof InputType)[keyof typeof InputType];
/**
* `` provides consistent styling and behaviour for form inputs and textareas.
* It is typically used as child of ``.
*
* #### Reactive form
*
* ```typescript
* // Component class
* sampleForm: FormGroup = new FormGroup({
* lastName: new FormControl(''),
* comment: new FormControl(''),
* });
* ```
*
* ```html
*
*
* ```
*
* #### Template driven form
*
* ```typescript
* // Import `FormsModule` in the declaring module
* import { FormsModule } from '@angular/forms';
* @NgModule({
* // ...
* imports: [FormsModule],
*})
* ```
*
* ```typescript
* // Component class
* lastName = '';
* comment = '';
* ```
*
* ```html
*
*
* ```
*
* #### Formless
*
* ```typescript
* // Component class
* lastName = '';
* comment = '';
* ```
*
* ```html
*
*
*
*
*
*
*
*
* ```
*
* ### Import
*
* ```typescript
* import { InputModule } from '@talenra/ngx-base/input';
* ```
*
* ../../#/input
*
* @see {@link FormFieldComponent}
*/
declare class InputComponent extends FormFieldControlBaseComponent implements OnInit, ControlValueAccessor, FormFieldControl {
/**
* The value provided to the input elements `type` attribute. Supports a subset of the native input element's types.
*
* ```html
*
* ```
*
* @see {@link InputComponent}
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#input_types|MDN: Input type}
*/
type: TInputType;
/** Determines whether the control is disabled/enabled. */
get disabled(): boolean;
/** Set the control's disabled state */
set disabled(value: boolean);
/**
* Determines whether the control is read-only.
*
* ```html
*
* ```
*/
get readonly(): boolean;
/** Set the control's read-only state */
set readonly(value: boolean);
/** @internal */
_readonly: boolean;
/** Controls whether the control is in focusable. */
private updateTabindex;
/** @internal */
get isEmpty(): boolean;
/** Determines whether the input has vertical scroll offset (textarea only) */
hasScroll: i0.WritableSignal;
/** Determines whether the host element is of type textarea */
private isTextarea;
private hostClass;
private destroyRef;
private elementRef;
private ngControl;
/** @internal */
constructor();
/** @internal */
ngOnInit(): void;
/**
* Triggered by scroll listener. Checks whether a textarea's content has vertical scroll offset and updates
* `hasScroll` property.
*/
private scrolled;
/** @internal */
handleChange(): void;
private focusChanged;
/** Sets the focus to the input. */
focus(): void;
/**
* Clear the value and focus the input element. Triggered by the clear button in FormField.
*
* @internal
*/
clearValue(): void;
/** @internal */
updateHostClass(): void;
/** Used for property binding in component's metadata */
private readonly FormFieldStatus;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵcmp: i0.ɵɵComponentDeclaration;
static ngAcceptInputType_disabled: unknown;
static ngAcceptInputType_readonly: unknown;
}
/**
* The directive is applied to an `InputComponent` (``) to support users
* entering social security numbers (Swiss OASI/AHV/AVS numbers).
*
* - Prefill the input-field with the prefix it gets focus.
* - Auto-format input values
*
* You might want to limit the input value to 16 characters (the length of a Swiss OASI/AHV/AVS number including
* separators).
*
* ```html
*
*
*
* ```
*
* You might want to use `InputValidator.socialSecurityNumber` to validate the input.
*
* ```typescript
* form: FormGroup = new FormGroup({
* socialSecurityNumber: new FormControl('', [InputValidators.socialSecurityNumber]),
* });
* ```
*
* Example for a valid input: 756.9217.0769.85
*
* ### Import
*
* ```typescript
* import { InputModule } from '@talenra/ngx-base/input';
* ```
*
* @see {@link InputValidators.socialSecurityNumber}
*
* ../../#/input
*/
declare class SocialSecurityNumberDirective implements OnInit {
/** @internal */
private control;
private ngControl;
private ssnPipe;
/** @internal */
ngOnInit(): void;
/** Add/remove the prefix '756.' when the field gets/looses focus and the field has no value. */
private handleFocus;
/** Remove the auto-filled prefix if the pasted value already includes it. */
private handlePaste;
/** Auto-format input */
private handleInput;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵdir: i0.ɵɵDirectiveDeclaration;
}
/**
* The directive is applied to an `InputComponent` (``) to support users
* entering billing numbers (German: "Abrechnungsnummer", e.g. AB.123.456).
*
* - Auto-format input values
* - Converts letters to upper-case
*
* You might want to limit the input value to 17 characters (the maximum length of billing numbers including
* separators).
*
* ```html
*
*
*
* ```
*
* You might want to use `InputValidator.billingNumber` to validate the input.
*
* ```typescript
* form: FormGroup = new FormGroup({
* billingNumber: new FormControl('', [InputValidators.billingNumber]),
* });
* ```
*
* Example for a valid input: A1.234.567
*
* ### Import
*
* ```typescript
* import { InputModule } from '@talenra/ngx-base/input';
* ```
*
* @see {@link InputValidators.billingNumber}
*
* ../../#/input
*/
declare class BillingNumberDirective implements OnInit {
private control;
private ngControl;
private billingNrPipe;
/** @internal */
ngOnInit(): void;
/** Auto-format input */
private handleInput;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵdir: i0.ɵɵDirectiveDeclaration;
}
/**
* Form validators for inputs.
*
* ```typescript
* form: FormGroup = new FormGroup({
* socialSecurityNumber: new FormControl('', [InputValidators.socialSecurityNumber])
* });
* ```
*
* ### Import
*
* ```typescript
* import { InputValidators } from '@talenra/ngx-base/input';
* ```
*/
declare class InputValidators {
/**
* Validates a Swiss social security number.
*
* Example for a valid value: 756.9217.0769.85
*
* @returns `null` if valid, `{ socialSecurityNumber: true }` if invalid.
*
* @see {@link SocialSecurityNumberDirective}
*/
static socialSecurityNumber(control: AbstractControl): {
socialSecurityNumber: boolean;
} | null;
/**
* Validates billing number (German: "Abrechnungsnummer").
*
* Examples for a valid values: EF.132, EF1.45K.123
*
* @returns `null` if valid, `{ socialSecurityNumber: true }` if invalid.
*
* @see {@link BillingNumberDirective}
*/
static billingNumber(control: AbstractControl): {
billingNumber: boolean;
} | null;
}
export { BillingNumberDirective, InputComponent, InputType, InputValidators, SocialSecurityNumberDirective };
export type { TInputType };