@sumaris-net/ngx-components 2.4.12-rc4 → 2.4.12-rc6
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/social/user-event/notification/user-event-notification.list.mjs +12 -17
- package/fesm2015/sumaris-net.ngx-components.mjs +11 -17
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +11 -16
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/social/user-event/notification/user-event-notification.list.d.ts +9 -9
|
@@ -31487,15 +31487,15 @@ class UserEventNotificationList {
|
|
|
31487
31487
|
this.settings = settings;
|
|
31488
31488
|
this.userEventService = userEventService;
|
|
31489
31489
|
this.infiniteScrollThresholdFromToken = infiniteScrollThresholdFromToken;
|
|
31490
|
-
this._subscriptions = new Subscription();
|
|
31491
|
-
this._$pageSize = new BehaviorSubject(20);
|
|
31492
|
-
this.fetchingMore = false;
|
|
31493
|
-
this.$items = new BehaviorSubject(undefined);
|
|
31494
|
-
this.$itemCount = new BehaviorSubject(undefined);
|
|
31495
31490
|
this.debug = false;
|
|
31496
31491
|
this.sortBy = 'creationDate';
|
|
31497
31492
|
this.sortDirection = 'desc';
|
|
31498
31493
|
this.enableInfiniteScroll = true;
|
|
31494
|
+
this.fetchingMore = false;
|
|
31495
|
+
this.$items = new BehaviorSubject(undefined);
|
|
31496
|
+
this.$itemCount = new BehaviorSubject(undefined);
|
|
31497
|
+
this._subscriptions = new Subscription();
|
|
31498
|
+
this._$pageSize = new BehaviorSubject(20);
|
|
31499
31499
|
this.mobile = this.settings?.mobile || false;
|
|
31500
31500
|
this.infiniteScrollThreshold = infiniteScrollThresholdFromToken;
|
|
31501
31501
|
}
|
|
@@ -31605,7 +31605,8 @@ class UserEventNotificationList {
|
|
|
31605
31605
|
this.$itemCount.next(result.total || result.data?.length || 0);
|
|
31606
31606
|
this._fetchMoreFn = result.fetchMore;
|
|
31607
31607
|
// Update the page size, to keep same scroll height, after the next refresh
|
|
31608
|
-
|
|
31608
|
+
// 2023/01/13 LP: No, don't update page size. It doubles at every iteration, so let initial page size
|
|
31609
|
+
// this.pageSize = Math.max(this.pageSize, data.length);
|
|
31609
31610
|
}
|
|
31610
31611
|
catch (err) {
|
|
31611
31612
|
console.error(err);
|
|
@@ -31625,15 +31626,9 @@ class UserEventNotificationList {
|
|
|
31625
31626
|
this._fetchMoreSubscription.unsubscribe();
|
|
31626
31627
|
threshold = threshold || (this.mobile ? '15%' : '2%');
|
|
31627
31628
|
await waitFor(() => !!this.ionContent, { dueTime: 250, timeout: 1000 });
|
|
31628
|
-
|
|
31629
|
-
if (panel) {
|
|
31630
|
-
const child = panel.firstChild;
|
|
31631
|
-
if (child instanceof HTMLSlotElement) {
|
|
31632
|
-
panel = child.assignedElements()?.[0];
|
|
31633
|
-
}
|
|
31634
|
-
}
|
|
31629
|
+
const panel = await this.ionContent.getScrollElement();
|
|
31635
31630
|
// Trigger fetch more, end end scroll reached
|
|
31636
|
-
this._fetchMoreSubscription = this.$items.pipe(debounceTime(250), filter(() => this.canFetchMore
|
|
31631
|
+
this._fetchMoreSubscription = this.$items.pipe(debounceTime(250), filter(() => this.canFetchMore), switchMap(() => fromScrollEndEvent(panel, threshold, 250 /*force to check when no scrollbar - e.g. in large screen*/)))
|
|
31637
31632
|
.subscribe(() => this.fetchMore());
|
|
31638
31633
|
this._subscriptions.add(this._fetchMoreSubscription);
|
|
31639
31634
|
}
|
|
@@ -31674,8 +31669,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
31674
31669
|
type: Input
|
|
31675
31670
|
}], infiniteScrollThreshold: [{
|
|
31676
31671
|
type: Input
|
|
31677
|
-
}], pageSize: [{
|
|
31678
|
-
type: Input
|
|
31679
31672
|
}], readEvent: [{
|
|
31680
31673
|
type: Output
|
|
31681
31674
|
}], readEvents: [{
|
|
@@ -31686,6 +31679,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
31686
31679
|
}], ionItems: [{
|
|
31687
31680
|
type: ViewChildren,
|
|
31688
31681
|
args: [IonItem]
|
|
31682
|
+
}], pageSize: [{
|
|
31683
|
+
type: Input
|
|
31689
31684
|
}] } });
|
|
31690
31685
|
|
|
31691
31686
|
class UserEventNotificationIcon {
|