@ng-forge/dynamic-forms 1.2.0-next.9 → 1.3.0-next.1
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-array-field.component-6yyDriVB.mjs → ng-forge-dynamic-forms-array-field.component-CSCKq_1K.mjs} +5 -5
- package/fesm2022/{ng-forge-dynamic-forms-array-field.component-6yyDriVB.mjs.map → ng-forge-dynamic-forms-array-field.component-CSCKq_1K.mjs.map} +1 -1
- package/fesm2022/{ng-forge-dynamic-forms-bootstrap-derivation-orchestrator-BB8jAcY4.mjs → ng-forge-dynamic-forms-bootstrap-derivation-orchestrator-CTOTwzzw.mjs} +2 -2
- package/fesm2022/{ng-forge-dynamic-forms-bootstrap-derivation-orchestrator-BB8jAcY4.mjs.map → ng-forge-dynamic-forms-bootstrap-derivation-orchestrator-CTOTwzzw.mjs.map} +1 -1
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-web-mcp-BtjqeJOj.mjs +1054 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-web-mcp-BtjqeJOj.mjs.map +1 -0
- package/fesm2022/{ng-forge-dynamic-forms-container-field.component-DfQ0y-77.mjs → ng-forge-dynamic-forms-container-field.component-Dc3ROhHL.mjs} +7 -7
- package/fesm2022/ng-forge-dynamic-forms-container-field.component-Dc3ROhHL.mjs.map +1 -0
- package/fesm2022/{ng-forge-dynamic-forms-css-wrapper.component-D_yRuLpu.mjs → ng-forge-dynamic-forms-css-wrapper.component-BzgX8lAD.mjs} +5 -5
- package/fesm2022/ng-forge-dynamic-forms-css-wrapper.component-BzgX8lAD.mjs.map +1 -0
- package/fesm2022/{ng-forge-dynamic-forms-field-errors-wrapper.component-ZdaC4Bit.mjs → ng-forge-dynamic-forms-field-errors-wrapper.component-CIKbWqYA.mjs} +4 -4
- package/fesm2022/{ng-forge-dynamic-forms-field-errors-wrapper.component-ZdaC4Bit.mjs.map → ng-forge-dynamic-forms-field-errors-wrapper.component-CIKbWqYA.mjs.map} +1 -1
- package/fesm2022/{ng-forge-dynamic-forms-form-schema.service-BzbBv-r0.mjs → ng-forge-dynamic-forms-form-schema.service-Dx5Dlb15.mjs} +5 -5
- package/fesm2022/{ng-forge-dynamic-forms-form-schema.service-BzbBv-r0.mjs.map → ng-forge-dynamic-forms-form-schema.service-Dx5Dlb15.mjs.map} +1 -1
- package/fesm2022/{ng-forge-dynamic-forms-group-field.component-DxHD5I8E.mjs → ng-forge-dynamic-forms-group-field.component-DAC3P9DC.mjs} +6 -6
- package/fesm2022/{ng-forge-dynamic-forms-group-field.component-DxHD5I8E.mjs.map → ng-forge-dynamic-forms-group-field.component-DAC3P9DC.mjs.map} +1 -1
- package/fesm2022/ng-forge-dynamic-forms-integration.mjs +33 -33
- package/fesm2022/ng-forge-dynamic-forms-internal.mjs +19 -19
- package/fesm2022/ng-forge-dynamic-forms-internal.mjs.map +1 -1
- package/fesm2022/{ng-forge-dynamic-forms-ng-forge-dynamic-forms-tA8ZkP8i.mjs → ng-forge-dynamic-forms-ng-forge-dynamic-forms-CXQe_5td.mjs} +154 -68
- package/fesm2022/ng-forge-dynamic-forms-ng-forge-dynamic-forms-CXQe_5td.mjs.map +1 -0
- package/fesm2022/{ng-forge-dynamic-forms-page-field.component-DCdBvJ-h.mjs → ng-forge-dynamic-forms-page-field.component-DPKJcwUO.mjs} +5 -5
- package/fesm2022/{ng-forge-dynamic-forms-page-field.component-DCdBvJ-h.mjs.map → ng-forge-dynamic-forms-page-field.component-DPKJcwUO.mjs.map} +1 -1
- package/fesm2022/{ng-forge-dynamic-forms-row-wrapper.component-BBWmqQA_.mjs → ng-forge-dynamic-forms-row-wrapper.component-DMEeKZny.mjs} +5 -5
- package/fesm2022/ng-forge-dynamic-forms-row-wrapper.component-DMEeKZny.mjs.map +1 -0
- package/fesm2022/{ng-forge-dynamic-forms-schema-builder-IsjNBo0h.mjs → ng-forge-dynamic-forms-schema-builder-BvDTzfdM.mjs} +2 -2
- package/fesm2022/{ng-forge-dynamic-forms-schema-builder-IsjNBo0h.mjs.map → ng-forge-dynamic-forms-schema-builder-BvDTzfdM.mjs.map} +1 -1
- package/fesm2022/{ng-forge-dynamic-forms-text-field.component-C-f80sbk.mjs → ng-forge-dynamic-forms-text-field.component-BB-jutBq.mjs} +4 -4
- package/fesm2022/{ng-forge-dynamic-forms-text-field.component-C-f80sbk.mjs.map → ng-forge-dynamic-forms-text-field.component-BB-jutBq.mjs.map} +1 -1
- package/fesm2022/ng-forge-dynamic-forms.mjs +1 -1
- package/package.json +2 -2
- package/types/ng-forge-dynamic-forms-internal.d.ts +114 -3
- package/types/ng-forge-dynamic-forms.d.ts +157 -4
- package/fesm2022/ng-forge-dynamic-forms-container-field.component-DfQ0y-77.mjs.map +0 -1
- package/fesm2022/ng-forge-dynamic-forms-css-wrapper.component-D_yRuLpu.mjs.map +0 -1
- package/fesm2022/ng-forge-dynamic-forms-ng-forge-dynamic-forms-tA8ZkP8i.mjs.map +0 -1
- package/fesm2022/ng-forge-dynamic-forms-row-wrapper.component-BBWmqQA_.mjs.map +0 -1
|
@@ -83,6 +83,45 @@ interface FieldMeta {
|
|
|
83
83
|
[key: string]: string | number | boolean | undefined;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
+
/**
|
|
87
|
+
* Per-field WebMCP exposure policy.
|
|
88
|
+
*
|
|
89
|
+
* WebMCP tools are callable by any agent that reaches the page, so what a field
|
|
90
|
+
* lets an agent read and write is a security decision, not a formatting one.
|
|
91
|
+
* Sensible defaults are derived from the field itself (see below); this
|
|
92
|
+
* overrides them where the author knows better.
|
|
93
|
+
*
|
|
94
|
+
* Defaults, applied when a key is left unset:
|
|
95
|
+
*
|
|
96
|
+
* | Field | `readable` | `writable` |
|
|
97
|
+
* | --- | --- | --- |
|
|
98
|
+
* | `type: 'hidden'` | `false` | `false` |
|
|
99
|
+
* | `props.type === 'password'` | `false` | `true` |
|
|
100
|
+
* | `readonly: true`, or a `derivation` | `true` | `false` |
|
|
101
|
+
* | anything else | `true` | `true` |
|
|
102
|
+
*
|
|
103
|
+
* @experimental
|
|
104
|
+
*/
|
|
105
|
+
interface FieldWebMcpOptions {
|
|
106
|
+
/**
|
|
107
|
+
* Whether an agent may read this field's value back in a tool response.
|
|
108
|
+
*
|
|
109
|
+
* A field that is not readable is still reported by name, so the agent knows
|
|
110
|
+
* it exists and whether it currently holds a value — only the value itself is
|
|
111
|
+
* withheld.
|
|
112
|
+
*/
|
|
113
|
+
readable?: boolean;
|
|
114
|
+
/** Whether an agent may write this field. A write to a non-writable field is rejected. */
|
|
115
|
+
writable?: boolean;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* A field's WebMCP exposure policy. `false` is shorthand for hiding the field
|
|
119
|
+
* from agents entirely (`{ readable: false, writable: false }`).
|
|
120
|
+
*
|
|
121
|
+
* @experimental
|
|
122
|
+
*/
|
|
123
|
+
type FieldWebMcpConfig = FieldWebMcpOptions | false;
|
|
124
|
+
|
|
86
125
|
/**
|
|
87
126
|
* Base interface for all dynamic form field definitions.
|
|
88
127
|
*
|
|
@@ -168,6 +207,17 @@ interface FieldDef<TProps, TMeta extends FieldMeta = FieldMeta> {
|
|
|
168
207
|
skipDefaultWrappers?: boolean;
|
|
169
208
|
/** Addons rendered inside this field's slots (typically `prefix` / `suffix`). */
|
|
170
209
|
addons?: ReadonlyArray<AnyAddon>;
|
|
210
|
+
/**
|
|
211
|
+
* What a browser AI agent may read and write on this field, when the form
|
|
212
|
+
* opts in through `options.webMcp`. Ignored otherwise.
|
|
213
|
+
*
|
|
214
|
+
* Defaults are derived from the field (a password input is not readable, a
|
|
215
|
+
* `readonly` or derived field is not writable, a `hidden` field type is
|
|
216
|
+
* neither); `false` hides the field from agents entirely.
|
|
217
|
+
*
|
|
218
|
+
* @experimental
|
|
219
|
+
*/
|
|
220
|
+
webMcp?: FieldWebMcpConfig;
|
|
171
221
|
}
|
|
172
222
|
type IncludedKeys = 'label' | 'className' | 'hidden' | 'tabIndex';
|
|
173
223
|
/**
|
|
@@ -1695,6 +1745,67 @@ interface FormOptions {
|
|
|
1695
1745
|
* @default undefined (uses global setting)
|
|
1696
1746
|
*/
|
|
1697
1747
|
emitFormValueOnEvents?: boolean;
|
|
1748
|
+
/**
|
|
1749
|
+
* Exposes this form to browser AI agents as WebMCP tools.
|
|
1750
|
+
*
|
|
1751
|
+
* Requires the `withExperimentalWebMcp()` feature on `provideDynamicForm(...)`. Registers
|
|
1752
|
+
* `fill_{name}`, which applies a partial patch of values and reports the
|
|
1753
|
+
* form's state back. Submission stays off unless `allowSubmit` is set.
|
|
1754
|
+
*
|
|
1755
|
+
* Experimental: WebMCP is an emerging standard and Angular's underlying APIs
|
|
1756
|
+
* are marked experimental, so this may change outside a major version.
|
|
1757
|
+
*
|
|
1758
|
+
* @example
|
|
1759
|
+
* ```typescript
|
|
1760
|
+
* options: { webMcp: { name: 'invoice', description: 'Create an invoice for a customer.' } }
|
|
1761
|
+
* ```
|
|
1762
|
+
*
|
|
1763
|
+
* @default undefined (form is not exposed to agents)
|
|
1764
|
+
*/
|
|
1765
|
+
webMcp?: WebMcpToolOptions;
|
|
1766
|
+
}
|
|
1767
|
+
/** Identifies a form's WebMCP tools to connected AI agents. */
|
|
1768
|
+
interface WebMcpToolOptions {
|
|
1769
|
+
/**
|
|
1770
|
+
* Base name for this form's tools, used as `fill_{name}` and (when submission
|
|
1771
|
+
* is allowed) `submit_{name}`. Must be unique across every form on the page.
|
|
1772
|
+
*/
|
|
1773
|
+
name: string;
|
|
1774
|
+
/** What this form is for, and when an agent should reach for it. */
|
|
1775
|
+
description: string;
|
|
1776
|
+
/**
|
|
1777
|
+
* Whether an agent may submit this form directly.
|
|
1778
|
+
*
|
|
1779
|
+
* Off by default. Every registered tool is callable by any agent that reaches
|
|
1780
|
+
* the page, including one acting on injected instructions from elsewhere, so
|
|
1781
|
+
* submission is treated as the consequential step and kept opt-in. With it
|
|
1782
|
+
* off, an agent can still fill the form and a human presses the button.
|
|
1783
|
+
*
|
|
1784
|
+
* Leave it off for anything that spends money, sends a message, or cannot be
|
|
1785
|
+
* undone.
|
|
1786
|
+
*
|
|
1787
|
+
* @default false
|
|
1788
|
+
*/
|
|
1789
|
+
allowSubmit?: boolean;
|
|
1790
|
+
/**
|
|
1791
|
+
* How much of the form a tool response hands back to the agent.
|
|
1792
|
+
*
|
|
1793
|
+
* `'changed'` (the default) returns only the values the call itself set, plus
|
|
1794
|
+
* which fields apply, which are still empty, and any validation errors. That
|
|
1795
|
+
* is enough for an agent to orient itself and correct its own work without
|
|
1796
|
+
* being handed every value the form already held — prefilled personal data,
|
|
1797
|
+
* identifiers, anything a user typed before the agent arrived.
|
|
1798
|
+
*
|
|
1799
|
+
* `'all'` returns the whole model, minus fields whose `webMcp.readable` is
|
|
1800
|
+
* off. Choose it deliberately: every registered tool is callable by any agent
|
|
1801
|
+
* that reaches the page, and Chrome's guidance is that even a read-only tool
|
|
1802
|
+
* can reveal user information.
|
|
1803
|
+
*
|
|
1804
|
+
* @see https://developer.chrome.com/docs/ai/webmcp/secure-tools
|
|
1805
|
+
*
|
|
1806
|
+
* @default 'changed'
|
|
1807
|
+
*/
|
|
1808
|
+
readback?: 'changed' | 'all';
|
|
1698
1809
|
}
|
|
1699
1810
|
/** Options for controlling submit button disabled behavior. */
|
|
1700
1811
|
interface SubmitButtonOptions {
|
|
@@ -3173,7 +3284,7 @@ interface BaseCheckedField<TProps, TMeta extends FieldMeta = FieldMeta, TNullabl
|
|
|
3173
3284
|
nullable?: TNullable;
|
|
3174
3285
|
}
|
|
3175
3286
|
declare function isCheckedField<TProps, TMeta extends FieldMeta = FieldMeta>(field: FieldDef<TProps, TMeta>): field is BaseCheckedField<TProps, TMeta, boolean>;
|
|
3176
|
-
type ExcludedKeys$1 = 'type' | 'conditionals' | 'value' | 'nullable' | 'disabled' | 'readonly' | 'hidden' | 'col' | keyof FieldWithValidation | 'excludeValueIfHidden' | 'excludeValueIfDisabled' | 'excludeValueIfReadonly' | 'validateWhenHidden' | 'wrappers' | 'skipAutoWrappers' | 'skipDefaultWrappers' | 'addons';
|
|
3287
|
+
type ExcludedKeys$1 = 'type' | 'conditionals' | 'value' | 'nullable' | 'disabled' | 'readonly' | 'hidden' | 'col' | keyof FieldWithValidation | 'excludeValueIfHidden' | 'excludeValueIfDisabled' | 'excludeValueIfReadonly' | 'validateWhenHidden' | 'wrappers' | 'skipAutoWrappers' | 'skipDefaultWrappers' | 'addons' | 'webMcp';
|
|
3177
3288
|
type CheckedFieldComponent<T extends BaseCheckedField<Record<string, unknown> | unknown, FieldMeta, boolean>> = Prettify<WithInputSignals<Omit<T, ExcludedKeys$1>>>;
|
|
3178
3289
|
|
|
3179
3290
|
/**
|
|
@@ -3197,7 +3308,7 @@ interface BaseValueField<TProps, TValue, TMeta extends FieldMeta = FieldMeta, TN
|
|
|
3197
3308
|
nullable?: TNullable;
|
|
3198
3309
|
}
|
|
3199
3310
|
declare function isValueField<TProps, TMeta extends FieldMeta = FieldMeta>(field: FieldDef<TProps, TMeta>): field is BaseValueField<TProps, ValueType, TMeta, boolean>;
|
|
3200
|
-
type ExcludedKeys = 'type' | 'conditionals' | 'value' | 'valueType' | 'nullable' | 'disabled' | 'readonly' | 'hidden' | 'col' | 'minValue' | 'maxValue' | 'step' | 'required' | 'email' | 'min' | 'max' | 'minLength' | 'maxLength' | 'pattern' | 'validators' | 'logic' | 'derivation' | 'schemas' | 'excludeValueIfHidden' | 'excludeValueIfDisabled' | 'excludeValueIfReadonly' | 'validateWhenHidden' | 'wrappers' | 'skipAutoWrappers' | 'skipDefaultWrappers' | 'addons';
|
|
3311
|
+
type ExcludedKeys = 'type' | 'conditionals' | 'value' | 'valueType' | 'nullable' | 'disabled' | 'readonly' | 'hidden' | 'col' | 'minValue' | 'maxValue' | 'step' | 'required' | 'email' | 'min' | 'max' | 'minLength' | 'maxLength' | 'pattern' | 'validators' | 'logic' | 'derivation' | 'schemas' | 'excludeValueIfHidden' | 'excludeValueIfDisabled' | 'excludeValueIfReadonly' | 'validateWhenHidden' | 'wrappers' | 'skipAutoWrappers' | 'skipDefaultWrappers' | 'addons' | 'webMcp';
|
|
3201
3312
|
type ValueFieldComponent<T extends BaseValueField<Record<string, unknown> | unknown, unknown, FieldMeta, boolean>> = Prettify<WithInputSignals<Omit<T, ExcludedKeys>>>;
|
|
3202
3313
|
|
|
3203
3314
|
/** Base interface for all form events in the dynamic form system. */
|
|
@@ -3907,4 +4018,4 @@ declare abstract class FieldErrorsWrapperBase implements FieldWrapper, FieldErro
|
|
|
3907
4018
|
declare function provideFieldErrorDisplay(wrapper: () => Type<FieldErrorDisplayClaim>): Provider;
|
|
3908
4019
|
|
|
3909
4020
|
export { ADDON_ACTION_HANDLERS, ADDON_ACTION_REGISTRY, ADDON_TYPE_COMPONENT_CACHE, ADDON_TYPE_DEFINITIONS, ADDON_TYPE_REGISTRY, ARRAY_CONTEXT, AsyncConditionFunctionCacheService, ComponentInitializedEvent, DEFAULT_PROPS, DEFAULT_VALIDATION_MESSAGES, DEFAULT_WRAPPERS, DEPRECATION_WARNING_TRACKER, DF_FIELD_TEMPLATES, DfAddonSlot, DynamicFormError, DynamicFormLogger, DynamicTextPipe, DynamicValueFunctionCacheService, EMIT_FORM_VALUE_ON_EVENTS, EXTERNAL_DATA, EventBus, ExpressionParser, ExpressionParserError, FIELD_ERROR_DISPLAY, FIELD_REGISTRY, FIELD_SIGNAL_CONTEXT, FORM_ID_PREFIX, FORM_OPTIONS, FieldContextRegistryService, FieldErrorsWrapperBase, FunctionRegistryService, GROUP_CONTEXT, HTTP_CONDITION_CACHE, HttpConditionCache, HttpConditionFunctionCacheService, INITIALIZATION_TIMEOUT_MS, LogicFunctionCacheService, NoopLogger, READONLY_FIELD_TREE_CACHE, RootFormRegistryService, TokenType, WRAPPER_AUTO_ASSOCIATIONS, WRAPPER_COMPONENT_CACHE, WRAPPER_COMPONENT_LOAD_CACHE, WRAPPER_REGISTRY, applyMetaToElement, applyValidator, applyValidators, arrayFieldMapper, assertNever, baseFieldMapper, buildBaseInputs, buildClassName, compareValues, containerFieldMapper, createAddonActionRegistry, createDebouncedLogicFunction, createDefaultDerivationLogConfig, createDynamicValueFunction, createFieldValueProxy, createFormFieldStateMap, createFormStateLogicFunction, createInitializationTracker, createLogicFunction, createResolvedErrorsSignal, createWarningTracker, deepMergeDefaults, derivedFromDeferred, detectFormMode, dynamicTextToObservable, evaluateCondition, evaluateNonFieldDisabled, evaluateNonFieldHidden, extractExpressionDependencies, extractStringDependencies, getArrayLength, getChangedKeys, getChangedKeysWithin, getFieldValueHandling, getGridClassString, getNestedValue, groupFieldMapper, hasChildFields, hasCrossFieldWhenCondition, hasFormValue, hasNestedProperty, hasTargetProperty, injectAddonTypeRegistry, injectFieldErrors, injectFieldSignalContext, injectFieldsSupportingAddons, injectNonFieldEvaluationContext, interpolateParams, isArrayField, isCheckedField, isContainerField, isCrossFieldBuiltInValidator, isCrossFieldExpression, isCrossFieldSchema, isCrossFieldStateLogic, isCrossFieldValidator, isDerivationLogicConfig, isDisplayOnlyField, isEqual, isFieldBoundContext, isFormStateCondition, isFunctionHttpValidator, isGenericContainerField, isGroupField, isHiddenField, isLeafField, isNonPagedForm, isPageField, isPagedForm, isResourceBasedValidator, isRowField, isSimplifiedArrayField, isStateLogicConfig, isValidNonPagedForm, isValidPagedForm, isValueBearingField, isValueField, isWrapperTypeDefinition, keyBy, mapValues, memoize, normalizeFieldsArray, omit, pageFieldMapper, provideFieldErrorDisplay, readFieldStateInfo, resolveDynamicValue, resolveHttpRequest, resolveNextButtonDisabled, resolveNonFieldDisabled, resolveNonFieldHidden, resolveSubmitButtonDisabled, resolveTokens, rowError, rowFieldMapper, runPresetAction, setupInitializationTracking, shouldLog, shouldShowErrors, textFieldMapper, toReadonlyFieldTree, toReadonlyFieldTreeCached, validatePageNesting, withPreviousValue, writeToFieldValue };
|
|
3910
|
-
export type { ASTNode, AddonActionContext, AddonActionHandler, AddonActionPreset, AddonShapeValidator, AddonSlot, AddonTypeDefinition, AddonTypeRegistryRef, AddonTypeSchema, AndCondition, AnyAddon, ArrayAllowedChildren, ArrayButtonConfig, ArrayComponent, ArrayContext, ArrayField, ArrayFieldTree, ArrayItemDefinition, ArrayItemTemplate, ArrayLiteralNode, ArrowFunctionNode, AsyncCondition, AsyncConditionFunction, AsyncCustomValidator, AsyncDerivationFunction, AsyncValidatorConfig, AvailableFieldTypes, BaseAddon, BaseCheckedField, BaseValidatorConfig, BaseValueField, BinaryOpNode, BuiltInValidatorConfig, ButtonLogicContext, CallExpressionNode, CheckedFieldComponent, CommonAddonActionPreset, CommonAddonSlot, ComparisonOperator, ComponentAddon, ComputedMemberAccessNode, ConditionalExpression, ConditionalNode, ContainerAllowedChildren, ContainerComponent, ContainerField, ContainerFieldTypes, ContainerLogicConfig, ContainerValidation, CrossFieldDetectionContext, CssWrapper, CustomCondition, CustomFnConfig, CustomFunction, CustomFunctionOptions, CustomFunctionScope, CustomValidator, CustomValidatorConfig, DeclarativeHttpValidatorConfig, DerivationLogConfig, DerivationLogLevel, DerivationLogicConfig, DerivedFromDeferredOptions, DynamicFormActionRegistry, DynamicFormAddonActionPresetRegistry, DynamicFormAddonRegistry, DynamicFormAddonSlotRegistry, DynamicFormFieldRegistry, DynamicText, DynamicValue, EvaluationContext, ExtractField, FieldAddonSupport, FieldAddonSupportEntry, FieldBoundAddonActionContext, FieldComponent, FieldDef, FieldErrorDisplayClaim, FieldErrors, FieldErrorsOptions, FieldErrorsWrapper, FieldMeta, FieldOption, FieldPathAccess, FieldRegistryContainers, FieldRegistryLeaves, FieldRegistryWrappers, FieldScope, FieldSignalContext, FieldStateContext, FieldStateInfo, FieldTreeRecord, FieldTypeDefinition, FieldValueCondition, FieldWithValidation, FieldWrapper, FormConfig, FormEvent, FormEventConstructor, FormFieldStateMap, FormMode, FormModeDetectionResult, FormOptions, FormStateCondition, FunctionHttpValidatorConfig, GroupAllowedChildren, GroupComponent, GroupContext, GroupField, HiddenField, HiddenScalar, HiddenValue, HttpCondition, HttpCustomValidator, HttpRequestConfig, HttpResourceRequest, HttpValidationResponseMapping, IdentifierNode, InferFormModel, InferFormValue, InitialPageConfig, InitializationTrackingOptions, JavascriptCondition, LazyComponentLoader, LeafFieldTypes, LiteralNode, Logger, LogicConfig, LogicTrigger, MapperFn, MemberAccessNode, MemoizeOptions, NarrowField, NarrowFields, NextButtonOptions, NonFieldLogicConfig, NonFieldLogicContext, NonFieldLogicType, ObjectLiteralNode, OrCondition, OrphanAddonActionContext, PageAllowedChildren, PageField, PresetCollaborators, Prettify, ReadonlyFieldTree, RegisteredActionRef, RegisteredFieldTypes, RegisteredWrapperTypes, RenderReadyInput, ResolvedError, ResolvedValidationExecutionConfig, ResolvedValueExclusionConfig, RowAllowedChildren, RowComponent, RowErrorSpec, RowField, RowWrapper, SchemaApplicationConfig, SchemaDefinition, SimplifiedArrayField, StateLogicConfig, StateLogicType, SubmissionActionResult, SubmissionConfig, SubmitButtonOptions, TemplateAddon, TextAddon, TextElementType, TextField, TextProps, Token, TokenContext, UnaryOpNode, ValidationError, ValidationExecutionConfig, ValidationMessage, ValidationMessageResolver, ValidationMessages, ValidatorAttachment, ValidatorConfig, ValueExclusionConfig, ValueFieldComponent, ValueHandlingMode, ValueType, WarningTracker, WithInputSignals, WrapperAutoAssociations, WrapperConfig, WrapperFieldInputs, WrapperTypeDefinition };
|
|
4021
|
+
export type { ASTNode, AddonActionContext, AddonActionHandler, AddonActionPreset, AddonShapeValidator, AddonSlot, AddonTypeDefinition, AddonTypeRegistryRef, AddonTypeSchema, AndCondition, AnyAddon, ArrayAllowedChildren, ArrayButtonConfig, ArrayComponent, ArrayContext, ArrayField, ArrayFieldTree, ArrayItemDefinition, ArrayItemTemplate, ArrayLiteralNode, ArrowFunctionNode, AsyncCondition, AsyncConditionFunction, AsyncCustomValidator, AsyncDerivationFunction, AsyncValidatorConfig, AvailableFieldTypes, BaseAddon, BaseCheckedField, BaseValidatorConfig, BaseValueField, BinaryOpNode, BuiltInValidatorConfig, ButtonLogicContext, CallExpressionNode, CheckedFieldComponent, CommonAddonActionPreset, CommonAddonSlot, ComparisonOperator, ComponentAddon, ComputedMemberAccessNode, ConditionalExpression, ConditionalNode, ContainerAllowedChildren, ContainerComponent, ContainerField, ContainerFieldTypes, ContainerLogicConfig, ContainerValidation, CrossFieldDetectionContext, CssWrapper, CustomCondition, CustomFnConfig, CustomFunction, CustomFunctionOptions, CustomFunctionScope, CustomValidator, CustomValidatorConfig, DeclarativeHttpValidatorConfig, DerivationLogConfig, DerivationLogLevel, DerivationLogicConfig, DerivedFromDeferredOptions, DynamicFormActionRegistry, DynamicFormAddonActionPresetRegistry, DynamicFormAddonRegistry, DynamicFormAddonSlotRegistry, DynamicFormFieldRegistry, DynamicText, DynamicValue, EvaluationContext, ExtractField, FieldAddonSupport, FieldAddonSupportEntry, FieldBoundAddonActionContext, FieldComponent, FieldDef, FieldErrorDisplayClaim, FieldErrors, FieldErrorsOptions, FieldErrorsWrapper, FieldMeta, FieldOption, FieldPathAccess, FieldRegistryContainers, FieldRegistryLeaves, FieldRegistryWrappers, FieldScope, FieldSignalContext, FieldStateContext, FieldStateInfo, FieldTreeRecord, FieldTypeDefinition, FieldValueCondition, FieldWebMcpConfig, FieldWebMcpOptions, FieldWithValidation, FieldWrapper, FormConfig, FormEvent, FormEventConstructor, FormFieldStateMap, FormMode, FormModeDetectionResult, FormOptions, FormStateCondition, FunctionHttpValidatorConfig, GroupAllowedChildren, GroupComponent, GroupContext, GroupField, HiddenField, HiddenScalar, HiddenValue, HttpCondition, HttpCustomValidator, HttpRequestConfig, HttpResourceRequest, HttpValidationResponseMapping, IdentifierNode, InferFormModel, InferFormValue, InitialPageConfig, InitializationTrackingOptions, JavascriptCondition, LazyComponentLoader, LeafFieldTypes, LiteralNode, Logger, LogicConfig, LogicTrigger, MapperFn, MemberAccessNode, MemoizeOptions, NarrowField, NarrowFields, NextButtonOptions, NonFieldLogicConfig, NonFieldLogicContext, NonFieldLogicType, ObjectLiteralNode, OrCondition, OrphanAddonActionContext, PageAllowedChildren, PageField, PresetCollaborators, Prettify, ReadonlyFieldTree, RegisteredActionRef, RegisteredFieldTypes, RegisteredWrapperTypes, RenderReadyInput, ResolvedError, ResolvedValidationExecutionConfig, ResolvedValueExclusionConfig, RowAllowedChildren, RowComponent, RowErrorSpec, RowField, RowWrapper, SchemaApplicationConfig, SchemaDefinition, SimplifiedArrayField, StateLogicConfig, StateLogicType, SubmissionActionResult, SubmissionConfig, SubmitButtonOptions, TemplateAddon, TextAddon, TextElementType, TextField, TextProps, Token, TokenContext, UnaryOpNode, ValidationError, ValidationExecutionConfig, ValidationMessage, ValidationMessageResolver, ValidationMessages, ValidatorAttachment, ValidatorConfig, ValueExclusionConfig, ValueFieldComponent, ValueHandlingMode, ValueType, WarningTracker, WebMcpToolOptions, WithInputSignals, WrapperAutoAssociations, WrapperConfig, WrapperFieldInputs, WrapperTypeDefinition };
|
|
@@ -3,7 +3,7 @@ import * as _angular_forms_signals from '@angular/forms/signals';
|
|
|
3
3
|
import { FieldTree } from '@angular/forms/signals';
|
|
4
4
|
import * as _ng_forge_dynamic_forms_internal from '@ng-forge/dynamic-forms/internal';
|
|
5
5
|
import { FormEvent, FieldDef, RegisteredFieldTypes, InferFormModel, FormConfig, FormOptions, EventBus, LazyComponentLoader, WrapperTypeDefinition, FieldTypeDefinition, InferFormValue as InferFormValue$1, DerivationLogLevel, Logger, ValueExclusionConfig, ValidationExecutionConfig, TextAddon, WrapperFieldInputs, TemplateAddon, ComponentAddon, BaseAddon, AddonTypeDefinition, AddonActionHandler, ArrayItemDefinition } from '@ng-forge/dynamic-forms/internal';
|
|
6
|
-
export { AddonActionContext, AddonActionPreset, AddonSlot, AddonTypeDefinition, AnyAddon, ArrayAllowedChildren, ArrayButtonConfig, ArrayField, ArrayItemTemplate, AsyncCondition, AsyncConditionFunction, AsyncCustomValidator, AsyncDerivationFunction, AsyncValidatorConfig, AvailableFieldTypes, BaseAddon, BaseCheckedField, BaseValidatorConfig, BaseValueField, BuiltInValidatorConfig, CheckedFieldComponent, CommonAddonActionPreset, CommonAddonSlot, ComponentAddon, ConditionalExpression, ContainerAllowedChildren, ContainerField, ContainerFieldTypes, CssWrapper, CustomFnConfig, CustomFunction, CustomValidator, CustomValidatorConfig, DF_FIELD_TEMPLATES, DeclarativeHttpValidatorConfig, DynamicFormActionRegistry, DynamicFormAddonActionPresetRegistry, DynamicFormAddonRegistry, DynamicFormAddonSlotRegistry, DynamicFormError, DynamicFormFieldRegistry, DynamicFormLogger, DynamicText, DynamicValue, EvaluationContext, ExtractField, FieldBoundAddonActionContext, FieldComponent, FieldDef, FieldMeta, FieldOption, FieldPathAccess, FieldRegistryContainers, FieldRegistryLeaves, FieldRegistryWrappers, FieldWithValidation, FieldWrapper, FormConfig, FormEvent, FormEventConstructor, FormMode, FormModeDetectionResult, FormOptions, FormStateCondition, GroupAllowedChildren, GroupField, HiddenField, HiddenScalar, HiddenValue, HttpCondition, HttpCustomValidator, HttpRequestConfig, HttpValidationResponseMapping, InferFormValue, InitialPageConfig, LeafFieldTypes, Logger, LogicConfig, NarrowField, NarrowFields, NextButtonOptions, NoopLogger, OrphanAddonActionContext, PageAllowedChildren, PageField, RegisteredActionRef, RegisteredFieldTypes, ResolvedValidationExecutionConfig, ResolvedValueExclusionConfig, RowAllowedChildren, RowErrorSpec, RowField, SchemaApplicationConfig, SchemaDefinition, SimplifiedArrayField, StateLogicConfig, SubmissionActionResult, SubmissionConfig, SubmitButtonOptions, TemplateAddon, TextAddon, TextElementType, TextField, TextProps, TokenContext, ValidationError, ValidationExecutionConfig, ValidationMessage, ValidationMessageResolver, ValidationMessages, ValidatorConfig, ValueExclusionConfig, ValueFieldComponent, ValueType, WithInputSignals, WrapperConfig, WrapperTypeDefinition, hasFormValue, isArrayField, isContainerField, isDisplayOnlyField, isFieldBoundContext, isFormStateCondition, isGroupField, isHiddenField, isLeafField, isPageField, isRowField, isSimplifiedArrayField, isValueBearingField, isWrapperTypeDefinition, resolveDynamicValue, rowError } from '@ng-forge/dynamic-forms/internal';
|
|
6
|
+
export { AddonActionContext, AddonActionPreset, AddonSlot, AddonTypeDefinition, AnyAddon, ArrayAllowedChildren, ArrayButtonConfig, ArrayField, ArrayItemTemplate, AsyncCondition, AsyncConditionFunction, AsyncCustomValidator, AsyncDerivationFunction, AsyncValidatorConfig, AvailableFieldTypes, BaseAddon, BaseCheckedField, BaseValidatorConfig, BaseValueField, BuiltInValidatorConfig, CheckedFieldComponent, CommonAddonActionPreset, CommonAddonSlot, ComponentAddon, ConditionalExpression, ContainerAllowedChildren, ContainerField, ContainerFieldTypes, CssWrapper, CustomFnConfig, CustomFunction, CustomValidator, CustomValidatorConfig, DF_FIELD_TEMPLATES, DeclarativeHttpValidatorConfig, DynamicFormActionRegistry, DynamicFormAddonActionPresetRegistry, DynamicFormAddonRegistry, DynamicFormAddonSlotRegistry, DynamicFormError, DynamicFormFieldRegistry, DynamicFormLogger, DynamicText, DynamicValue, EvaluationContext, ExtractField, FieldBoundAddonActionContext, FieldComponent, FieldDef, FieldMeta, FieldOption, FieldPathAccess, FieldRegistryContainers, FieldRegistryLeaves, FieldRegistryWrappers, FieldWithValidation, FieldWrapper, FormConfig, FormEvent, FormEventConstructor, FormMode, FormModeDetectionResult, FormOptions, FormStateCondition, GroupAllowedChildren, GroupField, HiddenField, HiddenScalar, HiddenValue, HttpCondition, HttpCustomValidator, HttpRequestConfig, HttpValidationResponseMapping, InferFormValue, InitialPageConfig, LeafFieldTypes, Logger, LogicConfig, NarrowField, NarrowFields, NextButtonOptions, NoopLogger, OrphanAddonActionContext, PageAllowedChildren, PageField, RegisteredActionRef, RegisteredFieldTypes, ResolvedValidationExecutionConfig, ResolvedValueExclusionConfig, RowAllowedChildren, RowErrorSpec, RowField, SchemaApplicationConfig, SchemaDefinition, SimplifiedArrayField, StateLogicConfig, SubmissionActionResult, SubmissionConfig, SubmitButtonOptions, TemplateAddon, TextAddon, TextElementType, TextField, TextProps, TokenContext, ValidationError, ValidationExecutionConfig, ValidationMessage, ValidationMessageResolver, ValidationMessages, ValidatorConfig, ValueExclusionConfig, ValueFieldComponent, ValueType, WebMcpToolOptions, WithInputSignals, WrapperConfig, WrapperTypeDefinition, hasFormValue, isArrayField, isContainerField, isDisplayOnlyField, isFieldBoundContext, isFormStateCondition, isGroupField, isHiddenField, isLeafField, isPageField, isRowField, isSimplifiedArrayField, isValueBearingField, isWrapperTypeDefinition, resolveDynamicValue, rowError } from '@ng-forge/dynamic-forms/internal';
|
|
7
7
|
import * as _angular_core from '@angular/core';
|
|
8
8
|
import { Type, Injector, Signal, EnvironmentInjector, WritableSignal, Provider, EnvironmentProviders, TemplateRef } from '@angular/core';
|
|
9
9
|
import * as _ng_forge_dynamic_forms from '@ng-forge/dynamic-forms';
|
|
@@ -231,6 +231,7 @@ declare class DynamicForm<TFields extends RegisteredFieldTypes[] = RegisteredFie
|
|
|
231
231
|
excludeValueIfReadonly?: boolean;
|
|
232
232
|
validateWhenHidden?: boolean;
|
|
233
233
|
emitFormValueOnEvents?: boolean;
|
|
234
|
+
webMcp?: _ng_forge_dynamic_forms.WebMcpToolOptions;
|
|
234
235
|
}>;
|
|
235
236
|
/** Field signal context for injection into child components */
|
|
236
237
|
fieldSignalContext: Signal<_ng_forge_dynamic_forms_internal.FieldSignalContext<TModel>>;
|
|
@@ -259,6 +260,21 @@ declare class DynamicForm<TFields extends RegisteredFieldTypes[] = RegisteredFie
|
|
|
259
260
|
/** Whether to render the form template */
|
|
260
261
|
private derivationReady;
|
|
261
262
|
shouldRender: Signal<boolean>;
|
|
263
|
+
/**
|
|
264
|
+
* What the experimental WebMCP layer is doing for this form.
|
|
265
|
+
*
|
|
266
|
+
* Injecting it is also what instantiates the gate (component providers are
|
|
267
|
+
* lazy), which is what keeps the registrar lazily loaded. Intentionally absent
|
|
268
|
+
* from `shouldRender`: agent visibility must never gate render.
|
|
269
|
+
*
|
|
270
|
+
* `'disabled'` unless `withExperimentalWebMcp()` is provided; `'idle'` until a
|
|
271
|
+
* config declares `options.webMcp`; `'active'` once its tools are registered.
|
|
272
|
+
* `'failed'` and `'unsupported'` are the two ways registration does not
|
|
273
|
+
* happen, and are worth surfacing rather than guessing at.
|
|
274
|
+
*
|
|
275
|
+
* @experimental
|
|
276
|
+
*/
|
|
277
|
+
readonly webMcpStatus: Signal<_ng_forge_dynamic_forms.WebMcpStatus>;
|
|
262
278
|
/** Resolved fields ready for rendering */
|
|
263
279
|
protected resolvedFields: Signal<ResolvedField[]>;
|
|
264
280
|
/**
|
|
@@ -618,6 +634,135 @@ declare function withFieldWindowing(config?: {
|
|
|
618
634
|
park?: FieldParkingOption;
|
|
619
635
|
}): DynamicFormFeature<'field-windowing'>;
|
|
620
636
|
|
|
637
|
+
/**
|
|
638
|
+
* Enables WebMCP tool registration for forms that declare `options.webMcp`.
|
|
639
|
+
*
|
|
640
|
+
* @experimental
|
|
641
|
+
*
|
|
642
|
+
* @remarks
|
|
643
|
+
* WebMCP lets an AI agent running in the browser discover and drive a form
|
|
644
|
+
* through structured tools rather than by simulating clicks. Each opted-in form
|
|
645
|
+
* registers `fill_{name}`, which applies a partial patch of values to the form
|
|
646
|
+
* and reports back what it set, which fields apply, which are still empty, and
|
|
647
|
+
* any validation errors. Submission is a separate, per-form opt-in
|
|
648
|
+
* (`options.webMcp.allowSubmit`); without it the agent stages values and a human
|
|
649
|
+
* presses the button.
|
|
650
|
+
*
|
|
651
|
+
* The tool schema is generated from the form config, so agents see labels,
|
|
652
|
+
* option enums with their human titles, and static validator constraints rather
|
|
653
|
+
* than the bare types value-shape inference would produce. Agent arguments are
|
|
654
|
+
* validated in code before anything is written, and a call that does not parse
|
|
655
|
+
* is rejected whole rather than half-applied.
|
|
656
|
+
*
|
|
657
|
+
* Nothing is registered unless a form opts in, and the registrar module is
|
|
658
|
+
* dynamically imported, so a form without `options.webMcp` never loads it — the
|
|
659
|
+
* feature itself, the token and the form-scoped hook that decides are part of
|
|
660
|
+
* the main bundle. Registration is browser-only and no-ops where the page
|
|
661
|
+
* exposes no model context.
|
|
662
|
+
*
|
|
663
|
+
* Named `experimental` on purpose: WebMCP is a proposed standard, in an origin
|
|
664
|
+
* trial as of Chrome 149, and the browser surface underneath this may still
|
|
665
|
+
* change. Expect breaking changes outside a major version.
|
|
666
|
+
*
|
|
667
|
+
* @returns A DynamicFormFeature enabling WebMCP registration.
|
|
668
|
+
*
|
|
669
|
+
* @example
|
|
670
|
+
* ```typescript
|
|
671
|
+
* provideDynamicForm(...withMaterialFields(), withExperimentalWebMcp());
|
|
672
|
+
*
|
|
673
|
+
* const config = {
|
|
674
|
+
* options: { webMcp: { name: 'signup', description: 'Sign a new user up.' } },
|
|
675
|
+
* fields: [...],
|
|
676
|
+
* } as const satisfies FormConfig;
|
|
677
|
+
* ```
|
|
678
|
+
*/
|
|
679
|
+
declare function withExperimentalWebMcp(): DynamicFormFeature<'web-mcp'>;
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* What the WebMCP layer is currently doing for this form. Reported by
|
|
683
|
+
* `DynamicForm.webMcpStatus()`; `'active'` is the only state in which an agent
|
|
684
|
+
* can see the form.
|
|
685
|
+
*
|
|
686
|
+
* @experimental
|
|
687
|
+
*/
|
|
688
|
+
type WebMcpStatus =
|
|
689
|
+
/** `withExperimentalWebMcp()` is not provided, or this is the server. */
|
|
690
|
+
'disabled'
|
|
691
|
+
/** Enabled, but the current config does not declare `options.webMcp`. */
|
|
692
|
+
| 'idle'
|
|
693
|
+
/** Loading the registrar or awaiting `registerTool()`. */
|
|
694
|
+
| 'registering'
|
|
695
|
+
/** Tools are registered against the browser's model context. */
|
|
696
|
+
| 'active'
|
|
697
|
+
/** The browser exposes no model context, so there is nothing to register against. */
|
|
698
|
+
| 'unsupported'
|
|
699
|
+
/** Registration was attempted and rejected. See the console for the reason. */
|
|
700
|
+
| 'failed';
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* How a submission ended.
|
|
704
|
+
*
|
|
705
|
+
* Dispatching `FormSubmitEvent` is fire-and-forget: the submission pipeline
|
|
706
|
+
* drops a second submission through `exhaustMap`, skips submission entirely when
|
|
707
|
+
* the form is invalid or async validators are still pending, and swallows an
|
|
708
|
+
* asynchronous action failure to keep the stream alive. None of that is visible
|
|
709
|
+
* to the caller, which is fine for a button click — the user is watching the
|
|
710
|
+
* page — and wrong for anything that has to report back, an agent tool call
|
|
711
|
+
* above all.
|
|
712
|
+
*
|
|
713
|
+
* @experimental
|
|
714
|
+
*/
|
|
715
|
+
type SubmissionOutcome = {
|
|
716
|
+
readonly status: 'success';
|
|
717
|
+
}
|
|
718
|
+
/** No `submission.action` is configured; the `(submitted)` output received the value. */
|
|
719
|
+
| {
|
|
720
|
+
readonly status: 'dispatched';
|
|
721
|
+
}
|
|
722
|
+
/** The form was invalid, so nothing was submitted. */
|
|
723
|
+
| {
|
|
724
|
+
readonly status: 'validation-failed';
|
|
725
|
+
}
|
|
726
|
+
/** Async validators had not resolved, so submission was skipped. */
|
|
727
|
+
| {
|
|
728
|
+
readonly status: 'pending-validation';
|
|
729
|
+
}
|
|
730
|
+
/** The action ran and came back with server-side validation errors. */
|
|
731
|
+
| {
|
|
732
|
+
readonly status: 'server-errors';
|
|
733
|
+
}
|
|
734
|
+
/** The action threw or rejected. */
|
|
735
|
+
| {
|
|
736
|
+
readonly status: 'action-failed';
|
|
737
|
+
readonly error: unknown;
|
|
738
|
+
}
|
|
739
|
+
/** Another submission was already in flight and this one was dropped. */
|
|
740
|
+
| {
|
|
741
|
+
readonly status: 'busy';
|
|
742
|
+
}
|
|
743
|
+
/** The form went away before the submission settled. */
|
|
744
|
+
| {
|
|
745
|
+
readonly status: 'cancelled';
|
|
746
|
+
};
|
|
747
|
+
/**
|
|
748
|
+
* The reply channel a caller attaches to `FormSubmitEvent` when it needs to know
|
|
749
|
+
* what happened.
|
|
750
|
+
*
|
|
751
|
+
* `accept()` is called by the submission handler the moment it takes the event.
|
|
752
|
+
* Because the event bus dispatches synchronously, a caller that finds its reply
|
|
753
|
+
* un-accepted once `dispatch()` returns knows the pipeline dropped the
|
|
754
|
+
* submission rather than merely not having finished it yet — which is the only
|
|
755
|
+
* way to tell "busy" apart from "still running".
|
|
756
|
+
*
|
|
757
|
+
* @experimental
|
|
758
|
+
*/
|
|
759
|
+
interface SubmissionReply {
|
|
760
|
+
/** Marks the submission as taken by the pipeline. */
|
|
761
|
+
accept(): void;
|
|
762
|
+
/** Reports the final outcome. The first call wins; later calls are ignored. */
|
|
763
|
+
settle(outcome: SubmissionOutcome): void;
|
|
764
|
+
}
|
|
765
|
+
|
|
621
766
|
/**
|
|
622
767
|
* Configures global validation execution defaults — when validators should run
|
|
623
768
|
* relative to a field's reactive state.
|
|
@@ -836,9 +981,17 @@ declare class GoToPageEvent implements FormEvent {
|
|
|
836
981
|
options?: PageNavigationOptions | undefined);
|
|
837
982
|
}
|
|
838
983
|
|
|
839
|
-
/**
|
|
984
|
+
/**
|
|
985
|
+
* Event dispatched to submit the form (the action behind a `submit` button).
|
|
986
|
+
*
|
|
987
|
+
* A caller that needs to know how the submission ended passes a
|
|
988
|
+
* {@link SubmissionReply}; the submission handler reports back through it. A
|
|
989
|
+
* button click passes nothing and stays fire-and-forget, as before.
|
|
990
|
+
*/
|
|
840
991
|
declare class FormSubmitEvent implements FormEvent {
|
|
992
|
+
readonly reply?: SubmissionReply | undefined;
|
|
841
993
|
readonly type: "submit";
|
|
994
|
+
constructor(reply?: SubmissionReply | undefined);
|
|
842
995
|
}
|
|
843
996
|
|
|
844
997
|
/** Event dispatched to advance a paged form to the next page. */
|
|
@@ -1079,5 +1232,5 @@ interface ArrayItemContext {
|
|
|
1079
1232
|
formValue?: unknown;
|
|
1080
1233
|
}
|
|
1081
1234
|
|
|
1082
|
-
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, withFieldWindowing, withLegacyStatusClasses, withLoggerConfig, withPagePreload, withValidationExecutionDefaults, withValueExclusionDefaults, wrapperProps };
|
|
1083
|
-
export type { AddonActionsFeature, AddonWarning, ArrayItemContext, ArrayItemDefinitionTemplate, ExtractFieldDefs, ExtractFormValue, FieldParkingOption, InferWrapperRegistry, PageNavigationOptions, PagerState, SanitizeFormConfigOptions, SanitizedFormConfig, WrapperRegistration, WrappersBundle };
|
|
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 };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ng-forge-dynamic-forms-container-field.component-DfQ0y-77.mjs","mappings":";;;;;AAuDc;AACK;;AAEA;AACE;AACF;AACA;AACA;AACA;;;AAIA;AACA;;;;;AAIjB;;;;AAGS;;AACA;;;;AAGQ;;AAEE;AAGf;AACA;;;AAGA;AACE;;;AAKI;;AAIP;AAIc;AAOjB;AACE;AAQA;;;AAGE;AACD;;;AAnEgB;;;;;;;AAZlB;;;;AATS;;;;;;;;AAYR;AACA;AACA;AACA;AACA;AACA;;AAgBgD","names":[],"ignoreList":[],"sources":["../../../../packages/dynamic-forms/src/lib/fields/container/container-field.component.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n EnvironmentInjector,\n inject,\n Injector,\n input,\n TemplateRef,\n viewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport { DfFieldOutlet } from '../../directives/df-field-outlet/df-field-outlet.directive';\nimport { derivedFromDeferred } from '@ng-forge/dynamic-forms/internal';\nimport { createFieldResolutionPipe, ResolvedField } from '../../utils/resolve-field/resolve-field';\nimport {\n computeContainerHostClasses,\n initializationComponentPath,\n setupContainerInitEffect,\n} from '../../utils/container-utils/container-utils';\nimport { ContainerField } from '@ng-forge/dynamic-forms/internal';\nimport { injectFieldRegistry } from '../../utils/inject-field-registry/inject-field-registry';\nimport { EventBus } from '@ng-forge/dynamic-forms/internal';\nimport { FieldDef } from '@ng-forge/dynamic-forms/internal';\nimport { DynamicFormLogger } from '@ng-forge/dynamic-forms/internal';\nimport { WRAPPER_AUTO_ASSOCIATIONS, WRAPPER_REGISTRY } from '@ng-forge/dynamic-forms/internal';\nimport { DEFAULT_WRAPPERS } from '@ng-forge/dynamic-forms/internal';\nimport { isSameWrapperChain, resolveWrappers } from '../../utils/resolve-wrappers/resolve-wrappers';\nimport { createWrapperChainController } from '../../utils/wrapper-chain/wrapper-chain-controller';\nimport { GROUP_CONTEXT } from '@ng-forge/dynamic-forms/internal';\n\n/** Layout container that wraps child fields with UI chrome. */\n@Component({\n selector: 'div[container-field]',\n imports: [DfFieldOutlet],\n template: `\n <ng-template #childrenTpl>\n @for (field of resolvedFields(); track field.key) {\n <ng-container *dfFieldOutlet=\"field; environmentInjector: environmentInjector\" />\n }\n </ng-template>\n <ng-container #wrapperContainer></ng-container>\n `,\n styleUrl: './container-field.component.scss',\n host: {\n '[class]': 'hostClasses()',\n '[class.disabled]': 'disabled()',\n '[class.df-container-hidden]': 'hidden()',\n '[attr.aria-hidden]': 'hidden() || null',\n '[id]': '`${key()}`',\n '[attr.data-testid]': 'key()',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport default class ContainerFieldComponent {\n private readonly destroyRef = inject(DestroyRef);\n private readonly fieldRegistry = injectFieldRegistry();\n private readonly injector = inject(Injector);\n protected readonly environmentInjector = inject(EnvironmentInjector);\n private readonly eventBus = inject(EventBus);\n private readonly logger = inject(DynamicFormLogger);\n private readonly wrapperAutoAssociations = inject(WRAPPER_AUTO_ASSOCIATIONS);\n private readonly wrapperRegistry = inject(WRAPPER_REGISTRY);\n private readonly defaultWrappersSignal = inject(DEFAULT_WRAPPERS, { optional: true });\n private readonly groupContext = inject(GROUP_CONTEXT, { optional: true });\n\n private readonly childrenTpl = viewChild.required('childrenTpl', { read: TemplateRef });\n private readonly wrapperContainer = viewChild.required('wrapperContainer', { read: ViewContainerRef });\n\n field = input.required<ContainerField>();\n key = input.required<string>();\n className = input<string>();\n hidden = input(false);\n\n readonly hostClasses = computed(() => computeContainerHostClasses('container', this.className()));\n readonly disabled = computed(() => this.field().disabled || false);\n\n private readonly rawFieldRegistry = computed(() => this.fieldRegistry.raw);\n private readonly fieldsSource = computed(() => (this.field().fields || []) as FieldDef<unknown>[]);\n\n protected readonly resolvedFields = derivedFromDeferred(\n this.fieldsSource,\n createFieldResolutionPipe(() => ({\n loadTypeComponent: (type: string) => this.fieldRegistry.loadTypeComponent(type),\n registry: this.rawFieldRegistry(),\n injector: this.injector,\n destroyRef: this.destroyRef,\n onError: (fieldDef: FieldDef<unknown>, error: unknown) => {\n const fieldKey = fieldDef.key || '<no key>';\n\n const containerKey = this.field().key || '<no key>';\n this.logger.error(\n `Failed to load component for field type '${fieldDef.type}' (key: ${fieldKey}) ` +\n `within container '${containerKey}'. Ensure the field type is registered in your field registry.`,\n error,\n );\n },\n })),\n { initialValue: [] as ResolvedField[], injector: this.injector },\n );\n\n private readonly wrappers = computed(\n () => resolveWrappers(this.field(), this.defaultWrappersSignal?.(), this.wrapperAutoAssociations, this.wrapperRegistry),\n {\n equal: isSameWrapperChain,\n },\n );\n\n constructor() {\n setupContainerInitEffect(\n this.resolvedFields,\n this.eventBus,\n 'container',\n () => initializationComponentPath(this.field().key, this.groupContext?.groupPath()),\n this.injector,\n );\n\n createWrapperChainController({\n vcr: this.wrapperContainer,\n wrappers: this.wrappers,\n renderInnermost: (slot) => slot.createEmbeddedView(this.childrenTpl()),\n });\n }\n}\n\nexport { ContainerFieldComponent };\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ng-forge-dynamic-forms-css-wrapper.component-D_yRuLpu.mjs","mappings":";;;;;;AAiBc;AACK;AAER;AAEA;;AACA;;AAEA;AAIL;AACD;;;;;;AArBM;AACT;AACA;;AAEA;AACE;AACD;AACF;AAI8C","names":[],"ignoreList":[],"sources":["../../../../packages/dynamic-forms/src/lib/wrappers/css/css-wrapper.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, inject, Injector, input, Signal, ViewContainerRef, viewChild } from '@angular/core';\nimport { pipe, switchMap } from 'rxjs';\nimport { derivedFrom } from 'ngxtension/derived-from';\nimport { FieldWrapper } from '@ng-forge/dynamic-forms/internal';\nimport { DynamicText } from '@ng-forge/dynamic-forms/internal';\nimport { dynamicTextToObservable } from '@ng-forge/dynamic-forms/internal';\nimport { WrapperFieldInputs } from '@ng-forge/dynamic-forms/internal';\n\n/** Built-in CSS wrapper component. */\n@Component({\n selector: 'df-css-wrapper',\n template: `<ng-container #fieldComponent></ng-container>`,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'resolvedClasses()',\n },\n})\nexport default class CssWrapperComponent implements FieldWrapper {\n private readonly injector = inject(Injector);\n\n readonly fieldComponent = viewChild.required('fieldComponent', { read: ViewContainerRef });\n\n readonly cssClasses = input<DynamicText>();\n readonly fieldInputs = input<WrapperFieldInputs>();\n\n readonly resolvedClasses: Signal<string> = derivedFrom(\n [this.cssClasses],\n pipe(switchMap(([value]) => dynamicTextToObservable(value, this.injector))),\n {\n initialValue: '',\n },\n );\n}\n\nexport { CssWrapperComponent };\n"]}
|