@internetarchive/collection-browser 2.7.3 → 2.7.5-alpha.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.
- package/dist/src/collection-browser.d.ts +6 -0
- package/dist/src/collection-browser.js +18 -3
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js +9 -8
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js +3 -2
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source.js +6 -8
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/package.json +1 -1
- package/src/collection-browser.ts +24 -5
- package/src/collection-facets/smart-facets/smart-facet-bar.ts +16 -13
- package/src/collection-facets/smart-facets/smart-facet-dropdown.ts +6 -6
- package/src/data-source/collection-browser-data-source.ts +13 -10
|
@@ -434,6 +434,12 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
434
434
|
connectedCallback(): void;
|
|
435
435
|
disconnectedCallback(): void;
|
|
436
436
|
handleResize(entry: ResizeObserverEntry): void;
|
|
437
|
+
/**
|
|
438
|
+
* Ensures that if we have new results from the data source that are not yet
|
|
439
|
+
* displayed in the infinite scroller, that they are immediately reflected
|
|
440
|
+
* in the tile count.
|
|
441
|
+
*/
|
|
442
|
+
private ensureAvailableTilesDisplayed;
|
|
437
443
|
/**
|
|
438
444
|
* Updates the data source with the current state of facet readiness for loading,
|
|
439
445
|
* so that they will begin to load in at the appropriate time according to the
|
|
@@ -1137,6 +1137,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1137
1137
|
this.disconnectResizeObserver(oldObserver);
|
|
1138
1138
|
this.setupResizeObserver();
|
|
1139
1139
|
}
|
|
1140
|
+
this.ensureAvailableTilesDisplayed();
|
|
1140
1141
|
}
|
|
1141
1142
|
connectedCallback() {
|
|
1142
1143
|
var _a;
|
|
@@ -1170,6 +1171,19 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1170
1171
|
// Ensure the facet sidebar remains sized correctly
|
|
1171
1172
|
this.updateLeftColumnHeight();
|
|
1172
1173
|
}
|
|
1174
|
+
/**
|
|
1175
|
+
* Ensures that if we have new results from the data source that are not yet
|
|
1176
|
+
* displayed in the infinite scroller, that they are immediately reflected
|
|
1177
|
+
* in the tile count.
|
|
1178
|
+
*/
|
|
1179
|
+
ensureAvailableTilesDisplayed() {
|
|
1180
|
+
if (this.infiniteScroller &&
|
|
1181
|
+
this.infiniteScroller.itemCount < this.dataSource.size) {
|
|
1182
|
+
this.setTileCount(this.dataSource.endOfDataReached
|
|
1183
|
+
? this.dataSource.size
|
|
1184
|
+
: this.estimatedTileCount);
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1173
1187
|
/**
|
|
1174
1188
|
* Updates the data source with the current state of facet readiness for loading,
|
|
1175
1189
|
* so that they will begin to load in at the appropriate time according to the
|
|
@@ -1332,12 +1346,13 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1332
1346
|
var _a;
|
|
1333
1347
|
// only reset if the query has actually changed
|
|
1334
1348
|
if (!this.searchService ||
|
|
1335
|
-
this.dataSource.pageFetchQueryKey === this.previousQueryKey)
|
|
1349
|
+
this.dataSource.pageFetchQueryKey === this.previousQueryKey) {
|
|
1336
1350
|
return;
|
|
1351
|
+
}
|
|
1337
1352
|
// If the new state prevents us from updating the search results, don't reset
|
|
1338
|
-
if (!this.dataSource.canPerformSearch
|
|
1339
|
-
!(this.clearResultsOnEmptyQuery && this.baseQuery === ''))
|
|
1353
|
+
if (this.baseQuery && !this.dataSource.canPerformSearch) {
|
|
1340
1354
|
return;
|
|
1355
|
+
}
|
|
1341
1356
|
this.previousQueryKey = this.dataSource.pageFetchQueryKey;
|
|
1342
1357
|
this.totalResults = undefined;
|
|
1343
1358
|
this.pagesToRender =
|