@sumaris-net/ngx-components 0.27.8 → 0.27.9

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.
@@ -3145,7 +3145,6 @@
3145
3145
  var endField = group.get(endDateField);
3146
3146
  var endDate = fromDateISOString(endField.value);
3147
3147
  if (isNotNil(startDate) && isNotNil(endDate) && Math.abs(startDate.diff(endDate, durationUnit)) > maxDuration) {
3148
- console.log('TODO error !');
3149
3148
  // Update end field
3150
3149
  endField.markAsTouched({ onlySelf: true });
3151
3150
  endField.markAsPending();
@@ -19055,6 +19054,7 @@
19055
19054
  this.onSubmit = new i0.EventEmitter();
19056
19055
  if (form)
19057
19056
  this.setForm(form);
19057
+ this.translate = injector.get(i1$2.TranslateService);
19058
19058
  this.settings = injector.get(LocalSettingsService);
19059
19059
  this.errorTranslator = injector.get(FormErrorTranslator);
19060
19060
  this.autocompleteHelper = new MatAutocompleteConfigHolder(this.settings && {
@@ -19301,7 +19301,9 @@
19301
19301
  this.markForCheck();
19302
19302
  };
19303
19303
  AppForm.prototype.translateControlPath = function (path) {
19304
- return this.getFieldName(path);
19304
+ var _a;
19305
+ var i18nFieldName = this.getI18nFieldName(path);
19306
+ return ((_a = this.translate) === null || _a === void 0 ? void 0 : _a.instant(i18nFieldName)) || i18nFieldName;
19305
19307
  };
19306
19308
  /* -- protected methods -- */
19307
19309
  AppForm.prototype.getFormError = function (form, opts) {
@@ -19309,7 +19311,7 @@
19309
19311
  return undefined;
19310
19312
  return this.errorTranslator.translateErrors(this.form, Object.assign({ controlPathTranslator: this }, opts));
19311
19313
  };
19312
- AppForm.prototype.getFieldName = function (path) {
19314
+ AppForm.prototype.getI18nFieldName = function (path) {
19313
19315
  return (this.i18nFieldPrefix || '') + changeCaseToUnderscore(path).toUpperCase();
19314
19316
  };
19315
19317
  AppForm.prototype.registerSubscription = function (sub) {
@@ -19319,7 +19321,7 @@
19319
19321
  return this.autocompleteHelper.add(fieldName, opts);
19320
19322
  };
19321
19323
  AppForm.prototype.markForCheck = function () {
19322
- // Should be override by subclasses
19324
+ // Should be overwritten by subclasses
19323
19325
  console.warn('markForCheck() has been called, but is not overwritten by component ' + this.constructor.name);
19324
19326
  };
19325
19327
  return AppForm;