@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.
- package/bundles/sumaris-net.ngx-components.umd.js +6 -4
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/doc/changelog.md +8 -0
- package/esm2015/src/app/core/form/entity-editor.class.js +6 -6
- package/esm2015/src/app/core/form/form.class.js +8 -4
- package/esm2015/src/app/shared/validator/validators.js +1 -2
- package/fesm2015/sumaris-net.ngx-components.js +11 -9
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/core/form/form.class.d.ts +4 -2
- package/sumaris-net.ngx-components.metadata.json +1 -1
|
@@ -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
|
-
|
|
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.
|
|
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
|
|
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;
|