@internetarchive/collection-browser 1.14.17-alpha.4 → 1.14.17-alpha.41
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/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/src/collection-browser.d.ts +6 -13
- package/dist/src/collection-browser.js +56 -30
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source-interface.d.ts +194 -0
- package/dist/src/data-source/collection-browser-data-source-interface.js +2 -0
- package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -0
- package/dist/src/data-source/collection-browser-data-source.d.ts +62 -174
- package/dist/src/data-source/collection-browser-data-source.js +185 -64
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/data-source/collection-browser-query-state.d.ts +42 -0
- package/dist/src/data-source/collection-browser-query-state.js +2 -0
- package/dist/src/data-source/collection-browser-query-state.js.map +1 -0
- package/dist/src/data-source/models.d.ts +1 -39
- package/dist/src/data-source/models.js.map +1 -1
- package/dist/src/models.d.ts +3 -2
- package/dist/src/models.js +24 -22
- package/dist/src/models.js.map +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.js +1 -0
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.d.ts +1 -0
- package/dist/src/tiles/grid/item-tile.js +28 -1
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/grid/tile-stats.js +13 -8
- package/dist/src/tiles/grid/tile-stats.js.map +1 -1
- package/dist/src/tiles/item-image.d.ts +3 -0
- package/dist/src/tiles/item-image.js +30 -2
- package/dist/src/tiles/item-image.js.map +1 -1
- package/dist/src/tiles/list/tile-list.d.ts +1 -0
- package/dist/src/tiles/list/tile-list.js +30 -1
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.js +3 -2
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/src/tiles/tile-display-value-provider.d.ts +5 -1
- package/dist/src/tiles/tile-display-value-provider.js +15 -1
- package/dist/src/tiles/tile-display-value-provider.js.map +1 -1
- package/dist/test/collection-browser.test.js +2 -6
- package/dist/test/collection-browser.test.js.map +1 -1
- package/index.ts +3 -5
- package/package.json +2 -2
- package/src/collection-browser.ts +70 -49
- package/src/data-source/collection-browser-data-source-interface.ts +245 -0
- package/src/data-source/collection-browser-data-source.ts +237 -281
- package/src/data-source/collection-browser-query-state.ts +53 -0
- package/src/data-source/models.ts +0 -47
- package/src/models.ts +7 -3
- package/src/sort-filter-bar/sort-filter-bar.ts +1 -0
- package/src/tiles/grid/item-tile.ts +36 -1
- package/src/tiles/grid/tile-stats.ts +12 -7
- package/src/tiles/item-image.ts +28 -0
- package/src/tiles/list/tile-list.ts +37 -1
- package/src/tiles/tile-dispatcher.ts +2 -1
- package/src/tiles/tile-display-value-provider.ts +19 -1
- package/test/collection-browser.test.ts +2 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { CollectionBrowser } from './src/collection-browser';
|
|
2
|
-
export { CollectionBrowserDataSource
|
|
3
|
-
export {
|
|
2
|
+
export { CollectionBrowserDataSource } from './src/data-source/collection-browser-data-source';
|
|
3
|
+
export { CollectionBrowserDataSourceInterface } from './src/data-source/collection-browser-data-source-interface';
|
|
4
|
+
export { CollectionBrowserQueryState } from './src/data-source/collection-browser-query-state';
|
|
4
5
|
export { SortFilterBar } from './src/sort-filter-bar/sort-filter-bar';
|
|
5
6
|
export { CollectionDisplayMode, SortField, TileModel } from './src/models';
|
|
6
7
|
export { CollectionBrowserLoadingTile } from './src/tiles/collection-browser-loading-tile';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { CollectionBrowser } from './src/collection-browser';
|
|
2
|
-
export { CollectionBrowserDataSource
|
|
3
|
-
export {} from './src/data-source/
|
|
2
|
+
export { CollectionBrowserDataSource } from './src/data-source/collection-browser-data-source';
|
|
3
|
+
export {} from './src/data-source/collection-browser-data-source-interface';
|
|
4
|
+
export {} from './src/data-source/collection-browser-query-state';
|
|
4
5
|
export { SortFilterBar } from './src/sort-filter-bar/sort-filter-bar';
|
|
5
6
|
export { SortField, TileModel } from './src/models';
|
|
6
7
|
export { CollectionBrowserLoadingTile } from './src/tiles/collection-browser-loading-tile';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAC;AAC/F,OAAO,EAAwC,MAAM,4DAA4D,CAAC;AAClH,OAAO,EAA+B,MAAM,kDAAkD,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAyB,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC","sourcesContent":["export { CollectionBrowser } from './src/collection-browser';\nexport { CollectionBrowserDataSource } from './src/data-source/collection-browser-data-source';\nexport { CollectionBrowserDataSourceInterface } from './src/data-source/collection-browser-data-source-interface';\nexport { CollectionBrowserQueryState } from './src/data-source/collection-browser-query-state';\nexport { SortFilterBar } from './src/sort-filter-bar/sort-filter-bar';\nexport { CollectionDisplayMode, SortField, TileModel } from './src/models';\nexport { CollectionBrowserLoadingTile } from './src/tiles/collection-browser-loading-tile';\nexport { CollectionTile } from './src/tiles/grid/collection-tile';\nexport { AccountTile } from './src/tiles/grid/account-tile';\nexport { ItemTile } from './src/tiles/grid/item-tile';\nexport { TileList } from './src/tiles/list/tile-list';\nexport { TileListCompact } from './src/tiles/list/tile-list-compact';\n"]}
|
|
@@ -14,9 +14,9 @@ import './collection-facets';
|
|
|
14
14
|
import './circular-activity-indicator';
|
|
15
15
|
import { SelectedFacets, SortField, CollectionBrowserContext, TileModel, CollectionDisplayMode, FacetEventDetails } from './models';
|
|
16
16
|
import { RestorationStateHandlerInterface } from './restoration-state-handler';
|
|
17
|
-
import {
|
|
18
|
-
import type { CollectionBrowserSearchInterface } from './data-source/models';
|
|
17
|
+
import type { CollectionBrowserQueryState, CollectionBrowserSearchInterface } from './data-source/collection-browser-query-state';
|
|
19
18
|
import './empty-placeholder';
|
|
19
|
+
import type { CollectionBrowserDataSourceInterface } from './data-source/collection-browser-data-source-interface';
|
|
20
20
|
export declare class CollectionBrowser extends LitElement implements InfiniteScrollerCellProviderInterface, SharedResizeObserverResizeHandlerInterface, CollectionBrowserSearchInterface {
|
|
21
21
|
baseNavigationUrl?: string;
|
|
22
22
|
baseImageUrl: string;
|
|
@@ -42,6 +42,7 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
42
42
|
suppressResultCount: boolean;
|
|
43
43
|
suppressURLQuery: boolean;
|
|
44
44
|
suppressFacets: boolean;
|
|
45
|
+
suppressSortBar: boolean;
|
|
45
46
|
clearResultsOnEmptyQuery: boolean;
|
|
46
47
|
collectionPagePath: string;
|
|
47
48
|
/** describes where this component is being used */
|
|
@@ -59,7 +60,6 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
59
60
|
*/
|
|
60
61
|
isManageView: boolean;
|
|
61
62
|
isLoansTab: boolean;
|
|
62
|
-
queryErrorMessage?: string;
|
|
63
63
|
/**
|
|
64
64
|
* The results per page so we can paginate.
|
|
65
65
|
*
|
|
@@ -109,6 +109,7 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
109
109
|
private leftColIntersectionObserver?;
|
|
110
110
|
private facetsIntersectionObserver?;
|
|
111
111
|
private placeholderCellTemplate;
|
|
112
|
+
constructor();
|
|
112
113
|
private tileModelAtCellIndex;
|
|
113
114
|
private get estimatedTileCount();
|
|
114
115
|
/**
|
|
@@ -277,6 +278,7 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
277
278
|
* Emits an event indicating a change in whether the manage mode is shown.
|
|
278
279
|
*/
|
|
279
280
|
private emitManageModeChangedEvent;
|
|
281
|
+
installDataSourceAndQueryState(dataSource: CollectionBrowserDataSourceInterface, queryState: CollectionBrowserQueryState): Promise<void>;
|
|
280
282
|
firstUpdated(): void;
|
|
281
283
|
updated(changed: PropertyValues): void;
|
|
282
284
|
disconnectedCallback(): void;
|
|
@@ -304,7 +306,7 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
304
306
|
private updateFacetFadeOut;
|
|
305
307
|
private emitBaseQueryChanged;
|
|
306
308
|
private emitSearchTypeChanged;
|
|
307
|
-
|
|
309
|
+
emitQueryStateChanged(): void;
|
|
308
310
|
emitEmptyResults(): void;
|
|
309
311
|
private disconnectResizeObserver;
|
|
310
312
|
private setupResizeObserver;
|
|
@@ -319,15 +321,6 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
|
|
|
319
321
|
private initialQueryChangeHappened;
|
|
320
322
|
private historyPopOccurred;
|
|
321
323
|
private previousQueryKey?;
|
|
322
|
-
/**
|
|
323
|
-
* Internal property to store the `resolve` function for the most recent
|
|
324
|
-
* `initialSearchComplete` promise, allowing us to resolve it at the appropriate time.
|
|
325
|
-
*/
|
|
326
|
-
private _initialSearchCompleteResolver;
|
|
327
|
-
/**
|
|
328
|
-
* Internal property to store the private value backing the `initialSearchComplete` getter.
|
|
329
|
-
*/
|
|
330
|
-
private _initialSearchCompletePromise;
|
|
331
324
|
/**
|
|
332
325
|
* A Promise which, after each query change, resolves once the fetches for the initial
|
|
333
326
|
* search have completed. Waits for *both* the hits and aggregations fetches to finish.
|
|
@@ -14,7 +14,7 @@ import './collection-facets';
|
|
|
14
14
|
import './circular-activity-indicator';
|
|
15
15
|
import { SortField, getDefaultSelectedFacets, sortOptionFromAPIString, SORT_OPTIONS, } from './models';
|
|
16
16
|
import { RestorationStateHandler, } from './restoration-state-handler';
|
|
17
|
-
import { CollectionBrowserDataSource
|
|
17
|
+
import { CollectionBrowserDataSource } from './data-source/collection-browser-data-source';
|
|
18
18
|
import chevronIcon from './assets/img/icons/chevron';
|
|
19
19
|
import './empty-placeholder';
|
|
20
20
|
import { analyticsActions, analyticsCategories, } from './utils/analytics-events';
|
|
@@ -23,7 +23,7 @@ import { sha1 } from './utils/sha1';
|
|
|
23
23
|
import { formatDate } from './utils/format-date';
|
|
24
24
|
let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
25
25
|
constructor() {
|
|
26
|
-
super(
|
|
26
|
+
super();
|
|
27
27
|
this.baseImageUrl = 'https://archive.org';
|
|
28
28
|
this.searchType = SearchType.METADATA;
|
|
29
29
|
this.defaultSortParam = null;
|
|
@@ -37,6 +37,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
37
37
|
this.suppressResultCount = false;
|
|
38
38
|
this.suppressURLQuery = false;
|
|
39
39
|
this.suppressFacets = false;
|
|
40
|
+
this.suppressSortBar = false;
|
|
40
41
|
this.clearResultsOnEmptyQuery = false;
|
|
41
42
|
this.collectionPagePath = '/details/';
|
|
42
43
|
/** describes where this component is being used */
|
|
@@ -126,16 +127,10 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
126
127
|
// so this keeps track of whether we've already set the initial query
|
|
127
128
|
this.initialQueryChangeHappened = false;
|
|
128
129
|
this.historyPopOccurred = false;
|
|
129
|
-
|
|
130
|
-
* Internal property to store the private value backing the `initialSearchComplete` getter.
|
|
131
|
-
*/
|
|
132
|
-
this._initialSearchCompletePromise = new Promise(res => {
|
|
133
|
-
this._initialSearchCompleteResolver = res;
|
|
134
|
-
});
|
|
130
|
+
this.addController(this.dataSource);
|
|
135
131
|
}
|
|
136
132
|
tileModelAtCellIndex(index) {
|
|
137
|
-
const
|
|
138
|
-
const model = this.dataSource.getTileModelAt(offsetIndex);
|
|
133
|
+
const model = this.dataSource.getTileModelAt(index);
|
|
139
134
|
/**
|
|
140
135
|
* If we encounter a model we don't have yet and we're not in the middle of an
|
|
141
136
|
* automated scroll, fetch the page and just return undefined.
|
|
@@ -144,8 +139,8 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
144
139
|
* We disable it during the automated scroll since we don't want to fetch pages for intervening cells the
|
|
145
140
|
* user may never see.
|
|
146
141
|
*/
|
|
147
|
-
if (!model && !this.isScrollingToCell) {
|
|
148
|
-
const pageNumber = Math.floor(
|
|
142
|
+
if (!model && !this.isScrollingToCell && this.dataSource.queryInitialized) {
|
|
143
|
+
const pageNumber = Math.floor(index / this.pageSize) + 1;
|
|
149
144
|
this.dataSource.fetchPage(pageNumber);
|
|
150
145
|
}
|
|
151
146
|
return model;
|
|
@@ -196,12 +191,14 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
196
191
|
* Sets the state for whether the initial set of search results is loading in.
|
|
197
192
|
*/
|
|
198
193
|
setSearchResultsLoading(loading) {
|
|
194
|
+
console.log('setting search results loading to', loading);
|
|
199
195
|
this.searchResultsLoading = loading;
|
|
200
196
|
}
|
|
201
197
|
/**
|
|
202
198
|
* Sets the state for whether facet data is loading in
|
|
203
199
|
*/
|
|
204
200
|
setFacetsLoading(loading) {
|
|
201
|
+
console.log('setting facets loading to', loading);
|
|
205
202
|
this.facetsLoading = loading;
|
|
206
203
|
}
|
|
207
204
|
/**
|
|
@@ -299,7 +296,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
299
296
|
this.placeholderType =
|
|
300
297
|
!hasQuery && isCollection ? 'empty-collection' : 'no-results';
|
|
301
298
|
}
|
|
302
|
-
if (this.queryErrorMessage) {
|
|
299
|
+
if (this.dataSource.queryErrorMessage) {
|
|
303
300
|
this.placeholderType =
|
|
304
301
|
!hasQuery && isCollection ? 'collection-error' : 'query-error';
|
|
305
302
|
}
|
|
@@ -311,7 +308,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
311
308
|
.placeholderType=${this.placeholderType}
|
|
312
309
|
?isMobileView=${this.mobileView}
|
|
313
310
|
?isCollection=${!!this.withinCollection}
|
|
314
|
-
.detailMessage=${(_a = this.queryErrorMessage) !== null && _a !== void 0 ? _a : ''}
|
|
311
|
+
.detailMessage=${(_a = this.dataSource.queryErrorMessage) !== null && _a !== void 0 ? _a : ''}
|
|
315
312
|
.baseNavigationUrl=${this.baseNavigationUrl}
|
|
316
313
|
></empty-placeholder>
|
|
317
314
|
${this.infiniteScrollerTemplate}
|
|
@@ -446,6 +443,8 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
446
443
|
}
|
|
447
444
|
get sortFilterBarTemplate() {
|
|
448
445
|
var _a;
|
|
446
|
+
if (this.suppressSortBar)
|
|
447
|
+
return nothing;
|
|
449
448
|
return html `
|
|
450
449
|
<sort-filter-bar
|
|
451
450
|
.defaultSortField=${this.defaultSortField}
|
|
@@ -773,12 +772,40 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
773
772
|
detail: this.isManageView,
|
|
774
773
|
}));
|
|
775
774
|
}
|
|
775
|
+
async installDataSourceAndQueryState(dataSource, queryState) {
|
|
776
|
+
var _a;
|
|
777
|
+
console.log('installing in CB:', dataSource, queryState);
|
|
778
|
+
if (this.dataSource)
|
|
779
|
+
this.removeController(this.dataSource);
|
|
780
|
+
this.dataSource = dataSource;
|
|
781
|
+
this.addController(this.dataSource);
|
|
782
|
+
this.baseQuery = queryState.baseQuery;
|
|
783
|
+
this.profileElement = queryState.profileElement;
|
|
784
|
+
this.searchType = queryState.searchType;
|
|
785
|
+
this.selectedFacets = queryState.selectedFacets;
|
|
786
|
+
this.minSelectedDate = queryState.minSelectedDate;
|
|
787
|
+
this.maxSelectedDate = queryState.maxSelectedDate;
|
|
788
|
+
this.selectedSort = (_a = queryState.selectedSort) !== null && _a !== void 0 ? _a : SortField.default;
|
|
789
|
+
this.sortDirection = queryState.sortDirection;
|
|
790
|
+
this.selectedTitleFilter = queryState.selectedTitleFilter;
|
|
791
|
+
this.selectedCreatorFilter = queryState.selectedCreatorFilter;
|
|
792
|
+
this.requestUpdate();
|
|
793
|
+
await this.updateComplete;
|
|
794
|
+
if (!this.searchResultsLoading) {
|
|
795
|
+
this.setTotalResultCount(this.dataSource.totalResults);
|
|
796
|
+
this.setTileCount(this.dataSource.size);
|
|
797
|
+
this.refreshVisibleResults();
|
|
798
|
+
}
|
|
799
|
+
}
|
|
776
800
|
firstUpdated() {
|
|
777
801
|
this.setupStateRestorationObserver();
|
|
778
802
|
this.restoreState();
|
|
779
803
|
}
|
|
780
804
|
updated(changed) {
|
|
781
805
|
var _a, _b;
|
|
806
|
+
console.log('* CB UPDATED\n', [...changed.entries()]
|
|
807
|
+
.map(([k, v]) => `${String(k)}: ${v} => ${this[k]}`)
|
|
808
|
+
.join('\n'));
|
|
782
809
|
if (changed.has('placeholderType') && this.placeholderType === null) {
|
|
783
810
|
if (!this.leftColIntersectionObserver) {
|
|
784
811
|
this.setupLeftColumnScrollListeners();
|
|
@@ -960,6 +987,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
960
987
|
}));
|
|
961
988
|
}
|
|
962
989
|
emitQueryStateChanged() {
|
|
990
|
+
console.log('emitting query state changed event');
|
|
963
991
|
this.dispatchEvent(new CustomEvent('queryStateChanged', {
|
|
964
992
|
detail: {
|
|
965
993
|
baseQuery: this.baseQuery,
|
|
@@ -1027,11 +1055,16 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1027
1055
|
* one, to ensure you do not await an obsolete promise from the previous update.
|
|
1028
1056
|
*/
|
|
1029
1057
|
get initialSearchComplete() {
|
|
1030
|
-
return this.
|
|
1058
|
+
return this.dataSource.initialSearchComplete;
|
|
1031
1059
|
}
|
|
1032
1060
|
async handleQueryChange() {
|
|
1033
1061
|
var _a;
|
|
1034
|
-
console.log(
|
|
1062
|
+
// console.log(
|
|
1063
|
+
// 'CB: handling query change',
|
|
1064
|
+
// this.previousQueryKey,
|
|
1065
|
+
// this.dataSource.pageFetchQueryKey,
|
|
1066
|
+
// this.dataSource.canPerformSearch
|
|
1067
|
+
// );
|
|
1035
1068
|
// only reset if the query has actually changed
|
|
1036
1069
|
if (!this.searchService ||
|
|
1037
1070
|
this.dataSource.pageFetchQueryKey === this.previousQueryKey)
|
|
@@ -1042,14 +1075,13 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1042
1075
|
return;
|
|
1043
1076
|
console.log('CB will reset', this.baseQuery, JSON.stringify(this.selectedFacets));
|
|
1044
1077
|
this.previousQueryKey = this.dataSource.pageFetchQueryKey;
|
|
1045
|
-
this.emitQueryStateChanged();
|
|
1078
|
+
// this.emitQueryStateChanged();
|
|
1046
1079
|
this.tileModelOffset = 0;
|
|
1047
1080
|
this.totalResults = undefined;
|
|
1048
1081
|
this.pagesToRender =
|
|
1049
1082
|
this.initialPageNumber === 1
|
|
1050
1083
|
? 2 // First two pages are batched into one request when starting from page 1
|
|
1051
1084
|
: this.initialPageNumber;
|
|
1052
|
-
this.queryErrorMessage = undefined;
|
|
1053
1085
|
// Reset the infinite scroller's item count, so that it
|
|
1054
1086
|
// shows tile placeholders until the new query's results load in
|
|
1055
1087
|
if (this.infiniteScroller) {
|
|
@@ -1070,14 +1102,8 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1070
1102
|
this.persistState();
|
|
1071
1103
|
}
|
|
1072
1104
|
this.historyPopOccurred = false;
|
|
1073
|
-
// Reset the `initialSearchComplete` promise with a new value for the imminent search
|
|
1074
|
-
this._initialSearchCompletePromise = new Promise(res => {
|
|
1075
|
-
this._initialSearchCompleteResolver = res;
|
|
1076
|
-
});
|
|
1077
1105
|
// Fire the initial page and facets requests
|
|
1078
|
-
await this.dataSource.handleQueryChange();
|
|
1079
|
-
// Resolve the `initialSearchComplete` promise for this search
|
|
1080
|
-
this._initialSearchCompleteResolver(true);
|
|
1106
|
+
// await this.dataSource.handleQueryChange();
|
|
1081
1107
|
}
|
|
1082
1108
|
setupStateRestorationObserver() {
|
|
1083
1109
|
if (this.boundNavigationHandler)
|
|
@@ -1302,7 +1328,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1302
1328
|
// this.mapDataSource(model => ({ ...model }));
|
|
1303
1329
|
const cellIndex = this.dataSource.indexOf(event.detail);
|
|
1304
1330
|
if (cellIndex >= 0)
|
|
1305
|
-
(_a = this.infiniteScroller) === null || _a === void 0 ? void 0 : _a.refreshCell(cellIndex
|
|
1331
|
+
(_a = this.infiniteScroller) === null || _a === void 0 ? void 0 : _a.refreshCell(cellIndex);
|
|
1306
1332
|
}
|
|
1307
1333
|
(_b = this.analyticsHandler) === null || _b === void 0 ? void 0 : _b.sendEvent({
|
|
1308
1334
|
category: this.searchContext,
|
|
@@ -1345,7 +1371,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
1345
1371
|
* increase the number of pages to render and start fetching data for the new page
|
|
1346
1372
|
*/
|
|
1347
1373
|
scrollThresholdReached() {
|
|
1348
|
-
if (!this.dataSource.endOfDataReached) {
|
|
1374
|
+
if (!this.dataSource.endOfDataReached && this.dataSource.queryInitialized) {
|
|
1349
1375
|
this.pagesToRender += 1;
|
|
1350
1376
|
this.dataSource.fetchPage(this.pagesToRender);
|
|
1351
1377
|
}
|
|
@@ -1803,6 +1829,9 @@ __decorate([
|
|
|
1803
1829
|
__decorate([
|
|
1804
1830
|
property({ type: Boolean })
|
|
1805
1831
|
], CollectionBrowser.prototype, "suppressFacets", void 0);
|
|
1832
|
+
__decorate([
|
|
1833
|
+
property({ type: Boolean })
|
|
1834
|
+
], CollectionBrowser.prototype, "suppressSortBar", void 0);
|
|
1806
1835
|
__decorate([
|
|
1807
1836
|
property({ type: Boolean })
|
|
1808
1837
|
], CollectionBrowser.prototype, "clearResultsOnEmptyQuery", void 0);
|
|
@@ -1842,9 +1871,6 @@ __decorate([
|
|
|
1842
1871
|
__decorate([
|
|
1843
1872
|
property({ type: Boolean })
|
|
1844
1873
|
], CollectionBrowser.prototype, "isLoansTab", void 0);
|
|
1845
|
-
__decorate([
|
|
1846
|
-
property({ type: String })
|
|
1847
|
-
], CollectionBrowser.prototype, "queryErrorMessage", void 0);
|
|
1848
1874
|
__decorate([
|
|
1849
1875
|
property({ type: Object })
|
|
1850
1876
|
], CollectionBrowser.prototype, "dataSource", void 0);
|