@controladad/ng-base
Version:
Everything you need for Angular
97 lines (96 loc) • 6.19 kB
TypeScript
import { AfterViewInit, ChangeDetectorRef, DestroyRef, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
import { MatFormField } from '@angular/material/form-field';
import { BehaviorSubject, Subscription } from 'rxjs';
import { DateFilterFn, MatDatepicker } from '@angular/material/datepicker';
import { InputmaskOptions } from '../../../directives';
import { ItemRecords$ } from '../../../../core';
import { CacSelectOptionsComponent } from '../select-options';
import { QuillModules } from 'ngx-quill';
import { FormControlExtended } from '@al00x/forms';
import * as i0 from "@angular/core";
export type FieldInputType = 'text' | 'password' | 'password-eye' | 'number' | 'number-nobtn' | 'time';
export type FieldControlType = 'input' | 'date' | 'datetime' | 'textarea' | 'select' | 'rich-text' | 'file';
export type FieldAppearanceType = 'outlined' | 'simple' | 'compact';
export type FieldMaskType = 'time';
export type FieldFloatLabelType = 'always' | 'auto';
export declare class CacFieldComponent<T> implements OnInit, AfterViewInit, OnDestroy, OnChanges {
private cdr;
readonly destroyRef: DestroyRef;
formField: MatFormField;
inputElement?: ElementRef<HTMLInputElement>;
selectElement?: ElementRef<HTMLInputElement>;
selectOptions?: CacSelectOptionsComponent<any>;
datepickerElement?: MatDatepicker<any>;
fileInputElement?: ElementRef<HTMLInputElement>;
control: FormControlExtended;
value?: any;
controlType: FieldControlType;
appearance?: FieldAppearanceType;
label?: string;
placeholder?: string;
align?: 'left' | 'right';
prefixIcon?: string;
suffixIcon?: string;
suffix?: string;
prefix?: string;
hideError?: boolean;
invisibleError?: boolean;
clearable: boolean;
hint?: string;
loading: boolean;
hideStar: boolean;
floatLabel?: FieldFloatLabelType;
inputType: FieldInputType;
maskType?: FieldMaskType;
items: ItemRecords$<T, any> | undefined;
categories?: ItemRecords$<string | number, any>;
multiple?: boolean;
optional: boolean;
searchable: boolean;
showIcons: boolean;
autoComplete: boolean | 'new-password' | string;
textareaRows?: number;
resizable: boolean;
hideSuffix: boolean;
dateFilter: DateFilterFn<any>;
menuClass?: string;
min: number;
fileAccept?: string;
fileMaxSize?: number;
quillModules: QuillModules;
onSelect: EventEmitter<T>;
controlSub: Subscription;
itemsUpdateSub: Subscription;
showPassword$: BehaviorSubject<boolean>;
inputMask?: InputmaskOptions<any>;
isLoading: import("@angular/core").WritableSignal<boolean>;
isFocused: import("@angular/core").WritableSignal<boolean>;
isMenuOpen: import("@angular/core").WritableSignal<boolean>;
hasStar: import("@angular/core").WritableSignal<boolean>;
overrideFloatLabel: import("@angular/core").WritableSignal<FieldFloatLabelType | undefined>;
protected tempControl: FormControlExtended<unknown, any>;
constructor(cdr: ChangeDetectorRef);
ngOnInit(): void;
ngAfterViewInit(): void;
ngOnChanges(changes: SimpleChanges): void;
ngOnDestroy(): void;
reset(): void;
setFocus(state: boolean): void;
focus(): void;
protected onClearClick(e: MouseEvent): void;
protected onFocus(): void;
protected onBlur(): void;
protected onFileBrowse(e: MouseEvent): void;
protected onFileInput(e: Event): void;
protected onFormFieldClick(): void;
protected onNumericUp(): void;
protected onNumericDown(): void;
protected onSelectOptionsMultiple(v: any[]): void;
protected openDatePicker(e: MouseEvent): void;
protected onDatePickerClose(): void;
private numericAddToValue;
protected passwordVisibility(): void;
private formatFileSize;
static ɵfac: i0.ɵɵFactoryDeclaration<CacFieldComponent<any>, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<CacFieldComponent<any>, "cac-field", never, { "control": { "alias": "control"; "required": false; }; "value": { "alias": "value"; "required": false; }; "controlType": { "alias": "controlType"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "align": { "alias": "align"; "required": false; }; "prefixIcon": { "alias": "prefixIcon"; "required": false; }; "suffixIcon": { "alias": "suffixIcon"; "required": false; }; "suffix": { "alias": "suffix"; "required": false; }; "prefix": { "alias": "prefix"; "required": false; }; "hideError": { "alias": "hideError"; "required": false; }; "invisibleError": { "alias": "invisibleError"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "hideStar": { "alias": "hideStar"; "required": false; }; "floatLabel": { "alias": "floatLabel"; "required": false; }; "inputType": { "alias": "inputType"; "required": false; }; "maskType": { "alias": "maskType"; "required": false; }; "items": { "alias": "items"; "required": false; }; "categories": { "alias": "categories"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "optional": { "alias": "optional"; "required": false; }; "searchable": { "alias": "searchable"; "required": false; }; "showIcons": { "alias": "showIcons"; "required": false; }; "autoComplete": { "alias": "autoComplete"; "required": false; }; "textareaRows": { "alias": "textareaRows"; "required": false; }; "resizable": { "alias": "resizable"; "required": false; }; "hideSuffix": { "alias": "hideSuffix"; "required": false; }; "dateFilter": { "alias": "dateFilter"; "required": false; }; "menuClass": { "alias": "menuClass"; "required": false; }; "min": { "alias": "min"; "required": false; }; "fileAccept": { "alias": "fileAccept"; "required": false; }; "fileMaxSize": { "alias": "fileMaxSize"; "required": false; }; "quillModules": { "alias": "quillModules"; "required": false; }; }, { "onSelect": "onSelect"; }, never, ["[slot=suffix]"], true, never>;
}