@smartbit4all/ng-client 7.3.16 → 7.3.17
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.
|
@@ -7632,12 +7632,11 @@ class SmartFormService {
|
|
|
7632
7632
|
}
|
|
7633
7633
|
applyComponentConstraints(widgets, constraints) {
|
|
7634
7634
|
widgets.forEach((widget) => {
|
|
7635
|
-
let widgetConstraints = constraints?.filter(
|
|
7636
|
-
//(constraint: SmartFormComponentConstraint) => constraint.dataName === widget.key
|
|
7637
|
-
(constraint) => this.antPathMatcher(constraint.dataName, widget.key));
|
|
7635
|
+
let widgetConstraints = constraints?.filter((constraint) => this.antPathMatcher(constraint.dataName, widget.key));
|
|
7638
7636
|
if (widgetConstraints && widgetConstraints.length) {
|
|
7639
7637
|
widgetConstraints.forEach((constraint) => {
|
|
7640
|
-
|
|
7638
|
+
// null or undefined: not specified, keep what earlier constraints (or the layout) set
|
|
7639
|
+
if (constraint.visible == null) {
|
|
7641
7640
|
if (widget.isVisible === undefined) {
|
|
7642
7641
|
widget.isVisible = true;
|
|
7643
7642
|
}
|
|
@@ -7660,10 +7659,10 @@ class SmartFormService {
|
|
|
7660
7659
|
let requiredIndex = validators.findIndex((v) => v.validator === Validators.required);
|
|
7661
7660
|
let wasMandatory = requiredIndex >= 0;
|
|
7662
7661
|
let tobeMandatory = false;
|
|
7663
|
-
if (constraint.mandatory
|
|
7664
|
-
// not specified
|
|
7665
|
-
//
|
|
7666
|
-
tobeMandatory = widget.isVisible && wasMandatory;
|
|
7662
|
+
if (constraint.mandatory == null) {
|
|
7663
|
+
// not specified: keep the state left by earlier constraints or the layout;
|
|
7664
|
+
// a hidden widget is not mandatory unless a constraint says so
|
|
7665
|
+
tobeMandatory = !!widget.isVisible && wasMandatory;
|
|
7667
7666
|
}
|
|
7668
7667
|
else {
|
|
7669
7668
|
tobeMandatory = constraint.mandatory;
|
|
@@ -7692,7 +7691,7 @@ class SmartFormService {
|
|
|
7692
7691
|
}
|
|
7693
7692
|
this.addEmptyItemToValueList(widget, emptyLabel);
|
|
7694
7693
|
}
|
|
7695
|
-
if (constraint.enabled
|
|
7694
|
+
if (constraint.enabled == null) {
|
|
7696
7695
|
if (widget.isDisabled === undefined) {
|
|
7697
7696
|
widget.isDisabled = false;
|
|
7698
7697
|
}
|
|
@@ -24378,7 +24377,6 @@ class SmartFilterParamsComponent {
|
|
|
24378
24377
|
this.setUp(this.service().model);
|
|
24379
24378
|
});
|
|
24380
24379
|
this.setUp(this.service().model);
|
|
24381
|
-
console.log(this.service().model);
|
|
24382
24380
|
}
|
|
24383
24381
|
ngOnDestroy() {
|
|
24384
24382
|
this._destroy$.next();
|