@wavemaker/app-ng-runtime 11.4.0-next.1417070 → 11.4.0-next.1417071

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 (42) hide show
  1. app-ng-runtime/build-task/bundles/index.umd.js +1 -1
  2. app-ng-runtime/build-task/bundles/index.umd.js.map +1 -1
  3. app-ng-runtime/build-task/esm2015/data/form/form-field/form-field.build.js +2 -2
  4. app-ng-runtime/build-task/fesm2015/index.js +1 -1
  5. app-ng-runtime/build-task/fesm2015/index.js.map +1 -1
  6. app-ng-runtime/components/base/bundles/index.umd.js +7 -1
  7. app-ng-runtime/components/base/bundles/index.umd.js.map +1 -1
  8. app-ng-runtime/components/base/esm2015/widgets/common/base/base-field-validations.js +3 -2
  9. app-ng-runtime/components/base/esm2015/widgets/common/dialog/dialog.service.js +7 -1
  10. app-ng-runtime/components/base/fesm2015/index.js +7 -1
  11. app-ng-runtime/components/base/fesm2015/index.js.map +1 -1
  12. app-ng-runtime/components/data/form/bundles/index.umd.js +37 -13
  13. app-ng-runtime/components/data/form/bundles/index.umd.js.map +1 -1
  14. app-ng-runtime/components/data/form/esm2015/form-field/form-field.directive.js +26 -7
  15. app-ng-runtime/components/data/form/esm2015/form.component.js +10 -5
  16. app-ng-runtime/components/data/form/fesm2015/index.js +34 -10
  17. app-ng-runtime/components/data/form/fesm2015/index.js.map +1 -1
  18. app-ng-runtime/components/data/form/index.metadata.json +1 -1
  19. app-ng-runtime/components/data/list/bundles/index.umd.js +1 -1
  20. app-ng-runtime/components/data/list/bundles/index.umd.js.map +1 -1
  21. app-ng-runtime/components/data/list/esm2015/list.component.js +2 -2
  22. app-ng-runtime/components/data/list/fesm2015/index.js +1 -1
  23. app-ng-runtime/components/data/list/fesm2015/index.js.map +1 -1
  24. app-ng-runtime/components/data/list/index.metadata.json +1 -1
  25. app-ng-runtime/components/data/list/list.component.d.ts +1 -1
  26. app-ng-runtime/components/dialogs/default/bundles/index.umd.js +5 -0
  27. app-ng-runtime/components/dialogs/default/bundles/index.umd.js.map +1 -1
  28. app-ng-runtime/components/dialogs/default/esm2015/base-dialog.js +7 -2
  29. app-ng-runtime/components/dialogs/default/fesm2015/index.js +6 -1
  30. app-ng-runtime/components/dialogs/default/fesm2015/index.js.map +1 -1
  31. app-ng-runtime/components/input/epoch/bundles/index.umd.js +1 -1
  32. app-ng-runtime/components/input/epoch/bundles/index.umd.js.map +1 -1
  33. app-ng-runtime/components/input/epoch/esm2015/date/date.component.js +2 -2
  34. app-ng-runtime/components/input/epoch/fesm2015/index.js +1 -1
  35. app-ng-runtime/components/input/epoch/fesm2015/index.js.map +1 -1
  36. app-ng-runtime/components/input/epoch/index.metadata.json +1 -1
  37. app-ng-runtime/components/navigation/popover/bundles/index.umd.js +3 -0
  38. app-ng-runtime/components/navigation/popover/bundles/index.umd.js.map +1 -1
  39. app-ng-runtime/components/navigation/popover/esm2015/popover.component.js +4 -1
  40. app-ng-runtime/components/navigation/popover/fesm2015/index.js +3 -0
  41. app-ng-runtime/components/navigation/popover/fesm2015/index.js.map +1 -1
  42. app-ng-runtime/package.json +1 -1
@@ -436,16 +436,21 @@
436
436
  };
437
437
  };
438
438
  var ɵ2 = findInvalidElement;
439
- var setTouchedState = function (ngForm) {
439
+ var setTouchedState = function (self, ngForm, fieldName) {
440
+ var _a, _b;
440
441
  if (ngForm.valid) {
441
442
  return;
442
443
  }
443
444
  if (ngForm.controls) {
444
- _.forEach(ngForm.controls, function (ctrl) {
445
- setTouchedState(ctrl);
445
+ _.forEach(ngForm.controls, function (ctrl, fieldName) {
446
+ setTouchedState(self, ctrl, fieldName);
446
447
  });
447
448
  }
448
449
  else {
450
+ var element = self.$element.find("[wmformfield][key=\"" + fieldName + "\"]");
451
+ element[0].setAttribute('__errormsg', element[0].getAttribute('__validationId'));
452
+ (_a = element[0].querySelector('input')) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-invalid', ngForm.invalid);
453
+ (_b = element[0].querySelector('input')) === null || _b === void 0 ? void 0 : _b.setAttribute('aria-describedby', element[0].getAttribute('__validationId'));
449
454
  ngForm.markAsTouched();
450
455
  }
451
456
  };
@@ -766,7 +771,7 @@
766
771
  };
767
772
  // This method loops through the form fields and highlights the invalid fields by setting state to touched
768
773
  FormComponent.prototype.highlightInvalidFields = function () {
769
- setTouchedState(this.ngform);
774
+ setTouchedState(this, this.ngform, '');
770
775
  };
771
776
  // Disable the form submit if form is in invalid state. Highlight all the invalid fields if validation type is default
772
777
  FormComponent.prototype.validateFieldsOnSubmit = function () {
@@ -1357,8 +1362,8 @@
1357
1362
  FormComponent.prototype.generateFormFields = function () {
1358
1363
  return __awaiter(this, void 0, void 0, function () {
1359
1364
  var noOfColumns, $gridLayout, columnWidth, fieldTemplate, colCount, index, userFields, fields, colTmpl, componentFactoryRef, component;
1360
- return __generator(this, function (_b) {
1361
- switch (_b.label) {
1365
+ return __generator(this, function (_c) {
1366
+ switch (_c.label) {
1362
1367
  case 0:
1363
1368
  // Check if grid layout is present or not for first time
1364
1369
  if (_.isUndefined(this._isGridLayoutPresent)) {
@@ -1416,7 +1421,7 @@
1416
1421
  transpile: true
1417
1422
  })];
1418
1423
  case 1:
1419
- componentFactoryRef = _b.sent();
1424
+ componentFactoryRef = _c.sent();
1420
1425
  component = this.dynamicFormRef.createComponent(componentFactoryRef, 0, this.inj);
1421
1426
  core.extendProto(component.instance, this._dynamicContext);
1422
1427
  $gridLayout[0].appendChild(component.location.nativeElement);
@@ -1828,10 +1833,20 @@
1828
1833
  $($evt.target).closest('.live-field').addClass('active');
1829
1834
  };
1830
1835
  FormFieldDirective.prototype._onBlurField = function ($evt) {
1831
- var _a, _b;
1836
+ var _a, _b, _c, _d;
1832
1837
  $($evt.target).closest('.live-field').removeClass('active');
1833
- (_a = this.nativeElement.querySelector('input')) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-invalid', "" + this.ngform.controls[this._fieldName].invalid);
1834
- (_b = this.nativeElement.querySelector('input')) === null || _b === void 0 ? void 0 : _b.setAttribute('aria-describedby', "" + this.nativeElement.getAttribute('__errormsg'));
1838
+ var ele = this.nativeElement.querySelector('p.text-danger');
1839
+ // Fix for [WMS-23959]: ADA issue - adding aria-describedby, aria-invalid, __errormsg attributes only when the form field is invalid , else removing the attributes
1840
+ if (this.ngform.controls[this._fieldName].invalid && this.ngform.controls[this._fieldName].touched && this.form.isUpdateMode) {
1841
+ this.nativeElement.setAttribute('__errormsg', "" + this.nativeElement.getAttribute('__validationId'));
1842
+ (_a = this.nativeElement.querySelector('input')) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-invalid', "" + this.ngform.controls[this._fieldName].invalid);
1843
+ (_b = this.nativeElement.querySelector('input')) === null || _b === void 0 ? void 0 : _b.setAttribute('aria-describedby', "" + this.nativeElement.getAttribute('__validationId'));
1844
+ }
1845
+ else {
1846
+ this.nativeElement.removeAttribute('__errormsg');
1847
+ (_c = this.nativeElement.querySelector('input')) === null || _c === void 0 ? void 0 : _c.removeAttribute('aria-invalid');
1848
+ (_d = this.nativeElement.querySelector('input')) === null || _d === void 0 ? void 0 : _d.removeAttribute('aria-describedby');
1849
+ }
1835
1850
  this._activeField = false;
1836
1851
  this._triggeredByUser = false;
1837
1852
  this._clicktriggeredByUser = false;
@@ -2067,7 +2082,7 @@
2067
2082
  };
2068
2083
  // On field value change, propagate event to parent form
2069
2084
  FormFieldDirective.prototype.onValueChange = function (val) {
2070
- var _a, _b;
2085
+ var _a, _b, _c, _d;
2071
2086
  if (!this.isDestroyed) {
2072
2087
  var captionEl = $(this.nativeElement).find('.caption-floating');
2073
2088
  if (captionEl.length > 0) {
@@ -2077,8 +2092,17 @@
2077
2092
  var hasValue = ((core.isDefined(val) && val !== '' && val !== null) || captionEl.find('input').val()) || captionEl.find('input:-webkit-autofill').length;
2078
2093
  this.app.notify('captionPositionAnimate', { displayVal: hasValue, nativeEl: captionEl, isSelectMultiple: this.formWidget && this.formWidget.multiple, isFocused: this._activeField });
2079
2094
  }
2080
- (_a = this.nativeElement.querySelector('input')) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-invalid', this._triggeredByUser && this.ngform.controls[this._fieldName].invalid ? 'true' : 'false');
2081
- (_b = this.nativeElement.querySelector('input')) === null || _b === void 0 ? void 0 : _b.setAttribute('aria-describedby', "" + this.nativeElement.getAttribute('__errormsg'));
2095
+ // Fix for [WMS-23959]: ADA issue - adding aria-describedby, aria-invalid, __errormsg attributes only when the form field is invalid , else removing the attributes
2096
+ if (this.ngform.controls[this._fieldName].invalid && this.ngform.controls[this._fieldName].touched && this.form.isUpdateMode) {
2097
+ this.nativeElement.setAttribute('__errormsg', "" + this.nativeElement.getAttribute('__validationId'));
2098
+ (_a = this.nativeElement.querySelector('input')) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-invalid', this._triggeredByUser && this.ngform.controls[this._fieldName].invalid ? 'true' : 'false');
2099
+ (_b = this.nativeElement.querySelector('input')) === null || _b === void 0 ? void 0 : _b.setAttribute('aria-describedby', "" + this.nativeElement.getAttribute('__validationId'));
2100
+ }
2101
+ else {
2102
+ this.nativeElement.removeAttribute('__errormsg');
2103
+ (_c = this.nativeElement.querySelector('input')) === null || _c === void 0 ? void 0 : _c.removeAttribute('aria-invalid');
2104
+ (_d = this.nativeElement.querySelector('input')) === null || _d === void 0 ? void 0 : _d.removeAttribute('aria-describedby');
2105
+ }
2082
2106
  this.form.onFieldValueChange(this, val);
2083
2107
  this.notifyChanges();
2084
2108
  // Do mark as touched, only incase when user has entered an input but not through the script. Hence added mousedown event check