@sumaris-net/ngx-components 2.2.4 → 2.2.6-rc1
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 +7 -0
- package/esm2020/src/app/core/menu/menu.component.mjs +14 -7
- package/esm2020/src/app/shared/toolbar/toolbar.mjs +8 -4
- package/fesm2015/sumaris-net.ngx-components.mjs +19 -9
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +18 -8
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/shared/toolbar/toolbar.d.ts +1 -0
|
@@ -18797,7 +18797,7 @@ class ToolbarComponent {
|
|
|
18797
18797
|
// Listen progress bar service mode
|
|
18798
18798
|
if (progressBarService) {
|
|
18799
18799
|
this.progressBarMode$ = progressBarService.onProgressChanged
|
|
18800
|
-
.pipe(startWith('none'), tap((mode) => '[toolbar] Updating progressBarMode: ' + mode), debounceTime(100), // wait 100ms, to group changes
|
|
18800
|
+
.pipe(startWith('none'), tap((mode) => console.debug('[toolbar] Updating progressBarMode: ' + mode)), debounceTime(100), // wait 100ms, to group changes
|
|
18801
18801
|
distinctUntilChanged());
|
|
18802
18802
|
}
|
|
18803
18803
|
}
|
|
@@ -18843,8 +18843,9 @@ class ToolbarComponent {
|
|
|
18843
18843
|
async toggleSearchBar() {
|
|
18844
18844
|
this.showSearchBar = !this.showSearchBar;
|
|
18845
18845
|
if (this.showSearchBar && this.searchbar) {
|
|
18846
|
-
setTimeout(
|
|
18847
|
-
|
|
18846
|
+
setTimeout(() => {
|
|
18847
|
+
this.searchbar.setFocus();
|
|
18848
|
+
this.markForCheck();
|
|
18848
18849
|
}, 300);
|
|
18849
18850
|
}
|
|
18850
18851
|
}
|
|
@@ -18937,6 +18938,9 @@ class ToolbarComponent {
|
|
|
18937
18938
|
ionSearchBarChanged(event) {
|
|
18938
18939
|
this.onSearch.emit(event);
|
|
18939
18940
|
}
|
|
18941
|
+
markForCheck() {
|
|
18942
|
+
this.cd.markForCheck();
|
|
18943
|
+
}
|
|
18940
18944
|
}
|
|
18941
18945
|
ToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ToolbarComponent, deps: [{ token: i1$5.ActivatedRoute }, { token: i1$5.Router }, { token: i2.IonRouterOutlet }, { token: i0.ChangeDetectorRef }, { token: ProgressBarService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
18942
18946
|
ToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: ToolbarComponent, selector: "app-toolbar", inputs: { title: "title", color: "color", class: "class", backHref: "backHref", defaultBackHref: "defaultBackHref", hasValidate: "hasValidate", hasClose: "hasClose", hasSearch: "hasSearch", canGoBack: "canGoBack", canShowMenu: "canShowMenu" }, outputs: { onValidate: "onValidate", onClose: "onClose", onValidateAndClose: "onValidateAndClose", onBackClick: "onBackClick", onSearch: "onSearch" }, providers: [
|
|
@@ -21374,11 +21378,17 @@ class MenuComponent {
|
|
|
21374
21378
|
.pipe(distinctUntilChanged())
|
|
21375
21379
|
.subscribe((value) => value ? this.open() : this.close());
|
|
21376
21380
|
// Update component when refresh is need (=login events or config changed)
|
|
21377
|
-
this._subscription.add(merge(merge(this.accountService.onLogin
|
|
21381
|
+
this._subscription.add(merge(merge(this.accountService.onLogin
|
|
21382
|
+
.pipe(
|
|
21383
|
+
// DEBUG
|
|
21384
|
+
//tap(account => console.debug('[menu] Receiving login event', account)),
|
|
21385
|
+
distinctUntilChanged((a1, a2) => !DateUtils.isSame(a1?.updateDate, a2?.updateDate))), this.configService.config
|
|
21386
|
+
.pipe(tap(config => this._config = config)))
|
|
21378
21387
|
.pipe(
|
|
21388
|
+
// Add debounce to avoid to trigger twice, at startup
|
|
21389
|
+
debounceTime(250),
|
|
21379
21390
|
// Wait account service ready (can be restarted)
|
|
21380
|
-
mergeMap(() => this.accountService.ready()), map(() => this.accountService.isLogin())
|
|
21381
|
-
.pipe(tap(config => this._config = config), mergeMap(() => this.accountService.ready()), map(() => this.accountService.isLogin())))
|
|
21391
|
+
mergeMap(() => this.accountService.ready()), map(() => this.accountService.isLogin())), this.accountService.onLogout)
|
|
21382
21392
|
.subscribe(login => {
|
|
21383
21393
|
if (login) {
|
|
21384
21394
|
this.onLogin(this.accountService.account);
|
|
@@ -21389,7 +21399,7 @@ class MenuComponent {
|
|
|
21389
21399
|
}));
|
|
21390
21400
|
}
|
|
21391
21401
|
async onLogin(account) {
|
|
21392
|
-
console.info('[menu] Update (login)');
|
|
21402
|
+
console.info('[menu] Update (on login)');
|
|
21393
21403
|
this.accountAvatar = account.avatar;
|
|
21394
21404
|
this.accountName = account.displayName;
|
|
21395
21405
|
this.accountEmail = account.email;
|
|
@@ -21405,7 +21415,7 @@ class MenuComponent {
|
|
|
21405
21415
|
console.debug('[menu] Logout');
|
|
21406
21416
|
}
|
|
21407
21417
|
else {
|
|
21408
|
-
console.debug('[menu] Update (logout)');
|
|
21418
|
+
console.debug('[menu] Update (on logout)');
|
|
21409
21419
|
}
|
|
21410
21420
|
this.isLogin = false;
|
|
21411
21421
|
this.accountAvatar = null;
|