@sumaris-net/ngx-components 2.4.2 → 2.4.4
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/doc/changelog.md +4 -1
- package/esm2020/src/app/core/form/form.utils.mjs +10 -10
- package/esm2020/src/app/core/services/platform.service.mjs +11 -3
- package/fesm2015/sumaris-net.ngx-components.mjs +19 -11
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +19 -11
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -4641,7 +4641,7 @@ class AppFormArray extends UntypedFormArray {
|
|
|
4641
4641
|
*/
|
|
4642
4642
|
setValue(values, options) {
|
|
4643
4643
|
if (values === undefined)
|
|
4644
|
-
throw new Error('\'undefined\' value not allowed in AppFormArray.setValue()');
|
|
4644
|
+
throw new Error('\'undefined\' value not allowed in AppFormArray.setValue(). Use \'null\' or \'[]\' to clear the array');
|
|
4645
4645
|
if (this.options.allowReuseControls === false) {
|
|
4646
4646
|
const disabled = this.disabled;
|
|
4647
4647
|
// Clean all
|
|
@@ -4664,14 +4664,14 @@ class AppFormArray extends UntypedFormArray {
|
|
|
4664
4664
|
}
|
|
4665
4665
|
}
|
|
4666
4666
|
patchValue(values, options) {
|
|
4667
|
-
// /!\ From
|
|
4668
|
-
//
|
|
4669
|
-
//
|
|
4670
|
-
//
|
|
4671
|
-
//
|
|
4672
|
-
//
|
|
4673
|
-
if (values
|
|
4674
|
-
return;
|
|
4667
|
+
// --- /!\ From official Angular doc of 'FormGroup.patchValue()' :
|
|
4668
|
+
// Even though the `value` argument type doesn't allow `null` and `undefined` values, the
|
|
4669
|
+
// `patchValue` can be called recursively and inner data structures might have these values, so
|
|
4670
|
+
// we just ignore such cases when a field containing FormGroup instance receives `null` or
|
|
4671
|
+
// `undefined` as a value.
|
|
4672
|
+
// ---
|
|
4673
|
+
if (values == null)
|
|
4674
|
+
return; // Ignore
|
|
4675
4675
|
if (this.options.allowReuseControls === false) {
|
|
4676
4676
|
const disabled = this.disabled;
|
|
4677
4677
|
// Clean all
|
|
@@ -18511,8 +18511,16 @@ class PlatformService extends StartableService {
|
|
|
18511
18511
|
}
|
|
18512
18512
|
});
|
|
18513
18513
|
this.settings.onChange.subscribe(data => {
|
|
18514
|
-
if (data
|
|
18515
|
-
|
|
18514
|
+
if (data) {
|
|
18515
|
+
if (data.locale) {
|
|
18516
|
+
if (data.locale !== this.translate.currentLang) {
|
|
18517
|
+
this.translate.use(data.locale);
|
|
18518
|
+
}
|
|
18519
|
+
}
|
|
18520
|
+
else {
|
|
18521
|
+
// Hotfix from ludovic.pecquot@e-is.pro (14/11/2021) - See 1.20.42
|
|
18522
|
+
this.translate.use(this.environment.defaultLocale);
|
|
18523
|
+
}
|
|
18516
18524
|
}
|
|
18517
18525
|
});
|
|
18518
18526
|
// Use account's settings, (like locale), when account inheritance enabled
|