ngx-eiffage-material 0.0.47 → 0.0.48
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.
|
@@ -3018,19 +3018,34 @@ class NgxPaginatedSelectBottomSheetComponent {
|
|
|
3018
3018
|
}, ...(ngDevMode ? [{ debugName: "someSelected" }] : []));
|
|
3019
3019
|
// ─── Accumulate pages ──────────────────────────────────────────────────────
|
|
3020
3020
|
/**
|
|
3021
|
-
*
|
|
3021
|
+
* Reactively depends ONLY on `resource.value()`. The filter snapshot is read
|
|
3022
|
+
* via `untracked` so external filter changes (parent-driven, e.g. an extra
|
|
3023
|
+
* filters panel) do NOT create a reactive dependency here — that would make
|
|
3024
|
+
* the effect re-run on scroll page increments with stale resource data,
|
|
3025
|
+
* duplicating items and breaking `onScroll` (see original limitation).
|
|
3022
3026
|
*
|
|
3023
|
-
*
|
|
3024
|
-
*
|
|
3025
|
-
*
|
|
3026
|
-
*
|
|
3027
|
-
*
|
|
3028
|
-
*
|
|
3029
|
-
*
|
|
3027
|
+
* Reset logic:
|
|
3028
|
+
* - Fingerprint the current filter identity (everything except `pageNumber`).
|
|
3029
|
+
* - If the fingerprint changed since the previous fetch, this fetch belongs
|
|
3030
|
+
* to a different filter set → replace the accumulated array.
|
|
3031
|
+
* - If only `pageNumber` moved, this is a scroll-load-more → append.
|
|
3032
|
+
*
|
|
3033
|
+
* This is what allows callers to mutate `data.filters` from outside (extra
|
|
3034
|
+
* filter selects, checkboxes, etc.) and have the list refresh cleanly
|
|
3035
|
+
* without the previous page's items lingering.
|
|
3030
3036
|
*/
|
|
3037
|
+
_lastFilterFingerprint = null;
|
|
3031
3038
|
_accumEffect = effect(() => {
|
|
3032
3039
|
const value = this.resource.value();
|
|
3033
|
-
|
|
3040
|
+
const { pageNumber: _pn, ...rest } = untracked(() => this.data.filters());
|
|
3041
|
+
const fingerprint = JSON.stringify(rest);
|
|
3042
|
+
if (fingerprint !== this._lastFilterFingerprint) {
|
|
3043
|
+
this._lastFilterFingerprint = fingerprint;
|
|
3044
|
+
this.accumulatedItems.set([...value.items]);
|
|
3045
|
+
}
|
|
3046
|
+
else {
|
|
3047
|
+
this.accumulatedItems.update(acc => [...acc, ...value.items]);
|
|
3048
|
+
}
|
|
3034
3049
|
}, ...(ngDevMode ? [{ debugName: "_accumEffect" }] : []));
|
|
3035
3050
|
constructor() {
|
|
3036
3051
|
// Reset to page 1 when the sheet opens
|