@ng-forge/dynamic-forms 0.9.0-next.1 → 0.9.0-next.10
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-CWxCWVdz.mjs → ng-forge-dynamic-forms-array-field.component-DbWes42V.mjs} +3 -3
- package/fesm2022/{ng-forge-dynamic-forms-array-field.component-CWxCWVdz.mjs.map → ng-forge-dynamic-forms-array-field.component-DbWes42V.mjs.map} +1 -1
- package/fesm2022/{ng-forge-dynamic-forms-container-field.component-PozYj2JC.mjs → ng-forge-dynamic-forms-container-field.component-CMhqFGJZ.mjs} +3 -3
- package/fesm2022/{ng-forge-dynamic-forms-container-field.component-PozYj2JC.mjs.map → ng-forge-dynamic-forms-container-field.component-CMhqFGJZ.mjs.map} +1 -1
- package/fesm2022/{ng-forge-dynamic-forms-container-utils-DW_P7w-b.mjs → ng-forge-dynamic-forms-container-utils-D_nNzKo1.mjs} +2 -2
- package/fesm2022/{ng-forge-dynamic-forms-container-utils-DW_P7w-b.mjs.map → ng-forge-dynamic-forms-container-utils-D_nNzKo1.mjs.map} +1 -1
- package/fesm2022/{ng-forge-dynamic-forms-css-wrapper.component-DrtHSaVV.mjs → ng-forge-dynamic-forms-css-wrapper.component-htvP_o95.mjs} +2 -2
- package/fesm2022/ng-forge-dynamic-forms-css-wrapper.component-htvP_o95.mjs.map +1 -0
- package/fesm2022/{ng-forge-dynamic-forms-emit-initialization-CSx0gwFc.mjs → ng-forge-dynamic-forms-emit-initialization-DtkxP7pE.mjs} +2 -2
- package/fesm2022/{ng-forge-dynamic-forms-emit-initialization-CSx0gwFc.mjs.map → ng-forge-dynamic-forms-emit-initialization-DtkxP7pE.mjs.map} +1 -1
- package/fesm2022/{ng-forge-dynamic-forms-group-field.component-2yRmHAUp.mjs → ng-forge-dynamic-forms-group-field.component-BhYFIDA1.mjs} +3 -3
- package/fesm2022/{ng-forge-dynamic-forms-group-field.component-2yRmHAUp.mjs.map → ng-forge-dynamic-forms-group-field.component-BhYFIDA1.mjs.map} +1 -1
- package/fesm2022/ng-forge-dynamic-forms-integration.mjs +629 -54
- package/fesm2022/ng-forge-dynamic-forms-integration.mjs.map +1 -1
- package/fesm2022/{ng-forge-dynamic-forms-ng-forge-dynamic-forms-Ll4W2Z_n.mjs → ng-forge-dynamic-forms-ng-forge-dynamic-forms-DWPPLOrV.mjs} +662 -110
- package/fesm2022/ng-forge-dynamic-forms-ng-forge-dynamic-forms-DWPPLOrV.mjs.map +1 -0
- package/fesm2022/{ng-forge-dynamic-forms-page-field.component-B_CxX0T-.mjs → ng-forge-dynamic-forms-page-field.component-B9v_1shD.mjs} +3 -3
- package/fesm2022/{ng-forge-dynamic-forms-page-field.component-B_CxX0T-.mjs.map → ng-forge-dynamic-forms-page-field.component-B9v_1shD.mjs.map} +1 -1
- package/fesm2022/ng-forge-dynamic-forms-row-wrapper.component-BIvEUoia.mjs.map +1 -1
- package/fesm2022/{ng-forge-dynamic-forms-text-field.component-rJMtKX2X.mjs → ng-forge-dynamic-forms-text-field.component-B4LnTnIA.mjs} +2 -2
- package/fesm2022/{ng-forge-dynamic-forms-text-field.component-rJMtKX2X.mjs.map → ng-forge-dynamic-forms-text-field.component-B4LnTnIA.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 +380 -8
- package/types/ng-forge-dynamic-forms.d.ts +106 -8
- package/fesm2022/ng-forge-dynamic-forms-css-wrapper.component-DrtHSaVV.mjs.map +0 -1
- package/fesm2022/ng-forge-dynamic-forms-ng-forge-dynamic-forms-Ll4W2Z_n.mjs.map +0 -1
|
@@ -2973,6 +2973,19 @@ interface FormOptions {
|
|
|
2973
2973
|
* @default undefined (uses global setting)
|
|
2974
2974
|
*/
|
|
2975
2975
|
excludeValueIfReadonly?: boolean;
|
|
2976
|
+
/**
|
|
2977
|
+
* Whether to run validation when a field is hidden.
|
|
2978
|
+
*
|
|
2979
|
+
* Acts as the root inherited value for the entire form — per-field
|
|
2980
|
+
* `FieldDef.validateWhenHidden` overrides it for a subtree, and once
|
|
2981
|
+
* overridden the new value is itself inherited by descendants unless
|
|
2982
|
+
* they override in turn.
|
|
2983
|
+
*
|
|
2984
|
+
* Overrides the global `withValidationExecutionDefaults()` setting for this form.
|
|
2985
|
+
*
|
|
2986
|
+
* @default undefined (uses global setting, which defaults to `false`)
|
|
2987
|
+
*/
|
|
2988
|
+
validateWhenHidden?: boolean;
|
|
2976
2989
|
/**
|
|
2977
2990
|
* Whether to attach the current form value to all events dispatched through the EventBus.
|
|
2978
2991
|
*
|
|
@@ -3666,14 +3679,14 @@ declare function isWrapperTypeDefinition(value: unknown): value is WrapperTypeDe
|
|
|
3666
3679
|
* </dbx-section>
|
|
3667
3680
|
* `,
|
|
3668
3681
|
* })
|
|
3669
|
-
* export class SectionWrapperComponent implements
|
|
3682
|
+
* export class SectionWrapperComponent implements FieldWrapper {
|
|
3670
3683
|
* readonly fieldComponent = viewChild.required('fieldComponent', { read: ViewContainerRef });
|
|
3671
3684
|
* readonly header = input<string>();
|
|
3672
3685
|
* readonly fieldInputs = input<WrapperFieldInputs>();
|
|
3673
3686
|
* }
|
|
3674
3687
|
* ```
|
|
3675
3688
|
*/
|
|
3676
|
-
interface
|
|
3689
|
+
interface FieldWrapper {
|
|
3677
3690
|
/** ViewContainerRef slot where inner content is rendered */
|
|
3678
3691
|
readonly fieldComponent: Signal<ViewContainerRef>;
|
|
3679
3692
|
}
|
|
@@ -3899,8 +3912,10 @@ interface FieldDef<TProps, TMeta extends FieldMeta = FieldMeta> {
|
|
|
3899
3912
|
/**
|
|
3900
3913
|
* Whether the field is hidden from view.
|
|
3901
3914
|
*
|
|
3902
|
-
* When true, the field is not rendered in the UI
|
|
3903
|
-
*
|
|
3915
|
+
* When true, the field is not rendered in the UI. By default, validators on
|
|
3916
|
+
* a hidden field are skipped — set {@link validateWhenHidden} to `true` (on
|
|
3917
|
+
* the field, an ancestor, the form, or globally) to keep validation running
|
|
3918
|
+
* while hidden. State logic and value derivations continue to apply.
|
|
3904
3919
|
*
|
|
3905
3920
|
* @value false
|
|
3906
3921
|
*/
|
|
@@ -3943,6 +3958,23 @@ interface FieldDef<TProps, TMeta extends FieldMeta = FieldMeta> {
|
|
|
3943
3958
|
* @default undefined (uses form-level or global setting)
|
|
3944
3959
|
*/
|
|
3945
3960
|
excludeValueIfReadonly?: boolean;
|
|
3961
|
+
/**
|
|
3962
|
+
* Whether to run validation when this field is hidden — statically (`hidden: true`),
|
|
3963
|
+
* via a `hidden` logic rule, or via any hidden ancestor.
|
|
3964
|
+
*
|
|
3965
|
+
* When `false`, all validators on this field (built-in like `required`/`email`/`min`,
|
|
3966
|
+
* custom `validate()`/expression validators, and `required` state logic) are skipped
|
|
3967
|
+
* while the field is hidden. The hidden state, disabled state, readonly state, and
|
|
3968
|
+
* value derivations continue to apply.
|
|
3969
|
+
*
|
|
3970
|
+
* Inherited from the parent field — once a field overrides this value, all of its
|
|
3971
|
+
* descendants inherit the new value unless they override in turn. Form-level
|
|
3972
|
+
* `FormOptions.validateWhenHidden` is the root inherited value, falling back to the
|
|
3973
|
+
* global default.
|
|
3974
|
+
*
|
|
3975
|
+
* @default undefined — inherits from parent / form / global default (which is `false`)
|
|
3976
|
+
*/
|
|
3977
|
+
validateWhenHidden?: boolean;
|
|
3946
3978
|
/**
|
|
3947
3979
|
* Column sizing configuration for responsive grid layout.
|
|
3948
3980
|
*
|
|
@@ -4414,6 +4446,7 @@ declare class DynamicForm<TFields extends RegisteredFieldTypes[] = RegisteredFie
|
|
|
4414
4446
|
excludeValueIfHidden?: boolean;
|
|
4415
4447
|
excludeValueIfDisabled?: boolean;
|
|
4416
4448
|
excludeValueIfReadonly?: boolean;
|
|
4449
|
+
validateWhenHidden?: boolean;
|
|
4417
4450
|
emitFormValueOnEvents?: boolean;
|
|
4418
4451
|
}>;
|
|
4419
4452
|
/** Field signal context for injection into child components */
|
|
@@ -5288,6 +5321,71 @@ type ResolvedValueExclusionConfig = Required<ValueExclusionConfig>;
|
|
|
5288
5321
|
*/
|
|
5289
5322
|
declare function withValueExclusionDefaults(config?: Partial<ValueExclusionConfig>): DynamicFormFeature<'value-exclusion'>;
|
|
5290
5323
|
|
|
5324
|
+
/**
|
|
5325
|
+
* Configuration for when validation runs based on a field's reactive state.
|
|
5326
|
+
*
|
|
5327
|
+
* Currently controls whether hidden fields are validated. Resolved through a
|
|
5328
|
+
* tree-aware hierarchy: per-field overrides inherit down to descendants, with
|
|
5329
|
+
* per-form `FormOptions` and global `withValidationExecutionDefaults()` providing
|
|
5330
|
+
* the root inherited value.
|
|
5331
|
+
*
|
|
5332
|
+
* @public
|
|
5333
|
+
*/
|
|
5334
|
+
interface ValidationExecutionConfig {
|
|
5335
|
+
/**
|
|
5336
|
+
* Whether validators run while a field is hidden (statically, via `hidden`
|
|
5337
|
+
* logic, or because any ancestor is hidden).
|
|
5338
|
+
*
|
|
5339
|
+
* When `false`, all validators on a hidden field are skipped — the field is
|
|
5340
|
+
* effectively inert until shown. State logic (hidden/disabled/readonly) and
|
|
5341
|
+
* value derivations continue to apply.
|
|
5342
|
+
*/
|
|
5343
|
+
readonly validateWhenHidden?: boolean;
|
|
5344
|
+
}
|
|
5345
|
+
/**
|
|
5346
|
+
* Fully resolved validation execution config — every property defined.
|
|
5347
|
+
*
|
|
5348
|
+
* @public
|
|
5349
|
+
*/
|
|
5350
|
+
type ResolvedValidationExecutionConfig = Required<ValidationExecutionConfig>;
|
|
5351
|
+
|
|
5352
|
+
/**
|
|
5353
|
+
* Configures global validation execution defaults — when validators should run
|
|
5354
|
+
* relative to a field's reactive state.
|
|
5355
|
+
*
|
|
5356
|
+
* By default, validators are **skipped** for hidden fields (`validateWhenHidden: false`),
|
|
5357
|
+
* matching what most users expect: a hidden field is inert. Use this feature to
|
|
5358
|
+
* restore the legacy behavior where hidden fields still validate.
|
|
5359
|
+
*
|
|
5360
|
+
* @example Default behavior — no feature needed
|
|
5361
|
+
* ```typescript
|
|
5362
|
+
* provideDynamicForm(...withMaterialFields())
|
|
5363
|
+
* // hidden fields skip validation
|
|
5364
|
+
* ```
|
|
5365
|
+
*
|
|
5366
|
+
* @example Restore legacy validation-on-hidden behavior
|
|
5367
|
+
* ```typescript
|
|
5368
|
+
* provideDynamicForm(
|
|
5369
|
+
* ...withMaterialFields(),
|
|
5370
|
+
* withValidationExecutionDefaults({ validateWhenHidden: true })
|
|
5371
|
+
* )
|
|
5372
|
+
* ```
|
|
5373
|
+
*
|
|
5374
|
+
* @remarks
|
|
5375
|
+
* **Precedence rules:**
|
|
5376
|
+
* 1. Per-field `FieldDef.validateWhenHidden` — wins for that field; inherits down to descendants
|
|
5377
|
+
* that don't override.
|
|
5378
|
+
* 2. Per-form `FormOptions.validateWhenHidden` — root inherited value for the form.
|
|
5379
|
+
* 3. Global `withValidationExecutionDefaults()` — fallback when no form/field setting.
|
|
5380
|
+
* 4. No feature configured — uses token default (`validateWhenHidden: false`).
|
|
5381
|
+
*
|
|
5382
|
+
* @param config - Partial override. Unspecified properties keep their defaults.
|
|
5383
|
+
* @returns A `DynamicFormFeature` that configures validation execution defaults.
|
|
5384
|
+
*
|
|
5385
|
+
* @public
|
|
5386
|
+
*/
|
|
5387
|
+
declare function withValidationExecutionDefaults(config?: Partial<ValidationExecutionConfig>): DynamicFormFeature<'validation-execution'>;
|
|
5388
|
+
|
|
5291
5389
|
/**
|
|
5292
5390
|
* Zero-cost type carrier used in wrapper registrations.
|
|
5293
5391
|
*
|
|
@@ -5397,7 +5495,7 @@ interface BaseValueField<TProps, TValue, TMeta extends FieldMeta = FieldMeta, TN
|
|
|
5397
5495
|
nullable?: TNullable;
|
|
5398
5496
|
}
|
|
5399
5497
|
declare function isValueField<TProps, TMeta extends FieldMeta = FieldMeta>(field: FieldDef<TProps, TMeta>): field is BaseValueField<TProps, ValueType, TMeta, boolean>;
|
|
5400
|
-
type ExcludedKeys$1 = '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' | 'wrappers' | 'skipAutoWrappers' | 'skipDefaultWrappers';
|
|
5498
|
+
type ExcludedKeys$1 = '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';
|
|
5401
5499
|
type ValueFieldComponent<T extends BaseValueField<Record<string, unknown> | unknown, unknown, FieldMeta, boolean>> = Prettify<WithInputSignals<Omit<T, ExcludedKeys$1>>>;
|
|
5402
5500
|
|
|
5403
5501
|
interface BaseCheckedField<TProps, TMeta extends FieldMeta = FieldMeta> extends FieldDef<TProps, TMeta>, FieldWithValidation {
|
|
@@ -5410,7 +5508,7 @@ interface BaseCheckedField<TProps, TMeta extends FieldMeta = FieldMeta> extends
|
|
|
5410
5508
|
required?: boolean;
|
|
5411
5509
|
}
|
|
5412
5510
|
declare function isCheckedField<TProps, TMeta extends FieldMeta = FieldMeta>(field: FieldDef<TProps, TMeta>): field is BaseCheckedField<TProps, TMeta>;
|
|
5413
|
-
type ExcludedKeys = 'type' | 'conditionals' | 'value' | 'disabled' | 'readonly' | 'hidden' | 'col' | keyof FieldWithValidation | 'excludeValueIfHidden' | 'excludeValueIfDisabled' | 'excludeValueIfReadonly' | 'wrappers' | 'skipAutoWrappers' | 'skipDefaultWrappers';
|
|
5511
|
+
type ExcludedKeys = 'type' | 'conditionals' | 'value' | 'disabled' | 'readonly' | 'hidden' | 'col' | keyof FieldWithValidation | 'excludeValueIfHidden' | 'excludeValueIfDisabled' | 'excludeValueIfReadonly' | 'validateWhenHidden' | 'wrappers' | 'skipAutoWrappers' | 'skipDefaultWrappers';
|
|
5414
5512
|
type CheckedFieldComponent<T extends BaseCheckedField<Record<string, unknown> | unknown>> = Prettify<WithInputSignals<Omit<T, ExcludedKeys>>>;
|
|
5415
5513
|
|
|
5416
5514
|
declare function applyValidator(config: ValidatorConfig, fieldPath: SchemaPath<any> | SchemaPathTree<any>): void;
|
|
@@ -6658,5 +6756,5 @@ declare class RootFormRegistryService {
|
|
|
6658
6756
|
*/
|
|
6659
6757
|
declare const INITIALIZATION_TIMEOUT_MS: InjectionToken<number>;
|
|
6660
6758
|
|
|
6661
|
-
export { ARRAY_CONTEXT, AppendArrayItemEvent, ArrayFieldComponent, BUILT_IN_FIELDS, ConsoleLogger, ContainerFieldComponent, DEFAULT_PROPS, DEFAULT_VALIDATION_MESSAGES, DEFAULT_WRAPPERS, DynamicForm, DynamicFormError, DynamicFormLogger, DynamicTextPipe, EventBus, EventDispatcher, FIELD_REGISTRY, FIELD_SIGNAL_CONTEXT, FORM_OPTIONS, FormClearEvent, FormResetEvent, GroupFieldComponent, INITIALIZATION_TIMEOUT_MS, InsertArrayItemEvent, MoveArrayItemEvent, NextPageEvent, NoopLogger, PageChangeEvent, PopArrayItemEvent, PrependArrayItemEvent, PreviousPageEvent, RemoveAtIndexEvent, RootFormRegistryService, ShiftArrayItemEvent, SubmitEvent, WRAPPER_REGISTRY, applyMetaToElement, applyValidator, applyValidators, arrayEvent, arrayFieldMapper, baseFieldMapper, buildBaseInputs, containerFieldMapper, createField, createWrappers, dynamicTextToObservable, evaluateNonFieldDisabled, evaluateNonFieldHidden, field, formConfig, getArrayLength, groupFieldMapper, hasFormValue, interpolateParams, isArrayField, isCheckedField, isContainerField, isContainerTypedField, isDisplayOnlyField, isEqual, isFormStateCondition, isGroupField, isLeafField, isPageField, isRowField, isSimplifiedArrayField, isValueBearingField, isValueField, isWrapperTypeDefinition, isWrappersBundle, omit, pageFieldMapper, provideDynamicForm, resolveNextButtonDisabled, resolveNonFieldDisabled, resolveNonFieldHidden, resolveSubmitButtonDisabled, resolveTokens, rowFieldMapper, textFieldMapper, toReadonlyFieldTree, withEventFormValue, withLoggerConfig, withPreviousValue, withValueExclusionDefaults, wrapperProps };
|
|
6662
|
-
export type { ArrayAllowedChildren, ArrayButtonConfig, ArrayContext, ArrayField, ArrayFieldTree, ArrayItemContext, ArrayItemDefinitionTemplate, ArrayItemTemplate, AsyncCondition, AsyncConditionFunction, AsyncCustomValidator, AsyncDerivationFunction, AsyncValidatorConfig, AvailableFieldTypes, BaseCheckedField, BaseValidatorConfig, BaseValueField, BuiltInValidatorConfig, ButtonLogicContext, CheckedFieldComponent, ConditionalExpression, ContainerAllowedChildren, ContainerField, ContainerFieldTypes, CssWrapper, CustomFnConfig, CustomValidator, CustomValidatorConfig, DeclarativeHttpValidatorConfig, DynamicFormFieldRegistry, DynamicText, EvaluationContext, ExtractField, ExtractFieldDefs, ExtractFormValue, FieldComponent, FieldDef, FieldMeta, FieldOption, FieldPathAccess, FieldRegistryContainers, FieldRegistryLeaves, FieldRegistryWrappers, FieldScope, FieldSignalContext, FieldStateContext, FieldStateInfo, FieldTypeDefinition, FieldWithValidation,
|
|
6759
|
+
export { ARRAY_CONTEXT, AppendArrayItemEvent, ArrayFieldComponent, BUILT_IN_FIELDS, ConsoleLogger, ContainerFieldComponent, DEFAULT_PROPS, DEFAULT_VALIDATION_MESSAGES, DEFAULT_WRAPPERS, DynamicForm, DynamicFormError, DynamicFormLogger, DynamicTextPipe, EventBus, EventDispatcher, FIELD_REGISTRY, FIELD_SIGNAL_CONTEXT, FORM_OPTIONS, FormClearEvent, FormResetEvent, GroupFieldComponent, INITIALIZATION_TIMEOUT_MS, InsertArrayItemEvent, MoveArrayItemEvent, NextPageEvent, NoopLogger, PageChangeEvent, PopArrayItemEvent, PrependArrayItemEvent, PreviousPageEvent, RemoveAtIndexEvent, RootFormRegistryService, ShiftArrayItemEvent, SubmitEvent, WRAPPER_REGISTRY, applyMetaToElement, applyValidator, applyValidators, arrayEvent, arrayFieldMapper, baseFieldMapper, buildBaseInputs, containerFieldMapper, createField, createWrappers, dynamicTextToObservable, evaluateNonFieldDisabled, evaluateNonFieldHidden, field, formConfig, getArrayLength, groupFieldMapper, hasFormValue, interpolateParams, isArrayField, isCheckedField, isContainerField, isContainerTypedField, isDisplayOnlyField, isEqual, isFormStateCondition, isGroupField, isLeafField, isPageField, isRowField, isSimplifiedArrayField, isValueBearingField, isValueField, isWrapperTypeDefinition, isWrappersBundle, omit, pageFieldMapper, provideDynamicForm, resolveNextButtonDisabled, resolveNonFieldDisabled, resolveNonFieldHidden, resolveSubmitButtonDisabled, resolveTokens, rowFieldMapper, textFieldMapper, toReadonlyFieldTree, withEventFormValue, withLoggerConfig, withPreviousValue, withValidationExecutionDefaults, withValueExclusionDefaults, wrapperProps };
|
|
6760
|
+
export type { ArrayAllowedChildren, ArrayButtonConfig, ArrayContext, ArrayField, ArrayFieldTree, ArrayItemContext, ArrayItemDefinitionTemplate, ArrayItemTemplate, AsyncCondition, AsyncConditionFunction, AsyncCustomValidator, AsyncDerivationFunction, AsyncValidatorConfig, AvailableFieldTypes, BaseCheckedField, BaseValidatorConfig, BaseValueField, BuiltInValidatorConfig, ButtonLogicContext, CheckedFieldComponent, ConditionalExpression, ContainerAllowedChildren, ContainerField, ContainerFieldTypes, CssWrapper, CustomFnConfig, CustomValidator, CustomValidatorConfig, DeclarativeHttpValidatorConfig, DynamicFormFieldRegistry, DynamicText, EvaluationContext, ExtractField, ExtractFieldDefs, ExtractFormValue, FieldComponent, FieldDef, FieldMeta, FieldOption, FieldPathAccess, FieldRegistryContainers, FieldRegistryLeaves, FieldRegistryWrappers, FieldScope, FieldSignalContext, FieldStateContext, FieldStateInfo, FieldTypeDefinition, FieldWithValidation, FieldWrapper, FormConfig, FormEvent, FormEventConstructor, FormFieldStateMap, FormMode, FormModeDetectionResult, FormOptions, FormStateCondition, GroupAllowedChildren, GroupField, HttpCondition, HttpCustomValidator, HttpRequestConfig, HttpResourceRequest, HttpValidationResponseMapping, InferFormValue$1 as InferFormValue, InferWrapperRegistry, LeafFieldTypes, Logger, LogicConfig, MapperFn, NarrowField, NarrowFields, NextButtonOptions, NonFieldLogicConfig, NonFieldLogicContext, NonFieldLogicType, PageAllowedChildren, PageField, Prettify, ReadonlyFieldTree, RegisteredFieldTypes, ResolvedValidationExecutionConfig, ResolvedValueExclusionConfig, RowAllowedChildren, RowField, SchemaApplicationConfig, SchemaDefinition, SimplifiedArrayField, StateLogicConfig, SubmissionActionResult, SubmissionConfig, SubmitButtonOptions, TextElementType, TextField, TextProps, TokenContext, ValidationError, ValidationExecutionConfig, ValidationMessages, ValidatorConfig, ValueExclusionConfig, ValueFieldComponent, ValueHandlingMode, ValueType, WithInputSignals, WrapperConfig, WrapperFieldInputs, WrapperRegistration, WrapperTypeDefinition, WrappersBundle };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ng-forge-dynamic-forms-css-wrapper.component-DrtHSaVV.mjs","sources":["../../../../packages/dynamic-forms/src/lib/wrappers/css/css-wrapper.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, Signal, ViewContainerRef, viewChild } from '@angular/core';\nimport { pipe, switchMap } from 'rxjs';\nimport { derivedFrom } from 'ngxtension/derived-from';\nimport { FieldWrapperContract } from '../../models/wrapper-type';\nimport { DynamicText } from '../../models/types/dynamic-text';\nimport { dynamicTextToObservable } from '../../utils/dynamic-text-to-observable';\nimport { WrapperFieldInputs } from '../wrapper-field-inputs';\n\n/**\n * Built-in CSS wrapper component.\n *\n * Applies CSS classes from the `cssClasses` config property to the host element,\n * wrapping the inner content (next wrapper or children) in its ViewContainerRef slot.\n *\n * Receives `cssClasses` as an individual Angular input (set by the outlet via\n * `setInput()`). `fieldInputs` carries the wrapped field's mapper outputs +\n * a read-only view of its form state (via `ReadonlyFieldTree`).\n *\n * @example\n * ```typescript\n * {\n * type: 'container',\n * key: 'styled',\n * wrappers: [{ type: 'css', cssClasses: 'card p-4' }],\n * fields: [...]\n * }\n * ```\n */\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 FieldWrapperContract {\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([this.cssClasses], pipe(switchMap(([value]) => dynamicTextToObservable(value))), {\n initialValue: '',\n });\n}\n\nexport { CssWrapperComponent };\n"],"names":[],"mappings":";;;;;;AAQA;;;;;;;;;;;;;;;;;;;AAmBG;AASW,MAAO,mBAAmB,CAAA;AAC7B,IAAA,cAAc,GAAG,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;IAEjF,UAAU,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAe;IACjC,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAsB;IAEzC,eAAe,GAAmB,WAAW,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,uBAAuB,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;AACtI,QAAA,YAAY,EAAE,EAAE;AACjB,KAAA,CAAC;uGARiB,mBAAmB,EAAA,IAAA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