@adins/ucsearch 2.9.9 → 2.9.11
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.
|
@@ -788,11 +788,19 @@ class UCSearchComponent {
|
|
|
788
788
|
}
|
|
789
789
|
checkValueGteLte(component) {
|
|
790
790
|
//cek yg pakai restriction gte/lte/gt/lt
|
|
791
|
-
let MinComponent = this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "GTE"))
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
791
|
+
let MinComponent = this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "GTE"));
|
|
792
|
+
if (!MinComponent) {
|
|
793
|
+
MinComponent = this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "GT"));
|
|
794
|
+
}
|
|
795
|
+
let MaxComponent = this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "LTE"));
|
|
796
|
+
if (!MaxComponent) {
|
|
797
|
+
MaxComponent = this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "LT"));
|
|
798
|
+
}
|
|
799
|
+
if (MinComponent && MaxComponent) {
|
|
800
|
+
if (this.myForm.nativeElement[MinComponent.id].value > this.myForm.nativeElement[MaxComponent.id].value) {
|
|
801
|
+
this.toastr.warning(MinComponent.label + " must be less than " + MaxComponent.label);
|
|
802
|
+
return false;
|
|
803
|
+
}
|
|
796
804
|
}
|
|
797
805
|
return true;
|
|
798
806
|
}
|