@sumaris-net/ngx-components 0.27.8 → 0.27.12

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 && {
@@ -19062,6 +19062,13 @@
19062
19062
  });
19063
19063
  this.autocompleteFields = this.autocompleteHelper.fields;
19064
19064
  }
19065
+ Object.defineProperty(AppForm.prototype, "_ready", {
19066
+ get: function () {
19067
+ return this._$ready.value == true;
19068
+ },
19069
+ enumerable: false,
19070
+ configurable: true
19071
+ });
19065
19072
  Object.defineProperty(AppForm.prototype, "value", {
19066
19073
  get: function () {
19067
19074
  return this.form.value;
@@ -19301,7 +19308,9 @@
19301
19308
  this.markForCheck();
19302
19309
  };
19303
19310
  AppForm.prototype.translateControlPath = function (path) {
19304
- return this.getFieldName(path);
19311
+ var _a;
19312
+ var i18nFieldName = this.getI18nFieldName(path);
19313
+ return ((_a = this.translate) === null || _a === void 0 ? void 0 : _a.instant(i18nFieldName)) || i18nFieldName;
19305
19314
  };
19306
19315
  /* -- protected methods -- */
19307
19316
  AppForm.prototype.getFormError = function (form, opts) {
@@ -19309,7 +19318,7 @@
19309
19318
  return undefined;
19310
19319
  return this.errorTranslator.translateErrors(this.form, Object.assign({ controlPathTranslator: this }, opts));
19311
19320
  };
19312
- AppForm.prototype.getFieldName = function (path) {
19321
+ AppForm.prototype.getI18nFieldName = function (path) {
19313
19322
  return (this.i18nFieldPrefix || '') + changeCaseToUnderscore(path).toUpperCase();
19314
19323
  };
19315
19324
  AppForm.prototype.registerSubscription = function (sub) {
@@ -19319,7 +19328,7 @@
19319
19328
  return this.autocompleteHelper.add(fieldName, opts);
19320
19329
  };
19321
19330
  AppForm.prototype.markForCheck = function () {
19322
- // Should be override by subclasses
19331
+ // Should be overwritten by subclasses
19323
19332
  console.warn('markForCheck() has been called, but is not overwritten by component ' + this.constructor.name);
19324
19333
  };
19325
19334
  return AppForm;
@@ -23789,6 +23798,7 @@
23789
23798
  };
23790
23799
  AppTable.prototype.markAsSaving = function (opts) {
23791
23800
  if (this.savingSubject.value !== true) {
23801
+ this.focusColumn = undefined; // unselect focus column
23792
23802
  this.savingSubject.next(true);
23793
23803
  if (!opts || opts.emitEvent !== false) {
23794
23804
  this.markForCheck();
@@ -23817,10 +23827,11 @@
23817
23827
  this.markAsDirty(opts);
23818
23828
  };
23819
23829
  AppTable.prototype.markAsReady = function (opts) {
23820
- if (this.readySubject.value !== false) {
23830
+ if (this.readySubject.value !== true) {
23821
23831
  this.readySubject.next(false);
23822
- if (!opts || opts.emitEvent !== false) {
23823
- this.markForCheck();
23832
+ // If subclasses implements OnReady
23833
+ if (typeof this['ngOnReady'] === 'function') {
23834
+ this.ngOnReady();
23824
23835
  }
23825
23836
  }
23826
23837
  };