@ngx-smz/core 21.8.1 → 21.8.2
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/ngx-smz-core.mjs +1749 -1659
- package/fesm2022/ngx-smz-core.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ngx-smz-core.d.ts +34 -0
package/package.json
CHANGED
package/types/ngx-smz-core.d.ts
CHANGED
|
@@ -486,10 +486,35 @@ declare class SmzFormsVisibilityService {
|
|
|
486
486
|
[key: string]: {
|
|
487
487
|
input: SmzControlTypes;
|
|
488
488
|
options: BehaviorSubject<any>;
|
|
489
|
+
formId?: string;
|
|
490
|
+
sourceKey?: string;
|
|
489
491
|
};
|
|
490
492
|
};
|
|
493
|
+
/** Inputs that can be observed (registered by the form setup, even while hidden). */
|
|
494
|
+
private sources;
|
|
495
|
+
/** Current value readers (usually backed by the FormControl). */
|
|
496
|
+
private valueResolvers;
|
|
497
|
+
/** Last value emitted by setValue, used when there is no resolver. */
|
|
498
|
+
private lastValues;
|
|
491
499
|
constructor();
|
|
492
500
|
registryObserver(input: SmzControlTypes, formId: string): void;
|
|
501
|
+
/** Registers an input as a possible visibility source, even if it is never rendered. */
|
|
502
|
+
registrySource(input: SmzControlTypes, formId: string): void;
|
|
503
|
+
/** Registers a function that returns the current raw value of an input (e.g. its FormControl value). */
|
|
504
|
+
registryValueResolver(input: SmzControlTypes, formId: string, resolver: () => any): void;
|
|
505
|
+
/** Normalizes a raw value into the representation compared against the visibility conditions. */
|
|
506
|
+
normalizeValue(type: SmzControlType, value: any): any;
|
|
507
|
+
/** Evaluates the visibility of an observer for a given (normalized) source value. */
|
|
508
|
+
evaluateVisibility(sourceType: SmzControlType, value: any, dependsOn: SmzControlTypes['visibilityDependsOn']): boolean;
|
|
509
|
+
private getCurrentValue;
|
|
510
|
+
/**
|
|
511
|
+
* Re-evaluates the observers of `sourceKey` from the current state of the source
|
|
512
|
+
* (hidden source => hidden observers; visible source => computed from its current value)
|
|
513
|
+
* and cascades through every observer whose visibility changed.
|
|
514
|
+
*/
|
|
515
|
+
private refreshObservers;
|
|
516
|
+
/** Must be called whenever the visibility of an input changes outside of the dependency flow. */
|
|
517
|
+
notifyVisibilityChanged(input: SmzControlTypes, formId: string): void;
|
|
493
518
|
private getDependsOnKey;
|
|
494
519
|
registryDependsOnData(input: SmzCheckBoxControl, formId: string): void;
|
|
495
520
|
setValue(input: SmzCheckBoxControl, formId: string, onChangeDropdownEvent: any): void;
|
|
@@ -511,6 +536,15 @@ declare class SmzFormsManagerService {
|
|
|
511
536
|
setupDropdownServices(input: SmzDropDownControl<any>, form: SmzForm<any>): void;
|
|
512
537
|
setupLinkedDropdownServices(input: SmzLinkedDropDownControl<any>, form: SmzForm<any>): void;
|
|
513
538
|
setupVisibilityServices(inputData: SmzControlTypes, form: SmzForm<any>): void;
|
|
539
|
+
/** Registers how to read the current raw value of an input (used when visibility is re-evaluated). */
|
|
540
|
+
setupVisibilityValueResolver(inputData: SmzControlTypes, form: SmzForm<any>, resolver: () => unknown): void;
|
|
541
|
+
/** Re-evaluates (and cascades) the observers of an input whose visibility changed. */
|
|
542
|
+
notifyVisibilityChanged(inputData: SmzControlTypes, form: SmzForm<any>): void;
|
|
543
|
+
/**
|
|
544
|
+
* Initial visibility from the dependency's default value. A hidden dependency hides its observers;
|
|
545
|
+
* the chain is resolved recursively (guarded against circular dependencies).
|
|
546
|
+
*/
|
|
547
|
+
private resolveInitialVisibility;
|
|
514
548
|
static ɵfac: i0.ɵɵFactoryDeclaration<SmzFormsManagerService, never>;
|
|
515
549
|
static ɵprov: i0.ɵɵInjectableDeclaration<SmzFormsManagerService>;
|
|
516
550
|
}
|