@ng-forge/dynamic-forms 0.9.0-next.12 → 0.9.0-next.13
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-BgCrTME1.mjs → ng-forge-dynamic-forms-array-field.component-Ckpe0rW7.mjs} +9 -9
- package/fesm2022/ng-forge-dynamic-forms-array-field.component-Ckpe0rW7.mjs.map +1 -0
- package/fesm2022/{ng-forge-dynamic-forms-container-field.component-VHaBk_1l.mjs → ng-forge-dynamic-forms-container-field.component-BD7Lpcts.mjs} +6 -6
- package/fesm2022/{ng-forge-dynamic-forms-container-field.component-VHaBk_1l.mjs.map → ng-forge-dynamic-forms-container-field.component-BD7Lpcts.mjs.map} +1 -1
- package/fesm2022/{ng-forge-dynamic-forms-container-utils-CGJiiKBY.mjs → ng-forge-dynamic-forms-container-utils-CeHyhb2v.mjs} +2 -2
- package/fesm2022/{ng-forge-dynamic-forms-container-utils-CGJiiKBY.mjs.map → ng-forge-dynamic-forms-container-utils-CeHyhb2v.mjs.map} +1 -1
- package/fesm2022/{ng-forge-dynamic-forms-css-wrapper.component-BOdw40ZF.mjs → ng-forge-dynamic-forms-css-wrapper.component-DkyuJH6T.mjs} +5 -5
- package/fesm2022/{ng-forge-dynamic-forms-css-wrapper.component-BOdw40ZF.mjs.map → ng-forge-dynamic-forms-css-wrapper.component-DkyuJH6T.mjs.map} +1 -1
- package/fesm2022/{ng-forge-dynamic-forms-emit-initialization-D72mQxlX.mjs → ng-forge-dynamic-forms-emit-initialization-u4H5jr35.mjs} +2 -2
- package/fesm2022/{ng-forge-dynamic-forms-emit-initialization-D72mQxlX.mjs.map → ng-forge-dynamic-forms-emit-initialization-u4H5jr35.mjs.map} +1 -1
- package/fesm2022/{ng-forge-dynamic-forms-group-field.component-BvTQwoLg.mjs → ng-forge-dynamic-forms-group-field.component-C9xUHrXp.mjs} +9 -9
- package/fesm2022/ng-forge-dynamic-forms-group-field.component-C9xUHrXp.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-integration.mjs +334 -27
- package/fesm2022/ng-forge-dynamic-forms-integration.mjs.map +1 -1
- package/fesm2022/{ng-forge-dynamic-forms-ng-forge-dynamic-forms-BAPGCjUs.mjs → ng-forge-dynamic-forms-ng-forge-dynamic-forms-BbgkzKuI.mjs} +1572 -186
- package/fesm2022/ng-forge-dynamic-forms-ng-forge-dynamic-forms-BbgkzKuI.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-page-field.component-BwNIx3R1.mjs +114 -0
- package/fesm2022/{ng-forge-dynamic-forms-page-field.component-DDzmhJNn.mjs.map → ng-forge-dynamic-forms-page-field.component-BwNIx3R1.mjs.map} +1 -1
- package/fesm2022/ng-forge-dynamic-forms-row-wrapper.component-CFtnatYj.mjs +34 -0
- package/fesm2022/{ng-forge-dynamic-forms-row-wrapper.component-BIvEUoia.mjs.map → ng-forge-dynamic-forms-row-wrapper.component-CFtnatYj.mjs.map} +1 -1
- package/fesm2022/{ng-forge-dynamic-forms-text-field.component-Bo4zNJXY.mjs → ng-forge-dynamic-forms-text-field.component-CpgtswdO.mjs} +5 -5
- package/fesm2022/{ng-forge-dynamic-forms-text-field.component-Bo4zNJXY.mjs.map → ng-forge-dynamic-forms-text-field.component-CpgtswdO.mjs.map} +1 -1
- package/fesm2022/ng-forge-dynamic-forms.mjs +1 -1
- package/package.json +1 -1
- package/types/ng-forge-dynamic-forms-integration.d.ts +241 -37
- package/types/ng-forge-dynamic-forms.d.ts +1671 -531
- package/fesm2022/ng-forge-dynamic-forms-array-field.component-BgCrTME1.mjs.map +0 -1
- package/fesm2022/ng-forge-dynamic-forms-group-field.component-BvTQwoLg.mjs.map +0 -1
- package/fesm2022/ng-forge-dynamic-forms-ng-forge-dynamic-forms-BAPGCjUs.mjs.map +0 -1
- package/fesm2022/ng-forge-dynamic-forms-page-field.component-DDzmhJNn.mjs +0 -114
- package/fesm2022/ng-forge-dynamic-forms-row-wrapper.component-BIvEUoia.mjs +0 -34
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FormEvent, FieldDef, FormEventConstructor, StateLogicConfig, BaseCheckedField, BaseValueField, FieldMeta, FieldOption, ArrayAllowedChildren, NonFieldLogicConfig, NextPageEvent, PreviousPageEvent, FieldWithValidation, ValidationMessages, DynamicText, ArrayItemContext, EventBus } from '@ng-forge/dynamic-forms';
|
|
1
|
+
import { FormEvent, FieldDef, FormEventConstructor, StateLogicConfig, BaseCheckedField, BaseValueField, FieldMeta, FieldOption, ArrayAllowedChildren, NonFieldLogicConfig, NextPageEvent, PreviousPageEvent, FieldWithValidation, ValidationMessages, DynamicText, ArrayItemContext, AnyAddon, BaseAddon, AddonActionHandler, DynamicValue, WrapperFieldInputs, AddonActionContext, EventBus } from '@ng-forge/dynamic-forms';
|
|
2
2
|
export { FieldWrapper, InferWrapperRegistry, NonFieldLogicConfig, NonFieldLogicContext, NonFieldLogicType, WrapperFieldInputs, WrapperRegistration, WrapperTypeDefinition, WrappersBundle, createWrappers, isEqual, isWrappersBundle, resolveNonFieldDisabled, resolveNonFieldHidden, wrapperProps } from '@ng-forge/dynamic-forms';
|
|
3
|
-
import * as
|
|
4
|
-
import { Signal, Injector, ElementRef, Provider, WritableSignal, Type } from '@angular/core';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { Signal, Injector, ElementRef, InjectionToken, Provider, WritableSignal, Type } from '@angular/core';
|
|
5
5
|
import { FieldTree, SchemaPath } from '@angular/forms/signals';
|
|
6
6
|
import { ComponentFixture } from '@angular/core/testing';
|
|
7
7
|
|
|
@@ -820,10 +820,10 @@ declare function createAriaDescribedBySignal(errorsToDisplay: Signal<ResolvedErr
|
|
|
820
820
|
* directly.
|
|
821
821
|
*/
|
|
822
822
|
declare class NgForgeFieldShell {
|
|
823
|
-
readonly key:
|
|
824
|
-
readonly className:
|
|
825
|
-
static ɵfac:
|
|
826
|
-
static ɵdir:
|
|
823
|
+
readonly key: i0.InputSignal<string>;
|
|
824
|
+
readonly className: i0.InputSignal<string>;
|
|
825
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgForgeFieldShell, never>;
|
|
826
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgForgeFieldShell, never, never, { "key": { "alias": "key"; "required": true; "isSignal": true; }; "className": { "alias": "className"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
827
827
|
}
|
|
828
828
|
/** Input names forwarded onto `NgForgeFieldShell` via `hostDirectives`. */
|
|
829
829
|
declare const NG_FORGE_FIELD_SHELL_INPUTS: readonly ["key", "className"];
|
|
@@ -867,13 +867,13 @@ declare class NgForgeField {
|
|
|
867
867
|
readonly key: Signal<string>;
|
|
868
868
|
/** Shell-owned className, re-exported as plain `Signal<string>` for the same reason. */
|
|
869
869
|
readonly className: Signal<string>;
|
|
870
|
-
readonly field:
|
|
871
|
-
readonly label:
|
|
872
|
-
readonly placeholder:
|
|
873
|
-
readonly tabIndex:
|
|
874
|
-
readonly props:
|
|
875
|
-
readonly meta:
|
|
876
|
-
readonly validationMessages:
|
|
870
|
+
readonly field: i0.InputSignal<FieldTree<unknown>>;
|
|
871
|
+
readonly label: i0.InputSignal<DynamicText | undefined>;
|
|
872
|
+
readonly placeholder: i0.InputSignal<DynamicText | undefined>;
|
|
873
|
+
readonly tabIndex: i0.InputSignal<number | undefined>;
|
|
874
|
+
readonly props: i0.InputSignal<unknown>;
|
|
875
|
+
readonly meta: i0.InputSignal<FieldMeta | undefined>;
|
|
876
|
+
readonly validationMessages: i0.InputSignal<ValidationMessages | undefined>;
|
|
877
877
|
private readonly defaultValidationMessages;
|
|
878
878
|
readonly errors: Signal<ResolvedError[]>;
|
|
879
879
|
readonly showErrors: Signal<boolean>;
|
|
@@ -888,8 +888,8 @@ declare class NgForgeField {
|
|
|
888
888
|
markClaimed(): void;
|
|
889
889
|
private readonly logger;
|
|
890
890
|
constructor();
|
|
891
|
-
static ɵfac:
|
|
892
|
-
static ɵdir:
|
|
891
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgForgeField, never>;
|
|
892
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgForgeField, never, never, { "field": { "alias": "field"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "tabIndex": { "alias": "tabIndex"; "required": false; "isSignal": true; }; "props": { "alias": "props"; "required": false; "isSignal": true; }; "meta": { "alias": "meta"; "required": false; "isSignal": true; }; "validationMessages": { "alias": "validationMessages"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
893
893
|
}
|
|
894
894
|
/**
|
|
895
895
|
* Inputs forwarded onto `NgForgeField` via `hostDirectives`. Excludes
|
|
@@ -950,14 +950,14 @@ declare class NgForgeAction<TEvent extends FormEvent = FormEvent> {
|
|
|
950
950
|
private readonly shell;
|
|
951
951
|
readonly key: Signal<string>;
|
|
952
952
|
readonly className: Signal<string>;
|
|
953
|
-
readonly label:
|
|
954
|
-
readonly disabled:
|
|
955
|
-
readonly hidden:
|
|
956
|
-
readonly tabIndex:
|
|
957
|
-
readonly event:
|
|
958
|
-
readonly eventArgs:
|
|
959
|
-
readonly eventContext:
|
|
960
|
-
readonly props:
|
|
953
|
+
readonly label: i0.InputSignal<DynamicText>;
|
|
954
|
+
readonly disabled: i0.InputSignal<boolean>;
|
|
955
|
+
readonly hidden: i0.InputSignal<boolean>;
|
|
956
|
+
readonly tabIndex: i0.InputSignal<number | undefined>;
|
|
957
|
+
readonly event: i0.InputSignal<FormEventConstructor<TEvent> | undefined>;
|
|
958
|
+
readonly eventArgs: i0.InputSignal<EventArgs | undefined>;
|
|
959
|
+
readonly eventContext: i0.InputSignal<ArrayItemContext | undefined>;
|
|
960
|
+
readonly props: i0.InputSignal<unknown>;
|
|
961
961
|
private readonly eventBus;
|
|
962
962
|
private readonly arrayContext;
|
|
963
963
|
/**
|
|
@@ -968,8 +968,8 @@ declare class NgForgeAction<TEvent extends FormEvent = FormEvent> {
|
|
|
968
968
|
* (e.g. submit buttons handled by the native form lifecycle).
|
|
969
969
|
*/
|
|
970
970
|
dispatch(): void;
|
|
971
|
-
static ɵfac:
|
|
972
|
-
static ɵdir:
|
|
971
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgForgeAction<any>, never>;
|
|
972
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgForgeAction<any>, never, never, { "label": { "alias": "label"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "hidden": { "alias": "hidden"; "required": false; "isSignal": true; }; "tabIndex": { "alias": "tabIndex"; "required": false; "isSignal": true; }; "event": { "alias": "event"; "required": false; "isSignal": true; }; "eventArgs": { "alias": "eventArgs"; "required": false; "isSignal": true; }; "eventContext": { "alias": "eventContext"; "required": false; "isSignal": true; }; "props": { "alias": "props"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
973
973
|
}
|
|
974
974
|
/**
|
|
975
975
|
* Inputs forwarded onto `NgForgeAction` via `hostDirectives`. Excludes
|
|
@@ -989,6 +989,210 @@ declare const NG_FORGE_ACTION_INPUTS: readonly ["label", "disabled", "hidden", "
|
|
|
989
989
|
*/
|
|
990
990
|
declare function injectNgForgeAction<TEvent extends FormEvent = FormEvent>(): NgForgeAction<TEvent>;
|
|
991
991
|
|
|
992
|
+
/**
|
|
993
|
+
* Universal addon-array plumbing: signal-cached `hidden` resolution and
|
|
994
|
+
* slot bucketing. Used internally by the `NgForgeAddons` host wrapper —
|
|
995
|
+
* consumers should compose `NgForgeAddons` directly and inject the
|
|
996
|
+
* directive instance via `injectNgForgeAddons<TAddon>()`.
|
|
997
|
+
*/
|
|
998
|
+
declare class NgForgeAddonsBase {
|
|
999
|
+
/** Capture the host's injector so `toSignal` (inside `resolveDynamicValue`) ties to the host's `DestroyRef`. */
|
|
1000
|
+
private readonly hostInjector;
|
|
1001
|
+
/** Addon array mapped from `FieldDef.addons` by `buildBaseInputs`. */
|
|
1002
|
+
readonly addons: i0.InputSignal<readonly AnyAddon[] | undefined>;
|
|
1003
|
+
/**
|
|
1004
|
+
* Per-addon `hidden` signal cache. Built via `explicitEffect` rather
|
|
1005
|
+
* than `computed` because `toSignal` (inside `resolveDynamicValue` for
|
|
1006
|
+
* Observable inputs) is disallowed in reactive contexts (NG0602).
|
|
1007
|
+
*/
|
|
1008
|
+
private readonly _hiddenSignalCache;
|
|
1009
|
+
readonly hiddenSignalCache: Signal<ReadonlyMap<AnyAddon, Signal<boolean>>>;
|
|
1010
|
+
readonly visibleAddons: Signal<ReadonlyArray<AnyAddon>>;
|
|
1011
|
+
readonly hasAddons: Signal<boolean>;
|
|
1012
|
+
readonly prefixAddons: Signal<ReadonlyArray<AnyAddon>>;
|
|
1013
|
+
readonly suffixAddons: Signal<ReadonlyArray<AnyAddon>>;
|
|
1014
|
+
/**
|
|
1015
|
+
* Visible addons grouped by their `slot` string. Convenience view for
|
|
1016
|
+
* adapters with non-universal slots (e.g., Ionic `start` / `end`).
|
|
1017
|
+
*/
|
|
1018
|
+
readonly addonsBySlot: Signal<ReadonlyMap<string, ReadonlyArray<AnyAddon>>>;
|
|
1019
|
+
/** Secondary index keyed by `hidden` value identity. Catches the common case
|
|
1020
|
+
* where a FormConfig re-emit produces structurally-different-but-content-
|
|
1021
|
+
* identical addon objects — without this, every re-emit would spawn a new
|
|
1022
|
+
* `toSignal` subscription for each addon's hidden axis. */
|
|
1023
|
+
private readonly _hiddenByValue;
|
|
1024
|
+
constructor();
|
|
1025
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgForgeAddonsBase, never>;
|
|
1026
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgForgeAddonsBase, never, never, { "addons": { "alias": "addons"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1027
|
+
}
|
|
1028
|
+
/** Forwarded onto `NgForgeAddonsBase` via the `NgForgeAddons` wrapper. */
|
|
1029
|
+
declare const NG_FORGE_ADDONS_INPUTS: readonly ["addons"];
|
|
1030
|
+
/**
|
|
1031
|
+
* Host wrapper for `NgForgeAddonsBase`. Consumers compose this directly:
|
|
1032
|
+
*
|
|
1033
|
+
* ```ts
|
|
1034
|
+
* \@Component({
|
|
1035
|
+
* hostDirectives: [NgForgeFieldHost, NgForgeAddons],
|
|
1036
|
+
* template: `
|
|
1037
|
+
* @if (ngfa.hasAddons()) {
|
|
1038
|
+
* <p-inputgroup>
|
|
1039
|
+
* @for (a of ngfa.prefixAddons(); track $index) {
|
|
1040
|
+
* <df-addon-slot [addon]="a" [hidden]="ngfa.hiddenSignalCache().get(a)" />
|
|
1041
|
+
* }
|
|
1042
|
+
* <input ngForgeControl ... />
|
|
1043
|
+
* </p-inputgroup>
|
|
1044
|
+
* }
|
|
1045
|
+
* `,
|
|
1046
|
+
* })
|
|
1047
|
+
* export class MyInputField {
|
|
1048
|
+
* protected readonly ngfa = injectNgForgeAddons<MyInputAddon>();
|
|
1049
|
+
* }
|
|
1050
|
+
* ```
|
|
1051
|
+
*
|
|
1052
|
+
* The wrapper exists so `hostDirectives: [NgForgeAddons]` resolves
|
|
1053
|
+
* cross-package — same constraint that drives `NgForgeFieldHost`.
|
|
1054
|
+
*/
|
|
1055
|
+
declare class NgForgeAddons {
|
|
1056
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgForgeAddons, never>;
|
|
1057
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgForgeAddons, never, never, {}, {}, never, never, true, [{ directive: typeof NgForgeAddonsBase; inputs: { "addons": "addons"; }; outputs: {}; }]>;
|
|
1058
|
+
}
|
|
1059
|
+
/** Narrowed view of `NgForgeAddonsBase` returned by `injectNgForgeAddons<TAddon>()`. */
|
|
1060
|
+
type TypedNgForgeAddons<TAddon extends AnyAddon = AnyAddon> = Omit<NgForgeAddonsBase, 'addons' | 'visibleAddons' | 'prefixAddons' | 'suffixAddons'> & {
|
|
1061
|
+
readonly addons: Signal<ReadonlyArray<TAddon> | undefined>;
|
|
1062
|
+
readonly visibleAddons: Signal<ReadonlyArray<TAddon>>;
|
|
1063
|
+
readonly prefixAddons: Signal<ReadonlyArray<TAddon>>;
|
|
1064
|
+
readonly suffixAddons: Signal<ReadonlyArray<TAddon>>;
|
|
1065
|
+
};
|
|
1066
|
+
/**
|
|
1067
|
+
* Typed inject helper. Always resolves to the underlying
|
|
1068
|
+
* `NgForgeAddonsBase` instance — the wrapper class has no instance
|
|
1069
|
+
* fields of its own.
|
|
1070
|
+
*/
|
|
1071
|
+
declare function injectNgForgeAddons<TAddon extends AnyAddon = AnyAddon>(): TypedNgForgeAddons<TAddon>;
|
|
1072
|
+
|
|
1073
|
+
/**
|
|
1074
|
+
* Permissive shape the directive reads from `addon()`. Adapter-specific
|
|
1075
|
+
* addon types (e.g., `PrimeButtonAddon`) narrow this at the inject site via
|
|
1076
|
+
* `injectNgForgeAddonAction<T>()`.
|
|
1077
|
+
*/
|
|
1078
|
+
interface ActionAddonShape extends BaseAddon {
|
|
1079
|
+
readonly preset?: string;
|
|
1080
|
+
readonly actionRef?: string;
|
|
1081
|
+
readonly action?: AddonActionHandler;
|
|
1082
|
+
readonly disabled?: DynamicValue<boolean>;
|
|
1083
|
+
readonly loading?: DynamicValue<boolean>;
|
|
1084
|
+
}
|
|
1085
|
+
/**
|
|
1086
|
+
* Universal click-dispatch plumbing for action-style addons (icon buttons,
|
|
1087
|
+
* labelled buttons, etc.): `disabled` / `loading` resolution from
|
|
1088
|
+
* `DynamicValue<boolean>`, action context construction, and the
|
|
1089
|
+
* `preset / actionRef / action` precedence dispatcher.
|
|
1090
|
+
*
|
|
1091
|
+
* Adapter button kinds (e.g., `prime-button`) compose `NgForgeAddonAction`
|
|
1092
|
+
* and read state via `injectNgForgeAddonAction<TAddon>()`. Preset semantics
|
|
1093
|
+
* are adapter-specific — register an `ADDON_PRESET_HANDLER` at the host
|
|
1094
|
+
* field scope to receive preset dispatches.
|
|
1095
|
+
*/
|
|
1096
|
+
declare class NgForgeAddonActionBase {
|
|
1097
|
+
private readonly actionRegistry;
|
|
1098
|
+
private readonly presetHandler;
|
|
1099
|
+
private readonly logger;
|
|
1100
|
+
private readonly hostInjector;
|
|
1101
|
+
readonly addon: i0.InputSignal<ActionAddonShape>;
|
|
1102
|
+
readonly fieldInputs: i0.InputSignal<WrapperFieldInputs | undefined>;
|
|
1103
|
+
/**
|
|
1104
|
+
* Per-value caches for `disabled` / `loading` signal resolution. Keyed by
|
|
1105
|
+
* the `DynamicValue` identity so a single `toSignal` subscription is
|
|
1106
|
+
* shared across addon-reference swaps that pass the same Observable.
|
|
1107
|
+
* Mirrors `NgForgeAddonsBase._hiddenByValue` — `resolveDynamicValue`
|
|
1108
|
+
* cannot run inside `computed`/`linkedSignal.computation` because
|
|
1109
|
+
* `toSignal` throws in reactive contexts (NG0602), and re-running it on
|
|
1110
|
+
* every recomputation would leak subscriptions on each cycle.
|
|
1111
|
+
*/
|
|
1112
|
+
private readonly _disabledByValue;
|
|
1113
|
+
private readonly _loadingByValue;
|
|
1114
|
+
private readonly _resolvedDisabled;
|
|
1115
|
+
private readonly _resolvedLoading;
|
|
1116
|
+
readonly disabled: Signal<boolean>;
|
|
1117
|
+
readonly loading: Signal<boolean>;
|
|
1118
|
+
constructor();
|
|
1119
|
+
private _resolveAxis;
|
|
1120
|
+
/**
|
|
1121
|
+
* Resolve the click handler from the addon's three-axis click variant and
|
|
1122
|
+
* invoke it. Precedence on multi-set: `preset > actionRef > action`. The
|
|
1123
|
+
* validator drops multi-set configs at config-init time; this is
|
|
1124
|
+
* defence-in-depth + a logged warning so the misconfiguration is loud.
|
|
1125
|
+
*/
|
|
1126
|
+
dispatch(): void;
|
|
1127
|
+
/**
|
|
1128
|
+
* Build an `AddonActionContext` for handlers from the wrapper-style
|
|
1129
|
+
* `fieldInputs` bag. Returns the field-bound variant when a host field
|
|
1130
|
+
* is reachable, or the orphan variant otherwise.
|
|
1131
|
+
*
|
|
1132
|
+
* Resolution order for `setValue`:
|
|
1133
|
+
* 1. `inputs.setValue` from the forwarded bag (preferred — populated by
|
|
1134
|
+
* `buildFieldInputs` in `DfFieldOutlet`).
|
|
1135
|
+
* 2. Fallback reconstructed from `inputs.field` itself: although
|
|
1136
|
+
* `ReadonlyFieldTree.value` is type-narrowed to `Signal<T>`, the
|
|
1137
|
+
* underlying runtime object is the same `WritableSignal<T>` created
|
|
1138
|
+
* by Signal Forms (the read-only wrapping is type-level only, see
|
|
1139
|
+
* `toReadonlyFieldTree`). Casting back at the writer boundary
|
|
1140
|
+
* produces a working setValue for ANY field depth — top-level OR
|
|
1141
|
+
* nested under groups. This avoids the previous FSC-key navigation
|
|
1142
|
+
* that broke for grouped fields, where `inputs.key` is DOM-mangled
|
|
1143
|
+
* (`'user_address_street'`) and `fsc.form[key]` returns undefined.
|
|
1144
|
+
*
|
|
1145
|
+
* The orphan variant fires only when the bag carries no field tree at
|
|
1146
|
+
* all — genuine "rendered outside a field" scenario.
|
|
1147
|
+
*/
|
|
1148
|
+
buildActionContext(): AddonActionContext;
|
|
1149
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgForgeAddonActionBase, never>;
|
|
1150
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgForgeAddonActionBase, never, never, { "addon": { "alias": "addon"; "required": true; "isSignal": true; }; "fieldInputs": { "alias": "fieldInputs"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1151
|
+
}
|
|
1152
|
+
/** Forwarded onto `NgForgeAddonActionBase` via the `NgForgeAddonAction` wrapper. */
|
|
1153
|
+
declare const NG_FORGE_ADDON_ACTION_INPUTS: readonly ["addon", "fieldInputs"];
|
|
1154
|
+
/**
|
|
1155
|
+
* Host wrapper for `NgForgeAddonActionBase`. Consumers compose this directly:
|
|
1156
|
+
*
|
|
1157
|
+
* ```ts
|
|
1158
|
+
* \@Component({
|
|
1159
|
+
* hostDirectives: [NgForgeAddonAction],
|
|
1160
|
+
* template: `
|
|
1161
|
+
* <p-button [loading]="action.loading()" [disabled]="action.disabled()"
|
|
1162
|
+
* (onClick)="action.dispatch()" />
|
|
1163
|
+
* `,
|
|
1164
|
+
* })
|
|
1165
|
+
* export class MyButtonAddon {
|
|
1166
|
+
* protected readonly action = injectNgForgeAddonAction<MyButtonAddon>();
|
|
1167
|
+
* }
|
|
1168
|
+
* ```
|
|
1169
|
+
*/
|
|
1170
|
+
declare class NgForgeAddonAction {
|
|
1171
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgForgeAddonAction, never>;
|
|
1172
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgForgeAddonAction, never, never, {}, {}, never, never, true, [{ directive: typeof NgForgeAddonActionBase; inputs: { "addon": "addon"; "fieldInputs": "fieldInputs"; }; outputs: {}; }]>;
|
|
1173
|
+
}
|
|
1174
|
+
/** Narrowed view of `NgForgeAddonActionBase` returned by `injectNgForgeAddonAction<T>()`. */
|
|
1175
|
+
type TypedNgForgeAddonAction<TAddon extends ActionAddonShape = ActionAddonShape> = Omit<NgForgeAddonActionBase, 'addon'> & {
|
|
1176
|
+
readonly addon: Signal<TAddon>;
|
|
1177
|
+
};
|
|
1178
|
+
declare function injectNgForgeAddonAction<TAddon extends ActionAddonShape = ActionAddonShape>(): TypedNgForgeAddonAction<TAddon>;
|
|
1179
|
+
|
|
1180
|
+
/**
|
|
1181
|
+
* Adapter-supplied resolver for `preset` addon actions (e.g., `'clear'`,
|
|
1182
|
+
* `'toggle-password-visibility'`). The universal click-dispatch directive
|
|
1183
|
+
* (`NgForgeAddonAction`) delegates to this when an addon configures a
|
|
1184
|
+
* `preset`; the adapter wires concrete preset semantics in its own
|
|
1185
|
+
* provider scope.
|
|
1186
|
+
*
|
|
1187
|
+
* `NgForgeAddonAction` injects this with `{ optional: true }`. Addons that
|
|
1188
|
+
* configure a preset on an adapter that hasn't registered a handler get a
|
|
1189
|
+
* lenient warning at click time.
|
|
1190
|
+
*/
|
|
1191
|
+
interface AddonPresetHandler {
|
|
1192
|
+
run(preset: string, ctx: AddonActionContext): void | Promise<void>;
|
|
1193
|
+
}
|
|
1194
|
+
declare const ADDON_PRESET_HANDLER: InjectionToken<AddonPresetHandler>;
|
|
1195
|
+
|
|
992
1196
|
/**
|
|
993
1197
|
* Marker directive applied to the canonical control element of an
|
|
994
1198
|
* `NgForgeField`-using component. Forwards the field's `meta` AND
|
|
@@ -1024,10 +1228,10 @@ declare function injectNgForgeAction<TEvent extends FormEvent = FormEvent>(): Ng
|
|
|
1024
1228
|
* structural lifecycle handles add/remove naturally.
|
|
1025
1229
|
*/
|
|
1026
1230
|
declare class NgForgeControl {
|
|
1027
|
-
readonly target:
|
|
1231
|
+
readonly target: i0.InputSignal<string | undefined>;
|
|
1028
1232
|
constructor();
|
|
1029
|
-
static ɵfac:
|
|
1030
|
-
static ɵdir:
|
|
1233
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgForgeControl, never>;
|
|
1234
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgForgeControl, "[ngForgeControl]", never, { "target": { "alias": "ngForgeControl"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1031
1235
|
}
|
|
1032
1236
|
/**
|
|
1033
1237
|
* Selectorless companion directive for shadow-DOM-encapsulated components
|
|
@@ -1055,8 +1259,8 @@ declare class NgForgeControl {
|
|
|
1055
1259
|
*/
|
|
1056
1260
|
declare class NgForgeHostControl {
|
|
1057
1261
|
constructor();
|
|
1058
|
-
static ɵfac:
|
|
1059
|
-
static ɵdir:
|
|
1262
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgForgeHostControl, never>;
|
|
1263
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgForgeHostControl, never, never, {}, {}, never, never, true, never>;
|
|
1060
1264
|
}
|
|
1061
1265
|
|
|
1062
1266
|
/**
|
|
@@ -1086,8 +1290,8 @@ declare class NgForgeHostControl {
|
|
|
1086
1290
|
* for the same reason. See https://www.angularspace.com/host-directives-decomposition-unleashed/
|
|
1087
1291
|
*/
|
|
1088
1292
|
declare class NgForgeFieldHost {
|
|
1089
|
-
static ɵfac:
|
|
1090
|
-
static ɵdir:
|
|
1293
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgForgeFieldHost, never>;
|
|
1294
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgForgeFieldHost, never, never, {}, {}, never, never, true, [{ directive: typeof NgForgeFieldShell; inputs: { "key": "key"; "className": "className"; }; outputs: {}; }, { directive: typeof NgForgeField; inputs: { "field": "field"; "label": "label"; "placeholder": "placeholder"; "tabIndex": "tabIndex"; "props": "props"; "meta": "meta"; "validationMessages": "validationMessages"; }; outputs: {}; }]>;
|
|
1091
1295
|
}
|
|
1092
1296
|
/**
|
|
1093
1297
|
* Action / button host wrapper. Composes `NgForgeFieldShell` with
|
|
@@ -1106,8 +1310,8 @@ declare class NgForgeFieldHost {
|
|
|
1106
1310
|
* ```
|
|
1107
1311
|
*/
|
|
1108
1312
|
declare class NgForgeActionHost {
|
|
1109
|
-
static ɵfac:
|
|
1110
|
-
static ɵdir:
|
|
1313
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgForgeActionHost, never>;
|
|
1314
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgForgeActionHost, never, never, {}, {}, never, never, true, [{ directive: typeof NgForgeFieldShell; inputs: { "key": "key"; "className": "className"; }; outputs: {}; }, { directive: typeof NgForgeAction; inputs: { "label": "label"; "disabled": "disabled"; "hidden": "hidden"; "tabIndex": "tabIndex"; "event": "event"; "eventArgs": "eventArgs"; "eventContext": "eventContext"; "props": "props"; }; outputs: {}; }]>;
|
|
1111
1315
|
}
|
|
1112
1316
|
|
|
1113
1317
|
interface CreateNgForgeFieldFixtureOptions<TValue = unknown> {
|
|
@@ -1161,5 +1365,5 @@ declare function createNgForgeActionFixture<C, TEvent extends FormEvent = FormEv
|
|
|
1161
1365
|
/** Provider for `DEFAULT_VALIDATION_MESSAGES` in field tests — supply the default-messages map and the directive resolves it from DI. */
|
|
1162
1366
|
declare function provideTestValidationMessages(messages: ValidationMessages): Provider;
|
|
1163
1367
|
|
|
1164
|
-
export { NG_FORGE_ACTION_INPUTS, NG_FORGE_FIELD_SHELL_INPUTS, NG_FORGE_VALUE_FIELD_INPUTS, NgForgeAction, NgForgeActionHost, NgForgeControl, NgForgeField, NgForgeFieldHost, NgForgeFieldShell, NgForgeHostControl, addArrayItemButtonMapper, buildArrayButtonEventContext, buildValueFieldInputs, buttonFieldMapper, checkboxFieldMapper, createAriaDescribedBySignal, createNgForgeActionFixture, createNgForgeFieldFixture, createResolvedErrorsSignal, datepickerFieldMapper, injectNgForgeAction, injectNgForgeField, insertArrayItemButtonMapper, nextButtonFieldMapper, optionsFieldMapper, popArrayItemButtonMapper, prependArrayItemButtonMapper, previousButtonFieldMapper, provideTestValidationMessages, removeArrayItemButtonMapper, resolveArrayButtonContext, resolveArrayButtonEventArgs, resolveValueFieldContext, setupMetaTracking, shiftArrayItemButtonMapper, shouldShowErrors, submitButtonFieldMapper, valueFieldMapper };
|
|
1165
|
-
export type { ArrayButtonContext, ArrayButtonEventContext, Autocapitalize, AutocompleteValue, BaseArrayAddButtonField, BaseArrayRemoveButtonField, BaseInsertArrayItemButtonField, BaseNavigationButtonField, ButtonField, CheckboxField, CreateNgForgeActionFixtureOptions, CreateNgForgeFieldFixtureOptions, DatepickerField, DatepickerProps, EnterKeyHint, EventArg, EventArgs, FieldWithOptions, HtmlInputType, InferInputValue, InputField, InputMeta, InputMode, InputProps, InputType, InputTypeToValueType, MetaTrackingOptions, MultiCheckboxField, NgForgeActionFixture, NgForgeFieldFixture, NumericInputType, RadioField, ResolvedError, SelectField, SelectProps, SliderField, StringInputType, TextareaField, TextareaMeta, TextareaProps, TextareaWrap, ToggleField, TypedNgForgeField, ValueFieldContext };
|
|
1368
|
+
export { ADDON_PRESET_HANDLER, NG_FORGE_ACTION_INPUTS, NG_FORGE_ADDONS_INPUTS, NG_FORGE_ADDON_ACTION_INPUTS, NG_FORGE_FIELD_SHELL_INPUTS, NG_FORGE_VALUE_FIELD_INPUTS, NgForgeAction, NgForgeActionHost, NgForgeAddonAction, NgForgeAddonActionBase, NgForgeAddons, NgForgeAddonsBase, NgForgeControl, NgForgeField, NgForgeFieldHost, NgForgeFieldShell, NgForgeHostControl, addArrayItemButtonMapper, buildArrayButtonEventContext, buildValueFieldInputs, buttonFieldMapper, checkboxFieldMapper, createAriaDescribedBySignal, createNgForgeActionFixture, createNgForgeFieldFixture, createResolvedErrorsSignal, datepickerFieldMapper, injectNgForgeAction, injectNgForgeAddonAction, injectNgForgeAddons, injectNgForgeField, insertArrayItemButtonMapper, nextButtonFieldMapper, optionsFieldMapper, popArrayItemButtonMapper, prependArrayItemButtonMapper, previousButtonFieldMapper, provideTestValidationMessages, removeArrayItemButtonMapper, resolveArrayButtonContext, resolveArrayButtonEventArgs, resolveValueFieldContext, setupMetaTracking, shiftArrayItemButtonMapper, shouldShowErrors, submitButtonFieldMapper, valueFieldMapper };
|
|
1369
|
+
export type { AddonPresetHandler, ArrayButtonContext, ArrayButtonEventContext, Autocapitalize, AutocompleteValue, BaseArrayAddButtonField, BaseArrayRemoveButtonField, BaseInsertArrayItemButtonField, BaseNavigationButtonField, ButtonField, CheckboxField, CreateNgForgeActionFixtureOptions, CreateNgForgeFieldFixtureOptions, DatepickerField, DatepickerProps, EnterKeyHint, EventArg, EventArgs, FieldWithOptions, HtmlInputType, InferInputValue, InputField, InputMeta, InputMode, InputProps, InputType, InputTypeToValueType, MetaTrackingOptions, MultiCheckboxField, NgForgeActionFixture, NgForgeFieldFixture, NumericInputType, RadioField, ResolvedError, SelectField, SelectProps, SliderField, StringInputType, TextareaField, TextareaMeta, TextareaProps, TextareaWrap, ToggleField, TypedNgForgeAddonAction, TypedNgForgeAddons, TypedNgForgeField, ValueFieldContext };
|