@sumaris-net/ngx-components 1.0.9 → 1.0.10
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 +22 -12
- 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/esm2015/src/app/core/form/entity-editor.class.js +1 -1
- package/esm2015/src/app/shared/pipes/form.pipes.js +4 -4
- package/esm2015/src/app/shared/shared-routing.module.js +21 -11
- package/fesm2015/sumaris-net.ngx-components.js +22 -12
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/shared/shared-routing.module.d.ts +7 -0
- package/sumaris-net.ngx-components.metadata.json +1 -1
|
@@ -4236,8 +4236,8 @@
|
|
|
4236
4236
|
this.value = this.adapter.translateErrors(form, opts);
|
|
4237
4237
|
this._ref.markForCheck();
|
|
4238
4238
|
}
|
|
4239
|
-
else if (
|
|
4240
|
-
this.value =
|
|
4239
|
+
else if (this.value !== undefined) {
|
|
4240
|
+
this.value = undefined;
|
|
4241
4241
|
this._ref.markForCheck();
|
|
4242
4242
|
}
|
|
4243
4243
|
};
|
|
@@ -17703,20 +17703,30 @@
|
|
|
17703
17703
|
function CustomReuseStrategy() {
|
|
17704
17704
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
17705
17705
|
}
|
|
17706
|
+
/**
|
|
17707
|
+
* Force to reuse the route when:
|
|
17708
|
+
* - path change from [/new] -> [/:id]
|
|
17709
|
+
* - or path change from [/new] -> [/new?id=:id]
|
|
17710
|
+
* @param future
|
|
17711
|
+
* @param curr
|
|
17712
|
+
*/
|
|
17706
17713
|
CustomReuseStrategy.prototype.shouldReuseRoute = function (future, curr) {
|
|
17707
17714
|
var result = _super.prototype.shouldReuseRoute.call(this, future, curr);
|
|
17708
|
-
//
|
|
17709
|
-
// - path change from [/new] -> [/:id]
|
|
17710
|
-
// - or path change from [/new] -> [/new?id=:id]
|
|
17715
|
+
// Is sam route config
|
|
17711
17716
|
if (!result && future.routeConfig && future.routeConfig === curr.routeConfig) {
|
|
17717
|
+
// Read the parameter name, where id is stored
|
|
17712
17718
|
var pathIdParam = future.routeConfig.data && future.routeConfig.data.pathIdParam || 'id';
|
|
17713
|
-
|
|
17714
|
-
|
|
17715
|
-
|
|
17716
|
-
|
|
17717
|
-
|
|
17718
|
-
|
|
17719
|
-
|
|
17719
|
+
// Read the current route id
|
|
17720
|
+
var currId = curr.params[pathIdParam] === 'new'
|
|
17721
|
+
? (curr.queryParams[pathIdParam] || curr.queryParams['id'] || 'new') // e.g. path like '/new/?id=<ID>'
|
|
17722
|
+
: curr.params[pathIdParam]; // e.g. path like '/<ID>'
|
|
17723
|
+
// Read the future route id
|
|
17724
|
+
var futureId = future.params[pathIdParam] === 'new'
|
|
17725
|
+
? (future.queryParams[pathIdParam] || future.queryParams['id'] || 'new') // e.g. path like '/new/?id=<ID>'
|
|
17726
|
+
: future.params[pathIdParam]; // e.g. path like '/<ID>'
|
|
17727
|
+
// Reuse if same ID, but never when 'new' expected
|
|
17728
|
+
return futureId !== 'new' && currId !== 'new'
|
|
17729
|
+
&& futureId === currId;
|
|
17720
17730
|
}
|
|
17721
17731
|
return result;
|
|
17722
17732
|
};
|