@ascentgl/ads-ui 21.97.0 → 21.98.0
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.
|
@@ -8461,6 +8461,10 @@ class AdsTableComponent {
|
|
|
8461
8461
|
this.LIST_RENDER_CHUNK_SIZE = 10;
|
|
8462
8462
|
/** @ignore - Handle for the pending rAF that fills the first batch, so it can be cancelled on destroy or re-toggle */
|
|
8463
8463
|
this._listRenderRafId = null;
|
|
8464
|
+
/** @ignore - Target rendered count for the current progressive render pass */
|
|
8465
|
+
this._listRenderTarget = 0;
|
|
8466
|
+
/** @ignore - Whether a progressive render pass is currently in progress */
|
|
8467
|
+
this._listRenderInProgress = false;
|
|
8464
8468
|
/** @ignore - Wrapper for getFilteredColumnValues that can be passed to filter menu */
|
|
8465
8469
|
this.getFilterOptionsForFieldFn = (field) => {
|
|
8466
8470
|
return this.getFilteredColumnValues(field);
|
|
@@ -8743,8 +8747,10 @@ class AdsTableComponent {
|
|
|
8743
8747
|
// Find the scrollable container (the .list-view-container div)
|
|
8744
8748
|
const root = sentinelEl.closest('.list-view-container');
|
|
8745
8749
|
this.listSentinelObserver = new IntersectionObserver((entries) => {
|
|
8746
|
-
if (entries[0]?.isIntersecting && this.hasMoreListRows()) {
|
|
8747
|
-
|
|
8750
|
+
if (entries[0]?.isIntersecting && this.hasMoreListRows() && !this._listRenderInProgress) {
|
|
8751
|
+
const total = this.listRowDataCache().length;
|
|
8752
|
+
const target = Math.min(this.renderedListCount() + this.listBatchSize, total);
|
|
8753
|
+
this.scheduleProgressiveRender(target);
|
|
8748
8754
|
}
|
|
8749
8755
|
}, { root: root, rootMargin: '200px' });
|
|
8750
8756
|
this.listSentinelObserver.observe(sentinelEl);
|
|
@@ -9015,7 +9021,8 @@ class AdsTableComponent {
|
|
|
9015
9021
|
const initialCount = Math.min(this.INITIAL_LIST_RENDER_COUNT, total);
|
|
9016
9022
|
this.renderedListCount.set(initialCount);
|
|
9017
9023
|
// Schedule chunked rendering for the remaining items up to listBatchSize
|
|
9018
|
-
this.
|
|
9024
|
+
const target = Math.min(this.listBatchSize, total);
|
|
9025
|
+
this.scheduleProgressiveRender(target);
|
|
9019
9026
|
}
|
|
9020
9027
|
else {
|
|
9021
9028
|
this.listSentinelObserver?.disconnect();
|
|
@@ -9036,18 +9043,30 @@ class AdsTableComponent {
|
|
|
9036
9043
|
cancelAnimationFrame(this._listRenderRafId);
|
|
9037
9044
|
this._listRenderRafId = null;
|
|
9038
9045
|
}
|
|
9046
|
+
this._listRenderInProgress = false;
|
|
9047
|
+
this._listRenderTarget = 0;
|
|
9048
|
+
}
|
|
9049
|
+
/** @ignore - Progressively render list items in small chunks across animation frames up to the given target */
|
|
9050
|
+
scheduleProgressiveRender(target) {
|
|
9051
|
+
this._listRenderTarget = target;
|
|
9052
|
+
this._listRenderInProgress = true;
|
|
9053
|
+
this.scheduleNextListRenderChunk();
|
|
9039
9054
|
}
|
|
9040
9055
|
/** @ignore - Progressively render list items in small chunks across animation frames */
|
|
9041
9056
|
scheduleNextListRenderChunk() {
|
|
9042
|
-
const
|
|
9057
|
+
const target = this._listRenderTarget;
|
|
9043
9058
|
const current = this.renderedListCount();
|
|
9044
|
-
if (current >=
|
|
9059
|
+
if (current >= target || !this.isListView()) {
|
|
9060
|
+
this._listRenderInProgress = false;
|
|
9045
9061
|
return;
|
|
9062
|
+
}
|
|
9046
9063
|
this._listRenderRafId = requestAnimationFrame(() => {
|
|
9047
9064
|
this._listRenderRafId = null;
|
|
9048
|
-
if (!this.isListView())
|
|
9065
|
+
if (!this.isListView()) {
|
|
9066
|
+
this._listRenderInProgress = false;
|
|
9049
9067
|
return;
|
|
9050
|
-
|
|
9068
|
+
}
|
|
9069
|
+
const nextCount = Math.min(current + this.LIST_RENDER_CHUNK_SIZE, target);
|
|
9051
9070
|
this.renderedListCount.set(nextCount);
|
|
9052
9071
|
this.cdr.detectChanges();
|
|
9053
9072
|
// Continue rendering remaining chunks
|
|
@@ -9056,8 +9075,13 @@ class AdsTableComponent {
|
|
|
9056
9075
|
}
|
|
9057
9076
|
/** @ignore - Refresh the list view data cache and reset rendered count */
|
|
9058
9077
|
refreshListView() {
|
|
9078
|
+
this.cancelListRenderRaf();
|
|
9059
9079
|
this.listRowDataCache.set(this.getFilteredRowData());
|
|
9060
|
-
|
|
9080
|
+
const total = this.listRowDataCache().length;
|
|
9081
|
+
const initialCount = Math.min(this.INITIAL_LIST_RENDER_COUNT, total);
|
|
9082
|
+
this.renderedListCount.set(initialCount);
|
|
9083
|
+
const target = Math.min(this.listBatchSize, total);
|
|
9084
|
+
this.scheduleProgressiveRender(target);
|
|
9061
9085
|
}
|
|
9062
9086
|
/** @ignore - Get filtered and sorted row data for list view */
|
|
9063
9087
|
getFilteredRowData() {
|