import * as i0 from '@angular/core'; import { InputSignalWithTransform, InputSignal, EmbeddedViewRef, TemplateRef, ViewContainerRef, Signal, ElementRef, WritableSignal, ModelSignal, OnDestroy, Injector, Type, Provider, OutputEmitterRef, EventEmitter } from '@angular/core'; import * as _juulsgaard_ngx_forms_core from '@juulsgaard/ngx-forms-core'; import { FormUnit, FormRoot, FormLayer, FormList, ControlFormLayer, FormNode, FormNodeEvent, FormSelectNode, BaseFormDialog, FormDialog, FormNodeType, AnonFormNode, FormValidationContext, FormPage } from '@juulsgaard/ngx-forms-core'; import * as _juulsgaard_ngx_forms from '@juulsgaard/ngx-forms'; import * as rxjs from 'rxjs'; import { Subject, Observable, Subscribable } from 'rxjs'; import { ThemePalette, ErrorStateMatcher } from '@angular/material/core'; import { MatFormFieldAppearance, MatFormFieldControl } from '@angular/material/form-field'; import { MapFunc, Selection, SimpleObject } from '@juulsgaard/ts-tools'; import { UntypedFormControl, FormGroupDirective, NgForm } from '@angular/forms'; import { RenderSourceDirective } from '@juulsgaard/ngx-tools'; import { TemplateDialogInstance, DialogManagerService } from '@juulsgaard/ngx-ui'; import { FocusOptions as FocusOptions$1 } from '@angular/cdk/a11y'; declare class FormDirective> { private templateRef; private viewContainer; form: InputSignalWithTransform, FormRoot | { readonly form: FormRoot; }>; readonly show: InputSignal; view?: EmbeddedViewRef>; constructor(templateRef: TemplateRef>, viewContainer: ViewContainerRef); get control(): FormRoot; static ngTemplateContextGuard>(directive: FormDirective, context: unknown): context is FormDirectiveContext; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, "[ngxForm]", never, { "form": { "alias": "ngxForm"; "required": true; "isSignal": true; }; "show": { "alias": "ngxFormWhen"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>; } interface FormDirectiveContext> { ngxForm: TControls; } declare class FormLayerDirective> { private templateRef; private viewContainer; readonly layer: InputSignal>; readonly show: InputSignal; view?: EmbeddedViewRef>; constructor(templateRef: TemplateRef>, viewContainer: ViewContainerRef); static ngTemplateContextGuard>(directive: FormLayerDirective, context: unknown): context is FormLayerDirectiveContext; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, "[ngxFormLayer]", never, { "layer": { "alias": "ngxFormLayer"; "required": true; "isSignal": true; }; "show": { "alias": "ngxFormLayerWhen"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>; } interface FormLayerDirectiveContext> { ngxFormLayer: TControls; } declare class FormListDirective> { private templateRef; private viewContainer; readonly list: InputSignal>; readonly show: InputSignal; views: Map, EmbeddedViewRef>>; constructor(templateRef: TemplateRef>, viewContainer: ViewContainerRef); private clear; static ngTemplateContextGuard>(directive: FormListDirective, context: unknown): context is FormListDirectiveContext; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, "[ngxFormList][ngxFormListIn]", never, { "list": { "alias": "ngxFormListIn"; "required": true; "isSignal": true; }; "show": { "alias": "ngxFormListWhen"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>; } declare class FormListDirectiveContext> { $implicit: TControls; ngxFormListIn: TControls[]; index: number; layer: ControlFormLayer; constructor(layer: ControlFormLayer, index: number, list: TControls[]); update(layer: ControlFormLayer, index: number, list: TControls[]): boolean; } declare class FormCardComponent { readonly icon: InputSignal; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class FormFlowWrapperComponent { readonly minWidth: InputSignal; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class NgxFormCardTitleDirective { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class NgxFormCardDescriptionDirective { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class NgxFormCardTextDirective { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class NgxFormCardWarningDirective { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare abstract class BaseInputComponent { readonly baseClass = true; protected inputElementRef: Signal | undefined>; /** The main input element */ protected inputElement: Signal; /** A list of all NgModels in the input */ private ngModels; readonly requiredIn: InputSignalWithTransform; readonly hideRequired: InputSignalWithTransform; protected required: Signal; private _touched; readonly touched: Signal; readonly changed: Signal; markAsTouched(): void; markAsUntouched(): void; /** The internal error state used for input level errors */ protected inputError: WritableSignal; private inputErrors; readonly errors: Signal; readonly hasError: Signal; protected readonly errorMatcher: Signal<_juulsgaard_ngx_forms.TouchedErrorStateMatcher | _juulsgaard_ngx_forms.AlwaysErrorStateMatcher | _juulsgaard_ngx_forms.NeverErrorStateMatcher>; readonly canShowError: Signal; readonly showError: Signal; /** The internal error state used for input level warnings */ protected inputWarning: WritableSignal; private inputWarnings; readonly warnings: Signal; readonly hasWarning: Signal; /** A controls that contains the input value / state */ readonly control: InputSignal | FormNode | undefined>; readonly valueIn: ModelSignal; readonly valueIn$: InputSignalWithTransform | Observable | undefined, Subject | Subscribable | undefined | null>; private externalSubject; protected externalValue: Signal; protected _value: WritableSignal; /** The value representing the internal input state */ protected get value(): TVal; /** The value representing the internal input state */ protected set value(val: TVal); readonly disabledIn: InputSignalWithTransform; /** Marks that the input should be shown as disabled */ protected disabled: Signal; /** Disable hiding the input when it's disabled */ readonly showDisabledIn: InputSignalWithTransform; protected showDisabled: Signal; /** Marks whether the input should be displayed or not */ protected show: Signal; private formScope; readonly readonlyIn: InputSignalWithTransform; protected readonly: Signal; /** The input label */ readonly labelIn: InputSignal; protected label: Signal; /** A placeholder text, if not set the label will be used */ readonly placeholderIn: InputSignal; protected placeholder: Signal; /** Input to tell the browser what type of autocomplete the input should use */ readonly autocompleteIn: InputSignal; protected autocomplete: Signal; /** Focus the input when it's first created */ readonly autofocusIn: InputSignalWithTransform; protected autofocus: Signal; /** Add a tooltip with additional information about the input */ readonly tooltipIn: InputSignal; protected tooltip: Signal; /** Set the theme color for the input */ readonly colorIn: InputSignal; protected color: Signal; /** Change the material input style */ readonly appearanceIn: InputSignal; protected appearance: Signal; /** Hide the required asterisk */ readonly directionIn: InputSignal<"ltr" | "rtl" | "auto" | undefined>; protected direction: Signal<"ltr" | "rtl" | "auto" | undefined>; private lastValue?; private element; private scrollContainer; protected constructor(); /** Focus the input */ focus(options?: FocusOptions): void; /** Select the contents of the input */ select(): void; scrollTo(): void; /** * Processes the value from the FormNode before it is assigned to the inputValue prop * @param value The value to processed */ abstract preprocessValue(value: TIn | undefined): TVal; /** * Processes the value generated by the input component and returns the value that is stored in the FormNode * @param value The value to be processed */ abstract postprocessValue(value: TVal): TIn | undefined; /** * Generate an initial value for the internal state */ getInitialValue(): TVal; /** Handle events dispatched from the FormNode */ protected handleAction(event: FormNodeEvent): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, never, never, { "requiredIn": { "alias": "required"; "required": false; "isSignal": true; }; "hideRequired": { "alias": "hideRequired"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "valueIn": { "alias": "value"; "required": false; "isSignal": true; }; "valueIn$": { "alias": "value$"; "required": false; "isSignal": true; }; "disabledIn": { "alias": "disabled"; "required": false; "isSignal": true; }; "showDisabledIn": { "alias": "showDisabled"; "required": false; "isSignal": true; }; "readonlyIn": { "alias": "readonly"; "required": false; "isSignal": true; }; "labelIn": { "alias": "label"; "required": false; "isSignal": true; }; "placeholderIn": { "alias": "placeholder"; "required": false; "isSignal": true; }; "autocompleteIn": { "alias": "autocomplete"; "required": false; "isSignal": true; }; "autofocusIn": { "alias": "autofocus"; "required": false; "isSignal": true; }; "tooltipIn": { "alias": "tooltip"; "required": false; "isSignal": true; }; "colorIn": { "alias": "color"; "required": false; "isSignal": true; }; "appearanceIn": { "alias": "appearance"; "required": false; "isSignal": true; }; "directionIn": { "alias": "direction"; "required": false; "isSignal": true; }; }, { "valueIn": "valueChange"; }, never, never, true, never>; } declare abstract class BaseSelectInputComponent extends BaseInputComponent { abstract readonly multiple: TMultiple; readonly control: InputSignal | FormNode<(TMultiple extends true ? TValue[] : TValue) | undefined> | FormSelectNode | undefined>; protected selectControl: Signal | undefined>; private controlItems$; private controlItems; readonly itemsIn: InputSignal; protected items: Signal; protected readonly mappedItems: Signal[]>; protected empty: Signal; readonly hideEmptyIn: InputSignalWithTransform; protected hideEmpty: Signal; protected hidden: Signal; readonly clearableIn: InputSignalWithTransform; protected clearable: Signal; readonly selectGroupsIn: InputSignalWithTransform; protected selectGroups: Signal; constructor(); readonly bindValue: InputSignalWithTransform | undefined, string | Selection | undefined | null>; private controlBindValue; protected getValue: Signal | undefined>; protected mapValue(item: TItem): TValue; readonly bindLabel: InputSignalWithTransform | undefined, string | Selection | undefined | null>; private controlBindLabel; protected getLabel: Signal | undefined>; protected mapLabel(item: TItem): string; readonly bindOption: InputSignalWithTransform | undefined, string | Selection | undefined | null>; private controlBindOption; protected getOption: Signal | undefined>; protected mapOption(item: TItem): string; readonly groupByIn: InputSignalWithTransform | undefined, string | Selection | undefined | null>; protected groupBy: Signal | undefined>; getInitialValue(): TState; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, never, never, { "itemsIn": { "alias": "items"; "required": false; "isSignal": true; }; "hideEmptyIn": { "alias": "hideEmpty"; "required": false; "isSignal": true; }; "clearableIn": { "alias": "clearable"; "required": false; "isSignal": true; }; "selectGroupsIn": { "alias": "selectGroupsIn"; "required": false; "isSignal": true; }; "bindValue": { "alias": "bindValue"; "required": false; "isSignal": true; }; "bindLabel": { "alias": "bindLabel"; "required": false; "isSignal": true; }; "bindOption": { "alias": "bindOption"; "required": false; "isSignal": true; }; "groupByIn": { "alias": "groupBy"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>; } declare class FormSelectValue { readonly value: T; readonly id: TId; readonly name: string; constructor(value: T, id?: TId, name?: string); } declare abstract class BaseMultiSelectInputComponent extends BaseSelectInputComponent { readonly multiple = true; readonly control: InputSignal | FormNode | FormSelectNode | undefined>; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, never, never, { "control": { "alias": "control"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>; } declare abstract class BaseSingleSelectInputComponent extends BaseSelectInputComponent { readonly multiple = false; readonly control: InputSignal | FormNode | FormSelectNode | FormSelectNode | undefined>; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, never, never, { "control": { "alias": "control"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>; } declare class TouchedErrorStateMatcher implements ErrorStateMatcher { isErrorState(control: UntypedFormControl | null, form: FormGroupDirective | NgForm | null): boolean; } declare const touchedErrorStateMatcher: TouchedErrorStateMatcher; declare class AlwaysErrorStateMatcher implements ErrorStateMatcher { isErrorState(control: UntypedFormControl | null, form: FormGroupDirective | NgForm | null): boolean; } declare const alwaysErrorStateMatcher: AlwaysErrorStateMatcher; declare class NeverErrorStateMatcher implements ErrorStateMatcher { isErrorState(control: UntypedFormControl | null, form: FormGroupDirective | NgForm | null): boolean; } declare const neverErrorStateMatcher: NeverErrorStateMatcher; declare abstract class FormContext { abstract readonly readonly: Signal; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class FormWrapperComponent extends FormContext { readonly submitted: i0.OutputEmitterRef; readonly fieldset: InputSignalWithTransform; readonly readonly: InputSignalWithTransform; constructor(); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** Form rendering for a FormDialog. Can only be used inside Form Dialogs */ declare class FormDialogDirective> { readonly viewContainer: ViewContainerRef; readonly template: TemplateRef>; form: InputSignalWithTransform, BaseFormDialog>; private view?; readonly show: i0.WritableSignal; constructor(viewContainer: ViewContainerRef, template: TemplateRef>); static ngTemplateContextGuard>(directive: FormDialogDirective, context: unknown): context is DialogFormContext; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, "[ngxDialogForm]", never, { "form": { "alias": "dialogForm"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>; } interface DialogFormContext> { dialogForm: TControls; } declare class FormDialogComponent> implements OnDestroy { private manager; private injector; readonly showErrors: i0.WritableSignal; readonly config: InputSignal>; readonly formTemplate: i0.Signal> | undefined>; readonly content: i0.Signal>; readonly footer: i0.Signal>; readonly canClose: InputSignalWithTransform; private defaults; instance?: TemplateDialogInstance; constructor(manager: DialogManagerService, injector: Injector); ngOnDestroy(): void; destroy(): void; formSubmit(): Promise; onEnter(event: Event | KeyboardEvent): Promise; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "ngx-form-dialog", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "canClose": { "alias": "canClose"; "required": false; "isSignal": true; }; }, {}, ["formTemplate"], ["*"], true, never>; } interface FormInputConfig { register(type: FormNodeType, component: Type>): this; } declare class FormInputRegistry { private map; constructor(map: Map>>); getComponent(type: FormNodeType): Type> | undefined; } declare function provideFormInputs(builder: (cfg: FormInputConfig) => void): Provider; declare class FormInputDirective { /** The input label */ readonly label: InputSignal; /** A placeholder text, if not set the label will be used */ readonly placeholder: InputSignal; /** Input to tell the browser what type of autocomplete the input should use */ readonly autocomplete: InputSignal; /** Focus the input when it's first created */ readonly autofocus: InputSignalWithTransform; /** Add a tooltip with additional information about the input */ readonly tooltip: InputSignal; /** Set the theme color for the input */ readonly color: InputSignal; /** Change the material input style */ readonly appearance: InputSignal; /** Hide the required asterisk */ readonly direction: InputSignal<"ltr" | "rtl" | "auto" | undefined>; readonly disabled: InputSignalWithTransform; readonly readonly: InputSignalWithTransform; readonly control: InputSignal; private registry; private viewContainer; private component?; constructor(); private updateComponentInputs; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare abstract class NgxFormFieldDirective implements MatFormFieldControl { static nextId: number; protected uid: string; readonly idIn: InputSignal; protected readonly _id: i0.Signal; get id(): string; readonly ngxModel: ModelSignal; readonly control: InputSignal | FormNode | undefined>; private readonly _value; readonly touched: i0.OutputEmitterRef; readonly ngControl: null; protected element: any; private lastValue?; protected constructor(); protected abstract writeValue(value: T | undefined): void; protected setValue(value: T | undefined): void; get value(): T | undefined; set value(value: T | undefined); private readonly _stateChanges; readonly stateChanges: rxjs.Observable; protected update(): void; readonly placeholderIn: InputSignal; protected readonly _placeholder: i0.Signal; get placeholder(): string; protected readonly _focused: i0.WritableSignal; get focused(): boolean; protected readonly _empty: i0.Signal; get empty(): boolean; protected abstract isEmpty(value: T | undefined): boolean; protected readonly _shouldLabelFloat: i0.Signal; get shouldLabelFloat(): boolean; readonly requiredIn: InputSignalWithTransform; protected readonly _required: i0.Signal; get required(): boolean; readonly disabledIn: InputSignalWithTransform; protected readonly _disabled: i0.Signal; get disabled(): boolean; readonly nodeErrorState: i0.Signal; readonly errorStateIn: InputSignalWithTransform; protected readonly _errorState: i0.Signal; get errorState(): boolean; readonly controlType = "ngx-input"; protected readonly _autofilled: i0.WritableSignal; get autofilled(): boolean; readonly userAriaDescribedByIn: InputSignal; protected readonly _userAriaDescribedBy: i0.Signal; get userAriaDescribedBy(): string; onContainerClick(): void; setDescribedByIds(ids: string[]): void; abstract focus(options?: FocusOptions): void; protected onFocus(): void; protected onBlur(): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, never, never, { "idIn": { "alias": "id"; "required": false; "isSignal": true; }; "ngxModel": { "alias": "ngxModel"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "placeholderIn": { "alias": "placeholder"; "required": false; "isSignal": true; }; "requiredIn": { "alias": "required"; "required": false; "isSignal": true; }; "disabledIn": { "alias": "disabled"; "required": false; "isSignal": true; }; "errorStateIn": { "alias": "showError"; "required": false; "isSignal": true; }; "userAriaDescribedByIn": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; }, { "ngxModel": "ngxModelChange"; "touched": "touched"; }, never, never, true, never>; } declare class NgxInputDirective extends NgxFormFieldDirective { protected _inMdcFormField: boolean; private autofillMonitor; constructor(); focus(options: FocusOptions$1 | undefined): void; protected isEmpty(value: T | undefined): boolean; protected writeValue(value: T | undefined): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, "input[ngxInput], textarea[ngxInput], [contentEditable][ngxInput]", never, {}, {}, never, never, true, never>; } declare class FormErrorStateComponent { readonly errors: InputSignalWithTransform; readonly warnings: InputSignalWithTransform; tooltip: i0.Signal; readonly button: InputSignalWithTransform; readonly show: InputSignal; readonly showChange: OutputEmitterRef; toggleErrors(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class FormErrorsComponent { show: InputSignalWithTransform; showAllIn: ModelSignal; private _showAll; showAll: Signal; errors: InputSignalWithTransform; warnings: InputSignalWithTransform; list: Signal; hasMore: Signal; first: Signal; rest: Signal; constructor(); toggle(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } interface Data { type: 'warning' | 'error'; message: string; icon?: string; scrollTo?: () => void; context?: FormValidationContext; } declare class FormHeaderComponent { readonly form: InputSignal>; back: EventEmitter; close: EventEmitter; showErrors: EventEmitter; readonly heading: InputSignal; readonly subHeading: InputSignal; readonly hideClose: InputSignalWithTransform; readonly hideBack: InputSignalWithTransform; private uiContext; constructor(); static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "ngx-form-header", never, { "form": { "alias": "form"; "required": true; "isSignal": true; }; "heading": { "alias": "heading"; "required": false; "isSignal": true; }; "subHeading": { "alias": "subHeading"; "required": false; "isSignal": true; }; "hideClose": { "alias": "hideClose"; "required": false; "isSignal": true; }; "hideBack": { "alias": "hideBack"; "required": false; "isSignal": true; }; }, { "back": "back"; "close": "close"; "showErrors": "showErrors"; }, never, ["*"], true, never>; } declare class FormSubmitComponent { readonly form: InputSignal>; readonly disableShortcut: i0.InputSignalWithTransform; private tabContext; private formContext; readonly showErrors: i0.WritableSignal; readonly readonly: i0.Signal; constructor(); onSubmit(): void; onDelete(): void; onShowChange(show: boolean): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "ngx-form-submit", never, { "form": { "alias": "form"; "required": true; "isSignal": true; }; "disableShortcut": { "alias": "disableShortcut"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>; } export { AlwaysErrorStateMatcher, BaseInputComponent, BaseMultiSelectInputComponent, BaseSelectInputComponent, BaseSingleSelectInputComponent, FormCardComponent, FormContext, FormDialogComponent, FormDialogDirective, FormDirective, FormErrorStateComponent, FormErrorsComponent, FormFlowWrapperComponent, FormHeaderComponent, FormInputDirective, FormInputRegistry, FormLayerDirective, FormListDirective, FormSelectValue, FormSubmitComponent, FormWrapperComponent, NeverErrorStateMatcher, NgxFormCardDescriptionDirective, NgxFormCardTextDirective, NgxFormCardTitleDirective, NgxFormCardWarningDirective, NgxFormFieldDirective, NgxInputDirective, TouchedErrorStateMatcher, alwaysErrorStateMatcher, neverErrorStateMatcher, provideFormInputs, touchedErrorStateMatcher }; export type { DialogFormContext, FormInputConfig };