@quadrel-enterprise-ui/framework 20.36.0 → 20.36.1
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.
|
@@ -24735,6 +24735,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
24735
24735
|
*/
|
|
24736
24736
|
const QD_TABLE_DATA_RESOLVER_TOKEN = new InjectionToken('QD_TABLE_DATA_RESOLVER_TOKEN');
|
|
24737
24737
|
|
|
24738
|
+
/**
|
|
24739
|
+
* Resolves table data through the consumer's `QdTableDataResolver` and writes the result into the table store.
|
|
24740
|
+
*
|
|
24741
|
+
* #### Internal invariant
|
|
24742
|
+
*
|
|
24743
|
+
* Both streams wait for resolution criteria from the store and only resolve once criteria arrive.
|
|
24744
|
+
* The store yields criteria only while `pageIndex` and `pageSize` are set for this table. A resolver
|
|
24745
|
+
* result without `size` therefore stores `pageSize: undefined` and silences every later refresh,
|
|
24746
|
+
* because the stream keeps waiting for criteria that never come again. `handleResolverResult`
|
|
24747
|
+
* guards against that, so a broken result surfaces as an error instead of a table that stops
|
|
24748
|
+
* reacting without a trace.
|
|
24749
|
+
*/
|
|
24738
24750
|
class QdTableResolverService {
|
|
24739
24751
|
tableDataResolver = inject(QD_TABLE_DATA_RESOLVER_TOKEN, { optional: true });
|
|
24740
24752
|
tableStoreService = inject(QdTableStoreService);
|
|
@@ -24817,6 +24829,9 @@ class QdTableResolverService {
|
|
|
24817
24829
|
if (!result?.data)
|
|
24818
24830
|
throw new Error('Quadrel Framework | QdTable - Resolver result has no data.');
|
|
24819
24831
|
const { page, data, size, totalElements } = result;
|
|
24832
|
+
if (this._hasPagination && size === undefined)
|
|
24833
|
+
throw new Error('Quadrel Framework | QdTable - The QdTableDataResolver returned a result without "size". ' +
|
|
24834
|
+
'A paginated table stores it to resolve the next page and stops resolving without it.');
|
|
24820
24835
|
if (this.isOnEmptyPageWithRemainingEntries(result)) {
|
|
24821
24836
|
const lastValidPage = Math.ceil(totalElements / size) - 1;
|
|
24822
24837
|
this._isNavigatingToValidPage = true;
|