@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
|
@@ -2748,6 +2748,12 @@ class DateUtils {
|
|
|
2748
2748
|
value[MOMENT_NO_TIME_PROPERTY] = true;
|
|
2749
2749
|
return value;
|
|
2750
2750
|
}
|
|
2751
|
+
static markTime(value) {
|
|
2752
|
+
if (!value)
|
|
2753
|
+
return undefined;
|
|
2754
|
+
delete value[MOMENT_NO_TIME_PROPERTY];
|
|
2755
|
+
return value;
|
|
2756
|
+
}
|
|
2751
2757
|
static isNoTime(value) {
|
|
2752
2758
|
return value?.[MOMENT_NO_TIME_PROPERTY] === true;
|
|
2753
2759
|
}
|
|
@@ -19047,28 +19053,29 @@ class ToolbarComponent {
|
|
|
19047
19053
|
const replaceUrl = !this.routerOutlet.canGoBack();
|
|
19048
19054
|
// Relative href
|
|
19049
19055
|
if (this._backHref.startsWith('.')) {
|
|
19050
|
-
|
|
19056
|
+
return this.router.navigate([this._backHref], { relativeTo: this.route, replaceUrl });
|
|
19051
19057
|
}
|
|
19052
19058
|
else {
|
|
19053
|
-
|
|
19059
|
+
return this.router.navigateByUrl(this._backHref, { replaceUrl });
|
|
19054
19060
|
}
|
|
19055
19061
|
}
|
|
19056
19062
|
else if (this.routerOutlet.canGoBack()) {
|
|
19057
|
-
|
|
19063
|
+
return this.routerOutlet.pop();
|
|
19058
19064
|
}
|
|
19059
19065
|
else if (this._defaultBackHref) {
|
|
19060
19066
|
// Relative href
|
|
19061
19067
|
if (this._defaultBackHref.startsWith('.')) {
|
|
19062
|
-
|
|
19068
|
+
return this.router.navigate([this._defaultBackHref], { relativeTo: this.route, replaceUrl: true });
|
|
19063
19069
|
}
|
|
19064
19070
|
else {
|
|
19065
|
-
|
|
19071
|
+
return this.router.navigateByUrl(this._defaultBackHref, {
|
|
19066
19072
|
replaceUrl: true
|
|
19067
19073
|
});
|
|
19068
19074
|
}
|
|
19069
19075
|
}
|
|
19070
19076
|
else {
|
|
19071
19077
|
console.error('[toolbar] Cannot go back. Missing attribute \'defaultBackHref\' or \'backHref\'');
|
|
19078
|
+
return false;
|
|
19072
19079
|
}
|
|
19073
19080
|
}
|
|
19074
19081
|
tapClose(event) {
|
|
@@ -28304,34 +28311,14 @@ class AppEntityEditor extends AppTabEditor {
|
|
|
28304
28311
|
* Update the route location, and open the next tab
|
|
28305
28312
|
*/
|
|
28306
28313
|
async updateTabAndRoute(data, opts) {
|
|
28307
|
-
|
|
28314
|
+
const queryParams = { ...this.queryParams };
|
|
28308
28315
|
// Open the next tab
|
|
28309
28316
|
this.updateTabIndex(opts && opts.openTabIndex);
|
|
28310
|
-
//
|
|
28311
|
-
|
|
28317
|
+
// Update queryParams
|
|
28318
|
+
queryParams.tab = this.selectedTabIndex;
|
|
28319
|
+
queryParams[this._pathIdAttribute] = isNotNil(data?.id) ? data.id : 'new';
|
|
28312
28320
|
// Update route location
|
|
28313
|
-
|
|
28314
|
-
const queryParams = { ...this.queryParams };
|
|
28315
|
-
queryParams[this._pathIdAttribute] = data.id;
|
|
28316
|
-
if (this.debug)
|
|
28317
|
-
console.debug('[entity-editor] Updating route using params: ', queryParams);
|
|
28318
|
-
await this.router.navigate(['.'], {
|
|
28319
|
-
relativeTo: this.route,
|
|
28320
|
-
queryParams
|
|
28321
|
-
});
|
|
28322
|
-
}
|
|
28323
|
-
// Move to ../new
|
|
28324
|
-
else {
|
|
28325
|
-
const queryParams = { ...this.queryParams };
|
|
28326
|
-
queryParams[this._pathIdAttribute] = 'new';
|
|
28327
|
-
if (this.debug)
|
|
28328
|
-
console.debug('[entity-editor] Updating route to \'../new\' using params: ', queryParams);
|
|
28329
|
-
await this.router.navigate(['..', 'new'], {
|
|
28330
|
-
relativeTo: this.route,
|
|
28331
|
-
queryParams
|
|
28332
|
-
});
|
|
28333
|
-
}
|
|
28334
|
-
await this.updateRoute(data, this.queryParams);
|
|
28321
|
+
await this.updateRoute(data, queryParams);
|
|
28335
28322
|
}
|
|
28336
28323
|
/**
|
|
28337
28324
|
* Update the route location, and open the next tab
|
|
@@ -28653,17 +28640,19 @@ class AppEntityEditor extends AppTabEditor {
|
|
|
28653
28640
|
this.markForCheck();
|
|
28654
28641
|
}
|
|
28655
28642
|
}
|
|
28656
|
-
|
|
28643
|
+
updateRoute(data, queryParams) {
|
|
28657
28644
|
const path = this.computePageUrl(isNotNil(data.id) ? data.id : 'new');
|
|
28658
28645
|
const commands = (path && typeof path === 'string') ? path.split('/') : path;
|
|
28659
28646
|
if (isNotEmptyArray(commands)) {
|
|
28660
|
-
|
|
28647
|
+
this.queryParams = queryParams || this.queryParams;
|
|
28648
|
+
return this.router.navigate(commands, {
|
|
28661
28649
|
replaceUrl: true,
|
|
28662
28650
|
queryParams: this.queryParams
|
|
28663
28651
|
});
|
|
28664
28652
|
}
|
|
28665
28653
|
else {
|
|
28666
28654
|
console.warn('Skip page route update. Invalid page path: ', path);
|
|
28655
|
+
return Promise.resolve(false);
|
|
28667
28656
|
}
|
|
28668
28657
|
}
|
|
28669
28658
|
}
|