@sumaris-net/ngx-components 2.4.23-rc1 → 2.4.23-rc3
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/esm2020/src/app/core/form/entity/entity-editor.class.mjs +16 -7
- package/esm2020/src/app/shared/toolbar/toolbar.mjs +7 -6
- package/fesm2015/sumaris-net.ngx-components.mjs +31 -19
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +21 -11
- 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 +2 -0
- package/src/app/shared/toolbar/toolbar.d.ts +2 -2
|
@@ -60,7 +60,7 @@ import { timer, merge, fromEvent, BehaviorSubject, Subscription, Subject, isObse
|
|
|
60
60
|
import { filter, map, takeUntil, first, switchMap, tap, debounceTime, startWith, distinctUntilChanged, mergeMap, catchError, throttleTime, skip, bufferWhen, mapTo, take } from 'rxjs/operators';
|
|
61
61
|
import { trigger, transition, style, animate, state } from '@angular/animations';
|
|
62
62
|
import * as i1 from '@ionic/angular';
|
|
63
|
-
import { IonicModule, Platform, ToastController, IonicSafeString, createAnimation, IonicRouteStrategy, ModalController, AlertController, IonContent, IonItem, IonModal, IonInfiniteScroll } from '@ionic/angular';
|
|
63
|
+
import { IonicModule, Platform, ToastController, IonicSafeString, createAnimation, IonicRouteStrategy, ModalController, AlertController, IonContent, IonRouterOutlet, IonItem, IonModal, IonInfiniteScroll } from '@ionic/angular';
|
|
64
64
|
import { Capacitor } from '@capacitor/core';
|
|
65
65
|
import { Keyboard } from '@capacitor/keyboard';
|
|
66
66
|
import * as i1$2 from '@ngx-translate/core';
|
|
@@ -19053,28 +19053,29 @@ class ToolbarComponent {
|
|
|
19053
19053
|
const replaceUrl = !this.routerOutlet.canGoBack();
|
|
19054
19054
|
// Relative href
|
|
19055
19055
|
if (this._backHref.startsWith('.')) {
|
|
19056
|
-
|
|
19056
|
+
return this.router.navigate([this._backHref], { relativeTo: this.route, replaceUrl });
|
|
19057
19057
|
}
|
|
19058
19058
|
else {
|
|
19059
|
-
|
|
19059
|
+
return this.router.navigateByUrl(this._backHref, { replaceUrl });
|
|
19060
19060
|
}
|
|
19061
19061
|
}
|
|
19062
19062
|
else if (this.routerOutlet.canGoBack()) {
|
|
19063
|
-
|
|
19063
|
+
return this.routerOutlet.pop();
|
|
19064
19064
|
}
|
|
19065
19065
|
else if (this._defaultBackHref) {
|
|
19066
19066
|
// Relative href
|
|
19067
19067
|
if (this._defaultBackHref.startsWith('.')) {
|
|
19068
|
-
|
|
19068
|
+
return this.router.navigate([this._defaultBackHref], { relativeTo: this.route, replaceUrl: true });
|
|
19069
19069
|
}
|
|
19070
19070
|
else {
|
|
19071
|
-
|
|
19071
|
+
return this.router.navigateByUrl(this._defaultBackHref, {
|
|
19072
19072
|
replaceUrl: true
|
|
19073
19073
|
});
|
|
19074
19074
|
}
|
|
19075
19075
|
}
|
|
19076
19076
|
else {
|
|
19077
19077
|
console.error('[toolbar] Cannot go back. Missing attribute \'defaultBackHref\' or \'backHref\'');
|
|
19078
|
+
return false;
|
|
19078
19079
|
}
|
|
19079
19080
|
}
|
|
19080
19081
|
tapClose(event) {
|
|
@@ -28075,6 +28076,7 @@ class AppEntityEditor extends AppTabEditor {
|
|
|
28075
28076
|
};
|
|
28076
28077
|
this.settings = injector.get(LocalSettingsService);
|
|
28077
28078
|
this.errorTranslator = injector.get(FormErrorTranslator);
|
|
28079
|
+
this.routerOutlet = injector.get(IonRouterOutlet);
|
|
28078
28080
|
this.cd = injector.get(ChangeDetectorRef);
|
|
28079
28081
|
this.dateFormat = injector.get(DateFormatService);
|
|
28080
28082
|
this.toastController = injector.get(ToastController);
|
|
@@ -28639,15 +28641,23 @@ class AppEntityEditor extends AppTabEditor {
|
|
|
28639
28641
|
this.markForCheck();
|
|
28640
28642
|
}
|
|
28641
28643
|
}
|
|
28642
|
-
updateRoute(data, queryParams) {
|
|
28644
|
+
async updateRoute(data, queryParams) {
|
|
28643
28645
|
const path = this.computePageUrl(isNotNil(data.id) ? data.id : 'new');
|
|
28644
28646
|
const commands = (path && typeof path === 'string') ? path.split('/') : path;
|
|
28645
28647
|
if (isNotEmptyArray(commands)) {
|
|
28646
28648
|
this.queryParams = queryParams || this.queryParams;
|
|
28647
|
-
|
|
28648
|
-
|
|
28649
|
-
|
|
28650
|
-
|
|
28649
|
+
// Disabling router animation
|
|
28650
|
+
this.routerOutlet.animated = false;
|
|
28651
|
+
try {
|
|
28652
|
+
return await this.router.navigate(commands, {
|
|
28653
|
+
replaceUrl: true,
|
|
28654
|
+
queryParams: this.queryParams
|
|
28655
|
+
});
|
|
28656
|
+
}
|
|
28657
|
+
finally {
|
|
28658
|
+
// Re enabling router animation
|
|
28659
|
+
this.routerOutlet.animated = true;
|
|
28660
|
+
}
|
|
28651
28661
|
}
|
|
28652
28662
|
else {
|
|
28653
28663
|
console.warn('Skip page route update. Invalid page path: ', path);
|