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

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 (37) hide show
  1. app-ng-runtime/components/base/bundles/index.umd.js +23 -9
  2. app-ng-runtime/components/base/esm2020/widgets/common/base/base-field-validations.mjs +12 -9
  3. app-ng-runtime/components/base/esm2020/widgets/common/partial-param/partial-param.directive.mjs +13 -2
  4. app-ng-runtime/components/base/fesm2015/index.mjs +23 -9
  5. app-ng-runtime/components/base/fesm2015/index.mjs.map +1 -1
  6. app-ng-runtime/components/base/fesm2020/index.mjs +23 -9
  7. app-ng-runtime/components/base/fesm2020/index.mjs.map +1 -1
  8. app-ng-runtime/components/base/widgets/common/base/base-field-validations.d.ts +1 -0
  9. app-ng-runtime/components/base/widgets/common/partial-param/partial-param.directive.d.ts +1 -0
  10. app-ng-runtime/components/data/list/bundles/index.umd.js +8 -6
  11. app-ng-runtime/components/data/list/esm2020/list-item.directive.mjs +11 -9
  12. app-ng-runtime/components/data/list/fesm2015/index.mjs +10 -8
  13. app-ng-runtime/components/data/list/fesm2015/index.mjs.map +1 -1
  14. app-ng-runtime/components/data/list/fesm2020/index.mjs +8 -8
  15. app-ng-runtime/components/data/list/fesm2020/index.mjs.map +1 -1
  16. app-ng-runtime/components/data/list/list-item.directive.d.ts +3 -2
  17. app-ng-runtime/components/input/default/bundles/index.umd.js +1 -1
  18. app-ng-runtime/components/input/default/esm2020/base-form-custom.component.mjs +2 -2
  19. app-ng-runtime/components/input/default/fesm2015/index.mjs +1 -1
  20. app-ng-runtime/components/input/default/fesm2015/index.mjs.map +1 -1
  21. app-ng-runtime/components/input/default/fesm2020/index.mjs +1 -1
  22. app-ng-runtime/components/input/default/fesm2020/index.mjs.map +1 -1
  23. app-ng-runtime/core/bundles/index.umd.js +12 -40
  24. app-ng-runtime/core/esm2020/utils/utils.mjs +12 -40
  25. app-ng-runtime/core/esm2020/utils/watcher.mjs +2 -2
  26. app-ng-runtime/core/fesm2015/index.mjs +12 -40
  27. app-ng-runtime/core/fesm2015/index.mjs.map +1 -1
  28. app-ng-runtime/core/fesm2020/index.mjs +12 -40
  29. app-ng-runtime/core/fesm2020/index.mjs.map +1 -1
  30. app-ng-runtime/core/utils/utils.d.ts +2 -2
  31. app-ng-runtime/package.json +1 -1
  32. app-ng-runtime/variables/bundles/index.umd.js +2 -1
  33. app-ng-runtime/variables/esm2020/service/variables.service.mjs +3 -2
  34. app-ng-runtime/variables/fesm2015/index.mjs +2 -1
  35. app-ng-runtime/variables/fesm2015/index.mjs.map +1 -1
  36. app-ng-runtime/variables/fesm2020/index.mjs +2 -1
  37. app-ng-runtime/variables/fesm2020/index.mjs.map +1 -1
@@ -1876,10 +1876,14 @@ class PartialParamHandlerDirective {
1876
1876
  }
1877
1877
  registerParams(name, value, bindExpr, type) {
1878
1878
  this.widgetRef.partialParams[name] = value;
1879
+ let viewParent = this.widgetRef.getViewParent();
1880
+ if (this.widgetRef.inj._tNode.parent === null) {
1881
+ viewParent = this.getViewParent(viewParent);
1882
+ }
1879
1883
  if (!value && bindExpr) {
1880
1884
  this.widgetRef.registerDestroyListener(
1881
1885
  //[Todo-CSP]: expr fn should be generated be default
1882
- $watch(bindExpr, this.widgetRef.getViewParent(), _.get(this.widgetRef, 'context'), nv => {
1886
+ $watch(bindExpr, viewParent, _.get(this.widgetRef, 'context'), nv => {
1883
1887
  this.widgetRef.partialParams[name] = nv;
1884
1888
  // notify the partial container of the param changes
1885
1889
  this.widgetRef.params$.next();
@@ -1889,6 +1893,13 @@ class PartialParamHandlerDirective {
1889
1893
  this.widgetRef.params$.next();
1890
1894
  }
1891
1895
  }
1896
+ getViewParent(viewParent) {
1897
+ let parent = viewParent.viewParent;
1898
+ if (parent.hasOwnProperty("isDynamicComponent") || parent.hasOwnProperty("isPageComponent")) {
1899
+ return parent;
1900
+ }
1901
+ return this.getViewParent(parent);
1902
+ }
1892
1903
  }
1893
1904
  PartialParamHandlerDirective.ɵfac = function PartialParamHandlerDirective_Factory(t) { return new (t || PartialParamHandlerDirective)(i0.ɵɵdirectiveInject(WidgetRef, 2)); };
1894
1905
  PartialParamHandlerDirective.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: PartialParamHandlerDirective, selectors: [["", "partialContainer", ""]] });
@@ -4545,9 +4556,9 @@ class BaseFieldValidations {
4545
4556
  if (this.widgetContext.ngform) {
4546
4557
  this.widgetControl.setValidators(this.instance._validators);
4547
4558
  const opt = {};
4548
- // updating the value only when prevData is not equal to current value.
4559
+ // 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
4560
  // 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) {
4561
+ if (this.formwidget && (this.instance.value === this.formwidget.prevDatavalue || this.isNullOrEmptyOrFalsy(this.instance.value))) {
4551
4562
  opt['emitEvent'] = false;
4552
4563
  }
4553
4564
  this.widgetControl.updateValueAndValidity(opt);
@@ -4604,9 +4615,9 @@ class BaseFieldValidations {
4604
4615
  this.widgetControl.setAsyncValidators([this._asyncValidatorFn()]);
4605
4616
  if (this.widgetContext.ngform.touched) {
4606
4617
  const opt = {};
4607
- // updating the value only when prevData is not equal to current value.
4618
+ // 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
4619
  // 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) {
4620
+ if (this.formwidget && (this.instance.value === this.formwidget.prevDatavalue || this.isNullOrEmptyOrFalsy(this.instance.value))) {
4610
4621
  opt['emitEvent'] = false;
4611
4622
  }
4612
4623
  this.widgetControl.updateValueAndValidity(opt);
@@ -4673,9 +4684,9 @@ class BaseFieldValidations {
4673
4684
  this.applyDefaultValidators();
4674
4685
  if (this._asyncValidatorFn) {
4675
4686
  const opt = {};
4676
- // updating the value only when prevData is not equal to current value.
4687
+ // 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
4688
  // 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) {
4689
+ if (this.formwidget && (this.instance.value === this.formwidget.prevDatavalue || this.isNullOrEmptyOrFalsy(this.instance.value))) {
4679
4690
  opt['emitEvent'] = false;
4680
4691
  }
4681
4692
  this.widgetControl.setAsyncValidators([this._asyncValidatorFn()]);
@@ -4696,13 +4707,16 @@ class BaseFieldValidations {
4696
4707
  this.applyDefaultValidators();
4697
4708
  }, watchName));
4698
4709
  }
4710
+ isNullOrEmptyOrFalsy(value) {
4711
+ return _.isEmpty(value);
4712
+ }
4699
4713
  // invokes both custom sync validations and default validations.
4700
4714
  applyDefaultValidators() {
4701
4715
  const validators = this.getDefaultValidators();
4702
4716
  const opt = {};
4703
- // updating the value only when prevData is not equal to current value.
4717
+ // 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
4718
  // 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) {
4719
+ if (this.formwidget && (this.instance.value === this.formwidget.prevDatavalue || this.isNullOrEmptyOrFalsy(this.instance.value))) {
4706
4720
  opt['emitEvent'] = false;
4707
4721
  }
4708
4722
  this.widgetControl.setValidators(_.concat(this._syncValidators || [], validators));