@internetarchive/collection-browser
Advanced tools
Comparing version 0.0.1-alpha.37 to 0.0.1-alpha.38
@@ -178,2 +178,3 @@ import { | ||
.collectionNameCache=${this.collectionNameCache} | ||
.showHistogramDatePicker=${true} | ||
@visiblePageChanged=${this.visiblePageChanged} | ||
@@ -180,0 +181,0 @@ > |
@@ -153,2 +153,3 @@ import { __decorate } from "tslib"; | ||
.collectionNameCache=${this.collectionNameCache} | ||
.showHistogramDatePicker=${true} | ||
@visiblePageChanged=${this.visiblePageChanged} | ||
@@ -155,0 +156,0 @@ > |
@@ -36,2 +36,3 @@ import { LitElement, PropertyValues, TemplateResult } from 'lit'; | ||
selectedFacets?: SelectedFacets; | ||
showHistogramDatePicker: boolean; | ||
collectionNameCache?: CollectionNameCacheInterface; | ||
@@ -38,0 +39,0 @@ pageContext: CollectionBrowserContext; |
@@ -29,2 +29,3 @@ import { __decorate } from "tslib"; | ||
this.pageSize = 50; | ||
this.showHistogramDatePicker = false; | ||
this.pageContext = 'search'; | ||
@@ -151,3 +152,3 @@ this.restorationStateHandler = new RestorationStateHandler({ | ||
<span id="big-results-count" | ||
>${this.totalResults | ||
>${this.totalResults !== undefined | ||
? this.totalResults.toLocaleString() | ||
@@ -186,2 +187,10 @@ : '-'}</span | ||
: nothing} | ||
${Object.keys(this.dataSource).length === 0 | ||
? html ` | ||
<h2> | ||
Your search did not match any items in the Archive. Try | ||
different keywords or a more general search. | ||
</h2> | ||
` | ||
: nothing} | ||
@@ -257,2 +266,3 @@ <infinite-scroller | ||
.languageCodeHandler=${this.languageCodeHandler} | ||
.showHistogramDatePicker=${this.showHistogramDatePicker} | ||
?collapsableFacets=${this.mobileView} | ||
@@ -316,2 +326,5 @@ ?facetsLoading=${this.facetDataLoading} | ||
} | ||
if (changed.has('baseQuery')) { | ||
this.selectedFacets = undefined; | ||
} | ||
if (changed.has('baseQuery') || | ||
@@ -1058,2 +1071,5 @@ changed.has('titleQuery') || | ||
__decorate([ | ||
property({ type: Boolean }) | ||
], CollectionBrowser.prototype, "showHistogramDatePicker", void 0); | ||
__decorate([ | ||
property({ type: Object }) | ||
@@ -1060,0 +1076,0 @@ ], CollectionBrowser.prototype, "collectionNameCache", void 0); |
@@ -18,2 +18,3 @@ import { LitElement, PropertyValues, TemplateResult } from 'lit'; | ||
collapsableFacets: boolean; | ||
showHistogramDatePicker: boolean; | ||
languageCodeHandler?: LanguageCodeHandlerInterface; | ||
@@ -20,0 +21,0 @@ collectionNameCache?: CollectionNameCacheInterface; |
@@ -43,2 +43,3 @@ import { __decorate } from "tslib"; | ||
this.collapsableFacets = false; | ||
this.showHistogramDatePicker = false; | ||
this.openFacets = { | ||
@@ -56,7 +57,10 @@ subject: false, | ||
<div id="container" class="${this.facetsLoading ? 'loading' : ''}"> | ||
<div class="facet-group"> | ||
<h1>Year Published <feature-feedback></feature-feedback></h1> | ||
${this.histogramTemplate} | ||
</div> | ||
${this.showHistogramDatePicker && this.fullYearsHistogramAggregation | ||
? html ` | ||
<div class="facet-group"> | ||
<h1>Year Published <feature-feedback></feature-feedback></h1> | ||
${this.histogramTemplate} | ||
</div> | ||
` | ||
: nothing} | ||
${this.mergedFacets.map(facetGroup => this.getFacetGroupTemplate(facetGroup))} | ||
@@ -179,7 +183,2 @@ </div> | ||
} | ||
// private languageDelimiter = '•••'; | ||
// private getLanguageName(languageCode: string): string { | ||
// const split = languageCode.split(this.languageDelimiter); | ||
// return languageCode; | ||
// } | ||
/** | ||
@@ -230,2 +229,4 @@ * Converts the raw `aggregations` to `FacetGroups`, which are easier to use | ||
getFacetGroupTemplate(facetGroup) { | ||
if (facetGroup.buckets.length === 0) | ||
return nothing; | ||
const { key } = facetGroup; | ||
@@ -531,2 +532,5 @@ const isOpen = this.openFacets[key]; | ||
__decorate([ | ||
property({ type: Boolean }) | ||
], CollectionFacets.prototype, "showHistogramDatePicker", void 0); | ||
__decorate([ | ||
property({ type: Object }) | ||
@@ -533,0 +537,0 @@ ], CollectionFacets.prototype, "languageCodeHandler", void 0); |
@@ -6,3 +6,3 @@ { | ||
"author": "Internet Archive", | ||
"version": "0.0.1-alpha.37", | ||
"version": "0.0.1-alpha.38", | ||
"main": "dist/index.js", | ||
@@ -9,0 +9,0 @@ "module": "dist/index.js", |
@@ -101,2 +101,4 @@ /* eslint-disable import/no-duplicates */ | ||
@property({ type: Boolean }) showHistogramDatePicker = false; | ||
@property({ type: Object }) | ||
@@ -255,3 +257,3 @@ collectionNameCache?: CollectionNameCacheInterface; | ||
<span id="big-results-count" | ||
>${this.totalResults | ||
>${this.totalResults !== undefined | ||
? this.totalResults.toLocaleString() | ||
@@ -290,2 +292,10 @@ : '-'}</span | ||
: nothing} | ||
${Object.keys(this.dataSource).length === 0 | ||
? html` | ||
<h2> | ||
Your search did not match any items in the Archive. Try | ||
different keywords or a more general search. | ||
</h2> | ||
` | ||
: nothing} | ||
@@ -376,2 +386,3 @@ <infinite-scroller | ||
.languageCodeHandler=${this.languageCodeHandler} | ||
.showHistogramDatePicker=${this.showHistogramDatePicker} | ||
?collapsableFacets=${this.mobileView} | ||
@@ -447,2 +458,5 @@ ?facetsLoading=${this.facetDataLoading} | ||
} | ||
if (changed.has('baseQuery')) { | ||
this.selectedFacets = undefined; | ||
} | ||
if ( | ||
@@ -449,0 +463,0 @@ changed.has('baseQuery') || |
@@ -74,2 +74,4 @@ /* eslint-disable import/no-duplicates */ | ||
@property({ type: Boolean }) showHistogramDatePicker = false; | ||
@property({ type: Object }) | ||
@@ -93,7 +95,10 @@ languageCodeHandler?: LanguageCodeHandlerInterface; | ||
<div id="container" class="${this.facetsLoading ? 'loading' : ''}"> | ||
<div class="facet-group"> | ||
<h1>Year Published <feature-feedback></feature-feedback></h1> | ||
${this.histogramTemplate} | ||
</div> | ||
${this.showHistogramDatePicker && this.fullYearsHistogramAggregation | ||
? html` | ||
<div class="facet-group"> | ||
<h1>Year Published <feature-feedback></feature-feedback></h1> | ||
${this.histogramTemplate} | ||
</div> | ||
` | ||
: nothing} | ||
${this.mergedFacets.map(facetGroup => | ||
@@ -250,10 +255,2 @@ this.getFacetGroupTemplate(facetGroup) | ||
// private languageDelimiter = '•••'; | ||
// private getLanguageName(languageCode: string): string { | ||
// const split = languageCode.split(this.languageDelimiter); | ||
// return languageCode; | ||
// } | ||
/** | ||
@@ -303,3 +300,6 @@ * Converts the raw `aggregations` to `FacetGroups`, which are easier to use | ||
*/ | ||
private getFacetGroupTemplate(facetGroup: FacetGroup): TemplateResult { | ||
private getFacetGroupTemplate( | ||
facetGroup: FacetGroup | ||
): TemplateResult | typeof nothing { | ||
if (facetGroup.buckets.length === 0) return nothing; | ||
const { key } = facetGroup; | ||
@@ -306,0 +306,0 @@ const isOpen = this.openFacets[key]; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
923167
12997