@internetarchive/collection-browser 3.5.2-alpha-webdev8160.0 → 3.5.2-alpha-webdev8093.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/app-root.js +606 -606
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/collection-browser.js +764 -764
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-row.js +140 -140
- package/dist/src/collection-facets/facet-row.js.map +1 -1
- package/dist/src/collection-facets/facets-template.js +23 -23
- package/dist/src/collection-facets/facets-template.js.map +1 -1
- package/dist/src/collection-facets/more-facets-content.d.ts +1 -0
- package/dist/src/collection-facets/more-facets-content.js +126 -127
- package/dist/src/collection-facets/more-facets-content.js.map +1 -1
- package/dist/src/collection-facets.js +267 -267
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/data-source/collection-browser-query-state.js.map +1 -1
- package/dist/src/data-source/models.js.map +1 -1
- package/dist/src/models.d.ts +0 -4
- package/dist/src/models.js +0 -8
- package/dist/src/models.js.map +1 -1
- package/dist/src/restoration-state-handler.js.map +1 -1
- package/dist/src/tiles/grid/collection-tile.js +77 -77
- package/dist/src/tiles/grid/collection-tile.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.js +137 -137
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/hover/hover-pane-controller.d.ts +8 -0
- package/dist/src/tiles/hover/hover-pane-controller.js +13 -1
- package/dist/src/tiles/hover/hover-pane-controller.js.map +1 -1
- package/dist/src/tiles/models.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.js +215 -215
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/test/collection-browser.test.js +189 -189
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/collection-facets/more-facets-content.test.js +28 -28
- package/dist/test/collection-facets/more-facets-content.test.js.map +1 -1
- package/dist/test/restoration-state-handler.test.js.map +1 -1
- package/package.json +1 -1
- package/src/app-root.ts +1140 -1140
- package/src/collection-browser.ts +3075 -3075
- package/src/collection-facets/facet-row.ts +299 -299
- package/src/collection-facets/facets-template.ts +83 -83
- package/src/collection-facets/more-facets-content.ts +642 -644
- package/src/collection-facets.ts +1010 -1010
- package/src/data-source/collection-browser-data-source-interface.ts +345 -345
- package/src/data-source/collection-browser-data-source.ts +1441 -1441
- package/src/data-source/collection-browser-query-state.ts +59 -59
- package/src/data-source/models.ts +56 -56
- package/src/models.ts +0 -9
- package/src/restoration-state-handler.ts +546 -546
- package/src/tiles/grid/collection-tile.ts +163 -163
- package/src/tiles/grid/item-tile.ts +340 -340
- package/src/tiles/hover/hover-pane-controller.ts +15 -1
- package/src/tiles/models.ts +1 -1
- package/src/tiles/tile-dispatcher.ts +517 -517
- package/test/collection-browser.test.ts +2413 -2413
- package/test/collection-facets/more-facets-content.test.ts +231 -231
- package/test/restoration-state-handler.test.ts +480 -480
- package/vite.config.ts +29 -29
|
@@ -80,28 +80,28 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
80
80
|
// Added data-testid for Playwright testing
|
|
81
81
|
// Using facet-group class and aria-labels is not ideal for Playwright locator
|
|
82
82
|
const datePickerLabelId = 'date-picker-label';
|
|
83
|
-
return html `
|
|
84
|
-
<div id="container" class=${containerClasses}>
|
|
83
|
+
return html `
|
|
84
|
+
<div id="container" class=${containerClasses}>
|
|
85
85
|
${this.showHistogramDatePicker &&
|
|
86
86
|
(this.histogramAggregation || this.histogramAggregationLoading)
|
|
87
|
-
? html `
|
|
88
|
-
<section
|
|
89
|
-
class="facet-group"
|
|
90
|
-
aria-labelledby=${datePickerLabelId}
|
|
91
|
-
data-testid="facet-group-header-label-date-picker"
|
|
92
|
-
>
|
|
93
|
-
<h3 id=${datePickerLabelId}>
|
|
94
|
-
${heading} <span class="sr-only">${msg('range filter')}</span>
|
|
95
|
-
${this.expandDatePickerBtnTemplate}
|
|
96
|
-
</h3>
|
|
97
|
-
${this.histogramTemplate}
|
|
98
|
-
</section>
|
|
87
|
+
? html `
|
|
88
|
+
<section
|
|
89
|
+
class="facet-group"
|
|
90
|
+
aria-labelledby=${datePickerLabelId}
|
|
91
|
+
data-testid="facet-group-header-label-date-picker"
|
|
92
|
+
>
|
|
93
|
+
<h3 id=${datePickerLabelId}>
|
|
94
|
+
${heading} <span class="sr-only">${msg('range filter')}</span>
|
|
95
|
+
${this.expandDatePickerBtnTemplate}
|
|
96
|
+
</h3>
|
|
97
|
+
${this.histogramTemplate}
|
|
98
|
+
</section>
|
|
99
99
|
`
|
|
100
|
-
: nothing}
|
|
101
|
-
${this.collectionPartOfTemplate}
|
|
102
|
-
<slot name="facets-top"></slot>
|
|
103
|
-
${this.mergedFacets.map(facetGroup => this.getFacetGroupTemplate(facetGroup))}
|
|
104
|
-
</div>
|
|
100
|
+
: nothing}
|
|
101
|
+
${this.collectionPartOfTemplate}
|
|
102
|
+
<slot name="facets-top"></slot>
|
|
103
|
+
${this.mergedFacets.map(facetGroup => this.getFacetGroupTemplate(facetGroup))}
|
|
104
|
+
</div>
|
|
105
105
|
`;
|
|
106
106
|
}
|
|
107
107
|
get collectionPartOfTemplate() {
|
|
@@ -111,30 +111,30 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
111
111
|
// Added data-testid for Playwright testing
|
|
112
112
|
// Using className and aria-labels is not ideal for Playwright locator
|
|
113
113
|
const headingId = 'partof-heading';
|
|
114
|
-
return html `
|
|
115
|
-
<section
|
|
116
|
-
class="facet-group partof-collections"
|
|
117
|
-
aria-labelledby=${headingId}
|
|
118
|
-
data-testid="facet-group-partof-collections"
|
|
119
|
-
>
|
|
120
|
-
<div class="facet-group-header">
|
|
121
|
-
<h3 id=${headingId}>${msg('Part Of')}</h3>
|
|
122
|
-
</div>
|
|
123
|
-
<ul>
|
|
114
|
+
return html `
|
|
115
|
+
<section
|
|
116
|
+
class="facet-group partof-collections"
|
|
117
|
+
aria-labelledby=${headingId}
|
|
118
|
+
data-testid="facet-group-partof-collections"
|
|
119
|
+
>
|
|
120
|
+
<div class="facet-group-header">
|
|
121
|
+
<h3 id=${headingId}>${msg('Part Of')}</h3>
|
|
122
|
+
</div>
|
|
123
|
+
<ul>
|
|
124
124
|
${map(this.parentCollections, collxn => {
|
|
125
125
|
const collectionURL = `${this.baseNavigationUrl}${this.collectionPagePath}${collxn}`;
|
|
126
|
-
return html ` <li>
|
|
127
|
-
<a
|
|
128
|
-
href=${collectionURL}
|
|
129
|
-
data-id=${collxn}
|
|
130
|
-
@click=${this.partOfCollectionClicked}
|
|
131
|
-
>
|
|
132
|
-
${this.collectionTitles?.get(collxn) ?? collxn}
|
|
133
|
-
</a>
|
|
126
|
+
return html ` <li>
|
|
127
|
+
<a
|
|
128
|
+
href=${collectionURL}
|
|
129
|
+
data-id=${collxn}
|
|
130
|
+
@click=${this.partOfCollectionClicked}
|
|
131
|
+
>
|
|
132
|
+
${this.collectionTitles?.get(collxn) ?? collxn}
|
|
133
|
+
</a>
|
|
134
134
|
</li>`;
|
|
135
|
-
})}
|
|
136
|
-
</ul>
|
|
137
|
-
</section>
|
|
135
|
+
})}
|
|
136
|
+
</ul>
|
|
137
|
+
</section>
|
|
138
138
|
`;
|
|
139
139
|
}
|
|
140
140
|
partOfCollectionClicked(e) {
|
|
@@ -214,24 +214,24 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
214
214
|
expandedDatePicker.maxSelectedDate = this.maxSelectedDate;
|
|
215
215
|
}
|
|
216
216
|
};
|
|
217
|
-
const customModalContent = html `
|
|
218
|
-
<expanded-date-picker
|
|
219
|
-
${ref(expandedDatePickerChanged)}
|
|
220
|
-
.minDate=${minDate}
|
|
221
|
-
.maxDate=${maxDate}
|
|
222
|
-
.minSelectedDate=${this.minSelectedDate}
|
|
223
|
-
.maxSelectedDate=${this.maxSelectedDate}
|
|
224
|
-
.customDateFormat=${dateFormat}
|
|
225
|
-
.customTooltipDateFormat=${tooltipDateFormat}
|
|
226
|
-
.customTooltipLabel=${tooltipLabel}
|
|
227
|
-
.binSnapping=${binSnapping}
|
|
228
|
-
.barScaling=${barScaling}
|
|
229
|
-
.buckets=${buckets}
|
|
230
|
-
.modalManager=${this.modalManager}
|
|
231
|
-
.analyticsHandler=${this.analyticsHandler}
|
|
232
|
-
@histogramDateRangeApplied=${this.histogramDateRangeUpdated}
|
|
233
|
-
@modalClosed=${this.handleExpandedDatePickerClosed}
|
|
234
|
-
></expanded-date-picker>
|
|
217
|
+
const customModalContent = html `
|
|
218
|
+
<expanded-date-picker
|
|
219
|
+
${ref(expandedDatePickerChanged)}
|
|
220
|
+
.minDate=${minDate}
|
|
221
|
+
.maxDate=${maxDate}
|
|
222
|
+
.minSelectedDate=${this.minSelectedDate}
|
|
223
|
+
.maxSelectedDate=${this.maxSelectedDate}
|
|
224
|
+
.customDateFormat=${dateFormat}
|
|
225
|
+
.customTooltipDateFormat=${tooltipDateFormat}
|
|
226
|
+
.customTooltipLabel=${tooltipLabel}
|
|
227
|
+
.binSnapping=${binSnapping}
|
|
228
|
+
.barScaling=${barScaling}
|
|
229
|
+
.buckets=${buckets}
|
|
230
|
+
.modalManager=${this.modalManager}
|
|
231
|
+
.analyticsHandler=${this.analyticsHandler}
|
|
232
|
+
@histogramDateRangeApplied=${this.histogramDateRangeUpdated}
|
|
233
|
+
@modalClosed=${this.handleExpandedDatePickerClosed}
|
|
234
|
+
></expanded-date-picker>
|
|
235
235
|
`;
|
|
236
236
|
const config = new ModalConfig({
|
|
237
237
|
bodyColor: '#fff',
|
|
@@ -270,13 +270,13 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
270
270
|
*/
|
|
271
271
|
get expandDatePickerBtnTemplate() {
|
|
272
272
|
return this.allowExpandingDatePicker && !this.facetsLoading
|
|
273
|
-
? html `<button
|
|
274
|
-
class="expand-date-picker-btn"
|
|
275
|
-
aria-haspopup="dialog"
|
|
276
|
-
@click=${this.showDatePickerModal}
|
|
277
|
-
>
|
|
278
|
-
<span class="sr-only">${msg('Expand date histogram')}</span>
|
|
279
|
-
<span aria-hidden="true">${expandIcon}</span>
|
|
273
|
+
? html `<button
|
|
274
|
+
class="expand-date-picker-btn"
|
|
275
|
+
aria-haspopup="dialog"
|
|
276
|
+
@click=${this.showDatePickerModal}
|
|
277
|
+
>
|
|
278
|
+
<span class="sr-only">${msg('Expand date histogram')}</span>
|
|
279
|
+
<span aria-hidden="true">${expandIcon}</span>
|
|
280
280
|
</button>`
|
|
281
281
|
: nothing;
|
|
282
282
|
}
|
|
@@ -288,26 +288,26 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
288
288
|
if (!histogramProps)
|
|
289
289
|
return nothing;
|
|
290
290
|
const { buckets, dateFormat, tooltipDateFormat, tooltipLabel, binSnapping, barScaling, minDate, maxDate, } = histogramProps;
|
|
291
|
-
return html `
|
|
292
|
-
<histogram-date-range
|
|
293
|
-
class=${this.isTvSearch ? 'wide-inputs' : ''}
|
|
294
|
-
.minDate=${minDate}
|
|
295
|
-
.maxDate=${maxDate}
|
|
296
|
-
.minSelectedDate=${this.minSelectedDate ?? minDate}
|
|
297
|
-
.maxSelectedDate=${this.maxSelectedDate ?? maxDate}
|
|
298
|
-
.updateDelay=${100}
|
|
299
|
-
.dateFormat=${dateFormat}
|
|
300
|
-
.tooltipDateFormat=${tooltipDateFormat}
|
|
301
|
-
.tooltipLabel=${tooltipLabel}
|
|
302
|
-
.binSnapping=${binSnapping}
|
|
303
|
-
.barScaling=${barScaling}
|
|
304
|
-
.bins=${buckets}
|
|
305
|
-
missingDataMessage="..."
|
|
291
|
+
return html `
|
|
292
|
+
<histogram-date-range
|
|
293
|
+
class=${this.isTvSearch ? 'wide-inputs' : ''}
|
|
294
|
+
.minDate=${minDate}
|
|
295
|
+
.maxDate=${maxDate}
|
|
296
|
+
.minSelectedDate=${this.minSelectedDate ?? minDate}
|
|
297
|
+
.maxSelectedDate=${this.maxSelectedDate ?? maxDate}
|
|
298
|
+
.updateDelay=${100}
|
|
299
|
+
.dateFormat=${dateFormat}
|
|
300
|
+
.tooltipDateFormat=${tooltipDateFormat}
|
|
301
|
+
.tooltipLabel=${tooltipLabel}
|
|
302
|
+
.binSnapping=${binSnapping}
|
|
303
|
+
.barScaling=${barScaling}
|
|
304
|
+
.bins=${buckets}
|
|
305
|
+
missingDataMessage="..."
|
|
306
306
|
.width=${this.collapsableFacets && this.contentWidth
|
|
307
307
|
? this.contentWidth
|
|
308
|
-
: 180}
|
|
309
|
-
@histogramDateRangeUpdated=${this.histogramDateRangeUpdated}
|
|
310
|
-
></histogram-date-range>
|
|
308
|
+
: 180}
|
|
309
|
+
@histogramDateRangeUpdated=${this.histogramDateRangeUpdated}
|
|
310
|
+
></histogram-date-range>
|
|
311
311
|
`;
|
|
312
312
|
}
|
|
313
313
|
/**
|
|
@@ -487,8 +487,8 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
487
487
|
return nothing;
|
|
488
488
|
const { key } = facetGroup;
|
|
489
489
|
const isOpen = this.openFacets[key];
|
|
490
|
-
const collapser = html `
|
|
491
|
-
<span class="collapser ${isOpen ? 'open' : ''}"> ${chevronIcon} </span>
|
|
490
|
+
const collapser = html `
|
|
491
|
+
<span class="collapser ${isOpen ? 'open' : ''}"> ${chevronIcon} </span>
|
|
492
492
|
`;
|
|
493
493
|
const toggleCollapsed = () => {
|
|
494
494
|
const newOpenFacets = { ...this.openFacets };
|
|
@@ -498,40 +498,40 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
498
498
|
// Added data-testid for Playwright testing
|
|
499
499
|
// Using className and aria-labels is not ideal for Playwright locator
|
|
500
500
|
const headerId = `facet-group-header-label-${facetGroup.key}`;
|
|
501
|
-
return html `
|
|
502
|
-
<section
|
|
503
|
-
class="facet-group ${this.collapsableFacets ? 'mobile' : ''}"
|
|
504
|
-
aria-labelledby=${headerId}
|
|
505
|
-
data-testid=${headerId}
|
|
506
|
-
>
|
|
507
|
-
<div class="facet-group-header">
|
|
508
|
-
<h3
|
|
509
|
-
id=${headerId}
|
|
510
|
-
@click=${toggleCollapsed}
|
|
511
|
-
@keyup=${toggleCollapsed}
|
|
512
|
-
>
|
|
513
|
-
${this.collapsableFacets ? collapser : nothing} ${facetGroup.title}
|
|
514
|
-
<span class="sr-only">filters</span>
|
|
515
|
-
</h3>
|
|
516
|
-
</div>
|
|
517
|
-
<div
|
|
518
|
-
class="facet-group-content ${isOpen ? 'open' : ''}"
|
|
519
|
-
data-testid="facet-group-content-${facetGroup.key}"
|
|
520
|
-
>
|
|
501
|
+
return html `
|
|
502
|
+
<section
|
|
503
|
+
class="facet-group ${this.collapsableFacets ? 'mobile' : ''}"
|
|
504
|
+
aria-labelledby=${headerId}
|
|
505
|
+
data-testid=${headerId}
|
|
506
|
+
>
|
|
507
|
+
<div class="facet-group-header">
|
|
508
|
+
<h3
|
|
509
|
+
id=${headerId}
|
|
510
|
+
@click=${toggleCollapsed}
|
|
511
|
+
@keyup=${toggleCollapsed}
|
|
512
|
+
>
|
|
513
|
+
${this.collapsableFacets ? collapser : nothing} ${facetGroup.title}
|
|
514
|
+
<span class="sr-only">filters</span>
|
|
515
|
+
</h3>
|
|
516
|
+
</div>
|
|
517
|
+
<div
|
|
518
|
+
class="facet-group-content ${isOpen ? 'open' : ''}"
|
|
519
|
+
data-testid="facet-group-content-${facetGroup.key}"
|
|
520
|
+
>
|
|
521
521
|
${this.facetsLoading
|
|
522
522
|
? this.getTombstoneFacetGroupTemplate()
|
|
523
|
-
: html `
|
|
524
|
-
${this.getFacetTemplate(facetGroup)}
|
|
525
|
-
${this.searchMoreFacetsLink(facetGroup)}
|
|
526
|
-
`}
|
|
527
|
-
</div>
|
|
528
|
-
</section>
|
|
523
|
+
: html `
|
|
524
|
+
${this.getFacetTemplate(facetGroup)}
|
|
525
|
+
${this.searchMoreFacetsLink(facetGroup)}
|
|
526
|
+
`}
|
|
527
|
+
</div>
|
|
528
|
+
</section>
|
|
529
529
|
`;
|
|
530
530
|
}
|
|
531
531
|
getTombstoneFacetGroupTemplate() {
|
|
532
532
|
// Render five tombstone rows
|
|
533
|
-
return html `
|
|
534
|
-
${map(Array(5).fill(null), () => html `<facet-tombstone-row></facet-tombstone-row>`)}
|
|
533
|
+
return html `
|
|
534
|
+
${map(Array(5).fill(null), () => html `<facet-tombstone-row></facet-tombstone-row>`)}
|
|
535
535
|
`;
|
|
536
536
|
}
|
|
537
537
|
/**
|
|
@@ -556,8 +556,8 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
556
556
|
const facetSort = defaultFacetSort[facetGroup.key];
|
|
557
557
|
// Added data-testid for Playwright testing
|
|
558
558
|
// Using the className is not ideal for Playwright locator
|
|
559
|
-
return html `<button
|
|
560
|
-
class="more-link"
|
|
559
|
+
return html `<button
|
|
560
|
+
class="more-link"
|
|
561
561
|
@click=${() => {
|
|
562
562
|
this.showMoreFacetsModal(facetGroup, facetSort);
|
|
563
563
|
this.analyticsHandler?.sendEvent({
|
|
@@ -566,29 +566,29 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
566
566
|
label: facetGroup.key,
|
|
567
567
|
});
|
|
568
568
|
this.dispatchEvent(new CustomEvent('showMoreFacets', { detail: facetGroup.key }));
|
|
569
|
-
}}
|
|
570
|
-
data-testid="more-link-btn"
|
|
571
|
-
>
|
|
572
|
-
More...
|
|
569
|
+
}}
|
|
570
|
+
data-testid="more-link-btn"
|
|
571
|
+
>
|
|
572
|
+
More...
|
|
573
573
|
</button>`;
|
|
574
574
|
}
|
|
575
575
|
async showMoreFacetsModal(facetGroup, sortedBy) {
|
|
576
|
-
const customModalContent = html `
|
|
577
|
-
<more-facets-content
|
|
578
|
-
.analyticsHandler=${this.analyticsHandler}
|
|
579
|
-
.facetKey=${facetGroup.key}
|
|
580
|
-
.query=${this.query}
|
|
581
|
-
.identifiers=${this.identifiers}
|
|
582
|
-
.filterMap=${this.filterMap}
|
|
583
|
-
.pageSpecifierParams=${this.pageSpecifierParams}
|
|
584
|
-
.modalManager=${this.modalManager}
|
|
585
|
-
.searchService=${this.searchService}
|
|
586
|
-
.searchType=${this.searchType}
|
|
587
|
-
.collectionTitles=${this.collectionTitles}
|
|
588
|
-
.tvChannelAliases=${this.tvChannelAliases}
|
|
589
|
-
.selectedFacets=${this.selectedFacets}
|
|
590
|
-
.sortedBy=${sortedBy}
|
|
591
|
-
.isTvSearch=${this.isTvSearch}
|
|
576
|
+
const customModalContent = html `
|
|
577
|
+
<more-facets-content
|
|
578
|
+
.analyticsHandler=${this.analyticsHandler}
|
|
579
|
+
.facetKey=${facetGroup.key}
|
|
580
|
+
.query=${this.query}
|
|
581
|
+
.identifiers=${this.identifiers}
|
|
582
|
+
.filterMap=${this.filterMap}
|
|
583
|
+
.pageSpecifierParams=${this.pageSpecifierParams}
|
|
584
|
+
.modalManager=${this.modalManager}
|
|
585
|
+
.searchService=${this.searchService}
|
|
586
|
+
.searchType=${this.searchType}
|
|
587
|
+
.collectionTitles=${this.collectionTitles}
|
|
588
|
+
.tvChannelAliases=${this.tvChannelAliases}
|
|
589
|
+
.selectedFacets=${this.selectedFacets}
|
|
590
|
+
.sortedBy=${sortedBy}
|
|
591
|
+
.isTvSearch=${this.isTvSearch}
|
|
592
592
|
@facetsChanged=${(e) => {
|
|
593
593
|
const event = new CustomEvent('facetsChanged', {
|
|
594
594
|
detail: e.detail,
|
|
@@ -596,9 +596,9 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
596
596
|
composed: true,
|
|
597
597
|
});
|
|
598
598
|
this.dispatchEvent(event);
|
|
599
|
-
}}
|
|
600
|
-
>
|
|
601
|
-
</more-facets-content>
|
|
599
|
+
}}
|
|
600
|
+
>
|
|
601
|
+
</more-facets-content>
|
|
602
602
|
`;
|
|
603
603
|
const config = new ModalConfig({
|
|
604
604
|
bodyColor: '#fff',
|
|
@@ -620,12 +620,12 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
620
620
|
* Generate the list template for each bucket in a facet group
|
|
621
621
|
*/
|
|
622
622
|
getFacetTemplate(facetGroup) {
|
|
623
|
-
return html `
|
|
624
|
-
<facets-template
|
|
625
|
-
.collectionPagePath=${this.collectionPagePath}
|
|
626
|
-
.facetGroup=${facetGroup}
|
|
627
|
-
.selectedFacets=${this.selectedFacets}
|
|
628
|
-
.collectionTitles=${this.collectionTitles}
|
|
623
|
+
return html `
|
|
624
|
+
<facets-template
|
|
625
|
+
.collectionPagePath=${this.collectionPagePath}
|
|
626
|
+
.facetGroup=${facetGroup}
|
|
627
|
+
.selectedFacets=${this.selectedFacets}
|
|
628
|
+
.collectionTitles=${this.collectionTitles}
|
|
629
629
|
@facetClick=${(e) => {
|
|
630
630
|
this.selectedFacets = updateSelectedFacetBucket(this.selectedFacets, facetGroup.key, e.detail.bucket, true);
|
|
631
631
|
const event = new CustomEvent('facetsChanged', {
|
|
@@ -634,134 +634,134 @@ let CollectionFacets = class CollectionFacets extends LitElement {
|
|
|
634
634
|
composed: true,
|
|
635
635
|
});
|
|
636
636
|
this.dispatchEvent(event);
|
|
637
|
-
}}
|
|
638
|
-
></facets-template>
|
|
637
|
+
}}
|
|
638
|
+
></facets-template>
|
|
639
639
|
`;
|
|
640
640
|
}
|
|
641
641
|
static get styles() {
|
|
642
642
|
return [
|
|
643
643
|
srOnlyStyle,
|
|
644
|
-
css `
|
|
645
|
-
a:link {
|
|
646
|
-
text-decoration: none;
|
|
647
|
-
color: var(--ia-theme-link-color, #4b64ff);
|
|
648
|
-
}
|
|
649
|
-
a:link:hover {
|
|
650
|
-
text-decoration: underline;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
#container.loading {
|
|
654
|
-
opacity: 0.5;
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
#container.managing {
|
|
658
|
-
opacity: 0.3;
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
.histogram-loading-indicator {
|
|
662
|
-
width: 100%;
|
|
663
|
-
height: 5.25rem;
|
|
664
|
-
margin-top: 1.75rem;
|
|
665
|
-
font-size: 1.4rem;
|
|
666
|
-
text-align: center;
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
.collapser {
|
|
670
|
-
display: inline-block;
|
|
671
|
-
cursor: pointer;
|
|
672
|
-
width: 10px;
|
|
673
|
-
height: 10px;
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
.collapser svg {
|
|
677
|
-
transition: transform 0.2s ease-in-out;
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
.collapser.open svg {
|
|
681
|
-
transform: rotate(90deg);
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
.facet-group {
|
|
685
|
-
margin-bottom: 2rem;
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
.facet-group h3 {
|
|
689
|
-
margin-bottom: 0.7rem;
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
.facet-group.mobile h3 {
|
|
693
|
-
cursor: pointer;
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
.facet-group-header {
|
|
697
|
-
display: flex;
|
|
698
|
-
margin-bottom: 0.7rem;
|
|
699
|
-
justify-content: space-between;
|
|
700
|
-
border-bottom: 1px solid rgb(232, 232, 232);
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
.facet-group-content {
|
|
704
|
-
transition: max-height 0.2s ease-in-out;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
.facet-group.mobile .facet-group-content {
|
|
708
|
-
max-height: 0;
|
|
709
|
-
overflow: hidden;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
.facet-group.mobile .facet-group-content.open {
|
|
713
|
-
max-height: 2000px;
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
.partof-collections ul {
|
|
717
|
-
list-style-type: none;
|
|
718
|
-
padding: 0;
|
|
719
|
-
font-size: 1.2rem;
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
h3 {
|
|
723
|
-
font-size: 1.4rem;
|
|
724
|
-
margin: 0;
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
.more-link {
|
|
728
|
-
font-size: 1.2rem;
|
|
729
|
-
text-decoration: none;
|
|
730
|
-
padding: 0;
|
|
731
|
-
margin-top: 0.25rem;
|
|
732
|
-
background: inherit;
|
|
733
|
-
border: 0;
|
|
734
|
-
color: var(--ia-theme-link-color, #4b64ff);
|
|
735
|
-
cursor: pointer;
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
#date-picker-label {
|
|
739
|
-
display: flex;
|
|
740
|
-
justify-content: space-between;
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
.expand-date-picker-btn {
|
|
744
|
-
margin: 0;
|
|
745
|
-
padding: 0;
|
|
746
|
-
border: 0;
|
|
747
|
-
appearance: none;
|
|
748
|
-
background: none;
|
|
749
|
-
cursor: pointer;
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
.expand-date-picker-btn svg {
|
|
753
|
-
width: 14px;
|
|
754
|
-
height: 14px;
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
.sorting-icon {
|
|
758
|
-
height: 15px;
|
|
759
|
-
cursor: pointer;
|
|
760
|
-
}
|
|
761
|
-
|
|
762
|
-
histogram-date-range.wide-inputs {
|
|
763
|
-
--histogramDateRangeInputWidth: 4.8rem;
|
|
764
|
-
}
|
|
644
|
+
css `
|
|
645
|
+
a:link {
|
|
646
|
+
text-decoration: none;
|
|
647
|
+
color: var(--ia-theme-link-color, #4b64ff);
|
|
648
|
+
}
|
|
649
|
+
a:link:hover {
|
|
650
|
+
text-decoration: underline;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
#container.loading {
|
|
654
|
+
opacity: 0.5;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
#container.managing {
|
|
658
|
+
opacity: 0.3;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
.histogram-loading-indicator {
|
|
662
|
+
width: 100%;
|
|
663
|
+
height: 5.25rem;
|
|
664
|
+
margin-top: 1.75rem;
|
|
665
|
+
font-size: 1.4rem;
|
|
666
|
+
text-align: center;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
.collapser {
|
|
670
|
+
display: inline-block;
|
|
671
|
+
cursor: pointer;
|
|
672
|
+
width: 10px;
|
|
673
|
+
height: 10px;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
.collapser svg {
|
|
677
|
+
transition: transform 0.2s ease-in-out;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
.collapser.open svg {
|
|
681
|
+
transform: rotate(90deg);
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
.facet-group {
|
|
685
|
+
margin-bottom: 2rem;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
.facet-group h3 {
|
|
689
|
+
margin-bottom: 0.7rem;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
.facet-group.mobile h3 {
|
|
693
|
+
cursor: pointer;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
.facet-group-header {
|
|
697
|
+
display: flex;
|
|
698
|
+
margin-bottom: 0.7rem;
|
|
699
|
+
justify-content: space-between;
|
|
700
|
+
border-bottom: 1px solid rgb(232, 232, 232);
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
.facet-group-content {
|
|
704
|
+
transition: max-height 0.2s ease-in-out;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
.facet-group.mobile .facet-group-content {
|
|
708
|
+
max-height: 0;
|
|
709
|
+
overflow: hidden;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
.facet-group.mobile .facet-group-content.open {
|
|
713
|
+
max-height: 2000px;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
.partof-collections ul {
|
|
717
|
+
list-style-type: none;
|
|
718
|
+
padding: 0;
|
|
719
|
+
font-size: 1.2rem;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
h3 {
|
|
723
|
+
font-size: 1.4rem;
|
|
724
|
+
margin: 0;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
.more-link {
|
|
728
|
+
font-size: 1.2rem;
|
|
729
|
+
text-decoration: none;
|
|
730
|
+
padding: 0;
|
|
731
|
+
margin-top: 0.25rem;
|
|
732
|
+
background: inherit;
|
|
733
|
+
border: 0;
|
|
734
|
+
color: var(--ia-theme-link-color, #4b64ff);
|
|
735
|
+
cursor: pointer;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
#date-picker-label {
|
|
739
|
+
display: flex;
|
|
740
|
+
justify-content: space-between;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
.expand-date-picker-btn {
|
|
744
|
+
margin: 0;
|
|
745
|
+
padding: 0;
|
|
746
|
+
border: 0;
|
|
747
|
+
appearance: none;
|
|
748
|
+
background: none;
|
|
749
|
+
cursor: pointer;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
.expand-date-picker-btn svg {
|
|
753
|
+
width: 14px;
|
|
754
|
+
height: 14px;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
.sorting-icon {
|
|
758
|
+
height: 15px;
|
|
759
|
+
cursor: pointer;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
histogram-date-range.wide-inputs {
|
|
763
|
+
--histogramDateRangeInputWidth: 4.8rem;
|
|
764
|
+
}
|
|
765
765
|
`,
|
|
766
766
|
];
|
|
767
767
|
}
|