@wavemaker/app-ng-runtime 11.5.0-next.24746 → 11.5.0-next.26221

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.
Files changed (26) hide show
  1. app-ng-runtime/components/base/bundles/index.umd.js +11 -8
  2. app-ng-runtime/components/base/esm2020/widgets/common/base/base-field-validations.mjs +12 -9
  3. app-ng-runtime/components/base/fesm2015/index.mjs +11 -8
  4. app-ng-runtime/components/base/fesm2015/index.mjs.map +1 -1
  5. app-ng-runtime/components/base/fesm2020/index.mjs +11 -8
  6. app-ng-runtime/components/base/fesm2020/index.mjs.map +1 -1
  7. app-ng-runtime/components/base/widgets/common/base/base-field-validations.d.ts +1 -0
  8. app-ng-runtime/components/input/default/bundles/index.umd.js +1 -1
  9. app-ng-runtime/components/input/default/esm2020/base-form-custom.component.mjs +2 -2
  10. app-ng-runtime/components/input/default/fesm2015/index.mjs +1 -1
  11. app-ng-runtime/components/input/default/fesm2015/index.mjs.map +1 -1
  12. app-ng-runtime/components/input/default/fesm2020/index.mjs +1 -1
  13. app-ng-runtime/components/input/default/fesm2020/index.mjs.map +1 -1
  14. app-ng-runtime/core/bundles/index.umd.js +1 -1
  15. app-ng-runtime/core/esm2020/utils/watcher.mjs +2 -2
  16. app-ng-runtime/core/fesm2015/index.mjs +1 -1
  17. app-ng-runtime/core/fesm2015/index.mjs.map +1 -1
  18. app-ng-runtime/core/fesm2020/index.mjs +1 -1
  19. app-ng-runtime/core/fesm2020/index.mjs.map +1 -1
  20. app-ng-runtime/package.json +1 -1
  21. app-ng-runtime/variables/bundles/index.umd.js +2 -1
  22. app-ng-runtime/variables/esm2020/service/variables.service.mjs +3 -2
  23. app-ng-runtime/variables/fesm2015/index.mjs +2 -1
  24. app-ng-runtime/variables/fesm2015/index.mjs.map +1 -1
  25. app-ng-runtime/variables/fesm2020/index.mjs +2 -1
  26. app-ng-runtime/variables/fesm2020/index.mjs.map +1 -1
@@ -4545,9 +4545,9 @@ class BaseFieldValidations {
4545
4545
  if (this.widgetContext.ngform) {
4546
4546
  this.widgetControl.setValidators(this.instance._validators);
4547
4547
  const opt = {};
4548
- // updating the value only when prevData is not equal to current value.
4548
+ // updating the value only when prevData is not equal to current value. and also initially when instance.value is empty or null for some widgets like date, checkboxset
4549
4549
  // emitEvent flag will prevent from emitting the valueChanges when value is equal to the prevDatavalue.
4550
- if (this.formwidget && this.instance.value === this.formwidget.prevDatavalue) {
4550
+ if (this.formwidget && (this.instance.value === this.formwidget.prevDatavalue || this.isNullOrEmptyOrFalsy(this.instance.value))) {
4551
4551
  opt['emitEvent'] = false;
4552
4552
  }
4553
4553
  this.widgetControl.updateValueAndValidity(opt);
@@ -4604,9 +4604,9 @@ class BaseFieldValidations {
4604
4604
  this.widgetControl.setAsyncValidators([this._asyncValidatorFn()]);
4605
4605
  if (this.widgetContext.ngform.touched) {
4606
4606
  const opt = {};
4607
- // updating the value only when prevData is not equal to current value.
4607
+ // updating the value only when prevData is not equal to current value. and also initially when instance.value is empty or null for some widgets like date, checkboxset
4608
4608
  // emitEvent flag will prevent from emitting the valueChanges when value is equal to the prevDatavalue.
4609
- if (this.formwidget && this.instance.value === this.formwidget.prevDatavalue) {
4609
+ if (this.formwidget && (this.instance.value === this.formwidget.prevDatavalue || this.isNullOrEmptyOrFalsy(this.instance.value))) {
4610
4610
  opt['emitEvent'] = false;
4611
4611
  }
4612
4612
  this.widgetControl.updateValueAndValidity(opt);
@@ -4673,9 +4673,9 @@ class BaseFieldValidations {
4673
4673
  this.applyDefaultValidators();
4674
4674
  if (this._asyncValidatorFn) {
4675
4675
  const opt = {};
4676
- // updating the value only when prevData is not equal to current value.
4676
+ // updating the value only when prevData is not equal to current value. and also initially when instance.value is empty or null for some widgets like date, checkboxset
4677
4677
  // emitEvent flag will prevent from emitting the valueChanges when value is equal to the prevDatavalue.
4678
- if (this.formwidget && this.instance.value === this.formwidget.prevDatavalue) {
4678
+ if (this.formwidget && (this.instance.value === this.formwidget.prevDatavalue || this.isNullOrEmptyOrFalsy(this.instance.value))) {
4679
4679
  opt['emitEvent'] = false;
4680
4680
  }
4681
4681
  this.widgetControl.setAsyncValidators([this._asyncValidatorFn()]);
@@ -4696,13 +4696,16 @@ class BaseFieldValidations {
4696
4696
  this.applyDefaultValidators();
4697
4697
  }, watchName));
4698
4698
  }
4699
+ isNullOrEmptyOrFalsy(value) {
4700
+ return _.isEmpty(value);
4701
+ }
4699
4702
  // invokes both custom sync validations and default validations.
4700
4703
  applyDefaultValidators() {
4701
4704
  const validators = this.getDefaultValidators();
4702
4705
  const opt = {};
4703
- // updating the value only when prevData is not equal to current value.
4706
+ // updating the value only when prevData is not equal to current value. and also initially when instance.value is empty or null for some widgets like date, checkboxset
4704
4707
  // emitEvent flag will prevent from emitting the valueChanges when value is equal to the prevDatavalue.
4705
- if (this.formwidget && this.instance.value === this.formwidget.prevDatavalue) {
4708
+ if (this.formwidget && (this.instance.value === this.formwidget.prevDatavalue || this.isNullOrEmptyOrFalsy(this.instance.value))) {
4706
4709
  opt['emitEvent'] = false;
4707
4710
  }
4708
4711
  this.widgetControl.setValidators(_.concat(this._syncValidators || [], validators));