@ng-forge/dynamic-forms 1.3.0-next.2 → 1.3.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ng-forge-dynamic-forms-active-page-initialized.event-CiKN-mcc.mjs +12 -0
- package/fesm2022/ng-forge-dynamic-forms-active-page-initialized.event-CiKN-mcc.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-array-field.component-Dv9mPnJ3.mjs +770 -0
- package/fesm2022/ng-forge-dynamic-forms-array-field.component-Dv9mPnJ3.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-array-item-registry.service-D-AxVLdk.mjs +83 -0
- package/fesm2022/ng-forge-dynamic-forms-array-item-registry.service-D-AxVLdk.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-derivation-orchestrator-EuYCbquo.mjs +1887 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-derivation-orchestrator-EuYCbquo.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-web-mcp-2wQK_wPp.mjs +954 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-web-mcp-2wQK_wPp.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-container-field-processors-C_JRvaVt.mjs +117 -0
- package/fesm2022/ng-forge-dynamic-forms-container-field-processors-C_JRvaVt.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-container-field.component-Bg7Win9n.mjs +228 -0
- package/fesm2022/ng-forge-dynamic-forms-container-field.component-Bg7Win9n.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-css-wrapper.component-R2yc-H0T.mjs +102 -0
- package/fesm2022/ng-forge-dynamic-forms-css-wrapper.component-R2yc-H0T.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-debounce-CG3uP5B-.mjs +4 -0
- package/fesm2022/{ng-forge-dynamic-forms-debounce-C9F4v1Ke.mjs.map → ng-forge-dynamic-forms-debounce-CG3uP5B-.mjs.map} +1 -1
- package/fesm2022/ng-forge-dynamic-forms-default-value-D5M4MNE-.mjs +77 -0
- package/fesm2022/ng-forge-dynamic-forms-default-value-D5M4MNE-.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-dev-mode-4rbYBBo_.mjs +4 -0
- package/fesm2022/ng-forge-dynamic-forms-dev-mode-4rbYBBo_.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-df-field-outlet.directive-CQsDMV-s.mjs +644 -0
- package/fesm2022/ng-forge-dynamic-forms-df-field-outlet.directive-CQsDMV-s.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-field-errors-wrapper.component-DKgkpIpG.mjs +56 -0
- package/fesm2022/ng-forge-dynamic-forms-field-errors-wrapper.component-DKgkpIpG.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-form-schema.service-Dd-gHJ_7.mjs +38 -0
- package/fesm2022/{ng-forge-dynamic-forms-form-schema.service-Dx5Dlb15.mjs.map → ng-forge-dynamic-forms-form-schema.service-Dd-gHJ_7.mjs.map} +1 -1
- package/fesm2022/ng-forge-dynamic-forms-form-state-manager-DcOXRFRL.mjs +1522 -0
- package/fesm2022/ng-forge-dynamic-forms-form-state-manager-DcOXRFRL.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-group-field.component-BjZi0bhq.mjs +292 -0
- package/fesm2022/ng-forge-dynamic-forms-group-field.component-BjZi0bhq.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-integration.mjs +1318 -843
- package/fesm2022/ng-forge-dynamic-forms-integration.mjs.map +1 -1
- package/fesm2022/ng-forge-dynamic-forms-internal.mjs +3326 -3641
- package/fesm2022/ng-forge-dynamic-forms-internal.mjs.map +1 -1
- package/fesm2022/ng-forge-dynamic-forms-page-field.component-BRjQmWC9.mjs +295 -0
- package/fesm2022/ng-forge-dynamic-forms-page-field.component-BRjQmWC9.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-resolve-field-ByGa5cpo.mjs +329 -0
- package/fesm2022/ng-forge-dynamic-forms-resolve-field-ByGa5cpo.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-row-wrapper.component-CuFycQb-.mjs +81 -0
- package/fesm2022/ng-forge-dynamic-forms-row-wrapper.component-CuFycQb-.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-schema-builder-C62afItJ.mjs +400 -0
- package/fesm2022/ng-forge-dynamic-forms-schema-builder-C62afItJ.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-schema-registry.service-axBV9FBH.mjs +45 -0
- package/fesm2022/ng-forge-dynamic-forms-schema-registry.service-axBV9FBH.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-schema.mjs +8 -14
- package/fesm2022/ng-forge-dynamic-forms-schema.mjs.map +1 -1
- package/fesm2022/ng-forge-dynamic-forms-testing.mjs +68 -73
- package/fesm2022/ng-forge-dynamic-forms-testing.mjs.map +1 -1
- package/fesm2022/ng-forge-dynamic-forms-text-field.component--MAh_h4Q.mjs +257 -0
- package/fesm2022/ng-forge-dynamic-forms-text-field.component--MAh_h4Q.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-validation-execution.token-BFyySKtp.mjs +8 -0
- package/fesm2022/ng-forge-dynamic-forms-validation-execution.token-BFyySKtp.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-with-logger-config-BAATqYY0.mjs +94 -0
- package/fesm2022/ng-forge-dynamic-forms-with-logger-config-BAATqYY0.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-wrapper-chain-BnntfNU1.mjs +115 -0
- package/fesm2022/ng-forge-dynamic-forms-wrapper-chain-BnntfNU1.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms.mjs +2136 -3
- package/fesm2022/ng-forge-dynamic-forms.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ng-forge-dynamic-forms-integration.d.ts +543 -415
- package/types/ng-forge-dynamic-forms-internal.d.ts +2319 -2436
- package/types/ng-forge-dynamic-forms-schema.d.ts +13 -16
- package/types/ng-forge-dynamic-forms-testing.d.ts +34 -37
- package/types/ng-forge-dynamic-forms.d.ts +735 -722
- package/fesm2022/ng-forge-dynamic-forms-array-field.component-CSCKq_1K.mjs +0 -750
- package/fesm2022/ng-forge-dynamic-forms-array-field.component-CSCKq_1K.mjs.map +0 -1
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-derivation-orchestrator-CTOTwzzw.mjs +0 -2394
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-derivation-orchestrator-CTOTwzzw.mjs.map +0 -1
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-web-mcp-BtjqeJOj.mjs +0 -1054
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-web-mcp-BtjqeJOj.mjs.map +0 -1
- package/fesm2022/ng-forge-dynamic-forms-container-field.component-Dc3ROhHL.mjs +0 -86
- package/fesm2022/ng-forge-dynamic-forms-container-field.component-Dc3ROhHL.mjs.map +0 -1
- package/fesm2022/ng-forge-dynamic-forms-css-wrapper.component-BzgX8lAD.mjs +0 -33
- package/fesm2022/ng-forge-dynamic-forms-css-wrapper.component-BzgX8lAD.mjs.map +0 -1
- package/fesm2022/ng-forge-dynamic-forms-debounce-C9F4v1Ke.mjs +0 -17
- package/fesm2022/ng-forge-dynamic-forms-field-errors-wrapper.component-CIKbWqYA.mjs +0 -25
- package/fesm2022/ng-forge-dynamic-forms-field-errors-wrapper.component-CIKbWqYA.mjs.map +0 -1
- package/fesm2022/ng-forge-dynamic-forms-form-schema.service-Dx5Dlb15.mjs +0 -24
- package/fesm2022/ng-forge-dynamic-forms-group-field.component-DAC3P9DC.mjs +0 -177
- package/fesm2022/ng-forge-dynamic-forms-group-field.component-DAC3P9DC.mjs.map +0 -1
- package/fesm2022/ng-forge-dynamic-forms-ng-forge-dynamic-forms-CXQe_5td.mjs +0 -5133
- package/fesm2022/ng-forge-dynamic-forms-ng-forge-dynamic-forms-CXQe_5td.mjs.map +0 -1
- package/fesm2022/ng-forge-dynamic-forms-page-field.component-DPKJcwUO.mjs +0 -176
- package/fesm2022/ng-forge-dynamic-forms-page-field.component-DPKJcwUO.mjs.map +0 -1
- package/fesm2022/ng-forge-dynamic-forms-row-wrapper.component-DMEeKZny.mjs +0 -19
- package/fesm2022/ng-forge-dynamic-forms-row-wrapper.component-DMEeKZny.mjs.map +0 -1
- package/fesm2022/ng-forge-dynamic-forms-schema-builder-BvDTzfdM.mjs +0 -570
- package/fesm2022/ng-forge-dynamic-forms-schema-builder-BvDTzfdM.mjs.map +0 -1
- package/fesm2022/ng-forge-dynamic-forms-text-field.component-BB-jutBq.mjs +0 -126
- package/fesm2022/ng-forge-dynamic-forms-text-field.component-BB-jutBq.mjs.map +0 -1
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { AddonActionContext, AddonActionHandler, AddonActionPreset, AddonSlot, AddonTypeDefinition, AddonTypeDefinition as AddonTypeDefinition$1, AnyAddon, ArrayAllowedChildren, ArrayButtonConfig, ArrayField, ArrayItemDefinition, ArrayItemTemplate, AsyncCondition, AsyncConditionFunction, AsyncCustomValidator, AsyncDerivationFunction, AsyncValidatorConfig, AvailableFieldTypes, BaseAddon, BaseAddon as BaseAddon$1, BaseCheckedField, BaseValidatorConfig, BaseValueField, BuiltInValidatorConfig, CheckedFieldComponent, CommonAddonActionPreset, CommonAddonSlot, ComponentAddon, ComponentAddon as ComponentAddon$1, ConditionalExpression, ContainerAllowedChildren, ContainerField, ContainerFieldTypes, CssWrapper, CustomFnConfig, CustomFunction, CustomValidator, CustomValidatorConfig, DF_FIELD_TEMPLATES, DeclarativeHttpValidatorConfig, DerivationLogLevel, DynamicFormActionRegistry, DynamicFormAddonActionPresetRegistry, DynamicFormAddonRegistry, DynamicFormAddonSlotRegistry, DynamicFormError, DynamicFormFieldRegistry, DynamicFormLogger, DynamicText, DynamicValue, EvaluationContext, EventBus, ExtractField, FieldBoundAddonActionContext, FieldComponent, FieldDef, FieldDef as FieldDef$1, FieldMeta, FieldOption, FieldPathAccess, FieldRegistryContainers, FieldRegistryLeaves, FieldRegistryWrappers, FieldTypeDefinition, FieldWithValidation, FieldWrapper, FormConfig, FormConfig as FormConfig$1, FormEvent, FormEvent as FormEvent$1, FormEventConstructor, FormMode, FormModeDetectionResult, FormOptions, FormOptions as FormOptions$1, FormStateCondition, GroupAllowedChildren, GroupField, HiddenField, HiddenScalar, HiddenValue, HttpCondition, HttpCustomValidator, HttpRequestConfig, HttpValidationResponseMapping, InferFormModel, InferFormValue, InferFormValue as InferFormValue$1, InitialPageConfig, LazyComponentLoader, LeafFieldTypes, Logger, Logger as Logger$1, LogicConfig, NarrowField, NarrowFields, NextButtonOptions, NoopLogger, OrphanAddonActionContext, PageAllowedChildren, PageField, RegisteredActionRef, RegisteredFieldTypes, RegisteredFieldTypes as RegisteredFieldTypes$1, ResolvedValidationExecutionConfig, ResolvedValueExclusionConfig, RowAllowedChildren, RowErrorSpec, RowField, SchemaApplicationConfig, SchemaDefinition, SimplifiedArrayField, StateLogicConfig, SubmissionActionResult, SubmissionConfig, SubmitButtonOptions, TemplateAddon, TemplateAddon as TemplateAddon$1, TextAddon, TextAddon as TextAddon$1, TextElementType, TextField, TextProps, TokenContext, ValidationError, ValidationExecutionConfig, ValidationExecutionConfig as ValidationExecutionConfig$1, ValidationMessage, ValidationMessageResolver, ValidationMessages, ValidatorConfig, ValueExclusionConfig, ValueExclusionConfig as ValueExclusionConfig$1, ValueFieldComponent, ValueType, WebMcpToolOptions, WithInputSignals, WrapperConfig, WrapperFieldInputs, WrapperTypeDefinition, WrapperTypeDefinition as WrapperTypeDefinition$1, hasFormValue, isArrayField, isContainerField, isDisplayOnlyField, isFieldBoundContext, isFormStateCondition, isGroupField, isHiddenField, isLeafField, isPageField, isRowField, isSimplifiedArrayField, isValueBearingField, isWrapperTypeDefinition, resolveDynamicValue, rowError } from "@ng-forge/dynamic-forms/internal";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { EnvironmentInjector, EnvironmentProviders, Injector, Provider, Signal, TemplateRef, Type, WritableSignal } from "@angular/core";
|
|
4
|
+
import { FieldTree } from "@angular/forms/signals";
|
|
5
|
+
import "rxjs";
|
|
6
|
+
import "@ng-forge/dynamic-forms/schema";
|
|
7
|
+
/** Error from async field component loading. */
|
|
8
|
+
interface FieldLoadingError {
|
|
9
|
+
readonly fieldType: string;
|
|
10
|
+
readonly fieldKey: string;
|
|
11
|
+
readonly error: Error;
|
|
12
|
+
}
|
|
11
13
|
/**
|
|
12
14
|
* Global default configuration for progressive field mounting ("field
|
|
13
15
|
* windowing"): fields beyond `eager` render as `@defer (on viewport)`
|
|
@@ -17,14 +19,14 @@ import * as _ng_forge_dynamic_forms from '@ng-forge/dynamic-forms';
|
|
|
17
19
|
* @internal
|
|
18
20
|
*/
|
|
19
21
|
interface FieldWindowingConfig {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
/** Whether field windowing is active. */
|
|
23
|
+
readonly enabled: boolean;
|
|
24
|
+
/** Number of leading fields mounted eagerly (not windowed). */
|
|
25
|
+
readonly eager: number;
|
|
26
|
+
/** CSS `min-height` reserved for each unmounted field's placeholder. */
|
|
27
|
+
readonly placeholderHeight: string;
|
|
28
|
+
/** Parking: hold scrolled-away fields out of change detection, DOM intact. */
|
|
29
|
+
readonly park: FieldParkingConfig;
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
30
32
|
* Parking config. `@defer (on viewport)` only ever mounts — it never unmounts —
|
|
@@ -43,59 +45,47 @@ interface FieldWindowingConfig {
|
|
|
43
45
|
* @internal
|
|
44
46
|
*/
|
|
45
47
|
interface FieldParkingConfig {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
/** Whether scrolled-away fields are held out of change detection. */
|
|
49
|
+
readonly enabled: boolean;
|
|
50
|
+
/** `IntersectionObserver` rootMargin — how far outside the viewport stays live. */
|
|
51
|
+
readonly margin: string;
|
|
50
52
|
}
|
|
51
|
-
|
|
52
|
-
/** Error from async field component loading. */
|
|
53
|
-
interface FieldLoadingError {
|
|
54
|
-
readonly fieldType: string;
|
|
55
|
-
readonly fieldKey: string;
|
|
56
|
-
readonly error: Error;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
53
|
/** Event dispatched when the form should be cleared. */
|
|
60
|
-
declare class FormClearEvent implements FormEvent {
|
|
61
|
-
|
|
54
|
+
export declare class FormClearEvent implements FormEvent$1 {
|
|
55
|
+
readonly type: "form-clear";
|
|
62
56
|
}
|
|
63
|
-
|
|
64
57
|
/** Event dispatched when the form should be reset to its default values. */
|
|
65
|
-
declare class FormResetEvent implements FormEvent {
|
|
66
|
-
|
|
58
|
+
export declare class FormResetEvent implements FormEvent$1 {
|
|
59
|
+
readonly type: "form-reset";
|
|
67
60
|
}
|
|
68
|
-
|
|
69
61
|
/** Event emitted when the active page of a paged form changes. */
|
|
70
|
-
declare class PageChangeEvent implements FormEvent {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
62
|
+
export declare class PageChangeEvent implements FormEvent$1 {
|
|
63
|
+
/** The current page index (0-based) */
|
|
64
|
+
readonly currentPageIndex: number;
|
|
65
|
+
/** Total number of pages */
|
|
66
|
+
readonly totalPages: number;
|
|
67
|
+
/** Previous page index (0-based), undefined if first navigation */
|
|
68
|
+
readonly previousPageIndex?: number | undefined;
|
|
69
|
+
readonly type: "page-change";
|
|
70
|
+
constructor(
|
|
71
|
+
/** The current page index (0-based) */
|
|
72
|
+
currentPageIndex: number,
|
|
73
|
+
/** Total number of pages */
|
|
74
|
+
totalPages: number,
|
|
75
|
+
/** Previous page index (0-based), undefined if first navigation */
|
|
76
|
+
previousPageIndex?: number | undefined);
|
|
85
77
|
}
|
|
86
|
-
|
|
87
78
|
/** Navigation state of a paged form, as emitted by `PagerStateEvent`. */
|
|
88
79
|
interface PagerState {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
80
|
+
/** Current page index (0-based) */
|
|
81
|
+
currentPageIndex: number;
|
|
82
|
+
/** Total number of pages */
|
|
83
|
+
totalPages: number;
|
|
84
|
+
/** Whether the current page is the first visible page */
|
|
85
|
+
isFirstPage: boolean;
|
|
86
|
+
/** Whether the current page is the last visible page */
|
|
87
|
+
isLastPage: boolean;
|
|
97
88
|
}
|
|
98
|
-
|
|
99
89
|
/**
|
|
100
90
|
* Event emitted whenever the pager state of a paged form changes.
|
|
101
91
|
*
|
|
@@ -104,40 +94,37 @@ interface PagerState {
|
|
|
104
94
|
* `isLastPage` flip because a page's `hidden` logic toggled and the set of
|
|
105
95
|
* visible pages shifted, with the active page never moving.
|
|
106
96
|
*/
|
|
107
|
-
declare class PagerStateEvent implements FormEvent {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
97
|
+
export declare class PagerStateEvent implements FormEvent$1 {
|
|
98
|
+
state: PagerState;
|
|
99
|
+
readonly type: "pager-state";
|
|
100
|
+
constructor(state: PagerState);
|
|
111
101
|
}
|
|
112
|
-
|
|
113
102
|
/** Emitted after the active page and all of its visible fields have rendered. */
|
|
114
|
-
declare class ActivePageInitializedEvent implements FormEvent {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
103
|
+
export declare class ActivePageInitializedEvent implements FormEvent$1 {
|
|
104
|
+
readonly pageIndex: number;
|
|
105
|
+
readonly pageKey: string;
|
|
106
|
+
readonly type: "active-page-initialized";
|
|
107
|
+
constructor(pageIndex: number, pageKey: string);
|
|
119
108
|
}
|
|
120
|
-
|
|
121
109
|
/** Resolved field ready for rendering with ngComponentOutlet / DfFieldOutlet. */
|
|
122
110
|
interface ResolvedField {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
111
|
+
key: string;
|
|
112
|
+
/** The original field definition (used by DfFieldOutlet to resolve wrappers). */
|
|
113
|
+
fieldDef: FieldDef$1<unknown>;
|
|
114
|
+
component: Type<unknown>;
|
|
115
|
+
injector: Injector;
|
|
116
|
+
inputs: Signal<Record<string, unknown>>;
|
|
117
|
+
renderReady: Signal<boolean>;
|
|
118
|
+
/**
|
|
119
|
+
* Whether the field is currently hidden. Sourced from the FieldTree's
|
|
120
|
+
* `state.hidden()` for value-bearing fields (set by Angular Signal Forms in
|
|
121
|
+
* response to `hidden(path, …)` calls), or from the mapper's explicit
|
|
122
|
+
* `hidden` input for non-value fields (button, text, container, …). Consumers
|
|
123
|
+
* must `@if (!field.hidden())` around `*dfFieldOutlet` so hidden fields are
|
|
124
|
+
* removed from the DOM — Angular Signal Forms warns (NG01916) otherwise.
|
|
125
|
+
*/
|
|
126
|
+
hidden: Signal<boolean>;
|
|
139
127
|
}
|
|
140
|
-
|
|
141
128
|
/**
|
|
142
129
|
* Renders a form from a {@link FormConfig}. Attribute component on a native
|
|
143
130
|
* `<form>` element (selector `form[dynamic-form]`); state management is
|
|
@@ -168,188 +155,220 @@ interface ResolvedField {
|
|
|
168
155
|
* }
|
|
169
156
|
* ```
|
|
170
157
|
*/
|
|
171
|
-
declare class DynamicForm<TFields extends RegisteredFieldTypes[] = RegisteredFieldTypes[], TModel extends Record<string, unknown> = InferFormModel<TFields>> {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
158
|
+
export declare class DynamicForm<TFields extends RegisteredFieldTypes$1[] = RegisteredFieldTypes$1[], TModel extends Record<string, unknown> = InferFormModel<TFields>> {
|
|
159
|
+
/** Form configuration defining the structure, validation, and behavior. */
|
|
160
|
+
config: import("@angular/core").InputSignal<FormConfig$1<TFields, import("@ng-forge/dynamic-forms").InferFormValue<TFields extends readonly RegisteredFieldTypes$1[] ? TFields : RegisteredFieldTypes$1[]>, Record<string, unknown>, unknown>>;
|
|
161
|
+
/** Runtime form options that override config options when provided. */
|
|
162
|
+
formOptions: import("@angular/core").InputSignal<FormOptions$1 | undefined>;
|
|
163
|
+
/** Form values for two-way data binding. */
|
|
164
|
+
value: import("@angular/core").ModelSignal<Partial<TModel> | undefined>;
|
|
165
|
+
/**
|
|
166
|
+
* How lenient the addon validator is on `config.fields[...].addons`.
|
|
167
|
+
* `'inline'` (default) keeps everything; `'json'` drops code-only types
|
|
168
|
+
* with a warning. Read at form init and on every config swap — change
|
|
169
|
+
* `source` AND the config to force re-validation mid-flight.
|
|
170
|
+
*/
|
|
171
|
+
source: import("@angular/core").InputSignal<"json" | "inline">;
|
|
172
|
+
private destroyRef;
|
|
173
|
+
private injector;
|
|
174
|
+
protected environmentInjector: EnvironmentInjector;
|
|
175
|
+
private eventBus;
|
|
176
|
+
private logger;
|
|
177
|
+
private dispatcher;
|
|
178
|
+
private templateRegistry;
|
|
179
|
+
private globalFieldWindowing;
|
|
180
|
+
/** All `<ng-template dfTemplate="...">` instances projected into this form. */
|
|
181
|
+
private readonly _projectedTemplates;
|
|
182
|
+
private readonly stateManager;
|
|
183
|
+
/**
|
|
184
|
+
* Owns this form's DOM-id prefix and registers the instance with the root
|
|
185
|
+
* registry for multi-form collision detection. Injected eagerly (not lazily
|
|
186
|
+
* via first field map) so the live-form count is accurate from construction.
|
|
187
|
+
*/
|
|
188
|
+
private readonly formIdPrefix;
|
|
189
|
+
/** Active DOM-id prefix — empty unless explicitly set or multiple forms are mounted. */
|
|
190
|
+
protected readonly idPrefix: Signal<string>;
|
|
191
|
+
private componentId;
|
|
192
|
+
/** The currently active config used for form rendering */
|
|
193
|
+
activeConfig: Signal<FormConfig$1<TFields, import("@ng-forge/dynamic-forms").InferFormValue<TFields extends readonly RegisteredFieldTypes$1[] ? TFields : RegisteredFieldTypes$1[]>, Record<string, unknown>, unknown> | undefined>;
|
|
194
|
+
/** Current render phase: 'render' = showing form, 'teardown' = hiding old components */
|
|
195
|
+
renderPhase: Signal<"teardown" | "render">;
|
|
196
|
+
/** Computed form mode detection with validation */
|
|
197
|
+
formModeDetection: Signal<import("@ng-forge/dynamic-forms").FormModeDetectionResult>;
|
|
198
|
+
/** Page field definitions for paged forms */
|
|
199
|
+
pageFieldDefinitions: Signal<import("@ng-forge/dynamic-forms").PageField<import("@ng-forge/dynamic-forms").PageAllowedChildren[]>[]>;
|
|
200
|
+
/** Effective form options (merged from config and input) */
|
|
201
|
+
effectiveFormOptions: Signal<{
|
|
202
|
+
disabled?: boolean;
|
|
203
|
+
idPrefix?: string;
|
|
204
|
+
maxDerivationIterations?: number;
|
|
205
|
+
submitButton?: import("@ng-forge/dynamic-forms").SubmitButtonOptions;
|
|
206
|
+
nextButton?: import("@ng-forge/dynamic-forms").NextButtonOptions;
|
|
207
|
+
initialPage?: number | import("@ng-forge/dynamic-forms").InitialPageConfig;
|
|
208
|
+
pagePreloadWindow?: number;
|
|
209
|
+
fieldWindowing?: boolean | {
|
|
210
|
+
eager?: number;
|
|
211
|
+
placeholderHeight?: string;
|
|
212
|
+
park?: boolean | {
|
|
213
|
+
margin?: string;
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
excludeValueIfHidden?: boolean;
|
|
217
|
+
excludeValueIfDisabled?: boolean;
|
|
218
|
+
excludeValueIfReadonly?: boolean;
|
|
219
|
+
validateWhenHidden?: boolean;
|
|
220
|
+
emitFormValueOnEvents?: boolean;
|
|
221
|
+
webMcp?: import("@ng-forge/dynamic-forms").WebMcpToolOptions;
|
|
222
|
+
}>;
|
|
223
|
+
/** Field signal context for injection into child components */
|
|
224
|
+
fieldSignalContext: Signal<import("@ng-forge/dynamic-forms/internal").FieldSignalContext<TModel>>;
|
|
225
|
+
/** Default values computed from field definitions */
|
|
226
|
+
defaultValues: WritableSignal<TModel>;
|
|
227
|
+
/** The Angular Signal Form instance */
|
|
228
|
+
form: Signal<FieldTree<TModel, string | number, "writable">>;
|
|
229
|
+
/** Current form values (reactive) */
|
|
230
|
+
formValue: Signal<TModel>;
|
|
231
|
+
/** Whether the form is currently valid */
|
|
232
|
+
valid: Signal<boolean>;
|
|
233
|
+
/** Whether the form is currently invalid */
|
|
234
|
+
invalid: Signal<boolean>;
|
|
235
|
+
/** Whether any form field has been modified */
|
|
236
|
+
dirty: Signal<boolean>;
|
|
237
|
+
/** Whether any form field has been touched (blurred) */
|
|
238
|
+
touched: Signal<boolean>;
|
|
239
|
+
/** Current validation errors from all fields */
|
|
240
|
+
errors: Signal<import("@angular/forms/signals").ValidationError.WithFieldTree[]>;
|
|
241
|
+
/** Whether the form is disabled (from options or form state) */
|
|
242
|
+
disabled: Signal<boolean>;
|
|
243
|
+
/** Whether the form is currently submitting */
|
|
244
|
+
submitting: Signal<boolean>;
|
|
245
|
+
/** Collects errors from async field component loading for error boundary patterns */
|
|
246
|
+
fieldLoadingErrors: WritableSignal<FieldLoadingError[]>;
|
|
247
|
+
/** Whether to render the form template */
|
|
248
|
+
private derivationReady;
|
|
249
|
+
shouldRender: Signal<boolean>;
|
|
250
|
+
/**
|
|
251
|
+
* What the experimental WebMCP layer is doing for this form.
|
|
252
|
+
*
|
|
253
|
+
* Injecting it is also what instantiates the gate (component providers are
|
|
254
|
+
* lazy), which is what keeps the registrar lazily loaded. Intentionally absent
|
|
255
|
+
* from `shouldRender`: agent visibility must never gate render.
|
|
256
|
+
*
|
|
257
|
+
* `'disabled'` unless `withExperimentalWebMcp()` is provided; `'idle'` until a
|
|
258
|
+
* config declares `options.webMcp`; `'active'` once its tools are registered.
|
|
259
|
+
* `'failed'` and `'unsupported'` are the two ways registration does not
|
|
260
|
+
* happen, and are worth surfacing rather than guessing at.
|
|
261
|
+
*
|
|
262
|
+
* @experimental
|
|
263
|
+
*/
|
|
264
|
+
readonly webMcpStatus: Signal<import("@ng-forge/dynamic-forms").WebMcpStatus>;
|
|
265
|
+
/** Resolved fields ready for rendering */
|
|
266
|
+
protected resolvedFields: Signal<ResolvedField[]>;
|
|
267
|
+
/**
|
|
268
|
+
* Effective field-windowing config for non-paged forms. Per-form
|
|
269
|
+
* `FormOptions.fieldWindowing` wins over the global `withFieldWindowing()`
|
|
270
|
+
* default; both fall back to disabled (fully eager).
|
|
271
|
+
*/
|
|
272
|
+
protected readonly fieldWindowing: Signal<FieldWindowingConfig>;
|
|
273
|
+
private readonly initializedComponents;
|
|
274
|
+
private readonly initialPageReady;
|
|
275
|
+
private readonly initializationReady;
|
|
276
|
+
/** Replayable readiness so late subscribers cannot miss hot EventBus announcements. */
|
|
277
|
+
initialized$: import("rxjs").Observable<boolean>;
|
|
278
|
+
/** Emits when form validity changes. */
|
|
279
|
+
validityChange: import("@angular/core").OutputRef<boolean>;
|
|
280
|
+
/** Emits when form dirty state changes. */
|
|
281
|
+
dirtyChange: import("@angular/core").OutputRef<boolean>;
|
|
282
|
+
/** Emits form values when submitted (via FormSubmitEvent) and form is valid. */
|
|
283
|
+
submitted: import("@angular/core").OutputRef<TModel>;
|
|
284
|
+
/** Emits when form is reset to default values. */
|
|
285
|
+
reset: import("@angular/core").OutputRef<FormResetEvent>;
|
|
286
|
+
/** Emits when form is cleared to empty state. */
|
|
287
|
+
cleared: import("@angular/core").OutputRef<FormClearEvent>;
|
|
288
|
+
/** Emits all form events for custom event handling. */
|
|
289
|
+
events: import("@angular/core").OutputRef<import("@ng-forge/dynamic-forms").FormEvent>;
|
|
290
|
+
/**
|
|
291
|
+
* Emits when a non-paged form is fully initialized, or when the initially active page of a
|
|
292
|
+
* paged form is ready for interaction. Virtualized inactive pages are not part of initial
|
|
293
|
+
* readiness because they intentionally remain unmounted.
|
|
294
|
+
*/
|
|
295
|
+
initialized: import("@angular/core").OutputRef<boolean>;
|
|
296
|
+
/**
|
|
297
|
+
* EXPERIMENTAL. Added alongside page preloading; the emission contract may change.
|
|
298
|
+
*
|
|
299
|
+
* Emits after the currently visible page and all of its visible fields render. Announced
|
|
300
|
+
* once per visit to a page, and again when that page is returned to. Use this when work must
|
|
301
|
+
* run after every page transition; `initialized` emits only for the initial page.
|
|
302
|
+
*/
|
|
303
|
+
activePageInitialized: import("@angular/core").OutputRef<ActivePageInitializedEvent>;
|
|
304
|
+
/** Emits when the current page changes in paged forms. */
|
|
305
|
+
onPageChange: import("@angular/core").OutputRef<PageChangeEvent>;
|
|
306
|
+
/** Emits when pager state changes (currentPageIndex, totalPages, isFirstPage, isLastPage). */
|
|
307
|
+
onPageNavigationStateChange: import("@angular/core").OutputRef<PagerStateEvent>;
|
|
308
|
+
constructor();
|
|
309
|
+
/**
|
|
310
|
+
* Handles native form submission triggered by:
|
|
311
|
+
* - Pressing Enter in an input field
|
|
312
|
+
* - Clicking a button with type="submit"
|
|
313
|
+
* - Programmatic form.submit() calls
|
|
314
|
+
*
|
|
315
|
+
* @param event - The native submit event from the form element
|
|
316
|
+
*/
|
|
317
|
+
protected onNativeSubmit(event: Event): void;
|
|
318
|
+
/**
|
|
319
|
+
* Whether a field should be deferred by field windowing. Containers are never
|
|
320
|
+
* windowed: they emit `ComponentInitializedEvent`, which the form's init
|
|
321
|
+
* tracker counts, so deferring one would stall `initialized` until it scrolls
|
|
322
|
+
* into view. Leaf fields carry no such count, so they defer freely.
|
|
323
|
+
*/
|
|
324
|
+
protected windowsField(field: ResolvedField, index: number): boolean;
|
|
325
|
+
/** Class string for a windowed field's placeholder — matches the real field's grid column. */
|
|
326
|
+
protected placeholderGridClass(field: ResolvedField): string;
|
|
327
|
+
private setupEffects;
|
|
328
|
+
/**
|
|
329
|
+
* Populates FORM_STATE_DEPS with this component's input signals, then injects
|
|
330
|
+
* FormStateManager. Must be called as a field initializer (after the input signals
|
|
331
|
+
* are declared) so that FormStateManager reads populated deps when it is constructed.
|
|
332
|
+
* inject() is valid here because field initializers run inside the injection context.
|
|
333
|
+
*/
|
|
334
|
+
private connectDeps;
|
|
335
|
+
private setupEventHandlers;
|
|
336
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicForm<any, any>, never>;
|
|
337
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicForm<any, any>, "form[dynamic-form]", never, {
|
|
338
|
+
"config": {
|
|
339
|
+
"alias": "dynamic-form";
|
|
340
|
+
"required": true;
|
|
341
|
+
"isSignal": true;
|
|
342
|
+
};
|
|
343
|
+
"formOptions": {
|
|
344
|
+
"alias": "formOptions";
|
|
345
|
+
"required": false;
|
|
346
|
+
"isSignal": true;
|
|
347
|
+
};
|
|
348
|
+
"value": {
|
|
349
|
+
"alias": "value";
|
|
350
|
+
"required": false;
|
|
351
|
+
"isSignal": true;
|
|
352
|
+
};
|
|
353
|
+
"source": {
|
|
354
|
+
"alias": "source";
|
|
355
|
+
"required": false;
|
|
356
|
+
"isSignal": true;
|
|
357
|
+
};
|
|
358
|
+
}, {
|
|
359
|
+
"value": "valueChange";
|
|
360
|
+
"validityChange": "validityChange";
|
|
361
|
+
"dirtyChange": "dirtyChange";
|
|
362
|
+
"submitted": "submitted";
|
|
363
|
+
"reset": "reset";
|
|
364
|
+
"cleared": "cleared";
|
|
365
|
+
"events": "events";
|
|
366
|
+
"initialized": "initialized";
|
|
367
|
+
"activePageInitialized": "activePageInitialized";
|
|
368
|
+
"onPageChange": "onPageChange";
|
|
369
|
+
"onPageNavigationStateChange": "onPageNavigationStateChange";
|
|
370
|
+
}, ["_projectedTemplates"], never, true, never>;
|
|
351
371
|
}
|
|
352
|
-
|
|
353
372
|
/**
|
|
354
373
|
* Injectable service for dispatching events into a DynamicForm from outside the form.
|
|
355
374
|
*
|
|
@@ -391,88 +410,81 @@ declare class DynamicForm<TFields extends RegisteredFieldTypes[] = RegisteredFie
|
|
|
391
410
|
* dispatcher.dispatch(new FormResetEvent());
|
|
392
411
|
* ```
|
|
393
412
|
*/
|
|
394
|
-
declare class EventDispatcher {
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
413
|
+
export declare class EventDispatcher {
|
|
414
|
+
private bus;
|
|
415
|
+
/**
|
|
416
|
+
* Dispatches a form event into the connected DynamicForm's event bus.
|
|
417
|
+
* No-op if no form is currently connected.
|
|
418
|
+
*
|
|
419
|
+
* @param event - A FormEvent instance. Use the `arrayEvent()` builder for array operations.
|
|
420
|
+
*/
|
|
421
|
+
dispatch(event: FormEvent$1): void;
|
|
422
|
+
/** @internal - Called by DynamicForm on init */
|
|
423
|
+
connect(bus: EventBus): void;
|
|
424
|
+
/** @internal - Called by DynamicForm on destroy */
|
|
425
|
+
disconnect(): void;
|
|
426
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EventDispatcher, never>;
|
|
427
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
409
428
|
}
|
|
410
|
-
|
|
411
429
|
/**
|
|
412
430
|
* Base interface for dynamic form features.
|
|
413
431
|
* Features are configuration options that can be passed to provideDynamicForm
|
|
414
432
|
* alongside field type definitions.
|
|
415
433
|
*/
|
|
416
434
|
interface DynamicFormFeature<TKind extends string = string> {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
435
|
+
/** Internal marker to identify this as a feature, not a field type */
|
|
436
|
+
ɵkind: TKind;
|
|
437
|
+
/** Providers to register for this feature */
|
|
438
|
+
ɵproviders: Provider[];
|
|
421
439
|
}
|
|
422
|
-
|
|
423
440
|
/** User-facing wrapper registration shape used with `createWrappers(...)`. */
|
|
424
441
|
interface WrapperRegistration<TName extends string = string, TConfig = unknown> {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
442
|
+
/** Unique identifier for the wrapper type */
|
|
443
|
+
readonly wrapperName: TName;
|
|
444
|
+
/** Lazy-loader for the wrapper component */
|
|
445
|
+
readonly loadComponent: LazyComponentLoader;
|
|
446
|
+
/** Field types this wrapper auto-applies to (merged lowest-priority during wrapper resolution) */
|
|
447
|
+
readonly types?: readonly string[];
|
|
448
|
+
/**
|
|
449
|
+
* Type carrier only — runtime value is always `undefined`.
|
|
450
|
+
* Use `wrapperProps<YourConfig>()` to thread the config type.
|
|
451
|
+
*/
|
|
452
|
+
readonly props?: TConfig;
|
|
436
453
|
}
|
|
437
454
|
/** Branded bundle returned by `createWrappers(...)`. */
|
|
438
455
|
interface WrappersBundle<T extends readonly WrapperRegistration[] = readonly WrapperRegistration[]> {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
456
|
+
readonly ɵkind: 'wrappers';
|
|
457
|
+
readonly ɵregistrations: T;
|
|
458
|
+
readonly ɵdefinitions: readonly WrapperTypeDefinition$1[];
|
|
442
459
|
}
|
|
443
460
|
/**
|
|
444
461
|
* Bundle wrapper registrations into a single object that can be passed to
|
|
445
462
|
* `provideDynamicForm(...)`.
|
|
446
463
|
*/
|
|
447
|
-
declare function createWrappers<const T extends readonly WrapperRegistration[]>(...registrations: T): WrappersBundle<T>;
|
|
464
|
+
export declare function createWrappers<const T extends readonly WrapperRegistration[]>(...registrations: T): WrappersBundle<T>;
|
|
448
465
|
/** Type guard for a `WrappersBundle`. */
|
|
449
|
-
declare function isWrappersBundle(value: unknown): value is WrappersBundle;
|
|
466
|
+
export declare function isWrappersBundle(value: unknown): value is WrappersBundle;
|
|
450
467
|
/** Derive the `FieldRegistryWrappers` augmentation shape from a wrapper bundle. */
|
|
451
|
-
type InferWrapperRegistry<T> = T extends WrappersBundle<infer R> ? {
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
};
|
|
457
|
-
} : never;
|
|
458
|
-
|
|
468
|
+
type InferWrapperRegistry<T> = T extends WrappersBundle<infer R> ? { [Reg in R[number] as Reg['wrapperName']]: Reg extends {
|
|
469
|
+
props: infer P;
|
|
470
|
+
} ? Exclude<P, undefined> : {
|
|
471
|
+
readonly type: Reg['wrapperName'];
|
|
472
|
+
}; } : never;
|
|
459
473
|
/** Extract FieldDef type from FieldTypeDefinition */
|
|
460
474
|
type ExtractFieldDef<T> = T extends FieldTypeDefinition<infer F> ? F : never;
|
|
461
475
|
/** Union of all FieldDef types from provided field types */
|
|
462
476
|
type FieldDefUnion<T extends FieldTypeDefinition[]> = ExtractFieldDef<T[number]>;
|
|
463
477
|
/** Infer form value type from field definitions using the real inference type. */
|
|
464
|
-
type InferFormValue<TFieldDefs extends FieldDef<unknown>[]> = InferFormValue$1<TFieldDefs>;
|
|
478
|
+
type InferFormValue$2<TFieldDefs extends FieldDef$1<unknown>[]> = InferFormValue$1<TFieldDefs>;
|
|
465
479
|
/** Provider result with type inference */
|
|
466
480
|
type ProvideDynamicFormResult<T extends FieldTypeDefinition[]> = EnvironmentProviders & {
|
|
467
|
-
|
|
468
|
-
|
|
481
|
+
__fieldDefs?: FieldDefUnion<T>;
|
|
482
|
+
__formValue?: InferFormValue$2<FieldDefUnion<T>[]>;
|
|
469
483
|
};
|
|
470
484
|
/** Union type for items that can be passed to provideDynamicForm */
|
|
471
|
-
type FieldTypeOrFeature = FieldTypeDefinition | WrapperTypeDefinition | WrappersBundle | DynamicFormFeature;
|
|
485
|
+
type FieldTypeOrFeature = FieldTypeDefinition | WrapperTypeDefinition$1 | WrappersBundle | DynamicFormFeature;
|
|
472
486
|
/** Extract only FieldTypeDefinition items from a tuple type */
|
|
473
|
-
type ExtractFieldTypes<T extends FieldTypeOrFeature[]> = {
|
|
474
|
-
[K in keyof T]: T[K] extends FieldTypeDefinition ? T[K] : never;
|
|
475
|
-
}[number] extends infer U ? U extends FieldTypeDefinition ? U[] : never : never;
|
|
487
|
+
type ExtractFieldTypes<T extends FieldTypeOrFeature[]> = { [K in keyof T]: T[K] extends FieldTypeDefinition ? T[K] : never; }[number] extends (infer U) ? U extends FieldTypeDefinition ? U[] : never : never;
|
|
476
488
|
/**
|
|
477
489
|
* Provider function to configure the dynamic form system with field types and options.
|
|
478
490
|
*
|
|
@@ -480,33 +492,31 @@ type ExtractFieldTypes<T extends FieldTypeOrFeature[]> = {
|
|
|
480
492
|
* @returns Environment providers for dependency injection with type inference
|
|
481
493
|
* @typeParam T - Array of field type definitions for type inference
|
|
482
494
|
*/
|
|
483
|
-
declare function provideDynamicForm<const T extends FieldTypeOrFeature[]>(...items: T): ProvideDynamicFormResult<ExtractFieldTypes<T> extends FieldTypeDefinition[] ? ExtractFieldTypes<T> : FieldTypeDefinition[]>;
|
|
495
|
+
export declare function provideDynamicForm<const T extends FieldTypeOrFeature[]>(...items: T): ProvideDynamicFormResult<ExtractFieldTypes<T> extends FieldTypeDefinition[] ? ExtractFieldTypes<T> : FieldTypeDefinition[]>;
|
|
484
496
|
/** Extract FieldDef types from provider result */
|
|
485
497
|
type ExtractFieldDefs<T> = T extends {
|
|
486
|
-
|
|
498
|
+
__fieldDefs?: infer F;
|
|
487
499
|
} ? F : never;
|
|
488
500
|
/** Extract form value type from provider result */
|
|
489
501
|
type ExtractFormValue<T> = T extends {
|
|
490
|
-
|
|
502
|
+
__formValue?: infer V;
|
|
491
503
|
} ? V : never;
|
|
492
|
-
|
|
493
504
|
/** Built-in field types provided by the dynamic form library. */
|
|
494
|
-
declare const BUILT_IN_FIELDS: FieldTypeDefinition[];
|
|
495
|
-
|
|
505
|
+
export declare const BUILT_IN_FIELDS: FieldTypeDefinition[];
|
|
496
506
|
/** Configuration options for the logger feature. */
|
|
497
507
|
interface LoggerConfigOptions {
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
508
|
+
/**
|
|
509
|
+
* Whether general logging is enabled.
|
|
510
|
+
*
|
|
511
|
+
* @default true
|
|
512
|
+
*/
|
|
513
|
+
enabled?: boolean;
|
|
514
|
+
/**
|
|
515
|
+
* Derivation logging level.
|
|
516
|
+
*
|
|
517
|
+
* @default 'none'
|
|
518
|
+
*/
|
|
519
|
+
derivations?: DerivationLogLevel;
|
|
510
520
|
}
|
|
511
521
|
/**
|
|
512
522
|
* Configure logging for dynamic forms.
|
|
@@ -514,17 +524,15 @@ interface LoggerConfigOptions {
|
|
|
514
524
|
* @param config - Boolean to enable/disable logging, a function returning boolean, or a config object
|
|
515
525
|
* @returns A DynamicFormFeature that configures logging
|
|
516
526
|
*/
|
|
517
|
-
declare function withLoggerConfig(config?: boolean | (() => boolean) | LoggerConfigOptions): DynamicFormFeature<'logger'>;
|
|
518
|
-
|
|
527
|
+
export declare function withLoggerConfig(config?: boolean | (() => boolean) | LoggerConfigOptions): DynamicFormFeature<'logger'>;
|
|
519
528
|
/** Console-based logger implementation. */
|
|
520
|
-
declare class ConsoleLogger implements Logger {
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
529
|
+
export declare class ConsoleLogger implements Logger$1 {
|
|
530
|
+
private readonly prefix;
|
|
531
|
+
debug(message: string, ...args: unknown[]): void;
|
|
532
|
+
info(message: string, ...args: unknown[]): void;
|
|
533
|
+
warn(message: string, ...args: unknown[]): void;
|
|
534
|
+
error(message: string, ...args: unknown[]): void;
|
|
526
535
|
}
|
|
527
|
-
|
|
528
536
|
/**
|
|
529
537
|
* Enables automatic form value attachment to all events dispatched through the EventBus.
|
|
530
538
|
*
|
|
@@ -537,8 +545,7 @@ declare class ConsoleLogger implements Logger {
|
|
|
537
545
|
* 5. No global feature - Disabled globally (default)
|
|
538
546
|
* @returns A DynamicFormFeature that enables form value attachment to events
|
|
539
547
|
*/
|
|
540
|
-
declare function withEventFormValue(): DynamicFormFeature<'event-form-value'>;
|
|
541
|
-
|
|
548
|
+
export declare function withEventFormValue(): DynamicFormFeature<'event-form-value'>;
|
|
542
549
|
/**
|
|
543
550
|
* Configures global value exclusion defaults for form submission output.
|
|
544
551
|
*
|
|
@@ -551,8 +558,7 @@ declare function withEventFormValue(): DynamicFormFeature<'event-form-value'>;
|
|
|
551
558
|
* @param config - Partial override of exclusion rules. Unspecified properties default to `true`.
|
|
552
559
|
* @returns A DynamicFormFeature that configures value exclusion defaults
|
|
553
560
|
*/
|
|
554
|
-
declare function withValueExclusionDefaults(config?: Partial<ValueExclusionConfig>): DynamicFormFeature<'value-exclusion'>;
|
|
555
|
-
|
|
561
|
+
export declare function withValueExclusionDefaults(config?: Partial<ValueExclusionConfig$1>): DynamicFormFeature<'value-exclusion'>;
|
|
556
562
|
/**
|
|
557
563
|
* Configures the global page preload window for paged forms — how many pages on
|
|
558
564
|
* each side of the current page are mounted during browser idle time.
|
|
@@ -582,14 +588,12 @@ declare function withValueExclusionDefaults(config?: Partial<ValueExclusionConfi
|
|
|
582
588
|
* provideDynamicForm(...withMaterialFields(), withPagePreload(2));
|
|
583
589
|
* ```
|
|
584
590
|
*/
|
|
585
|
-
declare function withPagePreload(window: number): DynamicFormFeature<'page-preload'>;
|
|
586
|
-
|
|
591
|
+
export declare function withPagePreload(window: number): DynamicFormFeature<'page-preload'>;
|
|
587
592
|
/** Per-form override shape for parking. `false` opts out; an object tunes the margin. */
|
|
588
593
|
type FieldParkingOption = boolean | {
|
|
589
|
-
|
|
590
|
-
|
|
594
|
+
/** IntersectionObserver root margin. Supports one to four `px` or `%` values. */
|
|
595
|
+
margin?: string;
|
|
591
596
|
};
|
|
592
|
-
|
|
593
597
|
/**
|
|
594
598
|
* Configures global progressive field mounting ("field windowing") for large
|
|
595
599
|
* flat (single-page) forms.
|
|
@@ -628,12 +632,11 @@ type FieldParkingOption = boolean | {
|
|
|
628
632
|
* provideDynamicForm(...withMaterialFields(), withFieldWindowing({ eager: 20 }));
|
|
629
633
|
* ```
|
|
630
634
|
*/
|
|
631
|
-
declare function withFieldWindowing(config?: {
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
+
export declare function withFieldWindowing(config?: {
|
|
636
|
+
eager?: number;
|
|
637
|
+
placeholderHeight?: string;
|
|
638
|
+
park?: FieldParkingOption;
|
|
635
639
|
}): DynamicFormFeature<'field-windowing'>;
|
|
636
|
-
|
|
637
640
|
/**
|
|
638
641
|
* Enables WebMCP tool registration for forms that declare `options.webMcp`.
|
|
639
642
|
*
|
|
@@ -676,8 +679,7 @@ declare function withFieldWindowing(config?: {
|
|
|
676
679
|
* } as const satisfies FormConfig;
|
|
677
680
|
* ```
|
|
678
681
|
*/
|
|
679
|
-
declare function withExperimentalWebMcp(): DynamicFormFeature<'web-mcp'>;
|
|
680
|
-
|
|
682
|
+
export declare function withExperimentalWebMcp(): DynamicFormFeature<'web-mcp'>;
|
|
681
683
|
/**
|
|
682
684
|
* What the WebMCP layer is currently doing for this form. Reported by
|
|
683
685
|
* `DynamicForm.webMcpStatus()`; `'active'` is the only state in which an agent
|
|
@@ -685,20 +687,19 @@ declare function withExperimentalWebMcp(): DynamicFormFeature<'web-mcp'>;
|
|
|
685
687
|
*
|
|
686
688
|
* @experimental
|
|
687
689
|
*/
|
|
688
|
-
type WebMcpStatus =
|
|
690
|
+
type WebMcpStatus =
|
|
689
691
|
/** `withExperimentalWebMcp()` is not provided, or this is the server. */
|
|
690
|
-
'disabled'
|
|
692
|
+
'disabled' |
|
|
691
693
|
/** Enabled, but the current config does not declare `options.webMcp`. */
|
|
692
|
-
|
|
694
|
+
'idle' |
|
|
693
695
|
/** Loading the registrar or awaiting `registerTool()`. */
|
|
694
|
-
|
|
696
|
+
'registering' |
|
|
695
697
|
/** Tools are registered against the browser's model context. */
|
|
696
|
-
|
|
698
|
+
'active' |
|
|
697
699
|
/** The browser exposes no model context, so there is nothing to register against. */
|
|
698
|
-
|
|
700
|
+
'unsupported' |
|
|
699
701
|
/** Registration was attempted and rejected. See the console for the reason. */
|
|
700
|
-
|
|
701
|
-
|
|
702
|
+
'failed';
|
|
702
703
|
/**
|
|
703
704
|
* How a submission ended.
|
|
704
705
|
*
|
|
@@ -713,36 +714,36 @@ type WebMcpStatus =
|
|
|
713
714
|
* @experimental
|
|
714
715
|
*/
|
|
715
716
|
type SubmissionOutcome = {
|
|
716
|
-
|
|
717
|
-
}
|
|
717
|
+
readonly status: 'success';
|
|
718
|
+
} |
|
|
718
719
|
/** No `submission.action` is configured; the `(submitted)` output received the value. */
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
}
|
|
720
|
+
{
|
|
721
|
+
readonly status: 'dispatched';
|
|
722
|
+
} |
|
|
722
723
|
/** The form was invalid, so nothing was submitted. */
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
}
|
|
724
|
+
{
|
|
725
|
+
readonly status: 'validation-failed';
|
|
726
|
+
} |
|
|
726
727
|
/** Async validators had not resolved, so submission was skipped. */
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
}
|
|
728
|
+
{
|
|
729
|
+
readonly status: 'pending-validation';
|
|
730
|
+
} |
|
|
730
731
|
/** The action ran and came back with server-side validation errors. */
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
}
|
|
732
|
+
{
|
|
733
|
+
readonly status: 'server-errors';
|
|
734
|
+
} |
|
|
734
735
|
/** The action threw or rejected. */
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
}
|
|
736
|
+
{
|
|
737
|
+
readonly status: 'action-failed';
|
|
738
|
+
readonly error: unknown;
|
|
739
|
+
} |
|
|
739
740
|
/** Another submission was already in flight and this one was dropped. */
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
}
|
|
741
|
+
{
|
|
742
|
+
readonly status: 'busy';
|
|
743
|
+
} |
|
|
743
744
|
/** The form went away before the submission settled. */
|
|
744
|
-
|
|
745
|
-
|
|
745
|
+
{
|
|
746
|
+
readonly status: 'cancelled';
|
|
746
747
|
};
|
|
747
748
|
/**
|
|
748
749
|
* The reply channel a caller attaches to `FormSubmitEvent` when it needs to know
|
|
@@ -757,12 +758,11 @@ type SubmissionOutcome = {
|
|
|
757
758
|
* @experimental
|
|
758
759
|
*/
|
|
759
760
|
interface SubmissionReply {
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
761
|
+
/** Marks the submission as taken by the pipeline. */
|
|
762
|
+
accept(): void;
|
|
763
|
+
/** Reports the final outcome. The first call wins; later calls are ignored. */
|
|
764
|
+
settle(outcome: SubmissionOutcome): void;
|
|
764
765
|
}
|
|
765
|
-
|
|
766
766
|
/**
|
|
767
767
|
* Configures global validation execution defaults — when validators should run
|
|
768
768
|
* relative to a field's reactive state.
|
|
@@ -777,8 +777,7 @@ interface SubmissionReply {
|
|
|
777
777
|
* @param config - Partial override. Unspecified properties keep their defaults.
|
|
778
778
|
* @returns A `DynamicFormFeature` that configures validation execution defaults.
|
|
779
779
|
*/
|
|
780
|
-
declare function withValidationExecutionDefaults(config?: Partial<ValidationExecutionConfig>): DynamicFormFeature<'validation-execution'>;
|
|
781
|
-
|
|
780
|
+
export declare function withValidationExecutionDefaults(config?: Partial<ValidationExecutionConfig$1>): DynamicFormFeature<'validation-execution'>;
|
|
782
781
|
/**
|
|
783
782
|
* Opt into Angular Signal Forms' legacy `.ng-touched` / `.ng-invalid` /
|
|
784
783
|
* `.ng-dirty` / `.ng-pristine` / `.ng-untouched` / `.ng-pending` /
|
|
@@ -786,80 +785,112 @@ declare function withValidationExecutionDefaults(config?: Partial<ValidationExec
|
|
|
786
785
|
*
|
|
787
786
|
* @returns A DynamicFormFeature that enables the legacy `ng-*` class strategy
|
|
788
787
|
*/
|
|
789
|
-
declare function withLegacyStatusClasses(): DynamicFormFeature<'legacy-status-classes'>;
|
|
790
|
-
|
|
788
|
+
export declare function withLegacyStatusClasses(): DynamicFormFeature<'legacy-status-classes'>;
|
|
791
789
|
/** Zero-cost type carrier used in wrapper registrations. */
|
|
792
|
-
declare function wrapperProps<T>(): T;
|
|
793
|
-
|
|
790
|
+
export declare function wrapperProps<T>(): T;
|
|
794
791
|
/**
|
|
795
792
|
* Marks an `<ng-template>` projected into `<df-dynamic-form>` content as
|
|
796
793
|
* available to template addons by name.
|
|
797
794
|
*/
|
|
798
|
-
declare class DfTemplate {
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
795
|
+
export declare class DfTemplate {
|
|
796
|
+
/** Name this template registers under — referenced from `TemplateAddon.templateKey`. */
|
|
797
|
+
readonly dfTemplate: import("@angular/core").InputSignal<string>;
|
|
798
|
+
/** The wrapped template, captured for registration and `NgTemplateOutlet` rendering. */
|
|
799
|
+
readonly templateRef: TemplateRef<unknown>;
|
|
800
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DfTemplate, never>;
|
|
801
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DfTemplate, "ng-template[dfTemplate]", ["dfTemplate"], {
|
|
802
|
+
"dfTemplate": {
|
|
803
|
+
"alias": "dfTemplate";
|
|
804
|
+
"required": true;
|
|
805
|
+
"isSignal": true;
|
|
806
|
+
};
|
|
807
|
+
}, {}, never, never, true, never>;
|
|
805
808
|
}
|
|
806
|
-
|
|
807
809
|
/** Renderer for the universal `text` addon type. */
|
|
808
|
-
declare class TextAddonComponent {
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
810
|
+
export declare class TextAddonComponent {
|
|
811
|
+
readonly addon: import("@angular/core").InputSignal<TextAddon$1>;
|
|
812
|
+
/** Accepted for contract uniformity — `NgComponentOutlet` setInput is strict; every kind must declare it. */
|
|
813
|
+
readonly fieldInputs: import("@angular/core").InputSignal<WrapperFieldInputs | undefined>;
|
|
814
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TextAddonComponent, never>;
|
|
815
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TextAddonComponent, "df-text-addon", never, {
|
|
816
|
+
"addon": {
|
|
817
|
+
"alias": "addon";
|
|
818
|
+
"required": true;
|
|
819
|
+
"isSignal": true;
|
|
820
|
+
};
|
|
821
|
+
"fieldInputs": {
|
|
822
|
+
"alias": "fieldInputs";
|
|
823
|
+
"required": false;
|
|
824
|
+
"isSignal": true;
|
|
825
|
+
};
|
|
826
|
+
}, {}, never, never, true, never>;
|
|
814
827
|
}
|
|
815
|
-
|
|
816
828
|
/** Renderer for the universal `template` addon type. */
|
|
817
|
-
declare class TemplateAddonComponent {
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
829
|
+
export declare class TemplateAddonComponent {
|
|
830
|
+
private readonly templates;
|
|
831
|
+
private readonly logger;
|
|
832
|
+
readonly addon: import("@angular/core").InputSignal<TemplateAddon$1>;
|
|
833
|
+
/** Forwarded by `df-addon-slot`; surfaced to the template as its implicit `$implicit` context. */
|
|
834
|
+
readonly fieldInputs: import("@angular/core").InputSignal<WrapperFieldInputs | undefined>;
|
|
835
|
+
protected readonly template: import("@angular/core").Signal<import("@angular/core").TemplateRef<unknown> | null>;
|
|
836
|
+
/** Implicit context payload — template authors bind via `let-fi`. */
|
|
837
|
+
protected readonly outletContext: import("@angular/core").Signal<{
|
|
838
|
+
$implicit: WrapperFieldInputs | undefined;
|
|
839
|
+
}>;
|
|
840
|
+
constructor();
|
|
841
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TemplateAddonComponent, never>;
|
|
842
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TemplateAddonComponent, "df-template-addon", never, {
|
|
843
|
+
"addon": {
|
|
844
|
+
"alias": "addon";
|
|
845
|
+
"required": true;
|
|
846
|
+
"isSignal": true;
|
|
847
|
+
};
|
|
848
|
+
"fieldInputs": {
|
|
849
|
+
"alias": "fieldInputs";
|
|
850
|
+
"required": false;
|
|
851
|
+
"isSignal": true;
|
|
852
|
+
};
|
|
853
|
+
}, {}, never, never, true, never>;
|
|
831
854
|
}
|
|
832
|
-
|
|
833
855
|
/**
|
|
834
856
|
* Renderer for the universal `component` addon type.
|
|
835
857
|
*
|
|
836
858
|
* @codeOnly The `component` loader is a function; this kind is dropped in
|
|
837
859
|
* lenient validation when the config originated from JSON.
|
|
838
860
|
*/
|
|
839
|
-
declare class ComponentAddonComponent {
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
861
|
+
export declare class ComponentAddonComponent {
|
|
862
|
+
private readonly logger;
|
|
863
|
+
readonly addon: import("@angular/core").InputSignal<ComponentAddon$1>;
|
|
864
|
+
/** Accepted for contract uniformity — `NgComponentOutlet` setInput is strict; every kind must declare it. */
|
|
865
|
+
readonly fieldInputs: import("@angular/core").InputSignal<WrapperFieldInputs | undefined>;
|
|
866
|
+
protected readonly inputs: import("@angular/core").Signal<Record<string, unknown>>;
|
|
867
|
+
/**
|
|
868
|
+
* Latest async-loaded `{ addon, component }` pair. Tagging the result with
|
|
869
|
+
* its source addon lets `resolvedComponent` filter stale loads structurally
|
|
870
|
+
* — same kind-tagging pattern `DfAddonSlot` uses. When `addon` swaps
|
|
871
|
+
* mid-load, the prior loader still completes and writes here, but the
|
|
872
|
+
* computed ignores it because the recorded addon no longer matches the
|
|
873
|
+
* current one.
|
|
874
|
+
*/
|
|
875
|
+
private readonly asyncLoaded;
|
|
876
|
+
protected readonly resolvedComponent: import("@angular/core").Signal<Type<unknown> | undefined>;
|
|
877
|
+
constructor();
|
|
878
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ComponentAddonComponent, never>;
|
|
879
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ComponentAddonComponent, "df-component-addon", never, {
|
|
880
|
+
"addon": {
|
|
881
|
+
"alias": "addon";
|
|
882
|
+
"required": true;
|
|
883
|
+
"isSignal": true;
|
|
884
|
+
};
|
|
885
|
+
"fieldInputs": {
|
|
886
|
+
"alias": "fieldInputs";
|
|
887
|
+
"required": false;
|
|
888
|
+
"isSignal": true;
|
|
889
|
+
};
|
|
890
|
+
}, {}, never, never, true, never>;
|
|
858
891
|
}
|
|
859
|
-
|
|
860
892
|
/** Register a custom addon type with the form. */
|
|
861
|
-
declare function withCustomAddon<T extends BaseAddon>(definition: AddonTypeDefinition<T>): DynamicFormFeature<'addons'>;
|
|
862
|
-
|
|
893
|
+
export declare function withCustomAddon<T extends BaseAddon$1>(definition: AddonTypeDefinition$1<T>): DynamicFormFeature<'addons'>;
|
|
863
894
|
/**
|
|
864
895
|
* Typed feature returned by {@link withAddonActions}. Carries the
|
|
865
896
|
* registered handler keys as a phantom type so consumers can derive the
|
|
@@ -867,67 +898,65 @@ declare function withCustomAddon<T extends BaseAddon>(definition: AddonTypeDefin
|
|
|
867
898
|
* every key.
|
|
868
899
|
*/
|
|
869
900
|
type AddonActionsFeature<K extends string = string> = DynamicFormFeature<'addon-actions'> & {
|
|
870
|
-
|
|
871
|
-
|
|
901
|
+
/** @internal Phantom field carrying the registered keys; never read at runtime. */
|
|
902
|
+
readonly __handlerKeys?: K;
|
|
872
903
|
};
|
|
873
904
|
/** Register named action handlers reachable via JSON-driven addon configs. */
|
|
874
|
-
declare function withAddonActions<const H extends Record<string, AddonActionHandler>>(handlers: H): AddonActionsFeature<keyof H & string>;
|
|
875
|
-
|
|
905
|
+
export declare function withAddonActions<const H extends Record<string, AddonActionHandler>>(handlers: H): AddonActionsFeature<keyof H & string>;
|
|
876
906
|
/** Reason an addon was dropped during validation. */
|
|
877
907
|
type AddonWarning = {
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
908
|
+
type: 'unknown-field-type';
|
|
909
|
+
fieldKey: string;
|
|
910
|
+
fieldType: string;
|
|
881
911
|
} | {
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
912
|
+
type: 'field-type-no-addon-support';
|
|
913
|
+
fieldKey: string;
|
|
914
|
+
fieldType: string;
|
|
885
915
|
} | {
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
916
|
+
type: 'unknown-slot';
|
|
917
|
+
fieldKey: string;
|
|
918
|
+
fieldType: string;
|
|
919
|
+
slot: string;
|
|
920
|
+
allowedSlots: readonly string[];
|
|
891
921
|
} | {
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
922
|
+
type: 'unknown-type';
|
|
923
|
+
fieldKey: string;
|
|
924
|
+
addonType: string;
|
|
925
|
+
registeredTypes: readonly string[];
|
|
896
926
|
} | {
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
927
|
+
type: 'type-not-allowed';
|
|
928
|
+
fieldKey: string;
|
|
929
|
+
fieldType: string;
|
|
930
|
+
addonType: string;
|
|
931
|
+
allowedTypes: readonly string[];
|
|
902
932
|
} | {
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
933
|
+
type: 'shape-violation';
|
|
934
|
+
fieldKey: string;
|
|
935
|
+
addonType: string;
|
|
936
|
+
reason: string;
|
|
907
937
|
} | {
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
938
|
+
type: 'code-only-type-in-json';
|
|
939
|
+
fieldKey: string;
|
|
940
|
+
addonType: string;
|
|
911
941
|
} | {
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
942
|
+
type: 'code-only-action-in-json';
|
|
943
|
+
fieldKey: string;
|
|
944
|
+
reason: string;
|
|
915
945
|
};
|
|
916
|
-
|
|
917
946
|
/** Options accepted by {@link sanitizeFormConfig}. */
|
|
918
947
|
interface SanitizeFormConfigOptions {
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
948
|
+
/**
|
|
949
|
+
* Whether the config originated from JSON (server-driven) or inline
|
|
950
|
+
* TypeScript code.
|
|
951
|
+
*/
|
|
952
|
+
source?: 'json' | 'inline';
|
|
924
953
|
}
|
|
925
954
|
/** Result of a `sanitizeFormConfig` call. */
|
|
926
955
|
interface SanitizedFormConfig {
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
956
|
+
/** Sanitized config — invalid addons stripped from the field tree. */
|
|
957
|
+
sanitized: FormConfig$1;
|
|
958
|
+
/** Structured list of every addon that was dropped, and why. */
|
|
959
|
+
warnings: readonly AddonWarning[];
|
|
931
960
|
}
|
|
932
961
|
/**
|
|
933
962
|
* Walk a `FormConfig`, validate every field's addons against the active
|
|
@@ -946,19 +975,18 @@ interface SanitizedFormConfig {
|
|
|
946
975
|
* }
|
|
947
976
|
* ```
|
|
948
977
|
*/
|
|
949
|
-
declare function sanitizeFormConfig(config: FormConfig, options?: SanitizeFormConfigOptions): SanitizedFormConfig;
|
|
950
|
-
|
|
978
|
+
export declare function sanitizeFormConfig(config: FormConfig$1, options?: SanitizeFormConfigOptions): SanitizedFormConfig;
|
|
951
979
|
/** Per-dispatch overrides for a page jump. */
|
|
952
980
|
interface PageNavigationOptions {
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
981
|
+
/**
|
|
982
|
+
* Whether to apply the forward-jump validity gate.
|
|
983
|
+
*
|
|
984
|
+
* Set `false` to land on the target regardless of earlier pages, which is what
|
|
985
|
+
* restoring a saved session wants. Bounds and hidden-page checks still apply.
|
|
986
|
+
*
|
|
987
|
+
* @default true
|
|
988
|
+
*/
|
|
989
|
+
validate?: boolean;
|
|
962
990
|
}
|
|
963
991
|
/**
|
|
964
992
|
* Event dispatched to move a paged form to a specific page.
|
|
@@ -968,19 +996,18 @@ interface PageNavigationOptions {
|
|
|
968
996
|
* if one is invalid, navigation stops on the first invalid page. Pass
|
|
969
997
|
* `{ validate: false }` to skip that gate and land on the target.
|
|
970
998
|
*/
|
|
971
|
-
declare class GoToPageEvent implements FormEvent {
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
999
|
+
export declare class GoToPageEvent implements FormEvent$1 {
|
|
1000
|
+
/** The target page index (0-based) */
|
|
1001
|
+
readonly pageIndex: number;
|
|
1002
|
+
/** Per-dispatch overrides; omit for the default gated behavior. */
|
|
1003
|
+
readonly options?: PageNavigationOptions | undefined;
|
|
1004
|
+
readonly type: "go-to-page";
|
|
1005
|
+
constructor(
|
|
1006
|
+
/** The target page index (0-based) */
|
|
1007
|
+
pageIndex: number,
|
|
1008
|
+
/** Per-dispatch overrides; omit for the default gated behavior. */
|
|
1009
|
+
options?: PageNavigationOptions | undefined);
|
|
982
1010
|
}
|
|
983
|
-
|
|
984
1011
|
/**
|
|
985
1012
|
* Event dispatched to submit the form (the action behind a `submit` button).
|
|
986
1013
|
*
|
|
@@ -988,249 +1015,235 @@ declare class GoToPageEvent implements FormEvent {
|
|
|
988
1015
|
* {@link SubmissionReply}; the submission handler reports back through it. A
|
|
989
1016
|
* button click passes nothing and stays fire-and-forget, as before.
|
|
990
1017
|
*/
|
|
991
|
-
declare class FormSubmitEvent implements FormEvent {
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
1018
|
+
export declare class FormSubmitEvent implements FormEvent$1 {
|
|
1019
|
+
readonly reply?: SubmissionReply | undefined;
|
|
1020
|
+
readonly type: "submit";
|
|
1021
|
+
constructor(reply?: SubmissionReply | undefined);
|
|
995
1022
|
}
|
|
996
|
-
|
|
997
1023
|
/** Event dispatched to advance a paged form to the next page. */
|
|
998
|
-
declare class NextPageEvent implements FormEvent {
|
|
999
|
-
|
|
1024
|
+
export declare class NextPageEvent implements FormEvent$1 {
|
|
1025
|
+
readonly type: "next-page";
|
|
1000
1026
|
}
|
|
1001
|
-
|
|
1002
1027
|
/** Event dispatched to return a paged form to the previous page. */
|
|
1003
|
-
declare class PreviousPageEvent implements FormEvent {
|
|
1004
|
-
|
|
1028
|
+
export declare class PreviousPageEvent implements FormEvent$1 {
|
|
1029
|
+
readonly type: "previous-page";
|
|
1005
1030
|
}
|
|
1006
|
-
|
|
1007
1031
|
/**
|
|
1008
1032
|
* Template type for array items used in events.
|
|
1009
1033
|
* Canonical definition lives in {@link ArrayItemDefinition} — this alias
|
|
1010
1034
|
* preserves the events-specific naming convention.
|
|
1011
1035
|
*/
|
|
1012
1036
|
type ArrayItemDefinitionTemplate = ArrayItemDefinition;
|
|
1013
|
-
|
|
1014
1037
|
/**
|
|
1015
1038
|
* Event dispatched to append a new item at the END of an array field.
|
|
1016
1039
|
*
|
|
1017
1040
|
* @typeParam TTemplate - The type of the template (single field or array of fields)
|
|
1018
1041
|
*/
|
|
1019
|
-
declare class AppendArrayItemEvent<TTemplate extends ArrayItemDefinitionTemplate = ArrayItemDefinitionTemplate> implements FormEvent {
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1042
|
+
export declare class AppendArrayItemEvent<TTemplate extends ArrayItemDefinitionTemplate = ArrayItemDefinitionTemplate> implements FormEvent$1 {
|
|
1043
|
+
/** The key of the array field to append an item to */
|
|
1044
|
+
readonly arrayKey: string;
|
|
1045
|
+
/**
|
|
1046
|
+
* Template for the new array item. REQUIRED.
|
|
1047
|
+
* - Single field (FieldDef): Creates a primitive item (field's value is extracted directly)
|
|
1048
|
+
* - Array of fields (FieldDef[]): Creates an object item (fields merged into object)
|
|
1049
|
+
*/
|
|
1050
|
+
readonly template: TTemplate;
|
|
1051
|
+
readonly type: "append-array-item";
|
|
1052
|
+
constructor(
|
|
1053
|
+
/** The key of the array field to append an item to */
|
|
1054
|
+
arrayKey: string,
|
|
1055
|
+
/**
|
|
1056
|
+
* Template for the new array item. REQUIRED.
|
|
1057
|
+
* - Single field (FieldDef): Creates a primitive item (field's value is extracted directly)
|
|
1058
|
+
* - Array of fields (FieldDef[]): Creates an object item (fields merged into object)
|
|
1059
|
+
*/
|
|
1060
|
+
template: TTemplate);
|
|
1038
1061
|
}
|
|
1039
|
-
|
|
1040
1062
|
/**
|
|
1041
1063
|
* Event dispatched to prepend a new item at the BEGINNING of an array field.
|
|
1042
1064
|
*
|
|
1043
1065
|
* @typeParam TTemplate - The type of the template (single field or array of fields)
|
|
1044
1066
|
*/
|
|
1045
|
-
declare class PrependArrayItemEvent<TTemplate extends ArrayItemDefinitionTemplate = ArrayItemDefinitionTemplate> implements FormEvent {
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1067
|
+
export declare class PrependArrayItemEvent<TTemplate extends ArrayItemDefinitionTemplate = ArrayItemDefinitionTemplate> implements FormEvent$1 {
|
|
1068
|
+
/** The key of the array field to prepend an item to */
|
|
1069
|
+
readonly arrayKey: string;
|
|
1070
|
+
/**
|
|
1071
|
+
* Template for the new array item. REQUIRED.
|
|
1072
|
+
* - Single field (FieldDef): Creates a primitive item (field's value is extracted directly)
|
|
1073
|
+
* - Array of fields (FieldDef[]): Creates an object item (fields merged into object)
|
|
1074
|
+
*/
|
|
1075
|
+
readonly template: TTemplate;
|
|
1076
|
+
readonly type: "prepend-array-item";
|
|
1077
|
+
constructor(
|
|
1078
|
+
/** The key of the array field to prepend an item to */
|
|
1079
|
+
arrayKey: string,
|
|
1080
|
+
/**
|
|
1081
|
+
* Template for the new array item. REQUIRED.
|
|
1082
|
+
* - Single field (FieldDef): Creates a primitive item (field's value is extracted directly)
|
|
1083
|
+
* - Array of fields (FieldDef[]): Creates an object item (fields merged into object)
|
|
1084
|
+
*/
|
|
1085
|
+
template: TTemplate);
|
|
1064
1086
|
}
|
|
1065
|
-
|
|
1066
1087
|
/**
|
|
1067
1088
|
* Event dispatched to insert a new item at a SPECIFIC INDEX in an array field.
|
|
1068
1089
|
*
|
|
1069
1090
|
* @typeParam TTemplate - The type of the template (single field or array of fields)
|
|
1070
1091
|
*/
|
|
1071
|
-
declare class InsertArrayItemEvent<TTemplate extends ArrayItemDefinitionTemplate = ArrayItemDefinitionTemplate> implements FormEvent {
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1092
|
+
export declare class InsertArrayItemEvent<TTemplate extends ArrayItemDefinitionTemplate = ArrayItemDefinitionTemplate> implements FormEvent$1 {
|
|
1093
|
+
/** The key of the array field to insert an item into */
|
|
1094
|
+
readonly arrayKey: string;
|
|
1095
|
+
/** The index at which to insert the new item */
|
|
1096
|
+
readonly index: number;
|
|
1097
|
+
/**
|
|
1098
|
+
* Template for the new array item. REQUIRED.
|
|
1099
|
+
* - Single field (FieldDef): Creates a primitive item (field's value is extracted directly)
|
|
1100
|
+
* - Array of fields (FieldDef[]): Creates an object item (fields merged into object)
|
|
1101
|
+
*/
|
|
1102
|
+
readonly template: TTemplate;
|
|
1103
|
+
readonly type: "insert-array-item";
|
|
1104
|
+
constructor(
|
|
1105
|
+
/** The key of the array field to insert an item into */
|
|
1106
|
+
arrayKey: string,
|
|
1107
|
+
/** The index at which to insert the new item */
|
|
1108
|
+
index: number,
|
|
1109
|
+
/**
|
|
1110
|
+
* Template for the new array item. REQUIRED.
|
|
1111
|
+
* - Single field (FieldDef): Creates a primitive item (field's value is extracted directly)
|
|
1112
|
+
* - Array of fields (FieldDef[]): Creates an object item (fields merged into object)
|
|
1113
|
+
*/
|
|
1114
|
+
template: TTemplate);
|
|
1094
1115
|
}
|
|
1095
|
-
|
|
1096
1116
|
/** Event dispatched to remove the LAST item from an array field. */
|
|
1097
|
-
declare class PopArrayItemEvent implements FormEvent {
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1117
|
+
export declare class PopArrayItemEvent implements FormEvent$1 {
|
|
1118
|
+
/** The key of the array field to remove the last item from */
|
|
1119
|
+
readonly arrayKey: string;
|
|
1120
|
+
readonly type: "pop-array-item";
|
|
1121
|
+
constructor(
|
|
1122
|
+
/** The key of the array field to remove the last item from */
|
|
1123
|
+
arrayKey: string);
|
|
1104
1124
|
}
|
|
1105
|
-
|
|
1106
1125
|
/** Event dispatched to remove the FIRST item from an array field. */
|
|
1107
|
-
declare class ShiftArrayItemEvent implements FormEvent {
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1126
|
+
export declare class ShiftArrayItemEvent implements FormEvent$1 {
|
|
1127
|
+
/** The key of the array field to remove the first item from */
|
|
1128
|
+
readonly arrayKey: string;
|
|
1129
|
+
readonly type: "shift-array-item";
|
|
1130
|
+
constructor(
|
|
1131
|
+
/** The key of the array field to remove the first item from */
|
|
1132
|
+
arrayKey: string);
|
|
1114
1133
|
}
|
|
1115
|
-
|
|
1116
1134
|
/** Event dispatched to move an existing item from one index to another within an array field. */
|
|
1117
|
-
declare class MoveArrayItemEvent implements FormEvent {
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1135
|
+
export declare class MoveArrayItemEvent implements FormEvent$1 {
|
|
1136
|
+
/** The key of the array field containing the item to move */
|
|
1137
|
+
readonly arrayKey: string;
|
|
1138
|
+
/** The current index of the item to move */
|
|
1139
|
+
readonly fromIndex: number;
|
|
1140
|
+
/** The target index to move the item to */
|
|
1141
|
+
readonly toIndex: number;
|
|
1142
|
+
readonly type: "move-array-item";
|
|
1143
|
+
constructor(
|
|
1144
|
+
/** The key of the array field containing the item to move */
|
|
1145
|
+
arrayKey: string,
|
|
1146
|
+
/** The current index of the item to move */
|
|
1147
|
+
fromIndex: number,
|
|
1148
|
+
/** The target index to move the item to */
|
|
1149
|
+
toIndex: number);
|
|
1132
1150
|
}
|
|
1133
|
-
|
|
1134
1151
|
/** Event dispatched to remove an item at a SPECIFIC INDEX from an array field. */
|
|
1135
|
-
declare class RemoveAtIndexEvent implements FormEvent {
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1152
|
+
export declare class RemoveAtIndexEvent implements FormEvent$1 {
|
|
1153
|
+
/** The key of the array field to remove an item from */
|
|
1154
|
+
readonly arrayKey: string;
|
|
1155
|
+
/** The index of the item to remove */
|
|
1156
|
+
readonly index: number;
|
|
1157
|
+
readonly type: "remove-at-index";
|
|
1158
|
+
constructor(
|
|
1159
|
+
/** The key of the array field to remove an item from */
|
|
1160
|
+
arrayKey: string,
|
|
1161
|
+
/** The index of the item to remove */
|
|
1162
|
+
index: number);
|
|
1146
1163
|
}
|
|
1147
|
-
|
|
1148
1164
|
/**
|
|
1149
1165
|
* Builder for array manipulation events.
|
|
1150
1166
|
*
|
|
1151
1167
|
* @param arrayKey - The key of the array field to operate on
|
|
1152
1168
|
* @returns An object with methods for all 7 array operations
|
|
1153
1169
|
*/
|
|
1154
|
-
declare function arrayEvent(arrayKey: string): {
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1170
|
+
export declare function arrayEvent(arrayKey: string): {
|
|
1171
|
+
/**
|
|
1172
|
+
* Append a new item at the END of the array.
|
|
1173
|
+
* This is the most common operation for adding items.
|
|
1174
|
+
*
|
|
1175
|
+
* @param template - Template for the new item (REQUIRED)
|
|
1176
|
+
* - Single field: Creates a primitive item (field's value is extracted directly)
|
|
1177
|
+
* - Array of fields: Creates an object item (fields merged into object)
|
|
1178
|
+
* @returns An AppendArrayItemEvent to dispatch
|
|
1179
|
+
*/
|
|
1180
|
+
append: <T extends ArrayItemDefinitionTemplate>(template: T) => AppendArrayItemEvent<T>;
|
|
1181
|
+
/**
|
|
1182
|
+
* Prepend a new item at the BEGINNING of the array.
|
|
1183
|
+
* Use when new items should appear at the start.
|
|
1184
|
+
*
|
|
1185
|
+
* @param template - Template for the new item (REQUIRED)
|
|
1186
|
+
* - Single field: Creates a primitive item (field's value is extracted directly)
|
|
1187
|
+
* - Array of fields: Creates an object item (fields merged into object)
|
|
1188
|
+
* @returns A PrependArrayItemEvent to dispatch
|
|
1189
|
+
*/
|
|
1190
|
+
prepend: <T extends ArrayItemDefinitionTemplate>(template: T) => PrependArrayItemEvent<T>;
|
|
1191
|
+
/**
|
|
1192
|
+
* Insert a new item at a SPECIFIC INDEX in the array.
|
|
1193
|
+
* Use when you need precise control over item placement.
|
|
1194
|
+
*
|
|
1195
|
+
* @param index - The position at which to insert the new item
|
|
1196
|
+
* @param template - Template for the new item (REQUIRED)
|
|
1197
|
+
* - Single field: Creates a primitive item (field's value is extracted directly)
|
|
1198
|
+
* - Array of fields: Creates an object item (fields merged into object)
|
|
1199
|
+
* @returns An InsertArrayItemEvent to dispatch
|
|
1200
|
+
*/
|
|
1201
|
+
insertAt: <T extends ArrayItemDefinitionTemplate>(index: number, template: T) => InsertArrayItemEvent<T>;
|
|
1202
|
+
/**
|
|
1203
|
+
* Remove the LAST item from the array.
|
|
1204
|
+
* Equivalent to JavaScript's `Array.pop()`.
|
|
1205
|
+
*
|
|
1206
|
+
* @returns A PopArrayItemEvent to dispatch
|
|
1207
|
+
*/
|
|
1208
|
+
pop: () => PopArrayItemEvent;
|
|
1209
|
+
/**
|
|
1210
|
+
* Remove the FIRST item from the array.
|
|
1211
|
+
* Equivalent to JavaScript's `Array.shift()`.
|
|
1212
|
+
*
|
|
1213
|
+
* @returns A ShiftArrayItemEvent to dispatch
|
|
1214
|
+
*/
|
|
1215
|
+
shift: () => ShiftArrayItemEvent;
|
|
1216
|
+
/**
|
|
1217
|
+
* Remove an item at a SPECIFIC INDEX from the array.
|
|
1218
|
+
* Use when you need to remove a specific item by position.
|
|
1219
|
+
*
|
|
1220
|
+
* @param index - The position of the item to remove
|
|
1221
|
+
* @returns A RemoveAtIndexEvent to dispatch
|
|
1222
|
+
*/
|
|
1223
|
+
removeAt: (index: number) => RemoveAtIndexEvent;
|
|
1224
|
+
/**
|
|
1225
|
+
* Move an existing item from one position to another within the array.
|
|
1226
|
+
* This is an atomic reorder — the item is NOT destroyed and recreated.
|
|
1227
|
+
* The resolved component, form value, and stored template are preserved.
|
|
1228
|
+
*
|
|
1229
|
+
* @param from - The current index of the item to move
|
|
1230
|
+
* @param to - The target index to move the item to
|
|
1231
|
+
* @returns A MoveArrayItemEvent to dispatch
|
|
1232
|
+
*/
|
|
1233
|
+
move: (from: number, to: number) => MoveArrayItemEvent;
|
|
1218
1234
|
};
|
|
1219
|
-
|
|
1220
1235
|
/**
|
|
1221
1236
|
* Context object for array item operations (add/remove)
|
|
1222
1237
|
* Provides the necessary information to resolve tokens in array item event arguments
|
|
1223
1238
|
*/
|
|
1224
1239
|
interface ArrayItemContext {
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1240
|
+
/** The key of the field */
|
|
1241
|
+
key: string;
|
|
1242
|
+
/** Array index for the item */
|
|
1243
|
+
index?: number;
|
|
1244
|
+
/** Parent array field key */
|
|
1245
|
+
arrayKey?: string;
|
|
1246
|
+
/** Form value for token resolution */
|
|
1247
|
+
formValue?: unknown;
|
|
1233
1248
|
}
|
|
1234
|
-
|
|
1235
|
-
export { ActivePageInitializedEvent, AppendArrayItemEvent, BUILT_IN_FIELDS, ComponentAddonComponent, ConsoleLogger, DfTemplate, DynamicForm, EventDispatcher, FormClearEvent, FormResetEvent, FormSubmitEvent, GoToPageEvent, InsertArrayItemEvent, MoveArrayItemEvent, NextPageEvent, PageChangeEvent, PagerStateEvent, PopArrayItemEvent, PrependArrayItemEvent, PreviousPageEvent, RemoveAtIndexEvent, ShiftArrayItemEvent, TemplateAddonComponent, TextAddonComponent, arrayEvent, createWrappers, isWrappersBundle, provideDynamicForm, sanitizeFormConfig, withAddonActions, withCustomAddon, withEventFormValue, withExperimentalWebMcp, withFieldWindowing, withLegacyStatusClasses, withLoggerConfig, withPagePreload, withValidationExecutionDefaults, withValueExclusionDefaults, wrapperProps };
|
|
1236
|
-
export type { AddonActionsFeature, AddonWarning, ArrayItemContext, ArrayItemDefinitionTemplate, ExtractFieldDefs, ExtractFormValue, FieldParkingOption, InferWrapperRegistry, PageNavigationOptions, PagerState, SanitizeFormConfigOptions, SanitizedFormConfig, SubmissionOutcome, SubmissionReply, WebMcpStatus, WrapperRegistration, WrappersBundle };
|
|
1249
|
+
export { type AddonActionContext, type AddonActionPreset, type AddonActionsFeature, type AddonSlot, type AddonTypeDefinition, type AddonWarning, type AnyAddon, type ArrayAllowedChildren, type ArrayButtonConfig, type ArrayField, type ArrayItemContext, type ArrayItemDefinitionTemplate, type ArrayItemTemplate, type AsyncCondition, type AsyncConditionFunction, type AsyncCustomValidator, type AsyncDerivationFunction, type AsyncValidatorConfig, type AvailableFieldTypes, type BaseAddon, type BaseCheckedField, type BaseValidatorConfig, type BaseValueField, type BuiltInValidatorConfig, type CheckedFieldComponent, type CommonAddonActionPreset, type CommonAddonSlot, type ComponentAddon, type ConditionalExpression, type ContainerAllowedChildren, type ContainerField, type ContainerFieldTypes, type CssWrapper, type CustomFnConfig, type CustomFunction, type CustomValidator, type CustomValidatorConfig, DF_FIELD_TEMPLATES, type DeclarativeHttpValidatorConfig, type DynamicFormActionRegistry, type DynamicFormAddonActionPresetRegistry, type DynamicFormAddonRegistry, type DynamicFormAddonSlotRegistry, DynamicFormError, type DynamicFormFieldRegistry, DynamicFormLogger, type DynamicText, type DynamicValue, type EvaluationContext, type ExtractField, type ExtractFieldDefs, type ExtractFormValue, type FieldBoundAddonActionContext, type FieldComponent, type FieldDef, type FieldMeta, type FieldOption, type FieldParkingOption, type FieldPathAccess, type FieldRegistryContainers, type FieldRegistryLeaves, type FieldRegistryWrappers, type FieldWithValidation, type FieldWrapper, type FormConfig, type FormEvent, type FormEventConstructor, type FormMode, type FormModeDetectionResult, type FormOptions, type FormStateCondition, type GroupAllowedChildren, type GroupField, type HiddenField, type HiddenScalar, type HiddenValue, type HttpCondition, type HttpCustomValidator, type HttpRequestConfig, type HttpValidationResponseMapping, type InferFormValue, type InferWrapperRegistry, type InitialPageConfig, type LeafFieldTypes, type Logger, type LogicConfig, type NarrowField, type NarrowFields, type NextButtonOptions, NoopLogger, type OrphanAddonActionContext, type PageAllowedChildren, type PageField, type PageNavigationOptions, type PagerState, type RegisteredActionRef, type RegisteredFieldTypes, type ResolvedValidationExecutionConfig, type ResolvedValueExclusionConfig, type RowAllowedChildren, type RowErrorSpec, type RowField, type SanitizeFormConfigOptions, type SanitizedFormConfig, type SchemaApplicationConfig, type SchemaDefinition, type SimplifiedArrayField, type StateLogicConfig, type SubmissionActionResult, type SubmissionConfig, type SubmissionOutcome, type SubmissionReply, type SubmitButtonOptions, type TemplateAddon, type TextAddon, type TextElementType, type TextField, type TextProps, type TokenContext, type ValidationError, type ValidationExecutionConfig, type ValidationMessage, type ValidationMessageResolver, type ValidationMessages, type ValidatorConfig, type ValueExclusionConfig, type ValueFieldComponent, type ValueType, type WebMcpStatus, type WebMcpToolOptions, type WithInputSignals, type WrapperConfig, type WrapperRegistration, type WrapperTypeDefinition, type WrappersBundle, hasFormValue, isArrayField, isContainerField, isDisplayOnlyField, isFieldBoundContext, isFormStateCondition, isGroupField, isHiddenField, isLeafField, isPageField, isRowField, isSimplifiedArrayField, isValueBearingField, isWrapperTypeDefinition, resolveDynamicValue, rowError };
|