@sumaris-net/ngx-components 2.4.22 → 2.4.23-rc2
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 +3 -0
- package/esm2020/src/app/core/form/entity/entity-editor.class.mjs +10 -28
- package/esm2020/src/app/shared/dates.mjs +7 -1
- package/esm2020/src/app/shared/toolbar/toolbar.mjs +7 -6
- package/fesm2015/sumaris-net.ngx-components.mjs +30 -43
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +21 -32
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/core/form/entity/entity-editor.class.d.ts +1 -1
- package/src/app/shared/dates.d.ts +1 -0
- package/src/app/shared/toolbar/toolbar.d.ts +2 -2
|
@@ -2764,6 +2764,12 @@ class DateUtils {
|
|
|
2764
2764
|
value[MOMENT_NO_TIME_PROPERTY] = true;
|
|
2765
2765
|
return value;
|
|
2766
2766
|
}
|
|
2767
|
+
static markTime(value) {
|
|
2768
|
+
if (!value)
|
|
2769
|
+
return undefined;
|
|
2770
|
+
delete value[MOMENT_NO_TIME_PROPERTY];
|
|
2771
|
+
return value;
|
|
2772
|
+
}
|
|
2767
2773
|
static isNoTime(value) {
|
|
2768
2774
|
return (value === null || value === void 0 ? void 0 : value[MOMENT_NO_TIME_PROPERTY]) === true;
|
|
2769
2775
|
}
|
|
@@ -19328,28 +19334,29 @@ class ToolbarComponent {
|
|
|
19328
19334
|
const replaceUrl = !this.routerOutlet.canGoBack();
|
|
19329
19335
|
// Relative href
|
|
19330
19336
|
if (this._backHref.startsWith('.')) {
|
|
19331
|
-
|
|
19337
|
+
return this.router.navigate([this._backHref], { relativeTo: this.route, replaceUrl });
|
|
19332
19338
|
}
|
|
19333
19339
|
else {
|
|
19334
|
-
|
|
19340
|
+
return this.router.navigateByUrl(this._backHref, { replaceUrl });
|
|
19335
19341
|
}
|
|
19336
19342
|
}
|
|
19337
19343
|
else if (this.routerOutlet.canGoBack()) {
|
|
19338
|
-
|
|
19344
|
+
return this.routerOutlet.pop();
|
|
19339
19345
|
}
|
|
19340
19346
|
else if (this._defaultBackHref) {
|
|
19341
19347
|
// Relative href
|
|
19342
19348
|
if (this._defaultBackHref.startsWith('.')) {
|
|
19343
|
-
|
|
19349
|
+
return this.router.navigate([this._defaultBackHref], { relativeTo: this.route, replaceUrl: true });
|
|
19344
19350
|
}
|
|
19345
19351
|
else {
|
|
19346
|
-
|
|
19352
|
+
return this.router.navigateByUrl(this._defaultBackHref, {
|
|
19347
19353
|
replaceUrl: true
|
|
19348
19354
|
});
|
|
19349
19355
|
}
|
|
19350
19356
|
}
|
|
19351
19357
|
else {
|
|
19352
19358
|
console.error('[toolbar] Cannot go back. Missing attribute \'defaultBackHref\' or \'backHref\'');
|
|
19359
|
+
return false;
|
|
19353
19360
|
}
|
|
19354
19361
|
});
|
|
19355
19362
|
}
|
|
@@ -28860,34 +28867,14 @@ class AppEntityEditor extends AppTabEditor {
|
|
|
28860
28867
|
*/
|
|
28861
28868
|
updateTabAndRoute(data, opts) {
|
|
28862
28869
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28863
|
-
|
|
28870
|
+
const queryParams = Object.assign({}, this.queryParams);
|
|
28864
28871
|
// Open the next tab
|
|
28865
28872
|
this.updateTabIndex(opts && opts.openTabIndex);
|
|
28866
|
-
//
|
|
28867
|
-
|
|
28873
|
+
// Update queryParams
|
|
28874
|
+
queryParams.tab = this.selectedTabIndex;
|
|
28875
|
+
queryParams[this._pathIdAttribute] = isNotNil(data === null || data === void 0 ? void 0 : data.id) ? data.id : 'new';
|
|
28868
28876
|
// Update route location
|
|
28869
|
-
|
|
28870
|
-
const queryParams = Object.assign({}, this.queryParams);
|
|
28871
|
-
queryParams[this._pathIdAttribute] = data.id;
|
|
28872
|
-
if (this.debug)
|
|
28873
|
-
console.debug('[entity-editor] Updating route using params: ', queryParams);
|
|
28874
|
-
yield this.router.navigate(['.'], {
|
|
28875
|
-
relativeTo: this.route,
|
|
28876
|
-
queryParams
|
|
28877
|
-
});
|
|
28878
|
-
}
|
|
28879
|
-
// Move to ../new
|
|
28880
|
-
else {
|
|
28881
|
-
const queryParams = Object.assign({}, this.queryParams);
|
|
28882
|
-
queryParams[this._pathIdAttribute] = 'new';
|
|
28883
|
-
if (this.debug)
|
|
28884
|
-
console.debug('[entity-editor] Updating route to \'../new\' using params: ', queryParams);
|
|
28885
|
-
yield this.router.navigate(['..', 'new'], {
|
|
28886
|
-
relativeTo: this.route,
|
|
28887
|
-
queryParams
|
|
28888
|
-
});
|
|
28889
|
-
}
|
|
28890
|
-
yield this.updateRoute(data, this.queryParams);
|
|
28877
|
+
yield this.updateRoute(data, queryParams);
|
|
28891
28878
|
});
|
|
28892
28879
|
}
|
|
28893
28880
|
/**
|
|
@@ -29244,19 +29231,19 @@ class AppEntityEditor extends AppTabEditor {
|
|
|
29244
29231
|
}
|
|
29245
29232
|
}
|
|
29246
29233
|
updateRoute(data, queryParams) {
|
|
29247
|
-
|
|
29248
|
-
|
|
29249
|
-
|
|
29250
|
-
|
|
29251
|
-
|
|
29252
|
-
|
|
29253
|
-
|
|
29254
|
-
|
|
29255
|
-
|
|
29256
|
-
|
|
29257
|
-
|
|
29258
|
-
|
|
29259
|
-
}
|
|
29234
|
+
const path = this.computePageUrl(isNotNil(data.id) ? data.id : 'new');
|
|
29235
|
+
const commands = (path && typeof path === 'string') ? path.split('/') : path;
|
|
29236
|
+
if (isNotEmptyArray(commands)) {
|
|
29237
|
+
this.queryParams = queryParams || this.queryParams;
|
|
29238
|
+
return this.router.navigate(commands, {
|
|
29239
|
+
replaceUrl: true,
|
|
29240
|
+
queryParams: this.queryParams
|
|
29241
|
+
});
|
|
29242
|
+
}
|
|
29243
|
+
else {
|
|
29244
|
+
console.warn('Skip page route update. Invalid page path: ', path);
|
|
29245
|
+
return Promise.resolve(false);
|
|
29246
|
+
}
|
|
29260
29247
|
}
|
|
29261
29248
|
}
|
|
29262
29249
|
AppEntityEditor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: AppEntityEditor, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
|